Skip to content

Bump LDK dependencies#912

Open
jkczyz wants to merge 8 commits into
lightningdevkit:mainfrom
jkczyz:2026-05-bump-ldk-deps
Open

Bump LDK dependencies#912
jkczyz wants to merge 8 commits into
lightningdevkit:mainfrom
jkczyz:2026-05-bump-ldk-deps

Conversation

@jkczyz
Copy link
Copy Markdown
Contributor

@jkczyz jkczyz commented May 22, 2026

There's been a growing number of LDK changes that haven't been incorporated into LDK Node yet. This PR bumps the LDK dependencies and accounts for any public API changes. New functionality is not incorporated by this PR nor is any other changes in behavior accounted for.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 22, 2026

👋 Thanks for assigning @tnull 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.

@jkczyz jkczyz force-pushed the 2026-05-bump-ldk-deps branch from 330fdf0 to 502b8ee Compare May 22, 2026 03:25
@jkczyz jkczyz requested a review from tnull May 22, 2026 03:25
@benthecarman benthecarman self-requested a review May 22, 2026 04:08
Copy link
Copy Markdown
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thank you very much for looking into this! Two minor things, otherwise looks good!

let expected_splice_in_fee_sat = 255;
let expected_splice_in_fee_sat = 251;
let expected_splice_in_onchain_cost_sat = 254;
let expected_splice_in_lightning_balance_sat = 4_000_003;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we leave a comment here that explains why we don't expect 4_000_000?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, and added a TODO to update this when updating BDK wallet.

Comment thread src/event.rs
(1, channel_id, required),
(3, counterparty_node_id, required),
(5, user_channel_id, required),
(7, abandoned_funding_txo, option),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, dropping this entry is probably fine given it's odd, right? But should we still leave comment here so we never accidentally reuse the type number and fail to deserialize if an LDK Node v0.7 wrote the old field?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

benthecarman and others added 8 commits May 22, 2026 09:59
The new API computes its splice fee independently of the BDK coin
selection it drives, so any surplus BDK reserves on top of LDK's fee
flows into the new funding output instead of returning as change. A
splice-in therefore deposits slightly more on the channel side than
requested.

Stop double-counting the 5 WU per foreign input that BDK adds for the
empty `script_sig` byte and witness-count varint already in LDK's
`satisfaction_weight`. A small residue from BDK's per-component fee
rounding still inflates the funding output.

Co-Authored-By: Jeffrey Czyz <jkczyz@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
After the LDK splice-builder API change, `FundingTemplate::splice_in`
and `splice_out` silently reuse and amend a prior contribution when one
is present, rather than starting from scratch. ldk-node has no caller
that intentionally exercises that path today, so reject the request
explicitly until we design a dedicated RBF entry point. This preserves
the pre-upgrade behavior for back-to-back splice attempts on the same
channel.

Co-Authored-By: Claude <noreply@anthropic.com>
LDK renamed `BestBlock` to `BlockLocator`. Drop the import aliases
that anticipated the rename.

Co-Authored-By: Claude <noreply@anthropic.com>
LDK renamed `Event::SplicePending` to `Event::SpliceNegotiated` and
`Event::SpliceFailed` to `Event::SpliceNegotiationFailed`, reflecting
that these events fire at the close of a negotiation round rather than
tracking a committed splice tx. Mirror the rename on the LDK Node side.

`Event::SpliceNegotiationFailed` no longer carries an
`abandoned_funding_txo`: the negotiation can fail before any candidate
tx is constructed, so there's nothing meaningful to surface there.

Co-Authored-By: Claude <noreply@anthropic.com>
LDK's `lightning-transaction-sync` bumps `electrum-client` to 0.25, so
we have to match in lockstep or end up with two incompatible versions
in the dependency graph and type mismatches at the LTS boundary.

`electrum-client` 0.25 takes a `Duration` for the client timeout and
adds an `EstimationMode` argument to `Batch::estimate_fee`. `bdk_electrum`
needs the 0.24 line to track the same `electrum-client` major.

`electrsd` still uses `electrum-client` 0.24, so tests that touch
`electrsd.client` now import `ElectrumApi`/`Client` from electrsd's
re-export to stay on its trait version.

Co-Authored-By: Claude <noreply@anthropic.com>
`Event::DiscardFunding`'s `outputs` field is now `Vec<ScriptBuf>`
instead of `Vec<TxOut>`. Wrap each script in a zero-valued `TxOut`
when handing the placeholder transaction to `Wallet::cancel_tx`,
which still expects `TxOut`s.

Co-Authored-By: Claude <noreply@anthropic.com>
LDK's `ChannelManager::create_inbound_payment`,
`create_inbound_payment_for_hash`, and `get_payment_preimage` each grew
a trailing `payment_metadata: Option<&[u8]>` argument so the inbound
payment can commit to caller-supplied metadata. ldk-node has nothing to
attach yet — pass `None`.

Co-Authored-By: Claude <noreply@anthropic.com>
LDK dropped the `FundingTxInput` type alias in favor of using
`ConfirmedUtxo` directly across the funding API. Switch over our splice
coin-selection path that built the input list via
`FundingTxInput::new_p2wpkh`.

Co-Authored-By: Claude <noreply@anthropic.com>
@jkczyz jkczyz force-pushed the 2026-05-bump-ldk-deps branch from 502b8ee to 5e33d8d Compare May 22, 2026 15:04
@jkczyz jkczyz requested a review from tnull May 22, 2026 15:07
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.

4 participants