Devnet4 Phase 2: dual-key KeyManager and block proposal flow#231
Devnet4 Phase 2: dual-key KeyManager and block proposal flow#231pablodeymo wants to merge 2 commits intodevnet4from
Conversation
Introduce the devnet4 type-level changes:
- Validator: single pubkey → attestation_pubkey + proposal_pubkey with
get_attestation_pubkey() and get_proposal_pubkey() methods
- SignedBlockWithAttestation → SignedBlock (message is Block directly)
- Delete BlockWithAttestation and BlockSignaturesWithAttestation wrappers
- Genesis config: GENESIS_VALIDATORS changes from list of hex strings to
list of {attestation_pubkey, proposal_pubkey} objects
- Test fixtures: Validator deserialization updated for dual pubkeys
NOTE: This is SSZ-breaking. Downstream crates will not compile until
subsequent phases update all call sites.
- KeyManager: introduce ValidatorKeyPair with attestation_key + proposal_key - sign_attestation() routes to attestation key, new sign_block_root() uses proposal key - propose_block(): sign block root with proposal key, remove proposer attestation from block (proposer now attests at interval 1 via gossip) - produce_attestations(): remove proposer skip, all validators attest - main.rs: read dual key files per validator (attestation_privkey_file + proposal_privkey_file) - checkpoint_sync: validate both attestation_pubkey and proposal_pubkey - Type cascade: SignedBlockWithAttestation → SignedBlock, fix field access NOTE: store.rs and network layer still reference old types — fixed in subsequent phases.
🤖 Kimi Code ReviewReview SummaryThis PR introduces dual XMSS key pairs for validators (separate attestation and proposal keys) to enable signing both attestations and block proposals in the same slot without violating OTS constraints. The changes are comprehensive and touch multiple components. Issues Found
Security Considerations
Performance Impact
Code Quality
Recommendations
Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Claude Code ReviewPR Review: Devnet4 Phase 2 — Dual-key KeyManager and Block Proposal FlowThe overall design is clean and the refactoring is well-scoped. The transition from embedded proposer attestation to a signed block root is architecturally sound. A few concrete issues below. Bug: Wrong metric timer in
|
🤖 Codex Code ReviewFindings
Overall direction (dual attestation/proposal keys, proposer signing block root) is good, but Item 1 and Item 2 should be fixed before merge. Automated review by OpenAI Codex · custom prompt |
Motivation
Second of 4 PRs implementing devnet4. Introduces dual-key management and rewrites the block proposal flow to sign the block root with the proposal key instead of embedding a proposer attestation.
Depends on: #230 (Phase 1: Types)
Description
KeyManager: dual keys per validator
sign_attestation()→ uses attestation keysign_block_root()→ uses proposal keyBlock proposal: sign block root, no proposer attestation
Before: proposer creates attestation → signs attestation data → embeds in
SignedBlockWithAttestationAfter: proposer signs block root with proposal key → assembles
SignedBlock. Proposer attests at interval 1 through normal gossip.Key behavioral change:
produce_attestations()no longer skips the proposer — all validators attest at interval 1.Binary: dual key loading
AnnotatedValidatornow expects:attestation_pubkey_hex/proposal_pubkey_hexattestation_privkey_file/proposal_privkey_fileread_validator_keys()reads two key files per validator and constructsValidatorKeyPair.Checkpoint sync
Validates both
attestation_pubkeyandproposal_pubkeymatch between downloaded state and local genesis config.Files changed
crates/blockchain/src/key_manager.rs— ValidatorKeyPair, sign_block_rootcrates/blockchain/src/lib.rs— proposal flow, attestation flow, type cascadebin/ethlambda/src/main.rs— dual key loadingbin/ethlambda/src/checkpoint_sync.rs— dual pubkey validationPR chain
How to Test
Requires Phase 1 merged first. Store and network still reference old types — fixed in Phase 3+4.