Skip to content
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

Draft
wants to merge 43 commits into
base: remove-subnetid-uptime-manager
Choose a base branch
from

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

How this works

How this was tested

@StephenButtolph StephenButtolph self-assigned this Sep 13, 2024
@StephenButtolph StephenButtolph added this to the v1.11.12 milestone Sep 13, 2024
return d.parentActiveSOVs + d.sovDiff.numAddedActive
}

func (d *diff) NumSubnetOnlyValidators(subnetID ids.ID) (int, error) {
Copy link
Contributor Author

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.

Comment on lines +1844 to +1848
// Load inactive weights
it := s.weightsDB.NewIterator()
defer it.Release()

for it.Next() {
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.

@StephenButtolph StephenButtolph changed the base branch from master to remove-subnetid-uptime-manager September 22, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress 🏗
Development

Successfully merging this pull request may close these issues.

1 participant