Skip to content

fix(tests): make more Prague tests fork-aware for EIP-2780#11

Merged
gurukamath merged 5 commits into
gurukamath:eip-2780/implement-eip-finalfrom
danceratopz:2780-prague-test-suggestions
Apr 21, 2026
Merged

fix(tests): make more Prague tests fork-aware for EIP-2780#11
gurukamath merged 5 commits into
gurukamath:eip-2780/implement-eip-finalfrom
danceratopz:2780-prague-test-suggestions

Conversation

@danceratopz

Copy link
Copy Markdown
Collaborator

Summary

  • Pass _fork to transactions() in EIP-7002, EIP-7251, and EIP-7685 system contract tests that were falling back to hardcoded gas limits.
  • Replace hardcoded gas_limit=21_000 with the fork's intrinsic gas calculator in the EIP-7702 nonce mismatch test (empty account + value costs 30,000 under EIP-2780).
  • Replace stale 21_000 with the intrinsic gas calculator in test_many_delegations where fork is available; document the overestimate in test_gas.py where it isn't.
  • Add sends_value=True to EIP-7002/7251 contract deployment intrinsic gas calculations (transactions send the system contract fee as value).
  • Generalize "21,000 gas" comments to "base intrinsic gas (fork-dependent)" in EIP-7623 docstrings.

Test plan

  • uvx tox -e static passes after each commit.
  • uv run fill passes on all modified test modules.

- Pass _fork=fork to transactions() in EIP-7002 test_withdrawal_requests
  to use the fork's intrinsic gas calculator instead of hardcoded fallback.
- Add fork: Fork fixture parameter and pass _fork=fork in EIP-7002
  test_modified_withdrawal_contract.
- Add fork: Fork fixture parameter and pass _fork=fork in EIP-7251
  test_modified_consolidation_contract.
- Add fork: Fork fixture parameter and import Fork in EIP-7685
  conftest.py blocks fixture, pass _fork=fork to transactions().
- Replace hardcoded gas_limit=21_000 with fork-aware intrinsic gas
  calculation in test_invalid_transaction_after_authorization.
- The transaction sends value=1 to an empty account, which under
  EIP-2780 costs 30,000 gas instead of 21,000.
- In test_gas.py, add a comment explaining that 21,000 is a
  conservative overestimate since fork is unavailable at
  parametrization time.
- In test_set_code_txs.py test_many_delegations, replace the hardcoded
  21,000 with the fork's intrinsic gas calculator (fork is available).
- Add sends_value=True to intrinsic gas calculator calls in EIP-7002
  and EIP-7251 contract deployment tests.
- Both transactions send the system contract fee as value, which under
  EIP-2780 adds GAS_STATE_UPDATE (1,000) to the intrinsic cost.
- Replace hardcoded "21,000 gas for the transaction" with
  "Base intrinsic gas for the transaction (fork-dependent)" in the
  tx_data fixture docstring.
- The base intrinsic gas varies by fork (e.g. 21,000 in Prague,
  different under EIP-2780).
@danceratopz danceratopz changed the title fix(tests): make Prague tests fork-aware for EIP-2780 fix(tests): make more Prague tests fork-aware for EIP-2780 Mar 26, 2026
@gurukamath gurukamath merged commit ef3d40b into gurukamath:eip-2780/implement-eip-final Apr 21, 2026
6 of 11 checks passed
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