Skip to content

Commit 7f8e79a

Browse files
authored
Ignore proposer preferences for pre-Gloas slots (#5559)
1 parent 64e8259 commit 7f8e79a

3 files changed

Lines changed: 164 additions & 58 deletions

File tree

specs/gloas/p2p-interface.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,10 @@ def validate_proposer_preferences_gossip(
10661066
preferences = signed_proposer_preferences.message
10671067
proposal_epoch = compute_epoch_at_slot(preferences.proposal_slot)
10681068

1069+
# [IGNORE] The proposal epoch is after the Gloas upgrade
1070+
if proposal_epoch < GLOAS_FORK_EPOCH:
1071+
raise GossipIgnore("proposal epoch is pre-gloas")
1072+
10691073
# [IGNORE] The proposal slot has not started yet
10701074
if is_past_slot(store, preferences.proposal_slot, current_time_ms):
10711075
raise GossipIgnore("proposal slot has already started")

tests/core/pyspec/eth_consensus_specs/test/gloas/networking/test_gossip_execution_payload_bid.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from eth_consensus_specs.test.context import (
2-
spec_state_test,
2+
spec_state_test_with_matching_config,
33
with_gloas_and_later,
44
)
55
from eth_consensus_specs.test.helpers.block import build_empty_block_for_next_slot
@@ -106,7 +106,7 @@ def _seed_bid_context(
106106

107107

108108
@with_gloas_and_later
109-
@spec_state_test
109+
@spec_state_test_with_matching_config
110110
def test_gossip_execution_payload_bid__valid(spec, state):
111111
"""A bid for the next slot from an active builder with matching preferences is valid."""
112112
anchor_state = state.copy()
@@ -164,7 +164,7 @@ def test_gossip_execution_payload_bid__valid(spec, state):
164164

165165

166166
@with_gloas_and_later
167-
@spec_state_test
167+
@spec_state_test_with_matching_config
168168
def test_gossip_execution_payload_bid__valid_zero_value_first_bid(spec, state):
169169
"""The first bid for a slot and parent is valid even with a zero value.
170170
@@ -227,7 +227,7 @@ def test_gossip_execution_payload_bid__valid_zero_value_first_bid(spec, state):
227227

228228

229229
@with_gloas_and_later
230-
@spec_state_test
230+
@spec_state_test_with_matching_config
231231
def test_gossip_execution_payload_bid__ignore_slot_too_far_future(spec, state):
232232
"""A bid whose slot is far in the future is ignored."""
233233
anchor_state = state.copy()
@@ -287,7 +287,7 @@ def test_gossip_execution_payload_bid__ignore_slot_too_far_future(spec, state):
287287

288288

289289
@with_gloas_and_later
290-
@spec_state_test
290+
@spec_state_test_with_matching_config
291291
def test_gossip_execution_payload_bid__ignore_slot_outside_lower_disparity(spec, state):
292292
"""A bid whose slot is 1ms before the lower clock-disparity edge is ignored."""
293293
anchor_state = state.copy()
@@ -356,7 +356,7 @@ def test_gossip_execution_payload_bid__ignore_slot_outside_lower_disparity(spec,
356356

357357

358358
@with_gloas_and_later
359-
@spec_state_test
359+
@spec_state_test_with_matching_config
360360
def test_gossip_execution_payload_bid__valid_slot_at_lower_disparity(spec, state):
361361
"""A bid whose slot lands exactly on the lower clock-disparity edge is valid."""
362362
anchor_state = state.copy()
@@ -465,7 +465,7 @@ def test_gossip_execution_payload_bid__valid_slot_at_lower_disparity(spec, state
465465

466466

467467
@with_gloas_and_later
468-
@spec_state_test
468+
@spec_state_test_with_matching_config
469469
def test_gossip_execution_payload_bid__valid_slot_at_upper_disparity(spec, state):
470470
"""A bid whose slot lands exactly on the upper clock-disparity edge is valid."""
471471
anchor_state = state.copy()
@@ -569,7 +569,7 @@ def test_gossip_execution_payload_bid__valid_slot_at_upper_disparity(spec, state
569569

570570

571571
@with_gloas_and_later
572-
@spec_state_test
572+
@spec_state_test_with_matching_config
573573
def test_gossip_execution_payload_bid__ignore_slot_outside_upper_disparity(spec, state):
574574
"""A bid whose slot is 1ms past the upper clock-disparity edge is ignored."""
575575
anchor_state = state.copy()
@@ -634,7 +634,7 @@ def test_gossip_execution_payload_bid__ignore_slot_outside_upper_disparity(spec,
634634

635635

636636
@with_gloas_and_later
637-
@spec_state_test
637+
@spec_state_test_with_matching_config
638638
def test_gossip_execution_payload_bid__ignore_duplicate_from_builder(spec, state):
639639
"""A second bid from the same builder for the same slot and parent is ignored.
640640
@@ -732,7 +732,7 @@ def test_gossip_execution_payload_bid__ignore_duplicate_from_builder(spec, state
732732

733733

734734
@with_gloas_and_later
735-
@spec_state_test
735+
@spec_state_test_with_matching_config
736736
def test_gossip_execution_payload_bid__ignore_not_highest_value(spec, state):
737737
"""A bid whose value does not exceed the best bid for this slot/parent is ignored.
738738
@@ -829,7 +829,7 @@ def test_gossip_execution_payload_bid__ignore_not_highest_value(spec, state):
829829

830830

831831
@with_gloas_and_later
832-
@spec_state_test
832+
@spec_state_test_with_matching_config
833833
def test_gossip_execution_payload_bid__ignore_equal_value(spec, state):
834834
"""A bid whose value merely equals (does not exceed) the best bid is ignored.
835835
@@ -927,7 +927,7 @@ def test_gossip_execution_payload_bid__ignore_equal_value(spec, state):
927927

928928

929929
@with_gloas_and_later
930-
@spec_state_test
930+
@spec_state_test_with_matching_config
931931
def test_gossip_execution_payload_bid__valid_higher_value(spec, state):
932932
"""A bid whose value strictly exceeds the best bid for this slot/parent is valid.
933933
@@ -1023,7 +1023,7 @@ def test_gossip_execution_payload_bid__valid_higher_value(spec, state):
10231023

10241024

10251025
@with_gloas_and_later
1026-
@spec_state_test
1026+
@spec_state_test_with_matching_config
10271027
def test_gossip_execution_payload_bid__reject_builder_index_out_of_range(spec, state):
10281028
"""A bid whose builder_index is past the builder registry is rejected.
10291029
@@ -1089,7 +1089,7 @@ def test_gossip_execution_payload_bid__reject_builder_index_out_of_range(spec, s
10891089

10901090

10911091
@with_gloas_and_later
1092-
@spec_state_test
1092+
@spec_state_test_with_matching_config
10931093
def test_gossip_execution_payload_bid__ignore_builder_cannot_cover(spec, state):
10941094
"""A bid whose value exceeds what the builder can cover is ignored."""
10951095
# Zero out the builder's balance so it cannot cover even a tiny bid. This
@@ -1154,7 +1154,7 @@ def test_gossip_execution_payload_bid__ignore_builder_cannot_cover(spec, state):
11541154

11551155

11561156
@with_gloas_and_later
1157-
@spec_state_test
1157+
@spec_state_test_with_matching_config
11581158
def test_gossip_execution_payload_bid__reject_execution_payment_nonzero(spec, state):
11591159
"""A bid whose execution_payment is non-zero is rejected."""
11601160
anchor_state = state.copy()
@@ -1214,7 +1214,7 @@ def test_gossip_execution_payload_bid__reject_execution_payment_nonzero(spec, st
12141214

12151215

12161216
@with_gloas_and_later
1217-
@spec_state_test
1217+
@spec_state_test_with_matching_config
12181218
def test_gossip_execution_payload_bid__reject_builder_not_active(spec, state):
12191219
"""A bid from an inactive builder is rejected."""
12201220
anchor_state = state.copy()
@@ -1276,7 +1276,7 @@ def test_gossip_execution_payload_bid__reject_builder_not_active(spec, state):
12761276

12771277

12781278
@with_gloas_and_later
1279-
@spec_state_test
1279+
@spec_state_test_with_matching_config
12801280
def test_gossip_execution_payload_bid__reject_builder_not_payload_version(spec, state):
12811281
"""A bid from a builder whose version is not PAYLOAD_BUILDER_VERSION is rejected.
12821282
@@ -1344,7 +1344,7 @@ def test_gossip_execution_payload_bid__reject_builder_not_payload_version(spec,
13441344

13451345

13461346
@with_gloas_and_later
1347-
@spec_state_test
1347+
@spec_state_test_with_matching_config
13481348
def test_gossip_execution_payload_bid__reject_too_many_blobs(spec, state):
13491349
"""A bid whose blob KZG commitment count exceeds the per-epoch limit is rejected."""
13501350
anchor_state = state.copy()
@@ -1410,7 +1410,7 @@ def test_gossip_execution_payload_bid__reject_too_many_blobs(spec, state):
14101410

14111411

14121412
@with_gloas_and_later
1413-
@spec_state_test
1413+
@spec_state_test_with_matching_config
14141414
def test_gossip_execution_payload_bid__valid_max_blobs(spec, state):
14151415
"""A bid with exactly the per-epoch blob KZG commitment limit is valid.
14161416
@@ -1477,7 +1477,7 @@ def test_gossip_execution_payload_bid__valid_max_blobs(spec, state):
14771477

14781478

14791479
@with_gloas_and_later
1480-
@spec_state_test
1480+
@spec_state_test_with_matching_config
14811481
def test_gossip_execution_payload_bid__ignore_parent_block_unknown(spec, state):
14821482
"""A bid whose parent_block_root is not in store.blocks is ignored.
14831483
@@ -1541,7 +1541,7 @@ def test_gossip_execution_payload_bid__ignore_parent_block_unknown(spec, state):
15411541

15421542

15431543
@with_gloas_and_later
1544-
@spec_state_test
1544+
@spec_state_test_with_matching_config
15451545
def test_gossip_execution_payload_bid__reject_slot_not_higher_than_parent(spec, state):
15461546
"""A bid whose slot is not greater than its parent block's slot is rejected.
15471547
@@ -1638,7 +1638,7 @@ def test_gossip_execution_payload_bid__reject_slot_not_higher_than_parent(spec,
16381638

16391639

16401640
@with_gloas_and_later
1641-
@spec_state_test
1641+
@spec_state_test_with_matching_config
16421642
def test_gossip_execution_payload_bid__ignore_parent_block_hash_unknown(spec, state):
16431643
"""A bid whose parent_block_hash is not in seen.execution_payloads is ignored.
16441644
@@ -1702,7 +1702,7 @@ def test_gossip_execution_payload_bid__ignore_parent_block_hash_unknown(spec, st
17021702

17031703

17041704
@with_gloas_and_later
1705-
@spec_state_test
1705+
@spec_state_test_with_matching_config
17061706
def test_gossip_execution_payload_bid__ignore_parent_state_unavailable(spec, state):
17071707
"""A bid whose parent block's state is missing is ignored."""
17081708
anchor_state = state.copy()
@@ -1791,7 +1791,7 @@ def test_gossip_execution_payload_bid__ignore_parent_state_unavailable(spec, sta
17911791

17921792

17931793
@with_gloas_and_later
1794-
@spec_state_test
1794+
@spec_state_test_with_matching_config
17951795
def test_gossip_execution_payload_bid__ignore_slot_past_parent_lookahead(spec, state):
17961796
"""
17971797
A bid whose slot is more than MIN_SEED_LOOKAHEAD epochs ahead of its parent
@@ -1880,7 +1880,7 @@ def test_gossip_execution_payload_bid__ignore_slot_past_parent_lookahead(spec, s
18801880

18811881

18821882
@with_gloas_and_later
1883-
@spec_state_test
1883+
@spec_state_test_with_matching_config
18841884
def test_gossip_execution_payload_bid__ignore_preferences_not_seen(spec, state):
18851885
"""A bid whose matching proposer preferences have not been seen is ignored."""
18861886
anchor_state = state.copy()
@@ -1958,7 +1958,7 @@ def test_gossip_execution_payload_bid__ignore_preferences_not_seen(spec, state):
19581958

19591959

19601960
@with_gloas_and_later
1961-
@spec_state_test
1961+
@spec_state_test_with_matching_config
19621962
def test_gossip_execution_payload_bid__ignore_fee_recipient_mismatch(spec, state):
19631963
"""A bid whose fee_recipient does not match the proposer's preference is ignored."""
19641964
anchor_state = state.copy()
@@ -2061,7 +2061,7 @@ def test_gossip_execution_payload_bid__ignore_fee_recipient_mismatch(spec, state
20612061

20622062

20632063
@with_gloas_and_later
2064-
@spec_state_test
2064+
@spec_state_test_with_matching_config
20652065
def test_gossip_execution_payload_bid__ignore_gas_limit_incompatible(spec, state):
20662066
"""A bid whose gas_limit is incompatible with the proposer's target is ignored."""
20672067
anchor_state = state.copy()
@@ -2165,7 +2165,7 @@ def test_gossip_execution_payload_bid__ignore_gas_limit_incompatible(spec, state
21652165

21662166

21672167
@with_gloas_and_later
2168-
@spec_state_test
2168+
@spec_state_test_with_matching_config
21692169
def test_gossip_execution_payload_bid__reject_incorrect_prev_randao(spec, state):
21702170
"""A bid whose prev_randao does not match the parent state's RANDAO mix is rejected."""
21712171
anchor_state = state.copy()
@@ -2273,7 +2273,7 @@ def test_gossip_execution_payload_bid__reject_incorrect_prev_randao(spec, state)
22732273

22742274

22752275
@with_gloas_and_later
2276-
@spec_state_test
2276+
@spec_state_test_with_matching_config
22772277
def test_gossip_execution_payload_bid__reject_invalid_signature(spec, state):
22782278
"""A bid with an invalid signature is rejected once all other checks pass."""
22792279
anchor_state = state.copy()
@@ -2492,7 +2492,7 @@ def _run_bid_gas_limit_scenario(
24922492

24932493

24942494
@with_gloas_and_later
2495-
@spec_state_test
2495+
@spec_state_test_with_matching_config
24962496
def test_gossip_execution_payload_bid__valid_gas_limit_increase_within_limit(spec, state):
24972497
"""A bid with gas_limit raised within the EIP-1559 step toward target is valid."""
24982498
yield from _run_bid_gas_limit_scenario(
@@ -2507,7 +2507,7 @@ def test_gossip_execution_payload_bid__valid_gas_limit_increase_within_limit(spe
25072507

25082508

25092509
@with_gloas_and_later
2510-
@spec_state_test
2510+
@spec_state_test_with_matching_config
25112511
def test_gossip_execution_payload_bid__valid_gas_limit_increase_exceeding_limit(spec, state):
25122512
"""When target is above the EIP-1559 max, a bid pinned to the max value is valid."""
25132513
# max_gas_limit_difference = 60_000_000 // 1024 - 1 = 58_592
@@ -2523,7 +2523,7 @@ def test_gossip_execution_payload_bid__valid_gas_limit_increase_exceeding_limit(
25232523

25242524

25252525
@with_gloas_and_later
2526-
@spec_state_test
2526+
@spec_state_test_with_matching_config
25272527
def test_gossip_execution_payload_bid__ignore_gas_limit_increase_exceeding_limit_off_by_one(
25282528
spec, state
25292529
):
@@ -2540,7 +2540,7 @@ def test_gossip_execution_payload_bid__ignore_gas_limit_increase_exceeding_limit
25402540

25412541

25422542
@with_gloas_and_later
2543-
@spec_state_test
2543+
@spec_state_test_with_matching_config
25442544
def test_gossip_execution_payload_bid__valid_gas_limit_decrease_within_limit(spec, state):
25452545
"""A bid with gas_limit lowered within the EIP-1559 step toward target is valid."""
25462546
yield from _run_bid_gas_limit_scenario(
@@ -2555,7 +2555,7 @@ def test_gossip_execution_payload_bid__valid_gas_limit_decrease_within_limit(spe
25552555

25562556

25572557
@with_gloas_and_later
2558-
@spec_state_test
2558+
@spec_state_test_with_matching_config
25592559
def test_gossip_execution_payload_bid__valid_gas_limit_decrease_exceeding_limit(spec, state):
25602560
"""When target is below the EIP-1559 min, a bid pinned to the min value is valid."""
25612561
yield from _run_bid_gas_limit_scenario(
@@ -2570,7 +2570,7 @@ def test_gossip_execution_payload_bid__valid_gas_limit_decrease_exceeding_limit(
25702570

25712571

25722572
@with_gloas_and_later
2573-
@spec_state_test
2573+
@spec_state_test_with_matching_config
25742574
def test_gossip_execution_payload_bid__ignore_gas_limit_decrease_exceeding_limit_off_by_one(
25752575
spec, state
25762576
):
@@ -2587,7 +2587,7 @@ def test_gossip_execution_payload_bid__ignore_gas_limit_decrease_exceeding_limit
25872587

25882588

25892589
@with_gloas_and_later
2590-
@spec_state_test
2590+
@spec_state_test_with_matching_config
25912591
def test_gossip_execution_payload_bid__valid_gas_limit_target_equals_parent(spec, state):
25922592
"""A bid whose gas_limit equals both target and parent gas_limit is valid."""
25932593
yield from _run_bid_gas_limit_scenario(
@@ -2602,7 +2602,7 @@ def test_gossip_execution_payload_bid__valid_gas_limit_target_equals_parent(spec
26022602

26032603

26042604
@with_gloas_and_later
2605-
@spec_state_test
2605+
@spec_state_test_with_matching_config
26062606
def test_gossip_execution_payload_bid__valid_gas_limit_parent_under_step(spec, state):
26072607
"""A bid is valid when parent gas_limit is below the 1024 step (step floors to 1)."""
26082608
yield from _run_bid_gas_limit_scenario(
@@ -2617,7 +2617,7 @@ def test_gossip_execution_payload_bid__valid_gas_limit_parent_under_step(spec, s
26172617

26182618

26192619
@with_gloas_and_later
2620-
@spec_state_test
2620+
@spec_state_test_with_matching_config
26212621
def test_gossip_execution_payload_bid__valid_requires_state_advanced_across_epoch(spec, state):
26222622
"""
26232623
A bid that is only coverable because validation advances the state across

0 commit comments

Comments
 (0)