Skip to content

Commit 646149c

Browse files
authored
chore(tests): fix pre alloc grouping remaining fails (#1975)
* chore(tests): fix pre alloc grouping eip4788. * chore(tests): fix pre alloc grouping eip6110. * chore(tests): temp skip for type 4 txs for pre alloc grouping eip7934.
1 parent 1b0cb62 commit 646149c

File tree

3 files changed

+76
-20
lines changed

3 files changed

+76
-20
lines changed

tests/cancun/eip4788_beacon_root/test_beacon_root_contract.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,27 @@ def test_beacon_root_contract_calls(
120120
@pytest.mark.parametrize(
121121
"system_address_balance",
122122
[
123-
pytest.param(0, id="empty_system_address"),
124-
pytest.param(1, id="one_wei_system_address"),
125-
pytest.param(int(1e18), id="one_eth_system_address"),
123+
pytest.param(
124+
0,
125+
id="empty_system_address",
126+
marks=pytest.mark.pre_alloc_group(
127+
"beacon_root_empty_system", reason="Tests with empty system address balance"
128+
),
129+
),
130+
pytest.param(
131+
1,
132+
id="one_wei_system_address",
133+
marks=pytest.mark.pre_alloc_group(
134+
"beacon_root_one_wei_system", reason="Tests with 1 wei system address balance"
135+
),
136+
),
137+
pytest.param(
138+
int(1e18),
139+
id="one_eth_system_address",
140+
marks=pytest.mark.pre_alloc_group(
141+
"beacon_root_one_eth_system", reason="Tests with 1 ETH system address balance"
142+
),
143+
),
126144
],
127145
)
128146
@pytest.mark.valid_from("Cancun")
@@ -595,7 +613,7 @@ def test_beacon_root_transition(
595613
@pytest.mark.parametrize("timestamp", [15_000])
596614
@pytest.mark.valid_at_transition_to("Cancun")
597615
@pytest.mark.pre_alloc_group(
598-
"separate", reason="This test removes the beacon root system contract"
616+
"beacon_root_no_contract", reason="This test removes the beacon root system contract"
599617
)
600618
def test_no_beacon_root_contract_at_transition(
601619
blockchain_test: BlockchainTestFiller,
@@ -670,7 +688,7 @@ def test_no_beacon_root_contract_at_transition(
670688
)
671689
@pytest.mark.valid_at_transition_to("Cancun")
672690
@pytest.mark.pre_alloc_group(
673-
"separate",
691+
"beacon_root_deploy_contract",
674692
reason=(
675693
"This test is parametrized with a hard-coded address (the beacon root contract deployer "
676694
"address); they can't be in the same pre alloc group."

tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
REFERENCE_SPEC_GIT_PATH = ref_spec_7934.git_path
3131
REFERENCE_SPEC_VERSION = ref_spec_7934.version
3232

33-
pytestmark = pytest.mark.valid_from("Osaka")
33+
pytestmark = [
34+
pytest.mark.valid_from("Osaka"),
35+
pytest.mark.pre_alloc_group(
36+
"block_rlp_limit_tests",
37+
reason="Block RLP size tests require exact calculations",
38+
),
39+
]
3440

3541

3642
HEADER_TIMESTAMP = 123456789
@@ -445,8 +451,16 @@ def test_block_rlp_size_at_limit_with_all_typed_transactions(
445451
block_size_limit: int,
446452
env: Environment,
447453
typed_transaction: Transaction,
454+
request: pytest.FixtureRequest,
448455
) -> None:
449456
"""Test the block RLP size limit with all transaction types."""
457+
# TODO: fix this for generate all formats.
458+
if typed_transaction.ty == 4 and (
459+
request.config.getoption("generate_pre_alloc_groups")
460+
or request.config.getoption("use_pre_alloc_groups")
461+
):
462+
pytest.skip("EIP-7702 fixture generates different transactions in Phase 1")
463+
450464
transactions, gas_used = exact_size_transactions(
451465
sender,
452466
block_size_limit,

tests/prague/eip6110_deposits/test_modified_contract.py

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,22 @@
5656
@pytest.mark.parametrize(
5757
"include_deposit_event",
5858
[
59-
pytest.param(True),
60-
pytest.param(False),
59+
pytest.param(
60+
True,
61+
marks=pytest.mark.pre_alloc_group(
62+
"deposit_extra_logs_with_event",
63+
reason="Deposit contract with Transfer log AND deposit event",
64+
),
65+
),
66+
pytest.param(
67+
False,
68+
marks=pytest.mark.pre_alloc_group(
69+
"deposit_extra_logs_no_event",
70+
reason="Deposit contract with Transfer log but NO deposit event",
71+
),
72+
),
6173
],
6274
)
63-
@pytest.mark.pre_alloc_group(
64-
"separate", reason="Deploys custom deposit contract with different bytecode"
65-
)
6675
def test_extra_logs(
6776
blockchain_test: BlockchainTestFiller,
6877
pre: Alloc,
@@ -145,12 +154,20 @@ def test_extra_logs(
145154

146155
@pytest.mark.parametrize(
147156
"log_argument,value",
148-
[(log_argument, value) for log_argument in EVENT_ARGUMENTS for value in EVENT_ARGUMENT_VALUES],
157+
[
158+
pytest.param(
159+
arg,
160+
val,
161+
marks=pytest.mark.pre_alloc_group(
162+
f"deposit_layout_{arg}_{val}",
163+
reason=f"Deposit contract with invalid {arg} set to {val}",
164+
),
165+
)
166+
for arg in EVENT_ARGUMENTS
167+
for val in EVENT_ARGUMENT_VALUES
168+
],
149169
)
150170
@pytest.mark.exception_test
151-
@pytest.mark.pre_alloc_group(
152-
"modified_deposit_contract", reason="Deploys custom deposit contract with different bytecode"
153-
)
154171
def test_invalid_layout(
155172
blockchain_test: BlockchainTestFiller, pre: Alloc, log_argument: str, value: str
156173
):
@@ -192,14 +209,21 @@ def test_invalid_layout(
192209
@pytest.mark.parametrize(
193210
"slice_bytes",
194211
[
195-
pytest.param(True),
196-
pytest.param(False),
212+
pytest.param(
213+
True,
214+
marks=pytest.mark.pre_alloc_group(
215+
"deposit_log_length_short", reason="Deposit contract with shortened log data"
216+
),
217+
),
218+
pytest.param(
219+
False,
220+
marks=pytest.mark.pre_alloc_group(
221+
"deposit_log_length_long", reason="Deposit contract with lengthened log data"
222+
),
223+
),
197224
],
198225
)
199226
@pytest.mark.exception_test
200-
@pytest.mark.pre_alloc_group(
201-
"modified_deposit_contract", reason="Deploys custom deposit contract with different bytecode"
202-
)
203227
def test_invalid_log_length(blockchain_test: BlockchainTestFiller, pre: Alloc, slice_bytes: bool):
204228
"""Test deposit contract emitting logs with invalid log length (one byte more or less)."""
205229
changed_log = DEFAULT_REQUEST_LOG[:-1] if slice_bytes else DEFAULT_REQUEST_LOG + b"\x00"

0 commit comments

Comments
 (0)