Skip to content

Make backend objects Send + Sync for compatibility with cln-plugin #1047

@chrisguida

Description

@chrisguida

Describe the enhancement
Not sure if this is a feature request or a bug. It sounds like BDK v1.0 wants to have good async support, so it seems this would be good to get working before then? But I'll just put it in as a feature request in case not :)

I'm trying to get this CLN plugin repo to build: https://github.com/chrisguida/watchdescriptor/tree/wip/esplora_client

Currently it seems the support for async in BDK is not quite where cln-plugin (the official Rust CLN plugin framework) is expecting it to be, as it requires everything to be Send + Sync.

I discussed this with @notmandatory and he says:

my steps were going to be to 

1. look at all bdk return types from async functions called in your code; 
2. try to determine which ones are not send+sync; 
3. try to make the necessary type(s) send+sync; 
4. iterate with fields of those types until needed return types are send+sync.
once all this research/testing is done will need to put it into a PR.. 
if any needed types come from other crates then we'll need to 
figure out if/where to wrap them in a mutex or figure out if 
a PR is needed for the dependency crate (like rust-bitcoin or rust-miniscript, 
or some other dependency)

Use case
To be able to use BDK inside CLN plugins

I will take this on myself if someone wants to coach me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions