@@ -50,6 +50,7 @@ import (
5050
5151func Test_pruneAttsFromPool_Electra (t * testing.T ) {
5252 ctx := context .Background ()
53+ logHook := logTest .NewGlobal ()
5354
5455 params .SetupTestConfigCleanup (t )
5556 cfg := params .BeaconConfig ().Copy ()
@@ -71,7 +72,7 @@ func Test_pruneAttsFromPool_Electra(t *testing.T) {
7172 cb := primitives .NewAttestationCommitteeBits ()
7273 cb .SetBitAt (0 , true )
7374 att1 := & ethpb.AttestationElectra {
74- AggregationBits : bitfield.Bitlist {0b11110111 , 0b00000001 },
75+ AggregationBits : bitfield.Bitlist {0b10000000 , 0b00000001 },
7576 Data : data ,
7677 Signature : make ([]byte , 96 ),
7778 CommitteeBits : cb ,
@@ -95,16 +96,15 @@ func Test_pruneAttsFromPool_Electra(t *testing.T) {
9596 CommitteeBits : cb ,
9697 }
9798
98- require .NoError (t , s .cfg .AttPool .SaveAggregatedAttestation (att1 ))
99+ require .NoError (t , s .cfg .AttPool .SaveUnaggregatedAttestation (att1 ))
99100 require .NoError (t , s .cfg .AttPool .SaveAggregatedAttestation (att2 ))
100101 require .NoError (t , s .cfg .AttPool .SaveAggregatedAttestation (att3 ))
101- require .Equal (t , 3 , len (s .cfg .AttPool .AggregatedAttestations ()))
102102
103103 cb = primitives .NewAttestationCommitteeBits ()
104104 cb .SetBitAt (0 , true )
105105 cb .SetBitAt (1 , true )
106106 onChainAtt := & ethpb.AttestationElectra {
107- AggregationBits : bitfield.Bitlist {0b11110111 , 0b11110111 , 0b00000001 },
107+ AggregationBits : bitfield.Bitlist {0b10000000 , 0b11110111 , 0b00000001 },
108108 Data : data ,
109109 Signature : make ([]byte , 96 ),
110110 CommitteeBits : cb ,
@@ -127,7 +127,12 @@ func Test_pruneAttsFromPool_Electra(t *testing.T) {
127127 require .Equal (t , 4 , len (committees ))
128128
129129 require .NoError (t , s .pruneAttsFromPool (ctx , st , rob ))
130- attsInPool := s .cfg .AttPool .AggregatedAttestations ()
130+ require .LogsDoNotContain (t , logHook , "Could not prune attestations" )
131+
132+ attsInPool , err := s .cfg .AttPool .UnaggregatedAttestations ()
133+ require .NoError (t , err )
134+ assert .Equal (t , 0 , len (attsInPool ))
135+ attsInPool = s .cfg .AttPool .AggregatedAttestations ()
131136 require .Equal (t , 1 , len (attsInPool ))
132137 assert .DeepEqual (t , att3 , attsInPool [0 ])
133138}
@@ -908,6 +913,8 @@ func TestInsertFinalizedDeposits_MultipleFinalizedRoutines(t *testing.T) {
908913}
909914
910915func TestRemoveBlockAttestationsInPool (t * testing.T ) {
916+ logHook := logTest .NewGlobal ()
917+
911918 genesis , keys := util .DeterministicGenesisState (t , 64 )
912919 b , err := util .GenerateFullBlock (genesis , keys , util .DefaultBlockGenConfig (), 1 )
913920 assert .NoError (t , err )
@@ -928,6 +935,7 @@ func TestRemoveBlockAttestationsInPool(t *testing.T) {
928935 wsb , err := consensusblocks .NewSignedBeaconBlock (b )
929936 require .NoError (t , err )
930937 require .NoError (t , service .pruneAttsFromPool (context .Background (), nil /* state not needed pre-Electra */ , wsb ))
938+ require .LogsDoNotContain (t , logHook , "Could not prune attestations" )
931939 require .Equal (t , 0 , service .cfg .AttPool .AggregatedAttestationCount ())
932940}
933941
0 commit comments