diff --git a/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py b/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py index 68edbd5a82d..4efd572d090 100644 --- a/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py +++ b/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py @@ -140,36 +140,3 @@ def test_blobbasefee_out_of_gas( tx=tx, post=post, ) - - -@pytest.mark.parametrize("caller_pre_storage", [{1: 1}], ids=[""]) -@pytest.mark.valid_at_transition_to("Cancun") -def test_blobbasefee_before_fork( - state_test: StateTestFiller, - pre: Alloc, - caller_address: Address, - callee_address: Address, - tx: Transaction, -): - """Tests that the BLOBBASEFEE opcode results on exception when called before the fork.""" - # Fork happens at timestamp 15_000 - timestamp = 7_500 - post = { - caller_address: Account( - storage={1: 0}, - ), - callee_address: Account( - balance=0, - ), - } - state_test( - env=Environment( - timestamp=timestamp, - ), - pre=pre, - tx=tx, - post=post, - ) - - -timestamps = [7_500, 14_999, 15_000] diff --git a/tests/prague/eip2537_bls_12_381_precompiles/test_bls12_precompiles_before_fork.py b/tests/prague/eip2537_bls_12_381_precompiles/test_bls12_precompiles_before_fork.py deleted file mode 100644 index 97509cb1664..00000000000 --- a/tests/prague/eip2537_bls_12_381_precompiles/test_bls12_precompiles_before_fork.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -abstract: Tests BLS12 precompiles of [EIP-2537: Precompile for BLS12-381 curve operations](https://eips.ethereum.org/EIPS/eip-2537) - Tests BLS12 precompiles of [EIP-2537: Precompile for BLS12-381 curve operations](https://eips.ethereum.org/EIPS/eip-2537) - before the Prague hard fork is active. -""" # noqa: E501 - -import pytest - -from ethereum_test_tools import Alloc, Environment, StateTestFiller, Transaction - -from .spec import FP, FP2, Scalar, Spec, ref_spec_2537 - -REFERENCE_SPEC_GIT_PATH = ref_spec_2537.git_path -REFERENCE_SPEC_VERSION = ref_spec_2537.version - -pytestmark = [ - pytest.mark.valid_at_transition_to("Prague"), - pytest.mark.slow, -] - - -@pytest.mark.parametrize( - "precompile_address,input_data", - [ - pytest.param( - Spec.G1ADD, - Spec.INF_G1 + Spec.INF_G1, - id="G1ADD", - ), - pytest.param( - Spec.G1MSM, - Spec.INF_G1 + Scalar(0), - id="G1MSM", - ), - pytest.param( - Spec.G2ADD, - Spec.INF_G2 + Spec.INF_G2, - id="G2ADD", - ), - pytest.param( - Spec.G2MSM, - Spec.INF_G2 + Scalar(0), - id="G2MSM", - ), - pytest.param( - Spec.PAIRING, - Spec.INF_G1 + Spec.INF_G2, - id="PAIRING", - ), - pytest.param( - Spec.MAP_FP_TO_G1, - FP(0), - id="MAP_FP_TO_G1", - ), - pytest.param( - Spec.MAP_FP2_TO_G2, - FP2((0, 0)), - id="MAP_FP2_TO_G2", - ), - ], -) -@pytest.mark.parametrize("expected_output,call_succeeds", [pytest.param(b"", True, id="")]) -def test_precompile_before_fork( - state_test: StateTestFiller, - pre: Alloc, - post: dict, - tx: Transaction, -): - """ - Test all BLS12 precompiles before the Prague hard fork is active. - - The call must succeed but the output must be empty. - """ - state_test( - env=Environment(), - pre=pre, - tx=tx, - post=post, - ) diff --git a/tests/prague/eip2935_historical_block_hashes_from_state/contract_deploy_tx.json b/tests/prague/eip2935_historical_block_hashes_from_state/contract_deploy_tx.json deleted file mode 100644 index b3f938f86bc..00000000000 --- a/tests/prague/eip2935_historical_block_hashes_from_state/contract_deploy_tx.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "0x0", - "nonce": "0x0", - "to": null, - "gas": "0x3d090", - "gasPrice": "0xe8d4a51000", - "maxPriorityFeePerGas": null, - "maxFeePerGas": null, - "value": "0x0", - "input": "0x60538060095f395ff33373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500", - "v": "0x1b", - "r": "0x539", - "s": "0x0aa12693182426612186309f02cfe8a80a0000", - "hash": "0x67139a552b0d3fffc30c0fa7d0c20d42144138c8fe07fc5691f09c1cce632e15", - "sender": "0x3462413Af4609098e1E27A490f554f260213D685" -} \ No newline at end of file diff --git a/tests/prague/eip2935_historical_block_hashes_from_state/test_contract_deployment.py b/tests/prague/eip2935_historical_block_hashes_from_state/test_contract_deployment.py deleted file mode 100644 index 2d8bc81cef6..00000000000 --- a/tests/prague/eip2935_historical_block_hashes_from_state/test_contract_deployment.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -abstract: Tests [EIP-2935: Serve historical block hashes from state](https://eips.ethereum.org/EIPS/eip-2935). - Test system contract deployment for [EIP-2935: Serve historical block hashes from state](https://eips.ethereum.org/EIPS/eip-2935). -""" # noqa: E501 - -from os.path import realpath -from pathlib import Path -from typing import Dict - -from ethereum_test_forks import Prague -from ethereum_test_tools import ( - Account, - Address, - Alloc, - Block, - DeploymentTestType, - Transaction, - generate_system_contract_deploy_test, -) -from ethereum_test_tools import Opcodes as Op - -from .spec import Spec, ref_spec_2935 - -REFERENCE_SPEC_GIT_PATH = ref_spec_2935.git_path -REFERENCE_SPEC_VERSION = ref_spec_2935.version - - -@generate_system_contract_deploy_test( - fork=Prague, - tx_json_path=Path(realpath(__file__)).parent / "contract_deploy_tx.json", - expected_deploy_address=Address(Spec.HISTORY_STORAGE_ADDRESS), -) -def test_system_contract_deployment( - *, - pre: Alloc, - post: Alloc, - test_type: DeploymentTestType, - **kwargs, -): - """Verify deployment of the block hashes system contract.""" - # Deploy a contract that calls the history contract and verifies the block hashes. - yield Block() # Empty block just to have more history in the contract. - - # We are going to query blocks even before contract deployment. - code = ( - sum( - Op.MSTORE(0, block_number) - + Op.POP( - Op.CALL( - address=Spec.HISTORY_STORAGE_ADDRESS, - args_offset=0, - args_size=32, - ret_offset=0, - ret_size=32, - ), - ) - + Op.SSTORE(block_number, Op.ISZERO(Op.ISZERO(Op.MLOAD(0)))) - for block_number in range(1, 4) - ) - + Op.STOP - ) - deployed_contract = pre.deploy_contract(code) - - tx = Transaction( - to=deployed_contract, - gas_limit=10_000_000, - sender=pre.fund_eoa(), - ) - - yield Block(txs=[tx]) - - storage: Dict - if test_type == DeploymentTestType.DEPLOY_BEFORE_FORK: - # Fork happens at block 2, and the contract is already there, so from block number 1 and - # after, the block hashes should be there. - storage = { - 1: 1, # Block prior to the fork, it's the first hash saved. - 2: 1, # Fork block, hash should be there. - 3: 1, # Empty block added at the start of this function, hash should be there. - } - elif test_type == DeploymentTestType.DEPLOY_AFTER_FORK: - # The contract should have the block hashes after contract deployment. - storage = { - 1: 0, # Fork block, but contract is not there yet. - 2: 1, # Deployment block, this is the first hash that gets added because it's added on - # the next block. - 3: 1, # Empty block added at the start of this function, hash should be there. - } - - post[deployed_contract] = Account( - balance=0, - storage=storage, - )