-
Notifications
You must be signed in to change notification settings - Fork 168
Properly forbid multipath keys in definite descriptor keys #830
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
This uses `Self::XYZ` when matching on errors, rather than writing out the full name or using wildcard imports (which are dangerous because the compiler may misinterpret typos as being variable names) (although there will be a warning and CI should fail). This also collapses a bunch of fmt impls to only write the top-level error, in cases where we weren't adding any useful context. (We should revisit these and produce rich errors which have line number information and so forth; and I believe the correct way to describe the errors is the opposite of what I've done, where we are supposed to provide context but NOT the underlying error which can be accessed by the .source() method. But this simplifies the code without making things worse and we can do a proper fix later.)
sanket1729
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.
ACK 5df4d5b
When deriving keys we refuse to allow multipath keys. We should forbid them when directly constructing them at all.
sanket1729
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.
ACK b9ccd9d
apoelstra
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.
On b9ccd9d successfully ran local tests
a3561f9 bump version to 12.3.3 (Andrew Poelstra) 08b446e descriptor: add unit tests for constructing multipath keys (Andrew Poelstra) 042cd08 DefiniteDescriptorKey: disallow multipath keys (Andrew Poelstra) Pull request description: Just the logic fix; the error refactoring doesn't apply. ACKs for top commit: sanket1729: utACK a3561f9 Tree-SHA512: e0ddaaa2313a791330d1bc1ca7a90604f223405b4219e66a8a840d9568a4b81789866ed80839c6e22d8453af6b5fb8cb808fc9ab2ed3a51d81df5ac14b5c626b
cfa85be bump version to 11.2.2 (Andrew Poelstra) f652949 descriptor: add unit tests for constructing multipath keys (Andrew Poelstra) c07272a DefiniteDescriptorKey: disallow multipath keys (Andrew Poelstra) Pull request description: Just the logic fix; the error refactoring doesn't apply. ACKs for top commit: sanket1729: utACK cfa85be Tree-SHA512: 182c5b199c82460f80e8d9ae6bce9c0ea5905af36c372a92ad0ce189daff8b99fec7a7177f295e9101f78b5567cfcffb01bd4bfc921d8ed394878b22aa9309e2
780d6bc bump version to 10.2.2 (Andrew Poelstra) 29808ae descriptor: add unit tests for constructing multipath keys (Andrew Poelstra) b41daad DefiniteDescriptorKey: disallow multipath keys (Andrew Poelstra) Pull request description: Just the logic fix; the error refactoring doesn't apply. ACKs for top commit: sanket1729: tACK 780d6bc. Tree-SHA512: 97ba6bd8c475650da03614e4f8477f568d984c71c09ba2cf4141e80a1facba70d8067f9a0a70fb614e66d0663c3653608f6b7a2df456bb5668adc14eebfb9e2c
…s in definite descriptor keys
b9ccd9d20c3e1bb54ce9f671180613d8626b1474 descriptor: add unit tests for constructing multipath keys (Andrew Poelstra)
dad35327c93f485f1fbb2313f92d3e980134e3c8 DefiniteDescriptorKey: disallow multipath keys (Andrew Poelstra)
258873f70646072f890180c06707ce080b5b193f key.rs: split "definite keys cannot have wildcards" into own error (Andrew Poelstra)
bd5db6a44cbc5545ce218c01c2449c7382c70a73 descriptor/key.rs: clean up error matching (Andrew Poelstra)
Pull request description:
This PR essentially just fixes a logic bug in `DefiniteDescriptorKey::new` but involves several commits that just rearrange error types.
I will backport the logic fix without the error refactoring, since for 12.x and earlier we didn't really have error types and were just returning `Error::Unexpected("arbitrary string")` style errors.
ACKs for top commit:
sanket1729:
ACK b9ccd9d20c3e1bb54ce9f671180613d8626b1474
Tree-SHA512: 44f5033732eb2b67792cf1f93d909bd255ff5be251c3937450d93265746aedb2944db57b256ee7dea9ae0140c921320cc570a5be54244c4c97970eb3fe09f1ee
This PR essentially just fixes a logic bug in
DefiniteDescriptorKey::newbut involves several commits that just rearrange error types.I will backport the logic fix without the error refactoring, since for 12.x and earlier we didn't really have error types and were just returning
Error::Unexpected("arbitrary string")style errors.