You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to propose the new RPC chain_getPossibleAuthors.
Currently, there is no way to get the validator list.
To generalize this, I want to add an RPC to get the authors that can be author of the block.
The purpose of this RPC is returning the sets of the account that can generate the blocks at the given block number.
It will return three of one.
[]
It returns an empty list if anyone can be the block author.
PoW chain will return an empty list always.
PlatformAddress[]
Only some accounts can be the block author in PoA or Tendermint.
CodeChain will return the accounts that can be a block author in the given block number.
null
The node returns null if it cannot calculate the possible author set.
If the chain supports dynamic validators and the given block number is larger than the next block, the node cannot calculate the possible author set.
Params
block number: number | null
null means the possible authors of the next block.
@foriequal0 I don't think it's a good idea that the type of a JSON field is "*" or array of something.
How about making it return null if it allows every accounts and returning the possible authors of the latest block if the block number is larger than the current best block number.
I think we need to keep returning null when it cannot calculate authors for the consistancy with other APIs. Then we don't have much choices. [] for any or null for any. I think [] is better than null.
Activity
sgkim126 commentedon Jun 12, 2019
@kseo @majecty @foriequal0 Please give your opinion.
sgkim126 commentedon Jun 12, 2019
FYI, it cannot be an engine category since the dynamic validators of the tendermint depend on the chain states.
sgkim126 commentedon Jun 12, 2019
I'm considering the RPC name between
chain_getValidAuthorsandchain_getPossibleAuthors.majecty commentedon Jun 12, 2019
LGTM I prefer
chain_getPossibleAuthorstochain_getValidAuthors.foriequal0 commentedon Jun 12, 2019
How about returning
"*"instead of[]?AWS IAM JSON Policy Elements uses
"*"for describingRoleorAction.https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_action.html
It is actually a string for single entry and a list of string for multiple entry with the wildcard support.
However, to return multiple types makes me think of PHP (https://www.php.net/manual/en/function.array-search.php)
sgkim126 commentedon Jun 12, 2019
@foriequal0 I don't think it's a good idea that the type of a JSON field is "*" or array of something.
How about making it return null if it allows every accounts and returning the possible authors of the latest block if the block number is larger than the current best block number.
[-]Proposal for chain_getValidAuthors[/-][+]Proposal for chain_getPossibleAuthors[/+]foriequal0 commentedon Jun 12, 2019
I think we need to keep returning null when it cannot calculate authors for the consistancy with other APIs. Then we don't have much choices.
[]for any ornullfor any. I think[]is better thannull.sgkim126 commentedon Jun 12, 2019
As I discussed with @foriequal0 and @majecty, I'll make it return
nullif anyone can be authors and return an error if the block number is invalid.sgkim126 commentedon Jun 14, 2019
#1619 and #1618 closes it.