Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/benchmark/compute/precompile/test_alt_bn128.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 6 additions & 2 deletions tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
)
Expand Down
5 changes: 4 additions & 1 deletion tests/shanghai/eip3860_initcode/test_initcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
)
Expand Down
Loading