You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(execute): add gas validation for benchmark tests in execute mode (#2219)
* fix(execute): add gas validation for benchmark tests in execute mode
Previously, execute mode was not validating that transactions consumed
the expected amount of gas when expected_benchmark_gas_used was set.
This could cause benchmark tests to incorrectly pass even when consuming
significantly less gas than expected (e.g., due to missing factory contracts).
This feature is needed by benchmark tests like the ones in #2186 in
order to make sure that the benchmarks are indeed consuming all gas
available or causing a failure otherwise when the flag is set.
Changes:
- Add expected_benchmark_gas_used and skip_gas_used_validation fields to TransactionPost
- Implement gas validation logic in TransactionPost.execute() using transaction receipts
- Pass gas validation parameters from StateTest and BlockchainTest to TransactionPost
- Add eth_getTransactionReceipt RPC method to fetch gas used from receipts
This ensures benchmark tests fail appropriately when gas consumption doesn't match
expectations, preventing false positives in performance testing.
* refactor(execute): simplify gas validation implementation
Addresses review comment to make execute mode gas validation cleaner:
- Set expected_benchmark_gas_used to gas_benchmark_value as default in execute parametrizer
- Remove gas_benchmark_value parameter from TransactionPost, StateTest, BlockchainTest, and BaseTest
- Simplify gas validation logic in TransactionPost
This ensures consistent gas validation behavior between fill and execute modes
with a cleaner implementation that sets defaults at the parametrizer level.
0 commit comments