-
Notifications
You must be signed in to change notification settings - Fork 807
Add Primary Network Partial Sync Option #1769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
state-sync prefers nodes that provide bandwidth and bootstrapping prefers validators - so I don't think this should impact bootstrapping times - even if widely adopted. |
chains/manager.go
Outdated
NodeID ids.NodeID // The ID of this node | ||
NetworkID uint32 // ID of the network this node is connected to | ||
Server server.Server // Handles HTTP API calls | ||
LiteSyncPrimaryNetwork bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: put next to NetworkID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved - lmk if that was where you were thinking
chains/manager.go
Outdated
return "node is a primary network validator", errNoLiteSyncForValidators | ||
}) | ||
|
||
if err := m.Health.RegisterHealthCheck("validation", liteSyncCheck, health.ApplicationTag); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not sure validation
is the right name for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it makes sense... The check is verifying that the node is not validating
m.Log.Warn("node is a primary network validator", | ||
zap.Error(errPartialSyncAsAValidator), | ||
) | ||
return "node is a primary network validator", errPartialSyncAsAValidator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see us removing this at some point for the reasons I shared previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine for now at least
return "node is a primary network validator", errPartialSyncAsAValidator | ||
}) | ||
|
||
if err := m.Health.RegisterHealthCheck("validation", partialSyncCheck, health.ApplicationTag); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "validation"
-> "partial_validation"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm I was thinking this was the "am I a primary network validator" check - not the "am I correctly configured to partially validate state"
Why this should be merged
Non-validators nodes tracking a subnet should not be required to track all primary network chains. This PR introduces a reduced mode configuration, where C-chain and X-chain are not instantiated and only P-chain is (partially) validated.
How this works
The PR introduces a reduced-mode configuration. If active:
How this was tested