-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Background
Following discussions around general benchmark refactoring and the transaction gas limit cap issue, the ZkEVM team, Nethermind team (for gas benchmarking purpose),along with other teams, agreed that using the blockchain_test format is sufficient. This aligns with zkEVM’s goal of proving entire blocks rather than individual transactions (as in state_test).
However, most existing test cases are currently in the state_test format, which requires conversion using the reth deserialization tools. Additionally, EIP-7825 has been introduced in Fusaka, which enforces a maximum transaction gas limit of 2^24. This requires us to rewrite a lot of benchmark tests. Since the test must be split into multiple parts and use the blockchain_test format when the transaction gas exceeds the cap.
Proposed Solution
Introduce a new test type: benchmark_test, designed specifically for benchmark test cases. This format would support:
- Act as a wrapper and only generates the
blockchain_testformat as output - High compatibility with both
blockchain_testandstate_testformats - Support EIP-7825 for transaction limit cap
Usage Scenarios
- For existing
blockchain_testcases: If the blocks field is present,benchmark_testwill execute using theblockchain_testformat:
blockchain_test(
genesis_environment=Environment(),
pre=pre,
post=post_state,
blocks=[Block(txs=txs)],
exclude_full_post_state_in_output=True,
)->
benchmark_test(
genesis_environment=Environment(),
pre=pre,
post=post_state,
blocks=[Block(txs=txs)],
exclude_full_post_state_in_output=True,
)- For existing
state_testinput: If only a single transaction is provided,benchmark_testwill convert it into ablockchain_test:
state_test(
env=Environment(),
pre=pre,
post={},
tx=tx,
)->
benchmark_test(
env=Environment(),
pre=pre,
post={},
tx=tx,
)In both scenarios, benchmark_test will:
- Verify the gas limit specified in the transaction.
- If EIP-7825 is active, compare the transaction gas limit against the 2**24 cap:
- If the limit exceeds the cap, split the test into multiple parts accordingly.
- If EIP-7825 is not active, proceed with the original gas limit.