1919 ../ beacon_chain/ fork_choice/ fork_choice,
2020 ../ beacon_chain/ consensus_object_pools/ [
2121 block_quarantine, blockchain_dag, block_clearance, attestation_pool,
22- sync_committee_msg_pool],
22+ envelope_quarantine, sync_committee_msg_pool],
2323 ../ beacon_chain/ spec/ datatypes/ [phase0, altair],
2424 ../ beacon_chain/ spec/ [
2525 beaconstate, state_transition, helpers, network, validator],
@@ -48,6 +48,7 @@ suite "Gossip validation " & preset():
4848 taskpool = Taskpool .new ()
4949 verifier {.used .} = BatchVerifier .init (rng, taskpool)
5050 quarantine = newClone (Quarantine .init (dag.cfg))
51+ envQuarantine = newClone (EnvelopeQuarantine .init ())
5152 pool {.used .} = newClone (AttestationPool .init (dag, quarantine))
5253 state = newClone (dag.headState)
5354 cache = StateCache ()
@@ -113,29 +114,29 @@ suite "Gossip validation " & preset():
113114 beaconTime = att_1_0.data.slot.start_beacon_time (cfg.timeParams)
114115
115116 check:
116- validateAttestation (pool, batchCrypto, nil , att_1_0, beaconTime, subnet, true ).waitFor ().isOk
117+ validateAttestation (pool, batchCrypto, envQuarantine , att_1_0, beaconTime, subnet, true ).waitFor ().isOk
117118
118119 # Same validator again
119- validateAttestation (pool, batchCrypto, nil , att_1_0, beaconTime, subnet, true ).waitFor ().error ()[0 ] ==
120+ validateAttestation (pool, batchCrypto, envQuarantine , att_1_0, beaconTime, subnet, true ).waitFor ().error ()[0 ] ==
120121 ValidationResult .Ignore
121122
122123 pool[].nextAttestationEpoch.setLen (0 ) # reset for test
123124 check:
124125 # Wrong subnet
125126 validateAttestation (
126- pool, batchCrypto, nil , att_1_0, beaconTime, SubnetId (subnet.uint8 + 1 ), true ).waitFor ().isErr
127+ pool, batchCrypto, envQuarantine , att_1_0, beaconTime, SubnetId (subnet.uint8 + 1 ), true ).waitFor ().isErr
127128
128129 pool[].nextAttestationEpoch.setLen (0 ) # reset for test
129130 check:
130131 # Too far in the future
131132 validateAttestation (
132- pool, batchCrypto, nil , att_1_0, beaconTime - 1 .seconds, subnet, true ).waitFor ().isErr
133+ pool, batchCrypto, envQuarantine , att_1_0, beaconTime - 1 .seconds, subnet, true ).waitFor ().isErr
133134
134135 pool[].nextAttestationEpoch.setLen (0 ) # reset for test
135136 check:
136137 # Too far in the past
137138 validateAttestation (
138- pool, batchCrypto, nil , att_1_0, beaconTime -
139+ pool, batchCrypto, envQuarantine , att_1_0, beaconTime -
139140 cfg.timeParams.SLOT_DURATION * SLOTS_PER_EPOCH .int64 - 1 .seconds,
140141 subnet, true ).waitFor ().isErr
141142
@@ -146,7 +147,7 @@ suite "Gossip validation " & preset():
146147 check:
147148 # Invalid signature
148149 validateAttestation (
149- pool, batchCrypto, nil , broken, beaconTime, subnet, true ).waitFor ().
150+ pool, batchCrypto, envQuarantine , broken, beaconTime, subnet, true ).waitFor ().
150151 error ()[0 ] == ValidationResult .Reject
151152
152153 block :
@@ -156,9 +157,9 @@ suite "Gossip validation " & preset():
156157 # One invalid, one valid (batched)
157158 let
158159 fut_1_0 = validateAttestation (
159- pool, batchCrypto, nil , broken, beaconTime, subnet, true )
160+ pool, batchCrypto, envQuarantine , broken, beaconTime, subnet, true )
160161 fut_1_1 = validateAttestation (
161- pool, batchCrypto, nil , att_1_1, beaconTime, subnet, true )
162+ pool, batchCrypto, envQuarantine, att_1_1, beaconTime, subnet, true )
162163
163164 check:
164165 fut_1_0.waitFor ().error ()[0 ] == ValidationResult .Reject
@@ -172,9 +173,9 @@ suite "Gossip validation " & preset():
172173 # One invalid, one valid (batched)
173174 let
174175 fut_1_0 = validateAttestation (
175- pool, batchCrypto, nil , broken, beaconTime, subnet, true )
176+ pool, batchCrypto, envQuarantine , broken, beaconTime, subnet, true )
176177 fut_1_1 = validateAttestation (
177- pool, batchCrypto, nil , att_1_1, beaconTime, subnet, true )
178+ pool, batchCrypto, envQuarantine, att_1_1, beaconTime, subnet, true )
178179
179180 check:
180181 fut_1_0.waitFor ().error ()[0 ] == ValidationResult .Reject
@@ -194,9 +195,9 @@ suite "Gossip validation " & preset():
194195 # the individual attestations are invalid but their aggregate validates!
195196 let
196197 fut_1_0 = validateAttestation (
197- pool, batchCrypto, nil , broken_1_0, beaconTime, subnet, true )
198+ pool, batchCrypto, envQuarantine , broken_1_0, beaconTime, subnet, true )
198199 fut_1_1 = validateAttestation (
199- pool, batchCrypto, nil , broken_1_1, beaconTime, subnet, true )
200+ pool, batchCrypto, envQuarantine , broken_1_1, beaconTime, subnet, true )
200201
201202 check:
202203 fut_1_0.waitFor ().error ()[0 ] == ValidationResult .Reject
0 commit comments