Skip to content

Commit 585655f

Browse files
authored
Merge pull request #743 from tnull/2026-01-bump-ldk-main
Bump the LDK dependency to current `main`
2 parents 0c81333 + dd55d47 commit 585655f

File tree

9 files changed

+25
-81
lines changed

9 files changed

+25
-81
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 = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["std"] }
43-
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc" }
44-
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["std"] }
45-
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc" }
46-
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["tokio"] }
47-
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc" }
48-
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc" }
49-
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["rest-client", "rpc-client", "tokio"] }
50-
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
51-
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["std"] }
52-
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc" }
42+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["std"] }
43+
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0" }
44+
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["std"] }
45+
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0" }
46+
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["tokio"] }
47+
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0" }
48+
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0" }
49+
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["rest-client", "rpc-client", "tokio"] }
50+
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
51+
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["std"] }
52+
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0" }
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"]}
@@ -78,13 +78,13 @@ log = { version = "0.4.22", default-features = false, features = ["std"]}
7878
vss-client = { package = "vss-client-ng", version = "0.4" }
7979
prost = { version = "0.11.6", default-features = false}
8080
#bitcoin-payment-instructions = { version = "0.6" }
81-
bitcoin-payment-instructions = { git = "https://github.com/tnull/bitcoin-payment-instructions", branch = "2025-12-ldk-node-base" }
81+
bitcoin-payment-instructions = { git = "https://github.com/tnull/bitcoin-payment-instructions", rev = "a9ad849a0eb7b155a688d713de6d9010cb48f073" }
8282

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

8686
[dev-dependencies]
87-
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "5bf0d1e2427d759fc1ba4108ddc7e9b32e8bacfc", features = ["std", "_test_utils"] }
87+
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "1c730c8a16e28cc8e0c4817717ee63c97abcf4b0", features = ["std", "_test_utils"] }
8888
proptest = "1.0.0"
8989
regex = "1.5.6"
9090
criterion = { version = "0.7.0", features = ["async_tokio"] }

bindings/ldk_node.udl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ dictionary NodeStatus {
359359
u64? latest_rgs_snapshot_timestamp;
360360
u64? latest_pathfinding_scores_sync_timestamp;
361361
u64? latest_node_announcement_broadcast_timestamp;
362-
u32? latest_channel_monitor_archival_height;
363362
};
364363

