Rename SignedBlockWithAttestation.message to .block to match leanSpec#250
Rename SignedBlockWithAttestation.message to .block to match leanSpec#250MegaRedHand merged 1 commit intomainfrom
Conversation
Aligns with leanEthereum/leanSpec#465 which renamed SignedBlock.message to SignedBlock.block. SSZ compatibility is unaffected since SSZ is schemaless; this is purely a naming convention change to keep all client implementations consistent with the spec.
🤖 Kimi Code ReviewThis is a straightforward field rename from Review Notes:
Verdict: LGTM. No correctness, security, or performance issues identified. Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
Greptile SummaryThis PR is a pure mechanical rename of Key observations:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| crates/common/types/src/block.rs | Core struct field renamed from message to block in SignedBlockWithAttestation; Debug impl, doc comments, from_signed_block(), and to_signed_block() all updated consistently. |
| crates/blockchain/src/lib.rs | All three call sites (propose_block, process_or_pend_block, process_pending_children) updated from .message.block.* to .block.block.*. |
| crates/blockchain/src/store.rs | All usages in on_block_core and verify_signatures updated; test helper struct construction also updated correctly. |
| crates/storage/src/store.rs | Destructuring pattern in write_signed_block updated from message: BlockWithAttestation { ... } to block: BlockWithAttestation { ... }; formatting improved as a minor bonus. |
| crates/net/p2p/src/gossipsub/handler.rs | All 10 field accesses across handle_gossipsub_message and publish_block updated consistently. |
| crates/net/p2p/src/req_resp/handlers.rs | Single field access in handle_blocks_by_root_response updated correctly. |
| crates/blockchain/tests/forkchoice_spectests.rs | build_signed_block helper and slot access updated; correct field name used in SignedBlockWithAttestation construction. |
| crates/blockchain/tests/signature_spectests.rs | Single slot access updated from .message.block.slot to .block.block.slot. |
| crates/blockchain/tests/signature_types.rs | Local variable renamed to block and struct field updated in From impl; TestSignedBlockWithAttestation.message deliberately kept for YAML fixture compatibility — intentional and well-documented. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class SignedBlockWithAttestation {
+BlockWithAttestation block
+BlockSignatures signature
}
class BlockWithAttestation {
+Block block
+Attestation proposer_attestation
}
class Block {
+u64 slot
+u64 proposer_index
+Hash parent_root
+BlockBody body
}
class BlockSignatures {
+VariableList attestation_signatures
+Signature proposer_signature
}
SignedBlockWithAttestation --> BlockWithAttestation : block\n(renamed from message)
SignedBlockWithAttestation --> BlockSignatures : signature
BlockWithAttestation --> Block : block
note for SignedBlockWithAttestation "Field renamed: message → block\nAccess pattern: signed_block.block.block"
Reviews (1): Last reviewed commit: "Rename SignedBlockWithAttestation.messag..." | Re-trigger Greptile
🤖 Claude Code ReviewReview: Rename
|
🤖 Codex Code Review
No correctness, fork-choice, attestation-validation, state-transition, XMSS verification, or SSZ-layout regressions stood out in the diff itself. The change appears to be a mechanical rename, and the updated call sites are consistent. I could not run Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
Motivation
leanSpec#465 renamed the
SignedBlockcontainer field frommessagetoblock. As noted in that PR:This PR makes the corresponding rename in ethlambda to stay aligned with the spec and other client implementations.
Changes
Renamed
SignedBlockWithAttestation.message→SignedBlockWithAttestation.blockacross 9 files (39 insertions, 40 deletions):Core type definition
crates/common/types/src/block.rs: Renamed the struct field, updated the manualDebugimpl,from_signed_block(),to_signed_block(), and doc comments that referencedmessage.Blockchain crate
crates/blockchain/src/lib.rs: Updated block construction inpropose_block(), field access inprocess_or_pend_block(), and pending block cascade inprocess_pending_children().crates/blockchain/src/store.rs: Updatedon_block_core()(block extraction and cloning),verify_signatures()(block and proposer attestation access), and a test helper struct construction.Storage crate
crates/storage/src/store.rs: Updated the destructuring pattern inwrite_signed_block().Networking crate
crates/net/p2p/src/gossipsub/handler.rs: Updated all 10 field accesses inhandle_gossipsub_message()(block receive logging) andpublish_block()(block publish logging).crates/net/p2p/src/req_resp/handlers.rs: Updated block root computation inhandle_blocks_by_root_response().Test files
crates/blockchain/tests/forkchoice_spectests.rs: Updatedbuild_signed_block()construction and slot access.crates/blockchain/tests/signature_spectests.rs: Updated slot access for block timing.crates/blockchain/tests/signature_types.rs: Updated local variable name and struct construction inFrom<TestSignedBlockWithAttestation>impl.Not changed
TestSignedBlockWithAttestation.message(insignature_types.rs): This test deserialization type still usesmessageto match the current YAML test fixture field names. It will need updating whenLEAN_SPEC_COMMIT_HASHis bumped to a commit that includes leanSpec#465.Notes
signed_block.block.block(outer.blockisBlockWithAttestation, inner.blockisBlock) is slightly redundant but matches the spec structure.How to Test