apollo_consensus_orchestrator: introduce BTreeMap-keyed SNIP-35 fee_proposals window#14083
Conversation
PR SummaryMedium Risk Overview Adds deterministic window maintenance: bootstrapping from state sync now records entries by height, window pruning is performed on each new height via a Reviewed by Cursor Bugbot for commit a6145b3. Bugbot is set up for automated code reviews on this repo. Configure here. |
0bc637c to
f9ec526
Compare
matanl-starkware
left a comment
There was a problem hiding this comment.
@matanl-starkware reviewed 1 file and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ShahakShama and sirandreww-starkware).
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
u64::try_from(FEE_PROPOSAL_WINDOW_SIZE).expect("FEE_PROPOSAL_WINDOW_SIZE fits in u64"); let cutoff = BlockNumber(current_height.0.saturating_sub(window_size)); self.fee_proposals_window = self.fee_proposals_window.split_off(&cutoff);
Please add some tests to verify only what you wanted is left in the tree after the split.
Code quote:
self.fee_proposals_window.split_off(&cutoff);crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 332 at r2 (raw file):
"SNIP-35 bootstrap failed at block {h}: {e:?}. Window has {} / \ {FEE_PROPOSAL_WINDOW_SIZE} entries.", self.fee_proposals_window.len()
Consider fixing this, to count only non-None entries
Code quote:
self.fee_proposals_window.len()|
Previously, matanl-starkware (Matan Lior) wrote…
IMO you shouldn't fix this. None entry is a valid entry for a 0.14.2 block |
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on matanl-starkware and sirandreww-starkware).
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
u64::try_from(FEE_PROPOSAL_WINDOW_SIZE).expect("FEE_PROPOSAL_WINDOW_SIZE fits in u64"); let cutoff = BlockNumber(current_height.0.saturating_sub(window_size)); self.fee_proposals_window = self.fee_proposals_window.split_off(&cutoff);
Please add a comment stating if split_off is inclusive or exclusive (and explain the meaning of inclusive/exclusive 😅 )
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on matanl-starkware and sirandreww-starkware).
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
Previously, matanl-starkware (Matan Lior) wrote…
Please add some tests to verify only what you wanted is left in the tree after the split.
+1
f9ec526 to
0d8de9c
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 3 comments.
Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on matanl-starkware and ShahakShama).
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
Previously, ShahakShama wrote…
+1
Done.
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
Previously, ShahakShama wrote…
Please add a comment stating if split_off is inclusive or exclusive (and explain the meaning of inclusive/exclusive 😅 )
Done.
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 332 at r2 (raw file):
Previously, ShahakShama wrote…
IMO you shouldn't fix this. None entry is a valid entry for a 0.14.2 block
Correct, this function is removed entirely in the next PR anyway
0d8de9c to
441da6b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 441da6b. Configure here.
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on matanl-starkware and sirandreww-starkware).
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
Done.
This is good, but what I meant is to have a code comment that "copies and summarizes" the documentation of split_off from std
441da6b to
a6145b3
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 2 comments and resolved 1 discussion.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on matanl-starkware and ShahakShama).
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 302 at r2 (raw file):
Previously, ShahakShama wrote…
This is good, but what I meant is to have a code comment that "copies and summarizes" the documentation of split_off from std
I think Done?
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on matanl-starkware).
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on matanl-starkware).
matanl-starkware
left a comment
There was a problem hiding this comment.
@matanl-starkware partially reviewed 2 files and all commit messages, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).


No description provided.