Commit graph

17316 commits

Author SHA1 Message Date
Oliver Gugger
662049681d
htlcswitch: thread through packet's inbound wire records
For calculating the available auxiliary bandwidth of a channel, we need
access to the inbound custom wire records of the HTLC packet, which
might contain auxiliary information about the worth of the HTLC packet
apart from the BTC value being transported.
2024-12-05 21:44:58 +01:00
Oliver Gugger
699e2b74f6
multi: move routing.TlvTrafficShaper => htlcswitch.AuxTrafficShaper
With this commit we move the traffic shaper definition from the routing
package to the HTLC switch package as a preparation for being able to
use it there as well.
At the same time we rename it to AuxTrafficShaper to be more in line
with the other auxiliary components.
2024-12-05 21:44:56 +01:00
Oliver Gugger
f5ad1ee438
Merge branch '0-18-4-branch-rc2-9324' into 0-18-4-branch-rc2 2024-12-05 21:41:27 +01:00
ziggie
ae227ce2c6
docs: add release-notes 2024-12-05 21:41:13 +01:00
ziggie
7e228f22a8
contractcourt: refactor start up of arbitrators
We decouple the state machine of the channel arbitrator from
the start-up process so that we can startup the whole daemon
reliably.
2024-12-05 21:40:31 +01:00
Oliver Gugger
c1129bb086
Merge pull request #9183 from lightningnetwork/0-18-4-branch-rc1
release: create branch for v0.18.4-beta.rc1
2024-11-21 20:19:40 +01:00
Oliver Gugger
9246d5c51c
Merge branch '0-18-4-branch-rc1-9288' into 0-18-4-branch-rc1 2024-11-20 15:31:13 +01:00
Oliver Gugger
117a145b97
docs: add release notes 2024-11-20 15:31:12 +01:00
Oliver Gugger
e074a8fab3
chanacceptor: add custom channel commitment type 2024-11-20 15:31:12 +01:00
Oliver Gugger
f9d876e8a3
Merge branch '0-18-4-branch-rc1-9253' into 0-18-4-branch-rc1 2024-11-20 10:44:12 +01:00
ziggie
a4211251bd
docs: add release notes 2024-11-20 10:43:59 +01:00
ziggie
d695383386
rpcserver: add robustness check 2024-11-20 10:42:54 +01:00
ziggie
79d0655a96
multi: introduce an option for resolutions
We don't always need the resolutions in the local force close
summary so we make it an option.
2024-11-20 10:42:54 +01:00
Oliver Gugger
78c8990772
Merge branch '0-18-4-branch-rc1-9272' into 0-18-4-branch-rc1 2024-11-19 12:44:51 +01:00
Olaoluwa Osuntokun
86de1ebdc2
sweep: update storeRecord to include utxo index
In this commit, we complete a recently added feature by ensuring that
even if we go through the RBF loop to create a txn, that we still
populate the `outpointToIndex` map. Unit tests have been updated to
ensure this is always set as expected.
2024-11-19 12:44:51 +01:00
Oliver Gugger
4c9d25cbe7
Merge branch '0-18-4-branch-rc1-9194' into 0-18-4-branch-rc1 2024-11-15 13:09:56 +01:00
Oliver Gugger
04b053e405
docs: move 0.18.4 items, add full list of custom chan PRs 2024-11-15 13:09:35 +01:00
Olaoluwa Osuntokun
e1a25f6c30
sweep: update BudgetInputSet.Budget() to factor in extra budget
In this commit, we update the `Budget()` call to factor in the
`extraBudget` value. Otherwise, when we go to intialize the fee
function, we won't factor in the extra budget, and will determine that
we can't broadcast/bump.
2024-11-15 13:09:10 +01:00
Olaoluwa Osuntokun
6db7d42654
lnwallet: add whoseCommit to FetchLeavesFromCommit
This is useful for additional context to know which commit the
AuxLeafStore is fetching the leaves for.
2024-11-15 13:09:10 +01:00
Olaoluwa Osuntokun
b8035d9db7
sweep: expand NotifyBroadcast to include an outpoint index
In this commit, we expand the `NotifyBroadcast` to include an outpoint
index. This is useful as it indicates the index of a given required tx
out input.
2024-11-15 13:09:09 +01:00
Olaoluwa Osuntokun
83f1c883ba
contractcourt: pass in new aux resolution blob to sweeper in resolvers
With this commit, we update all the resolvers to pass in the new htlc
resolution blobs. Along the way, we remove the old blocking guard on
this resolution logic for HTLCs with blobs.
2024-11-15 13:09:09 +01:00
Olaoluwa Osuntokun
f1a1c033d1
contractcourt: update encode/decode for taproot aux data
When we read/write the aux data, we need to make sure we always set the
new fields for aux HTLCs.
2024-11-15 13:09:09 +01:00
Olaoluwa Osuntokun
6914e6a4a5
contractcourt: add HtlcBlobs to taprootBriefcase
In this commit, we add the set of HtlcBlobs to the taprootBriefcase
struct. This new field will store all the resolution blobs for a given
HTLC. We also add some new property based tests along the way for
adequate test coverage.
2024-11-15 13:09:09 +01:00
Olaoluwa Osuntokun
413fdaf3fb
input: add new Preimage method to input.Input
In this commit, we add a new method to obtain an option of a preimage to
the input.Input struct. This is useful for callers that have an Input,
and want to optionally obtain the preimage.
2024-11-15 13:09:09 +01:00
Olaoluwa Osuntokun
e3eef0adff
lnwallet: populate resolution blob for incoming+outgoing HTLC resolutions
In this commit, we populate the resolution blobs for the incoming and
outgoing HTLCs. We take care to populate the AuxSigDesc with the correct
information, as we need to pass along the second-level aux signature and
also sign desc along with it.
2024-11-15 13:09:09 +01:00
Olaoluwa Osuntokun
84aacc6c39
channel: add ResolutionBlob to Incoming+Outgoing HtlcResolution
Similar to the other blobs we have for the commitment output force close
resolution, these blobs will be used to ensure that we have everything
needed to sweep aux HTLCs.
2024-11-15 13:09:08 +01:00
Olaoluwa Osuntokun
57617dc4f7
channel: always specify ChanType in ResolutionReq 2024-11-15 13:09:08 +01:00
Olaoluwa Osuntokun
a5beb340e4
lnwallet: expand attributes in ResolutionReq
In this commit, we add some additional attributes to the ResolutionReq
struct. These will be used to make sure that we can properly handle all
the HTLC variants, on chain.

