@@ -24,16 +24,17 @@ use qbft_manager::{
24
24
} ;
25
25
use safe_arith:: { ArithError , SafeArith } ;
26
26
use signature_collector:: {
27
- CollectionError , SignatureCollectorManager , SignatureMetadata , SignatureRequester , SigningData ,
27
+ CollectionError , SignatureCollectorManager , SignatureMetadata , SignatureRequester ,
28
+ ValidatorSigningData ,
28
29
} ;
29
30
use slashing_protection:: { NotSafe , Safe , SlashingDatabase } ;
30
31
use slot_clock:: SlotClock ;
31
32
use ssv_types:: {
32
33
Cluster , CommitteeId , ValidatorIndex , ValidatorMetadata ,
33
34
consensus:: {
34
35
BEACON_ROLE_AGGREGATOR , BEACON_ROLE_PROPOSER , BEACON_ROLE_SYNC_COMMITTEE_CONTRIBUTION ,
35
- BeaconVote , Contribution , ContributionWrapper , Contributions , ValidatorConsensusData ,
36
- ValidatorDuty ,
36
+ BeaconVote , Contribution , ContributionWrapper , Contributions , QbftData ,
37
+ ValidatorConsensusData , ValidatorDuty ,
37
38
} ,
38
39
msgid:: Role ,
39
40
partial_sig:: PartialSignatureKind ,
@@ -335,6 +336,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
335
336
& self ,
336
337
signature_kind : PartialSignatureKind ,
337
338
role : Role ,
339
+ base_hash : Option < Hash256 > ,
338
340
validator : InitializedValidator ,
339
341
signing_root : Hash256 ,
340
342
slot : Slot ,
@@ -353,7 +355,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
353
355
committee_id,
354
356
} ;
355
357
356
- let requester = if role == Role :: Committee {
358
+ let requester = if let Some ( base_hash ) = base_hash {
357
359
let metadata = self . get_slot_metadata ( slot) . await ?;
358
360
SignatureRequester :: Committee {
359
361
num_signatures_to_collect : self
@@ -375,14 +377,15 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
375
377
. sum ( )
376
378
} )
377
379
. unwrap_or_default ( ) ,
380
+ base_hash,
378
381
}
379
382
} else {
380
383
SignatureRequester :: SingleValidator {
381
384
pubkey : validator. metadata . public_key ,
382
385
}
383
386
} ;
384
387
385
- let signing_data = SigningData {
388
+ let signing_data = ValidatorSigningData {
386
389
root : signing_root,
387
390
index : validator
388
391
. metadata
@@ -514,6 +517,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
514
517
. collect_signature (
515
518
PartialSignatureKind :: PostConsensus ,
516
519
Role :: Proposer ,
520
+ None ,
517
521
self . validator ( validator_pubkey) ?,
518
522
signing_root,
519
523
header. slot ,
@@ -616,6 +620,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
616
620
. collect_signature (
617
621
PartialSignatureKind :: VoluntaryExit ,
618
622
Role :: VoluntaryExit ,
623
+ None ,
619
624
self . validator ( validator_pubkey) ?,
620
625
signing_root,
621
626
slot,
@@ -835,6 +840,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
835
840
self . collect_signature (
836
841
PartialSignatureKind :: RandaoPartialSig ,
837
842
Role :: Proposer ,
843
+ None ,
838
844
self . validator ( validator_pubkey) ?,
839
845
signing_root,
840
846
self . slot_clock . now ( ) . ok_or ( SpecificError :: SlotClock ) ?,
@@ -972,6 +978,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
972
978
Completed :: TimedOut => return Err ( Error :: SpecificError ( SpecificError :: Timeout ) ) ,
973
979
Completed :: Success ( data) => data,
974
980
} ;
981
+ let data_hash = data. hash ( ) ;
975
982
attestation. data_mut ( ) . beacon_block_root = data. block_root ;
976
983
attestation. data_mut ( ) . source = data. source ;
977
984
attestation. data_mut ( ) . target = data. target ;
@@ -992,6 +999,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
992
999
. collect_signature (
993
1000
PartialSignatureKind :: PostConsensus ,
994
1001
Role :: Committee ,
1002
+ Some ( data_hash) ,
995
1003
validator,
996
1004
signing_root,
997
1005
attestation. data ( ) . slot ,
@@ -1036,6 +1044,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1036
1044
. collect_signature (
1037
1045
PartialSignatureKind :: ValidatorRegistration ,
1038
1046
Role :: ValidatorRegistration ,
1047
+ None ,
1039
1048
self . validator ( validator_registration_data. pubkey ) ?,
1040
1049
signing_root,
1041
1050
validity_slot,
@@ -1149,6 +1158,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1149
1158
. collect_signature (
1150
1159
PartialSignatureKind :: PostConsensus ,
1151
1160
Role :: Aggregator ,
1161
+ None ,
1152
1162
validator,
1153
1163
signing_root,
1154
1164
message. aggregate ( ) . get_slot ( ) ,
@@ -1190,6 +1200,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1190
1200
self . collect_signature (
1191
1201
PartialSignatureKind :: SelectionProofPartialSig ,
1192
1202
Role :: Aggregator ,
1203
+ None ,
1193
1204
self . validator ( validator_pubkey) ?,
1194
1205
signing_root,
1195
1206
slot,
@@ -1234,6 +1245,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1234
1245
self . collect_signature (
1235
1246
PartialSignatureKind :: ContributionProofs ,
1236
1247
Role :: SyncCommittee ,
1248
+ None ,
1237
1249
self . validator ( * validator_pubkey) ?,
1238
1250
signing_root,
1239
1251
slot,
@@ -1294,6 +1306,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1294
1306
. collect_signature (
1295
1307
PartialSignatureKind :: PostConsensus ,
1296
1308
Role :: Committee ,
1309
+ Some ( data. hash ( ) ) ,
1297
1310
validator,
1298
1311
signing_root,
1299
1312
slot,
@@ -1441,6 +1454,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1441
1454
self . collect_signature (
1442
1455
PartialSignatureKind :: PostConsensus ,
1443
1456
Role :: SyncCommittee ,
1457
+ None ,
1444
1458
validator,
1445
1459
signing_root,
1446
1460
slot,
0 commit comments