Skip to content

Commit

Permalink
Revise doppelganger registration logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Oct 1, 2023
1 parent 1525c6e commit d40f1cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions packages/validator/src/services/doppelgangerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,19 @@ export class DoppelgangerService {

if (attestedInPreviousEpoch) {
remainingEpochs = REMAINING_EPOCHS_IF_SKIPPED;
this.logger.info(
"Doppelganger detection skipped for validator, previous epoch attestation exists in database",
{
pubkey: prettyBytes(pubkeyHex),
previousEpoch,
}
);
this.logger.info("Doppelganger detection skipped, attestation from previous epoch exists in database", {
pubkey: prettyBytes(pubkeyHex),
previousEpoch,
});
} else {
this.logger.info("Registered validator for doppelganger", {
this.logger.info("Registered validator for doppelganger detection", {
pubkey: prettyBytes(pubkeyHex),
remainingEpochs,
nextEpochToCheck,
});
}
} else {
this.logger.info("Doppelganger detection skipped for validator, initialized before genesis", {
this.logger.info("Doppelganger detection skipped, validator initialized before genesis", {
pubkey: prettyBytes(pubkeyHex),
currentEpoch,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/test/unit/services/doppelganger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe("doppelganger service", () => {
const clock = new ClockMockMsToSlot(initialEpoch);

const slashingProtection = new SlashingProtectionMock();
// Previous epoch attestation exists in slashing protection db
// Attestation from previous epoch exists in slashing protection db
slashingProtection.hasAttestedInEpoch = async () => true;

const doppelganger = new DoppelgangerService(
Expand Down

0 comments on commit d40f1cd

Please sign in to comment.