Commit 29cf4d9
authored
feat: Handle multiple blocks per slot in validators (#19240)
## Summary
Implements Multiple Blocks Per Slot (MBPS) consensus model where
validators attest to checkpoints (aggregations of blocks) instead of
individual blocks. This is a foundational change for improving L2
throughput by allowing multiple blocks to be built within a single L1
slot.
## Key Changes
### New Consensus Types
- **CheckpointAttestation**: Validators sign checkpoint payloads (header
+ archive) instead of individual blocks
- **CheckpointProposal**: Proposers broadcast checkpoint proposals
containing the last block and aggregated checkpoint header
- **BlockAttestation deleted**: Fully replaced by CheckpointAttestation
- no traces remain in active code paths
### Validator Behavior
- Validators now call `attestToCheckpointProposal()` instead of
`attestToProposal()`
- Checkpoint number is derived from parent block's checkpoint info, not
computed from block number
- Block comparison during re-execution validates full struct (header +
archive), not just archive root
- Validators use `FullNodeCheckpointsBuilder` instead of block builder,
enabling multi-block checkpoint re-execution and validation
### P2P Layer
- New gossip topics: `checkpoint_proposal`, `checkpoint_attestation`
- Removed `block_attestation` topic handling
- Attestation pool interface simplified to only handle checkpoint
attestations
- Proposal validators consolidated into shared `proposal_validator/`
directory
### Packages Modified
- **stdlib**: New `CheckpointAttestation`, `CheckpointProposal` classes;
deleted `BlockAttestation`
- **p2p**: Updated pool, validators, libp2p service, encoding
- **validator-client**: Updated attestation creation and block handling
- **sequencer-client**: Fixed checkpoint number computation
- **end-to-end**: Added MBPS-specific e2e tests
## New E2E Tests
**These are pending review**
- `epochs_multiple_blocks_per_slot.test.ts`: Single sequencer with mock
gossip
- `mbps_checkpoint_consensus.test.ts`: Multi-validator with real P2P
networking
## Commits
This PR is split into multiple commits for easier review. Note that
intermediate commits may not build.
🤖 Generated with [Claude Code](https://claude.com/claude-code)File tree
135 files changed
+5347
-2425
lines changed- yarn-project
- .claude
- rules
- archiver
- src
- archiver
- kv_archiver_store
- l1
- test
- aztec-node/src
- aztec-node
- sentinel
- end-to-end/src
- composed/web3signer
- e2e_epochs
- e2e_l1_publisher
- e2e_multi_validator
- e2e_p2p
- epoch-cache/src
- foundation/src/branded-types
- p2p/src
- client
- test
- mem_pools/attestation_pool
- msg_validators
- attestation_validator
- block_proposal_validator
- proposal_validator
- services
- libp2p
- testbench
- prover-client/src/light
- sequencer-client/src
- client
- publisher
- sequencer
- test
- slasher/src/watchers
- stdlib/src
- block
- l2_block_stream
- checkpoint
- interfaces
- p2p
- rollup
- tests
- telemetry-client/src
- txe/src/state_machine
- validator-client
- src
- duties
- tx_validator
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
135 files changed
+5347
-2425
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
177 | 201 | | |
178 | 202 | | |
179 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
198 | 211 | | |
199 | 212 | | |
200 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
513 | | - | |
514 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
588 | | - | |
| 587 | + | |
| 588 | + | |
589 | 589 | | |
590 | | - | |
| 590 | + | |
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
619 | | - | |
| 618 | + | |
| 619 | + | |
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
641 | | - | |
| 640 | + | |
| 641 | + | |
642 | 642 | | |
643 | | - | |
644 | | - | |
| 643 | + | |
| 644 | + | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
| 651 | + | |
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
| 657 | + | |
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| |||
2441 | 2441 | | |
2442 | 2442 | | |
2443 | 2443 | | |
2444 | | - | |
| 2444 | + | |
2445 | 2445 | | |
2446 | 2446 | | |
2447 | 2447 | | |
| |||
0 commit comments