Skip to content

chore(test-tests): migrate tests from fork.gas_costs to bytecode.gas_cost(fork) #2049

@spencer-tb

Description

@spencer-tb

Description

PR #2002 introduced bytecode.gas_cost(fork) to calculate exact gas costs of bytecode for a given fork.
This replaces the need for manual gas calculations using fork.gas_costs accessors and GAS_* constants.

PR #2030 (WIP) has started migrating benchmark tests to use this new API.

This issue tracks migrating all remaining test files to the new bytecode.gas_cost(fork) API.

Files to Migrate

  • Benchmark Tests - refactor(testing): Implement IteratingBytecode, FixedIterationsBytecode #2030 @marioevz
    • tests/benchmark/compute/helpers.py
    • tests/benchmark/compute/instruction/test_keccak.py
    • tests/benchmark/compute/instruction/test_storage.py
    • tests/benchmark/compute/scenario/test_unchunkified_bytecode.py
    • tests/benchmark/compute/instruction/test_system.py
    • tests/benchmark/compute/instruction/test_account_query.py
    • tests/benchmark/compute/precompile/test_alt_bn128.py
    • tests/benchmark/compute/scenario/test_transaction_types.py
    • tests/benchmark/stateful/bloatnet/test_single_opcode.py
    • tests/benchmark/stateful/bloatnet/test_multi_opcode.py
  • Amsterdam
    • tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py
    • tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_opcodes.py
  • Berlin
    • tests/berlin/eip2929_gas_cost_increases/test_precompile_warming.py
    • tests/berlin/eip2930_access_list/test_acl.py
    • tests/berlin/eip2930_access_list/test_tx_intrinsic_gas.py
  • Byzantium
    • tests/byzantium/eip196_ec_add_mul/conftest.py
    • tests/byzantium/eip196_ec_add_mul/test_gas.py
    • tests/byzantium/eip197_ec_pairing/test_gas.py
  • Cancun
    • tests/cancun/eip1153_tstore/test_basic_tload.py
    • tests/cancun/eip1153_tstore/test_tstorage.py
    • tests/cancun/eip1153_tstore/test_tstorage_execution_contexts.py
    • tests/cancun/eip4844_blobs/conftest.py
    • tests/cancun/eip4844_blobs/test_blobhash_opcode.py
    • tests/cancun/eip4844_blobs/test_blob_txs.py
    • tests/cancun/eip4844_blobs/test_excess_blob_gas.py
  • Frontier
    • tests/frontier/opcodes/test_call.py
    • tests/frontier/opcodes/test_call_and_callcode_gas_calculation.py
    • tests/frontier/validation/test_transaction.py
  • Osaka
    • tests/osaka/eip7594_peerdas/test_max_blob_per_tx.py
    • tests/osaka/eip7823_modexp_upper_bounds/conftest.py
    • tests/osaka/eip7825_transaction_gas_limit_cap/test_eip_mainnet.py
    • tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit.py
    • tests/osaka/eip7825_transaction_gas_limit_cap/test_tx_gas_limit_transition_fork.py
    • tests/osaka/eip7883_modexp_gas_increase/conftest.py
    • tests/osaka/eip7883_modexp_gas_increase/test_modexp_thresholds_transition.py
    • tests/osaka/eip7918_blob_reserve_price/conftest.py
    • tests/osaka/eip7918_blob_reserve_price/test_blob_base_fee.py
    • tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py
  • Prague
    • tests/prague/eip2537_bls_12_381_precompiles/conftest.py
    • tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py
    • tests/prague/eip7002_el_triggerable_withdrawals/test_modified_withdrawal_contract.py
    • tests/prague/eip7251_consolidations/test_modified_consolidation_contract.py
    • tests/prague/eip7623_increase_calldata_cost/conftest.py
    • tests/prague/eip7623_increase_calldata_cost/helpers.py
    • tests/prague/eip7623_increase_calldata_cost/test_eip_mainnet.py
    • tests/prague/eip7623_increase_calldata_cost/test_execution_gas.py
    • tests/prague/eip7623_increase_calldata_cost/test_refunds.py
    • tests/prague/eip7623_increase_calldata_cost/test_transaction_validity.py
    • tests/prague/eip7702_set_code_tx/test_eip_mainnet.py
    • tests/prague/eip7702_set_code_tx/test_gas.py
    • tests/prague/eip7702_set_code_tx/test_set_code_txs.py
    • tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py
  • Shanghai
    • tests/shanghai/eip3651_warm_coinbase/test_warm_coinbase.py
    • tests/shanghai/eip3860_initcode/test_initcode.py
  • Tangerine Whistle
    • tests/tangerine_whistle/eip150_operation_gas_costs/test_eip150_selfdestruct.py

Related PRs and Issues

Please add below!

Metadata

Metadata

Labels

A-test-testsArea: tests for packages/testingC-choreCategory: choreC-trackerCategory: Tracker—Meta-issues that collect many issues for progress monitoringE-hardExperience: difficult, probably not for the faint of heartP-medium

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions