Skip to content

Conversation

chris-ricketts
Copy link
Contributor

Fixes #800

@chris-ricketts chris-ricketts changed the title Fix: make StatusDebugAndDisplay Send and Sync Fix: make StaticDebugAndDisplay Send and Sync Mar 31, 2025
@apoelstra
Copy link
Member

Nice. Yeah, I'm ok with this. In general I don't wanna throw every trait under the sun into this, but Send and Sync seem very reasonable, and if it makes the difference between anyhow compatibility and not we should do it.

Maaaybe I had some specific error types in mind that couldn't be Send/Sync, in which case I'll need to revisit this the next time I dust off my error improvement branch. But I don't think so.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK ea5b955; successfully ran local tests

@apoelstra apoelstra merged commit d0da327 into rust-bitcoin:master Mar 31, 2025
30 checks passed
@chris-ricketts
Copy link
Contributor Author

Thanks for the quick review and merge @apoelstra!

Maaaybe I had some specific error types in mind that couldn't be Send/Sync, in which case I'll need to revisit this the next time I dust off my error improvement branch. But I don't think so.

On the topic of error improvement, I have a commit which attempts to refactor the descriptor::key::DescriptorKeyParseError by turning it into an enum as suggested in the FIXME comment:

/// Descriptor Key parsing errors
// FIXME: replace with error enums
#[derive(Debug, PartialEq, Clone, Copy)]
pub struct DescriptorKeyParseError(&'static str);

Would it be worth a PR?

My main motivation is to add support for Ypubs in descriptors and this was a prerequisite to do it right.

My plan is the follow the advice in rust-bitcoin/rust-bitcoin#2190 and change the version bytes before calling Xpub::decode in the parse_bip32_xpub function.

@apoelstra
Copy link
Member

Would it be worth a PR?

This would be amazing. I've taken a few cracks at improving the global Error enum and never bothered touching DescriptorKeyParseError because it's self-contained and more of a chore than something that's blocking progress on the rest of the codebase.

My plan is the follow the advice in rust-bitcoin/rust-bitcoin#2190 and change the version bytes before calling Xpub::decode in the parse_bip32_xpub function.

Yeah, I still think that's the most reasonable way to approach this. (Given that I am still opposed to having any direct ypub/zpub support in this library. :))

heap-coder added a commit to heap-coder/rust-miniscript that referenced this pull request Sep 27, 2025
…lay` `Send` and `Sync`

ea5b955576fcb8afbdd7d7aac4c6fe2c819bfa4d doc: fix ParseError::RelativeLockTime doc-comment (Chris Ricketts)
cd4ace20a55a00ace78d4ac44efd1c3463775340 fix: make StaticDebugAndDisplay Send & Sync (Chris Ricketts)

Pull request description:

  Fixes #800

ACKs for top commit:
  apoelstra:
    ACK ea5b955576fcb8afbdd7d7aac4c6fe2c819bfa4d; successfully ran local tests

Tree-SHA512: 435dac54470272919ac22d79b4c3acdadb7ff0f830f7082b657ae8a9dbfe8ffc22e1334555a478ebb3b5bc6d4bf8e9a9e023af6947f6582d7c7fadf1cc18b1ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unreleased v13.0.0 is incompatible with anyhow crate
2 participants