-
Notifications
You must be signed in to change notification settings - Fork 37.7k
miniscript: account for all StringType
variants in Miniscriptdescriptor::ToString()
#31734
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
base: master
Are you sure you want to change the base?
miniscript: account for all StringType
variants in Miniscriptdescriptor::ToString()
#31734
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31734. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
StringType
variants in Miniscriptdescriptor::ToString()
StringType
variants in Miniscriptdescriptor::ToString()
StringType
variants in Miniscriptdescriptor::ToString()
StringType
variants in Miniscriptdescriptor::ToString()
StringType
variants in Miniscriptdescriptor::ToString()
2c70728
to
87be050
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
8ce78e5
to
0bc213d
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.
Code review 0bc213d
Thanks for taking on this issue! Not very familiar with this area but maybe I can assist in refining the PR anyway. Seems directionally correct to use h
consistently for hardened derivation paths unless backwards compatibility is requested.
PR title/summary
PR title typo
acount -> account
Summary
- In `MiniscriptDescriptor::ToStringHelper()` only `StringType::Private` variant of `type` argument was accounted. This PR implement serializing w/ all variants of `StringType` & add a functionnal test for the descriptor triggereing the related issue.
+ In `MiniscriptDescriptor::ToStringHelper()` only the `StringType::Private` variant of the `type` argument was handled. This PR implements serializing w/ all variants of `StringType` & add a functional test for the descriptor triggering the related issue.
Maybe the summary could also include a brief explanation of why this change ends up fixing the issue?
Commit order
The commit order is wrong for our CI setup, adding the test before the fix. Our CI expects each commit to succeed, so the test needs to be added last (reviewers can drop the other commit or run with binaries from master in order to trigger test failures).
StringType
variants in Miniscriptdescriptor::ToString()
StringType
variants in Miniscriptdescriptor::ToString()
0bc213d
to
498c47d
Compare
Thanks for the review @hodlinator! comments addressed & added more details to the summary |
This comment was marked as abuse.
This comment was marked as abuse.
1 similar comment
Concept ACK |
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.
Code review 498c47d
Since last review
git range-diff master 0bc213d 498c47d
- Reordered commits and avoid touching new test code in 2 commits. ✅
- Forwards on
cache
argument from calling function, changed types andconst
. ✅ - Improved PR title and summary. ✅
Concept
Before the PR, first key origin/derivation path in the descriptor undergoes '
-> h
conversion, but the second one does not. There seems to be some code in descriptor.cpp that deliberately tries to preserve apostrophes. I'm unsure whether the change breaks any existing requirements. My instinct says software depending on Bitcoin Core should handle h
in all cases. But there may be cases where changing the format leads to errors, worst case leading to users having problems recovering funds. If we go ahead with this PR, it should probably have release notes (example of PR with release notes).
Wallet and surrounding code is a beast that I don't have enough familiarity with to produce a Concept A-C-K at this point. Main code being changed seems to be from bfb0367 by @darosior and @sipa.
TODO
- Lacking
LIFETIMEBOUND
(see inline comment). - nit: PR summary typos: "differents hardened derivation marker" -> "different hardened derivation markers"
498c47d
to
a5c0516
Compare
a5c0516
to
28a4fcb
Compare
tahnks for your time @hodlinator! |
cc @darosior |
In
MiniscriptDescriptor::ToStringHelper()
only theStringType::Private
variant of thetype
argument was handled. This PR implements serializing w/ all variants ofStringType
& add a functional test for the descriptor triggering the related issue.Closes #31694: previously when calling
listdescriptors
RPC on a wallet containing a taproot descriptor w/ a (miniscript) taptree, origins of internal key & taptree were serialized w/ differents hardened derivation markers:StringType::Normalized
type (usingh
as marker)StringType::Private
type (using'
as marker)Note: Origins in segwit (
wsh()
) miniscript descriptors were also serialized w/StringType::Private
type ('
marker) and are now serialized w/StringType::Normalized
type (h
marker).