bdk-ffi icon indicating copy to clipboard operation
bdk-ffi copied to clipboard

LDK Node + BDK

Open reez opened this issue 1 year ago • 6 comments

Describe the bug

i've just updated to v0.4.1 in my swift app but my project won't build, xcode complains 'RustBuffer::capacity' from module 'LDKNodeFFI.LDKNodeFFI' is not present in definition of 'struct RustBuffer' in module 'bdkFFI.bdkFFI'
ldknodebdk

To Reproduce
Import BDK and LDK Node into the same project.

Expected behavior
Project should build.

Build environment

  • BDK tag/commit:
  • OS+version:
  • Rust/Cargo version:
  • Rust/Cargo target:

Additional context

reez avatar Nov 04 '24 19:11 reez

It could be that LDK node and BDK are currently incompatible due to re-exporting the same types with different UniFFI versions

reez avatar Nov 04 '24 19:11 reez

I was unable to reproduce with this setup Xcode 16.1:

I chose that setup to test pre-1.0 and post-1.0 in combination with the referenced ldk-node 0.4.1.

post_1-0 pre_1-0

reez avatar Nov 04 '24 20:11 reez

Btw, likely unrelated, but we didn't release Swift bindings for LDK Node 0.4.1 only then for the newest 0.4.2.

tnull avatar Nov 06 '24 08:11 tnull

Btw, likely unrelated, but we didn't release Swift bindings for LDK Node 0.4.1 only then for the newest 0.4.2.

Good additional note on reproducing the issue that was reported by a user, Swift bindings for LDK Node 0.4.1 are actually just 0.4.0, so if user was pulling in 0.4.1 it would have just used 0.4.0. I'm still unable to reproduce the issue reported by the user who mentioned they were using LDK Node 0.4.1 and BDK, but maybe I haven't tried the same BDK version they are using.

Adding screenshot of 0.4.1 having Package.swift tag 0.4.0:

Screenshot 2024-11-06 at 6 50 32 AM

reez avatar Nov 06 '24 13:11 reez

Good additional note on reproducing the issue that was reported by a user, Swift bindings for LDK Node 0.4.1 are actually just 0.4.0

Yes, as said above, we didn't release 0.4.1 for Swift as by the time we came around to do so, we had to push out a fix with 0.4.2 so didn't make sense to do a release for a known-to-be-buggy version.

tnull avatar Nov 06 '24 13:11 tnull

Good additional note on reproducing the issue that was reported by a user, Swift bindings for LDK Node 0.4.1 are actually just 0.4.0

Yes, as said above, we didn't release 0.4.1 for Swift as by the time we came around to do so, we had to push out a fix with 0.4.2 so didn't make sense to do a release for a known-to-be-buggy version.

Makes sense

reez avatar Nov 06 '24 13:11 reez

Revisiting this since I did a fix for cktap https://github.com/bitcoindevkit/rust-cktap/pull/34/commits/f23819a8306406fe9cacecaebc39410fc2413346#diff-9816bdceb4680a0c7131a73e0a51e3181ead28fb5c9b147d1929eacf75f67b85 that fixed being able to use CKTap in an Xcode project with BDK.

So as I was revisiting as it pertains to BDK & LDK Node, I created local swift bindings from LDK Node main and everything worked find in a sample app where I imported both BDK (2.2.0) & LDK Node. Then I pulled in the remote bindings from LDK Node (0.6.2) and it worked as well.

So thru my testing I feel like this issue is solved and/or can also be solved quickly via the fix I did in CKTap that I also have a branch for LDK Node if ever needed https://github.com/reez/ldk-node/tree/chore or some other small fix (or uniffi version issue like pre-0.28 etc, or some other older general version related issue) I'm pretty confident can be applied now.

Please anyone reach out to me if they are still seeing issues though! Closing for now though.

Image

reez avatar Nov 06 '25 19:11 reez