Consolidate the three parallel SSZ stacks
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- rust
- Ambito
- blockchain, distributed-systems, testing
Direzione di ricerca
Inizia da crates/ssz/src/hasher.rs e dai test esistenti di hasher, quindi esegui il corpus di golden file di verify_hashes per stabilire il comportamento attuale di Charon/fastssz. Esamina crates/ssz/types.rs e crates/core/src/ssz_codec.rs insieme agli helper e ai codec non testati elencati. Il lavoro è completato quando gli stack condividono interfacce e tipi dove compatibili, la copertura include i confini indicati e i codec specifici di Charon rimangono eccezioni documentate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
SSZ spans ~9,100 LOC across 22 files in three stacks that don't share types, hashing, or error handling:
ethereum_ssz+tree_hashderives for consensus-spec containers (crates/eth2api/src/spec/, 3,498 LOC). Every container repeats a 5-derive line plus per-field#[serde_as]attributes — 93 derive lines, 155Hex0xoccurrences.ssz_typesis not a dependency, socrates/ssz/types.rsreimplementsSszList/SszVector/BitList/BitVectorwith 12 manualEncode/Decode/TreeHashimpls (844 LOC).- A hand-ported fastssz
Hasher(crates/ssz/src/hasher.rs, 640 LOC) drivingcluster/src/ssz.rs— 29 versioned free functions selected via function-pointer tables, plus anSSZError<H>that duplicatespluto_ssz::Error— and a second locally-declaredSszHashabletrait inapp/src/obolapi/exit.rs#L30-L39. - Hand-written byte-level codecs for Charon wire formats (
core/src/ssz_codec.rs, 1,261 LOC), including deliberate deviations from what a derive would emit (documented inunsigneddata.rs: Charon emits an offset table even for fixed-size containers).
Consequences: two incompatible hash-tree-root paths, invisible semantic differences between types (some deliberately omit TreeHash and nothing flags it), and duplicated list/vector plumbing that upstream ssz_types already provides.
Proposed change
- Before touching any stack: pin the current hasher against Charon/fastssz with golden-vector tests (known input → known 32-byte root, expected values captured from the Go side). The existing
hasher.rstests are self-consistency checks (manual-tree comparisons, bitlist guards) — nothing cross-implementation. Add binary round-trip tests for the zero-test codec helpers (encode.rs,decode.rs) at the same time; they are part of the surface being consolidated. Same for the crate's other untested seams:helpers.rsput_byte_list/put_bytes_nIncorrectListSize,serde_utils.rsssz_list_u64_string_serde(string/int parse, MAX rejection, round-trip), the binaryEncode/Decodebound checks ofSszList/SszVector(only the JSON path is tested today), and the hasher'sCountGreaterThanLimitandget_depth/next_power_of_two/calculate_limitboundaries. - Adopt
ssz_typesfor List/Vector/Bitfield and delete most ofcrates/ssz/types.rs. - Merge the two hasher-side interfaces (
SszHashableinobolapivs the free-function tables incluster) into one, e.g. a version-aware trait inpluto_ssz; collapse the duplicated error enum. - Keep the Charon wire-format codecs (
ssz_codec.rs) as explicit, documented exceptions — they encode incompatibilities that derives cannot express.
Open question
The cluster config/definition/lock hashes must byte-match Charon's fastssz output. Before replacing the custom Hasher with tree_hash, prove equivalence on the existing fixture corpus (the verify_hashes golden files) — if fastssz semantics differ (they do for e.g. bitlist mixins and string hashing), the custom hasher stays and only the interface around it is consolidated.
- Lingua principale
- Rust
- Stelle
- 8
- Fork
- 6
- Merge medio
- 4g 20h
- PR unite (30g)
- 21
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NethermindEth/pluto
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
NethermindEth/pluto#719 ·
I maintainer di solito rispondono entro 4 giorni
-
feat(eth2api): wire --beacon-node-headers into the beacon node clientForse già presa @varex83agent l’ha presa 6 giorni fa. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
NethermindEth/pluto#709 · 1 assegnatario ·
I maintainer di solito rispondono entro 4 giorni
-
Global `EnvFilter` prevents topic spans from being constructed at the default log levelForse già presa @arunimshukla l’ha presa 11 giorni fa. Apertabug rust
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
NethermindEth/pluto#708 ·
I maintainer di solito rispondono entro 4 giorni
-
enhancement rust
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
NethermindEth/pluto#640 ·
I maintainer di solito rispondono entro 4 giorni
-
rust
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
NethermindEth/pluto#638 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di NethermindEth/pluto
Issue simili
-
review-drift
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oxidecomputer/hansei#14 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rubys/roundhouse#444 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
install: root SSH tmpfiles.d drop-in is labeled etc_runtime_t instead of etc_tForse già presa @andrewdunndev l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno