@@ -175,16 +175,6 @@ suite "Attestation pool processing" & preset():
175175 check_attestation (forkyState.data, att1, flags, cache2).isOk
176176 check_attestation (forkyState.data, att2, flags, cache2).isOk
177177
178- # An additional compatibility check catches that (used in block production)
179- withState (state[]):
180- check:
181- check_attestation_compatible (dag, forkyState, att1).isOk
182- check_attestation_compatible (dag, forkyState, att2).isErr
183- withState (state2[]):
184- check:
185- check_attestation_compatible (dag, forkyState, att1).isErr
186- check_attestation_compatible (dag, forkyState, att2).isOk
187-
188178 test " Can add and retrieve simple attestations" & preset ():
189179 let
190180 # Create an attestation for slot 1!
@@ -468,8 +458,6 @@ suite "Attestation pool processing" & preset():
468458 # signature: ValidatorSig()
469459 )
470460
471- cache = StateCache ()
472-
473461 # -------------------------------------------------------------
474462 # Prune
475463
@@ -569,13 +557,13 @@ suite "Attestation pool electra processing" & preset():
569557 slot = getStateField (state[], slot)
570558 parent_root = withState (state[]): forkyState.latest_block_root
571559 committee = get_beacon_committee (state[], slot, cIndex, cache)
572- makeAttestation (state[], parent_root, committee[0 ], cache)
560+ makeElectraAttestation (state[], parent_root, committee[0 ], cache)
573561 att2 = block :
574562 let
575563 slot = getStateField (state2[], slot)
576564 parent_root = withState (state2[]): forkyState.latest_block_root
577565 committee = get_beacon_committee (state2[], slot, cIndex, cache2)
578- makeAttestation (state2[], parent_root, committee[0 ], cache2)
566+ makeElectraAttestation (state2[], parent_root, committee[0 ], cache2)
579567 maxSlot = max (att1.data.slot, att2.data.slot)
580568
581569 # Advance time so attestations become valid
@@ -589,24 +577,28 @@ suite "Attestation pool electra processing" & preset():
589577
590578 # They should remain valid only within a compatible state
591579 withState (state[]):
592- check:
593- check_attestation (forkyState.data, att1, {}, cache).isOk
594- check_attestation (forkyState.data, att2, {}, cache).isErr
580+ when consensusFork >= ConsensusFork .Electra :
581+ check:
582+ check_attestation (forkyState.data, att1, {}, cache, true ).isOk
583+ check_attestation (forkyState.data, att2, {}, cache, true ).isErr
595584 withState (state2[]):
596- check:
597- check_attestation (forkyState.data, att1, {}, cache2).isErr
598- check_attestation (forkyState.data, att2, {}, cache2).isOk
585+ when consensusFork >= ConsensusFork .Electra :
586+ check:
587+ check_attestation (forkyState.data, att1, {}, cache2, true ).isErr
588+ check_attestation (forkyState.data, att2, {}, cache2, true ).isOk
599589
600590 # If signature checks are skipped, state incompatibility is not detected
601- let flags = {skipBlsValidation}
591+ const flags = {skipBlsValidation}
602592 withState (state[]):
603- check:
604- check_attestation (forkyState.data, att1, flags, cache).isOk
605- check_attestation (forkyState.data, att2, flags, cache).isOk
593+ when consensusFork >= ConsensusFork .Electra :
594+ check:
595+ check_attestation (forkyState.data, att1, flags, cache, true ).isOk
596+ check_attestation (forkyState.data, att2, flags, cache, true ).isOk
606597 withState (state2[]):
607- check:
608- check_attestation (forkyState.data, att1, flags, cache2).isOk
609- check_attestation (forkyState.data, att2, flags, cache2).isOk
598+ when consensusFork >= ConsensusFork .Electra :
599+ check:
600+ check_attestation (forkyState.data, att1, flags, cache2, true ).isOk
601+ check_attestation (forkyState.data, att2, flags, cache2, true ).isOk
610602
611603 # An additional compatibility check catches that (used in block production)
612604 withState (state[]):
0 commit comments