From 6f3171bfc30819649234d7452dc0f64bb124ff56 Mon Sep 17 00:00:00 2001 From: Tuyen Nguyen Date: Thu, 16 May 2024 17:47:41 +0300 Subject: [PATCH] chore: print duty committeeIndices --- .../validator/src/services/attestation.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/validator/src/services/attestation.ts b/packages/validator/src/services/attestation.ts index 47a726dad011..2f80a1437e6b 100644 --- a/packages/validator/src/services/attestation.ts +++ b/packages/validator/src/services/attestation.ts @@ -1,5 +1,5 @@ import {toHexString} from "@chainsafe/ssz"; -import {allForks, BLSSignature, electra, phase0, Slot, ssz} from "@lodestar/types"; +import {allForks, BLSSignature, electra, isElectraAttestation, phase0, Slot, ssz} from "@lodestar/types"; import {computeEpochAtSlot, isAggregatorFromCommitteeLength} from "@lodestar/state-transition"; import {sleep} from "@lodestar/utils"; import {Api, ApiError, routes} from "@lodestar/api"; @@ -227,13 +227,18 @@ export class AttestationService { ...(this.opts?.disableAttestationGrouping && {index: attestationNoCommittee.index}), }; try { - const firstAttestation = signedAttestations[0] as electra.Attestation; - const logCtx2 = { - slot: firstAttestation.data.slot, - indexInData: firstAttestation.data.index, - committeeBits: firstAttestation.committeeBits.toBoolArray().join(",") ?? "undefinedd", - }; - this.logger.info("@@@ vc submitPoolAttestations", logCtx2); + for (const [i, firstAttestation] of signedAttestations.entries()) { + const logCtx2 = { + i, + slot: firstAttestation.data.slot, + indexInData: firstAttestation.data.index, + committeeBits: isElectraAttestation(firstAttestation) + ? firstAttestation.committeeBits.toBoolArray().join(",") + : "undefinedd", + }; + this.logger.info("@@@ vc submitPoolAttestations", logCtx2); + } + this.logger.info("@@@ duties", {duties: duties.map((duty) => duty.duty.committeeIndex).join(",")}); ApiError.assert(await this.api.beacon.submitPoolAttestations(signedAttestations)); this.logger.info("Published attestations", {...logCtx, count: signedAttestations.length}); this.metrics?.publishedAttestations.inc(signedAttestations.length);