Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: publish attestations with non-zero committee index #6790

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/validator/src/services/attestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ export class AttestationService {
this.metrics?.attesterStepCallProduceAggregate.observe(this.clock.secFromSlot(slot + 2 / 3));

const dutiesByCommitteeIndex = groupAttDutiesByCommitteeIndex(dutiesAll);
const isAfterElectra = computeEpochAtSlot(slot) >= this.config.ELECTRA_FORK_EPOCH;

// Then download, sign and publish a `SignedAggregateAndProof` for each
// validator that is elected to aggregate for this `slot` and `committeeIndex`.
await Promise.all(
Array.from(dutiesByCommitteeIndex.entries()).map(([index, dutiesSameCommittee]) => {
const attestationData: phase0.AttestationData = {...attestationNoCommittee, index};
const attestationData: phase0.AttestationData = {...attestationNoCommittee, index: isAfterElectra ? 0 : index};
return this.produceAndPublishAggregates(attestationData, index, dutiesSameCommittee);
})
);
Expand Down Expand Up @@ -186,10 +187,11 @@ export class AttestationService {
const signedAttestations: phase0.Attestation[] = [];
const headRootHex = toHexString(attestationNoCommittee.beaconBlockRoot);
const currentEpoch = computeEpochAtSlot(slot);
const isAfterElectra = currentEpoch >= this.config.ELECTRA_FORK_EPOCH;

await Promise.all(
duties.map(async ({duty}) => {
const index = duty.committeeIndex;
const index = isAfterElectra ? 0 : duty.committeeIndex;
const attestationData: phase0.AttestationData = {...attestationNoCommittee, index};
const logCtxValidator = {slot, index, head: headRootHex, validatorIndex: duty.validatorIndex};

Expand Down
Loading