Commit 8ee2c79
feat: add devnet 5 support (#378)
## 🗒️ Description / Motivation
Adds support for the `pq-devnet-5` spec, whose headline feature is the
new two-tier signature aggregation scheme from [leanSpec PR
#717](leanEthereum/leanSpec#717):
per-attestation **Type-1** multi-signatures that get merged into a
single block-level **Type-2** proof. Instead of a block carrying one
aggregated proof per attestation plus a proposer signature, a
`SignedBlock` now carries a single merged proof binding every signature
it depends on.
Closes #285.
## What Changed
**Wire format / types** (`crates/common/types`)
- `SignedBlock.signature: BlockSignatures` → `SignedBlock.proof:
ByteList512KiB`, an SSZ-encoded `TypeTwoMultiSignature` envelope.
Helpers `merged_proof_bytes()` / `wrap_merged_proof()` handle the 4-byte
SSZ offset header.
- `AggregatedSignatureProof` is replaced by `TypeOneMultiSignature`
(flat container per leanSpec PR #717). `BlockSignatures` and
`AttestationSignatures` are gone.
**Crypto** (`crates/common/crypto`)
- New leanVM operations: `merge_type_1s_into_type_2` (block building),
`verify_type_2_signature` (block import), and `split_type_2_by_message`
(recovering per-attestation Type-1 proofs from a merged proof).
**Blockchain**
- Block builder produces the merged Type-2 proof from the pooled Type-1
proofs; block import verifies it.
- New `reaggregate.rs` module ports leanSpec's
`SyncService._deconstruct_block_into_store`: after importing a block, it
SNARK-splits the merged proof back into per-attestation Type-1 proofs
and folds them into the local aggregated-payload pool, so block-borne
votes can be republished on gossip. Splits are bounded (only when in
sync, skip already-justified targets, skip participant subsets, max
`MAX_REAGGREGATIONS_PER_BLOCK` splits per block) since each split runs a
fresh SNARK.
- `process_block` now reports whether the block was newly imported, so
reaggregation only runs once per block.
**Storage**
- `BlockSignatures` table now stores the raw proof envelope; the
`AggregatedPayloads` table stores `TypeOneMultiSignature`s. Genesis
blocks simply have no proof entry (the placeholder
`empty_block_signatures` is gone).
**Dependencies / CI**
- leanSpec pin bumped to `30ffb6c` (2026-06-03), leanVM to `e2592df`,
`leansig` pinned to its `devnet4` branch.
- CI fixture generation runs with `-n 1`: the devnet5 prover peaks at
~12 GiB per proof, so parallel provers OOM the 16 GiB runner. The
fixtures cache is now only saved when generation actually succeeds,
preventing a cancelled run from poisoning the cache with an empty
fixture set.
- Removed the curl+tar key-download workaround (the new pin is past
leanSpec PR #745).
## Correctness / Behavior Guarantees
- The on-chain block root is unchanged by proof serialization: consumers
always hash the inner `Block`, never the `SignedBlock` envelope.
- Block import rejects blocks whose merged Type-2 proof does not verify
against the block's attestations and proposer key.
- Reaggregation never floods gossip: it is skipped while syncing, and
the per-block SNARK-split budget is capped.
## Tests Added / Run
- Fork choice, signature, STF, and SSZ spec tests adapted to the devnet5
fixture format (fixtures regenerated from the new leanSpec pin).
- New unit tests for the proof envelope helpers and reaggregation
bounds.
- `make fmt` / `make lint` clean (CI Lint is green). The CI Test job
regenerates devnet5 fixtures (~2.5 h single-prover) before running the
suite.
## Related Issues / PRs
- Closes #285
- Spec reference: [leanSpec PR
#717](leanEthereum/leanSpec#717) (Type-1/Type-2
aggregation wire format)
## ✅ Verification Checklist
- [x] Ran `make fmt` — clean
- [x] Ran `make lint` (clippy with `-D warnings`) — clean
- [ ] Ran `cargo test --workspace --release` — CI Test job in progress
(devnet5 fixture generation takes ~2.5 h)
---------
Co-authored-by: Pablo Deymonnaz <pdeymon@fi.uba.ar>
Co-authored-by: Blessing Samuel <dicethedev@gmail.com>1 parent df8020b commit 8ee2c79
29 files changed
Lines changed: 1502 additions & 920 deletions
File tree
- .github/workflows
- bin/ethlambda/src
- crates
- blockchain
- src
- tests
- common
- crypto
- src
- test-fixtures
- src
- types
- src
- tests
- net
- p2p/src/req_resp
- rpc
- src
- tests
- storage/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 101 | | |
108 | 102 | | |
109 | 103 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 104 | + | |
116 | 105 | | |
117 | 106 | | |
118 | 107 | | |
| |||
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
131 | 126 | | |
| 127 | + | |
132 | 128 | | |
133 | 129 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments