Add checksum to getdescriptorinfo #15986
pull sipa wants to merge 2 commits into bitcoin:master from sipa:201905_justchecksum changing 4 files +39 −10-
sipa commented at 9:21 pm on May 8, 2019: member
-
sipa force-pushed on May 8, 2019
-
gwillen commented at 9:27 pm on May 8, 2019: contributor
So the only reason I didn’t write it this way, is that people have said they don’t want private keys to be echoed in the output.
Personally I think this is fine – the only way to get a private key in the output, is if you include it in the input. And in fact, there has to be SOME way to get private keys echoed back, if you want to be able to get checksums for descriptors with private keys included.
So I’d advocate for this PR the way it is, but if people aren’t comfortable with it, I’d suggest adding a flag, and not echoing descriptors with private keys unless the flag is set.
Thanks!
(Tagging #15740 for the record.)
-
DrahtBot added the label RPC/REST/ZMQ on May 8, 2019
-
DrahtBot added the label Tests on May 8, 2019
-
meshcollider commented at 5:56 am on May 9, 2019: contributor
-
Sjors commented at 12:32 pm on May 12, 2019: member
Concept ACK.
Light preference for returning only the checksum rather than echoing a private key. But I do agree with @gwillen’s point:
the only way to get a private key in the output, is if you include it in the input.
I find the extra
with_checksum
confusing. Maybe we can add an argumentkeep_private_keys
which defaults tofalse
. I would also prefer sticking to canonical form (but with private keys). An additional argumentcanonical
can betrue
by default. I know it makes the change a bit more complicated, but it seems more robust in the long run. -
DrahtBot commented at 4:41 am on May 30, 2019: member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #16542 (Return more specific errors about invalid descriptors by achow101)
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.
-
jb55 commented at 6:15 pm on May 30, 2019: memberI’m confused by this, getdescriptorinfo already adds a checksum if it’s missing?
-
jb55 commented at 7:59 am on May 31, 2019: memberah ok that was the bit I was missing
-
promag commented at 9:45 pm on June 12, 2019: member
ACK 15c482ef711a166b74dcd1fa127d213799d2a1d1, only reviewed code change. Looks like returning only the checksum, like @Sjors suggested, is a simple solution to not echo back private key. A small release note could be added.
Refactor commit best viewed with
git show --color-words 7976dd65f6503082370a40ac189b925322c29918
. -
fanquake requested review from achow101 on Jul 30, 2019
-
achow101 commented at 5:22 pm on July 30, 2019: member
Code Review ACK 15c482ef711a166b74dcd1fa127d213799d2a1d1
I would prefer if there were also a test where the descriptor were slightly modified (e.g. replacing
'
withh
in origin info) and that the result ofgetdescriptorinfo
gives the correct canonical form and the modified form with the checksum. -
achow101 approved
-
Sjors commented at 6:30 pm on August 2, 2019: memberTested ACK 15c482e
-
sipa commented at 6:52 pm on August 2, 2019: memberI like the suggestion of instead just reporting the checksum for the unmodified descriptor, and not echoing anything back. Since this has been reviewed already, I’m happy to go either way. What do reviewers think?
-
achow101 commented at 9:39 pm on August 2, 2019: member
I like the suggestion of instead just reporting the checksum for the unmodified descriptor, and not echoing anything back. Since this has been reviewed already, I’m happy to go either way. What do reviewers think?
I prefer this because it is unambiguous as to what the checksum belongs to and what the descriptor with with checksum will look like.
-
Factor out checksum checking from descriptor parsing 104b3a5069
-
Add unmodified-but-with-checksum to getdescriptorinfo 26d3fad109
-
sipa force-pushed on Aug 7, 2019
-
sipa renamed this:
Add unmodified-descriptor-with-checksum to getdescriptorinfo
Add checksum to getdescriptorinfo
on Aug 7, 2019 -
sipa commented at 0:12 am on August 7, 2019: memberUpdated to instead add a
"checksum"
togetdescriptorinfo
that returns the checksum for the (unmodified) descriptor input. -
in src/rpc/misc.cpp:139 in 26d3fad109
135@@ -136,6 +136,7 @@ UniValue getdescriptorinfo(const JSONRPCRequest& request) 136 RPCResult{ 137 "{\n" 138 " \"descriptor\" : \"desc\", (string) The descriptor in canonical form, without private keys\n" 139+ " \"checksum\" : \"chksum\", (string) The checksum for the input descriptor\n"
Sjors commented at 1:40 pm on August 7, 2019:nit: did you really meanchksum
?Sjors approvedSjors commented at 1:52 pm on August 7, 2019: memberACK 26d3fad1093dfc697048313be7a96c9adf723654achow101 commented at 2:43 pm on August 7, 2019: memberCode Review ACK 26d3fad1093dfc697048313be7a96c9adf723654fanquake commented at 9:26 am on August 15, 2019: memberTwo wallet reviewer ACKs here; @meshcollider want to take a final look? I’ve compiled to check that there aren’t any silent merge conflicts etc.meshcollider commented at 9:22 pm on August 16, 2019: contributorre-Code Review ACK 26d3fad1093dfc697048313be7a96c9adf723654meshcollider referenced this in commit 7a960ba775 on Aug 16, 2019meshcollider merged this on Aug 16, 2019meshcollider closed this on Aug 16, 2019
sidhujag referenced this in commit 1086701664 on Aug 17, 2019luke-jr referenced this in commit 34a4e70160 on Sep 3, 2019luke-jr referenced this in commit 74d91ab4c3 on Sep 3, 2019deadalnix referenced this in commit 4757f3807c on Jun 18, 2020deadalnix referenced this in commit 5b71c08726 on Jun 18, 2020kittywhiskers referenced this in commit 03a36fd5a7 on Oct 25, 2021kittywhiskers referenced this in commit 862f6c6414 on Oct 25, 2021kittywhiskers referenced this in commit 9ca62f46b2 on Oct 25, 2021kittywhiskers referenced this in commit 6689f7a4ed on Oct 26, 2021kittywhiskers referenced this in commit 4a2764f8f1 on Oct 26, 2021kittywhiskers referenced this in commit 324010f3a1 on Oct 26, 2021kittywhiskers referenced this in commit 981df02bac on Oct 28, 2021kittywhiskers referenced this in commit 60e2e63e85 on Oct 28, 2021kittywhiskers referenced this in commit 300db0c0a8 on Oct 28, 2021kittywhiskers referenced this in commit 760a6a0db0 on Oct 28, 2021kittywhiskers referenced this in commit 8647ba1316 on Oct 29, 2021pravblockc referenced this in commit c462ca0410 on Nov 18, 2021DrahtBot locked this on Dec 16, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 03:12 UTC
More mirrored repositories can be found on mirror.b10c.me