Skip to content

Commit f101d37

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 f101d37

File tree

3 files changed

+38
-20
lines changed

3 files changed

+38
-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/ffi/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use bip39::Mnemonic;
2121
use bitcoin::hashes::sha256::Hash as Sha256;
2222
use bitcoin::hashes::Hash;
2323
use bitcoin::secp256k1::PublicKey;
24-
pub use bitcoin::{Address, BlockHash, FeeRate, Network, OutPoint, ScriptBuf, Txid};
24+
pub use bitcoin::{Address, BlockHash, Network, OutPoint, ScriptBuf, Txid};
2525
pub use lightning::chain::channelmonitor::BalanceSource;
2626
use lightning::events::PaidBolt12Invoice as LdkPaidBolt12Invoice;
2727
pub use lightning::events::{ClosureReason, PaymentFailureReason};

src/lib.rs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance};
118118
pub use bip39;
119119
pub use bitcoin;
120120
use bitcoin::secp256k1::PublicKey;
121+
#[cfg(feature = "uniffi")]
122+
pub use bitcoin::FeeRate;
123+
#[cfg(not(feature = "uniffi"))]
124+
use bitcoin::FeeRate;
121125
use bitcoin::{Address, Amount};
122126
#[cfg(feature = "uniffi")]
123127
pub use builder::ArcedNodeBuilder as Builder;
@@ -1403,7 +1407,9 @@ impl Node {
14031407
if let Some(channel_details) =
14041408
open_channels.iter().find(|c| c.user_channel_id == user_channel_id.0)
14051409
{
1406-
let fee_rate = self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1410+
let min_feerate =
1411+
self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1412+
let max_feerate = FeeRate::from_sat_per_kwu(min_feerate.to_sat_per_kwu() * 3 / 2);
14071413

14081414
let splice_amount_sats = match splice_amount_sats {
14091415
FundingAmount::Exact { amount_sats } => amount_sats,
@@ -1437,7 +1443,7 @@ impl Node {
14371443
shared_input,
14381444
funding_output.script_pubkey.clone(),
14391445
cur_anchor_reserve_sats,
1440-
fee_rate,
1446+
min_feerate,
14411447
)
14421448
.map_err(|e| {
14431449
log_error!(
@@ -1451,7 +1457,7 @@ impl Node {
14511457
self.logger,
14521458
"Splicing in with all balance: {}sats (fee rate: {} sat/kw, anchor reserve: {}sats)",
14531459
amount,
1454-
fee_rate.to_sat_per_kwu(),
1460+
min_feerate.to_sat_per_kwu(),
14551461
cur_anchor_reserve_sats,
14561462
);
14571463

@@ -1463,7 +1469,12 @@ impl Node {
14631469

14641470
let funding_template = self
14651471
.channel_manager
1466-
.splice_channel(&channel_details.channel_id, &counterparty_node_id, fee_rate)
1472+
.splice_channel(
1473+
&channel_details.channel_id,
1474+
&counterparty_node_id,
1475+
min_feerate,
1476+
max_feerate,
1477+
)
14671478
.map_err(|e| {
14681479
log_error!(self.logger, "Failed to splice channel: {:?}", e);
14691480
Error::ChannelSplicingFailed
@@ -1568,11 +1579,18 @@ impl Node {
15681579

15691580
self.wallet.parse_and_validate_address(address)?;
15701581

1571-
let fee_rate = self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1582+
let min_feerate =
1583+
self.fee_estimator.estimate_fee_rate(ConfirmationTarget::ChannelFunding);
1584+
let max_feerate = FeeRate::from_sat_per_kwu(min_feerate.to_sat_per_kwu() * 3 / 2);
15721585

15731586
let funding_template = self
15741587
.channel_manager
1575-
.splice_channel(&channel_details.channel_id, &counterparty_node_id, fee_rate)
1588+
.splice_channel(
1589+
&channel_details.channel_id,
1590+
&counterparty_node_id,
1591+
min_feerate,
1592+
max_feerate,
1593+
)
15761594
.map_err(|e| {
15771595
log_error!(self.logger, "Failed to splice channel: {:?}", e);
15781596
Error::ChannelSplicingFailed

0 commit comments

Comments
 (0)