Skip to content

Bump BDK wallet dependency to 3.2 - #1182

Merged
tnull merged 5 commits into
lightningdevkit:mainfrom
tnull:2026-10-bdk-3.2-signers
Oct 26, 2026
Merged

tnull merged 5 commits into
lightningdevkit:mainfrom
tnull:2026-10-bdk-3.2-signers

Conversation

@tnull

@tnull tnull commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #654
Closes #1055

We bump bdk_wallet dependency, migrate to the updated signing API, and finally add some regression tests for the Electrum EOF fix that shipped in electrum-client.

@tnull
tnull requested a review from tankyleo October 20, 2026 16:02
@ldk-reviews-bot

ldk-reviews-bot commented Oct 20, 2026 •

Copy link
Copy Markdown

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tnull tnull added this to the 0.8 milestone Oct 20, 2026
@tnull
tnull force-pushed the 2026-10-bdk-3.2-signers branch from 2acfbd1 to 32f0c52 Compare October 20, 2026 16:26

@tankyleo tankyleo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also note that we currently include unconfirmed outputs from TRUC transactions in BalanceDetails::spendable_onchain_balance_sats, even though our onchain wallet currently never spends them. I think this is OK since we don't expect our onchain funds to be transaction outputs of V3 transactions.

Comment thread src/wallet/mod.rs Outdated
Comment thread src/wallet/mod.rs Outdated
Comment thread src/wallet/mod.rs
Comment thread src/chain/electrum.rs
Comment thread src/chain/electrum.rs Outdated
@tnull
tnull force-pushed the 2026-10-bdk-3.2-signers branch from 32f0c52 to 12778df Compare October 26, 2026 17:47
Our wallet needs per-input finalization results to distinguish
unfinished foreign inputs from failures to finalize its own inputs.

Raise the minimum BDK Wallet version to 3.2, which provides these
results alongside fixes for TRUC input selection and changeset merging.

Co-Authored-By: HAL 9000
@tnull
tnull force-pushed the 2026-10-bdk-3.2-signers branch 2 times, most recently from ab00f78 to 465bf51 Compare October 26, 2026 17:54
@tnull
tnull requested a review from tankyleo October 26, 2026 17:54
@tnull
tnull force-pushed the 2026-10-bdk-3.2-signers branch from 465bf51 to 56612fd Compare October 26, 2026 20:27
@tnull

tnull commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Let me know if I can squash

@tankyleo

Copy link
Copy Markdown
Contributor

Thanks yes please squash, this diff can help reduce flakiness in the clean_eof_wakes_concurrent_electrum_requests test.

diff --git a/src/chain/electrum.rs b/src/chain/electrum.rs
index 24b9b1a9..00155771 100644
--- a/src/chain/electrum.rs
+++ b/src/chain/electrum.rs
@@ -971,7 +971,7 @@ mod tests {
                        // unblock it until every request was fully written and flushed (excluding the
                        // version handshake).
                        let nudge = serde_json::json!({"jsonrpc": "2.0", "method": "test.nudge", "params": []});
-                       let deadline = std::time::Instant::now() + Duration::from_secs(10);
+                       let deadline = std::time::Instant::now() + Duration::from_secs(30);
                        while client.calls_made().unwrap() - 1 < REQUEST_COUNT {
                                assert!(std::time::Instant::now() < deadline, "requests weren't all sent");
                                writeln!(reader.get_mut(), "{nudge}").unwrap();
@@ -1016,7 +1016,7 @@ mod tests {

                for _ in 0..REQUEST_COUNT {
                        let failed_as_expected = finished_receiver
-                               .recv_timeout(Duration::from_secs(5))
+                               .recv_timeout(Duration::from_secs(60))
                                .expect("clean EOF must wake every concurrent Electrum request");
                        assert!(failed_as_expected);
                }

tnull added 4 commits October 26, 2026 22:40
BDK's wallet-owned signing APIs are deprecated, but our signing paths
still need their witness-UTXO policy, sighash checks, low-R signatures,
and input finalization.

Use caller-owned signers for both keychains to preserve these signing
options while dropping the deprecated APIs. Keep signing available
after reload, and cover witness-only signing from both keychains.

Refs lightningdevkit#654
Co-Authored-By: HAL 9000
Concurrent requests sharing an Electrum connection can remain blocked
when the active reader sees a clean EOF. This can keep blocking Tokio
workers alive through node shutdown.

electrum-client 0.25.1 fixed this, and we already require a release
that includes the fix. Cover the failure at the LDK Node boundary so
dependency updates cannot reintroduce the hang.

Fixes lightningdevkit#1007
Refs lightningdevkit#1055
(cherry picked from commit aff6ce0)
Co-Authored-By: HAL 9000
Mixed wallet and LDK transactions could be returned with unsigned
wallet inputs because the aggregate signing result also accounts
for unfinished foreign inputs.

Require BDK to finalize every recognized wallet input while allowing
inputs without a wallet descriptor to remain unfinished. Cover both
signing paths with tests that exercise missing wallet signers.

Co-Authored-By: HAL 9000
The maximum funding estimate relies on BDK's input selection. The
BDK 3.2 TRUC filtering change needs coverage at this boundary.

Check that unconfirmed v2 change remains usable, while v3 outputs
only increase the available funding amount after confirmation.

Co-Authored-By: HAL 9000
@tnull
tnull force-pushed the 2026-10-bdk-3.2-signers branch from 56612fd to 4611c67 Compare October 26, 2026 21:41
@tnull

tnull commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks yes please squash, this diff can help reduce flakiness in the clean_eof_wakes_concurrent_electrum_requests test.

diff --git a/src/chain/electrum.rs b/src/chain/electrum.rs
index 24b9b1a9..00155771 100644
--- a/src/chain/electrum.rs
+++ b/src/chain/electrum.rs
@@ -971,7 +971,7 @@ mod tests {
                        // unblock it until every request was fully written and flushed (excluding the
                        // version handshake).
                        let nudge = serde_json::json!({"jsonrpc": "2.0", "method": "test.nudge", "params": []});
-                       let deadline = std::time::Instant::now() + Duration::from_secs(10);
+                       let deadline = std::time::Instant::now() + Duration::from_secs(30);
                        while client.calls_made().unwrap() - 1 < REQUEST_COUNT {
                                assert!(std::time::Instant::now() < deadline, "requests weren't all sent");
                                writeln!(reader.get_mut(), "{nudge}").unwrap();
@@ -1016,7 +1016,7 @@ mod tests {

                for _ in 0..REQUEST_COUNT {
                        let failed_as_expected = finished_receiver
-                               .recv_timeout(Duration::from_secs(5))
+                               .recv_timeout(Duration::from_secs(60))
                                .expect("clean EOF must wake every concurrent Electrum request");
                        assert!(failed_as_expected);
                }

Squashed and included.

@tnull
tnull merged commit 9386a1c into lightningdevkit:main Oct 26, 2026
17 of 27 checks passed
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.

Migrate from deprecated signer module to bitcoin::psbt in ldk-node

3 participants