365364
dictionary BestBlock {

src/chain/bitcoind.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use lightning_block_sync::{
2929
};
3030
use serde::Serialize;
3131

32-
use super::{periodically_archive_fully_resolved_monitors, WalletSyncStatus};
32+
use super::WalletSyncStatus;
3333
use crate::config::{
3434
BitcoindRestClientConfig, Config, FEE_RATE_CACHE_UPDATE_TIMEOUT_SECS, TX_BROADCAST_TIMEOUT_SECS,
3535
};
@@ -414,14 +414,6 @@ impl BitcoindChainSource {
414414
now.elapsed().unwrap().as_millis()
415415
);
416416
*self.latest_chain_tip.write().unwrap() = Some(tip);
417-
418-
periodically_archive_fully_resolved_monitors(
419-
&*channel_manager,
420-
&*chain_monitor,
421-
&*self.kv_store,
422-
&*self.logger,
423-
&*self.node_metrics,
424-
)?;
425417
},
426418
Ok(_) => {},
427419
Err(e) => {

src/chain/electrum.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use lightning::chain::{Confirm, Filter, WatchedOutput};
2323
use lightning::util::ser::Writeable;
2424
use lightning_transaction_sync::ElectrumSyncClient;
2525

26-
use super::{periodically_archive_fully_resolved_monitors, WalletSyncStatus};
26+
use super::WalletSyncStatus;
2727
use crate::config::{
2828
Config, ElectrumSyncConfig, BDK_CLIENT_STOP_GAP, BDK_WALLET_SYNC_TIMEOUT_SECS,
2929
FEE_RATE_CACHE_UPDATE_TIMEOUT_SECS, LDK_WALLET_SYNC_TIMEOUT_SECS, TX_BROADCAST_TIMEOUT_SECS,
@@ -241,14 +241,6 @@ impl ElectrumChainSource {
241241
locked_node_metrics.latest_lightning_wallet_sync_timestamp = unix_time_secs_opt;
242242
write_node_metrics(&*locked_node_metrics, &*self.kv_store, &*self.logger)?;
243243
}
244-
245-
periodically_archive_fully_resolved_monitors(
246-
&*channel_manager,
247-
&*chain_monitor,
248-
&*self.kv_store,
249-
&*self.logger,
250-
&*self.node_metrics,
251-
)?;
252244
}
253245

254246
res

src/chain/esplora.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use lightning::chain::{Confirm, Filter, WatchedOutput};
1616
use lightning::util::ser::Writeable;
1717
use lightning_transaction_sync::EsploraSyncClient;
1818

19-
use super::{periodically_archive_fully_resolved_monitors, WalletSyncStatus};
19+
use super::WalletSyncStatus;
2020
use crate::config::{
2121
Config, EsploraSyncConfig, BDK_CLIENT_CONCURRENCY, BDK_CLIENT_STOP_GAP,
2222
BDK_WALLET_SYNC_TIMEOUT_SECS, DEFAULT_ESPLORA_CLIENT_TIMEOUT_SECS,
@@ -261,14 +261,6 @@ impl EsploraChainSource {
261261
unix_time_secs_opt;
262262
write_node_metrics(&*locked_node_metrics, &*self.kv_store, &*self.logger)?;
263263
}
264-
265-
periodically_archive_fully_resolved_monitors(
266-
&*channel_manager,
267-
&*chain_monitor,
268-
&*self.kv_store,
269-
&*self.logger,
270-
&*self.node_metrics,
271-
)?;
272264
Ok(())
273265
},
274266
Err(e) => {

src/chain/mod.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ use crate::chain::electrum::ElectrumChainSource;
2121
use crate::chain::esplora::EsploraChainSource;
2222
use crate::config::{
2323
BackgroundSyncConfig, BitcoindRestClientConfig, Config, ElectrumSyncConfig, EsploraSyncConfig,
24-
RESOLVED_CHANNEL_MONITOR_ARCHIVAL_INTERVAL, WALLET_SYNC_INTERVAL_MINIMUM_SECS,
24+
WALLET_SYNC_INTERVAL_MINIMUM_SECS,
2525
};
2626
use crate::fee_estimator::OnchainFeeEstimator;
27-
use crate::io::utils::write_node_metrics;
2827
use crate::logger::{log_debug, log_info, log_trace, LdkLogger, Logger};
2928
use crate::runtime::Runtime;
3029
use crate::types::{Broadcaster, ChainMonitor, ChannelManager, DynStore, Sweeper, Wallet};
@@ -486,22 +485,3 @@ impl Filter for ChainSource {
486485
}
487486
}
488487
}
489-
490-
fn periodically_archive_fully_resolved_monitors(
491-
channel_manager: &ChannelManager, chain_monitor: &ChainMonitor, kv_store: &DynStore,
492-
logger: &Logger, node_metrics: &RwLock<NodeMetrics>,
493-
) -> Result<(), Error> {
494-
let mut locked_node_metrics = node_metrics.write().unwrap();
495-
let cur_height = channel_manager.current_best_block().height;
496-
let should_archive = locked_node_metrics
497-
.latest_channel_monitor_archival_height
498-
.as_ref()
499-
.map_or(true, |h| cur_height >= h + RESOLVED_CHANNEL_MONITOR_ARCHIVAL_INTERVAL);
500-
501-
if should_archive {
502-
chain_monitor.archive_fully_resolved_channel_monitors();
503-
locked_node_metrics.latest_channel_monitor_archival_height = Some(cur_height);
504-
write_node_metrics(&*locked_node_metrics, kv_store, logger)?;
505-
}
506-
Ok(())
507-
}

src/config.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ pub(crate) const BDK_CLIENT_CONCURRENCY: usize = 4;
5454
// The timeout after which we abandon retrying failed payments.
5555
pub(crate) const LDK_PAYMENT_RETRY_TIMEOUT: Duration = Duration::from_secs(10);
5656

57-
// The interval (in block height) after which we retry archiving fully resolved channel monitors.
58-
pub(crate) const RESOLVED_CHANNEL_MONITOR_ARCHIVAL_INTERVAL: u32 = 6;
59-
6057
// The time in-between peer reconnection attempts.
6158
pub(crate) const PEER_RECONNECTION_INTERVAL: Duration = Duration::from_secs(60);
6259

src/io/test_utils.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ use std::sync::Mutex;
1313

