refactor(admin): key envelope payload decoding off the SPS-50 tx type - #206
Open
prajwolrg wants to merge 2 commits into
Open
refactor(admin): key envelope payload decoding off the SPS-50 tx type#206prajwolrg wants to merge 2 commits into
prajwolrg wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Only OperatorSet and Sequencer had conversions; the tx-type-keyed envelope parser needs every concrete update type convertible so its decode dispatch can stay generic.
The envelope was SSZ-decoded directly into SignedPayload, whose nested action unions re-encode what the tag's tx type byte already says. That left the tag byte unchecked, spent redundant selector bytes on L1, and tied the wire format to Rust enum ordering — awkward for constructing admin txs from other languages (STR-2366). Decode into a per-type SignedActionPayload<A> container selected by the tag instead, giving every tx type a flat, self-describing SSZ schema. SignedPayload stays as the in-memory handler type; it loses its SSZ derives so the old discriminant-carrying format can't be emitted by accident, and encoding moves to into_envelope_bytes(). parse_tx now returns Option like the bridge parser, warning and skipping unknown or malformed txs at one shared log site. A mis-tagged payload can't forge an action: signatures cover the signing message rendered from the reconstructed action, so a wrong tag either fails SSZ decode or fails threshold verification. This is a wire-format break: already-signed-but-unbroadcast admin payloads in the old encoding will no longer parse.
prajwolrg
force-pushed
the
refactor/admin-tx-payload-format
branch
from
July 27, 2026 05:07
71fb018 to
192f9f6
Compare
prajwolrg
marked this pull request as ready for review
July 27, 2026 05:10
|
Commit: e2ae102
|
storopoli
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Re-implements admin envelope payload parsing so the SPS-50 tag's tx type byte selects the concrete action type to decode, instead of SSZ-decoding the envelope into
SignedPayload's nested action unions. The old format re-encoded what the tag already says: it spent redundant union selector bytes on L1, left the tag byte entirely unchecked, and tied the wire format to Rust enum ordering — the main obstacle to constructing admin txs from other languages (STR-2366). Each tx type now has a flat, self-describing SSZ schema ({seqno, action, signatures}), andparse_txreturnsOptionwith warn-and-skip semantics, matching the bridge parser.Security-wise the tag byte becomes load-bearing but is still not signed; that's safe because signatures cover the signing message rendered from the reconstructed action, so a mis-tagged payload either fails SSZ decode or fails threshold verification in the handler. This is noted in the code docs.
Type of Change
Notes to Reviewers
Review entry point:
crates/subprotocols/admin/txs/src/parser.rs— the wire containerSignedActionPayload<A>, the tx-type-keyed decode dispatch, andSignedPayload::into_envelope_bytes()(encode side). Everything else is fallout: callers switching to theOptionflow and encode sites switching off the removed SSZ derives.This is a consensus wire-format break for admin txs: already-signed-but-unbroadcast payloads in the old encoding won't parse, and external tooling that builds these envelopes must adopt the new layout.
Tested with the parser unit tests (new roundtrip over arbitrary actions + malformed-payload rejection) and the full admin integration suites (
asm_admin,asm_admin_to_{checkpoint,bridge,stf,ee_stf}), all green.Checklist
Related Issues
STR-2366