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(aggregation): cap aggregation at one job before our proposal (#544)
## Motivation
At interval 2 the aggregation worker runs up to `MAX_AGGREGATION_JOBS`
leanVM proofs. When interval 4 of the *same* slot builds the next slot's
block, that build runs its own proofs — so the two compete for the
prover, and the build is the one with a hard deadline (it has to publish
at the next slot's interval-0 tick).
## Change
`start_aggregation_session` drops the session to a single job whenever
one of our validators proposes the next slot:
```rust
let next_proposer = self
.get_our_proposer(slot + 1)
.filter(|_| self.sync_status.duties_allowed());
let max_jobs = if next_proposer.is_some() {
1
} else {
MAX_AGGREGATION_JOBS
};
```
- **Condition mirrors the propose path** (`SlotInterval::EndOfSlot`):
proposer *and* `duties_allowed()`. A slot where duties are
sync-suppressed keeps the full job budget, since no build will happen.
- **Covers both entry points.** The cap is computed inside
`start_aggregation_session`, so it applies to the interval-2 tick *and*
the early 2/3-threshold trigger. The early session *is* the slot's
session, so exempting it would defeat the change.
- **The retained job is the best-scoring candidate.**
`snapshot_aggregation_inputs` gained a `max_jobs` parameter that bounds
the greedy selection loop; the pool is unchanged (`groups_considered`
still counts every candidate), so the one job we run is the same one the
uncapped selection picks first.
- **`MAX_AGGREGATION_JOBS` lowered 3 → 2**, trimming baseline prover
work per session too.
Unchanged: `AGGREGATION_DEADLINE`, the early-trigger threshold, and the
worker loop.
## Tests
- Existing `snapshot_caps_jobs_at_max_aggregation_jobs` refactored to
share a store fixture with a new
`snapshot_caps_jobs_at_one_for_proposer`, which asserts the proposer cap
yields exactly one job and that it is the top-scoring candidate (not an
arbitrary one).
- `make lint` clean, `cargo test --workspace --release` green (122
fork-choice spec, 119 STF, all unit tests).
0 commit comments