-
Notifications
You must be signed in to change notification settings - Fork 32
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
chore(starknet_consensus_manager): add proposal init into validate proposal input #2408
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
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. |
0dc1db4
to
9c9aa6c
Compare
ce0120e
to
73a6ac4
Compare
e104f26
to
b6a3940
Compare
38d7da8
to
c2fba98
Compare
73a6ac4
to
df7d345
Compare
c2fba98
to
4fab329
Compare
df7d345
to
17966b1
Compare
3b7032c
to
5bd0bcd
Compare
ca6a7be
to
12b8a52
Compare
2101554
to
419b2b3
Compare
12b8a52
to
e4c5d31
Compare
There was a problem hiding this 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.
e4c5d31
to
11d8683
Compare
There was a problem hiding this 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 forbuild_proposal
in that case.
Done.
11d8683
to
79d57f2
Compare
79d57f2
to
5faeb90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matan-starkware)
5faeb90
to
e460a61
Compare
There was a problem hiding this 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 r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @matan-starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @matan-starkware from a discussion.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @matan-starkware)
There was a problem hiding this 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, 1 unresolved discussion (waiting on @ArniStarkware and @matan-starkware)
a discussion (no related file):
Make sure with @matan-starkware if he wants this or not, and then merge or close accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 9 files at r3, 1 of 2 files at r4, 4 of 5 files at r5, 2 of 2 files at r6, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ArniStarkware)
crates/sequencing/papyrus_consensus_orchestrator/src/papyrus_consensus_context_test.rs
line 75 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Also, it is based on the change to the validator ID.
Can you explicitly define Default for ProposalInit
and that can have DEFAULT_VALIDATOR_ID
. I think that will make usage easier.
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 205 at r6 (raw file):
proposer: ValidatorId::from(DEFAULT_VALIDATOR_ID), ..Default::default() },
If you don't care about the field's specifics.
Suggestion:
ProposalInit::default(),
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 348 at r6 (raw file):
content_receiver, ) .await;
Let's refactor to highlight the round change.
Suggestion:
let mut init = ProposalInit {
round: 0,
..Default::default()
};
let fin_receiver_past_round =
context.validate_proposal(init.clone(), TIMEOUT, content_receiver).await;
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 367 at r6 (raw file):
content_receiver, ) .await;
and for round 2.
Suggestion:
init.round = 1;
let fin_receiver_curr_round =
context.validate_proposal(init.clone(), TIMEOUT, content_receiver).await;
e460a61
to
a57aead
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 12 files reviewed, 4 unresolved discussions (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…
Can you explicitly define
Default for ProposalInit
and that can haveDEFAULT_VALIDATOR_ID
. I think that will make usage easier.
Done.
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 205 at r6 (raw file):
Previously, matan-starkware wrote…
If you don't care about the field's specifics.
Done. Throughout the code.
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 348 at r6 (raw file):
Previously, matan-starkware wrote…
Let's refactor to highlight the round change.
Done.
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 367 at r6 (raw file):
Previously, matan-starkware wrote…
and for round 2.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 12 files reviewed, 4 unresolved discussions (waiting on @alonh5 and @matan-starkware)
crates/papyrus_protobuf/src/consensus.rs
line 81 at r7 (raw file):
round: Default::default(), valid_round: Default::default(), // TODO(Arni): Use DEFAULT_VALIDATOR_ID instead of 100.
Done. #2812.
Code quote:
// TODO(Arni): Use DEFAULT_VALIDATOR_ID instead of 100.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @ArniStarkware)
crates/papyrus_protobuf/src/consensus.rs
line 83 at r7 (raw file):
// TODO(Arni): Use DEFAULT_VALIDATOR_ID instead of 100. proposer: ContractAddress::from(100_u64), }
Suggestion:
fn default() -> Self {
ProposalInit {
// TODO(Arni): Use DEFAULT_VALIDATOR_ID instead of 100.
proposer: ContractAddress::from(100_u64),
..Default::default(),
}
There was a problem hiding this 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, 1 unresolved discussion (waiting on @alonh5 and @ArniStarkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @alonh5)
crates/papyrus_protobuf/src/consensus.rs
line 83 at r7 (raw file):
// TODO(Arni): Use DEFAULT_VALIDATOR_ID instead of 100. proposer: ContractAddress::from(100_u64), }
warning: function cannot return without recursing
This is because we are now defining default, so we can not use default to define it.
I suspect your suggestion does not even work.
No description provided.