Skip to content
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

feat: expose ElectrumClient::block_headers_subscribe method #664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thunderbiscuit
Copy link
Member

@thunderbiscuit thunderbiscuit commented Feb 5, 2025

This is a bit of a cheat: the method is not intended for a 1-time use, but rather is meant to open a subscription. In any case the Electrum client does return what I think our user wants (LDK-node please confirm!).

I'm not ready to merge this one just yet because I actually didn't expose the Header type fully (which would require 4 new types: Version, BlockHash, TxMerkleNode, and CompactTarget). If we do want to expose the block_header() method, then it might actually be worth taking the time exposing the whole Header type from rust-bitcoin.

Let me know if you have an opinion either way, because this would be a breaking change if we expose a simplified version and eventually want to return the full Header.

Changelog

Added:
    - Expose ElectrumClient::block_headers_subscribe method [#664]

[#664]: https://github.com/bitcoindevkit/bdk-ffi/pull/664

@reez
Copy link
Collaborator

reez commented Feb 6, 2025

I'm not ready to merge this one just yet because I actually didn't expose the Header type fully (which would require 4 new types: Version, BlockHash, TxMerkleNode, and CompactTarget). If we do want to expose the block_header() method, then it might actually be worth taking the time exposing the whole Header type from rust-bitcoin.

Let me know if you have an opinion either way, because this would be a breaking change if we expose a simplified version and eventually want to return the full Header.

Thanks for getting this PR going!

Yeah this solves the specific use case by providing the information needed/asked. It would be great to expose Header fully, but would also definitely be nice to have other specific use cases to help clarify how important it is to expose Header fully, I'm personally not using Electrum nearly as much as Esplora so I don't personally have a strong feeling (balancing this is what known user needs vs default of opening up types fully + not having future breaking changes)

@thunderbiscuit
Copy link
Member Author

We should also note that the Electrum client is not part of our "semantic 1.0", so if we do end up with small breaking changes there it's ok. Doesn't mean we shouldn't try to get it right on the first shot, but I just thought I'd mention it.

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.

2 participants