Skip to content

plugins(lsps): fix wrong onion failure type - #9690

Open
nepet wants to merge 3 commits into
ElementsProject:masterfrom
nepet:plugins/lsps2/fix-wrong-unknown-next-peer
Open

nepet wants to merge 3 commits into
ElementsProject:masterfrom
nepet:plugins/lsps2/fix-wrong-unknown-next-peer

Conversation

@nepet

@nepet nepet commented Nov 3, 2026

Copy link
Copy Markdown
Member

Fixes the type for UNKNOWN_NEXT_PEER

Changelog-Fixed: correct unknown next peer error type for the lsp service

Important

26.09 FREEZE August 5th: Non-bugfix PRs not ready by this date will wait for 26.12.

RC1 is scheduled on August 17th

The final release is scheduled for September 7th.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade

Fixes a wrong onion failure type on the lsp-service

Comment thread plugins/lsps-plugin/src/proto/lsps2.rs Resolved
@nepet
nepet requested a review from Andezion November 10, 2026 15:44
@nepet
nepet force-pushed the plugins/lsps2/fix-wrong-unknown-next-peer branch from 9156187 to edec3d3 Compare November 10, 2026 15:44
Andezion
Andezion previously approved these changes Nov 13, 2026

@Andezion Andezion left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to add a test?

#[test]
fn failure_codes_match_bolt4() {
    assert_eq!(UNKNOWN_NEXT_PEER, format!("{:04x}", 0x4000 | 10));
    assert_eq!(TEMPORARY_CHANNEL_FAILURE, format!("{:04x}{:04x}", 0x1000 | 7, 0));
}

@nepet
nepet force-pushed the plugins/lsps2/fix-wrong-unknown-next-peer branch from c6e1f89 to d453428 Compare November 16, 2026 16:40
@nepet
nepet requested a review from Andezion November 16, 2026 16:41
Fixes the type for UNKNOWN_NEXT_PEER

Changelog-Fixed: correct unknown next peer error type for the lsp service
…_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.
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
@nepet
nepet force-pushed the plugins/lsps2/fix-wrong-unknown-next-peer branch from d453428 to ed145c5 Compare November 17, 2026 09:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants