Skip to content

Commit f23a307

Browse files
authored
Merge pull request #912 from jkczyz/2026-05-bump-ldk-deps
Bump LDK dependencies
2 parents a297a58 + 5e33d8d commit f23a307

17 files changed

Lines changed: 146 additions & 104 deletions

Cargo.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ default = []
4040
#lightning-macros = { version = "0.2.0" }
4141
#lightning-dns-resolver = { version = "0.3.0" }
4242

43-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std"] }
44-
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" }
45-
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std"] }
46-
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" }
47-
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["tokio"] }
48-
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" }
49-
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" }
50-
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["rest-client", "rpc-client", "tokio"] }
51-
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
52-
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std"] }
53-
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" }
54-
lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" }
43+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std"] }
44+
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" }
45+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std"] }
46+
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" }
47+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["tokio"] }
48+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" }
49+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" }
50+
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["rest-client", "rpc-client", "tokio"] }
51+
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
52+
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std"] }
53+
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" }
54+
lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" }
5555

5656
bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] }
5757
bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]}
58-
bdk_electrum = { version = "0.23.0", default-features = false, features = ["use-rustls-ring"]}
58+
bdk_electrum = { version = "0.24.0", default-features = false, features = ["use-rustls-ring"]}
5959
bdk_wallet = { version = "2.3.0", default-features = false, features = ["std", "keys-bip39"]}
6060

6161
bitreq = { version = "0.3", default-features = false, features = ["async-https", "json-using-serde"] }
@@ -70,7 +70,7 @@ getrandom = { version = "0.3", default-features = false }
7070
chrono = { version = "0.4", default-features = false, features = ["clock"] }
7171
tokio = { version = "1.37", default-features = false, features = [ "rt-multi-thread", "time", "sync", "macros", "net" ] }
7272
esplora-client = { version = "0.12", default-features = false, features = ["tokio", "async-https-rustls"] }
73-
electrum-client = { version = "0.24.0", default-features = false, features = ["proxy", "use-rustls-ring"] }
73+
electrum-client = { version = "0.25", default-features = false, features = ["proxy", "use-rustls-ring"] }
7474
libc = "0.2"
7575
uniffi = { version = "0.29.5", features = ["build"], optional = true }
7676
serde = { version = "1.0.210", default-features = false, features = ["std", "derive"] }
@@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false }
8181
vss-client = { package = "vss-client-ng", version = "0.5" }
8282
prost = { version = "0.11.6", default-features = false}
8383
#bitcoin-payment-instructions = { version = "0.6" }
84-
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "679dac50cc0d81ec4d31da94b93d467e5308f16a" }
84+
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "c7d7ea849fcbe8cad385c93f8057cd68ecb994b7" }
8585

8686
[target.'cfg(windows)'.dependencies]
8787
winapi = { version = "0.3", features = ["winbase"] }
8888

8989
[dev-dependencies]
90-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std", "_test_utils"] }
90+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std", "_test_utils"] }
9191
rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] }
9292
proptest = "1.0.0"
9393
regex = "1.5.6"

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use bitcoin::secp256k1::PublicKey;
2222
use bitcoin::Network;
2323
use bitcoin_payment_instructions::dns_resolver::DNSHrnResolver;
2424
use bitcoin_payment_instructions::onion_message_resolver::LDKOnionMessageDNSSECHrnResolver;
25-
use lightning::chain::{chainmonitor, BestBlock as BlockLocator};
25+
use lightning::chain::{chainmonitor, BlockLocator};
2626
use lightning::ln::channelmanager::{self, ChainParameters, ChannelManagerReadArgs};
2727
use lightning::ln::msgs::{RoutingMessageHandler, SocketAddress};
2828
use lightning::ln::peer_handler::{IgnoringMessageHandler, MessageHandler};

src/chain/bitcoind.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use base64::prelude::BASE64_STANDARD;
1616
use base64::Engine;
1717
use bitcoin::{BlockHash, FeeRate, Network, OutPoint, Transaction, Txid};
1818
use lightning::chain::chaininterface::ConfirmationTarget as LdkConfirmationTarget;
19-
use lightning::chain::{BestBlock as BlockLocator, Listen};
19+
use lightning::chain::{BlockLocator, Listen};
2020
use lightning::util::ser::Writeable;
2121
use lightning_block_sync::gossip::UtxoSource;
2222
use lightning_block_sync::http::{HttpClientError, JsonResponse};
@@ -326,7 +326,7 @@ impl BitcoindChainSource {
326326
}
327327

328328
pub(super) async fn poll_best_block(&self) -> Result<BlockLocator, Error> {
329-
self.poll_chain_tip().await.map(|tip| tip.to_best_block())
329+
self.poll_chain_tip().await.map(|tip| tip.to_block_locator())
330330
}
331331

332332
async fn poll_chain_tip(&self) -> Result<ValidatedBlockHeader, Error> {
@@ -1365,7 +1365,7 @@ impl Listen for ChainListener {
13651365
self.output_sweeper.block_connected(block, height);
13661366
}
13671367

1368-
fn blocks_disconnected(&self, fork_point_block: lightning::chain::BestBlock) {
1368+
fn blocks_disconnected(&self, fork_point_block: lightning::chain::BlockLocator) {
13691369
self.onchain_wallet.blocks_disconnected(fork_point_block);
13701370
self.channel_manager.blocks_disconnected(fork_point_block);
13711371
self.chain_monitor.blocks_disconnected(fork_point_block);

src/chain/electrum.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ impl ElectrumRuntimeClient {
394394
) -> Result<Self, Error> {
395395
let electrum_config = ElectrumConfigBuilder::new()
396396
.retry(ELECTRUM_CLIENT_NUM_RETRIES)
397-
.timeout(Some(sync_config.timeouts_config.per_request_timeout_secs))
397+
.timeout(Some(Duration::from_secs(
398+
sync_config.timeouts_config.per_request_timeout_secs as u64,
399+
)))
398400
.build();
399401

400402
let electrum_client = Arc::new(
@@ -578,7 +580,7 @@ impl ElectrumRuntimeClient {
578580
let confirmation_targets = get_all_conf_targets();
579581
for target in confirmation_targets {
580582
let num_blocks = get_num_block_defaults_for_target(target);
581-
batch.estimate_fee(num_blocks);
583+
batch.estimate_fee(num_blocks, None);
582584
}
583585

584586
let spawn_fut = self.runtime.spawn_blocking(move || electrum_client.batch_call(&batch));

src/chain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::sync::{Arc, Mutex, RwLock};
1414
use std::time::Duration;
1515

1616
use bitcoin::{Script, Txid};
17-
use lightning::chain::{BestBlock as BlockLocator, Filter};
17+
use lightning::chain::{BlockLocator, Filter};
1818

1919
use crate::chain::bitcoind::{BitcoindChainSource, UtxoSourceClient};
2020
use crate::chain::electrum::ElectrumChainSource;

src/event.rs

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,9 @@ pub enum Event {
270270
/// This will be `None` for events serialized by LDK Node v0.2.1 and prior.
271271
reason: Option<ClosureReason>,
272272
},
273-
/// A channel splice is pending confirmation on-chain.
274-
SplicePending {
273+
/// A channel splice has been negotiated and the funding transaction is pending
274+
/// confirmation on-chain.
275+
SpliceNegotiated {
275276
/// The `channel_id` of the channel.
276277
channel_id: ChannelId,
277278
/// The `user_channel_id` of the channel.
@@ -281,16 +282,14 @@ pub enum Event {
281282
/// The outpoint of the channel's splice funding transaction.
282283
new_funding_txo: OutPoint,
283284
},
284-
/// A channel splice has failed.
285-
SpliceFailed {
285+
/// A channel splice negotiation round has failed.
286+
SpliceNegotiationFailed {
286287
/// The `channel_id` of the channel.
287288
channel_id: ChannelId,
288289
/// The `user_channel_id` of the channel.
289290
user_channel_id: UserChannelId,
290291
/// The `node_id` of the channel counterparty.
291292
counterparty_node_id: PublicKey,
292-
/// The outpoint of the channel's splice funding transaction, if one was created.
293-
abandoned_funding_txo: Option<OutPoint>,
294293
},
295294
}
296295

@@ -362,17 +361,17 @@ impl_writeable_tlv_based_enum!(Event,
362361
node_id: legacy_next_node_id,
363362
}])),
364363
},
365-
(8, SplicePending) => {
364+
(8, SpliceNegotiated) => {
366365
(1, channel_id, required),
367366
(3, counterparty_node_id, required),
368367
(5, user_channel_id, required),
369368
(7, new_funding_txo, required),
370369
},
371-
(9, SpliceFailed) => {
370+
(9, SpliceNegotiationFailed) => {
372371
(1, channel_id, required),
373372
(3, counterparty_node_id, required),
374373
(5, user_channel_id, required),
375-
(7, abandoned_funding_txo, option),
374+
// TLV 7 (abandoned_funding_txo) may be set for LDK Node v0.7.
376375
},
377376
);
378377

@@ -1612,7 +1611,13 @@ where
16121611
version: bitcoin::transaction::Version::TWO,
16131612
lock_time: bitcoin::absolute::LockTime::ZERO,
16141613
input: vec![],
1615-
output: outputs,
1614+
output: outputs
1615+
.into_iter()
1616+
.map(|script_pubkey| bitcoin::TxOut {
1617+
value: bitcoin::Amount::ZERO,
1618+
script_pubkey,
1619+
})
1620+
.collect(),
16161621
};
16171622
if let Err(e) = self.wallet.cancel_tx(&tx) {
16181623
log_error!(self.logger, "Failed reclaiming unused addresses: {}", e);
@@ -1814,7 +1819,7 @@ where
18141819
},
18151820
Err(()) => log_error!(self.logger, "Failed signing funding transaction"),
18161821
},
1817-
LdkEvent::SplicePending {
1822+
LdkEvent::SpliceNegotiated {
18181823
channel_id,
18191824
user_channel_id,
18201825
counterparty_node_id,
@@ -1823,13 +1828,13 @@ where
18231828
} => {
18241829
log_info!(
18251830
self.logger,
1826-
"Channel {} with counterparty {} pending splice with funding_txo {}",
1831+
"Channel {} with counterparty {} negotiated splice with funding_txo {}",
18271832
channel_id,
18281833
counterparty_node_id,
18291834
new_funding_txo,
18301835
);
18311836

1832-
let event = Event::SplicePending {
1837+
let event = Event::SpliceNegotiated {
18331838
channel_id,
18341839
user_channel_id: UserChannelId(user_channel_id),
18351840
counterparty_node_id,
@@ -1844,35 +1849,23 @@ where
18441849
},
18451850
};
18461851
},
1847-
LdkEvent::SpliceFailed {
1852+
LdkEvent::SpliceNegotiationFailed {
18481853
channel_id,
18491854
user_channel_id,
18501855
counterparty_node_id,
1851-
abandoned_funding_txo,
18521856
..
18531857
} => {
1854-
if let Some(funding_txo) = abandoned_funding_txo {
1855-
log_info!(
1856-
self.logger,
1857-
"Channel {} with counterparty {} failed splice with funding_txo {}",
1858-
channel_id,
1859-
counterparty_node_id,
1860-
funding_txo,
1861-
);
1862-
} else {
1863-
log_info!(
1864-
self.logger,
1865-
"Channel {} with counterparty {} failed splice",
1866-
channel_id,
1867-
counterparty_node_id,
1868-
);
1869-
}
1858+
log_info!(
1859+
self.logger,
1860+
"Channel {} with counterparty {} splice negotiation failed",
1861+
channel_id,
1862+
counterparty_node_id,
1863+
);
18701864

1871-
let event = Event::SpliceFailed {
1865+
let event = Event::SpliceNegotiationFailed {
18721866
channel_id,
18731867
user_channel_id: UserChannelId(user_channel_id),
18741868
counterparty_node_id,
1875-
abandoned_funding_txo,
18761869
};
18771870

18781871
match self.event_queue.add_event(event).await {

src/lib.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ use gossip::GossipSource;
145145
use graph::NetworkGraph;
146146
use io::utils::update_and_persist_node_metrics;
147147
pub use lightning;
148-
use lightning::chain::BestBlock as BlockLocator;
148+
use lightning::chain::BlockLocator;
149149
use lightning::impl_writeable_tlv_based;
150150
use lightning::ln::chan_utils::FUNDING_TRANSACTION_WITNESS_WEIGHT;
151151
use lightning::ln::channel_state::ChannelDetails as LdkChannelDetails;
@@ -1582,6 +1582,14 @@ impl Node {
15821582
Error::ChannelSplicingFailed
15831583
})?;
15841584

1585+
if funding_template.prior_contribution().is_some() {
1586+
log_error!(
1587+
self.logger,
1588+
"Failed to splice channel: a prior splice contribution is pending"
1589+
);
1590+
return Err(Error::ChannelSplicingFailed);
1591+
}
1592+
15851593
let contribution = self
15861594
.runtime
15871595
.block_on(funding_template.splice_in(
@@ -1695,19 +1703,20 @@ impl Node {
16951703
Error::ChannelSplicingFailed
16961704
})?;
16971705

1706+
if funding_template.prior_contribution().is_some() {
1707+
log_error!(
1708+
self.logger,
1709+
"Failed to splice channel: a prior splice contribution is pending"
1710+
);
1711+
return Err(Error::ChannelSplicingFailed);
1712+
}
1713+
16981714
let outputs = vec![bitcoin::TxOut {
16991715
value: Amount::from_sat(splice_amount_sats),
17001716
script_pubkey: address.script_pubkey(),
17011717
}];
1702-
let contribution = self
1703-
.runtime
1704-
.block_on(funding_template.splice_out(
1705-
outputs,
1706-
min_feerate,
1707-
max_feerate,
1708-
Arc::clone(&self.wallet),
1709-
))
1710-
.map_err(|e| {
1718+
let contribution =
1719+
funding_template.splice_out(outputs, min_feerate, max_feerate).map_err(|e| {
17111720
log_error!(self.logger, "Failed to splice channel: {}", e);
17121721
Error::ChannelSplicingFailed
17131722
})?;

src/liquidity.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ where
13131313
None,
13141314
expiry_secs,
13151315
Some(min_final_cltv_expiry_delta),
1316+
None,
13161317
)
13171318
.map_err(|e| {
13181319
log_error!(self.logger, "Failed to register inbound payment: {:?}", e);
@@ -1322,7 +1323,7 @@ where
13221323
},
13231324
None => self
13241325
.channel_manager
1325-
.create_inbound_payment(None, expiry_secs, Some(min_final_cltv_expiry_delta))
1326+
.create_inbound_payment(None, expiry_secs, Some(min_final_cltv_expiry_delta), None)
13261327
.map_err(|e| {
13271328
log_error!(self.logger, "Failed to register inbound payment: {:?}", e);
13281329
Error::InvoiceCreationFailed

src/payment/bolt11.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Bolt11Payment {
121121
// will know the preimage at this point.
122122
let res = self
123123
.channel_manager
124-
.get_payment_preimage(payment_hash, payment_secret.clone())
124+
.get_payment_preimage(payment_hash, payment_secret.clone(), None)
125125
.ok();
126126
debug_assert!(res.is_some(), "We just let ChannelManager create an inbound payment, it can't have forgotten the preimage by now.");
127127
res
@@ -206,8 +206,10 @@ impl Bolt11Payment {
206206
max_proportional_opening_fee_ppm_msat: lsp_prop_opening_fee,
207207
};
208208
let id = PaymentId(payment_hash.0);
209-
let preimage =
210-
self.channel_manager.get_payment_preimage(payment_hash, payment_secret.clone()).ok();
209+
let preimage = self
210+
.channel_manager
211+
.get_payment_preimage(payment_hash, payment_secret.clone(), None)
212+
.ok();
211213
let kind = PaymentKind::Bolt11Jit {
212214
hash: payment_hash,
213215
preimage,

0 commit comments

Comments
 (0)