Skip to content

t8n: Emit the real receipt status, root and logs - #1667

Merged
chfast merged 1 commit into
masterfrom
tooling/t8n-real-receipts
Aug 20, 2026
Merged

t8n: Emit the real receipt status, root and logs#1667
chfast merged 1 commit into
masterfrom
tooling/t8n-real-receipts

Conversation

@chfast

@chfast chfast commented Aug 20, 2026

Copy link
Copy Markdown
Member

The receipts JSON hard-coded the status to "0x1" and the logs to [], while the t8n's own receiptsRoot was built from the real receipt status and logs. The JSON and the trie hash therefore agreed only for successful zero-log transactions.

This breaks filling. execution-specs asserts the two against each other for every single-transaction state test — specs/state.py rebuilds a FixtureTransactionReceipt from the receipt JSON (its RLP covers logs and status) and compares its root with the receiptsRoot the tool reported:

AssertionError: Receipts root mismatch:
  0xea172341021a44ccd443700f500c8aa1b6f03d40ce90bc591ad0790030d9e103
  != 4dcfc751a42386805efef49737a1a76732de03f13b8a7966463c397414bcbeb3

That receipt's RLP ends in c0, an empty logs list, while its bloom filter has bits set.

Filling tests/frontier/opcodes/test_log.py at Shanghai with --evm-bin pointing at each build:

t8n Result
before 25 failed, 50 passed
after 75 passed

A pre-Byzantium receipt is keyed on the post-state root rather than the EIP-658 status, so both fields are emitted, as go-ethereum does; the consumer gives a non-empty root precedence.

Extracted from the Amsterdam branch's t8n work, where filling against the devnet releases exercised it. The fix itself is fork-independent.

@codspeed-hq

codspeed-hq Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 129 untouched benchmarks


Comparing tooling/t8n-real-receipts (8a1cbdc) with master (9344010)

Open in CodSpeed

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (9344010) to head (8a1cbdc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1667   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files         171      171           
  Lines       15636    15666   +30     
  Branches     3616     3625    +9     
=======================================
+ Hits        15280    15310   +30     
  Misses        269      269           
  Partials       87       87           
Flag Coverage Δ
eest-develop 88.60% <ø> (ø)
eest-develop-gmp 26.51% <0.00%> (-0.06%) ⬇️
eest-legacy 17.10% <0.00%> (-0.04%) ⬇️
eest-libsecp256k1 28.78% <0.00%> (-0.06%) ⬇️
eest-stable 88.60% <ø> (ø)
evmone-unittests 93.45% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 96.11% <ø> (ø)
tooling 91.96% <100.00%> (+0.04%) ⬆️
tests 99.80% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
test/unittests/tooling_t8n_test.cpp 100.00% <100.00%> (ø)
test/utils/statetest.hpp 80.00% <ø> (ø)
test/utils/statetest_export.cpp 98.90% <100.00%> (+0.09%) ⬆️
test/utils/t8n.cpp 96.82% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The receipts JSON hard-coded the status to "0x1" and the logs to [], while
the t8n's own receiptsRoot was built from the real receipt status and logs,
so the JSON and the trie hash agreed only for successful zero-log
transactions. Emit the EIP-658 status, the log list, and the post-state root
for pre-Byzantium receipts.
@chfast
chfast force-pushed the tooling/t8n-real-receipts branch from bc2d8f9 to 8a1cbdc Compare August 20, 2026 05:53
@chfast
chfast requested a balanced review from Copilot August 20, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns t8n receipt JSON with the data used to calculate receiptsRoot.

Changes:

  • Serializes actual receipt logs and execution status.
  • Emits pre-Byzantium post-state roots.
  • Adds receipt log/status regression tests and shared test helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/utils/t8n.cpp Emits real logs, status, and post-state root.
test/utils/statetest.hpp Declares log JSON serialization.
test/utils/statetest_export.cpp Implements log JSON serialization.
test/unittests/tooling_t8n_test.cpp Tests logs, failure status, and pre-Byzantium roots.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chfast
chfast merged commit 46ffdce into master Aug 20, 2026
26 checks passed
@chfast
chfast deleted the tooling/t8n-real-receipts branch August 20, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants