-
Notifications
You must be signed in to change notification settings - Fork 209
RPC to get validators #1614
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
Merged
Merged
RPC to get validators #1614
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
113d10f
init solution
open-junius 11159b6
fix wrong interface parameter
open-junius d5d0964
remove commented code
open-junius 4919495
fix typo
open-junius bfd6d91
Merge branch 'devnet-ready' into only-validator-rpc
open-junius ea431ba
commit Cargo.lock
open-junius 853abba
bump runtime version
open-junius 091d630
update interface, take validator as new index
open-junius 89db1df
update interface definition
open-junius 1078b62
merge with target branch
open-junius 52f7bda
fix conflict
open-junius 317d34c
Merge branch 'devnet-ready' into only-validator-rpc
open-junius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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 means if the
SelectiveMetagraphIndex
isValidators
, we'd still be going to this match arm. Is this correct?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.
Yes, it is correct. get validators is a separate branch. that's the validator_only parameter means.
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.
But is there a case where the
validators_only
parameter is false, and yet theSelectedMetagraphIndex
isValidators
?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.
if validators_only is false, we don't return validators in the result. The index is wield, let me check how to change it. thanks
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.
removed the validators index.
Uh oh!
There was an error while loading. Please reload this page.
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 we not use the index of
ValidatorsOnly
to do this and not add a boolean to the api?e.g. remove the
only_validators
param. Then, ifValidatorsOnly
is present just keys that are validators.This requires we add a
uids
field to the struct alsoThere 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'd say this impl can be like this:
SelectedMetagraphIndex::Validators
. Then it gonna handled the same way as otherSelectedMetagraphIndex
indices.validators
field intoMetagraph
struct.Result:
get_metagraph_info
always has filedMetagraph::validators
fieldSelectiveMetagraph
returns object with filedvalidators
as Vec with related HK indexes ifSelectedMetagraphIndex::Validators
passed in params as item infield_indices
MetagraphInfo
class will get a new fieldvalidators
This is gonnabe clearest way for this and SDK implementation as far as I see.
Pleas feel free to correct me if I'm wrong.
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.
Agreed, we can handle the validators the same as other items in metagraph. user can get any data according to passed index list.