1414
use lightning::events::ClosureReason;
1515
use lightning::ln::functional_test_utils::{
16-
check_closed_event, connect_block, create_announced_chan_between_nodes, create_chanmon_cfgs,
17-
create_dummy_block, create_network, create_node_cfgs, create_node_chanmgrs, send_payment,
18-
TestChanMonCfg,
16+
check_added_monitors, check_closed_event, connect_block, create_announced_chan_between_nodes,
17+
create_chanmon_cfgs, create_dummy_block, create_network, create_node_cfgs,
18+
create_node_chanmgrs, send_payment, TestChanMonCfg,
1919
};
2020
use lightning::util::persist::{
2121
KVStore, KVStoreSync, MonitorUpdatingPersister, KVSTORE_NAMESPACE_KEY_MAX_LEN,
2222
};
2323
use lightning::util::test_utils;
24-
use lightning::{check_added_monitors, check_closed_broadcast, io};
24+
use lightning::{check_closed_broadcast, io};
2525
use rand::distr::Alphanumeric;
2626
use rand::{rng, Rng};
2727

@@ -333,7 +333,7 @@ pub(crate) fn do_test_store<K: KVStoreSync + Sync>(store_0: &K, store_1: &K) {
333333
100000,
334334
);
335335
check_closed_broadcast!(nodes[0], true);
336-
check_added_monitors!(nodes[0], 1);
336+
check_added_monitors(&nodes[0], 1);
337337

338338
let node_txn = nodes[0].tx_broadcaster.txn_broadcast();
339339
assert_eq!(node_txn.len(), 1);
@@ -345,7 +345,7 @@ pub(crate) fn do_test_store<K: KVStoreSync + Sync>(store_0: &K, store_1: &K) {
345345
let reason = ClosureReason::CommitmentTxConfirmed;
346346
let node_id_0 = nodes[0].node.get_our_node_id();
347347
check_closed_event(&nodes[1], 1, reason, &[node_id_0], 100000);
348-
check_added_monitors!(nodes[1], 1);
348+
check_added_monitors(&nodes[1], 1);
349349

350350
// Make sure everything is persisted as expected after close.
351351
check_persisted_data!(persister_0_max_pending_updates * 2 * EXPECTED_UPDATES_PER_PAYMENT + 1);

src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,6 @@ impl Node {
728728
locked_node_metrics.latest_pathfinding_scores_sync_timestamp;
729729
let latest_node_announcement_broadcast_timestamp =
730730
locked_node_metrics.latest_node_announcement_broadcast_timestamp;
731-
let latest_channel_monitor_archival_height =
732-
locked_node_metrics.latest_channel_monitor_archival_height;
733731

734732
NodeStatus {
735733
is_running,
@@ -740,7 +738,6 @@ impl Node {
740738
latest_rgs_snapshot_timestamp,
741739
latest_pathfinding_scores_sync_timestamp,
742740
latest_node_announcement_broadcast_timestamp,
743-
latest_channel_monitor_archival_height,
744741
}
745742
}
746743

@@ -1806,10 +1803,6 @@ pub struct NodeStatus {
18061803
///
18071804
/// Will be `None` if we have no public channels or we haven't broadcasted yet.
18081805
pub latest_node_announcement_broadcast_timestamp: Option<u64>,
1809-
/// The block height when we last archived closed channel monitor data.
1810-
///
1811-
/// Will be `None` if we haven't archived any monitors of closed channels yet.
1812-
pub latest_channel_monitor_archival_height: Option<u32>,
18131806
}
18141807

18151808
/// Status fields that are persisted across restarts.
@@ -1821,7 +1814,6 @@ pub(crate) struct NodeMetrics {
18211814
latest_rgs_snapshot_timestamp: Option<u32>,
18221815
latest_pathfinding_scores_sync_timestamp: Option<u64>,
18231816
latest_node_announcement_broadcast_timestamp: Option<u64>,
1824-
latest_channel_monitor_archival_height: Option<u32>,
18251817
}
18261818

18271819
impl Default for NodeMetrics {
@@ -1833,7 +1825,6 @@ impl Default for NodeMetrics {
18331825
latest_rgs_snapshot_timestamp: None,
18341826
latest_pathfinding_scores_sync_timestamp: None,
18351827
latest_node_announcement_broadcast_timestamp: None,
1836-
latest_channel_monitor_archival_height: None,
18371828
}
18381829
}
18391830
}
@@ -1845,7 +1836,8 @@ impl_writeable_tlv_based!(NodeMetrics, {
18451836
(4, latest_fee_rate_cache_update_timestamp, option),
18461837
(6, latest_rgs_snapshot_timestamp, option),
18471838
(8, latest_node_announcement_broadcast_timestamp, option),
1848-
(10, latest_channel_monitor_archival_height, option),
1839+
// 10 used to be latest_channel_monitor_archival_height
1840+
(10, _legacy_latest_channel_monitor_archival_height, (legacy, Option<u32>, |_: &NodeMetrics| None::<Option<u32>> )),
18491841
});
18501842

18511843
pub(crate) fn total_anchor_channels_reserve_sats(

0 commit comments

Comments
 (0)