Repository navigation
Conversation
A blinded invoice can advertise a recipient amount that exceeds an intermediate channel limit once downstream fees are included. Add a four-node test with a successful control payment, then attempt the maximum advertised by the invoice without retries or MPP. The settlement assertion intentionally fails on current master. Keep this test-only reproduction separate from a fix so reviewers can confirm the expected behavior and diagnosis first.
🟢 PR Severity: LOW
🟢 Low (2 files)
AnalysisThis PR only adds a new integration test ( To override, add a |
hieblmi
marked this pull request as ready for review
November 6, 2026 12:30
An introduction node need not own the channel that limits a blinded path. Add a five-node case with a 500-sat hidden channel and a 1-sat downstream fee, while the introduction channel allows 1,000 sats. Share the invoice and payment checks with the introduction-channel case. Both assert that the advertised maximum settles, exposing the current overstatement after a successful fee-adjusted control payment. No production fix is included.
Collaborator
|
@bitromortac: review reminder |
1 similar comment
Collaborator
|
@bitromortac: review reminder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
This is a test-only reproduction to review a reproducible blinded-path HTLC maximum problem. It intentionally fails on current master; no production fix is included. Please confirm the expected amount-limit semantics and diagnosis before we implement a fix.
Introduction-channel bottleneck
The first integration test creates a funded route:
Every channel has 100,000 sats of capacity. Policy buffering is explicitly disabled so the test exercises the exact limit. Dave generates a real bLIP 39 invoice with Bob as introduction node. Alice decodes it, queries a route using its blinded path, and submits one HTLC with
SendToRouteV2; retries and MPP cannot hide an overstated per-HTLC maximum.Observed on master at
0c538e1f2:Bob's log identifies the cause:
The payer receives
INVALID_ONION_BLINDINGwith failure source index 1.Hidden middle-channel bottleneck
The second case adds a forwarding node inside the blinded path:
Bob remains the introduction node; Carol's outgoing channel limits the path. Dave's downstream fee must fit inside that channel's 500-sat limit. The correct advertised recipient maximum is therefore 500 - 1 = 499 sats (499,000 msat).
For a 499-sat payment, Bob and Carol each forward 500 sats, then Dave deducts his 1-sat fee and delivers 499 sats to Eve. For the currently advertised 500-sat payment, Bob can forward 501 sats within his 1,000-sat limit, but Carol cannot forward 501 sats within her 500-sat limit.
Observed locally against unchanged master production code:
Carol's log confirms the hidden bottleneck:
The payer still sees
INVALID_ONION_BLINDINGwith source index 1 (Bob); that public error does not identify the hidden failing node.Why the limit is overstated
The suspected cause is collectRelayInfo taking the smallest channel maximum, without accounting for the downstream fees also carried by each channel. The fee quote itself is correct in both reproductions. Every channel must fit the recipient amount plus fees paid downstream of that channel. The whole-path maximum must be the most restrictive of those fee-adjusted limits, wherever the bottleneck sits. These examples require maxima of 999,000 and 499,000 msat respectively.
Each test first proves its fee-adjusted boundary is payable, then takes the advertised maximum from the first invoice and attempts that amount in a second invoice. It asserts settlement, exposing the current failure rather than treating it as expected behavior. Default policy buffering can mask this boundary; this test uses supported multipliers of one.
The separate aggregate-fee overflow issue is already fixed on master and is outside this PR.
Steps to Test
make build-itest make itest-only 'icase=blinded_path_htlc_maximumRun the cases separately because each deliberately fails its settlement assertion on current master: the control payment settles, then the advertised-maximum payment fails. Both failures have been reproduced locally. This PR is for diagnosis review, not merge.
Pull Request Checklist
Testing
Code Style and Documentation
timeout=10m
make itest-only icase=blinded_path_htlc_maximum_middle timeout=10m