Commit graph

17466 commits

Author SHA1 Message Date
Keagan McClelland
f7264e6a5b
fn: add Filter to List
This commit adds an immutable Filter method to the linked List API.
This is useful because there are several instances wherein we iterate
through the linked List and only process a subset of it in some way
or another.
2024-09-26 14:24:36 -06:00
Olaoluwa Osuntokun
6485a816d1
Merge pull request #9134 from ellemouton/checkPayAddrBeforeDeref
routerrpc: check payaddr before using for probing
2024-09-26 14:50:29 +09:00
Elle Mouton
8663950c68
feature: remove b11 feature bit from default invoice set 2024-09-25 14:32:52 +09:00
Elle Mouton
f1015cd58d
server: stop interceptable switch in Stop 2024-09-25 14:32:52 +09:00
Elle Mouton
0bd76ffe32
invoices: init quit channel of modifier
Also add atomic start and stop vars to prevent close of a closed
channel.
2024-09-25 14:32:29 +09:00
Elle Mouton
7dc86acb8c
multi: update PaymentAddr to use fn.Option
Since it is allowed to not be set and so can lead to nil deref panics if
it is a pointer.
2024-09-25 11:14:35 +09:00
Oliver Gugger
84c91f701c
Merge pull request #9062 from Roasbeef/htlc-resolution-sweeper
contractcourt: use the sweeper for HTLC offered remote timeout resolu…
2024-09-19 09:43:16 -06:00
Oliver Gugger
611852fd34
Merge pull request #9123 from guggero/bump-18-99
build: bump master to version v0.18.99-beta
2024-09-19 03:57:11 -06:00
Oliver Gugger
4ff7d77a79
Merge pull request #9095 from lightningnetwork/extract-part4-from-staging-branch
[custom channels 4/5]: Extract PART4 from mega staging branch
2024-09-19 03:45:01 -06:00
Oliver Gugger
e0b4601fb9
multi: add co-op close custom data to close update
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.
2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
8dee76a1b8
peer: decorate delivery addr w/ internal key
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.
2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
44ab7e6b10
server+peer: init peer struct w/ AuxChanCloser if present 2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
625d426a56
lnwallet: modify CoopCloseBalance to not depend on chan commit 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
8d651b9370
lnwallet/chancloser: add aux chan closer, use in coop flow 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
7ff251ca44
lnwallet/chancloser: add new AuxChanCloser interface 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
117a144f4e
lnwallet: add ability to do custom sort for coop close txn 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
517608ca3b
lnwallet: add ability to add extra co-op close outputs 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
7b396f4969
lnwallet: add FundingBlob method to LightningChannel 2024-09-19 10:18:40 +02:00
Olaoluwa Osuntokun
099f5566bc
lnwire: add CustomRecords to shutdown message 2024-09-19 10:18:39 +02:00
Oliver Gugger
dc32a48246
build: bump master to version v0.18.99-beta
As is customary when preparing for the next major (or minor) release, we
bump the version to .99 to allow us to set the minimum required version
to something like v0.18.4-beta in lndclient and it would still accept
the master branch (even if that target version hasn't been
released/tagged yet).
2024-09-19 09:33:54 +02:00
ffranr
9a972e1b0c
itest: add basic invoice HTLC modifier integration test
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.
2024-09-19 09:21:38 +02:00
Oliver Gugger
d37df75bc0
lnrpc+rpcserver: encode custom records as custom channel data
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.
2024-09-19 09:21:38 +02:00
ffranr
bbae7148aa
multi: pass UpdateAddHtlc message custom records to invoice modifier 2024-09-19 09:21:38 +02:00
Oliver Gugger
83923c7f33
lnwire: add MergedCopy method to CustomRecords 2024-09-19 09:21:38 +02:00
ffranr
0c6a1558d5
lntest: add HtlcModifier support to node RPC harness
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.
2024-09-19 09:21:38 +02:00
ffranr
1975fa60e2
invoicesrpc: add HtlcModifier RPC endpoint and modifier 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.
2024-09-19 09:21:37 +02:00
ffranr
008d265cdb
invoicesrpc: add HTLC modifier to invoices RPC server
This commit integrates the HTLC modifier service into the
invoices RPC server.
2024-09-19 09:21:37 +02:00
ffranr
481dfe21bc
lnd: initialize invoice settlement interceptor at server startup
This commit initiates the invoice settlement interceptor during the
main server startup, assigning it a handle within the server.
2024-09-19 09:21:37 +02:00
ffranr
c58b6a25a2
invoices: integrate settlement interceptor with invoice registry
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.
2024-09-19 09:21:37 +02:00
ffranr
b8c8774b5d
invoices: add invoice htlc interceptor service
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.
2024-09-19 09:21:36 +02:00
Oliver Gugger
cdad5d988d
Merge pull request #9072 from lightningnetwork/extract-part3-from-staging-branch
[custom channels 3/5]: Extract PART3 from mega staging branch
2024-09-19 01:20:55 -06:00
Olaoluwa Osuntokun
13a7becb91
Merge pull request #8044 from ellemouton/g175Messages
[1/7] lnwire: add new Gossip 1.75 messages
2024-09-18 16:05:38 -07:00
Oliver Gugger
52e50d807d
htlcswitch: override amount check on custom records 2024-09-18 19:07:27 +02:00
Oliver Gugger
cdc3a4a6c6
channeldb: add NextHeight, fix formatting 2024-09-18 19:07:27 +02:00
Oliver Gugger
d49da574e3
lnd: add aux data parser
This commit adds an optional data parser that can inspect and in-place
format custom data of certain RPC messages.
We don't add an implementation of the interface itself, as that will be
provided by external components when packaging up lnd as a bundle with
other software.
2024-09-18 19:07:27 +02:00
Oliver Gugger
5e1a98cd43
lnrpc+rpcserver: add and populate custom channel data 2024-09-18 19:07:26 +02:00
Jonathan Harvey-Buschel
ea83300942
lnwallet: sort sig jobs before submission
To make sure we attempt to read the results of the sig batches in the
same order they're processed, we sort them _before_ submitting them to
the batch processor.
Otherwise it might happen that we try to read on a result channel that
was never sent on because we aborted due to an error.
We also use slices.SortFunc now which doesn't use reflection and might
be slightly faster.
2024-09-18 19:07:26 +02:00
Olaoluwa Osuntokun
83fdbda2fa
multi: obtain+verify aux sigs for all second level HTLCs
In this commit, we start to use the new AuxSigner to obtain+verify aux sigs for all second level HTLCs. This is similar to the existing SigPool, but we'll only attempt to do this if the AuxSigner is present (won't be for most channels).
2024-09-18 19:04:53 +02:00
Elle Mouton
077273e66e
docs: update release notes 2024-09-18 16:20:28 +02:00
Elle Mouton
a62201b61d
netann: add chan update 2 validate and verify funcs 2024-09-18 16:20:28 +02:00
Elle Mouton
580c10477f
lnwire: add ChannelUpdate2
Add the new ChannelUpdate2 message and ensure that it implements the
ChannelUpdate interface.
2024-09-18 16:20:28 +02:00
Elle Mouton
21c9ef8904
netann: validation and verification funcs for ChannelAnnouncement2 2024-09-18 16:14:59 +02:00
Elle Mouton
5fc1da3abe
netann: add MsgHash helper
This commit adds the MsgHash helper function which can be used to
calculate the digest of a message to be signed using schnorr signatures.
2024-09-18 16:14:59 +02:00
Elle Mouton
a438eb3af3
lnwire: add ChannelAnnouncement2 message
And ensure that it implements the ChannelAnnouncement interface.
2024-09-18 16:14:59 +02:00
Elle Mouton
66302ceb29
lnwire: make RawFeatureVector a Record producer 2024-09-18 16:14:58 +02:00
Elle Mouton
0b4e5a0d83
lnwire: add AnnounceSignatures2 message
And ensure that it implements the AnnounceSignatures interface.
2024-09-18 16:14:58 +02:00
Elle Mouton
ced88a9978
netann: let ChannelUpdate validate methods take in the new interface 2024-09-18 16:14:58 +02:00
Elle Mouton
35d0c61c12
netann: let ValidateChannelAnn take the new interface 2024-09-18 16:14:58 +02:00
Elle Mouton
34e9ee1ee5
lnwire: lnwire: add a ChannelUpdate interface
In this commit, a new ChannelUpdate interface is added and
ChannelUpdate1 is made to implement the new interface.
2024-09-18 16:14:58 +02:00
Elle Mouton
7bbf89625f
multi: move ChannelUpdate validate methods to netann 2024-09-18 16:13:18 +02:00