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
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def test_gossip_beacon_aggregate_and_proof__valid(spec, state):
Test that a valid aggregate and proof passes gossip validation.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -109,6 +108,7 @@ def test_gossip_beacon_aggregate_and_proof__valid(spec, state):
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -139,7 +139,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_committee_index_out_of_range(
Test that an aggregate with committee index out of range is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -150,6 +149,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_committee_index_out_of_range(
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -191,7 +191,6 @@ def test_gossip_beacon_aggregate_and_proof__ignore_slot_not_within_range(spec, s
Test that an aggregate from a slot too far in the future is ignored.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -202,6 +201,7 @@ def test_gossip_beacon_aggregate_and_proof__ignore_slot_not_within_range(spec, s
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -241,7 +241,6 @@ def test_gossip_beacon_aggregate_and_proof__valid_within_clock_disparity(spec, s
Test that an aggregate at exactly the clock disparity boundary is valid.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -252,6 +251,7 @@ def test_gossip_beacon_aggregate_and_proof__valid_within_clock_disparity(spec, s
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -290,7 +290,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_epoch_mismatch(spec, state):
Test that an aggregate whose epoch doesn't match target is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -301,6 +300,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_epoch_mismatch(spec, state):
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -341,7 +341,6 @@ def test_gossip_beacon_aggregate_and_proof__ignore_already_seen_aggregate(spec,
Test that a duplicate aggregate data root is ignored.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

messages = []
seen = get_seen(spec)
Expand All @@ -353,6 +352,7 @@ def test_gossip_beacon_aggregate_and_proof__ignore_already_seen_aggregate(spec,
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -396,7 +396,6 @@ def test_gossip_beacon_aggregate_and_proof__ignore_same_data_root_without_supers
a prior aggregate has a non-strict superset of aggregation bits.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

messages = []
seen = get_seen(spec)
Expand All @@ -408,6 +407,7 @@ def test_gossip_beacon_aggregate_and_proof__ignore_same_data_root_without_supers
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(
spec,
Expand Down Expand Up @@ -486,7 +486,6 @@ def test_gossip_beacon_aggregate_and_proof__valid_two_aggregators_same_data(spec
is already in seen.aggregate_data_roots).
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

messages = []
seen = get_seen(spec)
Expand All @@ -498,6 +497,7 @@ def test_gossip_beacon_aggregate_and_proof__valid_two_aggregators_same_data(spec
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

# Create two attestations with different single-participant aggregation bits
# so neither is a superset of the other
Expand Down Expand Up @@ -568,7 +568,6 @@ def test_gossip_beacon_aggregate_and_proof__ignore_block_not_seen(spec, state):
Test that an aggregate for an unseen block is ignored.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -582,6 +581,7 @@ def test_gossip_beacon_aggregate_and_proof__ignore_block_not_seen(spec, state):
# Build and apply a block (but don't add to store)
block = build_empty_block_for_next_slot(spec, state)
signed_block = state_transition_and_sign_block(spec, state, block)
yield "state", state

# Create an attestation referencing the unseen block
attestation = get_valid_attestation(
Expand Down Expand Up @@ -622,7 +622,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_aggregation_bits_size_mismatc
Test that an aggregate with wrong aggregation bits size is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -633,6 +632,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_aggregation_bits_size_mismatc
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -679,7 +679,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_no_participants(spec, state):
Test that an aggregate with no participants is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -690,6 +689,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_no_participants(spec, state):
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -734,7 +734,6 @@ def test_gossip_beacon_aggregate_and_proof__ignore_already_seen_aggregator(spec,
Test that a second aggregate from the same aggregator in the same epoch is ignored.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

messages = []
seen = get_seen(spec)
Expand All @@ -746,6 +745,7 @@ def test_gossip_beacon_aggregate_and_proof__ignore_already_seen_aggregator(spec,
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation1 = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg1 = create_signed_aggregate_and_proof(spec, state, attestation1)
Expand Down Expand Up @@ -804,7 +804,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_not_aggregator(spec, state):
Test that an aggregate from a validator not selected as aggregator is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -815,6 +814,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_not_aggregator(spec, state):
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

# Search for a non-aggregator at the current slot across all committees
non_aggregator_index = None
Expand Down Expand Up @@ -886,7 +886,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_aggregator_not_in_committee(s
Test that an aggregate from a validator not in the committee is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -897,6 +896,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_aggregator_not_in_committee(s
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -945,7 +945,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_aggregator_index_out_of_range
Test that an aggregate with out-of-range aggregator index is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -956,6 +955,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_aggregator_index_out_of_range
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -996,7 +996,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_invalid_selection_proof(spec,
Test that an aggregate with invalid selection proof signature is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -1007,6 +1006,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_invalid_selection_proof(spec,
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -1048,7 +1048,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_invalid_aggregator_signature(
Test that an aggregate with invalid aggregator signature is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -1059,6 +1058,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_invalid_aggregator_signature(
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down Expand Up @@ -1100,7 +1100,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_invalid_aggregate_signature(s
Test that an aggregate with invalid aggregate attestation signature is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -1111,6 +1110,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_invalid_aggregate_signature(s
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

# Create an attestation with INVALID signature BEFORE creating the aggregate
attestation = get_valid_attestation(spec, state, signed=False, beacon_block_root=anchor_root)
Expand Down Expand Up @@ -1151,7 +1151,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_block_failed_validation(spec,
Test that an aggregate for a block that failed validation is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -1164,6 +1163,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_block_failed_validation(spec,
# Build and apply a block
block = build_empty_block_for_next_slot(spec, state)
signed_block = state_transition_and_sign_block(spec, state, block)
yield "state", state

yield get_filename(signed_block), signed_block

Expand Down Expand Up @@ -1215,7 +1215,6 @@ def test_gossip_beacon_aggregate_and_proof__reject_target_not_ancestor(spec, sta
Test that an aggregate whose target is not an ancestor of the LMD vote block is rejected.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -1226,6 +1225,7 @@ def test_gossip_beacon_aggregate_and_proof__reject_target_not_ancestor(spec, sta
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

# Create an attestation with wrong target root BEFORE signing
attestation = get_valid_attestation(spec, state, signed=False, beacon_block_root=anchor_root)
Expand Down Expand Up @@ -1267,7 +1267,6 @@ def test_gossip_beacon_aggregate_and_proof__ignore_finalized_not_ancestor(spec,
Test that an aggregate for a block not descending from finalized checkpoint is ignored.
"""
yield "topic", "meta", "beacon_aggregate_and_proof"
yield "state", state

seen = get_seen(spec)
store, anchor_block = get_genesis_forkchoice_store_and_block(spec, state)
Expand All @@ -1278,6 +1277,7 @@ def test_gossip_beacon_aggregate_and_proof__ignore_finalized_not_ancestor(spec,
yield "blocks", "meta", [{"block": get_filename(signed_anchor)}]

next_slot(spec, state)
yield "state", state

attestation = get_valid_attestation(spec, state, signed=True, beacon_block_root=anchor_root)
signed_agg = create_signed_aggregate_and_proof(spec, state, attestation)
Expand Down
Loading