Repository navigation
fix(prover): align manifest transaction decoding - #60
Merged
Merged
Conversation
davidtaikocha
approved these changes
Sep 29, 2026
davidtaikocha
left a comment
Member
There was a problem hiding this comment.
Reviewed against taiko-mono#22173 (merge commit aa3a24f5). Approving.
Verified
internal/prover/transaction_encoding.gohas the same logic as upstreampackages/taiko-client/driver/chain_syncer/event/derivation/transaction_encoding.go. Only names, blank lines and doc comments differ.- The call site is equivalent to upstream
source_fetcher.go:- every validation failure falls back to the default source (upstream also logs a warning);
- host-integrity blob errors stay hard errors;
decodeManifestPayloadis still the only place source bytes are decoded.
testdata/derivation_vectors/manifest_cases.jsonis byte-identical to upstream (sha256c4c040c6…4f62d223).- taiko-geth
4e001283f488 → 8e98046bfd6ais thev2.7.0tag and a direct child of the old pin. The diff is onlyCHANGELOG.mdand.release-please-manifest.json, so none of the linked go-ethereum packages change. go test ./internal/proverpasses on go1.24.11, go1.26.0 and go1.27.1, with 142/142 vector tests each time. Thecompress/zlibandflatereader code is effectively identical across those versions. ego's 1.26.1 was not run directly.- Mutation testing: removing any check, or moving its bound by one, fails the vector tests. The only exceptions are branches the geth decoder already enforces: the
default:type arm,v < 35, andSign() < 0.
Non-blocking follow-ups (test-only, so no enclave measurement impact)
- Positional coverage. Every invalid vector puts the bad tx last in the last block. A regression that checks only the last tx or block, or the classic
err =overwrite in the loop, would pass all 383 prover tests. These cases would catch it, ideally added upstream ingenerate.goso all three decoders get them:- bad tx then valid tx in the same block
- bad block 0 then valid block 1
- sidecar tx then valid tx
- EIP-155 legacy overflow. All legacy overflow vectors use
v=27, so EIP-155 legacy txs aren't exercised for the fee, value and r/s bounds. - Forced-inclusion variants. Upstream's isolation test also runs
type2_parity_2,type2_controlandlate_bad_transactionas forced-inclusion sources. Here onlytwo_valid_blocksruns as forced. - Nits:
- The doc comment on
validateManifestTransactionEncodingdrops upstream's precise wording ("the Rust manifest decoder and alethia-reth's execution transaction decoder"). In gaiko2 the manifest decoder is geth, which accepts all of these encodings, so the generic wording is misleading. - The fixture could record its provenance (upstream commit + sha256).
...DefaultWholeSourceAndPreserveNeighbordoesn't put two sources in one proposal.vector := vectoris redundant on Go ≥ 1.22.
- The doc comment on
Rollout notes
- No fork gate, consistent with upstream. Upstream validated local driver behaviour, not historical replay. Before registering the new MRENCLAVE, it's worth scanning mainnet/Hoodi Shasta proposals for any source that would now fall back to the default.
- raiko2 pin. raiko2
release/providers.toml(#268) pins gaiko2a88ae8b4, this PR's head. Its release tooling runsgit clonethengit checkout <sha>. Since this PR is being squash-merged, please keep thefix/align-manifest-decodingbranch until raiko2 is re-pinned to the squash commit onmain. The tree is identical, so the MRENCLAVE is the same.
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.


Summary
taikoxyz/taiko-mono#221738e98046bfd6a)The validation is intentionally not fork-gated. If any transaction in a decoded source has an incompatible encoding, the entire source follows the existing default-source path; signer recovery and execution validity remain the execution engine's responsibility.
No custom zlib behavior or decompression cap is added. The shared fixtures cover complete/truncated streams, dictionaries, trailing bytes and second streams, strict RLP framing, numeric boundaries, typed parity, and blob sidecar wrappers.
Validation
go test -count=1 ./internal/prover -run '^TestManifestVectors'— passed, all 136 vectorsgo test -count=1 ./internal/prover— passedgo test -count=1 ./...— passed, all five packagesgo vet ./...— passedgo mod verify— passedgofmt -l— cleango test -race -count=1 ./cmd/gaiko2 ./internal/api ./internal/tee— passedgit diff --check— passedThis PR only changes source and tests. It does not build, register, or deploy a new TEE image; the resulting enclave measurement will be handled by the release flow.
Note
Medium Risk
Changes L2 derivation/prover manifest handling on the critical path from blob data to executed blocks; behavior shifts for previously retained hostile encodings, though extensive vectors and default-source fallback limit blast radius.
Overview
Aligns Shasta blob manifest decoding with taiko-mono by bumping the taiko-geth replace to commit
8e98046bfd6aand adding post-RLP transaction encoding checks indecodeManifestPayload.New
validateManifestTransactionsrejects sources whose txs use unsupported types, out-of-range numeric fields, invalid legacy v / typed parity, or blob sidecar wrappers—one bad tx invalidates the whole source, which then follows the existing default-manifest path (same as other decode failures). Signer recovery and execution validity are still left to the engine.Adds 136 canonical derivation vectors (
manifest_cases.jsonplusTestManifestVectorsand follow-on tests for whole-source defaulting, neighbor preservation, forced-inclusion multi-block behavior, and late invalid txs).Reviewed by Cursor Bugbot for commit a88ae8b. Bugbot is set up for automated code reviews on this repo. Configure here.