From 4d4aecff8774fa908ce9a954c75c8c94ed134671 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Mon, 18 May 2026 17:00:11 -0500 Subject: [PATCH 1/8] Adopt new LDK splice API 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 Co-Authored-By: Claude --- Cargo.toml | 28 ++++++++++++++-------------- src/lib.rs | 11 ++--------- src/wallet/mod.rs | 29 +++++++++++++++++++++++++---- tests/integration_tests_rust.rs | 23 +++++++++++++++++++---- 4 files changed, 60 insertions(+), 31 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d34710a6e0..3d1d2c5c6f 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,18 +40,18 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "679dac50cc0d81ec4d31da94b93d467e5308f16a" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "47cd57f683cca44359dd000713edfbf3f815ad16" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "369a2cf9c8ef810deea0cd2b4cf6ed0691b78144", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/lib.rs b/src/lib.rs index 6d877ae10d..025c6d3bb1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1699,15 +1699,8 @@ impl Node { value: Amount::from_sat(splice_amount_sats), script_pubkey: address.script_pubkey(), }]; - let contribution = self - .runtime - .block_on(funding_template.splice_out( - outputs, - min_feerate, - max_feerate, - Arc::clone(&self.wallet), - )) - .map_err(|e| { + let contribution = + funding_template.splice_out(outputs, min_feerate, max_feerate).map_err(|e| { log_error!(self.logger, "Failed to splice channel: {}", e); Error::ChannelSplicingFailed })?; diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index daeb7becb3..f4e4df6800 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -574,7 +574,7 @@ impl Wallet { witness_utxo: Some(input.previous_utxo.clone()), ..Default::default() }; - let weight = Weight::from_wu(input.satisfaction_weight); + let weight = ldk_to_bdk_satisfaction_weight(input.satisfaction_weight); tx_builder.only_witness_utxo().exclude_unconfirmed(); tx_builder.add_foreign_utxo(input.outpoint, psbt_input, weight).map_err(|e| { log_error!(self.logger, "Failed to add shared input for fee estimation: {e}"); @@ -916,7 +916,7 @@ impl Wallet { witness_utxo: Some(input.previous_utxo.clone()), ..Default::default() }; - let weight = Weight::from_wu(input.satisfaction_weight); + let weight = ldk_to_bdk_satisfaction_weight(input.satisfaction_weight); tx_builder.add_foreign_utxo(input.outpoint, psbt_input, weight).map_err(|_| ())?; } @@ -958,8 +958,7 @@ impl Wallet { let change_output = unsigned_tx .output .into_iter() - .filter(|txout| must_pay_to.iter().all(|output| output != txout)) - .next(); + .find(|txout| must_pay_to.iter().all(|output| output != txout)); if change_output.is_some() { locked_wallet.persist(&mut locked_persister).map_err(|e| { @@ -1717,6 +1716,28 @@ impl ChangeDestinationSource for WalletKeysManager { } } +/// Convert LDK's `Input::satisfaction_weight` to the value BDK's +/// [`bdk_wallet::TxBuilder::add_foreign_utxo`] expects. +/// +/// LDK and BDK disagree on what `satisfaction_weight` includes for a SegWit input. LDK +/// treats it as the full weight of the spent input's `script_sig` and `witness` *each +/// with their lengths included* — i.e., the empty `script_sig` length byte (4 WU) and +/// the witness-elements-count varint (1 WU) are part of the value. BDK adds +/// `TxIn::default().segwit_weight()` internally, which already accounts for those same +/// 5 WU (an empty TxIn has a 1-byte empty `script_sig` length and a 1-byte empty +/// witness-count varint). Passing LDK's value directly to BDK therefore double-counts +/// 5 WU per foreign input, which inflates BDK's fee estimate and ultimately funnels the +/// surplus into the new funding output during splice negotiation. +fn ldk_to_bdk_satisfaction_weight(ldk_satisfaction_weight: u64) -> Weight { + const EMPTY_SCRIPT_SIG_WEIGHT: u64 = + 1 /* empty script_sig length byte */ * WITNESS_SCALE_FACTOR as u64; + const EMPTY_WITNESS_COUNT_WEIGHT: u64 = 1 /* witness elements count varint */; + Weight::from_wu( + ldk_satisfaction_weight + .saturating_sub(EMPTY_SCRIPT_SIG_WEIGHT + EMPTY_WITNESS_COUNT_WEIGHT), + ) +} + // FIXME/TODO: This is copied-over from bdk_wallet and only used to generate `WalletEvent`s after // applying mempool transactions. We should drop this when BDK offers to generate events for // mempool transactions natively. diff --git a/tests/integration_tests_rust.rs b/tests/integration_tests_rust.rs index d2c057a164..8a0eb1a10d 100644 --- a/tests/integration_tests_rust.rs +++ b/tests/integration_tests_rust.rs @@ -1067,7 +1067,16 @@ async fn splice_channel() { expect_channel_ready_event!(node_a, node_b.node_id()); expect_channel_ready_event!(node_b, node_a.node_id()); - let expected_splice_in_fee_sat = 255; + let expected_splice_in_fee_sat = 251; + let expected_splice_in_onchain_cost_sat = 254; + + // LDK's fee calculation differs from BDK wallet's, which over pays on fees. Rather than giving + // the extra fees to the miner, LDK sends it to the channel balance since there may not be a + // change output. + // + // TODO: Some of the discrepancy is addressed upstream, so this number should be adjusted when + // updating the BDK wallet dependency. See: https://github.com/bitcoindevkit/bdk_wallet/pull/479 + let expected_splice_in_lightning_balance_sat = 4_000_003; let payments = node_b.list_payments(); let payment = @@ -1076,9 +1085,12 @@ async fn splice_channel() { assert_eq!( node_b.list_balances().total_onchain_balance_sats, - premine_amount_sat - 4_000_000 - expected_splice_in_fee_sat + premine_amount_sat - 4_000_000 - expected_splice_in_onchain_cost_sat + ); + assert_eq!( + node_b.list_balances().total_lightning_balance_sats, + expected_splice_in_lightning_balance_sat ); - assert_eq!(node_b.list_balances().total_lightning_balance_sats, 4_000_000); let payment_id = node_b.spontaneous_payment().send(amount_msat, node_a.node_id(), None).unwrap(); @@ -1093,7 +1105,10 @@ async fn splice_channel() { node_a.list_balances().total_lightning_balance_sats, 4_000_000 - closing_transaction_fee_sat - anchor_output_sat + amount_msat / 1000 ); - assert_eq!(node_b.list_balances().total_lightning_balance_sats, 4_000_000 - amount_msat / 1000); + assert_eq!( + node_b.list_balances().total_lightning_balance_sats, + expected_splice_in_lightning_balance_sat - amount_msat / 1000 + ); // Splice-out funds for Node A from the payment sent by Node B let address = node_a.onchain_payment().new_address().unwrap(); From 8f90a6deeb0ac43f6371c3b81b18ee5a8df0d653 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 18 May 2026 17:00:39 -0500 Subject: [PATCH 2/8] Fail splice when funding template carries a prior contribution 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 --- src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 025c6d3bb1..38a27a5a34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1582,6 +1582,14 @@ impl Node { Error::ChannelSplicingFailed })?; + if funding_template.prior_contribution().is_some() { + log_error!( + self.logger, + "Failed to splice channel: a prior splice contribution is pending" + ); + return Err(Error::ChannelSplicingFailed); + } + let contribution = self .runtime .block_on(funding_template.splice_in( @@ -1695,6 +1703,14 @@ impl Node { Error::ChannelSplicingFailed })?; + if funding_template.prior_contribution().is_some() { + log_error!( + self.logger, + "Failed to splice channel: a prior splice contribution is pending" + ); + return Err(Error::ChannelSplicingFailed); + } + let outputs = vec![bitcoin::TxOut { value: Amount::from_sat(splice_amount_sats), script_pubkey: address.script_pubkey(), From 8d9684b4bac0b1e5ff9b270a5e086c628fdea31a Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Wed, 20 May 2026 12:52:12 -0500 Subject: [PATCH 3/8] Adopt LDK's BlockLocator rename LDK renamed `BestBlock` to `BlockLocator`. Drop the import aliases that anticipated the rename. Co-Authored-By: Claude --- Cargo.toml | 28 ++++++++++++++-------------- src/builder.rs | 2 +- src/chain/bitcoind.rs | 6 +++--- src/chain/mod.rs | 2 +- src/lib.rs | 2 +- src/wallet/mod.rs | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3d1d2c5c6f..f919947a7e 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,18 +40,18 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "47cd57f683cca44359dd000713edfbf3f815ad16" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "4b176efe2e0258767b949904c7c835b3d0d142dd" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3278ece85e5f57febd3927c530c0d1b5e15e1754", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/builder.rs b/src/builder.rs index 54a2f51abc..5f616c4ce8 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -22,7 +22,7 @@ use bitcoin::secp256k1::PublicKey; use bitcoin::Network; use bitcoin_payment_instructions::dns_resolver::DNSHrnResolver; use bitcoin_payment_instructions::onion_message_resolver::LDKOnionMessageDNSSECHrnResolver; -use lightning::chain::{chainmonitor, BestBlock as BlockLocator}; +use lightning::chain::{chainmonitor, BlockLocator}; use lightning::ln::channelmanager::{self, ChainParameters, ChannelManagerReadArgs}; use lightning::ln::msgs::{RoutingMessageHandler, SocketAddress}; use lightning::ln::peer_handler::{IgnoringMessageHandler, MessageHandler}; diff --git a/src/chain/bitcoind.rs b/src/chain/bitcoind.rs index 7ece757aeb..2582f32f64 100644 --- a/src/chain/bitcoind.rs +++ b/src/chain/bitcoind.rs @@ -16,7 +16,7 @@ use base64::prelude::BASE64_STANDARD; use base64::Engine; use bitcoin::{BlockHash, FeeRate, Network, OutPoint, Transaction, Txid}; use lightning::chain::chaininterface::ConfirmationTarget as LdkConfirmationTarget; -use lightning::chain::{BestBlock as BlockLocator, Listen}; +use lightning::chain::{BlockLocator, Listen}; use lightning::util::ser::Writeable; use lightning_block_sync::gossip::UtxoSource; use lightning_block_sync::http::{HttpClientError, JsonResponse}; @@ -326,7 +326,7 @@ impl BitcoindChainSource { } pub(super) async fn poll_best_block(&self) -> Result { - self.poll_chain_tip().await.map(|tip| tip.to_best_block()) + self.poll_chain_tip().await.map(|tip| tip.to_block_locator()) } async fn poll_chain_tip(&self) -> Result { @@ -1365,7 +1365,7 @@ impl Listen for ChainListener { self.output_sweeper.block_connected(block, height); } - fn blocks_disconnected(&self, fork_point_block: lightning::chain::BestBlock) { + fn blocks_disconnected(&self, fork_point_block: lightning::chain::BlockLocator) { self.onchain_wallet.blocks_disconnected(fork_point_block); self.channel_manager.blocks_disconnected(fork_point_block); self.chain_monitor.blocks_disconnected(fork_point_block); diff --git a/src/chain/mod.rs b/src/chain/mod.rs index b70620b99e..cb8541be6a 100644 --- a/src/chain/mod.rs +++ b/src/chain/mod.rs @@ -14,7 +14,7 @@ use std::sync::{Arc, Mutex, RwLock}; use std::time::Duration; use bitcoin::{Script, Txid}; -use lightning::chain::{BestBlock as BlockLocator, Filter}; +use lightning::chain::{BlockLocator, Filter}; use crate::chain::bitcoind::{BitcoindChainSource, UtxoSourceClient}; use crate::chain::electrum::ElectrumChainSource; diff --git a/src/lib.rs b/src/lib.rs index 38a27a5a34..2d1a0d958f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -145,7 +145,7 @@ use gossip::GossipSource; use graph::NetworkGraph; use io::utils::update_and_persist_node_metrics; pub use lightning; -use lightning::chain::BestBlock as BlockLocator; +use lightning::chain::BlockLocator; use lightning::impl_writeable_tlv_based; use lightning::ln::chan_utils::FUNDING_TRANSACTION_WITNESS_WEIGHT; use lightning::ln::channel_state::ChannelDetails as LdkChannelDetails; diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index f4e4df6800..7ea2d04cc9 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -35,7 +35,7 @@ use lightning::chain::chaininterface::{ BroadcasterInterface, INCREMENTAL_RELAY_FEE_SAT_PER_1000_WEIGHT, }; use lightning::chain::channelmonitor::ANTI_REORG_DELAY; -use lightning::chain::{BestBlock as BlockLocator, ClaimId, Listen}; +use lightning::chain::{BlockLocator, ClaimId, Listen}; use lightning::ln::channelmanager::PaymentId; use lightning::ln::funding::FundingTxInput; use lightning::ln::inbound_payment::ExpandedKey; From f3a74e23b50f5d1377935c2f653ce12c89b8bb4c Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 21 May 2026 17:16:17 -0500 Subject: [PATCH 4/8] Rename splice events to negotiation phase 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 --- Cargo.toml | 28 +++++++++--------- src/event.rs | 51 ++++++++++++--------------------- tests/common/mod.rs | 20 ++++++------- tests/common/scenarios/mod.rs | 2 +- tests/integration_tests_rust.rs | 10 +++---- 5 files changed, 49 insertions(+), 62 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f919947a7e..a589abb7c2 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,18 +40,18 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "4b176efe2e0258767b949904c7c835b3d0d142dd" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "3412c49b2144321e284bdf82a60beaf6260ee4c7" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "23b620a6016abcf1614659eb75b9bc1fd8579e89", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/event.rs b/src/event.rs index 65fe683ecb..096da19552 100644 --- a/src/event.rs +++ b/src/event.rs @@ -270,8 +270,9 @@ pub enum Event { /// This will be `None` for events serialized by LDK Node v0.2.1 and prior. reason: Option, }, - /// A channel splice is pending confirmation on-chain. - SplicePending { + /// A channel splice has been negotiated and the funding transaction is pending + /// confirmation on-chain. + SpliceNegotiated { /// The `channel_id` of the channel. channel_id: ChannelId, /// The `user_channel_id` of the channel. @@ -281,16 +282,14 @@ pub enum Event { /// The outpoint of the channel's splice funding transaction. new_funding_txo: OutPoint, }, - /// A channel splice has failed. - SpliceFailed { + /// A channel splice negotiation round has failed. + SpliceNegotiationFailed { /// The `channel_id` of the channel. channel_id: ChannelId, /// The `user_channel_id` of the channel. user_channel_id: UserChannelId, /// The `node_id` of the channel counterparty. counterparty_node_id: PublicKey, - /// The outpoint of the channel's splice funding transaction, if one was created. - abandoned_funding_txo: Option, }, } @@ -362,17 +361,17 @@ impl_writeable_tlv_based_enum!(Event, node_id: legacy_next_node_id, }])), }, - (8, SplicePending) => { + (8, SpliceNegotiated) => { (1, channel_id, required), (3, counterparty_node_id, required), (5, user_channel_id, required), (7, new_funding_txo, required), }, - (9, SpliceFailed) => { + (9, SpliceNegotiationFailed) => { (1, channel_id, required), (3, counterparty_node_id, required), (5, user_channel_id, required), - (7, abandoned_funding_txo, option), + // TLV 7 (abandoned_funding_txo) may be set for LDK Node v0.7. }, ); @@ -1814,7 +1813,7 @@ where }, Err(()) => log_error!(self.logger, "Failed signing funding transaction"), }, - LdkEvent::SplicePending { + LdkEvent::SpliceNegotiated { channel_id, user_channel_id, counterparty_node_id, @@ -1823,13 +1822,13 @@ where } => { log_info!( self.logger, - "Channel {} with counterparty {} pending splice with funding_txo {}", + "Channel {} with counterparty {} negotiated splice with funding_txo {}", channel_id, counterparty_node_id, new_funding_txo, ); - let event = Event::SplicePending { + let event = Event::SpliceNegotiated { channel_id, user_channel_id: UserChannelId(user_channel_id), counterparty_node_id, @@ -1844,35 +1843,23 @@ where }, }; }, - LdkEvent::SpliceFailed { + LdkEvent::SpliceNegotiationFailed { channel_id, user_channel_id, counterparty_node_id, - abandoned_funding_txo, .. } => { - if let Some(funding_txo) = abandoned_funding_txo { - log_info!( - self.logger, - "Channel {} with counterparty {} failed splice with funding_txo {}", - channel_id, - counterparty_node_id, - funding_txo, - ); - } else { - log_info!( - self.logger, - "Channel {} with counterparty {} failed splice", - channel_id, - counterparty_node_id, - ); - } + log_info!( + self.logger, + "Channel {} with counterparty {} splice negotiation failed", + channel_id, + counterparty_node_id, + ); - let event = Event::SpliceFailed { + let event = Event::SpliceNegotiationFailed { channel_id, user_channel_id: UserChannelId(user_channel_id), counterparty_node_id, - abandoned_funding_txo, }; match self.event_queue.add_event(event).await { diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 00c8808a7b..3b741a8371 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -179,7 +179,7 @@ macro_rules! expect_channel_ready_events { pub(crate) use expect_channel_ready_events; -macro_rules! expect_splice_pending_event { +macro_rules! expect_splice_negotiated_event { ($node:expr, $counterparty_node_id:expr) => {{ let event = tokio::time::timeout( std::time::Duration::from_secs(crate::common::INTEROP_TIMEOUT_SECS), @@ -187,10 +187,10 @@ macro_rules! expect_splice_pending_event { ) .await .unwrap_or_else(|_| { - panic!("{} timed out waiting for SplicePending event after 60s", $node.node_id()) + panic!("{} timed out waiting for SpliceNegotiated event after 60s", $node.node_id()) }); match event { - ref e @ Event::SplicePending { new_funding_txo, counterparty_node_id, .. } => { + ref e @ Event::SpliceNegotiated { new_funding_txo, counterparty_node_id, .. } => { println!("{} got event {:?}", $node.node_id(), e); assert_eq!(counterparty_node_id, $counterparty_node_id); $node.event_handled().unwrap(); @@ -203,7 +203,7 @@ macro_rules! expect_splice_pending_event { }}; } -pub(crate) use expect_splice_pending_event; +pub(crate) use expect_splice_negotiated_event; macro_rules! expect_payment_received_event { ($node:expr, $amount_msat:expr) => {{ @@ -888,8 +888,8 @@ pub async fn splice_in_with_all( ) { node_a.splice_in_with_all(user_channel_id, node_b.node_id()).unwrap(); - let splice_txo = expect_splice_pending_event!(node_a, node_b.node_id()); - expect_splice_pending_event!(node_b, node_a.node_id()); + let splice_txo = expect_splice_negotiated_event!(node_a, node_b.node_id()); + expect_splice_negotiated_event!(node_b, node_a.node_id()); wait_for_tx(&electrsd.client, splice_txo.txid).await; } @@ -1360,8 +1360,8 @@ pub(crate) async fn do_channel_full_cycle( let splice_out_sat = funding_amount_sat / 2; node_b.splice_out(&user_channel_id_b, node_a.node_id(), &addr_a, splice_out_sat).unwrap(); - expect_splice_pending_event!(node_a, node_b.node_id()); - expect_splice_pending_event!(node_b, node_a.node_id()); + expect_splice_negotiated_event!(node_a, node_b.node_id()); + expect_splice_negotiated_event!(node_b, node_a.node_id()); generate_blocks_and_wait(&bitcoind, electrsd, 6).await; node_a.sync_wallets().unwrap(); @@ -1382,8 +1382,8 @@ pub(crate) async fn do_channel_full_cycle( let splice_in_sat = splice_out_sat; node_a.splice_in(&user_channel_id_a, node_b.node_id(), splice_in_sat).unwrap(); - expect_splice_pending_event!(node_a, node_b.node_id()); - expect_splice_pending_event!(node_b, node_a.node_id()); + expect_splice_negotiated_event!(node_a, node_b.node_id()); + expect_splice_negotiated_event!(node_b, node_a.node_id()); generate_blocks_and_wait(&bitcoind, electrsd, 6).await; node_a.sync_wallets().unwrap(); diff --git a/tests/common/scenarios/mod.rs b/tests/common/scenarios/mod.rs index 1999b7d0cd..3d834b3f86 100644 --- a/tests/common/scenarios/mod.rs +++ b/tests/common/scenarios/mod.rs @@ -240,7 +240,7 @@ pub(crate) async fn splice_in_scenario( .await; let ext_node_id = peer.get_node_id().await.unwrap(); node.splice_in(&user_ch, ext_node_id, 500_000).unwrap(); - expect_splice_pending_event!(node, ext_node_id); + expect_splice_negotiated_event!(node, ext_node_id); generate_blocks_and_wait(bitcoind, electrs, 6).await; sync_wallets_with_retry(node).await; expect_channel_ready_event!(node, ext_node_id); diff --git a/tests/integration_tests_rust.rs b/tests/integration_tests_rust.rs index 8a0eb1a10d..a3970b1c24 100644 --- a/tests/integration_tests_rust.rs +++ b/tests/integration_tests_rust.rs @@ -20,7 +20,7 @@ use common::{ bump_fee_and_broadcast, distribute_funds_unconfirmed, do_channel_full_cycle, expect_channel_pending_event, expect_channel_ready_event, expect_channel_ready_events, expect_event, expect_payment_claimable_event, expect_payment_received_event, - expect_payment_successful_event, expect_splice_pending_event, generate_blocks_and_wait, + expect_payment_successful_event, expect_splice_negotiated_event, generate_blocks_and_wait, generate_listening_addresses, open_channel, open_channel_push_amt, open_channel_with_all, premine_and_distribute_funds, premine_blocks, prepare_rbf, random_chain_source, random_config, setup_bitcoind_and_electrsd, setup_builder, setup_node, setup_two_nodes, splice_in_with_all, @@ -1056,8 +1056,8 @@ async fn splice_channel() { // Splice-in funds for Node B so that it has outbound liquidity to make a payment node_b.splice_in(&user_channel_id_b, node_a.node_id(), 4_000_000).unwrap(); - let txo = expect_splice_pending_event!(node_a, node_b.node_id()); - expect_splice_pending_event!(node_b, node_a.node_id()); + let txo = expect_splice_negotiated_event!(node_a, node_b.node_id()); + expect_splice_negotiated_event!(node_b, node_a.node_id()); generate_blocks_and_wait(&bitcoind.client, &electrsd.client, 6).await; @@ -1114,8 +1114,8 @@ async fn splice_channel() { let address = node_a.onchain_payment().new_address().unwrap(); node_a.splice_out(&user_channel_id_a, node_b.node_id(), &address, amount_msat / 1000).unwrap(); - let txo = expect_splice_pending_event!(node_a, node_b.node_id()); - expect_splice_pending_event!(node_b, node_a.node_id()); + let txo = expect_splice_negotiated_event!(node_a, node_b.node_id()); + expect_splice_negotiated_event!(node_b, node_a.node_id()); generate_blocks_and_wait(&bitcoind.client, &electrsd.client, 6).await; From 7a550e8014c58b648f1e026026b6b69368a7bcca Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 21 May 2026 17:38:19 -0500 Subject: [PATCH 5/8] Bump electrum-client to 0.25 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 --- Cargo.toml | 32 +++++++++++++++---------------- src/chain/electrum.rs | 6 ++++-- tests/common/mod.rs | 2 +- tests/common/scenarios/channel.rs | 2 +- tests/common/scenarios/mod.rs | 2 +- tests/integration_tests_cln.rs | 2 +- tests/integration_tests_eclair.rs | 2 +- tests/integration_tests_lnd.rs | 2 +- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a589abb7c2..9bf5d5c355 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,22 +40,22 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} -bdk_electrum = { version = "0.23.0", default-features = false, features = ["use-rustls-ring"]} +bdk_electrum = { version = "0.24.0", default-features = false, features = ["use-rustls-ring"]} bdk_wallet = { version = "2.3.0", default-features = false, features = ["std", "keys-bip39"]} bitreq = { version = "0.3", default-features = false, features = ["async-https", "json-using-serde"] } @@ -70,7 +70,7 @@ getrandom = { version = "0.3", default-features = false } chrono = { version = "0.4", default-features = false, features = ["clock"] } tokio = { version = "1.37", default-features = false, features = [ "rt-multi-thread", "time", "sync", "macros", "net" ] } esplora-client = { version = "0.12", default-features = false, features = ["tokio", "async-https-rustls"] } -electrum-client = { version = "0.24.0", default-features = false, features = ["proxy", "use-rustls-ring"] } +electrum-client = { version = "0.25", default-features = false, features = ["proxy", "use-rustls-ring"] } libc = "0.2" uniffi = { version = "0.29.5", features = ["build"], optional = true } serde = { version = "1.0.210", default-features = false, features = ["std", "derive"] } @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "3412c49b2144321e284bdf82a60beaf6260ee4c7" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "6e3cf543ff7d4e74a4bf2d27112efebad3b49711" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "b780a85158d9db582c12da84c74c0453e61dad27", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/chain/electrum.rs b/src/chain/electrum.rs index c62cbb5261..54e7fff0ca 100644 --- a/src/chain/electrum.rs +++ b/src/chain/electrum.rs @@ -394,7 +394,9 @@ impl ElectrumRuntimeClient { ) -> Result { let electrum_config = ElectrumConfigBuilder::new() .retry(ELECTRUM_CLIENT_NUM_RETRIES) - .timeout(Some(sync_config.timeouts_config.per_request_timeout_secs)) + .timeout(Some(Duration::from_secs( + sync_config.timeouts_config.per_request_timeout_secs as u64, + ))) .build(); let electrum_client = Arc::new( @@ -578,7 +580,7 @@ impl ElectrumRuntimeClient { let confirmation_targets = get_all_conf_targets(); for target in confirmation_targets { let num_blocks = get_num_block_defaults_for_target(target); - batch.estimate_fee(num_blocks); + batch.estimate_fee(num_blocks, None); } let spawn_fut = self.runtime.spawn_blocking(move || electrum_client.batch_call(&batch)); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 3b741a8371..b701028c54 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -34,8 +34,8 @@ use bitcoin::{ Address, Amount, Network, OutPoint, ScriptBuf, Sequence, Transaction, Txid, Witness, }; use electrsd::corepc_node::{Client as BitcoindClient, Node as BitcoinD}; +use electrsd::electrum_client::ElectrumApi; use electrsd::{corepc_node, ElectrsD}; -use electrum_client::ElectrumApi; use ldk_node::config::{ AsyncPaymentsRole, Config, ElectrumSyncConfig, EsploraSyncConfig, HRNResolverConfig, HumanReadableNamesConfig, diff --git a/tests/common/scenarios/channel.rs b/tests/common/scenarios/channel.rs index da968b469a..74e04127c6 100644 --- a/tests/common/scenarios/channel.rs +++ b/tests/common/scenarios/channel.rs @@ -8,7 +8,7 @@ use std::time::Duration; use electrsd::corepc_node::Client as BitcoindClient; -use electrum_client::ElectrumApi; +use electrsd::electrum_client::ElectrumApi; use ldk_node::{Event, Node}; use super::super::external_node::ExternalNode; diff --git a/tests/common/scenarios/mod.rs b/tests/common/scenarios/mod.rs index 3d834b3f86..7cbf56b8e1 100644 --- a/tests/common/scenarios/mod.rs +++ b/tests/common/scenarios/mod.rs @@ -19,7 +19,7 @@ use std::time::Duration; use bitcoin::Amount; use electrsd::corepc_node::Client as BitcoindClient; -use electrum_client::ElectrumApi; +use electrsd::electrum_client::ElectrumApi; use ldk_node::{Event, Node}; use super::external_node::ExternalNode; diff --git a/tests/integration_tests_cln.rs b/tests/integration_tests_cln.rs index 1c90920ff9..484c52b109 100644 --- a/tests/integration_tests_cln.rs +++ b/tests/integration_tests_cln.rs @@ -16,7 +16,7 @@ use common::scenarios::{ }; use electrsd::corepc_client::client_sync::Auth; use electrsd::corepc_node::Client as BitcoindClient; -use electrum_client::Client as ElectrumClient; +use electrsd::electrum_client::Client as ElectrumClient; async fn setup_clients() -> (BitcoindClient, ElectrumClient, TestClnNode) { let bitcoind = BitcoindClient::new_with_auth( diff --git a/tests/integration_tests_eclair.rs b/tests/integration_tests_eclair.rs index 42d617eec2..cec957a91d 100644 --- a/tests/integration_tests_eclair.rs +++ b/tests/integration_tests_eclair.rs @@ -17,7 +17,7 @@ use common::scenarios::{ }; use electrsd::corepc_client::client_sync::Auth; use electrsd::corepc_node::Client as BitcoindClient; -use electrum_client::Client as ElectrumClient; +use electrsd::electrum_client::Client as ElectrumClient; /// Unlock all UTXOs in the given bitcoind wallet via JSON-RPC. async fn unlock_utxos(wallet_url: &str, user: &str, pass: &str) { diff --git a/tests/integration_tests_lnd.rs b/tests/integration_tests_lnd.rs index b3059ac485..ab82678afe 100755 --- a/tests/integration_tests_lnd.rs +++ b/tests/integration_tests_lnd.rs @@ -16,7 +16,7 @@ use common::scenarios::{ }; use electrsd::corepc_client::client_sync::Auth; use electrsd::corepc_node::Client as BitcoindClient; -use electrum_client::Client as ElectrumClient; +use electrsd::electrum_client::Client as ElectrumClient; async fn setup_clients() -> (BitcoindClient, ElectrumClient, TestLndNode) { let bitcoind = BitcoindClient::new_with_auth( From 31a7f29f5d1a121bd95104478c8725f7df380089 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 21 May 2026 18:51:17 -0500 Subject: [PATCH 6/8] Wrap discarded funding outputs in TxOuts `Event::DiscardFunding`'s `outputs` field is now `Vec` instead of `Vec`. 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 --- Cargo.toml | 28 ++++++++++++++-------------- src/event.rs | 8 +++++++- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9bf5d5c355..5a738ce5fb 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,18 +40,18 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "6e3cf543ff7d4e74a4bf2d27112efebad3b49711" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "95ee1d08c47ec2c0d0f8c358c64a4b178befb009" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "4f6f15df5ff542f347f6239115dd12e885d21fba", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/event.rs b/src/event.rs index 096da19552..d672a90f6d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -1611,7 +1611,13 @@ where version: bitcoin::transaction::Version::TWO, lock_time: bitcoin::absolute::LockTime::ZERO, input: vec![], - output: outputs, + output: outputs + .into_iter() + .map(|script_pubkey| bitcoin::TxOut { + value: bitcoin::Amount::ZERO, + script_pubkey, + }) + .collect(), }; if let Err(e) = self.wallet.cancel_tx(&tx) { log_error!(self.logger, "Failed reclaiming unused addresses: {}", e); From 9a6886399e1f4c6fd01c9d266cd283b11cc7cef1 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 21 May 2026 18:57:46 -0500 Subject: [PATCH 7/8] Pass `None` for new inbound-payment metadata argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Cargo.toml | 28 ++++++++++++++-------------- src/liquidity.rs | 3 ++- src/payment/bolt11.rs | 8 +++++--- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a738ce5fb..268e2be41f 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,18 +40,18 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "95ee1d08c47ec2c0d0f8c358c64a4b178befb009" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "beeb5d530fc14bb1fc0564dc39ecf57c4a92a53d" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "f0f83916be3111389fbe4fa2de3a95613f5bb242", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/liquidity.rs b/src/liquidity.rs index 30ab2c0df5..66e3edd334 100644 --- a/src/liquidity.rs +++ b/src/liquidity.rs @@ -1313,6 +1313,7 @@ where None, expiry_secs, Some(min_final_cltv_expiry_delta), + None, ) .map_err(|e| { log_error!(self.logger, "Failed to register inbound payment: {:?}", e); @@ -1322,7 +1323,7 @@ where }, None => self .channel_manager - .create_inbound_payment(None, expiry_secs, Some(min_final_cltv_expiry_delta)) + .create_inbound_payment(None, expiry_secs, Some(min_final_cltv_expiry_delta), None) .map_err(|e| { log_error!(self.logger, "Failed to register inbound payment: {:?}", e); Error::InvoiceCreationFailed diff --git a/src/payment/bolt11.rs b/src/payment/bolt11.rs index 18c489e27a..9ccecb272b 100644 --- a/src/payment/bolt11.rs +++ b/src/payment/bolt11.rs @@ -121,7 +121,7 @@ impl Bolt11Payment { // will know the preimage at this point. let res = self .channel_manager - .get_payment_preimage(payment_hash, payment_secret.clone()) + .get_payment_preimage(payment_hash, payment_secret.clone(), None) .ok(); debug_assert!(res.is_some(), "We just let ChannelManager create an inbound payment, it can't have forgotten the preimage by now."); res @@ -206,8 +206,10 @@ impl Bolt11Payment { max_proportional_opening_fee_ppm_msat: lsp_prop_opening_fee, }; let id = PaymentId(payment_hash.0); - let preimage = - self.channel_manager.get_payment_preimage(payment_hash, payment_secret.clone()).ok(); + let preimage = self + .channel_manager + .get_payment_preimage(payment_hash, payment_secret.clone(), None) + .ok(); let kind = PaymentKind::Bolt11Jit { hash: payment_hash, preimage, From 5e33d8d17b516c753063a73dec3b5c2a5ea53381 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Thu, 21 May 2026 19:06:58 -0500 Subject: [PATCH 8/8] Adopt LDK's ConfirmedUtxo in splice coin selection 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 --- Cargo.toml | 28 ++++++++++++++-------------- src/wallet/mod.rs | 5 ++--- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 268e2be41f..b68a93f200 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,18 +40,18 @@ default = [] #lightning-macros = { version = "0.2.0" } #lightning-dns-resolver = { version = "0.3.0" } -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] } -lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } -lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] } -lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } -lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["tokio"] } -lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } -lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } -lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["rest-client", "rpc-client", "tokio"] } -lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } -lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std"] } -lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } -lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90" } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std"] } +lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" } +lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std"] } +lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" } +lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["tokio"] } +lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" } +lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" } +lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["rest-client", "rpc-client", "tokio"] } +lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["esplora-async-https", "time", "electrum-rustls-ring"] } +lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std"] } +lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" } +lightning-dns-resolver = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a" } bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] } bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]} @@ -81,13 +81,13 @@ async-trait = { version = "0.1", default-features = false } vss-client = { package = "vss-client-ng", version = "0.5" } prost = { version = "0.11.6", default-features = false} #bitcoin-payment-instructions = { version = "0.6" } -bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "beeb5d530fc14bb1fc0564dc39ecf57c4a92a53d" } +bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "c7d7ea849fcbe8cad385c93f8057cd68ecb994b7" } [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["winbase"] } [dev-dependencies] -lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1ab220bfa84c8d2a6198fc5ae305aad82811fc90", features = ["std", "_test_utils"] } +lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "10608650d455f4d535cbac73921be329d814854a", features = ["std", "_test_utils"] } rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] } proptest = "1.0.0" regex = "1.5.6" diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index 7ea2d04cc9..13b1f384f5 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -37,7 +37,6 @@ use lightning::chain::chaininterface::{ use lightning::chain::channelmonitor::ANTI_REORG_DELAY; use lightning::chain::{BlockLocator, ClaimId, Listen}; use lightning::ln::channelmanager::PaymentId; -use lightning::ln::funding::FundingTxInput; use lightning::ln::inbound_payment::ExpandedKey; use lightning::ln::msgs::UnsignedGossipMessage; use lightning::ln::script::ShutdownScript; @@ -47,7 +46,7 @@ use lightning::sign::{ }; use lightning::util::message_signing; use lightning::util::wallet_utils::{ - CoinSelection, CoinSelectionSource, Input, Utxo, WalletSource, + CoinSelection, CoinSelectionSource, ConfirmedUtxo, Input, Utxo, WalletSource, }; use lightning_invoice::RawBolt11Invoice; use persist::KVStoreWalletPersister; @@ -942,7 +941,7 @@ impl Wallet { locked_wallet .tx_details(txin.previous_output.txid) .map(|tx_details| tx_details.tx.deref().clone()) - .map(|prevtx| FundingTxInput::new_p2wpkh(prevtx, txin.previous_output.vout)) + .map(|prevtx| ConfirmedUtxo::new_p2wpkh(prevtx, txin.previous_output.vout)) }) .collect::, ()>>()?;