-
Notifications
You must be signed in to change notification settings - Fork 680
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
ACP-77: Current validators API for SoV #3404
Merged
Merged
Conversation
This file contains 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
…hego into refactor-uptime-manager
…s/avalanchego into test-only-current-validators-api
yacovm
reviewed
Nov 11, 2024
yacovm
reviewed
Nov 11, 2024
yacovm
reviewed
Nov 11, 2024
…s/avalanchego into test-only-current-validators-api
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.
final nits
Co-authored-by: Stephen Buttolph <[email protected]> Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]> Signed-off-by: Ceyhun Onur <[email protected]>
StephenButtolph
approved these changes
Nov 13, 2024
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.
This pull request introduces a new gRPC method
GetCurrentValidatorSet
to theValidatorState
service, allowing clients to retrieve the current validator set for a given subnet. The changes span multiple files to implement this new functionality, including updates to the protobuf definitions, client and server interfaces, and associated tests.Additions to
ValidatorState
Service:proto/pb/validatorstate/validator_state_grpc.pb.go
: Added theGetCurrentValidatorSet
method to both client and server interfaces, along with its handler and full method name constant. [1] [2] [3] [4] [5] [6] [7]proto/validatorstate/validator_state.proto
: Defined theGetCurrentValidatorSetRequest
andGetCurrentValidatorSetResponse
messages, and added the new RPC method to theValidatorState
service. [1] [2]Client and Server Implementation:
snow/validators/gvalidators/validator_state_client.go
: Implemented theGetCurrentValidatorSet
method in theClient
struct to call the new gRPC method.snow/validators/gvalidators/validator_state_server.go
: Implemented theGetCurrentValidatorSet
method in theServer
struct to handle incoming requests.State Interface and Mock Updates:
snow/validators/state.go
: Added theGetCurrentValidatorSet
method to theState
interface and implemented it in thelockedState
struct. [1] [2] [3]snow/validators/traced_state.go
: Added tracing support for theGetCurrentValidatorSet
method.snow/validators/validator.go
: Defined theGetCurrentValidatorOutput
struct to represent the current validator data.snow/validators/validatorsmock/state.go
: Added mock implementations for theGetCurrentValidatorSet
method.snow/validators/validatorstest/state.go
: Added test support for theGetCurrentValidatorSet
method. [1] [2]Platform VM State Changes:
vms/platformvm/state/state.go
: Added theGetCurrentValidatorSet
method to theState
interface and implemented it in thestate
struct, including logic to determine if the subnet is L1 and fetch the current validators. [1] [2]vms/platformvm/state/mock_state.go
: Added mock implementations for theGetCurrentValidatorSet
method.