@@ -469,20 +469,33 @@ export class AttestationDutiesService {
469469
470470 const res = await this . api . validator . submitBeaconCommitteeSelections ( { selections : partialSelections } ) ;
471471
472- const combinedSelections = res . value ( ) ;
473- this . logger . debug ( "Received combined beacon committee selection proofs" , { epoch, count : combinedSelections . length } ) ;
472+ const combinedSelections = new Map < ValidatorIndex , routes . validator . BeaconCommitteeSelection > ( ) ;
473+ for ( const selection of res . value ( ) ) {
474+ combinedSelections . set ( selection . validatorIndex , selection ) ;
475+ }
476+ this . logger . debug ( "Received combined beacon committee selection proofs" , { epoch, count : combinedSelections . size } ) ;
474477
475478 for ( const dutyAndProof of duties ) {
476479 const { slot, validatorIndex, committeeIndex, committeeLength} = dutyAndProof . duty ;
477480 const logCtxValidator = { slot, index : committeeIndex , validatorIndex} ;
478481
479- const combinedSelection = combinedSelections . find ( ( s ) => s . validatorIndex === validatorIndex && s . slot === slot ) ;
482+ const combinedSelection = combinedSelections . get ( validatorIndex ) ;
480483
481484 if ( ! combinedSelection ) {
482485 this . logger . debug ( "Did not receive combined beacon committee selection proof" , logCtxValidator ) ;
483486 continue ;
484487 }
485488
489+ if ( combinedSelection . slot !== slot ) {
490+ this . logger . debug ( "Received combined beacon committee selection proof for different slot" , {
491+ expected : slot ,
492+ actual : combinedSelection . slot ,
493+ index : committeeIndex ,
494+ validatorIndex,
495+ } ) ;
496+ continue ;
497+ }
498+
486499 const isAggregator = isAggregatorFromCommitteeLength ( committeeLength , combinedSelection . selectionProof ) ;
487500
488501 if ( isAggregator ) {
0 commit comments