Skip to content

feat(test-fixtures): resolve implicit transaction test gas limits - #3493

Open
danceratopz wants to merge 2 commits into
experiments/expose-state-independent-tx-validationfrom
experiments/resolve-implicit-tx-test-gas-limits
Open

feat(test-fixtures): resolve implicit transaction test gas limits#3493
danceratopz wants to merge 2 commits into
experiments/expose-state-independent-tx-validationfrom
experiments/resolve-implicit-tx-test-gas-limits

Conversation

@danceratopz

@danceratopz danceratopz commented Sep 1, 2026

Copy link
Copy Markdown
Member

Description

StateTest and BlockchainTest resolve an omitted transaction gas limit before signing, but TransactionTest previously signed the transaction directly. This forced transaction tests to provide an otherwise arbitrary gas limit or fail with gas_limit must be set to sign a transaction.

This PR resolves omitted limits through the shared Transaction.with_gas_limit(...) behavior before signing. It uses the configured default block gas budget, preserves explicit limits, applies Osaka's transaction gas cap, and retains Amsterdam's state gas reservoir behavior.

The existing transaction tests now omit gas limits when gas is unrelated to the behavior under test. This keeps them useful as examples of the intended TransactionTest API. The explicit limit in the raw RLP source helper remains because that helper signs and serializes its transaction before the filler or execute pipeline can resolve an implicit limit.

The test intentions and expected results remain unchanged. The refactored tests still exercise the same nonce overflow, authorization-format, and RLP-validation cases with the same expected exceptions. Their serialized bytes and signatures intentionally change because the framework now supplies the gas limit.

Execute mode remains supported. TransactionPost.prepare_transactions() resolves omitted limits from the live environment and fork configuration before calculating balances and signing transactions.

Stack

This is the second PR in a three-PR stack:

  1. feat(spec-specs): expose state-independent transaction validation #3492 — Expose state-independent transaction validation.
  2. feat(test-fixtures): resolve implicit transaction test gas limits #3493 — Resolve implicit transaction test gas limits (this PR).
  3. feat(spec-tests): validate transaction test fixtures against EELS #3494 — Validate transaction test fixtures with EELS.

Related Issues or PRs

Fixes #3489.

Testing

  • Added coverage for omitted and explicit limits, Osaka's cap, and Amsterdam's state gas reservoir behavior.
  • Filled the three affected test modules: 1,178 tests passed.
  • Compared fixtures before and after with hasher compare: 124 transaction fixture hashes changed because the gas limit and signature changed; none of the 1,178 expected result values or exceptions changed.
  • Repeated the comparison for Amsterdam: 56 transaction fixture hashes changed and no expected results changed.
  • Collected the affected modules under execute mode for Amsterdam and exercised preparation and signing for the nonce-overflow, invalid type-4, and raw-RLP patterns.
  • just static
  • just test-tests
  • just json-loader on the restacked feat(spec-tests): validate transaction test fixtures against EELS #3494 branch

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards and Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> match the applied labels.

Cute Animal Picture

A cat

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.90%. Comparing base (f7fbf65) to head (73023cf).

Additional details and impacted files
@@                                 Coverage Diff                                 @@
##           experiments/expose-state-independent-tx-validation    #3493   +/-   ##
===================================================================================
  Coverage                                               93.90%   93.90%           
===================================================================================
  Files                                                     624      624           
  Lines                                                   36938    36938           
  Branches                                                 3330     3330           
===================================================================================
  Hits                                                    34688    34688           
  Misses                                                   1569     1569           
  Partials                                                  681      681           
Flag Coverage Δ
unittests 93.90% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danceratopz
danceratopz force-pushed the experiments/resolve-implicit-tx-test-gas-limits branch from 43fdc7b to c556791 Compare September 1, 2026 16:34
@danceratopz
danceratopz force-pushed the experiments/resolve-implicit-tx-test-gas-limits branch from c556791 to d93b047 Compare September 1, 2026 16:45
@danceratopz
danceratopz marked this pull request as draft September 1, 2026 16:48
@danceratopz
danceratopz force-pushed the experiments/resolve-implicit-tx-test-gas-limits branch from d346035 to 73023cf Compare September 1, 2026 19:37
@danceratopz
danceratopz marked this pull request as ready for review September 1, 2026 19:37
@gurukamath
gurukamath self-requested a review September 2, 2026 06:04
@gurukamath gurukamath self-assigned this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-fixtures Area: execution_testing.fixtures C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve implicit gas limits in transaction tests

2 participants