-
Notifications
You must be signed in to change notification settings - Fork 778
uplift: Add validators package from evm repositories #4166
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR uplifts the validators package from subnet-evm and coreth repositories to AvalancheGo to prevent duplicative maintenance of shared functionality, specifically to assist in uplifting the warp package.
- Adds a complete validators package with state management, uptime tracking, and manager functionality
- Implements pausable uptime management that can pause/resume validator tracking based on active status
- Provides thread-safe validator reader with atomic uptime and metadata retrieval
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
vms/evm/plugin/validators/manager.go | Core manager implementation for validator state and uptime synchronization |
vms/evm/plugin/validators/state/state.go | Validator state CRUD operations with database persistence |
vms/evm/plugin/validators/uptime/pausable_manager.go | Pausable uptime manager that wraps AvalancheGo's uptime manager |
vms/evm/plugin/validators/locked_reader.go | Thread-safe reader for atomic validator and uptime retrieval |
vms/evm/plugin/validators/interfaces/ | Interface definitions for manager, state, and uptime components |
vms/evm/plugin/validators/state/codec.go | Serialization codec for validator data persistence |
vms/evm/plugin/validators/README.md | Comprehensive documentation of the validators package |
Test files | Comprehensive test coverage for all components |
vms/evm/plugin/validators/manager.go
Outdated
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 package (everything under validators/
) has a ton of sprawl - I think we could reasonably put this under one file. We need to figure out a package name/type name.... maybe something like evm/state/validators.go
? I'm not sure what plugin
means in this context.
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.
Let's discuss the structure after the code clean up first - think it'll make more sense then as I'm sure a lot of stuff will change / get deleted etc.
plugin
is the name from the EVM repositories.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Jonathan Oppenheimer <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Jonathan Oppenheimer <[email protected]>
…-labs/avalanchego into uplift-evm-plugin-validators
Co-authored-by: Joshua Kim <[email protected]> Signed-off-by: Jonathan Oppenheimer <[email protected]>
…-labs/avalanchego into uplift-evm-plugin-validators
Why this should be merged
There are packages in subnet-evm and coreth that share a lot of functionality / are mirrored. These packages should be uplifted to AvalancheGo to prevent the duplicative maintenance of two sets of the same code. This is part of that effort, specifically in assisting the uplifting of the warp package. Closes #4207
Validators has no external imports but there are a couple things worth noting:
validators/locked_reader.go
is similar tosnow/uptime.LockedCalculator
(thread-safe reads) but not a duplicate: it also returns validator metadata atomically with uptime.validatorData
it exists inproposervm
but with different fields and in a different packageHow this was tested
This is currently 'dead' code; after a new AvalancheGo release is dropped, we can use the code in the evm repositories.
Need to be documented in RELEASES.md?
No