@@ -148,12 +148,13 @@ export class AttestationService {
148
148
this . metrics ?. attesterStepCallProduceAggregate . observe ( this . clock . secFromSlot ( slot + 2 / 3 ) ) ;
149
149
150
150
const dutiesByCommitteeIndex = groupAttDutiesByCommitteeIndex ( dutiesAll ) ;
151
+ const isAfterElectra = computeEpochAtSlot ( slot ) >= this . config . ELECTRA_FORK_EPOCH ;
151
152
152
153
// Then download, sign and publish a `SignedAggregateAndProof` for each
153
154
// validator that is elected to aggregate for this `slot` and `committeeIndex`.
154
155
await Promise . all (
155
156
Array . from ( dutiesByCommitteeIndex . entries ( ) ) . map ( ( [ index , dutiesSameCommittee ] ) => {
156
- const attestationData : phase0 . AttestationData = { ...attestationNoCommittee , index} ;
157
+ const attestationData : phase0 . AttestationData = { ...attestationNoCommittee , index : isAfterElectra ? 0 : index } ;
157
158
return this . produceAndPublishAggregates ( attestationData , index , dutiesSameCommittee ) ;
158
159
} )
159
160
) ;
@@ -184,10 +185,11 @@ export class AttestationService {
184
185
const signedAttestations : phase0 . Attestation [ ] = [ ] ;
185
186
const headRootHex = toHexString ( attestationNoCommittee . beaconBlockRoot ) ;
186
187
const currentEpoch = computeEpochAtSlot ( slot ) ;
188
+ const isAfterElectra = currentEpoch >= this . config . ELECTRA_FORK_EPOCH ;
187
189
188
190
await Promise . all (
189
191
duties . map ( async ( { duty} ) => {
190
- const index = duty . committeeIndex ;
192
+ const index = isAfterElectra ? 0 : duty . committeeIndex ;
191
193
const attestationData : phase0 . AttestationData = { ...attestationNoCommittee , index} ;
192
194
const logCtxValidator = { slot, index, head : headRootHex , validatorIndex : duty . validatorIndex } ;
193
195
0 commit comments