diff --git a/tests/benchmark/compute/precompile/test_alt_bn128.py b/tests/benchmark/compute/precompile/test_alt_bn128.py index dfb63a9aeab..d95345f5132 100644 --- a/tests/benchmark/compute/precompile/test_alt_bn128.py +++ b/tests/benchmark/compute/precompile/test_alt_bn128.py @@ -40,6 +40,35 @@ id="bn128_add", marks=pytest.mark.repricing, ), + pytest.param( + 0x06, + concatenate_parameters( + [ + "18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9", + "063C909C4720840CB5134CB9F59FA749755796819658D32EFC0D288198F37266", + "18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9", + "063C909C4720840CB5134CB9F59FA749755796819658D32EFC0D288198F37266", + ] + ), + Precompile.BN128_ADD, + id="bn128_double", + marks=pytest.mark.repricing, + ), + # Second point is the negative of the first one + pytest.param( + 0x06, + concatenate_parameters( + [ + "18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9", + "063C909C4720840CB5134CB9F59FA749755796819658D32EFC0D288198F37266", + "18B18ACFB4C2C30276DB5411368E7185B311DD124691610C5D3B74034E093DC9", + "2A27BDD69A111C1D033CF8FC8BE1B1142229D40FD218F75E401363953F898AE1", + ] + ), + Precompile.BN128_ADD, + id="bn128_add_negative", + marks=pytest.mark.repricing, + ), # Ported from # https://github.com/NethermindEth/nethermind/blob/ceb8d57b8530ce8181d7427c115ca593386909d6/tools/EngineRequestsGenerator/TestCase.cs#L326 pytest.param( diff --git a/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py b/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py index 1dc82ea1ed4..6ee241be0fc 100644 --- a/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py +++ b/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py @@ -18,6 +18,7 @@ compute_create_address, ) from execution_testing import Macros as Om +from execution_testing.forks.helpers import Fork from . import CreateOpcodeParams, PytestParameterEnum from .spec import ref_spec_1153 @@ -271,6 +272,7 @@ def test_tstore_rollback_on_failed_create( state_test: StateTestFiller, pre: Alloc, create_opcode: Op, + fork: Fork, ) -> None: """ Test TSTORE is rolled back after failed CREATE/CREATE2 initcode. @@ -296,11 +298,13 @@ def test_tstore_rollback_on_failed_create( # # TLOAD(1)==0: return_size = 0x600a > max code size -> fail # TLOAD(1)==0x6000: return_size = 0x0a <= max code size -> succeed + max_code_size = fork.max_code_size() + initcode = ( Op.TLOAD(1) - + Op.PUSH2(0x600A) + + Op.PUSH4(max_code_size + 0x0A) + Op.SUB - + Op.TSTORE(1, 0x6000) + + Op.TSTORE(1, max_code_size) + Op.PUSH1(0) + Op.RETURN ) diff --git a/tests/shanghai/eip3860_initcode/test_initcode.py b/tests/shanghai/eip3860_initcode/test_initcode.py index 08e56b48c48..f76bca44c2a 100644 --- a/tests/shanghai/eip3860_initcode/test_initcode.py +++ b/tests/shanghai/eip3860_initcode/test_initcode.py @@ -605,6 +605,7 @@ def test_create2_oversized_initcode_with_insufficient_balance( pre: Alloc, initcode_oversize: bool, expected_storage_1: int, + fork: Fork, ) -> None: """ Test CREATE2 with oversized initcode and insufficient balance. @@ -621,7 +622,9 @@ def test_create2_oversized_initcode_with_insufficient_balance( - Initcode within limit: insufficient balance pushes 0, execution continues, SSTORE(1, 1) executes, so storage slot 1 becomes 1. """ - initcode_size = 0x20000 if initcode_oversize else 0x100 + initcode_size = ( + fork.max_initcode_size() * 2 if initcode_oversize else 0x100 + ) caller_code = ( Op.CREATE2(1123123123, 0, initcode_size, 0) + Op.POP + Op.SSTORE(1, 1) )