Revisit the SSZ/JSON decode-probing fallback in the parsigex codec
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- rust
- Ambito
- blockchain, distributed-systems, testing-qa
Direzione di ricerca
Inizia in crates/core/src/parsigex_codec.rs, in deserialize_signed_data e nei relativi rami di probing SSZ/JSON, quindi esamina il percorso di rifiuto e la copertura di rejects_empty_set in unsigneddata.rs. Traccia i percorsi di decodifica e serialize_signed_data per ogni tipo di incarico prima di decidere come rappresentare i codec candidati. Il lavoro è completato quando i tentativi falliti sono visibili nell'errore del terminale e nel log di debug, e i test coprono i fallimenti del fallback, le protezioni di lunghezza/offset e i rami per ogni tipo di incarico.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Partial-signature payloads carry no encoding tag — the protobuf envelope is duty + opaque bytes — so deserialize_signed_data reconstructs the type by probing: per duty type, up to 2 SSZ shapes then (if the bytes look like JSON) 2 JSON shapes. ssz_codec layers a second probe underneath (20-byte vs 12-byte versioned-attestation headers), so one Attester payload can be tried five ways; first successful parse wins. This is a faithful port of Charon's core/proto.go marshal/unmarshal.
Problems:
- Error swallowing: 13
if let Ok(...)sites discard the per-attempt errors; when everything fails the caller getsParSigExCodecError::UnsupportedDutyType— misleading, since the duty type was supported and the bytes just didn't parse. There is no way to see "SSZ failed because X, JSON failed because Y". - Ambiguity is designed in: nothing guarantees the candidate shapes are mutually exclusive; a phase0 decode can accept bytes meant as versioned and get silently re-wrapped.
- Charon has a per-test kill switch (
DisableSSZMarshallingForT); Pluto has no equivalent, so the JSON decode branch is effectively unreachable in tests for SSZ-capable types.
Constraint
The wire format must interoperate with Charon in mixed clusters. An explicit encoding tag in the envelope deviates from Charon's parsigex protocol and is only viable behind protocol negotiation or as an upstream change — the probing itself cannot simply be removed.
Proposed change
- Short term: stop swallowing errors — accumulate each attempt's failure into the returned error (and a debug log), and rename the terminal variant to reflect "no codec accepted the payload". Land decode-rejection tests with it: today a single rejection branch in
unsigneddata.rsis tested (rejects_empty_set) — the SSZ/JSON fallback failures, the length/offset guards, and the codec's per-duty-type error branches are all unasserted, so the error-accumulation change would ship blind. - Medium term: replace the hand-written probe chains with a per-duty-type table of candidate codecs declared in one place, so encode (
serialize_signed_data's downcast ladder) and decode stay symmetric. This composes with theSignedData-to-enum refactor (#639), which makes the encode side an exhaustive match.
- Lingua principale
- Rust
- Stelle
- 8
- Fork
- 6
- Merge medio
- 3g 12h
- PR unite (30g)
- 9
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 5 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 5 giorni
-
enhancement rust
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NethermindEth/pluto#635 ·
I maintainer di solito rispondono entro 5 giorni
-
Improve `alpha test peers`: match Charon's probes; reduce timeoutsForse già presa @varex83agent l’ha presa 11 giorni fa. Apertabug track:orchestration-cli
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
NethermindEth/pluto#632 ·
I maintainer di solito rispondono entro 5 giorni
-
enhancement rust
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
NethermindEth/pluto#631 ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di NethermindEth/pluto
Issue simili
-
proxy: SQL-over-HTTP turns empty arrays into [""] or [false], or HTTP 500 for int and float arraysAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
neondatabase/neon#12965 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
goauthentik/authentik#26867 ·
I maintainer di solito rispondono entro 1 giorno
-
api bug macos maintainer-needed p2 triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
area::tern difficulty::easy good first issue kind::cleanup triage::ready
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
eclipse-zenoh/zenoh#2842 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno