Skip to content

malik672/Peam-ssz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

peam-ssz

crates.io docs.rs

peam-ssz is a small, performance-focused SSZ encoding, decoding, and merkleization crate extracted from Peam, a Lean/Ethereum consensus client written in Rust.

The design goals are straightforward:

  • keep dependencies minimal
  • keep the hot path cheap
  • stay close to Ethereum SSZ behavior

The crate depends only on sha2 for hashing. Everything else stays in-tree.

Warning: peam-ssz currently enables sha2's asm backend on aarch64, x86_64, and x86 builds to favor end-to-end throughput. The upstream sha2 documentation treats this as an application-level choice; we keep it enabled here deliberately.

Links

What It Includes

  • core SSZ encode/decode traits and primitives
  • fixed and variable-size collection helpers
  • container utilities
  • bitlist and bitvector support
  • progressive SSZ helpers
  • hash-tree-root and Merkle utilities

Repository layout:

  • src/: crate implementation
  • spec-tests/: Ethereum consensus spec-vector harness
  • fuzz/: robustness and differential fuzzing targets
  • benches/: Criterion differential benchmarks

Origins

This crate began as an extraction of Peam's internal SSZ code, which itself came from SigmaPrime ethssz, and was then shaped into a standalone library with tests, fuzzing, and benchmarks.

The original Peam sources were:

Validation

Run the crate test suite:

cargo test

Run the spec-test harness:

./spec-tests/download-vectors.sh
cargo test -p spec-tests -- --nocapture

The spec harness is wired to the Ethereum consensus spec vectors from v1.6.1.

Fuzzing

Fuzzing uses cargo-fuzz and libFuzzer.

Available targets:

  • decode_robustness
  • diff_header
  • diff_list_u64

Run one target from the fuzz workspace:

cd fuzz
cargo fuzz run decode_robustness

Benchmarks

peam-ssz includes a differential Criterion benchmark harness that compares against:

  • libssz
  • Lighthouse SSZ (ethereum_ssz)
  • ssz_rs

Run the benchmark suite:

cargo bench --bench peam_differential

The benchmark harness is intentionally narrow and focused on hot-path types such as primitives, fixed bytes, Vec<u64>, and a BeaconBlockHeader-shaped container. For current numbers, rerun the benches on your target machine rather than relying on committed local results.

Local benchmark snapshots are preserved in BENCHMARKS.md.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors