-
Notifications
You must be signed in to change notification settings - Fork 951
Set custom tlvs to update_add_htlc
via the htlc_accepted_hook
#8433
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
Open
nepet
wants to merge
8
commits into
ElementsProject:master
Choose a base branch
from
nepet:2519-extra-tlv-on-htlc_accepted-hook
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Set custom tlvs to update_add_htlc
via the htlc_accepted_hook
#8433
nepet
wants to merge
8
commits into
ElementsProject:master
from
nepet:2519-extra-tlv-on-htlc_accepted-hook
Conversation
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
83eb85c
to
a9bd415
Compare
We currently only consider known tlv types in the internal representation of a htlc. This commit adds the remaining unknown tlv fields to the htlc as well. This is in prepareation to forward these to the htlc_accepted_hook. Signed-off-by: Peter Neuroth <[email protected]>
This appends the extra_tlvs to the internal wire htlcs "added" and "existing" for the extra tlvs to be handed to lightningd. Signed-off-by: Peter Neuroth <[email protected]>
This appends the extra_tlvs to the internal channeld_offer_htlc wire msg. We also recombine the extra_tlvs with the blinded path key for forwarding htlcs. Signed-off-by: Peter Neuroth <[email protected]>
Add serializing and deserializing of the extra tlvs to to the htlc_accepted_hook to allow plugin users to replace the tlv stream that is attached to the update_add_htlc message on forwards. Signed-off-by: Peter Neuroth <[email protected]>
Adds some testcases for custom tlvs, set by a htlc_accepted_hook. We check that the custom tlvs replace the update_add_htlc_tlvs and get forwarded to the peer. We also check that a malformed tlv will result in a **BROKEN** behaviour. Signed-off-by: Peter Neuroth <[email protected]>
Changelog-Added: The `htlc_accepted_hook` now gets the TLV-stream attached to the HTLC passed through as `extra_tlvs` and can replace it. Signed-off-by: Peter Neuroth <[email protected]>
There was a problem with a ‘highlight’ that was misunderstood as a spelling mistake in lib-wally. Since ‘hightlight’ is already filtered out, we simply instruct grep to ignore upper/lower case when filtering. Signed-off-by: Peter Neuroth <[email protected]>
The rare case happened where a lockfile sha-sum contained a "Ctlv" which spell-check complained about. Stupid lockfiles that don't know it is actually "cltv"! Signed-off-by: Peter Neuroth <[email protected]>
a9bd415
to
b0c1c55
Compare
this PR is necessary for LSPS2 - doesn't conclude LSPS2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status::Ready for Review
The work has been completed and is now awaiting evaluation or approval.
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.
Important
25.09 FREEZE July 28TH: Non-bugfix PRs not ready by this date will wait for 25.12.
RC1 is scheduled on August 11th
The final release is scheduled for September 1st.
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:
This PR allows plugins that registered to th
htlc_accepted_hook
to get and replace the TLV-streamupdate_add_htlc_tlvs
attached to incommingupdate_add_htlc
messages, adding a new HTLC.If a plugin want's to replace the TLV-stream with custom TLVS, it needs to return
Specifying
extra_tlvs
will replace the TLV-stream attached to the HTLC (also the blinding path-key) and will be - in case of a forward - forwarded as theupdate_add_htlc_tlvs
to the peer.This PR is a necessary precondition to implement the LSPS2 protocol and Resolves #6663