Skip to content

Commit d6d6ddf

Browse files
committed
feat(forks): Add max request type to fork
1 parent 1778558 commit d6d6ddf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/ethereum_test_forks/base_fork.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ def create_opcodes(
317317
"""
318318
pass
319319

320+
@classmethod
321+
@abstractmethod
322+
def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int:
323+
"""
324+
Returns the max request type supported by the fork.
325+
"""
326+
pass
327+
320328
# Meta information about the fork
321329
@classmethod
322330
def name(cls) -> str:

src/ethereum_test_forks/forks/forks.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,13 @@ def create_opcodes(
357357
(Opcodes.CREATE, EVMCodeType.LEGACY),
358358
]
359359

360+
@classmethod
361+
def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int:
362+
"""
363+
At genesis, no request type is supported, signaled by -1
364+
"""
365+
return -1
366+
360367
@classmethod
361368
def pre_allocation(cls) -> Mapping:
362369
"""
@@ -862,6 +869,13 @@ def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Add
862869
SystemContract.BLOCK_HISTORY_CONTRACT,
863870
] + super(Prague, cls).system_contracts(block_number, timestamp)
864871

872+
@classmethod
873+
def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int:
874+
"""
875+
At Prague, three request types are introduced, hence the max request type is 2
876+
"""
877+
return 2
878+
865879
@classmethod
866880
def pre_allocation_blockchain(cls) -> Mapping:
867881
"""

0 commit comments

Comments
 (0)