The `AuxSigDesc` will be used to communicate if an HTLC needs to go to
the second level or not. It contains the second-level sig information
needed to finalize a broadcast to the second level.
2024-11-15 13:09:07 +01:00
Oliver Gugger
31ace742a5
Merge branch '0-18-4-branch-rc1-9084' into 0-18-4-branch-rc1 2024-11-13 12:52:32 +01:00
Matt Morehouse
2c25f38a5a
discovery: remove check for incorrect number of timestamps
The check is no longer required, as it is now done during decoding.
2024-11-13 12:52:32 +01:00
Matt Morehouse
c8033e1725
lnwire: fail decoding on incorrect number of timestamps
Currently if an incorrect number of timestamps is given, we fail later
on in the GossipSyncer. It makes more sense to fail right away, since we
already do that for incorrect SCID formats (e.g., unsorted or duplicate
SCIDs). There is already a matching check in Encode for incorrect number
of timestamps, so adding this check to Decode makes things symmetric.
2024-11-13 12:52:32 +01:00
Oliver Gugger
9bf48a7e9a
Merge branch '0-18-4-branch-rc1-9082' into 0-18-4-branch-rc1 2024-11-13 12:50:57 +01:00
Matt Morehouse
a4414fbbb9
lnwire: manually compare Timestamps in fuzz test
We can't use require.Equal because it considers nil slices and empty
slices to be not equal.
2024-11-13 12:50:56 +01:00
Oliver Gugger
af08c42d58
Merge branch '0-18-4-branch-rc1-9062' into 0-18-4-branch-rc1 2024-11-08 08:52:31 +01:00
Olaoluwa Osuntokun
b2b5ec052b
contractcourt: use the sweeper for HTLC offered remote timeout resolution
In this commit, we bring the timeout resolver more in line with the
success resolver by using the sweeper to handle the HTLC offered remote
timeout outputs. These are outputs that we can sweep directly from the
remote party's commitment transaction when they broadcast their version
of the commitment transaction.

With this change, we slim down the scope slightly by only doing this for
anchor channels. Non-anchor channels will continue to use the
utxonursery for this output type for now.
2024-11-08 08:52:31 +01:00
Olaoluwa Osuntokun
941590d384
contractcourt: use t.Run in TestHtlcTimeoutResolver
Along the way we refactor the test to eliminate some unnecessary line
length.
2024-11-08 08:52:30 +01:00
Oliver Gugger
906fa0b7b8
Merge branch '0-18-4-branch-rc1-9223' into 0-18-4-branch-rc1 2024-10-30 14:16:37 +01:00
Boris Nagaev
593afee12d
itest: coop_close_with_external_delivery with p2tr
Customize the itest with the type of external delivery address. Test with P2TR
address type in addition to P2WKPH.
2024-10-30 14:16:37 +01:00
Boris Nagaev
552d182594
lnwallet: fix closechannel for P2TR external addr
If the delivery address is P2TR, function InternalKeyForAddr checks its
existance in the wallet to return internal key for it in case it is a custom
taproot channel. It used to return the error returned by wallet.AddressInfo.
The error is now ignored if it is ErrAddressNotFound error. This fixes
"lncli closechannel --delivery_addr <external p2tr address" case.
2024-10-30 14:16:36 +01:00
Oliver Gugger
615f3d633e
Merge branch '0-18-4-branch-rc1-9199' into 0-18-4-branch-rc1 2024-10-25 11:00:09 +02:00
George Tsagkarelis
6f401b4265
invoices: cancel htlc on HtlcModify signal 2024-10-25 11:00:08 +02:00
George Tsagkarelis
2999b37607
lnrpc+invoices: add cancelSet to HtlcModifier interface 2024-10-25 11:00:08 +02:00
Oliver Gugger
b69fc15cc1
Merge branch '0-18-4-branch-rc1-9197' into 0-18-4-branch-rc1 2024-10-22 09:06:30 +02:00
Jonathan Harvey-Buschel
d650829f9b
gitignore: ignore vscode workspace files 2024-10-22 09:06:17 +02:00
Jonathan Harvey-Buschel
455cdffede
lnwallet: test link quit signal handling 2024-10-22 09:06:17 +02:00
Jonathan Harvey-Buschel
8703153c44
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-22 09:06:17 +02:00
Oliver Gugger
6feb74137d
mod: bump fn to v1.2.3 2024-10-22 09:06:15 +02:00
Jonathan Harvey-Buschel
753301cf38
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-22 09:05:42 +02:00
Jonathan Harvey-Buschel
afb7532f17
lnwallet: sort sig jobs before submission 2024-10-22 09:05:42 +02:00
Jonathan Harvey-Buschel
ed5d748a9f
lnwallet: test aux signer shutdown handling 2024-10-22 09:05:42 +02:00