Revisit the SSZ/JSON decode-probing fallback in the parsigex codec
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
調査の方向性
crates/core/src/parsigex_codec.rs の deserialize_signed_data とその SSZ/JSON プロービング分岐から始め、次に unsigneddata.rs の拒否パスと rejects_empty_set のカバレッジを調べます。候補 codec をどのように表現すべきかを決める前に、各 duty type のデコードパスと serialize_signed_data パスを追跡します。完了とは、失敗した試行がターミナルのエラーとデバッグログに表示され、テストがフォールバックの失敗、length/offset ガード、および各 duty type の分岐をカバーしていることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 8
- フォーク
- 6
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NethermindEth/pluto のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
NethermindEth/pluto#719 ·
メンテナーはふだん 4 日以内に返信
-
rust
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
NethermindEth/pluto#638 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
enhancement rust
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NethermindEth/pluto#635 ·
メンテナーはふだん 4 日以内に返信
-
Improve `alpha test peers`: match Charon's probes; reduce timeouts対応中かも @varex83agent が 5 日前に担当しました。 オープンbug track:orchestration-cli
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
NethermindEth/pluto#632 ·
メンテナーはふだん 4 日以内に返信
-
enhancement rust
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NethermindEth/pluto#631 ·
メンテナーはふだん 4 日以内に返信
NethermindEth/pluto の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
Devolutions/picky-rs#546 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zcashlabs/thus-spoke-zakura#153 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
topgrade-rs/topgrade#2395 ·
メンテナーはふだん 1 日以内に返信