Skip to content

Conversation

@ceyonur
Copy link
Contributor

@ceyonur ceyonur commented Nov 21, 2024

Why this should be merged

It adds L1 support and shows L1 validators in platform.getCurrentValidators API.

How this works

  • Added validationID to the platform.getL1Validator API outputs.
  • Added L1 support to the platform.getCurrentValidators API.
  • Removed the PermissionedValidator struct as it is no longer used.
  • Introduced getL1Validators and getPrimaryOrSubnetValidators methods to handle fetching validators based on subnet ID.
  • Added convertL1ValidatorToAPI method to convert L1 validator data to API format.
  • Added GetL1Validators method to the State interface 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.

@ceyonur ceyonur self-assigned this Nov 21, 2024
PublicKey: otherPK,
Weight: 1,
StartTime: now,
StartTime: now.Add(1 * time.Second),
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

@StephenButtolph StephenButtolph dismissed their stale review January 23, 2025 21:00

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`
Copy link
Contributor

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:

Suggested change
- L1 validators to `platform.getCurrentValidators`
- L1 validators are now listed in `platform.getCurrentValidators`

Copy link
Contributor Author

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),
Copy link
Contributor

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))
Copy link
Contributor

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

Suggested change
require.NoError(service.GetCurrentValidators(&http.Request{}, &args, &reply))
err = service.GetCurrentValidators(&http.Request{}, &args, &reply)
require.NoError(err)

Copy link
Contributor

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.

ceyonur and others added 6 commits January 24, 2025 13:00
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>
@StephenButtolph StephenButtolph added this pull request to the merge queue Jan 27, 2025
Merged via the queue into master with commit d31320e Jan 27, 2025
22 checks passed
@StephenButtolph StephenButtolph deleted the add-l1-validators-api branch January 27, 2025 16:00
tsachiherman pushed a commit that referenced this pull request Jan 29, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants