Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(starknet_consensus_manager): add proposal init into validate proposal input #2408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArniStarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 74.07407% with 7 lines in your changes missing coverage. Please review.

Project coverage is 32.26%. Comparing base (e3165c4) to head (79d57f2).
Report is 809 commits behind head on main.

Files with missing lines Patch % Lines
...nsus_orchestrator/src/papyrus_consensus_context.rs 53.33% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2408      +/-   ##
==========================================
- Coverage   40.10%   32.26%   -7.85%     
==========================================
  Files          26      119      +93     
  Lines        1895    14085   +12190     
  Branches     1895    14085   +12190     
==========================================
+ Hits          760     4544    +3784     
- Misses       1100     8989    +7889     
- Partials       35      552     +517     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArniStarkware ArniStarkware force-pushed the arni/batcher/block_builder_factory/set_propser_address_in_build_block_input branch from 0dc1db4 to 9c9aa6c Compare December 2, 2024 15:05
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from ce0120e to 73a6ac4 Compare December 2, 2024 15:07
@ArniStarkware ArniStarkware force-pushed the arni/batcher/block_builder_factory/set_propser_address_in_build_block_input branch 2 times, most recently from e104f26 to b6a3940 Compare December 3, 2024 10:59
@ArniStarkware ArniStarkware force-pushed the arni/batcher/block_builder_factory/set_propser_address_in_build_block_input branch 3 times, most recently from 38d7da8 to c2fba98 Compare December 3, 2024 14:15
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 73a6ac4 to df7d345 Compare December 3, 2024 14:15
@ArniStarkware ArniStarkware changed the base branch from arni/batcher/block_builder_factory/set_propser_address_in_build_block_input to graphite-base/2408 December 3, 2024 14:46
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from df7d345 to 17966b1 Compare December 3, 2024 14:50
@ArniStarkware ArniStarkware changed the base branch from graphite-base/2408 to main December 3, 2024 14:50
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch 2 times, most recently from 3b7032c to 5bd0bcd Compare December 3, 2024 15:18
@ArniStarkware ArniStarkware changed the base branch from main to arni/consensus/validator_id/non_zero December 3, 2024 15:19
Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 9 of 11 files reviewed, 1 unresolved discussion (waiting on @alonh5 and @matan-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context_test.rs line 75 at r1 (raw file):

Previously, matan-starkware wrote…
  1. Let's avoid ValidatorId::default() since this is 0 which is an illegal address.
  2. Don't set valid_round explicitly because: (a) validate_proposal doesn't care about the field, (b) we'll add signature field soon which also should be ignored and default makes that seamless.

Please do this for all tests

I did that for all the tests I added in this PR.
Done.

@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch 4 times, most recently from 6e9ff88 to 7747db5 Compare December 9, 2024 08:58
@ArniStarkware
Copy link
Contributor Author

crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context_test.rs line 75 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

I did that for all the tests I added in this PR.
Done.

Also, it is based on the change to the validator ID.

@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 7747db5 to 514e2e7 Compare December 9, 2024 09:04
@ArniStarkware ArniStarkware changed the base branch from main to arni/consensus/non_zero_validator_id/tests December 9, 2024 09:04
Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 11 files at r1, 9 of 9 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @matan-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs line 184 at r3 (raw file):

                // the block in storage and to getting the transaction was a revert
                // this flow will fail.
                wait_for_block(&storage_reader, proposal_init.height)

Maybe it's worth adding let height = proposal_init.height?

Code quote:

proposal_init.height

@ArniStarkware ArniStarkware force-pushed the arni/consensus/non_zero_validator_id/tests branch from b15b075 to 2101554 Compare December 9, 2024 11:13
@ArniStarkware ArniStarkware requested a review from alonh5 December 9, 2024 11:21
Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5 and @matan-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs line 184 at r3 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Maybe it's worth adding let height = proposal_init.height?

This is consistent with how this variable is handled in a similar function in this file:build_proposal

@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 514e2e7 to ca6a7be Compare December 9, 2024 11:21
@ArniStarkware ArniStarkware changed the base branch from arni/consensus/non_zero_validator_id/tests to graphite-base/2408 December 9, 2024 14:56
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from ca6a7be to 12b8a52 Compare December 9, 2024 15:16
@ArniStarkware ArniStarkware changed the base branch from graphite-base/2408 to main December 9, 2024 15:17
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 12b8a52 to e4c5d31 Compare December 9, 2024 15:17
Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @matan-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs line 184 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

This is consistent with how this variable is handled in a similar function in this file:build_proposal

I didn't understand your response. I'm saying proposal_init.height is used like 7 times in this function so it's probably defining a shorter variable name for it. Same goes for build_proposal in that case.

@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from e4c5d31 to 11d8683 Compare December 10, 2024 12:49
@ArniStarkware ArniStarkware requested a review from alonh5 December 10, 2024 14:16
Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 10 of 11 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @matan-starkware)


crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context.rs line 184 at r3 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

I didn't understand your response. I'm saying proposal_init.height is used like 7 times in this function so it's probably defining a shorter variable name for it. Same goes for build_proposal in that case.

Done.

@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 11d8683 to 79d57f2 Compare December 10, 2024 14:16
@ArniStarkware ArniStarkware marked this pull request as ready for review December 10, 2024 14:17
@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 79d57f2 to 5faeb90 Compare December 15, 2024 09:00
Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 5 of 5 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matan-starkware)

@ArniStarkware ArniStarkware force-pushed the arni/consensus/simplify_validate_proposal_input branch from 5faeb90 to e460a61 Compare December 16, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants