Devnet4 Phase 1: dual-key Validator, SignedBlock, genesis config format#230
Devnet4 Phase 1: dual-key Validator, SignedBlock, genesis config format#230pablodeymo wants to merge 1 commit intodevnet4from
Conversation
🤖 Kimi Code ReviewReview SummaryThis PR introduces dual-key validator structure (attestation + proposal keys) and refactors block signing accordingly. The changes are well-structured and address the OTS constraint issue. Issues Found
Positive Aspects
Minor Suggestions
impl Validator {
pub fn new(attestation_pubkey: ValidatorPubkeyBytes, proposal_pubkey: ValidatorPubkeyBytes, index: u64) -> Result<Self, DecodeError> {
// Validate both keys
let _ = ValidatorPublicKey::from_bytes(&attestation_pubkey)?;
let _ = ValidatorPublicKey::from_bytes(&proposal_pubkey)?;
Ok(Self { attestation_pubkey, proposal_pubkey, index })
}
}
Overall, the PR correctly implements the dual-key validator design and simplifies the block structure appropriately. Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Claude Code ReviewReview: Devnet4 Phase 1 — Dual-key Validator, SignedBlock, Genesis ConfigThis is a clean structural PR. The motivation (OTS key separation) is sound, and the deletions (removing the CorrectnessIncomplete test coverage in The test verifies // Missing:
assert_eq!(config.genesis_validators[1].proposal_pubkey, hex::decode(PROP_PUBKEY_B)...);
assert_eq!(config.genesis_validators[2].proposal_pubkey, hex::decode(PROP_PUBKEY_C)...);Duplicate constant values in test data (
Weakened state root pin ( Replacing the exact hash assertion with a non-zero check is understandable for a non-compiling PR. However, the comment says "Will be recomputed once we can run this test" without a tracking mechanism. A Minor / Non-blockingError message quality regression in The old What looks good
Automated review by Claude (Anthropic) · custom prompt |
🤖 Codex Code Review
I could not run Automated review by OpenAI Codex · custom prompt |
a5db569 to
6037718
Compare
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.
6037718 to
1de4efd
Compare
|
Superseded by unified PR #233 |
… (incl. #275 #277) ## Motivation Implements devnet4 ([leanSpec#449](leanEthereum/leanSpec#449)): separate attestation and proposal keys for validators, replacing the single-key model and removing the proposer attestation wrapper. ## Description ### Phase 1: Types (#230) - `Validator` gains `attestation_pubkey` + `proposal_pubkey` (replaces single `pubkey`) - `SignedBlockWithAttestation` → `SignedBlock`, `BlockWithAttestation` deleted - Genesis config updated to dual-key YAML format ### Phase 2: Key manager + block proposal (#231) - `ValidatorKeyPair` with separate attestation/proposal secret keys - Block proposal signs `hash_tree_root(block)` with proposal key (no proposer attestation) - All validators now attest at interval 1 (proposer no longer skipped) ### Phase 3: Store + verification (#232) - Signature verification uses `get_attestation_pubkey()` / `get_proposal_pubkey()` as appropriate - Removed ~40 lines of proposer attestation handling from `on_block_core` - Storage reads/writes `SignedBlock` directly ### Phase 4: Network + tests (#233) - Type rename cascade across all network layer files - Test harness updated: removed `ProposerAttestation`, simplified `build_signed_block()` - Added proposal signing metrics - leanSpec bumped to 9c30436 (dual-key test fixtures) - Skipped `test_reorg_with_slot_gaps` (fixture relies on gossip proposer attestation state) ## Supersedes Closes #230, closes #231, closes #232 ## Blockers - **lean-quickstart**: needs devnet4 genesis config support for manual devnet testing --------- Co-authored-by: Tomás Grüner <47506558+MegaRedHand@users.noreply.github.com>
Motivation
First of 4 PRs implementing devnet4 (leanSpec#449). Introduces the SSZ-breaking type changes that all subsequent phases depend on.
Description
Validator: single pubkey → dual pubkeys
get_pubkey()→get_attestation_pubkey()+get_proposal_pubkey()Block types: remove proposer attestation wrapper
SignedBlockWithAttestationSignedBlock, message isBlockdirectlyBlockWithAttestationBlockSignaturesWithAttestationBlockSignaturesdirectlyGenesis config format
Other
deser_pubkey_hexmade public ingenesismodule — single source for hex pubkey deserializationValidatordeserialization updated for dual pubkeysPR chain
How to Test
This PR alone does not compile (SSZ-breaking). Full compilation requires all 4 phases merged.