-
Notifications
You must be signed in to change notification settings - Fork 132
Use new NoopAddHtlc TLV when sending assets with default above-dust anchor amt #1567
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 15278104744Details
💛 - Coveralls |
@@ -135,6 +143,11 @@ func (h *Htlc) Records() []tlv.Record { | |||
records = append(records, r.Record()) | |||
}) | |||
|
|||
if h.NoopAdd { | |||
r := tlv.NewPrimitiveRecord[lnwallet.NoopAddHtlcType](true) |
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.
Another thing to update in the bLIPs.
return totalAmount, htlcCustomRecords, nil | ||
|
||
htlc.SetNoopAdd() | ||
updatedRecords, err := htlc.ToCustomRecords() |
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.
Seems the aspect related to the reserve that you mentioned isn't in this PR yet?
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.
It's not updated yet and it's on the LND PR, here we don't really have access to the channel state so we only decide whether we flag the noop to LND or not
@GeorgeTsagk, remember to re-request review from reviewers when ready |
We add a new noop flag to the HTLC which, when set, will produce the corresponding TLV record. We also hide this feature behind the dev flag, as we ultimately want to be backwards compatible via some feature bit related peer messages.
Since we now have two different candidate types for adding HTLCs, we use the helper method that checks against both of them.
Whenever we use the default above-dust anchor amount to send an HTLC with assets we also set the noop flag on the HTLC, which will produce the according noop HTLC record and signal to LND that the satoshi amount should be returned to the sender.
f6a1db8
to
723311b
Compare
Description
When sending HTLCs that carry assets we now set the noop flag whenever the amount is the default anchor amount. Since that amount is mandatory for the anchoring of assets we want to keep it around while HTLCs are inflight, but not actually send it to the channel counter party when the HTLC settles. This is exactly what the noop flag triggers.
The feature is currently hidden behind the
go:build dev
flag, as it will break backwards compatibility if used by default. This will be the case until we introduce feature related peer messages for custom channels.Closes #888
Closes #1305