-
Notifications
You must be signed in to change notification settings - Fork 668
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
Implement ACP-77 validator state #3388
base: remove-subnetid-uptime-manager
Are you sure you want to change the base?
Implement ACP-77 validator state #3388
Conversation
vms/platformvm/state/diff.go
Outdated
return d.parentActiveSOVs + d.sovDiff.numAddedActive | ||
} | ||
|
||
func (d *diff) NumSubnetOnlyValidators(subnetID ids.ID) (int, error) { |
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.
This should return the weight rather than the count.
// Load inactive weights | ||
it := s.weightsDB.NewIterator() | ||
defer it.Release() | ||
|
||
for it.Next() { |
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.
We should only be loading subnets with at least one active validator.
@@ -2004,6 +2172,303 @@ func (s *state) writeExpiry() error { | |||
return nil | |||
} | |||
|
|||
// TODO: Update validator sets | |||
// TODO: Add caching | |||
func (s *state) writeSubnetOnlyValidators(updateValidators bool, height uint64) error { |
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.
Note: this only works if the nodeIDs written here are unrelated to legacy subnet validators. This is fairly reasonable because we're going to be introducing 32-byte nodeIDs for SoVs.
…ov-validators-state
Why this should be merged
How this works
How this was tested