-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LightningPayment
first hop custom records
#8656
LightningPayment
first hop custom records
#8656
Conversation
This method adds encode and decode methods to type `CustomSet`. These methods will allow us to serialise and deserialize a `CustomSet` map as a byte slice.
- Introduce the field `CustomRecordsBlob` to the type `UpdateAddHtlc`. - Encode and decode the new field into the `ExtraData` field of the `update_add_htlc` wire message.
Introduce `ResumeModified` action to resume standard behavior of a p2p message with optional modifications as specified by the client during interception.
This commit extends the forward HTLC intercept response with fields that can be used in conjunction with a `ResumeModified` action to modify the intercepted HTLC p2p message.
Implement an integration test where an HTLC is intercepted and the interception response modifies fields in the resultant p2p message.
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
|
||
require.Eventually(ht, func() bool { | ||
ctx := context.Background() | ||
dbgInfo, err := bob.RPC.LN.GetDebugInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's not yet support to retrieve the custom blob from the interceptor, we'll assert that bob receives the first hop records by peeking at his logs
57b3608
to
c092a65
Compare
Removing myself for now then, feel free to re-add! |
if err := firstHopRecords.Validate(); err != nil { | ||
return nil, err | ||
} | ||
payIntent.FirstHopCustomRecords = firstHopRecords |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the FirstHopCustomRecords
field was added in a later commit. I think this one is more temp, but if not, we should move the commit that adds the new field to before this one.
recordsBytes, | ||
) | ||
|
||
htlcAdd.CustomRecordsBlob = tlv.SomeRecordT(tlvRecord) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I chatted with @ffranr about this offline, but instead we only want to be setting ExtraData
. All the other logic (further down in the state machine), will only look inside of ExtraData
, as it isn't expecting that extra layer of wrapping.
We do want the upfront validation here tho to ensure that w/e we're passed in is actually a canonical TLV stream.
@GeorgeTsagk, remember to re-request review from reviewers when ready |
These commits are now part of #8660 |
Description
Based on #8633
This PR adds a new field for first hop custom records to
LightningPayment
. This allows the sender to specify a set of custom records to be delivered via the wire messageupdate_add_htlc
to the first hop peer.