diff --git a/src/ethereum_test_forks/base_fork.py b/src/ethereum_test_forks/base_fork.py index aafcf8f9ff..793b51e99c 100644 --- a/src/ethereum_test_forks/base_fork.py +++ b/src/ethereum_test_forks/base_fork.py @@ -317,6 +317,14 @@ def create_opcodes( """ pass + @classmethod + @abstractmethod + def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int: + """ + Returns the max request type supported by the fork. + """ + pass + # Meta information about the fork @classmethod def name(cls) -> str: diff --git a/src/ethereum_test_forks/forks/forks.py b/src/ethereum_test_forks/forks/forks.py index 8eb671a861..e9dbd3e07b 100644 --- a/src/ethereum_test_forks/forks/forks.py +++ b/src/ethereum_test_forks/forks/forks.py @@ -357,6 +357,13 @@ def create_opcodes( (Opcodes.CREATE, EVMCodeType.LEGACY), ] + @classmethod + def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int: + """ + At genesis, no request type is supported, signaled by -1 + """ + return -1 + @classmethod def pre_allocation(cls) -> Mapping: """ @@ -862,6 +869,13 @@ def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Add SystemContract.BLOCK_HISTORY_CONTRACT, ] + super(Prague, cls).system_contracts(block_number, timestamp) + @classmethod + def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int: + """ + At Prague, three request types are introduced, hence the max request type is 2 + """ + return 2 + @classmethod def pre_allocation_blockchain(cls) -> Mapping: """