Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Revisit the SSZ/JSON decode-probing fallback in the parsigex codec

オープン
#640 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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 の本文から書いたものです。

説明

enhancement rust

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 gets ParSigExCodecError::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.rs is 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 the SignedData-to-enum refactor (#639), which makes the encode side an exhaustive match.
主要言語
Rust
スター
8
フォーク
6
平均マージ
4日 3時間
マージ済み PR(30日)
18

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NethermindEth/pluto のほかの issue

NethermindEth/pluto の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。