Devnet4 Phase 4: network type cascade and test harness updates#233
Devnet4 Phase 4: network type cascade and test harness updates#233pablodeymo wants to merge 4 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.
…r attestation - verify_signatures(): attestation proofs use get_attestation_pubkey(), proposer signature verified with get_proposal_pubkey() over block root - on_block_core(): remove proposer attestation processing (~40 lines) — no more gossip signature insert or dummy proof for proposer - Gossip attestation/aggregation verification: get_attestation_pubkey() - Remove StoreError::ProposerAttestationMismatch variant - Storage: write/read BlockSignatures directly (no wrapper), fix field access .message.block → .message - Table docs: BlockSignatures stores BlockSignatures (not WithAttestation)
- Network API: SignedBlockWithAttestation → SignedBlock in all protocols - Gossipsub handler: update block decode/encode and field access - Req/resp codec + handlers: update BlocksByRoot type and field access - Gossipsub encoding test: update ignored test for new type name - Fork choice spec tests: remove proposer_attestation from BlockStepData, simplify build_signed_block() - Signature spec tests: update to TestSignedBlock (no attestation wrapper) - Common test types: remove ProposerAttestation (no longer in block) This completes the devnet4 type migration. All 34 unit tests pass, cargo clippy clean with -D warnings.
🤖 Kimi Code ReviewReview SummaryThis PR introduces dual XMSS key support for validators (separate attestation and proposal keys) and removes the proposer attestation wrapper from blocks. The changes are extensive but generally well-structured. Below are the key findings: ✅ Correctness & Consensus Safety
|
🤖 Codex Code Review
Overall direction (dual keys + block-root proposer signature) looks coherent, but the two slot-handling issues are blocking for safety/correctness. Automated review by OpenAI Codex · custom prompt |
🤖 Claude Code ReviewHere is my review of PR #233: PR #233 — Devnet4 Phase 4: Network Type Cascade and Test Harness UpdatesOverall this is a clean, well-scoped mechanical migration. The type rename cascade is handled consistently across all 22 files, and the architectural change (proposer signs block root with dedicated proposal key rather than embedding a proposer attestation) is correctly threaded through the full pipeline: key manager → proposal → verification → storage → network. A few issues worth addressing: Wrong metrics label in
|
| Severity | Item |
|---|---|
| Bug (latent) | slot as u32 truncating cast in propose_block vs. try_into().expect() in verify_signatures |
| Bug | proposal_pubkey missing serialize_with on Validator |
| Metrics | sign_with_proposal_key uses attestation timing metric |
| Minor | ValidatorPubkeyMismatch doesn't identify which key type failed |
| Expected/tracked | Weakened state root test, storage format break |
The core logic — dual-key signing, block root verification using proposal_pubkey, proposer now attesting independently via attestation_key at interval 1 — looks correct and consistent across all layers.
Automated review by Claude (Anthropic) · custom prompt
Motivation
Final PR implementing devnet4. Completes the type migration across the network layer and updates all test harnesses. After this PR, the full workspace compiles clean and all 34 unit tests pass.
Depends on: #230 (Phase 1), #231 (Phase 2), #232 (Phase 3)
Description
Network layer: type rename cascade
`SignedBlockWithAttestation` → `SignedBlock` and `.message.block.X` → `.message.X` across:
Test harness updates
Verification
```bash
cargo clippy --workspace --all-targets -- -D warnings # clean
cargo test -p ethlambda-types # 3 passed
cargo test -p ethlambda-blockchain --lib # 13 passed
cargo test -p ethlambda # 18 passed
```
Spec tests (fork_choice, verify_signatures, stf) await devnet4 fixtures from `leansig-test-keys`.
PR chain
Blockers