From e6b1375f78e6f571999fcb8871da9d1b698e583f Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Tue, 3 Nov 2026 16:46:21 +0100 Subject: [PATCH 1/3] plugins(lsps): fix wrong onion failure type Fixes the type for UNKNOWN_NEXT_PEER Changelog-Fixed: correct unknown next peer error type for the lsp service --- plugins/lsps-plugin/src/proto/lsps2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lsps-plugin/src/proto/lsps2.rs b/plugins/lsps-plugin/src/proto/lsps2.rs index 9ea04847845d..dd51ed6674db 100644 --- a/plugins/lsps-plugin/src/proto/lsps2.rs +++ b/plugins/lsps-plugin/src/proto/lsps2.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; pub mod failure_codes { pub const TEMPORARY_CHANNEL_FAILURE: &'static str = "1007"; - pub const UNKNOWN_NEXT_PEER: &'static str = "4010"; + pub const UNKNOWN_NEXT_PEER: &'static str = "400a"; } pub trait ShortChannelIdJITExt { From 35fd8d2d3f521b30529b07eafd91cf1b7ada3c29 Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Tue, 10 Nov 2026 16:33:52 +0100 Subject: [PATCH 2/3] plugins(lsps): add missing channel_update length to temporary_channel_failure temporary_channel_failure (UPDATE|7) carries a u16 len followed by a channel_update. We returned only the 2-byte type "1007", which is a truncated message the payer can't parse. Append an empty length field, matching towire_temporary_channel_failure(ctx, NULL). Changelog-Fixed: lsps2 service: temporary_channel_failure onion error is no longer truncated. --- plugins/lsps-plugin/src/proto/lsps2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/lsps-plugin/src/proto/lsps2.rs b/plugins/lsps-plugin/src/proto/lsps2.rs index dd51ed6674db..37db8106a5c7 100644 --- a/plugins/lsps-plugin/src/proto/lsps2.rs +++ b/plugins/lsps-plugin/src/proto/lsps2.rs @@ -6,7 +6,7 @@ use lsps_types::{ use serde::{Deserialize, Serialize}; pub mod failure_codes { - pub const TEMPORARY_CHANNEL_FAILURE: &'static str = "1007"; + pub const TEMPORARY_CHANNEL_FAILURE: &'static str = "10070000"; pub const UNKNOWN_NEXT_PEER: &'static str = "400a"; } From ed145c575ed0e64d6c3789cb05630ed1481e0d1a Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Mon, 16 Nov 2026 16:14:29 +0100 Subject: [PATCH 3/3] plugins(lsps): test the onion failure codes against BOLT 4 The service sends unknown_next_peer (PERM|10) and temporary_channel_failure (UPDATE|7 plus an empty channel_update length) as hex strings. Build the expected values from the BOLT 4 flags, so a wrong hex literal gets caught. Changelog-None --- plugins/lsps-plugin/src/proto/lsps2.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/lsps-plugin/src/proto/lsps2.rs b/plugins/lsps-plugin/src/proto/lsps2.rs index 37db8106a5c7..af3709aa949a 100644 --- a/plugins/lsps-plugin/src/proto/lsps2.rs +++ b/plugins/lsps-plugin/src/proto/lsps2.rs @@ -206,4 +206,19 @@ mod tests { let back: OpeningFeeParams = serde_json::from_str(&json).unwrap(); assert!(verify_promise(&back, SECRET)); } + + #[test] + fn failure_codes_match_bolt4() { + use failure_codes::*; + // Failure code flags (BOLT 4): PERM = 0x4000, NODE = 0x2000, + // UPDATE = 0x1000. + // unknown_next_peer is PERM|10. + assert_eq!(UNKNOWN_NEXT_PEER, format!("{:04x}", 0x4000 | 10)); + // temporary_channel_failure is UPDATE|7, followed by the u16 length + // of the channel_update, which we leave out (length 0). + assert_eq!( + TEMPORARY_CHANNEL_FAILURE, + format!("{:04x}{:04x}", 0x1000 | 7, 0) + ); + } }