Skip to content

Commit

Permalink
chore: Upgrade to rust-lightning 0.0.116 and bump rust-dlc
Browse files Browse the repository at this point in the history
Some notes:

- We've had to increase the payment amounts in the `multi_hop_payment`
and `just_in_time_channel_with_multiple_payments` tests, as otherwise
we would run into `route not found` errors. It's probably worth
investigating why this is the case.

- We have decided to eagerly send `rust-dlc` messages because: (1)
after the upgrade they were not being automatically sent as fast as
they used to and (2) we can speed up the protocols this way anyway.

Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
  • Loading branch information
luckysori and bonomat committed Nov 1, 2023
1 parent fc157e1 commit aa6fe70
Show file tree
Hide file tree
Showing 56 changed files with 939 additions and 673 deletions.
61 changes: 35 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@ resolver = "2"

[patch.crates-io]
# We should usually track the `p2pderivatives/feature/ln-dlc-channels[-10101]` branch
dlc-manager = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
dlc-messages = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
dlc = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
dlc-sled-storage-provider = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
p2pd-oracle-client = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
dlc-trie = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
simple-wallet = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "9815582" }
dlc-manager = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }
dlc-messages = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }
dlc = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }
dlc-sled-storage-provider = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }
p2pd-oracle-client = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }
dlc-trie = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }
simple-wallet = { git = "https://github.com/p2pderivatives/rust-dlc", rev = "d1e08a0" }

# We should usually track the `p2pderivatives/split-tx-experiment[-10101]` branch
# Temporary fix: this fork allows us to access the channel monitor's channel_key_ids
lightning = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "698be7fb" }
lightning-background-processor = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "698be7fb" }
lightning-transaction-sync = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "698be7fb" }
lightning-net-tokio = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "698be7fb" }
lightning-persister = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "698be7fb" }
lightning = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "a57281b" }
lightning-background-processor = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "a57281b" }
lightning-transaction-sync = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "a57281b" }
lightning-net-tokio = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "a57281b" }
lightning-persister = { git = "https://github.com/p2pderivatives/rust-lightning/", rev = "a57281b" }

rust-bitcoin-coin-selection = { git = "https://github.com/p2pderivatives/rust-bitcoin-coin-selection" }

Expand Down
8 changes: 4 additions & 4 deletions coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
atty = "0.2.14"
bitcoin = "0.29"
bitcoin = "0.29.2"
console-subscriber = "0.1.6"
diesel_migrations = "2.0.0"
dlc = "0.4.0"
Expand Down Expand Up @@ -44,7 +44,7 @@ version = "0.6.20"
features = ["ws", "query"]

[dependencies.bdk]
version = "0.27.0"
version = "0.28.0"
default-features = false
features = ["key-value-db", "use-esplora-blocking"]

Expand All @@ -64,11 +64,11 @@ version = "0.4.0"
features = ["use-serde"]

[dependencies.lightning]
version = "0.0.114"
version = "0.0.116"
features = ["max_level_trace"]

[dependencies.lightning-invoice]
version = "0.22"
version = "0.24"

[dependencies.ln-dlc-node]
path = "../crates/ln-dlc-node"
Expand Down
6 changes: 3 additions & 3 deletions coordinator/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use bdk::TransactionDetails;
use bitcoin::secp256k1::PublicKey;
use coordinator_commons::CollaborativeRevert;
use dlc_manager::subchannel::SubChannel;
use lightning_invoice::Invoice;
use lightning_invoice::Bolt11Invoice;
use ln_dlc_node::node::NodeInfo;
use serde::de;
use serde::Deserialize;
Expand Down Expand Up @@ -172,7 +172,7 @@ pub async fn collaborative_revert(
.map_err(move |error| {
tracing::error!(
channel_id = channel_id_string,
"Could not collaborativel revert channel. {error:#}"
"Could not collaboratively revert channel: {error:#}"
);
AppError::InternalServerError("Could not collaboratively revert channel".to_string())
})?;
Expand Down Expand Up @@ -272,7 +272,7 @@ pub async fn send_payment(
Path(invoice): Path<String>,
State(state): State<Arc<AppState>>,
) -> Result<(), AppError> {
let invoice = Invoice::from_str(invoice.as_str())
let invoice = Bolt11Invoice::from_str(invoice.as_str())
.context("Could not parse Invoice string")
.map_err(|e| AppError::BadRequest(format!("{e:#}")))?;
state
Expand Down
4 changes: 2 additions & 2 deletions coordinator/src/bin/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use coordinator::settings::Settings;
use diesel::r2d2;
use diesel::r2d2::ConnectionManager;
use diesel::PgConnection;
use lightning::util::events::Event;
use lightning::events::Event;
use ln_dlc_node::scorer;
use ln_dlc_node::seed::Bip39Seed;
use ln_dlc_node::CoordinatorEventHandler;
Expand Down Expand Up @@ -121,7 +121,7 @@ async fn main() -> Result<()> {
)?);

let event_handler = CoordinatorEventHandler::new(node.clone(), Some(node_event_sender));
let running = node.start(event_handler)?;
let running = node.start(event_handler, false)?;
let node = Node::new(node, running, pool.clone(), settings.to_node_settings());

// TODO: Pass the tokio metrics into Prometheus
Expand Down
Loading

0 comments on commit aa6fe70

Please sign in to comment.