-
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
[custom channels 4/5]: Extract PART4 from mega staging branch #9095
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Pull reviewers statsStats of the last 30 days for lnd:
|
5e33608
to
2199ea9
Compare
8612201
to
3efea30
Compare
Ready for full review! |
3efea30
to
5dccc8c
Compare
2199ea9
to
49a8371
Compare
Please be aware that if the dependent part3 is updated and this isn't rebased immediately, it will look like there are more commits than before. The start commit for this part is always Will push a rebased version as soon as I've addressed the CI failures. |
5dccc8c
to
f3a0959
Compare
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.
Second pass looking gooood! I like the changes to the interceptor 🙏
Think this is pretty much g2g.
f3a0959
to
0a439cf
Compare
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.
Really clean PR! I'm not as confident reviewing the second part (aux closer) but looks overall very good 🚀 I wonder why all itests fail though?
invoices/invoiceregistry.go
Outdated
// If this is the first HTLC for the invoice, we don't actually | ||
// have the invoice in the database yet. We'll create a new and | ||
// empty invoice to pass to the interceptor. | ||
existingInvoice = Invoice{ |
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.
Why do we intercept in this case? Given that the normal flow of execution is that we return a new fail resolution (see below after the UpdateInvoice
call).
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.
Ah, you're right. I wondered why some unit tests failed before, that's why I added the empty invoice. But makes sense to just return the failure resolution directly.
3dc1947
to
8cb20e7
Compare
0a439cf
to
440a7b6
Compare
Addressed all comments and also fixed the CI. Ready for re-review. |
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.
Great work! LGTM 🚢
0626d8c
to
6a0d859
Compare
440a7b6
to
cc1a720
Compare
6a0d859
to
f093d3d
Compare
f093d3d
to
52e50d8
Compare
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.
LGTM 🥇
|
||
// If the invoice was not found, return a failure resolution | ||
// with an invoice not found result. | ||
return NewFailResolution( |
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.
👍
This commit introduces a new invoice htlc interceptor service that intercepts invoice HTLCs during their settlement phase. It forwards HTLCs to a subscribed client to determine their settlement outcomes. This commit also introduces an interface to facilitate integrating the interceptor with other packages.
This commit updates the invoice registry to utilize the settlement interceptor during the invoice settlement routine. It allows the interceptor to capture the invoice, providing interception clients an opportunity to determine the settlement outcome.
This commit initiates the invoice settlement interceptor during the main server startup, assigning it a handle within the server.
This commit integrates the HTLC modifier service into the invoices RPC server.
This commit introduces a singleton invoice HTLC modifier RPC server and an endpoint to activate it. The server interfaces with the internal invoice HTLC modifier interpreter, handling the marshalling between RPC types and internal formats.
This commit enhances the itest LND node harness to include support for the new `HtlcModifier` RPC endpoint. At the same time we move another method to the correct file.
With this commit we encode the custom records as a TLV stream into the custom channel data field of the invoice HTLC. This allows the custom data parser to parse those records and replace it with human-readable JSON on the RPC interface.
This commit introduces a basic integration test for the invoice HTLC modifier. The test covers scenarios where an invoice is settled with a payment that is less than the invoice amount, facilitated by the invoice HTLC modifier.
8acb279
to
8f5a527
Compare
In this commit, we move to add the internal key to the delivery addr. This way, we give the aux chan closer the extra information it may need to properly augment the normal co-op close process.
With this commit we populate additional information about the close outputs (including potential custom channel data) in the close update RPC message. This will allow custom channels to find out how the additional close outputs look like on chain and what data they might commit to. We also hook up the aux custom data formatter, so it can format the custom channel data to JSON.
8f5a527
to
e0b4601
Compare
Extracts part 4 from #8960.