diff --git a/docs/writing_tests/fork_methods.md b/docs/writing_tests/fork_methods.md index 0c7b5eb9727..d199a14ca86 100644 --- a/docs/writing_tests/fork_methods.md +++ b/docs/writing_tests/fork_methods.md @@ -190,7 +190,7 @@ Example of adding a new method: ```python @classmethod @abstractmethod -def supports_new_feature(cls, block_number: int = 0, timestamp: int = 0) -> bool: +def supports_new_feature(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return whether the given fork supports the new feature.""" pass ``` @@ -199,7 +199,7 @@ Implementation in a fork class: ```python @classmethod -def supports_new_feature(cls, block_number: int = 0, timestamp: int = 0) -> bool: +def supports_new_feature(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return whether the given fork supports the new feature.""" return False # Frontier doesn't support this feature ``` @@ -208,7 +208,7 @@ Implementation in a newer fork class: ```python @classmethod -def supports_new_feature(cls, block_number: int = 0, timestamp: int = 0) -> bool: +def supports_new_feature(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return whether the given fork supports the new feature.""" return True # This fork does support the feature ``` diff --git a/src/ethereum_test_forks/base_fork.py b/src/ethereum_test_forks/base_fork.py index 1a15d34149e..0a94f484b53 100644 --- a/src/ethereum_test_forks/base_fork.py +++ b/src/ethereum_test_forks/base_fork.py @@ -169,49 +169,49 @@ def __init_subclass__( # Header information abstract methods @classmethod @abstractmethod - def header_base_fee_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_base_fee_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain base fee.""" pass @classmethod @abstractmethod - def header_prev_randao_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_prev_randao_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain Prev Randao value.""" pass @classmethod @abstractmethod - def header_zero_difficulty_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_zero_difficulty_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must have difficulty zero.""" pass @classmethod @abstractmethod - def header_withdrawals_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_withdrawals_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain withdrawals.""" pass @classmethod @abstractmethod - def header_excess_blob_gas_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_excess_blob_gas_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain excess blob gas.""" pass @classmethod @abstractmethod - def header_blob_gas_used_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_blob_gas_used_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain blob gas used.""" pass @classmethod @abstractmethod - def header_beacon_root_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_beacon_root_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain parent beacon block root.""" pass @classmethod @abstractmethod - def header_requests_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_requests_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the header must contain beacon chain requests.""" pass @@ -219,14 +219,14 @@ def header_requests_required(cls, block_number: int = 0, timestamp: int = 0) -> @classmethod @abstractmethod - def gas_costs(cls, block_number: int = 0, timestamp: int = 0) -> GasCosts: + def gas_costs(cls, *, block_number: int = 0, timestamp: int = 0) -> GasCosts: """Return dataclass with the gas costs constants for the fork.""" pass @classmethod @abstractmethod def memory_expansion_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> MemoryExpansionGasCalculator: """Return a callable that calculates the gas cost of memory expansion for the fork.""" pass @@ -234,7 +234,7 @@ def memory_expansion_gas_calculator( @classmethod @abstractmethod def calldata_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> CalldataGasCalculator: """ Return callable that calculates the transaction gas cost for its calldata @@ -245,7 +245,7 @@ def calldata_gas_calculator( @classmethod @abstractmethod def transaction_data_floor_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionDataFloorCostCalculator: """Return a callable that calculates the transaction floor cost due to its calldata.""" pass @@ -253,7 +253,7 @@ def transaction_data_floor_cost_calculator( @classmethod @abstractmethod def transaction_intrinsic_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionIntrinsicCostCalculator: """Return callable that calculates the intrinsic gas cost of a transaction for the fork.""" pass @@ -261,7 +261,7 @@ def transaction_intrinsic_cost_calculator( @classmethod @abstractmethod def blob_gas_price_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> BlobGasPriceCalculator: """Return a callable that calculates the blob gas price at a given fork.""" pass @@ -269,57 +269,57 @@ def blob_gas_price_calculator( @classmethod @abstractmethod def excess_blob_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> ExcessBlobGasCalculator: """Return a callable that calculates the excess blob gas for a block at a given fork.""" pass @classmethod @abstractmethod - def min_base_fee_per_blob_gas(cls, block_number: int = 0, timestamp: int = 0) -> int: + def min_base_fee_per_blob_gas(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the minimum base fee per blob gas at a given fork.""" pass @classmethod @abstractmethod - def blob_gas_per_blob(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_gas_per_blob(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the amount of blob gas used per blob at a given fork.""" pass @classmethod @abstractmethod - def blob_base_fee_update_fraction(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_base_fee_update_fraction(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the blob base fee update fraction at a given fork.""" pass @classmethod @abstractmethod - def supports_blobs(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def supports_blobs(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return whether the given fork supports blobs or not.""" pass @classmethod @abstractmethod - def target_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def target_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the target blobs per block at a given fork.""" pass @classmethod @abstractmethod - def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def max_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the max blobs per block at a given fork.""" pass @classmethod @prefer_transition_to_method @abstractmethod - def blob_schedule(cls, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None: + def blob_schedule(cls, *, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None: """Return the blob schedule up until the given fork.""" pass @classmethod @abstractmethod - def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: + def get_reward(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return expected reward amount in wei of a given fork.""" pass @@ -327,18 +327,20 @@ def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: @classmethod @abstractmethod - def tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """Return list of the transaction types supported by the fork.""" pass @classmethod @abstractmethod - def contract_creating_tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def contract_creating_tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """Return list of the transaction types supported by the fork that can create contracts.""" pass @classmethod @abstractmethod + + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: def transaction_gas_limit_cap(cls, block_number: int = 0, timestamp: int = 0) -> int | None: """Return the transaction gas limit cap, or None if no limit is imposed.""" pass @@ -351,7 +353,7 @@ def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address] @classmethod @abstractmethod - def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def system_contracts(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """Return list system-contracts supported by the fork.""" pass @@ -383,7 +385,7 @@ def pre_allocation_blockchain(cls) -> Mapping: @classmethod @abstractmethod def engine_new_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """ Return `None` if this fork's payloads cannot be sent over the engine API, @@ -393,7 +395,7 @@ def engine_new_payload_version( @classmethod @abstractmethod - def engine_new_payload_blob_hashes(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_blob_hashes(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """ Return true if the engine api version requires new payload calls to include blob hashes. @@ -402,7 +404,7 @@ def engine_new_payload_blob_hashes(cls, block_number: int = 0, timestamp: int = @classmethod @abstractmethod - def engine_new_payload_beacon_root(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_beacon_root(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """ Return true if the engine api version requires new payload calls to include a parent beacon block root. @@ -411,14 +413,14 @@ def engine_new_payload_beacon_root(cls, block_number: int = 0, timestamp: int = @classmethod @abstractmethod - def engine_new_payload_requests(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_requests(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Return true if the engine api version requires new payload calls to include requests.""" pass @classmethod @abstractmethod def engine_new_payload_target_blobs_per_block( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> bool: """ Return true if the engine api version requires new payload calls to include @@ -429,7 +431,7 @@ def engine_new_payload_target_blobs_per_block( @classmethod @abstractmethod def engine_payload_attribute_target_blobs_per_block( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> bool: """Return true if the payload attributes include the target blobs per block.""" pass @@ -437,7 +439,7 @@ def engine_payload_attribute_target_blobs_per_block( @classmethod @abstractmethod def engine_payload_attribute_max_blobs_per_block( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> bool: """Return true if the payload attributes include the max blobs per block.""" pass @@ -445,7 +447,7 @@ def engine_payload_attribute_max_blobs_per_block( @classmethod @abstractmethod def engine_forkchoice_updated_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """Return `None` if the forks canonical chain cannot be set using the forkchoice method.""" pass @@ -453,7 +455,7 @@ def engine_forkchoice_updated_version( @classmethod @abstractmethod def engine_get_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """ Return `None` if the forks canonical chain cannot build a payload using the engine @@ -463,14 +465,14 @@ def engine_get_payload_version( @classmethod @abstractmethod - def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) -> Optional[int]: + def engine_get_blobs_version(cls, *, block_number: int = 0, timestamp: int = 0) -> Optional[int]: """Return `None` if the fork does not support the engine get blobs version.""" pass # EVM information abstract methods @classmethod @abstractmethod - def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]: + def evm_code_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]: """Return list of EVM code types supported by the fork.""" pass @@ -489,7 +491,7 @@ def max_initcode_size(cls) -> int: @classmethod @abstractmethod def call_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """Return list of tuples with the call opcodes and its corresponding EVM code type.""" pass @@ -505,14 +507,14 @@ def valid_opcodes( @classmethod @abstractmethod def create_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """Return list of tuples with the create opcodes and its corresponding EVM code type.""" pass @classmethod @abstractmethod - def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int: + def max_request_type(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return max request type supported by the fork.""" pass @@ -523,7 +525,7 @@ def name(cls) -> str: return cls.__name__ @classmethod - def fork_at(cls, block_number: int = 0, timestamp: int = 0) -> Type["BaseFork"]: + def fork_at(cls, *, block_number: int = 0, timestamp: int = 0) -> Type["BaseFork"]: """ Return fork at the given block number and timestamp. Useful only for transition forks, and it's a no-op for normal forks. @@ -532,7 +534,7 @@ def fork_at(cls, block_number: int = 0, timestamp: int = 0) -> Type["BaseFork"]: @classmethod @abstractmethod - def transition_tool_name(cls, block_number: int = 0, timestamp: int = 0) -> str: + def transition_tool_name(cls, *, block_number: int = 0, timestamp: int = 0) -> str: """Return fork name as it's meant to be passed to the transition tool for execution.""" pass diff --git a/src/ethereum_test_forks/forks/forks.py b/src/ethereum_test_forks/forks/forks.py index d37c49dc820..1cb789fdd4b 100644 --- a/src/ethereum_test_forks/forks/forks.py +++ b/src/ethereum_test_forks/forks/forks.py @@ -33,7 +33,7 @@ class Frontier(BaseFork, solc_name="homestead"): """Frontier fork.""" @classmethod - def transition_tool_name(cls, block_number: int = 0, timestamp: int = 0) -> str: + def transition_tool_name(cls, *, block_number: int = 0, timestamp: int = 0) -> str: """Return fork name as it's meant to be passed to the transition tool for execution.""" if cls._transition_tool_name is not None: return cls._transition_tool_name @@ -52,37 +52,37 @@ def solc_min_version(cls) -> Version: return Version.parse("0.8.20") @classmethod - def header_base_fee_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_base_fee_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain base fee.""" return False @classmethod - def header_prev_randao_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_prev_randao_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain Prev Randao value.""" return False @classmethod - def header_zero_difficulty_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_zero_difficulty_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not have difficulty zero.""" return False @classmethod - def header_withdrawals_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_withdrawals_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain withdrawals.""" return False @classmethod - def header_excess_blob_gas_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_excess_blob_gas_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain excess blob gas.""" return False @classmethod - def header_blob_gas_used_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_blob_gas_used_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain blob gas used.""" return False @classmethod - def gas_costs(cls, block_number: int = 0, timestamp: int = 0) -> GasCosts: + def gas_costs(cls, *, block_number: int = 0, timestamp: int = 0) -> GasCosts: """Return dataclass with the defined gas costs constants for genesis.""" return GasCosts( G_JUMPDEST=1, @@ -129,7 +129,7 @@ def gas_costs(cls, block_number: int = 0, timestamp: int = 0) -> GasCosts: @classmethod def memory_expansion_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> MemoryExpansionGasCalculator: """Return callable that calculates the gas cost of memory expansion for the fork.""" gas_costs = cls.gas_costs(block_number, timestamp) @@ -149,7 +149,7 @@ def c(w: int) -> int: @classmethod def calldata_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> CalldataGasCalculator: """ Return callable that calculates the transaction gas cost for its calldata @@ -170,7 +170,7 @@ def fn(*, data: BytesConvertible, floor: bool = False) -> int: @classmethod def transaction_data_floor_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionDataFloorCostCalculator: """At frontier, the transaction data floor cost is a constant zero.""" @@ -181,11 +181,14 @@ def fn(*, data: BytesConvertible) -> int: @classmethod def transaction_intrinsic_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionIntrinsicCostCalculator: """Return callable that calculates the intrinsic gas cost of a transaction for the fork.""" gas_costs = cls.gas_costs(block_number, timestamp) - calldata_gas_calculator = cls.calldata_gas_calculator(block_number, timestamp) + calldata_gas_calculator = cls.calldata_gas_calculator( + block_number=block_number, + timestamp=timestamp + ) def fn( *, @@ -213,84 +216,84 @@ def fn( @classmethod def blob_gas_price_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> BlobGasPriceCalculator: """Return a callable that calculates the blob gas price at a given fork.""" raise NotImplementedError(f"Blob gas price calculator is not supported in {cls.name()}") @classmethod def excess_blob_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> ExcessBlobGasCalculator: """Return a callable that calculates the excess blob gas for a block at a given fork.""" raise NotImplementedError(f"Excess blob gas calculator is not supported in {cls.name()}") @classmethod - def min_base_fee_per_blob_gas(cls, block_number: int = 0, timestamp: int = 0) -> int: + def min_base_fee_per_blob_gas(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the amount of blob gas used per blob at a given fork.""" raise NotImplementedError(f"Base fee per blob gas is not supported in {cls.name()}") @classmethod - def blob_base_fee_update_fraction(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_base_fee_update_fraction(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the blob base fee update fraction at a given fork.""" raise NotImplementedError( f"Blob base fee update fraction is not supported in {cls.name()}" ) @classmethod - def blob_gas_per_blob(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_gas_per_blob(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the amount of blob gas used per blob at a given fork.""" return 0 @classmethod - def supports_blobs(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def supports_blobs(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Blobs are not supported at Frontier.""" return False @classmethod - def target_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def target_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the target number of blobs per block at a given fork.""" raise NotImplementedError(f"Target blobs per block is not supported in {cls.name()}") @classmethod - def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def max_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the max number of blobs per block at a given fork.""" raise NotImplementedError(f"Max blobs per block is not supported in {cls.name()}") @classmethod - def blob_schedule(cls, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None: + def blob_schedule(cls, *, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None: """At genesis, no blob schedule is used.""" return None @classmethod - def header_requests_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_requests_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain beacon chain requests.""" return False @classmethod def engine_new_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """At genesis, payloads cannot be sent through the engine API.""" return None @classmethod - def header_beacon_root_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_beacon_root_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, header must not contain parent beacon block root.""" return False @classmethod - def engine_new_payload_blob_hashes(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_blob_hashes(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, payloads do not have blob hashes.""" return False @classmethod - def engine_new_payload_beacon_root(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_beacon_root(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, payloads do not have a parent beacon block root.""" return False @classmethod - def engine_new_payload_requests(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_requests(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At genesis, payloads do not have requests.""" return False @@ -305,39 +308,39 @@ def engine_new_payload_target_blobs_per_block( @classmethod def engine_payload_attribute_target_blobs_per_block( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> bool: """At genesis, payload attributes do not include the target blobs per block.""" return False @classmethod def engine_payload_attribute_max_blobs_per_block( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> bool: """At genesis, payload attributes do not include the max blobs per block.""" return False @classmethod def engine_forkchoice_updated_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """At genesis, forkchoice updates cannot be sent through the engine API.""" return cls.engine_new_payload_version(block_number, timestamp) @classmethod def engine_get_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """At genesis, payloads cannot be retrieved through the engine API.""" return cls.engine_new_payload_version(block_number, timestamp) @classmethod - def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) -> Optional[int]: + def engine_get_blobs_version(cls, *, block_number: int = 0, timestamp: int = 0) -> Optional[int]: """At genesis, blobs cannot be retrieved through the engine API.""" return None @classmethod - def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: + def get_reward(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """ At Genesis the expected reward amount in wei is 5_000_000_000_000_000_000. @@ -345,32 +348,36 @@ def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: return 5_000_000_000_000_000_000 @classmethod - def tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At Genesis, only legacy transactions are allowed.""" return [0] @classmethod - def contract_creating_tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def contract_creating_tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At Genesis, only legacy transactions are allowed.""" return [0] @classmethod + + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def transaction_gas_limit_cap(cls, block_number: int = 0, timestamp: int = 0) -> int | None: """At Genesis, no transaction gas limit cap is imposed.""" return None @classmethod def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + """At Genesis, no pre-compiles are present.""" return [] @classmethod - def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def system_contracts(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """At Genesis, no system-contracts are present.""" return [] @classmethod - def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]: + def evm_code_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]: """At Genesis, only legacy EVM code is supported.""" return [EVMCodeType.LEGACY] @@ -388,7 +395,7 @@ def max_initcode_size(cls) -> int: @classmethod def call_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """Return list of call opcodes supported by the fork.""" return [ @@ -535,7 +542,7 @@ def valid_opcodes( @classmethod def create_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """At Genesis, only `CREATE` opcode is supported.""" return [ @@ -543,7 +550,7 @@ def create_opcodes( ] @classmethod - def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int: + 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 @@ -570,7 +577,7 @@ class Homestead(Frontier): """Homestead fork.""" @classmethod - def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """ At Homestead, EC-recover, SHA256, RIPEMD160, and Identity pre-compiles are introduced. @@ -581,7 +588,7 @@ def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address] @classmethod def call_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """At Homestead, DELEGATECALL opcode was introduced.""" return [(Opcodes.DELEGATECALL, EVMCodeType.LEGACY)] + super(Homestead, cls).call_opcodes( @@ -597,7 +604,7 @@ def valid_opcodes( @classmethod def transaction_intrinsic_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionIntrinsicCostCalculator: """ At Homestead, the transaction intrinsic cost needs to take contract @@ -633,7 +640,7 @@ class Byzantium(Homestead): """Byzantium fork.""" @classmethod - def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: + def get_reward(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """ At Byzantium, the block reward is reduced to 3_000_000_000_000_000_000 wei. @@ -641,7 +648,7 @@ def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: return 3_000_000_000_000_000_000 @classmethod - def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """ At Byzantium, pre-compiles for bigint modular exponentiation, addition and scalar multiplication on elliptic curve alt_bn128, and optimal ate pairing check on @@ -659,7 +666,7 @@ def max_code_size(cls) -> int: @classmethod def call_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """At Byzantium, STATICCALL opcode was introduced.""" return [(Opcodes.STATICCALL, EVMCodeType.LEGACY)] + super(Byzantium, cls).call_opcodes( @@ -683,7 +690,7 @@ class Constantinople(Byzantium): """Constantinople fork.""" @classmethod - def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: + def get_reward(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """ At Constantinople, the block reward is reduced to 2_000_000_000_000_000_000 wei. @@ -692,7 +699,7 @@ def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: @classmethod def create_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """At Constantinople, `CREATE2` opcode is added.""" return [(Opcodes.CREATE2, EVMCodeType.LEGACY)] + super(Constantinople, cls).create_opcodes( @@ -723,7 +730,7 @@ class Istanbul(ConstantinopleFix): """Istanbul fork.""" @classmethod - def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """At Istanbul, pre-compile for blake2 compression is introduced.""" return [Address(9)] + super(Istanbul, cls).precompiles(block_number, timestamp) @@ -735,7 +742,7 @@ def valid_opcodes( return [Opcodes.CHAINID, Opcodes.SELFBALANCE] + super(Istanbul, cls).valid_opcodes() @classmethod - def gas_costs(cls, block_number: int = 0, timestamp: int = 0) -> GasCosts: + def gas_costs(cls, *, block_number: int = 0, timestamp: int = 0) -> GasCosts: """ On Istanbul, the non-zero transaction data byte cost is reduced to 16 due to EIP-2028. @@ -757,18 +764,18 @@ class Berlin(Istanbul): """Berlin fork.""" @classmethod - def tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At Berlin, access list transactions are introduced.""" return [1] + super(Berlin, cls).tx_types(block_number, timestamp) @classmethod - def contract_creating_tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def contract_creating_tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At Berlin, access list transactions are introduced.""" return [1] + super(Berlin, cls).contract_creating_tx_types(block_number, timestamp) @classmethod def transaction_intrinsic_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionIntrinsicCostCalculator: """At Berlin, the transaction intrinsic cost needs to take the access list into account.""" super_fn = super(Berlin, cls).transaction_intrinsic_cost_calculator( @@ -803,17 +810,17 @@ class London(Berlin): """London fork.""" @classmethod - def header_base_fee_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_base_fee_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Header must contain the Base Fee starting from London.""" return True @classmethod - def tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At London, dynamic fee transactions are introduced.""" return [2] + super(London, cls).tx_types(block_number, timestamp) @classmethod - def contract_creating_tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def contract_creating_tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At London, dynamic fee transactions are introduced.""" return [2] + super(London, cls).contract_creating_tx_types(block_number, timestamp) @@ -845,23 +852,23 @@ class Paris( """Paris (Merge) fork.""" @classmethod - def header_prev_randao_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_prev_randao_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Prev Randao is required starting from Paris.""" return True @classmethod - def header_zero_difficulty_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_zero_difficulty_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Zero difficulty is required starting from Paris.""" return True @classmethod - def get_reward(cls, block_number: int = 0, timestamp: int = 0) -> int: + def get_reward(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Paris updates the reward to 0.""" return 0 @classmethod def engine_new_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """From Paris, payloads can be sent through the engine API.""" return 1 @@ -871,13 +878,13 @@ class Shanghai(Paris): """Shanghai fork.""" @classmethod - def header_withdrawals_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_withdrawals_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Withdrawals are required starting from Shanghai.""" return True @classmethod def engine_new_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """From Shanghai, new payload calls must use version 2.""" return 2 @@ -904,23 +911,23 @@ def solc_min_version(cls) -> Version: return Version.parse("0.8.24") @classmethod - def header_excess_blob_gas_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_excess_blob_gas_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Excess blob gas is required starting from Cancun.""" return True @classmethod - def header_blob_gas_used_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_blob_gas_used_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Blob gas used is required starting from Cancun.""" return True @classmethod - def header_beacon_root_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_beacon_root_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """Parent beacon block root is required starting from Cancun.""" return True @classmethod def blob_gas_price_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> BlobGasPriceCalculator: """Return a callable that calculates the blob gas price at Cancun.""" min_base_fee_per_blob_gas = cls.min_base_fee_per_blob_gas(block_number, timestamp) @@ -937,7 +944,7 @@ def fn(*, excess_blob_gas) -> int: @classmethod def excess_blob_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> ExcessBlobGasCalculator: """Return a callable that calculates the excess blob gas for a block at Cancun.""" target_blobs_per_block = cls.target_blobs_per_block(block_number, timestamp) @@ -965,37 +972,37 @@ def fn( return fn @classmethod - def min_base_fee_per_blob_gas(cls, block_number: int = 0, timestamp: int = 0) -> int: + def min_base_fee_per_blob_gas(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the minimum base fee per blob gas for Cancun.""" return 1 @classmethod - def blob_base_fee_update_fraction(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_base_fee_update_fraction(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the blob base fee update fraction for Cancun.""" return 3338477 @classmethod - def blob_gas_per_blob(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_gas_per_blob(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Blobs are enabled starting from Cancun.""" return 2**17 @classmethod - def supports_blobs(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def supports_blobs(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """At Cancun, blobs support is enabled.""" return True @classmethod - def target_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def target_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Blobs are enabled starting from Cancun, with a static target of 3 blobs.""" return 3 @classmethod - def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def max_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Blobs are enabled starting from Cancun, with a static max of 6 blobs.""" return 6 @classmethod - def blob_schedule(cls, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None: + def blob_schedule(cls, *, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None: """ At Cancun, the fork object runs this routine to get the updated blob schedule. @@ -1012,17 +1019,17 @@ def blob_schedule(cls, block_number: int = 0, timestamp: int = 0) -> BlobSchedul return blob_schedule @classmethod - def tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At Cancun, blob type transactions are introduced.""" return [3] + super(Cancun, cls).tx_types(block_number, timestamp) @classmethod - def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """At Cancun, pre-compile for kzg point evaluation is introduced.""" return [Address(0xA)] + super(Cancun, cls).precompiles(block_number, timestamp) @classmethod - def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def system_contracts(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """Cancun introduces the system contract for EIP-4788.""" return [Address(0x000F3DF6D732807EF1319FB7B8BB8522D0BEAC02)] @@ -1044,23 +1051,23 @@ def pre_allocation_blockchain(cls) -> Mapping: @classmethod def engine_new_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """From Cancun, new payload calls must use version 3.""" return 3 @classmethod - def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) -> Optional[int]: + def engine_get_blobs_version(cls, *, block_number: int = 0, timestamp: int = 0) -> Optional[int]: """At Cancun, the engine get blobs version is 1.""" return 1 @classmethod - def engine_new_payload_blob_hashes(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_blob_hashes(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """From Cancun, payloads must have blob hashes.""" return True @classmethod - def engine_new_payload_beacon_root(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_beacon_root(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """From Cancun, payloads must have a parent beacon block root.""" return True @@ -1095,7 +1102,7 @@ def solc_min_version(cls) -> Version: return Version.parse("1.0.0") # set a high version; currently unknown @classmethod - def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def precompiles(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """ At Prague, pre-compile for BLS operations are added. @@ -1112,12 +1119,12 @@ def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address] ) @classmethod - def tx_types(cls, block_number: int = 0, timestamp: int = 0) -> List[int]: + def tx_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[int]: """At Prague, set-code type transactions are introduced.""" return [4] + super(Prague, cls).tx_types(block_number, timestamp) @classmethod - def gas_costs(cls, block_number: int = 0, timestamp: int = 0) -> GasCosts: + def gas_costs(cls, *, block_number: int = 0, timestamp: int = 0) -> GasCosts: """ On Prague, the standard token cost and the floor token costs are introduced due to EIP-7623. @@ -1131,7 +1138,7 @@ def gas_costs(cls, block_number: int = 0, timestamp: int = 0) -> GasCosts: ) @classmethod - def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]: + def system_contracts(cls, *, block_number: int = 0, timestamp: int = 0) -> List[Address]: """Prague introduces the system contracts for EIP-6110, EIP-7002, EIP-7251 and EIP-2935.""" return [ Address(0x00000000219AB540356CBB839CBE05303D7705FA), @@ -1141,13 +1148,13 @@ def system_contracts(cls, block_number: int = 0, timestamp: int = 0) -> List[Add ] + super(Prague, cls).system_contracts(block_number, timestamp) @classmethod - def max_request_type(cls, block_number: int = 0, timestamp: int = 0) -> int: + 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 calldata_gas_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> CalldataGasCalculator: """ Return a callable that calculates the transaction gas cost for its calldata @@ -1170,10 +1177,13 @@ def fn(*, data: BytesConvertible, floor: bool = False) -> int: @classmethod def transaction_data_floor_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionDataFloorCostCalculator: """On Prague, due to EIP-7623, the transaction data floor cost is introduced.""" - calldata_gas_calculator = cls.calldata_gas_calculator(block_number, timestamp) + calldata_gas_calculator = cls.calldata_gas_calculator( + block_number=block_number, + timestamp=timestamp + ) gas_costs = cls.gas_costs(block_number, timestamp) def fn(*, data: BytesConvertible) -> int: @@ -1183,7 +1193,7 @@ def fn(*, data: BytesConvertible) -> int: @classmethod def transaction_intrinsic_cost_calculator( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> TransactionIntrinsicCostCalculator: """ At Prague, the transaction intrinsic cost needs to take the @@ -1225,17 +1235,17 @@ def fn( return fn @classmethod - def blob_base_fee_update_fraction(cls, block_number: int = 0, timestamp: int = 0) -> int: + def blob_base_fee_update_fraction(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Return the blob base fee update fraction for Prague.""" return 5007716 @classmethod - def target_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def target_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Target blob count of 6 for Prague.""" return 6 @classmethod - def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int: + def max_blobs_per_block(cls, *, block_number: int = 0, timestamp: int = 0) -> int: """Max blob count of 9 for Prague.""" return 9 @@ -1302,7 +1312,7 @@ def pre_allocation_blockchain(cls) -> Mapping: return new_allocation | super(Prague, cls).pre_allocation_blockchain() # type: ignore @classmethod - def header_requests_required(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def header_requests_required(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """ Prague requires that the execution layer header contains the beacon chain requests hash. @@ -1310,20 +1320,20 @@ def header_requests_required(cls, block_number: int = 0, timestamp: int = 0) -> return True @classmethod - def engine_new_payload_requests(cls, block_number: int = 0, timestamp: int = 0) -> bool: + def engine_new_payload_requests(cls, *, block_number: int = 0, timestamp: int = 0) -> bool: """From Prague, new payloads include the requests hash as a parameter.""" return True @classmethod def engine_new_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """From Prague, new payload calls must use version 4.""" return 4 @classmethod def engine_forkchoice_updated_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """At Prague, version number of NewPayload and ForkchoiceUpdated diverge.""" return 3 @@ -1334,13 +1344,13 @@ class Osaka(Prague, solc_name="cancun"): @classmethod def engine_get_payload_version( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> Optional[int]: """From Osaka, get payload calls must use version 5.""" return 5 @classmethod - def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) -> Optional[int]: + def engine_get_blobs_version(cls, *, block_number: int = 0, timestamp: int = 0) -> Optional[int]: """At Osaka, the engine get blobs version is 2.""" return 2 @@ -1376,7 +1386,7 @@ class EOFv1(Prague, solc_name="cancun"): """EOF fork.""" @classmethod - def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]: + def evm_code_types(cls, *, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]: """EOF V1 is supported starting from Osaka.""" return super(EOFv1, cls).evm_code_types( block_number, @@ -1385,7 +1395,7 @@ def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCo @classmethod def call_opcodes( - cls, block_number: int = 0, timestamp: int = 0 + cls, *, block_number: int = 0, timestamp: int = 0 ) -> List[Tuple[Opcodes, EVMCodeType]]: """EOF V1 introduces EXTCALL, EXTSTATICCALL, EXTDELEGATECALL.""" return [ diff --git a/src/pytest_plugins/execute/pre_alloc.py b/src/pytest_plugins/execute/pre_alloc.py index 4858fa61b3b..6dd3e828fcf 100644 --- a/src/pytest_plugins/execute/pre_alloc.py +++ b/src/pytest_plugins/execute/pre_alloc.py @@ -188,7 +188,7 @@ def deploy_contract( f"initcode too large {len(initcode)} > {MAX_INITCODE_SIZE}" ) - calldata_gas_calculator = self._fork.calldata_gas_calculator() + calldata_gas_calculator = self._fork.calldata_gas_calculator(block_number=0, timestamp=0) deploy_gas_limit += calldata_gas_calculator(data=initcode) # Limit the gas limit