-
Notifications
You must be signed in to change notification settings - Fork 155
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.)
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.
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
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
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.