produce Elctra attestations when running tests (#6383)

Test blocks don't include Electra attestations currently so finality
breaks and tests fail if prolonged. Fix that.
This commit is contained in:
Etan Kissling 2024-06-23 15:06:58 +02:00 committed by GitHub
parent 9b6b42c8f9
commit 6d0c9d37fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -611,11 +611,17 @@ iterator makeTestBlocks*(
let let
parent_root = withState(state[]): forkyState.latest_block_root parent_root = withState(state[]): forkyState.latest_block_root
attestations = attestations =
if attested: if attested and state.kind < ConsensusFork.Electra:
makeFullAttestations( makeFullAttestations(
state[], parent_root, getStateField(state[], slot), cache) state[], parent_root, getStateField(state[], slot), cache)
else: else:
@[] @[]
electraAttestations =
if attested and state.kind >= ConsensusFork.Electra:
makeFullElectraAttestations(
state[], parent_root, getStateField(state[], slot), cache)
else:
@[]
stateEth1 = getStateField(state[], eth1_data) stateEth1 = getStateField(state[], eth1_data)
stateDepositIndex = getStateField(state[], eth1_deposit_index) stateDepositIndex = getStateField(state[], eth1_deposit_index)
deposits = deposits =
@ -633,6 +639,7 @@ iterator makeTestBlocks*(
state[], cache, state[], cache,
eth1_data = eth1_data, eth1_data = eth1_data,
attestations = attestations, attestations = attestations,
electraAttestations = electraAttestations,
deposits = deposits, deposits = deposits,
sync_aggregate = sync_aggregate, sync_aggregate = sync_aggregate,
graffiti = graffiti, graffiti = graffiti,