@@ -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 ,
@@ -342,6 +343,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
342
343
& self ,
343
344
signature_kind : PartialSignatureKind ,
344
345
role : Role ,
346
+ base_hash : Option < Hash256 > ,
345
347
validator : InitializedValidator ,
346
348
signing_root : Hash256 ,
347
349
slot : Slot ,
@@ -360,7 +362,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
360
362
committee_id,
361
363
} ;
362
364
363
- let requester = if role == Role :: Committee {
365
+ let requester = if let Some ( base_hash ) = base_hash {
364
366
let metadata = self . get_slot_metadata ( slot) . await ?;
365
367
SignatureRequester :: Committee {
366
368
num_signatures_to_collect : self
@@ -382,14 +384,15 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
382
384
. sum ( )
383
385
} )
384
386
. unwrap_or_default ( ) ,
387
+ base_hash,
385
388
}
386
389
} else {
387
390
SignatureRequester :: SingleValidator {
388
391
pubkey : validator. metadata . public_key ,
389
392
}
390
393
} ;
391
394
392
- let signing_data = SigningData {
395
+ let signing_data = ValidatorSigningData {
393
396
root : signing_root,
394
397
index : validator
395
398
. metadata
@@ -521,6 +524,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
521
524
. collect_signature (
522
525
PartialSignatureKind :: PostConsensus ,
523
526
Role :: Proposer ,
527
+ None ,
524
528
self . validator ( validator_pubkey) ?,
525
529
signing_root,
526
530
header. slot ,
@@ -623,6 +627,7 @@ impl<T: SlotClock, E: EthSpec> AnchorValidatorStore<T, E> {
623
627
. collect_signature (
624
628
PartialSignatureKind :: VoluntaryExit ,
625
629
Role :: VoluntaryExit ,
630
+ None ,
626
631
self . validator ( validator_pubkey) ?,
627
632
signing_root,
628
633
slot,
@@ -842,6 +847,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
842
847
self . collect_signature (
843
848
PartialSignatureKind :: RandaoPartialSig ,
844
849
Role :: Proposer ,
850
+ None ,
845
851
self . validator ( validator_pubkey) ?,
846
852
signing_root,
847
853
self . slot_clock . now ( ) . ok_or ( SpecificError :: SlotClock ) ?,
@@ -979,6 +985,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
979
985
Completed :: TimedOut => return Err ( Error :: SpecificError ( SpecificError :: Timeout ) ) ,
980
986
Completed :: Success ( data) => data,
981
987
} ;
988
+ let data_hash = data. hash ( ) ;
982
989
attestation. data_mut ( ) . beacon_block_root = data. block_root ;
983
990
attestation. data_mut ( ) . source = data. source ;
984
991
attestation. data_mut ( ) . target = data. target ;
@@ -999,6 +1006,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
999
1006
. collect_signature (
1000
1007
PartialSignatureKind :: PostConsensus ,
1001
1008
Role :: Committee ,
1009
+ Some ( data_hash) ,
1002
1010
validator,
1003
1011
signing_root,
1004
1012
attestation. data ( ) . slot ,
@@ -1043,6 +1051,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1043
1051
. collect_signature (
1044
1052
PartialSignatureKind :: ValidatorRegistration ,
1045
1053
Role :: ValidatorRegistration ,
1054
+ None ,
1046
1055
self . validator ( validator_registration_data. pubkey ) ?,
1047
1056
signing_root,
1048
1057
validity_slot,
@@ -1156,6 +1165,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1156
1165
. collect_signature (
1157
1166
PartialSignatureKind :: PostConsensus ,
1158
1167
Role :: Aggregator ,
1168
+ None ,
1159
1169
validator,
1160
1170
signing_root,
1161
1171
message. aggregate ( ) . get_slot ( ) ,
@@ -1197,6 +1207,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1197
1207
self . collect_signature (
1198
1208
PartialSignatureKind :: SelectionProofPartialSig ,
1199
1209
Role :: Aggregator ,
1210
+ None ,
1200
1211
self . validator ( validator_pubkey) ?,
1201
1212
signing_root,
1202
1213
slot,
@@ -1241,6 +1252,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1241
1252
self . collect_signature (
1242
1253
PartialSignatureKind :: ContributionProofs ,
1243
1254
Role :: SyncCommittee ,
1255
+ None ,
1244
1256
self . validator ( * validator_pubkey) ?,
1245
1257
signing_root,
1246
1258
slot,
@@ -1301,6 +1313,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1301
1313
. collect_signature (
1302
1314
PartialSignatureKind :: PostConsensus ,
1303
1315
Role :: Committee ,
1316
+ Some ( data. hash ( ) ) ,
1304
1317
validator,
1305
1318
signing_root,
1306
1319
slot,
@@ -1448,6 +1461,7 @@ impl<T: SlotClock, E: EthSpec> ValidatorStore for AnchorValidatorStore<T, E> {
1448
1461
self . collect_signature (
1449
1462
PartialSignatureKind :: PostConsensus ,
1450
1463
Role :: SyncCommittee ,
1464
+ None ,
1451
1465
validator,
1452
1466
signing_root,
1453
1467
slot,
0 commit comments