chore: remove from_ssz_bytes_compat for devnet-3 serialization compatibility#127
chore: remove from_ssz_bytes_compat for devnet-3 serialization compatibility#127pablodeymo merged 1 commit intodevnet-3from
Conversation
…rom_ssz_bytes with the payload
🤖 Kimi Code ReviewReview SummaryThe PR removes backward compatibility logic for Critical Issues
Security & Consensus Impact
Recommendations
The code itself is clean and follows Rust best practices, but the breaking change is too severe for consensus-critical software without proper migration strategy. Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Codex Code ReviewFindings
Consensus-layer considerations Summary Residual risk Automated review by OpenAI Codex · custom prompt |
Greptile OverviewGreptile SummaryThis PR removes backward compatibility code for
The backward compatibility was originally added in #63 (commit c4ecabb, Jan 30 2026) to support both the new container format (used by Zeam) and old transparent format (used by other clients). This PR assumes all clients have migrated to the new format. Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| crates/net/p2p/src/req_resp/codec.rs | Replaced from_ssz_bytes_compat with standard from_ssz_bytes, removed backward compatibility import, cleaned up unused import |
| crates/net/p2p/src/req_resp/messages.rs | Removed backward compatibility method from_ssz_bytes_compat and its tests, cleaned up unused import |
Last reviewed commit: 468ee98
🤖 Claude Code ReviewLet me review based on what I can see from the diff and the code. I'll compile my findings now. Based on my review of PR #127, here are my findings: PR #127 Review: Remove backward compatibility from BlocksByRootRequestSummaryThis PR removes the Findings1. Breaking Protocol Change (Critical)The removed
Impact: This PR will break compatibility with peers running older versions of ethlambda that send Questions to address:
2. Test Coverage RemovedThe PR removes Recommendation: Add a basic test to verify #[test]
fn test_blocks_by_root_request_encode_decode() {
let root1 = H256::from_slice(&[1u8; 32]);
let root2 = H256::from_slice(&[2u8; 32]);
let roots = RequestedBlockRoots::new(vec![root1, root2]).unwrap();
let request = BlocksByRootRequest { roots };
let encoded = request.as_ssz_bytes();
let decoded = BlocksByRootRequest::from_ssz_bytes(&encoded).unwrap();
assert_eq!(decoded.roots.len(), 2);
assert_eq!(decoded.roots[0], root1);
assert_eq!(decoded.roots[1], root2);
}3. Code Quality (Good)The simplification is excellent from a maintainability perspective:
4. Unused Import (Minor Issue)In codec.rs:16, there's now a redundant import alias: use ethlambda_types::primitives::ssz::Decode as SszDecode;This is imported solely for the Current (line 45): let request = SszDecode::from_ssz_bytes(&payload).map_err(|err| {Could be: let request = BlocksByRootRequest::from_ssz_bytes(&payload).map_err(|err| {Then remove the 5. Error Handling (Good)Error handling remains consistent - SSZ decode errors are properly converted to VerdictConditionally approve pending clarification on:
If this is a breaking protocol change without coordination, it should either:
The code quality of the change itself is good, but the protocol implications need careful consideration for a consensus client. Automated review by Claude (Anthropic) · custom prompt |
Change BlocksByRootRequest::from_ssz_bytes_compat to use SszDecode::from_ssz_bytes with the payload.
We don't need to maintain compatibility with devnet-2 format, so we remove the previous serialization.