Skip to content

Commit 1b6ed54

Browse files
varex83agentvarex83claudegithub-actions[bot]
authored
feat: add SSZ encoding/decoding support for parsigex (#322)
* feat: add deadline.rs * feat: deadline tests * fix: remove comments * wip: add parasig db and some tests * refactor: remove old app/deadline * feat: add rust docs * feat: add clone box and clone eq * feat: finish tests * feat: add parsigex [wip] * fix: typo * fix: parsigex * refactor: parsigex * fix: linter * feat: add subscribe * feat: add SSZ encoding/decoding support for parsigex Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update yanked fastrand and ignore pre-existing rand advisory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: linter * fix: remove binary * chore: remove Go sszfixtures generator from repo The SSZ test fixtures have already been generated and committed under crates/core/testdata/ssz/. The Go generator code is no longer needed in-tree; the binary is already gitignored. Co-authored-by: Bohdan Ohorodnii <varex83@users.noreply.github.com> * fix: review comments * fix: claude review --------- Co-authored-by: Bohdan Ohorodnii <35969035+varex83@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Bohdan Ohorodnii <varex83@users.noreply.github.com>
1 parent 8bc2dcd commit 1b6ed54

26 files changed

Lines changed: 1698 additions & 110 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ lcov.info
2424
coverage.json
2525

2626
.charon*
27+
.omx
2728

2829
.peerinfo*
30+
31+
test-infra/sszfixtures/sszfixtures

Cargo.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ oas3-gen-support = "0.24"
9494
bon = "3.8"
9595
testcontainers = "0.27"
9696
test-case = "3.3"
97+
ethereum_ssz = { version = "0.10" }
98+
ethereum_ssz_derive = { version = "0.10" }
9799
tree_hash = "0.12"
98100
tree_hash_derive = "0.12"
99101
tar = "0.4"

crates/core/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ publish.workspace = true
88

99
[dependencies]
1010
async-trait.workspace = true
11+
ethereum_ssz.workspace = true
1112
cancellation.workspace = true
1213
chrono.workspace = true
1314
crossbeam.workspace = true
1415
futures.workspace = true
16+
futures-timer.workspace = true
1517
dyn-clone.workspace = true
1618
dyn-eq.workspace = true
1719
hex.workspace = true
@@ -30,23 +32,29 @@ tokio.workspace = true
3032
tokio-util.workspace = true
3133
tracing.workspace = true
3234
pluto-eth2util.workspace = true
35+
pluto-ssz.workspace = true
3336
tree_hash.workspace = true
37+
unsigned-varint.workspace = true
3438

3539
[dev-dependencies]
40+
anyhow.workspace = true
3641
alloy.workspace = true
42+
clap.workspace = true
3743
rand.workspace = true
3844
libp2p.workspace = true
45+
k256.workspace = true
3946
prost.workspace = true
4047
prost-types.workspace = true
4148
hex.workspace = true
4249
chrono.workspace = true
4350
test-case.workspace = true
4451
pluto-eth2util.workspace = true
52+
pluto-cluster.workspace = true
4553
pluto-p2p.workspace = true
4654
pluto-testutil.workspace = true
55+
pluto-tracing.workspace = true
4756
tokio = { workspace = true, features = ["test-util"] }
4857
wiremock.workspace = true
49-
pluto-ssz.workspace = true
5058

5159
[build-dependencies]
5260
pluto-build-proto.workspace = true

crates/core/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ pub mod deadline;
2727
pub mod parsigdb;
2828

2929
mod parsigex_codec;
30+
// SSZ codec operates on compile-time-constant byte sizes and offsets.
31+
// Arithmetic is bounded and casts from `usize` to `u32` are safe because all
32+
// sizes are well below `u32::MAX`.
33+
#[allow(clippy::arithmetic_side_effects, clippy::cast_possible_truncation)]
34+
pub(crate) mod ssz_codec;
3035

3136
pub use parsigex_codec::ParSigExCodecError;
3237

0 commit comments

Comments
 (0)