Don't restart non-validators that are behind - #475
Open
samliok wants to merge 10 commits into
Open
Conversation
yacovm
reviewed
Jul 31, 2026
| onEpochChange: func(epoch uint64, validators common.Nodes) error { | ||
| height := i.Config.PlatformChain.GetCurrentHeight() | ||
| vdrs, err := i.Config.PlatformChain.GetValidatorSet(height) | ||
| // set the communication to the highest validator set, since this node is a non-validator and may be behind. |
Collaborator
There was a problem hiding this comment.
is this basically a poor man's caching of the highest validator set from the P-chain?
Collaborator
Author
There was a problem hiding this comment.
it uses the same mechanism as before, i just extracted it to a helper.
But yea, we should feed the non-validator the highest pchain validators. I think alternatively we could just pass in the platform chain interface into the non-validator. This could help if the non-validator was offline and the validator set diverged.
yacovm
reviewed
Jul 31, 2026
| switch epochChange.nodeRole { | ||
| case nonValidator: | ||
| switch { | ||
| case i.e != nil && i.nv != nil: |
Collaborator
There was a problem hiding this comment.
we removed the role but can we at least put some more meaningful code than i.e != nil and i.nv != nil?
Maybe:
amValidator := i.e != nil
amNonValidator := i.nv != nil
?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nodeRolestruct