@@ -88,6 +88,7 @@ def test_invalid_nonset_committee_bits(spec, state):
8888
8989@with_electra_and_later
9090@spec_state_test
91+ @with_presets ([MINIMAL ], "need multiple committees per slot" )
9192def test_invalid_nonset_multiple_committee_bits (spec , state ):
9293 """
9394 EIP-7549 test
@@ -148,3 +149,33 @@ def test_one_committee_with_gap(spec, state):
148149 next_slots (spec , state , spec .MIN_ATTESTATION_INCLUSION_DELAY )
149150
150151 yield from run_attestation_processing (spec , state , attestation )
152+
153+
154+ @with_electra_and_later
155+ @spec_state_test
156+ @with_presets ([MINIMAL ], "need multiple committees per slot" )
157+ def test_invalid_nonset_bits_for_one_committee (spec , state ):
158+ """
159+ EIP-7549 test
160+ """
161+ # Attestation with full committee participating
162+ committee_0 = spec .get_beacon_committee (state , state .slot , 0 )
163+ attestation_1 = get_valid_attestation (spec , state , index = 1 , signed = True )
164+
165+ # Create an on chain aggregate
166+ aggregate = spec .Attestation (data = attestation_1 .data , signature = attestation_1 .signature )
167+ aggregate .committee_bits [0 ] = True
168+ aggregate .committee_bits [1 ] = True
169+ aggregate .aggregation_bits = get_empty_eip7549_aggregation_bits (
170+ spec , state , aggregate .committee_bits , aggregate .data .slot
171+ )
172+ committee_offset = len (committee_0 )
173+ for i in range (len (attestation_1 .aggregation_bits )):
174+ aggregate .aggregation_bits [committee_offset + i ] = attestation_1 .aggregation_bits [i ]
175+
176+ # Check that only one committee is presented
177+ assert spec .get_attesting_indices (state , aggregate ) == spec .get_attesting_indices (state , attestation_1 )
178+
179+ next_slots (spec , state , spec .MIN_ATTESTATION_INCLUSION_DELAY )
180+
181+ yield from run_attestation_processing (spec , state , aggregate , valid = False )
0 commit comments