Skip to content

tests: fix statetest message construction to match other clients#18121

Merged
yperbasis merged 1 commit into
erigontech:mainfrom
bshastry:fix/statetest-txbytes-override
Dec 4, 2025
Merged

tests: fix statetest message construction to match other clients#18121
yperbasis merged 1 commit into
erigontech:mainfrom
bshastry:fix/statetest-txbytes-override

Conversation

@bshastry

@bshastry bshastry commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Fixes #18079

Previously, when post.Tx (txbytes) was present in state tests, erigon would override the message constructed from the transaction JSON with one derived from the raw transaction bytes. This caused inconsistencies because the txbytes could have different values (e.g., gas limit) than the transaction JSON fields.

Other clients (go-ethereum, nethermind, besu) only use txbytes for validation purposes, not to replace the message. This fix aligns erigon with other clients by:

  1. Adding BlobVersionedHashes field to stTransaction struct (previously missing, which was the original reason for the txbytes workaround)
  2. Using BlobVersionedHashes in toMessage() when constructing messages
  3. Removing the txbytes override logic that incorrectly replaced the message for all transaction types

This fixes gas calculation mismatches where erigon would report different initial gas than other clients due to the txbytes having a different gas limit than the transaction JSON.

🤖 Generated with Claude Code

Previously, when post.Tx (txbytes) was present in state tests, erigon
would override the message constructed from the transaction JSON with
one derived from the raw transaction bytes. This caused inconsistencies
because the txbytes could have different values (e.g., gas limit) than
the transaction JSON fields.

Other clients (go-ethereum, nethermind, besu) only use txbytes for
validation purposes, not to replace the message. This fix aligns erigon
with other clients by:

1. Adding BlobVersionedHashes field to stTransaction struct (previously
   missing, which was the original reason for the txbytes workaround)
2. Using BlobVersionedHashes in toMessage() when constructing messages
3. Removing the txbytes override logic that incorrectly replaced the
   message for all transaction types

This fixes gas calculation mismatches where erigon would report
different initial gas than other clients due to the txbytes having
a different gas limit than the transaction JSON.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yperbasis
yperbasis merged commit 0c3e776 into erigontech:main Dec 4, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State test runner ignores blobVersionedHashes when txbytes is absent

2 participants