Skip to content

Commit

Permalink
fix(fw): fix verkle transition tests (naive).
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Jul 30, 2024
1 parent fb9c617 commit 8afe9de
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/ethereum_test_base_types/conversions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common conversion methods.
"""

from re import sub
from typing import Any, List, Optional, SupportsBytes, TypeAlias

Expand Down
8 changes: 8 additions & 0 deletions src/ethereum_test_forks/base_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,14 @@ def fork_at(cls, block_number: int = 0, timestamp: int = 0) -> Type["BaseFork"]:
"""
return cls

@classmethod
def transition_at(cls) -> int:
"""
Return the timestamp at which the fork will start transitioning to the next fork.
Useful only for transition forks.
"""
return 0

@classmethod
@abstractmethod
def transition_tool_name(cls, block_number: int = 0, timestamp: int = 0) -> str:
Expand Down
7 changes: 6 additions & 1 deletion src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,12 @@ class EIP6800Transition(
Shanghai to Verkle transition at Timestamp 32.
"""

pass
@classmethod
def transition_at(cls) -> int:
"""
The timestamp at which the fork transition occurs.
"""
return 32


class CancunEIP7692(
Expand Down
4 changes: 2 additions & 2 deletions src/evm_transition_tool/geth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from re import compile
from typing import Optional

from ethereum_test_base_types import to_json
from ethereum_test_forks import Fork
from ethereum_test_tools.common.json import to_json
from ethereum_test_tools.common.types import Alloc, VerkleTree
from ethereum_test_types import Alloc, VerkleTree

from .transition_tool import FixtureFormats, TransitionTool, dump_files_to_directory

Expand Down
13 changes: 13 additions & 0 deletions src/evm_transition_tool/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
DepositRequest,
Environment,
Transaction,
VerkleTree,
WithdrawalRequest,
)

Expand Down Expand Up @@ -88,6 +89,16 @@ class Result(CamelModel):
withdrawal_requests: List[WithdrawalRequest] | None = None
consolidation_requests: List[ConsolidationRequest] | None = None

# Verkle fields within the result
verkle_conversion_address: Address | None = Field(None, alias="currentConversionAddress")
verkle_conversion_slot_hash: Hash | None = Field(None, alias="currentConversionSlotHash")
verkle_conversion_started: bool | None = Field(None, alias="currentConversionStarted")
verkle_conversion_ended: bool | None = Field(None, alias="currentConversionEnded")
verkle_conversion_storage_processed: bool | None = Field(
None,
alias="currentConversionStorageProcessed",
)


class TransitionToolInput(CamelModel):
"""
Expand All @@ -97,6 +108,7 @@ class TransitionToolInput(CamelModel):
alloc: Alloc
txs: List[Transaction]
env: Environment
vkt: VerkleTree | None = None


class TransitionToolOutput(CamelModel):
Expand All @@ -107,3 +119,4 @@ class TransitionToolOutput(CamelModel):
alloc: Alloc
result: Result
body: Bytes | None = None
vkt: VerkleTree | None = None
2 changes: 1 addition & 1 deletion 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,
},
"ShanghaiToPragueAt32": { # TODO: Make this verkle specific
"ShanghaiToPragueAtTime32": { # TODO: Make this verkle specific
"HIVE_FORK_HOMESTEAD": 0,
"HIVE_FORK_TANGERINE": 0,
"HIVE_FORK_SPURIOUS": 0,
Expand Down

0 comments on commit 8afe9de

Please sign in to comment.