You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(starfish): evict pending commit votes via quorum commit index (#11392)
# Description of change
Bounds the in-memory `pending_commit_votes` tracker in `DagState` and
tightens the proposal skip paths in `Core`.
### Eviction (issue #11391)
- Switch `pending_commit_votes` from `VecDeque<CommitVote>` to
`BTreeSet<CommitVote>` so eviction uses `split_off`. Insertion order is
preserved (the linearizer produces commits monotonically); insertion
dedup is a free side benefit.
- New field on `DagState`: `last_known_quorum_commit_index: CommitIndex`
(no `Arc<CommitVoteMonitor>` reference). `Core` is the sole holder of
the monitor and pushes the value via a setter.
- `evict_pending_commit_votes()` drops votes with `index <=
last_known_quorum_commit_index - gc_depth`. Gated on
`consensus_block_restrictions`; no-op otherwise.
- Eviction is called both from `take_commit_votes` (proposal path) and
from `flush()` (mirrors the existing `pending_acknowledgments` pattern).
- `Core` refreshes `DagState::last_known_quorum_commit_index` from
`CommitVoteMonitor::quorum_commit_index()` at three places:
`Core::try_commit` after every successful
`commit_observer.handle_committed_leaders` (regular consensus path);
`Core::handle_committed_sub_dags_from_fast_sync` (fast-sync path);
`Core::should_propose` (right before we propose).
### `should_propose` cleanup (issue #11400)
- Centralised every skip reason behind a new `SkipProposalReason` enum +
`skip_proposal` helper, so the `core_skipped_proposals` metric label
space is disjoint and visible in one place.
- New skip reason `behind_quorum_commit_round` — the
`consensus_block_restrictions` gate (formerly inside `try_new_block`)
moves up to `should_propose`.
- The `clock_round <= last_proposed_round` recheck moves up too. It is
silent (no metric, no debug log) since it fires on every accepted block
in a round we have already proposed in — counting it would drown the
genuinely interesting reasons.
- `try_new_block` now reads `clock_round` only; all gates are upstream.
## Links to any relevant issues
Fixes#11391Fixes#11400
## How the change has been tested
- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] New unit test `dag_state::test::test_evict_pending_commit_votes`
covering: quorum-driven eviction with the flag on; default-field no-op
(no setter call); flag-off no-op even with a non-zero field
- [x] Existing 280 starfish-core lib tests still pass
- [x] `cargo ci-clippy` clean across the workspace
- [ ] Patch-specific tests (correctness, functionality coverage)
0 commit comments