Skip to content

Commit

Permalink
pytest_plugins/consume_via_engine_api: Initialize fork ruleset.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Dec 1, 2023
1 parent ca58d33 commit 7c741df
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/pytest_plugins/consume_via_engine_api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
A hive simulator that executes blocks against clients using the Engine API.
"""
80 changes: 80 additions & 0 deletions src/pytest_plugins/consume_via_engine_api/client_fork_ruleset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
"""
Fork rules for clients ran within hive, starting from the Merge fork as
we are executing blocks using the Engine API.
"""

# TODO: 1) Can we programmatically generate this?
# TODO: 2) Can we generate a single ruleset for both rlp and engine_api simulators.
forks = {
"Merge": {
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
"HIVE_FORK_BYZANTIUM": 0,
"HIVE_FORK_CONSTANTINOPLE": 0,
"HIVE_FORK_PETERSBURG": 0,
"HIVE_FORK_ISTANBUL": 0,
"HIVE_FORK_BERLIN": 0,
"HIVE_FORK_LONDON": 0,
"HIVE_FORK_MERGE": 0,
"HIVE_TERMINAL_TOTAL_DIFFICULTY": 0,
},
"Shanghai": {
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
"HIVE_FORK_BYZANTIUM": 0,
"HIVE_FORK_CONSTANTINOPLE": 0,
"HIVE_FORK_PETERSBURG": 0,
"HIVE_FORK_ISTANBUL": 0,
"HIVE_FORK_BERLIN": 0,
"HIVE_FORK_LONDON": 0,
"HIVE_FORK_MERGE": 0,
"HIVE_TERMINAL_TOTAL_DIFFICULTY": 0,
"HIVE_SHANGHAI_TIMESTAMP": 0,
},
"MergeToShanghaiAtTime15k": {
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
"HIVE_FORK_BYZANTIUM": 0,
"HIVE_FORK_CONSTANTINOPLE": 0,
"HIVE_FORK_PETERSBURG": 0,
"HIVE_FORK_ISTANBUL": 0,
"HIVE_FORK_BERLIN": 0,
"HIVE_FORK_LONDON": 0,
"HIVE_FORK_MERGE": 0,
"HIVE_TERMINAL_TOTAL_DIFFICULTY": 0,
"HIVE_SHANGHAI_TIMESTAMP": 15000,
},
"Cancun": {
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
"HIVE_FORK_BYZANTIUM": 0,
"HIVE_FORK_CONSTANTINOPLE": 0,
"HIVE_FORK_PETERSBURG": 0,
"HIVE_FORK_ISTANBUL": 0,
"HIVE_FORK_BERLIN": 0,
"HIVE_FORK_LONDON": 0,
"HIVE_FORK_MERGE": 0,
"HIVE_TERMINAL_TOTAL_DIFFICULTY": 0,
"HIVE_SHANGHAI_TIMESTAMP": 0,
"HIVE_CANCUN_TIMESTAMP": 0,
},
"ShanghaiToCancunAtTime15k": {
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
"HIVE_FORK_BYZANTIUM": 0,
"HIVE_FORK_CONSTANTINOPLE": 0,
"HIVE_FORK_PETERSBURG": 0,
"HIVE_FORK_ISTANBUL": 0,
"HIVE_FORK_BERLIN": 0,
"HIVE_FORK_LONDON": 0,
"HIVE_FORK_MERGE": 0,
"HIVE_TERMINAL_TOTAL_DIFFICULTY": 0,
"HIVE_SHANGHAI_TIMESTAMP": 0,
"HIVE_CANCUN_TIMESTAMP": 15000,
},
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
A hive simulator that feeds blocks from test fixtures to clients via the Engine API.
A hive simulator that executes blocks against clients using the `engine_newPayloadVX` method from
the Engine API, verifying the appropriate VALID/INVALID responses.
Implemented using the pytest framework as a pytest plugin.
"""

0 comments on commit 7c741df

Please sign in to comment.