Commit Graph

17190 Commits

Author SHA1 Message Date
Keagan McClelland
1e2bf3e0b3
lnwallet: add function to convert paymentDescriptor to LogUpdate
Here we add a function that is capable of recovering LogUpdates from
paymentDescriptors and we refactor the lnwallet code to use this
rather than doing JIT inline construction of the LogUpdates.
2024-09-09 16:53:08 -06:00
Keagan McClelland
721a0c5edc
lnwire+htlcswitch: change NewInvalidBlinding to use array instead of slice 2024-09-09 16:26:41 -06:00
Keagan McClelland
5505b6daff
htlcswitch: change sendMalformedHTLCError to take array instead of slice 2024-09-09 16:26:41 -06:00
Keagan McClelland
5deb4c253a
htlcswitch+lnwallet: fix OnionBlob to 1366 bytes 2024-09-09 16:26:41 -06:00
Keagan McClelland
df3c6b72ab
lnwallet: track ChannelID on PaymentDescriptor
In this commit we track the ChannelID on the PaymentDescriptor.
This will be useful in upcoming commits that need to be able to
reconstruct lnwire.Message values from PaymentDescriptors as the
Messages that are exchanged to update channel state all include
the ChannelID.
2024-09-09 16:26:41 -06:00
Keagan McClelland
a89e24f487
lnwallet: add ChannelID method to LightningChannel
In this commit we introduce a convenience method to LightningChannel
to allow us to quickly grab the channel id. This will be important
in upcoming commits where we need to remember the ChannelID to
reconstruct update messages.
2024-09-09 16:26:41 -06:00
Oliver Gugger
a895b1c6ca
Merge pull request #9051 from calvinrzachman/export-routing-interface
routing: export dbMPPayment interface
2024-09-09 05:15:38 -06:00
Oliver Gugger
31a6f87c4d
Merge pull request #9049 from lightningnetwork/extract-part2-from-staging-branch
[custom channels 2/5]: Extract PART2 from mega staging branch
2024-09-05 12:08:36 -06:00
George Tsagkarelis
427d41dc1e
itest: add interceptor and first hop data tests 2024-09-05 18:00:53 +02:00
Oliver Gugger
81c8331f82
lnrpc: add first hop custom data to route 2024-09-05 18:00:53 +02:00
George Tsagkarelis
aa17543d23
routing: use first hop records on path finding 2024-09-05 18:00:53 +02:00
Oliver Gugger
4804cbf139
channeldb+routing: persist first hop custom data for route 2024-09-05 18:00:53 +02:00
George Tsagkarelis
c39143052e
lnd: use impl cfg TlvTrafficShaper 2024-09-05 18:00:52 +02:00
Olaoluwa Osuntokun
f04fa54622
routing: skip amtInRange for custom HTLCs
We might be trying to send an invoice amount that's greater than the size of the channel, but once you factor in the custom channel logic, an actual HTLC can be sent over the channel to pay that larger payment.

As a result, we'll skip over this check if a have a custom HTLC.
2024-09-05 18:00:52 +02:00
George Tsagkarelis
5b4de5f0d4
routing: add TlvTrafficShaper to bandwidth hints 2024-09-05 18:00:52 +02:00
George Tsagkarelis
5dcda25881
htlcswitch: expose custom channel blob from link 2024-09-05 18:00:49 +02:00
George Tsagkarelis
5cb68a59c5
lnwallet: expose commitment blob from channel 2024-09-05 11:18:17 +02:00
Oliver Gugger
afdceab400
lnrpc: add first hop custom records to RPC payment info 2024-09-05 11:18:16 +02:00
Oliver Gugger
1b31835230
channeldb+routing: persist first hop custom records
With this commit we make sure the first hop custom records aren't lost
on restart/resume of a payment, so we persist it as part of the
PaymentCreationInfo struct.
2024-09-05 11:18:16 +02:00
George Tsagkarelis
42e358e3d3
lnrpc: add wire records fields to payment+interceptor RPCs 2024-09-05 11:18:16 +02:00
George Tsagkarelis
878f964a33
multi: use wire records on payment and intercept flows 2024-09-05 11:18:16 +02:00
Oliver Gugger
aa86020b84
lnwallet: extract diskCommit, remove unused error return value 2024-09-05 11:18:16 +02:00
ffranr
ccea257c92
itest: add itest for field modification HTLC interception response
Implement an integration test where an HTLC is intercepted and the
interception response modifies fields in the resultant p2p message.
2024-09-05 11:18:16 +02:00
ffranr
fb14d8c96e
routerrpc: extend HTLC forward interceptor resp with modification fields
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.
2024-09-05 11:18:15 +02:00
ffranr
abca4b8234
htlcswitch: add resume modified HTLC action to switch
Introduce `ResumeModified` action to resume standard behavior of a p2p
message with optional modifications as specified by the client during
interception.
2024-09-05 11:18:15 +02:00
ffranr
8d1059f41c
lnwire: add custom records field to type UpdateFulfillHtlc
- Introduce the field `CustomRecords` to the type `UpdateFulfillHtlc`.
- Encode and decode the new field into the `ExtraData` field of the
`update_fulfill_htlc` wire message.
- Empty `ExtraData` field is set to `nil`.
2024-09-05 11:18:15 +02:00
ffranr
81f6a8060f
lnwire: add custom records field to type UpdateAddHtlc
- Introduce the field `CustomRecords` to the type `UpdateAddHtlc`.
- Encode and decode the new field into the `ExtraData` field of
  the `update_add_htlc` wire message.
2024-09-05 11:18:15 +02:00
ffranr
af50694643
lnwire: add ExtraOpaqueData helper functions and methods
Introduces a couple of new helper functions for both the ExtraOpaqueData
and CustomRecords types along with new methods on the ExtraOpaqueData.
2024-09-05 11:18:15 +02:00
ffranr
17c0a70b07
lnwire: add unit tests for ExtraOpaqueData.PackRecords 2024-09-05 10:29:42 +02:00
George Tsagkarelis
705e567357
itest: add dynamic scid alias routing test 2024-09-05 10:29:42 +02:00
George Tsagkarelis
70f82bc4ff
routerrpc: add XAddLocalChanAliases & XDeleteLocalChanAliases 2024-09-05 10:29:42 +02:00
Oliver Gugger
604bd81100
aliasmgr: export alias start and end ranges
Because we restrict custom SCID aliases to be in a specific range, we
export the range start and end values so a user of the RPCs we're going
to add in the next commits can adjust their values to fit within the
range.
2024-09-05 08:44:33 +02:00
Oliver Gugger
466f550ddb
aliasmgr: avoid collision when requesting alias
With the new RPC calls that we are going to add in the next commits, it
will be possible for users to add (local only, non-gossipped) SCID
aliases for channels. Since those will be in the same range as the ones
given out by RequestAlias, we need to make sure that when we generate a
new one that it doesn't collide with an already existing one.
2024-09-05 08:44:33 +02:00
Oliver Gugger
80dfaeb16d
aliasmgr: add map type alias 2024-09-05 08:44:33 +02:00
George Tsagkarelis
ea92d0aecc
multi: refresh htlcswitch aliases on aliasmgr update 2024-09-05 08:44:32 +02:00
George Tsagkarelis
e31cdc4db3
aliasmgr: add delete local alias method 2024-09-05 08:44:32 +02:00
Olaoluwa Osuntokun
6747fc13b4
Merge pull request #9063 from guggero/update-sqldb
mod: bump sqldb to latest version
2024-09-04 13:18:21 -07:00
Oliver Gugger
6900fb54e2
Merge pull request #9064 from longhutianjie/master
bug: fix json tag
2024-09-04 05:43:01 -06:00
longhutianjie
26dd72d93a
bug: fix json tag 2024-09-04 18:03:15 +08:00
Oliver Gugger
cb85e6f8ba
mod: bump sqldb to latest version 2024-09-04 09:33:27 +02:00
Oliver Gugger
258cf81240
Merge pull request #9050 from bhandras/native-sql-invoice-fixes
invoices+sqldb: small fixes to address some inconsistencies between KV and native SQL invoice DB implementations
2024-09-04 01:30:52 -06:00
Olaoluwa Osuntokun
ce27e4e62c
Merge pull request #9046 from Roasbeef/taproot-chan-sync-bug-fix
lnwallet: ensure we re-sign retransmitted commits for taproot channels
2024-09-03 17:25:19 -07:00
Olaoluwa Osuntokun
80b257991e
docs/release-notes: add release notes entry for taproot chans bug fix 2024-09-03 17:23:53 -07:00
Olaoluwa Osuntokun
b8e39c2311
lnwallet: expand chan sync tests to cover taproot channels
In this commit, we expand some of the existing chan sync tests to cover
taproot channels (the others already did). Along the way, we always
assert that the `PartialSig` is populated on retransmission. In
addition, we now send the new commit sig rather than the existing
in-memory one to test the new logic that re-signs the commitment.
2024-09-03 17:23:48 -07:00
Olaoluwa Osuntokun
528199839a
lnwallet: extract initMusigNonce from initRevocationWindows
This'll be useful later to make some enhancements to the existing unit
tests.
2024-09-03 17:23:46 -07:00
Olaoluwa Osuntokun
69a1cf4f23
lnwallet: ensure we re-sign retransmitted commits for taproot channels
In this commit, we fix an existing bug with the taproot channel type
that can cause force closes if a peer disconnects while attempting to
send the commitment signature.

Before this commit, since the `PartialSig` we send is never committed to
disk, the version read wouldn't contain the musig2 partial sig. We never
write these signatures to disk, as each time we make a new session, we
need to generate fresh nonces to avoid nonce-reuse.

Due to the above interaction, if we went to re-send a signature after a
disconnection, the `CommitSig` message we sent wouldn't actually contain
a `PartialSigWithNonce`, causing a protocol error.
2024-09-03 17:23:38 -07:00
Andras Banki-Horvath
1f7ac8e853
docs: update docs/release-notes/release-notes-0.18.3.md 2024-09-03 19:42:52 +02:00
Andras Banki-Horvath
06d4267a76
sqldb: fix end date filter when querying invoices
Previously, the SQL implementation of the invoice query simply
converted the start and end timestamps to time and used them
in SQL queries to check for inclusivity. However, this logic
failed when the start and end timestamps were equal.

This commit addresses and corrects this issue.
2024-09-03 19:40:47 +02:00
Andras Banki-Horvath
b57910ee3a
sqldb+invoices: synchronize SQL invoice updater behavior with KV version
Previously SQL invoice updater ignored the set ID hint when updating an
AMP invoice resulting in update subscriptions returning all of the AMP
state as well as all AMP HTLCs. This commit synchornizes behavior with
the KV implementation such that we now only return relevant AMP state
and HTLCs when updating an AMP invoice.
2024-09-03 19:40:46 +02:00
Andras Banki-Horvath
c8de7a1699
channeldb: filter AMP state to relevant set IDs
When fetching an AMP invoice we sometimes filter HTLCs to selected set
IDs, however we always kept the full AMP state which is irrelevant as it
contains state for all AMP payments. This was a side effect of
UpdateInvoice needing to serialize the whole invoice when storing after
an update but it is an unwanted "feature" as users will need to filter
to relevant set when listing an AMP payment or subsribing to an update.
2024-09-03 19:40:46 +02:00