feat(crypto)!: track leanVM main (internalized XMSS + reworked aggregation)#539
feat(crypto)!: track leanVM main (internalized XMSS + reworked aggregation)#539MegaRedHand wants to merge 3 commits into
Conversation
…ation)
Point the leanVM dependency at `main`. leanVM's `main` ("Xmss api rework")
removed the `lean-multisig` and `leansig_wrapper` crates ethlambda imported,
internalized XMSS in its own `xmss` crate (dropping the external leanSig
dependency), and reworked the recursive-aggregation API. Tracking main is
therefore a migration of the whole signature stack, not a version bump.
Changes:
- Cargo: replace `leansig`/`lean-multisig`/`leansig_wrapper` with `xmss` +
`rec_aggregation` (git, branch=main), plus `ssz` (ethereum_ssz, used by the
xmss SSZ impls) and `postcard` (secret-key format).
- types::signature: rebuild ValidatorPublicKey/Signature/SecretKey on leanVM's
`xmss` crate. Keys/signatures (de)serialize via SSZ (`PUB_KEY_SSZ_LEN` /
`SIGNATURE_SSZ_LEN`); secret keys via postcard. `SIGNATURE_SIZE` and the new
`PUBLIC_KEY_SIZE` are sourced from the xmss scheme constants. The sliding
preparation-window API becomes a fixed activation range (`advance_preparation`
is now a no-op; keys warm their signing cache on demand).
- crypto: rewrite aggregation/verification against `rec_aggregation`. Proofs now
serialize with `to_bytes()`/`from_bytes()` and embed participant pubkeys, so
the verify paths cross-check the embedded set against the expected validators
instead of attaching them at decode time. `setup_prover`/`setup_verifier` are
replaced by the idempotent `init_aggregation_bytecode`.
- Validator public keys are now 32 bytes (was 52); genesis/state layouts and
fixtures updated accordingly.
BREAKING: this changes the on-wire signature/proof formats and the genesis key
format. It is interop-incompatible with clients still on the previous scheme and
requires regenerated genesis keys; the fixture-driven spec tests need
regenerated fixtures. Landing this needs ecosystem coordination.
🤖 Kimi Code ReviewSecurity & Correctness
Performance & Memory
Code Quality & Maintainability
Testing
Summary The migration from the external Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
Greptile SummaryMigrates the validator signature stack to leanVM’s internal XMSS and recursive-aggregation APIs.
Confidence Score: 5/5The PR appears safe to merge from the reviewed code paths, with no concrete changed-code defect identified. Verification still binds each aggregate component to its expected message, slot, and validator key set, while the storage and consensus layouts are consistently migrated to the new XMSS encoding.
|
| Filename | Overview |
|---|---|
| crates/common/crypto/src/lib.rs | Migrates aggregation, verification, serialization, and proof splitting to rec_aggregation while binding embedded public-key sets to caller expectations. |
| crates/common/types/src/signature.rs | Rebuilds validator key and signature wrappers around leanVM XMSS with SSZ wire encoding and postcard secret-key persistence. |
| crates/common/types/src/state.rs | Changes validator public-key fields to the new 32-byte XMSS encoding, thereby updating the consensus state layout. |
| crates/common/types/src/attestation.rs | Updates the fixed XMSS signature representation and simplifies the structurally valid blank-signature construction. |
| crates/blockchain/src/reaggregate.rs | Adapts block-proof splitting to proofs that carry their participant public keys internally. |
| Cargo.toml | Replaces the removed leanSig and lean-multisig dependencies with leanVM XMSS, recursive aggregation, SSZ, and postcard dependencies. |
Sequence Diagram
sequenceDiagram
participant Validator
participant XMSS
participant Aggregator
participant Block
participant Verifier
Validator->>XMSS: Sign message at slot
XMSS-->>Aggregator: SSZ signature + public key
Aggregator->>Aggregator: Build Type-1 proof with embedded keys
Aggregator->>Block: Merge Type-1 proofs into Type-2 proof
Block->>Verifier: Block, aggregation bits, embedded-key proof
Verifier->>Verifier: Derive expected keys from validator state
Verifier->>Verifier: Cross-check messages, slots, and key sets
Verifier->>Verifier: Verify recursive aggregate proof
Reviews (1): Last reviewed commit: "feat(crypto)!: track leanVM main (intern..." | Re-trigger Greptile
🤖 Codex Code Review
Aside from that, the signature/aggregation migration looks internally consistent: the proof-verification paths now bind embedded pubkeys back to the expected validator sets, and the reaggregation path still sits behind full block-proof verification. I couldn’t run Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
…e branch Tracking `branch = main` re-resolves on every fetch, so the build could change under us. Pin the current main HEAD for reproducibility; the comment notes it is main's tip and the rev can be bumped to move forward.
What
Points the leanVM dependency at the
mainbranch, as requested.leanVM's
main("Xmss api rework") removed thelean-multisigandleansig_wrappercrates ethlambda imported, internalized XMSS in its ownxmsscrate (dropping the external leanSig dependency), and reworked the recursive-aggregation API. So trackingmainis a migration of the whole signature stack, not a version bump —cargo updatefails outright (no matching package named leansig_wrapper).Changes
rev e2592df)main)lean-multisig,leansig_wrapper,leansig(devnet4)rec_aggregation,xmss+ssz(ethereum_ssz),postcardxmsscratecompress_without_pubkeys(), pubkeys attached at decodeto_bytes()/from_bytes()(postcard), pubkeys embeddedPUB_KEY_SSZ_LEN)setup_prover/setup_verifierinit_aggregation_bytecodeadvance_preparationis now a no-op)types::signature: rebuiltValidatorPublicKey/ValidatorSignature/ValidatorSecretKeyonxmss. Pubkeys/sigs (de)serialize via SSZ; secret keys via postcard.SIGNATURE_SIZE+ newPUBLIC_KEY_SIZEcome from the scheme constants. AddedValidatorSecretKey::public_key()(now that xmss exposes it).crypto: rewired aggregation/verification againstrec_aggregation. Since proofs now embed participant pubkeys, the verify paths cross-check the embedded set against the caller's expected validators instead of attaching pubkeys at decode.split_type_2_by_messagedrops its now-redundant pubkey parameter.Validation
cargo build/check --workspace --all-targetsmake lint(clippy-D warnings)#[ignore](leanVM proving needs a release-sized stack;init_aggregation_bytecodeoverflows the debug stack).This changes the on-wire signature/proof formats and the genesis key format:
lean-quickstart).Landing this needs ecosystem coordination; it is not a drop-in for the live devnet.