Skip to content

When removing ValidatorPurpose peers, all remote nodes with that purpose should be considered, not just those currently peered with #948

@tkporter

Description

@tkporter

Expected Behavior

When calling ClearValidatorPeers or ReplaceValidatorPeers, we should consider all nodes that are have the static/trusted purpose ValidatorPurpose, not just those that are currently peered with.

Current Behavior

We currently iterate through all current peers. In the event that a remote ValidatorPurpose peer has already disconnected (which has a high chance of happening if the current node becomes unelected) by the time the current node wants to remove all ValidatorPurpose peers, those remote peers that have already disconnected will still remain as trusted/static ValidatorPurpose peers. This results in the current node continuing to peer with them, even though they shouldn't.

Steps to Reproduce Behavior

Unelect a validator, look at the logs after the epoch change

Logs

n/a

System information

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions