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
rpc: Consistent range arguments in scantxoutset/importmulti/deriveaddresses #15497
Conversation
I like int,int. IIRC scantxoutset is experimental and we shouldn't shy away from breaking it, if we think a change is correct. |
Concept ACK |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
Looks good, concept ACK, especially for keeping it compatible.
Is the scantxoutset
change worthy a release note?
I also think
[int,int]
is more convenient than{"start":int,"stop":int}
.
The object notation is more verbose, like named arguments, it increases readability.
@promag Added tiny release note. |
dbe2ea0
to
6541cc1
Compare
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
Named arguments are useful when there is potential confusion about what the arguments mean, or when there's need for future expansibility. Range notation is kind of self-evident and it's entirely sure that no new fields will be introduced. So I tend to disagree here. A tuple Concept ACK. |
Concept ACK (also as bugfix for 0.18 to avoid API inconsistency). |
I realize it's needed for backward compat, but specifying a range by giving one number seems kind of counter intuitive. Esp since by looking at the param, you can't really tell if the one number is supposed to be the start or end of the range (so there's a 50% chance of guessing wrong). Maybe the |
@flack in most cases the start of the range is 0. What I think is more likely to confuse people is that ranges are 0 based, and so |
@Sjors interesting, the 0-based part I got right away, but I guess it depends what programming lang you usually work with :-) What I just find ambiguous is that
ofc when you read the documentation, you know that option 1 is the correct one. But as a casual user it's quite easy to make mistakes, since |
I would be OK with always requiring both start and end, so [0, 0]. It probably takes less time to type than to interpret the docs :-) Backwards compatibility is not a huge concern because we declared the scan method experimental. |
@laanwj I didn't say otherwise, just that object notation is more verbose. |
6541cc1
to
0fa7e14
Compare
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 0fa7e14 (ignore the style-nit)
0fa7e14
to
ca253f6
Compare
See: Sjors@349c8cf |
re-utACK ca253f6 Only change since previous review is adding an |
…ulti/deriveaddresses ca253f6 Make deriveaddresses use stop/[start,stop] notation for ranges (Pieter Wuille) 1675b7c Use stop/[start,stop] notation in importmulti desc range (Pieter Wuille) 4566011 Add support for stop/[start,stop] ranges to scantxoutset (Pieter Wuille) 6b9f45e Support ranges arguments in RPC help (Pieter Wuille) 7aa6a8a Add ParseRange function to parse args of the form int/[int,int] (Pieter Wuille) Pull request description: This introduces a consistent notation for RPC arguments in `scantxoutset`, `importmulti`, and `deriveaddresses`, either: * `"range" : int` to just specify the end of the range * `"range" : [int,int]` to specify both the begin and the end of the range. For `scantxoutset`, this is a backward compatible new feature. For the two other RPCs, it's an incompatible change, but neither of them has been in a release so far. Because of that non-released reason, this only makes sense in 0.18, in my opinion. I suggest this as an alternative to #15496, which only makes `deriveaddresses` compatible with `importmulti`, but not with the existing `scantxoutset` RPC. I also think `[int,int]` is more convenient than `{"start":int,"stop":int}`. I realize this is technically a feature added to `scantxoutset` after the feature freeze. If desired, I'll drop the `scantxoutset` changes. Tree-SHA512: 1cbebb90cf34f106786dbcec7afbf3f43fb8b7e46cc7e6763faf1bc1babf12375a1b3c3cf86ee83c21ed2171d99b5a2f60331850bc613db25538c38b6a056676
…t/[int,int] Summary: bitcoin/bitcoin@7aa6a8a --- Partial backport of Core [[bitcoin/bitcoin#15497 | PR15497]] Test Plan: ninja Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6610
Summary: bitcoin/bitcoin@6b9f45e --- Depends on D6610 Partial backport of Core [[bitcoin/bitcoin#15497 | PR15497]] Test Plan: ninja Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6611
…tset Summary: bitcoin/bitcoin@4566011 --- Depends on D6611 Partial backport of Core [[bitcoin/bitcoin#15497 | PR15497]] Test Plan: ninja check test_runner.py rpc_scantxoutset Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6612
…ange Summary: bitcoin/bitcoin@1675b7c --- Depends on D6612 Partial backport of Core [[bitcoin/bitcoin#15497 | PR15497]] Test Plan: ninja check test_runner.py wallet_importmulti Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D6613
…for ranges Summary: bitcoin/bitcoin@ca253f6 --- Depends on D6613 Concludes backport of Core [[bitcoin/bitcoin#15497 | PR15497]] Test Plan: ninja check test_runner.py rpc_deriveaddresses Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6614
…aram 9586157 [rpc] deriveaddresses: add range to CRPCConvertParam (Sjors Provoost) Pull request description: Missing from bitcoin#15497 Tree-SHA512: 469de3f896bcd3435a480685e5257c51ba895df0311329d5e5a3cb2e1894e5358324473d998ea45221776aefe8836a7af6c4f12198a36d2d10bf6761991cfd60
…aram 9586157 [rpc] deriveaddresses: add range to CRPCConvertParam (Sjors Provoost) Pull request description: Missing from bitcoin#15497 Tree-SHA512: 469de3f896bcd3435a480685e5257c51ba895df0311329d5e5a3cb2e1894e5358324473d998ea45221776aefe8836a7af6c4f12198a36d2d10bf6761991cfd60
…aram 9586157 [rpc] deriveaddresses: add range to CRPCConvertParam (Sjors Provoost) Pull request description: Missing from bitcoin#15497 Tree-SHA512: 469de3f896bcd3435a480685e5257c51ba895df0311329d5e5a3cb2e1894e5358324473d998ea45221776aefe8836a7af6c4f12198a36d2d10bf6761991cfd60
…aram 9586157 [rpc] deriveaddresses: add range to CRPCConvertParam (Sjors Provoost) Pull request description: Missing from bitcoin#15497 Tree-SHA512: 469de3f896bcd3435a480685e5257c51ba895df0311329d5e5a3cb2e1894e5358324473d998ea45221776aefe8836a7af6c4f12198a36d2d10bf6761991cfd60
…importmulti/deriveaddresses ca253f6 Make deriveaddresses use stop/[start,stop] notation for ranges (Pieter Wuille) 1675b7c Use stop/[start,stop] notation in importmulti desc range (Pieter Wuille) 4566011 Add support for stop/[start,stop] ranges to scantxoutset (Pieter Wuille) 6b9f45e Support ranges arguments in RPC help (Pieter Wuille) 7aa6a8a Add ParseRange function to parse args of the form int/[int,int] (Pieter Wuille) Pull request description: This introduces a consistent notation for RPC arguments in `scantxoutset`, `importmulti`, and `deriveaddresses`, either: * `"range" : int` to just specify the end of the range * `"range" : [int,int]` to specify both the begin and the end of the range. For `scantxoutset`, this is a backward compatible new feature. For the two other RPCs, it's an incompatible change, but neither of them has been in a release so far. Because of that non-released reason, this only makes sense in 0.18, in my opinion. I suggest this as an alternative to bitcoin#15496, which only makes `deriveaddresses` compatible with `importmulti`, but not with the existing `scantxoutset` RPC. I also think `[int,int]` is more convenient than `{"start":int,"stop":int}`. I realize this is technically a feature added to `scantxoutset` after the feature freeze. If desired, I'll drop the `scantxoutset` changes. Tree-SHA512: 1cbebb90cf34f106786dbcec7afbf3f43fb8b7e46cc7e6763faf1bc1babf12375a1b3c3cf86ee83c21ed2171d99b5a2f60331850bc613db25538c38b6a056676
This introduces a consistent notation for RPC arguments in
scantxoutset
,importmulti
, andderiveaddresses
, either:"range" : int
to just specify the end of the range"range" : [int,int]
to specify both the begin and the end of the range.For
scantxoutset
, this is a backward compatible new feature. For the two other RPCs, it's an incompatible change, but neither of them has been in a release so far. Because of that non-released reason, this only makes sense in 0.18, in my opinion.I suggest this as an alternative to #15496, which only makes
deriveaddresses
compatible withimportmulti
, but not with the existingscantxoutset
RPC. I also think[int,int]
is more convenient than{"start":int,"stop":int}
.I realize this is technically a feature added to
scantxoutset
after the feature freeze. If desired, I'll drop thescantxoutset
changes.