-
Notifications
You must be signed in to change notification settings - Fork 841
add L1 support to getCurrentValidators API #3564
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
Signed-off-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
…go into add-l1-validators-api
| PublicKey: otherPK, | ||
| Weight: 1, | ||
| StartTime: now, | ||
| StartTime: now.Add(1 * time.Second), |
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.
(No action required) Why does the start time change in these tests?
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.
stakers should come before L1 validators and I wanted to test out different timestamps
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.
Should this be reversed then? Or we can add more test cases.
I'm going to stop approving until after CI finishes lol
| - `platform.getValidatorFeeConfig` | ||
| - `platform.getValidatorFeeState` | ||
| - `validationID` to `platform.getL1Validator` results | ||
| - L1 validators to `platform.getCurrentValidators` |
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 just a tiny bit clearer imo:
| - L1 validators to `platform.getCurrentValidators` | |
| - L1 validators are now listed in `platform.getCurrentValidators` |
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 contradicts with -Added: above
| PublicKey: otherPK, | ||
| Weight: 1, | ||
| StartTime: now, | ||
| StartTime: now.Add(1 * time.Second), |
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.
Should this be reversed then? Or we can add more test cases.
| SubnetID: subnetID, | ||
| } | ||
| reply := GetCurrentValidatorsReply{} | ||
| require.NoError(service.GetCurrentValidators(&http.Request{}, &args, &reply)) |
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 split those so it's more readable
| require.NoError(service.GetCurrentValidators(&http.Request{}, &args, &reply)) | |
| err = service.GetCurrentValidators(&http.Request{}, &args, &reply) | |
| require.NoError(err) |
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 this actually fails linting if applied.
Co-authored-by: Quentin McGaw <quentin.mcgaw@avalabs.org> Signed-off-by: Stephen Buttolph <stephen@avalabs.org>
Signed-off-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
…valanchego into add-l1-validators-api
Signed-off-by: Ceyhun Onur <ceyhun.onur@avalabs.org> Signed-off-by: Stephen Buttolph <stephen@avalabs.org> Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Co-authored-by: Quentin McGaw <quentin.mcgaw@avalabs.org>
Why this should be merged
It adds L1 support and shows L1 validators in
platform.getCurrentValidatorsAPI.How this works
validationIDto theplatform.getL1ValidatorAPI outputs.platform.getCurrentValidatorsAPI.PermissionedValidatorstruct as it is no longer used.getL1ValidatorsandgetPrimaryOrSubnetValidatorsmethods to handle fetching validators based on subnet ID.convertL1ValidatorToAPImethod to convert L1 validator data to API format.GetL1Validatorsmethod to theStateinterface to return both base stakers and L1 validators in a converted L1.How this was tested
Locally
Need to be documented in RELEASES.md?
Yes, updated.