feat: add SSZ encoding/decoding support for parsigex#322
feat: add SSZ encoding/decoding support for parsigex#322varex83agent wants to merge 2 commits intobohdan/dkg-parsigexfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @iamquang95's task in 4m 52s —— View job Code Review — feat: add SSZ encoding/decoding support for parsigex
SummaryThe PR adds SSZ binary encode/decode support for Charon's parsigex signed-data types. The architecture is clean and the Go-fixture compatibility tests are a good signal for wire-format correctness. However, there are several issues ranging from a potential protocol-level asymmetry to missing bounds checks in the Findings[High]
If a peer ever serializes a Impact: The serialize path for Evidence: Recommendation: Either remove the [High]
Impact: Malformed or attacker-controlled SSZ input can produce a Evidence: Recommendation: After decoding, add: if MAX > 0 && value.len() > MAX {
return Err(DecodeError::BytesInvalid(format!(
"bitlist length {} exceeds max {MAX}", value.len()
)));
}[High] In Additionally, the method signature is Evidence: Recommendation: Change [Medium]
Evidence: Recommendation: Either store the [Medium]
Evidence: Recommendation: Either make the function [Medium]
Evidence: Recommendation: Use [Medium] No SSZ fixture coverage for Altair–Fulu versioned types The fixture generator ( Evidence: Recommendation: Add at least one fixture per fork for the most structurally distinct cases (e.g., Electra attestation with [Low] Compiled
Evidence: Recommendation: Add it to [Low]
Evidence: [Low]
Evidence: Parity Matrix (wire format)
TestsTests were not run (no build toolchain available). The Go-fixture compatibility tests are the primary cross-language verification. Round-trip tests are comprehensive for Phase0 types. See the Medium finding above about missing multi-fork fixture coverage. Open Questions
|
|
remember to remove golang code |
Summary
crates/ssz/src/encode.rs,crates/ssz/src/decode.rs)crates/ssz/src/types.rswith SSZ type implementations for eth2api spec typescrates/eth2api/src/spec/*types (phase0, altair, bellatrix, capella, deneb, electra, fulu)crates/core/src/ssz_codec.rs— SSZ codec integration for parsigex signed dataparsigex_codec.rswith SSZ-based serialisation alongside existing JSON pathcrates/core/testdata/ssz/generated bytest-infra/sszfixtures/fastrand 2.4.0→2.4.1and ignores pre-existingrand 0.8.5advisory (RUSTSEC-2026-0097) present on base branchTest plan
cargo test --workspace --all-featurespassescargo clippy --workspace --all-targets --all-features -- -D warningspassescrates/coreexercise the new fixturescargo deny checkpasses🤖 Generated with Claude Code