Skip to content

Commit

Permalink
new(tests): EOF - EIP-7069: Test EOF calls to p256verify (#1021)
Browse files Browse the repository at this point in the history
Since RIP-7212 has been in and out of prague some clients have it
activated when it should not be. Verify the precompile does nothing.

Signed-off-by: Danno Ferrin <[email protected]>
  • Loading branch information
shemnon authored Dec 16, 2024
1 parent dc05b42 commit 1496c64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/osaka/eip7692_eof_v1/eip7069_extcall/test_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ def test_eof_calls_eof_mstore(
# `blake2f`` is chosen for the test because it fails unless args_size == 213, which is what we are
# interested in.
blake2f = Address(0x09)
# `p256verify` / RIP-7212 has been in and out of prague and osaka. Hence we need to test explicitly
p256verify = Address(0x100)


@pytest.mark.parametrize(
Expand All @@ -333,6 +335,11 @@ def test_eof_calls_eof_mstore(
pytest.param(Op.EXTCALL, blake2f, EXTCALL_FAILURE, id="extcall_failure"),
pytest.param(Op.EXTDELEGATECALL, blake2f, EXTCALL_REVERT, id="extdelegatecall_blocked2"),
pytest.param(Op.EXTSTATICCALL, blake2f, EXTCALL_FAILURE, id="extstaticcall_failure"),
pytest.param(Op.EXTCALL, p256verify, EXTCALL_SUCCESS, id="extcall_p256verify"),
pytest.param(
Op.EXTDELEGATECALL, p256verify, EXTCALL_REVERT, id="extdelegatecall_p256verify"
),
pytest.param(Op.EXTSTATICCALL, p256verify, EXTCALL_SUCCESS, id="extstaticcall_p256verify"),
],
)
def test_eof_calls_precompile(
Expand Down Expand Up @@ -362,11 +369,13 @@ def test_eof_calls_precompile(
gas_limit=5000000,
)

success_identity = expected_result == EXTCALL_SUCCESS and precompile == identity

calling_storage = {
slot_code_worked: value_code_worked,
slot_call_result: expected_result,
slot_returndatasize: 32 if expected_result == EXTCALL_SUCCESS else 0,
slot_returndata: value_returndata_magic if expected_result == EXTCALL_SUCCESS else 0,
slot_returndatasize: 32 if success_identity else 0,
slot_returndata: value_returndata_magic if success_identity else 0,
}

post = {
Expand Down
1 change: 1 addition & 0 deletions whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ ori
origin
P1
P2
p256verify
parseable
passthrough
pathlib
Expand Down

0 comments on commit 1496c64

Please sign in to comment.