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

Add "proposed" optional flag to getValidatorsAt #3531

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

iansuvak
Copy link
Contributor

@iansuvak iansuvak commented Nov 8, 2024

Why this should be merged

I'm not convinced that it should but opening this up for discussion.

Adding this interface was discussed together with adding platform.GetProposedHeight interface in #3530 This is a convenience method to allow for passing "proposed" instead of a numeric height literal to GetValidatorsAt.

The idea is to make it safer to publicly expose GetValidatorsAt interface. This by itself doesn't accomplish it but a different proxy service could use this same interface and call GetProposedHeight and return the cached value if this was called with the same resolved height and subnet.

How this works

Makes the GetValidatorsAt accept either numeric height or a "proposed" string literal that first calls getMinimumHeight and uses that instead of the numerical value. The service side is backward compatible but the client interface has changed.

I'm also not sure if this solution is cleaner than just adding a new boolean flag field to the request. I don't think that the platformVM service uses this kind of type overloading anywhere else.

How this was tested

Added a unit test.

Need to be documented in RELEASES.md?

Yes - -breaking change to the client.

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.

1 participant