Skip to content

Commit

Permalink
feat(tests|fw): use verkle for forkname.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Aug 8, 2024
1 parent 346084a commit 2109bce
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/ethereum_test_forks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Paris,
Prague,
Shanghai,
ShanghaiEIP6800,
Verkle,
)
from .forks.transition import (
BerlinToLondonAt5,
Expand Down Expand Up @@ -62,7 +62,7 @@
"MuirGlacier",
"Shanghai",
"ShanghaiToCancunAtTime15k",
"ShanghaiEIP6800",
"Verkle",
"EIP6800Transition",
"Cancun",
"Prague",
Expand Down
14 changes: 7 additions & 7 deletions src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,14 @@ def engine_forkchoice_updated_version(
return 3


class ShanghaiEIP6800(
class Verkle(
Shanghai,
transition_tool_name="Prague",
blockchain_test_network_name="Prague",
transition_tool_name="Verkle",
blockchain_test_network_name="Verkle",
solc_name="shanghai",
):
"""
Shanghai + EIP-6800 (Verkle) fork
Verkle fork. Built on top of Shanghai. To update when the exact fork is known.
"""

@classmethod
Expand Down Expand Up @@ -675,11 +675,11 @@ def pre_allocation_blockchain(cls) -> Mapping:
return new_allocation | super(Shanghai, cls).pre_allocation_blockchain()


# TODO: move back to transition.py after filling and executing ShanghaiEIP6800 tests successfully
@transition_fork(to_fork=ShanghaiEIP6800, at_timestamp=32)
# TODO: move back to transition.py after filling and executing Verkle tests successfully
@transition_fork(to_fork=Verkle, at_timestamp=32)
class EIP6800Transition(
Shanghai,
blockchain_test_network_name="ShanghaiToPragueAtTime32",
blockchain_test_network_name="ShanghaiToVerkleAtTime32",
):
"""
Shanghai to Verkle transition at Timestamp 32.
Expand Down
4 changes: 2 additions & 2 deletions src/ethereum_test_specs/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
FixtureWithdrawalRequest,
InvalidFixtureBlock,
)
from ethereum_test_forks import EIP6800Transition, Fork, ShanghaiEIP6800
from ethereum_test_forks import EIP6800Transition, Fork, Verkle
from ethereum_test_types import (
Alloc,
ConsolidationRequest,
Expand Down Expand Up @@ -517,7 +517,7 @@ def generate_block_data(
requests = Requests(root=block.requests)
header.requests_root = requests.trie_root

if fork.fork_at(env.number, env.timestamp) == ShanghaiEIP6800:
if fork.fork_at(env.number, env.timestamp) == Verkle:
env = Environment(
**(
env.model_dump(exclude_none=True)
Expand Down
4 changes: 2 additions & 2 deletions src/evm_transition_tool/transition_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def _evaluate_filesystem(
]

# TODO: Verkle specific logic, update when Verkle fork is confirmed.
if t8n_data.fork_name == "Prague":
if t8n_data.fork_name == "Verkle":
output_paths["vkt"] = os.path.join("output", "vkt.json")
args.extend(["--output.vkt", output_paths["vkt"]])
if t8n_data.vkt is not None:
Expand Down Expand Up @@ -448,7 +448,7 @@ def construct_args_stream(
]

# TODO: Verkle specific logic, update when Verkle fork is confirmed.
if t8n_data.fork_name == "Prague":
if t8n_data.fork_name == "Verkle":
args.append("--output.vkt=stdout")
if t8n_data.vkt is not None:
args.append("--input.vkt=stdin")
Expand Down
20 changes: 18 additions & 2 deletions src/pytest_plugins/consume/hive_simulators/ruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
"HIVE_SHANGHAI_TIMESTAMP": 0,
"HIVE_CANCUN_TIMESTAMP": 15000,
},
"ShanghaiToPragueAtTime32": { # TODO: Make this verkle specific
"ShanghaiToVerkleAtTime32": {
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
Expand All @@ -335,7 +335,23 @@
"HIVE_FORK_MERGE": 0,
"HIVE_TERMINAL_TOTAL_DIFFICULTY": 0,
"HIVE_SHANGHAI_TIMESTAMP": 0,
"HIVE_PRAGUE_TIMESTAMP": 32,
"HIVE_VERKLE_TIMESTAMP": 32,
},
"Verkle": {
"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,
"HIVE_VERKLE_TIMESTAMP": 0,
},
"Prague": {
"HIVE_FORK_HOMESTEAD": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
Test cases for all EIPs in Verkle
"""

VERKLE_FORK_NAME = "ShanghaiEIP6800"
VERKLE_FORK_NAME = "Verkle"
VERKLE_TRANSITION_FORK_NAME = "EIP6800Transition"
File renamed without changes.

0 comments on commit 2109bce

Please sign in to comment.