lndclient: add FailureMessage and FailureCode to InterceptedHtlcResponse#267
Open
calvinrzachman wants to merge 1 commit intolightninglabs:lnd-21-0from
Open
lndclient: add FailureMessage and FailureCode to InterceptedHtlcResponse#267calvinrzachman wants to merge 1 commit intolightninglabs:lnd-21-0from
calvinrzachman wants to merge 1 commit intolightninglabs:lnd-21-0from
Conversation
The HTLC interception response type was missing fields for controlling how lnd encodes failure errors back to the sender. Without these fields, all interceptor failures are encoded as TemporaryChannelFailure and attributed to the intercepting node, which causes Mission Control to penalize the forwarding pair. This adds FailureMessage and FailureCode to InterceptedHtlcResponse and wires them through rpcInterceptorResponse. FailureMessage accepts a pre-encrypted onion error blob that lnd relays via IntermediateEncrypt, preserving the error attribution of the original encrypter. This is the path a virtual node behind the interceptor uses to produce errors attributed to itself rather than the intercepting node. FailureCode selects a specific failure code for errors attributed to the interceptor.
ce1a4c1 to
4de8ad8
Compare
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.
Description
The
routerrpcHTLC interception API in lnd already supportsfailure_messageandfailure_codeonForwardHtlcInterceptResponse, but lndclient never exposed them. This PR brings the library in line with the proto by addingFailureMessageandFailureCodetoInterceptedHtlcResponseand wiring them throughrpcInterceptorResponse.FailureMessageaccepts a pre-encrypted onion error blob. When set, lnd relays the bytes throughIntermediateEncryptrather than constructing a new error withEncryptFirstHop. This allows a virtual node behind the interceptor to produce errors attributed to itself instead of the intercepting node.FailureCodeselects a specific failure code for errors that lnd constructs on behalf of the intercepting node. Without either field, lnd defaults toTemporaryChannelFailure.Pull Request Checklist
in
lnd_services.goare updated.macaroon_recipes.goif your PR adds a new method that is calleddifferently than the RPC method it invokes.