Skip to content

Conversation

@UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Apr 26, 2022

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

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)

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
```
@UdjinM6 UdjinM6 added RPC Some notable changes to RPC params/behaviour/descriptions backport-candidate-18.x labels Apr 26, 2022
@UdjinM6 UdjinM6 added this to the 18 milestone Apr 26, 2022
@UdjinM6 UdjinM6 requested a review from PastaPastaPasta April 26, 2022 17:24
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a 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

@UdjinM6 UdjinM6 merged commit 47ab180 into dashpay:develop Apr 26, 2022
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 26, 2022
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"},
Copy link
Collaborator

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?

Copy link
Author

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.

Copy link
Collaborator

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?

Copy link
Author

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 ?

gades pushed a commit to cosanta/cosanta-core that referenced this pull request Dec 1, 2023
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
```
gades pushed a commit to piratecash/pirate that referenced this pull request Dec 9, 2023
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC Some notable changes to RPC params/behaviour/descriptions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants