16841 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
5272db372c
Merge pull request #9074 from jharveyb/aux_signer_batching_fixes
lnwallet: aux signer batching fixes
2024-10-16 12:14:59 -07:00
Jonathan Harvey-Buschel
41e491c32b
gitignore: ignore vscode workspace files 2024-10-15 17:05:45 -04:00
Jonathan Harvey-Buschel
a680224c02
lnwallet: test link quit signal handling 2024-10-15 17:05:45 -04:00
Jonathan Harvey-Buschel
62ffe6ca56
multi: link quit can interrupt commitment signing
In this commit, we make sig job handling when singing a next commitment
non-blocking by allowing the shutdown of a channel link to prevent
further waiting on sig jobs by the channel state machine. This addresses
possible cases where the aux signer may be shut down via a separate quit
signal, so the state machine could block indefinitely on receiving an
update on a sig job.
2024-10-15 17:04:40 -04:00
Jonathan Harvey-Buschel
836a9657f3
htlcswitch: pass quit chans as unidirectional
This is a requirement for replacing the quit channel with a Context.
The Done() channel of a Context is always recv-only, so all users of
that channel must not expect a bidirectional channel.
2024-10-15 17:01:29 -04:00
Oliver Gugger
fe46353392
lnwallet: clarify usage of cancel and response channels 2024-09-30 15:40:33 -04:00
Jonathan Harvey-Buschel
36faab3553
lnwallet: sort sig jobs before submission 2024-09-30 15:40:33 -04:00
Jonathan Harvey-Buschel
aa435034bf
lnwallet: test aux signer shutdown handling 2024-09-30 15:40:32 -04:00
Jonathan Harvey-Buschel
43ab85b874
lnwallet: refactor test code for HTLC add and recv 2024-09-30 15:28:39 -04:00
Jonathan Harvey-Buschel
1cd4fdc859
lnwallet: allow mock aux signer to fail sig jobs 2024-09-30 13:09:46 -04:00
Oliver Gugger
7058040389
Merge pull request #9092 from GeorgeTsagk/trafficshaper-htlcamt
routing: add htlcAmt to PaymentBandwidth method of TlvTrafficShaper
2024-09-19 03:17:21 -06:00
Oliver Gugger
d3267f32c9
Merge pull request #9120 from GeorgeTsagk/aux-sig-panic
lnwallet: fix panic on aux sig handling
2024-09-19 03:17:05 -06:00
George Tsagkarelis
70338e3cf3
lnwallet: fix panic on aux sig handling 2024-09-19 11:12:29 +02:00
George Tsagkarelis
8e96d7000c
routing: add htlcAmt to PaymentBandwidth method of TlvTrafficShaper 2024-09-18 19:07:16 +02:00
Olaoluwa Osuntokun
fb66bd2e96
Merge pull request #9032 from lightningnetwork/htlc-aux-sig-retransmission
lnwallet: properly set aux HTLC blob on retransmission
2024-09-12 17:58:08 -07:00
Olaoluwa Osuntokun
505843213a
lnwallet: add new TestChanSyncOweCommitmentAuxSigner test
This test ensures that when we go to retransmit a signature, we also include the set of CustomRecords.
2024-09-12 17:54:39 -07:00
Olaoluwa Osuntokun
f41dd862d0
htlcswitch+lnwallet: use CustomRecords for aux sig blobs
In this commit, we start to use the set of CustomRecords instead of ExtraData for the aux sig blobs.
2024-09-12 17:54:37 -07:00
Olaoluwa Osuntokun
7dd3a5b361
lnwire: add CustomRecords field to CommitSig
In a future commit, we'll use the new field to ensure that if we add any additional records, they aren't over written by the TLV records that would be encoded.
2024-09-12 17:54:36 -07:00
Olaoluwa Osuntokun
681f44fd16
lnwire: modify TestLightningWireProtocol to use sub-tests
This way, it's possible to run induvidual tests to target failures.
2024-09-12 17:54:35 -07:00
Olaoluwa Osuntokun
78f31da2fb
lnwire: refactor custom vs official tlv parsing into new func
We'll use this to update CommitSig in the next commit.
2024-09-12 17:54:34 -07:00
Olaoluwa Osuntokun
e4c97d23c8
build: add rapid as a new dep 2024-09-12 17:54:33 -07:00
Olaoluwa Osuntokun
819de82262
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-12 17:54:32 -07:00
Olaoluwa Osuntokun
f5b57e8d08
lnwallet: extract initMusigNonce from initRevocationWindows
This'll be useful later to make some enhancements to the existing unit tests.
2024-09-12 17:54:32 -07:00
Olaoluwa Osuntokun
f03a6d5a0b
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 actualy contain a `PartialSigWithNonce`, causing a protocol error.
2024-09-12 17:54:31 -07:00
Olaoluwa Osuntokun
aed568b6ed
lnwallet: properly set aux HTLC blob on retransmission
Before this commit, we weren't properly setting the aux HTLC blob when
we went to retransmit a signature. We fix this by setting the
`ExtraData` field as expected in the `CommitSig` message.
2024-09-12 17:54:30 -07:00
Olaoluwa Osuntokun
e78b0bb853
Merge pull request #9040 from Roasbeef/rpc-commit-type-bug-fix
rpc: fix ordering of feature bit check in rpcCommitmentType
2024-08-28 16:45:53 -05:00
Olaoluwa Osuntokun
97a54153be
rpc: fix ordering of feature bit check in rpcCommitmentType
We need to check if it has a tapsript root first, as if it has a
tapscript root, then it's also a taproot channel. By checking if it has
a tapscript root first, we'll now display the proper commitment type for
RPC responses.
2024-08-28 16:45:22 -05:00
Oliver Gugger
1b353b0bfd
Merge pull request #8947 from guggero/reuse-cli-payment-code
cmd/commands: refactor SendPaymentRequest for re-use
2024-07-30 08:32:53 -06:00
Oliver Gugger
e3f5b74f92
cmd/commands: refactor SendPaymentRequest for re-use
We want to re-use the logic of the SendPaymentRequest code, most notably
the logic that prints the payment updates as a nicely formatted table to
the console, in other projects.
2024-07-29 18:04:44 +02:00
Olaoluwa Osuntokun
f09d4042ae
Merge pull request #8926 from lightningnetwork/second-level-aux
lnwallet: store aux sig in custom data within the HTLC
2024-07-22 21:32:04 -07:00
Olaoluwa Osuntokun
6a8da1cd80
lnwallet: store aux sig in custom data within the HTLC
We can use this space as we'll properly encode the blinded paths data
along with our custom fields before we go to write the HTLCs to the
wire.
2024-07-22 19:41:01 -07:00
Olaoluwa Osuntokun
115bad5c5c
build: update to latest TLV version 2024-07-22 19:40:56 -07:00
Olaoluwa Osuntokun
90f997c908
Merge pull request #8908 from lightningnetwork/traffic-shaper-htlc-amount-fix
routing: don't assume HTLC amount for custom channel
2024-07-11 19:50:14 -07:00
Olaoluwa Osuntokun
d80bca8c6f 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-07-11 19:48:47 -07:00
Olaoluwa Osuntokun
14a6f73258 routing: only set firstHopBlob if we have custom records 2024-07-11 19:47:34 -07:00
Olaoluwa Osuntokun
e8bf89160d
itest: don't modify HTLC amount in testForwardInterceptorWireRecords
The goal of the test is just to make sure that we can pick up the wire
records. With the prior bug fix, if we also modify the outgoing amount
here, the normal checks to ensure that the fee has been paid will
trigger with this larger amount, which wasn't factored in during initial
route creation.
2024-07-11 16:11:16 -07:00
Oliver Gugger
4f2c75f620
htlcswitch: also set packet amount on modified forward
This fixes an issue where the switch's forwarding logic would think the
bandwidth to forward an HTLC was insufficient for a custom channel HTLC,
because we only overwrote the HTLC's amount and not the packet's (which
is just a short cut struct member anyway).
2024-07-11 21:44:27 +02:00
Oliver Gugger
374b659476
routing: don't assume HTLC amount for custom channel
It seems like the amount given to the getBandwidth is 0 in some cases
(keysend) and non-zero in other cases (invoice payment).
If we use custom channels, then that amount will likely not be the
actual HTLC amount we're going to put on chain. So we have to use a zero
amount for the MayAddOutgoingHtlc check, otherwise we might seem to go
below the local channel reserve even though we'll end up sending a very
small amount only.
And since the check here is just to find out we're not already at the
maximum HTLC capacity for this channel, we can safely use the amount of
0 for the check, which is handled properly in the link logic.
2024-07-11 12:00:20 +02:00
Olaoluwa Osuntokun
7ffadde13e
Merge pull request #8904 from lightningnetwork/global-msg-router-fix
peer: don't stop global msg router
2024-07-09 19:14:40 -07:00
Olaoluwa Osuntokun
0cd11ad847
peer: don't stop global msg router
In this commit, we fix a bug that would cause a global message router to
be stopped anytime a peer disconnected. The global msg router only
allows `Start` to be called once, so afterwards, no messages would
properly be routed.
2024-07-09 14:07:32 -07:00
Olaoluwa Osuntokun
8d83880161
Merge pull request #8885 from lightningnetwork/co-op-close-scid
lnwallet: add short chan ID to AuxShutdownReq
2024-07-02 11:37:19 -07:00
Olaoluwa Osuntokun
c7011a6a5c
lnwallet: add short chan ID to AuxShutdownReq
This allows implementations to obtain information related where the
funding transaction confirmed in the mainchain.
2024-07-02 11:30:19 -07:00
Olaoluwa Osuntokun
9eec9b5045
Merge pull request #8867 from lightningnetwork/custom-chans-feature-bit
multi: add taproot chans overlay feature bit
2024-06-26 19:41:14 -07:00
Olaoluwa Osuntokun
c7487095ce
lnd: signal taproot overlay chans based on config
We also add a sanity check to make sure they can't be signaled without
the aux interfaces.
2024-06-26 18:13:11 -07:00
Olaoluwa Osuntokun
0651488bae
lncfg: add new config option for taproot overlay chans 2024-06-26 18:13:07 -07:00
Olaoluwa Osuntokun
db730d27b5
rpc+funding: add taproot overlay as RPC chan type 2024-06-26 18:13:04 -07:00
Olaoluwa Osuntokun
78394541e7
lnrpc: add SIMPLE_TAPROOT_OVERLAY feature bit 2024-06-26 18:13:02 -07:00
Olaoluwa Osuntokun
5dc5a1a442
funding: add chan type awareness for new taproot chans overlay 2024-06-26 18:13:00 -07:00
Olaoluwa Osuntokun
a222878a0d
lnwallet: add awareness of taproot overlay chan type to reservations 2024-06-26 18:12:58 -07:00
Olaoluwa Osuntokun
5c4dc2e193
feature: add awareness of new taproot chans overlay feature bit
This bit will be false by default in current production deployments.
2024-06-26 18:12:56 -07:00