Skip to content

fix(tests): replace hardcoded 21000 gas constants for EIP-2780 compatibility (tests/osaka)#10

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

fix(tests): replace hardcoded 21000 gas constants for EIP-2780 compatibility (tests/osaka)#10
gurukamath merged 4 commits into
gurukamath:eip-2780/implement-eip-finalfrom
danceratopz:2780-osaka-test-suggestions

Conversation

@danceratopz

@danceratopz danceratopz commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fix(tests): Use fork-aware intrinsic gas calculator in peerdas test_get_blobs — the hardcoded 21_000 was below the EIP-2780 intrinsic cost of 30,000 for value-to-empty-account, making every blob transaction invalid.
  • refactor(tests): Replace hardcoded 21_000 in blob reserve price transition tests (tx_gas fixture and assertion) with calculator-derived values.
  • refactor(tests): Remove dead or 21000 fallback in block RLP limit test gas summation.
  • refactor(tests): Generalize stale gas cost comment in tx gas limit cap test to be fork-independent.

Test plan

  • uvx tox -e static passes after each commit.
  • fill the affected test modules to verify fixture generation succeeds.

- Replace hardcoded 21,000 gas with fork-aware calculator.
- Use RecipientType.EMPTY_ACCOUNT and conditional sends_value.
- Under EIP-2780 the intrinsic cost for value-to-empty-account is
  30,000; the old constant made every blob transaction invalid.
…ransition tests

- Replace hardcoded 21,000 tx_gas fixture with fork-aware calculator
  targeting RecipientType.CONTRACT, plus a 1,000 gas buffer.
- Replace hardcoded 21,000 assertion with calculator-derived intrinsic
  gas for the gas-spender contract destination.
- Remove dead `or 21000` fallback in gas summation.
- All transactions in this test set gas_limit explicitly.
- Replace hardcoded "21000 + 16 * non-zero + 4 * zero" with
  fork-independent "intrinsic gas base cost + calldata cost".
@danceratopz danceratopz changed the title fix(tests): replace hardcoded 21000 gas constants for EIP-2780 compatibility fix(tests): replace hardcoded 21000 gas constants for EIP-2780 compatibility (tests/osaka) Mar 26, 2026
@danceratopz

Copy link
Copy Markdown
Collaborator Author

No guarantee of correctness, of course, but the modified modules do fill:

uv run fill tests/osaka/eip7594_peerdas/test_get_blobs.py tests/osaka/eip7918_blob_reserve_price/test_blob_reserve_price_with_bpo_transitions.py tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.py

@gurukamath gurukamath merged commit 3ca1df3 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