Skip to content

Commit bace666

Browse files
committed
Bump LDK dependency for splice acceptor contribution
In the event of a quiescence tie-breaker, the losing side may contribute as the splice acceptor. A min and max feerate allows us to determine whether to contribute. We use 150% of the min feerate for the max feerate to allow for RBFs in upcoming changes.
1 parent b0e159a commit bace666

File tree

2 files changed

+34
-20
lines changed

2 files changed

+34
-20
lines changed

Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ default = []
3939
#lightning-liquidity = { version = "0.2.0", features = ["std"] }
4040
#lightning-macros = { version = "0.2.0" }
4141

42-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
43-
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
44-
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
45-
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
46-
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["tokio"] }
47-
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
48-
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
49-
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["rest-client", "rpc-client", "tokio"] }
50-
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
51-
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
52-
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
42+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std"] }
43+
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
44+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std"] }
45+
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
46+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["tokio"] }
47+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
48+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
49+
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["rest-client", "rpc-client", "tokio"] }
50+
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
51+
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std"] }
52+
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204" }
5353

5454
bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] }
5555
bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]}
@@ -79,13 +79,13 @@ async-trait = { version = "0.1", default-features = false }
7979
vss-client = { package = "vss-client-ng", version = "0.5" }
8080
prost = { version = "0.11.6", default-features = false}
8181
#bitcoin-payment-instructions = { version = "0.6" }
82-
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "869fd348c3ca0c78f439d2f31181f4d798c6b20e" }
82+
bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-payment-instructions", rev = "0138feb7acefb1e49102a6fb46d7b776bf43265e" }
8383

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

8787
[dev-dependencies]
88-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std", "_test_utils"] }
88+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98393b3de3d8aec897e9ab783cb2418da504e204", features = ["std", "_test_utils"] }
8989
rand = { version = "0.9.2", default-features = false, features = ["std", "thread_rng", "os_rng"] }
9090
proptest = "1.0.0"
9191
regex = "1.5.6"

src/lib.rs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance};
118118
pub use bip39;
119119
pub use bitcoin;
120120
use bitcoin::secp256k1::PublicKey;
121-
use bitcoin::{Address, Amount};
121+
use bitcoin::{Address, Amount, FeeRate};
122122
#[cfg(feature = "uniffi")]
123123
pub use builder::ArcedNodeBuilder as Builder;
124124
pub use builder::BuildError;
@@ -1403,7 +1403,9 @@ impl Node {
14031403
if let Some(channel_details) =
14041404
open_channels.iter().find(|c| c.user_channel_id == user_channel_id.0)
14051405
{
1406-
let fee_rate = self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1406+
let min_feerate =
1407+
self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1408+
let max_feerate = FeeRate::from_sat_per_kwu(min_feerate.to_sat_per_kwu() * 3 / 2);
14071409

14081410
let splice_amount_sats = match splice_amount_sats {
14091411
FundingAmount::Exact { amount_sats } => amount_sats,
@@ -1437,7 +1439,7 @@ impl Node {
14371439
shared_input,
14381440
funding_output.script_pubkey.clone(),
14391441
cur_anchor_reserve_sats,
1440-
fee_rate,
1442+
min_feerate,
14411443
)
14421444
.map_err(|e| {
14431445
log_error!(
@@ -1451,7 +1453,7 @@ impl Node {
14511453
self.logger,
14521454
"Splicing in with all balance: {}sats (fee rate: {} sat/kw, anchor reserve: {}sats)",
14531455
amount,
1454-
fee_rate.to_sat_per_kwu(),
1456+
min_feerate.to_sat_per_kwu(),
14551457
cur_anchor_reserve_sats,
14561458
);
14571459

@@ -1463,7 +1465,12 @@ impl Node {
14631465

14641466
let funding_template = self
14651467
.channel_manager
1466-
.splice_channel(&channel_details.channel_id, &counterparty_node_id, fee_rate)
1468+
.splice_channel(
1469+
&channel_details.channel_id,
1470+
&counterparty_node_id,
1471+
min_feerate,
1472+
max_feerate,
1473+
)
14671474
.map_err(|e| {
14681475
log_error!(self.logger, "Failed to splice channel: {:?}", e);
14691476
Error::ChannelSplicingFailed
@@ -1568,11 +1575,18 @@ impl Node {
15681575

15691576
self.wallet.parse_and_validate_address(address)?;
15701577

1571-
let fee_rate = self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1578+
let min_feerate =
1579+
self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1580+
let max_feerate = FeeRate::from_sat_per_kwu(min_feerate.to_sat_per_kwu() * 3 / 2);
15721581

15731582
let funding_template = self
15741583
.channel_manager
1575-
.splice_channel(&channel_details.channel_id, &counterparty_node_id, fee_rate)
1584+
.splice_channel(
1585+
&channel_details.channel_id,
1586+
&counterparty_node_id,
1587+
min_feerate,
1588+
max_feerate,
1589+
)
15761590
.map_err(|e| {
15771591
log_error!(self.logger, "Failed to splice channel: {:?}", e);
15781592
Error::ChannelSplicingFailed

0 commit comments

Comments
 (0)