Skip to content

Commit

Permalink
Add additional logs to debug dvt deployment (temp)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Mar 22, 2023
1 parent 7a5e0c9 commit 602c0fc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/validator/src/services/attestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ export class AttestationService {

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

try {
signedAttestations.push(await this.validatorStore.signAttestation(duty, attestationData, currentEpoch));
Expand All @@ -197,15 +197,17 @@ export class AttestationService {

this.metrics?.attesterStepCallPublishAttestation.observe(this.clock.secFromSlot(slot + 1 / 3));

const logCtx = {slot, index: signedAttestations[0].data.index, count: signedAttestations.length};

// Step 2. Publish all `Attestations` in one go
try {
ApiError.assert(await this.api.beacon.submitPoolAttestations(signedAttestations));
this.logger.info("Published attestations", {slot, count: signedAttestations.length});
this.logger.info("Published attestations", logCtx);
this.metrics?.publishedAttestations.inc(signedAttestations.length);
} catch (e) {
// Note: metric counts only 1 since we don't know how many signedAttestations are invalid
this.metrics?.attestaterError.inc({error: "publish"});
this.logger.error("Error publishing attestations", {slot}, e as Error);
this.logger.error("Error publishing attestations", logCtx, e as Error);
}
}

Expand Down

0 comments on commit 602c0fc

Please sign in to comment.