-
Notifications
You must be signed in to change notification settings - Fork 1.2k
rpc: fix and simplify quorum rotationinfo
#4808
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
Issues with current implementation: params list is not mentioning `baseBlockHashes`, `baseBlockHashesNb` looks excessive, no default values, handling of baseBlockHash-es is off by 1 (`3 + i` should be `4 + i`). before: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" baseBlockHashesNb extraShare Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. baseBlockHashesNb (numeric, required) Number of baseBlockHashes 3. extraShare (boolean, required) Extra share ``` after: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" ( extraShare "baseBlockHash..." ) Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. extraShare (boolean, optional, default=false) Extra share 3. baseBlockHash... (string, optional, default=) baseBlockHashes ```
PastaPastaPasta
left a comment
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.
utACK for squash merge
Issues with current implementation: params list is not mentioning `baseBlockHashes`, `baseBlockHashesNb` looks excessive, no default values, handling of baseBlockHash-es is off by 1 (`3 + i` should be `4 + i`). before: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" baseBlockHashesNb extraShare Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. baseBlockHashesNb (numeric, required) Number of baseBlockHashes 3. extraShare (boolean, required) Extra share ``` after: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" ( extraShare "baseBlockHash..." ) Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. extraShare (boolean, optional, default=false) Extra share 3. baseBlockHash... (string, optional, default=) baseBlockHashes ```
| { | ||
| {"blockRequestHash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The blockHash of the request"}, | ||
| {"extraShare", RPCArg::Type::BOOL, /* default */ "false", "Extra share"}, | ||
| {"baseBlockHash...", RPCArg::Type::STR_HEX, /* default*/ "", "baseBlockHashes"}, |
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.
Why is this argument name truncated?
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.
... just indicates that there are many of them. We could probably turn it into a json array instead if that would make it clearer.
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.
So it's just multiple strings separated by spaces? Is there a limit to how many can be put there?
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's multiple hashes. There is no limit atm (there was none in the code I refactored so I kept it). I'm not sure if we have to put one in place though.. Thoughts @ogabrielides @PastaPastaPasta ?
Issues with current implementation: params list is not mentioning `baseBlockHashes`, `baseBlockHashesNb` looks excessive, no default values, handling of baseBlockHash-es is off by 1 (`3 + i` should be `4 + i`). before: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" baseBlockHashesNb extraShare Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. baseBlockHashesNb (numeric, required) Number of baseBlockHashes 3. extraShare (boolean, required) Extra share ``` after: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" ( extraShare "baseBlockHash..." ) Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. extraShare (boolean, optional, default=false) Extra share 3. baseBlockHash... (string, optional, default=) baseBlockHashes ```
Issues with current implementation: params list is not mentioning `baseBlockHashes`, `baseBlockHashesNb` looks excessive, no default values, handling of baseBlockHash-es is off by 1 (`3 + i` should be `4 + i`). before: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" baseBlockHashesNb extraShare Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. baseBlockHashesNb (numeric, required) Number of baseBlockHashes 3. extraShare (boolean, required) Extra share ``` after: ``` > help quorum rotationinfo quorum rotationinfo "blockRequestHash" ( extraShare "baseBlockHash..." ) Get quorum rotation information Arguments: 1. blockRequestHash (string, required) The blockHash of the request. 2. extraShare (boolean, optional, default=false) Extra share 3. baseBlockHash... (string, optional, default=) baseBlockHashes ```
Issues with current implementation: params list is not mentioning
baseBlockHashes,baseBlockHashesNblooks excessive, no default values, handling of baseBlockHash-es is off by 1 (3 + ishould be4 + i).before:
after:
Noticed this while reviewing #4734 (note to @Munkybooty: this patch is doing even more than the one I proposed there initially, you'll have to adjust 4734 accordingly on rebase)