refactor(blockchain): drop SyncStatusTracker::gate_proposer#449
Conversation
f9d9603 to
f8d6ec2
Compare
🤖 Kimi Code ReviewOverall Assessment: This is a clean refactoring that removes unnecessary abstraction without changing behavior. No security or correctness issues introduced. Detailed Feedback:
Consensus Safety Check:
Minor Style Note:
Verdict: LGTM. The refactoring reduces API surface area and improves code clarity. Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
🤖 Claude Code ReviewHere is my review of PR #449: PR #449:
|
🤖 Codex Code ReviewNo findings.
I could not run the targeted Rust tests in this environment: Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
gate_proposer was a one-line wrapper over duties_allowed() with a single call site. Inline it at the call site as scheduled_proposer.filter(|_| duties_allowed()) and drop the method, so the sync gate is expressed the same way everywhere. Behavior unchanged. Its three dedicated tests asserted duties_allowed() alongside the removed method; since duties_allowed() is just !syncing and the update()-based tests already cover that bit, they were duplicates and are removed.
f8d6ec2 to
9e43879
Compare
Split out of #445 (proposer pre-build). **Stacked on #449** (`gate_proposer` removal) — review/merge that first; this PR's base retargets to `main` once #449 lands. `on_tick` ran its per-interval blocks out of order (interval-4 snapshot, then tick, then 2, 0, 1). This regroups them into ascending interval order behind `==== interval N ====` markers so the slot timeline reads top-to-bottom and lines up with the duty schedule. **Pure reorder, behavior unchanged.** ### One block intentionally does *not* move The interval-4 `new_payloads` snapshot stays **ahead** of `store::on_tick`. At interval 4 the tick runs `accept_new_attestations → promote_new_aggregated_payloads()`, which drains `new_payloads`; snapshotting after the tick would capture an already-drained set and silently break the post-block coverage report's "timely" cohort. A comment now pins that ordering constraint. > Note: commit `7474c15` on #445 currently moves this snapshot *into* the post-tick interval-4 group, which hits exactly that regression (observability-only, so devnet doesn't surface it). #445 should adopt this PR's placement when it rebases.
main (#447/#449/#450) merged cleanly textually, but the simple BFT finality condition removed slot_is_justifiable_after, which main's block_builder and store still called. Reconciled those call sites to the new model (every slot justifiable; finalize only on consecutive source+1 == target): - store::get_attestation_target_with_checkpoints: drop the justifiability walk-back (now a no-op); finalized arg unused, kept as _finalized. - block_builder: drop the target_not_justifiable rejection; the finalizes predicate now checks source.slot + 1 == target.slot.
Split out of #445 (proposer pre-build).
gate_proposerwas a one-line wrapper overduties_allowed()with a single call site. This inlines it asscheduled_proposer.filter(|_| self.sync_status.duties_allowed())and removes the method, so the sync gate reads the same way everywhere.Behavior-preserving —
proposer_validator_idis computed identically; every downstream use (the skip-while-syncing log, thestore::on_tickproposal flag, the proposal call) is untouched.The three
gate_proposer-only unit tests collapse onto theduties_allowed()assertions they already made.Stacked under the on_tick-regrouping PR; #445 will drop these hunks once both land.