Skip to content

Commit

Permalink
new(tests): add migrated CALLF execution test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Oct 24, 2024
1 parent e9d31bb commit c26bee0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions converted-ethereum-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ EOFTests/efValidation/EOF1_returncontract_invalid_.json
EOFTests/efValidation/EOF1_returncontract_valid_.json

EIPTests/StateTests/stEOF/stEIP3540/EOF1_Execution.json
EIPTests/StateTests/stEOF/stEIP5450/EOF1_CALLF_Execution.json

([#440](https://github.com/ethereum/execution-spec-tests/pull/440))
GeneralStateTests/Cancun/stEIP1153-transientStorage/01_tloadBeginningTxn.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,52 @@
),
],
),
Container(
name="store_value_unmodified_by_callf",
sections=[
Section.Code(
Op.PUSH2[value_code_worked] # to be stored after CALLF
+ Op.PUSH0 # input to CALLF
+ Op.CALLF[1]
+ Op.PUSH1[slot_code_worked]
+ Op.SSTORE
+ Op.STOP,
max_stack_height=2,
),
Section.Code(
Op.POP # clear input
+ Op.PUSH0 * 1023 # reach max stack height
+ Op.POP * 1023
+ Op.RETF, # return nothing
code_inputs=1,
code_outputs=0,
max_stack_height=1023,
),
],
),
Container(
name="with_rjumpi",
sections=[
Section.Code(
Op.PUSH1[1] # input[1] to CALLF
+ Op.PUSH0 # input[0] to CALLF
+ Op.CALLF[1]
+ Op.SSTORE(slot_code_worked, value_code_worked)
+ Op.STOP,
max_stack_height=2,
),
Section.Code(
Op.POP # clear input[0]
+ Op.RJUMPI[2 * 1023] # jump to RETF based on input[1]
+ Op.PUSH0 * 1023 # reach max stack height
+ Op.POP * 1023
+ Op.RETF, # return nothing
code_inputs=2,
code_outputs=0,
max_stack_height=1023,
),
],
),
),
ids=lambda x: x.name,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/osaka/eip7692_eof_v1/eof_tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@

### Execution

- [ ] Max stack size (1024) in CALLF-ed function (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP4200/EOF1_CALLF_ExecutionFiller.yml)
- [x] Max stack size (1024) in CALLF-ed function ([`tests/osaka/eip7692_eof_v1/eip4750_functions/test_callf_execution.py::test_callf_operand_stack_size_max`](./eip4750_functions/test_callf_execution/test_callf_operand_stack_size_max.md)


## EIP-6206: EOF - JUMPF and non-returning functions
Expand Down

0 comments on commit c26bee0

Please sign in to comment.