ethereum / ethereum/execution-specs

feat(test-specs): filter system contracts by call phase in the framework, not in tests

Open
#3,584 0 comments 0 reactions 1 assignee Claimed by @fselmo View on GitHub
A-test-specs C-feat P-low
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

#3484 added the request axis (`fork.system_contract_request_types()`, `with_all_system_contract_request_types`). The phase axis, which predeploys the block calls, only exists as the raw `fork.system_contract_call_phases()` mapping, so tests filter it by hand (see [here](https://github.com/ethereum/execution-specs/blob/forks/amsterdam/tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_system_call_reads.py#L221) and [here](https://github.com/ethereum/execution-specs/blob/forks/amsterdam/tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_system_call_reads.py#L121-L125)). The two sets differ... deposits are a request with no call, beacon roots and history are calls with no request.

This is lower priority but something like this could be ideal:

- `fork.system_contracts(phase=None)` to filter the existing accessor by `SystemCallPhase`. Deposits already declare `NONE` and drop out.
- `with_all_system_contracts(phase=...)` on the existing marker (rather than using a lambda to filter every time).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.