diff --git a/lightning-liquidity/README.md b/lightning-liquidity/README.md index 163f4151341..d7f994a8a4e 100644 --- a/lightning-liquidity/README.md +++ b/lightning-liquidity/README.md @@ -14,11 +14,15 @@ inbound Lightning liquidity for which they are willing and able to pay in bitcoi on-boarding of clients as the channel opening fees are deducted from the incoming payment, i.e., no funds are required client-side to initiate this flow. +- [bLIP-55 / LSPS5] lets a client register HTTPS webhooks with its LSP so the LSP can send signed push + notifications (for example "payment incoming") that wake the app when it is offline, which is essential + for mobile wallets that get suspended in the background. -To get started, you'll want to setup a `LiquidityManager` and configure it to be the `CustomMessageHandler` of your LDK node. You can then call `LiquidityManager::lsps1_client_handler` / `LiquidityManager::lsps2_client_handler`, or `LiquidityManager::lsps2_service_handler`, to access the respective client-side or service-side handlers. +To get started, you'll want to setup a `LiquidityManager` and configure it to be the `CustomMessageHandler` of your LDK node. You can then call `LiquidityManager::lsps1_client_handler` / `LiquidityManager::lsps2_client_handler`, `LiquidityManager::lsps2_service_handler`, `LiquidityManager::lsps5_service_handler` or `LiquidityManager::lsps5_client_handler` to access the respective client-side or service-side handlers. `LiquidityManager` uses an eventing system to notify the user about important updates to the protocol flow. To this end, you will need to handle events emitted via one of the event handling methods provided by `LiquidityManager`, e.g., `LiquidityManager::next_event`. [bLIP-50 / LSPS0]: https://github.com/lightning/blips/blob/master/blip-0050.md [bLIP-51 / LSPS1]: https://github.com/lightning/blips/blob/master/blip-0051.md [bLIP-52 / LSPS2]: https://github.com/lightning/blips/blob/master/blip-0052.md +[bLIP-55 / LSPS5]: https://github.com/lightning/blips/blob/master/blip-0055.md diff --git a/lightning-liquidity/src/lsps2/client.rs b/lightning-liquidity/src/lsps2/client.rs index 5b7e0902e31..bbe313d6089 100644 --- a/lightning-liquidity/src/lsps2/client.rs +++ b/lightning-liquidity/src/lsps2/client.rs @@ -206,7 +206,7 @@ where "Received get_info response for an unknown request: {:?}", request_id ), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), }); } @@ -222,7 +222,7 @@ where "Received get_info response from unknown peer: {:?}", counterparty_node_id ), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), }) }, } @@ -246,7 +246,7 @@ where "Received get_info error for an unknown request: {:?}", request_id ), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), }); } @@ -267,7 +267,7 @@ where Err(lightning_error) }, None => { - return Err(LightningError { err: format!("Received error response for a get_info request from an unknown counterparty ({:?})",counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received error response for a get_info request from an unknown counterparty ({:?})",counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } } @@ -289,7 +289,7 @@ where "Received buy response for an unknown request: {:?}", request_id ), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), })?; if let Ok(intercept_scid) = result.jit_channel_scid.to_scid() { @@ -316,7 +316,7 @@ where "Received buy response from unknown peer: {:?}", counterparty_node_id ), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), }); }, } @@ -335,7 +335,7 @@ where peer_state.pending_buy_requests.remove(&request_id).ok_or(LightningError { err: format!("Received buy error for an unknown request: {:?}", request_id), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), })?; let lightning_error = LightningError { @@ -355,7 +355,7 @@ where Err(lightning_error) }, None => { - return Err(LightningError { err: format!("Received error response for a buy request from an unknown counterparty ({:?})", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received error response for a buy request from an unknown counterparty ({:?})", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } } diff --git a/lightning-liquidity/src/lsps5/client.rs b/lightning-liquidity/src/lsps5/client.rs index 54780214c0c..50b2c85ce1d 100644 --- a/lightning-liquidity/src/lsps5/client.rs +++ b/lightning-liquidity/src/lsps5/client.rs @@ -316,14 +316,14 @@ where "Received unexpected request message from {}", counterparty_node_id ), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), }); }, LSPS5Message::Response(rid, resp) => (rid, resp), }; let mut result: Result<(), LightningError> = Err(LightningError { err: format!("Received LSPS5 response from unknown peer: {}", counterparty_node_id), - action: ErrorAction::IgnoreAndLog(Level::Error), + action: ErrorAction::IgnoreAndLog(Level::Debug), }); let event_queue_notifier = self.pending_events.notifier(); let handle_response = |peer_state: &mut PeerState| { @@ -409,7 +409,7 @@ where } else { result = Err(LightningError { err: format!("Received response for unknown request ID: {}", request_id.0), - action: ErrorAction::IgnoreAndLog(Level::Info), + action: ErrorAction::IgnoreAndLog(Level::Debug), }); } }; diff --git a/lightning-liquidity/src/manager.rs b/lightning-liquidity/src/manager.rs index f36a067a004..6d412bd966a 100644 --- a/lightning-liquidity/src/manager.rs +++ b/lightning-liquidity/src/manager.rs @@ -500,7 +500,7 @@ where lsps0_service_handler.handle_message(msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS0 request message without LSPS0 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS0 request message without LSPS0 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } }, @@ -510,7 +510,7 @@ where lsps1_client_handler.handle_message(msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS1 response message without LSPS1 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS1 response message without LSPS1 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } }, @@ -521,11 +521,11 @@ where lsps1_service_handler.handle_message(_msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } #[cfg(not(lsps1_service))] - return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, LSPSMessage::LSPS2(msg @ LSPS2Message::Response(..)) => { match &self.lsps2_client_handler { @@ -533,7 +533,7 @@ where lsps2_client_handler.handle_message(msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS2 response message without LSPS2 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS2 response message without LSPS2 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } }, @@ -543,7 +543,7 @@ where lsps2_service_handler.handle_message(msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS2 request message without LSPS2 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS2 request message without LSPS2 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } }, @@ -553,7 +553,7 @@ where lsps5_client_handler.handle_message(msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS5 response message without LSPS5 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS5 response message without LSPS5 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } }, @@ -563,7 +563,7 @@ where lsps5_service_handler.handle_message(msg, sender_node_id)?; }, None => { - return Err(LightningError { err: format!("Received LSPS5 request message without LSPS5 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)}); + return Err(LightningError { err: format!("Received LSPS5 request message without LSPS5 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)}); }, } },