fix(evm-tools): encode accepted transactions in t8n body - #3361
Conversation
|
Heads up that this needs a rebase. #3307 moved the tree while this was open, and both paths this PR touches are gone on The second one matters more than a path change. I could not find any Just recipe or CI job that runs On HEAD the collected home for a t8n regression test is I was reading #3362 and reproduced the sparse receipts trie on Prague, keys |
0b79966 to
6d963d3
Compare
|
@zexoverz Thanks for the heads-up. I rebased onto the current |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3361 +/- ##
===================================================
+ Coverage 93.19% 93.53% +0.34%
===================================================
Files 624 624
Lines 37074 37074
Branches 3394 3394
===================================================
+ Hits 34551 34679 +128
+ Misses 1726 1645 -81
+ Partials 797 750 -47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
t8ncurrently builds its emitted block body before execution withrlp.encode([tx.rlp() for tx in self.txs]).Transaction.rlp()alreadyreturns the complete encoded transaction, so putting those bytes directly in
another RLP list wraps legacy transactions as byte strings instead of encoding
them as inline lists. Building the body before execution also includes
transactions that
t8nlater reports as rejected.This change records a transaction only after
process_transactionaccepts it,then builds the body after execution using the active fork's canonical
transaction representation: legacy transactions remain inline RLP lists and
typed transactions remain envelope byte strings. It also removes the unused
duplicate body construction from the CLI JSON parser.
The regression test uses a legacy transaction, a rejected legacy transaction,
and an accepted type-2 transaction. It checks that the rejected input is
absent, the accepted legacy transaction is inline, and the type-2 envelope is
preserved.
On that case, the old output is a 307-byte, three-member body beginning
0xf90130b862f860; the new output is a 204-byte, two-member body beginning0xf8caf860, byte-identical to Geth 1.15.6.Found while building a t8n frontend for Jaune, a Lean 4 executable EVM specification whose conformance gate is byte-exact against
ethereum-spec-evm.Validation
just test-testspasses with 2,080 tests passed; it is the recipe thatcollects
packages/testing/src/execution_testing/evm_tools/tests/test_t8n_body.py.just spec-toolsseparately passes all 22 tests.Related Issues or PRs
N/A. The separately observed trie-indexing behavior is intentionally not
changed by this PR.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture