Skip to content

Commit 2302246

Browse files
refactor(tests): add checklist marker for eip7883 (#2098)
* refactor: add checklist marker for eip7883 * doc: update eip checklist template * refactor: update modexp test and add checklist marker * chore: update checklist rules * refactor: enhance modexp checklist descriptions for clarity * refactor: update coverage table and check gas usage * fix rebase issue * chore: remove outdated entry from modexp checklist * refactor: expand modexp checklist with external coverage entries * refactor: adjust gas usage assertion for only Osaka fork * refactor: overwrite id and add comment
1 parent 365d927 commit 2302246

File tree

6 files changed

+306
-74
lines changed

6 files changed

+306
-74
lines changed

docs/writing_tests/checklist_templates/eip_testing_checklist_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ If the precompile requires a minimum value (fee) to execute, either constant or
409409

410410
If the precompile does not require any minimum value (fee) to execute.
411411

412-
| ID | Description | Status | Tests |
413-
| ------------------------------------------------ | ----------------------------- | ------ | ----- |
412+
| ID | Description | Status | Tests |
413+
| ---------------------------------------------- | ---------------------------------------------------------------- | ------ | ----- |
414414
| `precompile/test/value_transfer/no_fee` | Sending non-zero value does not cause an exception (unless otherwise specified by the EIP). | | |
415415

416416
#### Out-of-bounds checks

tests/osaka/eip7883_modexp_gas_increase/conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,14 @@ def gas_measure_contract(
119119
assert call_opcode in [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL]
120120
value = [0] if call_opcode in [Op.CALL, Op.CALLCODE] else []
121121

122+
gas_used = (
123+
precompile_gas + precompile_gas_modifier
124+
if precompile_gas_modifier != float("inf")
125+
else Environment().gas_limit
126+
)
127+
122128
call_code = call_opcode(
123-
precompile_gas + precompile_gas_modifier,
129+
gas_used,
124130
Spec.MODEXP_ADDRESS,
125131
*value,
126132
0,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
precompile/test/call_contexts/set_code = Covered in EIP-7702 cases
2+
precompile/test/inputs/max_values = Covered in osaka/eip7823_modexp_upper_bounds
3+
precompile/test/out_of_bounds/max = Covered in osaka/eip7823_modexp_upper_bounds
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
precompile/test/value_transfer/fee/under = No value is required
2+
precompile/test/value_transfer/fee/exact = No value is required
3+
precompile/test/value_transfer/fee/over = No value is required
4+
precompile/test/input_lengths/static/correct = The Modexp input length is not static
5+
precompile/test/input_lengths/static/too_short = The Modexp input length is not static
6+
precompile/test/input_lengths/static/too_long = The Modexp input length is not static
7+
precompile/test/input_lengths/dynamic/too_short = there would be no padding for precompile
8+
precompile/test/gas_usage/constant/oog = The Modexp gas cost is dynamic
9+
precompile/test/gas_usage/constant/exact = The Modexp gas cost is dynamic
10+
precompile/test/fork_transition/before/invalid_input = Modexp is not new precompile, it is still valid befork fork activation
11+
precompile/test/fork_transition/before/zero_gas = Modexp is not new precompile, it is still valid befork fork activation
12+
precompile/test/fork_transition/before/cold = Modexp is not new precompile, it is still valid befork fork activation
13+
gas_cost_changes/test/out_of_gas = No Out-of-gas scenario in Modexp
14+
system_contract = EIP does not include a new system contract
15+
opcode = EIP does not introduce a new opcode
16+
removed_precompile = EIP does not remove a precompile
17+
transaction_type = EIP does not introduce a new transaction type
18+
block_header_field = EIP does not add any new block header fields
19+
gas_refunds_changes = EIP does not introduce any gas refund changes
20+
blob_count_changes = EIP does not introduce any blob count changes
21+
execution_layer_request = EIP does not introduce an execution layer request
22+
new_transaction_validity_constraint = EIP does not introduce a new transaction validity constraint
23+
modified_transaction_validity_constraint = EIP does not introduce a modified transaction validity constraint
24+
block_body_field = EIP does not add any new block body fields

0 commit comments

Comments
 (0)