Skip to content
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
18 changes: 18 additions & 0 deletions yarn-project/validator-client/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ export class ValidatorClient extends (EventEmitter as new () => WatcherEmitter)
return false;
}

// Ignore proposals from ourselves (may happen in HA setups)
if (this.getValidatorAddresses().some(addr => addr.equals(proposer))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this isn't going to prohibit propagation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this kicks in after the inivial validations run in the libp2p service that gate propagation

this.log.warn(`Ignoring block proposal from self for slot ${slotNumber}`, {
proposer: proposer.toString(),
slotNumber,
});
return false;
}

// Check if we're in the committee (for metrics purposes)
const inCommittee = await this.epochCache.filterInCommittee(slotNumber, this.getValidatorAddresses());
const partOfCommittee = inCommittee.length > 0;
Expand Down Expand Up @@ -453,6 +462,15 @@ export class ValidatorClient extends (EventEmitter as new () => WatcherEmitter)
return undefined;
}

// Ignore proposals from ourselves (may happen in HA setups)
if (this.getValidatorAddresses().some(addr => addr.equals(proposer))) {
this.log.warn(`Ignoring block proposal from self for slot ${slotNumber}`, {
proposer: proposer.toString(),
slotNumber,
});
return undefined;
}

// Check that I have any address in current committee before attesting
const inCommittee = await this.epochCache.filterInCommittee(slotNumber, this.getValidatorAddresses());
const partOfCommittee = inCommittee.length > 0;
Expand Down
Loading