celo-blockchain icon indicating copy to clipboard operation
celo-blockchain copied to clipboard

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

Open tkporter opened this issue 5 years ago • 2 comments

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

tkporter avatar Mar 31 '20 17:03 tkporter

Github closed this automatically when I merged in #1191, but that PR is not a full fix, so I reopened the issue

oneeman avatar Oct 20 '20 19:10 oneeman

To check if it's still happening.

carterqw2 avatar Feb 20 '23 14:02 carterqw2