Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ default = []
#lightning-liquidity = { version = "0.2.0", features = ["std"] }
#lightning-macros = { version = "0.2.0" }

lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["tokio"] }
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["rest-client", "rpc-client", "tokio"] }
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std"] }
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245" }
lightning = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", features = ["std"] }
lightning-types = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-invoice = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", features = ["std"] }
lightning-net-tokio = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-persister = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", features = ["tokio"] }
lightning-background-processor = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-rapid-gossip-sync = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-block-sync = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", features = ["rest-client", "rpc-client", "tokio"] }
lightning-transaction-sync = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
lightning-liquidity = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", features = ["std"] }
lightning-macros = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }

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"]}
Expand Down Expand Up @@ -84,7 +84,7 @@ bitcoin-payment-instructions = { git = "https://github.com/jkczyz/bitcoin-paymen
winapi = { version = "0.3", features = ["winbase"] }

[dev-dependencies]
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "98501d6e5134228c41460dcf786ab53337e41245", features = ["std", "_test_utils"] }
lightning = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor", 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"
Expand Down Expand Up @@ -170,15 +170,16 @@ harness = false
#vss-client-ng = { path = "../vss-client" }
#vss-client-ng = { git = "https://github.com/lightningdevkit/vss-client", branch = "main" }
#
#[patch."https://github.com/lightningdevkit/rust-lightning"]
#lightning = { path = "../rust-lightning/lightning" }
#lightning-types = { path = "../rust-lightning/lightning-types" }
#lightning-invoice = { path = "../rust-lightning/lightning-invoice" }
#lightning-net-tokio = { path = "../rust-lightning/lightning-net-tokio" }
#lightning-persister = { path = "../rust-lightning/lightning-persister" }
#lightning-background-processor = { path = "../rust-lightning/lightning-background-processor" }
#lightning-rapid-gossip-sync = { path = "../rust-lightning/lightning-rapid-gossip-sync" }
#lightning-block-sync = { path = "../rust-lightning/lightning-block-sync" }
#lightning-transaction-sync = { path = "../rust-lightning/lightning-transaction-sync" }
#lightning-liquidity = { path = "../rust-lightning/lightning-liquidity" }
#lightning-macros = { path = "../rust-lightning/lightning-macros" }
[patch."https://github.com/lightningdevkit/rust-lightning"]
lightning = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-types = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-invoice = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-net-tokio = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-persister = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-background-processor = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-rapid-gossip-sync = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-block-sync = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-transaction-sync = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-liquidity = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
lightning-macros = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
possiblyrandom = { git = "https://github.com/tnull/rust-lightning", branch = "2025-11-lsps1-refactor" }
24 changes: 19 additions & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ use crate::gossip::GossipSource;
use crate::io::sqlite_store::SqliteStore;
use crate::io::utils::{
read_event_queue, read_external_pathfinding_scores_from_cache, read_network_graph,
read_node_metrics, read_output_sweeper, read_payments, read_peer_info, read_pending_payments,
read_scorer, write_node_metrics,
read_node_metrics, read_output_sweeper, read_payment_metadata, read_payments, read_peer_info,
read_pending_payments, read_scorer, write_node_metrics,
};
use crate::io::vss_store::VssStoreBuilder;
use crate::io::{
Expand All @@ -71,6 +71,7 @@ use crate::liquidity::{
use crate::logger::{log_error, LdkLogger, LogLevel, LogWriter, Logger};
use crate::message_handler::NodeCustomMessageHandler;
use crate::payment::asynchronous::om_mailbox::OnionMessageMailbox;
use crate::payment::metadata_store::PaymentMetadataStore;
use crate::peer_store::PeerStore;
use crate::runtime::{Runtime, RuntimeSpawner};
use crate::tx_broadcaster::TransactionBroadcaster;
Expand Down Expand Up @@ -1083,12 +1084,13 @@ fn build_with_store_internal(

let kv_store_ref = Arc::clone(&kv_store);
let logger_ref = Arc::clone(&logger);
let (payment_store_res, node_metris_res, pending_payment_store_res) =
let (payment_store_res, node_metris_res, pending_payment_store_res, payment_metadata_res) =
runtime.block_on(async move {
tokio::join!(
read_payments(&*kv_store_ref, Arc::clone(&logger_ref)),
read_node_metrics(&*kv_store_ref, Arc::clone(&logger_ref)),
read_pending_payments(&*kv_store_ref, Arc::clone(&logger_ref))
read_pending_payments(&*kv_store_ref, Arc::clone(&logger_ref)),
read_payment_metadata(&*kv_store_ref, Arc::clone(&logger_ref))
)
});

Expand Down Expand Up @@ -1119,6 +1121,18 @@ fn build_with_store_internal(
},
};

let payment_metadata_store = match payment_metadata_res {
Ok(metadata_entries) => Arc::new(PaymentMetadataStore::new(
metadata_entries,
Arc::clone(&kv_store),
Arc::clone(&logger),
)),
Err(e) => {
log_error!(logger, "Failed to read payment metadata from store: {}", e);
return Err(BuildError::ReadFailed);
},
};

let (chain_source, chain_tip_opt) = match chain_data_source_config {
Some(ChainDataSourceConfig::Esplora { server_url, headers, sync_config }) => {
let sync_config = sync_config.unwrap_or(EsploraSyncConfig::default());
Expand Down Expand Up @@ -1619,7 +1633,6 @@ fn build_with_store_internal(
Arc::clone(&wallet),
Arc::clone(&channel_manager),
Arc::clone(&keys_manager),
Arc::clone(&chain_source),
Arc::clone(&tx_broadcaster),
Arc::clone(&kv_store),
Arc::clone(&config),
Expand Down Expand Up @@ -1810,6 +1823,7 @@ fn build_with_store_internal(
scorer,
peer_store,
payment_store,
payment_metadata_store,
is_running,
node_metrics,
om_mailbox,
Expand Down
Loading
Loading