Commit Graph

17355 Commits

Author SHA1 Message Date
d695383386 rpcserver: add robustness check 2024-11-20 10:42:54 +01:00
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
78c8990772 Merge branch '0-18-4-branch-rc1-9272' into 0-18-4-branch-rc1 2024-11-19 12:44:51 +01:00
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
4c9d25cbe7 Merge branch '0-18-4-branch-rc1-9194' into 0-18-4-branch-rc1 2024-11-15 13:09:56 +01:00
04b053e405 docs: move 0.18.4 items, add full list of custom chan PRs 2024-11-15 13:09:35 +01:00
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
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
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
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
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
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
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
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
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
57617dc4f7 channel: always specify ChanType in ResolutionReq 2024-11-15 13:09:08 +01:00
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
31ace742a5 Merge branch '0-18-4-branch-rc1-9084' into 0-18-4-branch-rc1 2024-11-13 12:52:32 +01:00
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
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
9bf48a7e9a Merge branch '0-18-4-branch-rc1-9082' into 0-18-4-branch-rc1 2024-11-13 12:50:57 +01:00
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
af08c42d58 Merge branch '0-18-4-branch-rc1-9062' into 0-18-4-branch-rc1 2024-11-08 08:52:31 +01:00
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
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
906fa0b7b8 Merge branch '0-18-4-branch-rc1-9223' into 0-18-4-branch-rc1 2024-10-30 14:16:37 +01:00
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
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
615f3d633e Merge branch '0-18-4-branch-rc1-9199' into 0-18-4-branch-rc1 2024-10-25 11:00:09 +02:00
6f401b4265 invoices: cancel htlc on HtlcModify signal 2024-10-25 11:00:08 +02:00
2999b37607 lnrpc+invoices: add cancelSet to HtlcModifier interface 2024-10-25 11:00:08 +02:00
b69fc15cc1 Merge branch '0-18-4-branch-rc1-9197' into 0-18-4-branch-rc1 2024-10-22 09:06:30 +02:00
d650829f9b gitignore: ignore vscode workspace files 2024-10-22 09:06:17 +02:00
455cdffede lnwallet: test link quit signal handling 2024-10-22 09:06:17 +02:00
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
6feb74137d mod: bump fn to v1.2.3 2024-10-22 09:06:15 +02:00
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
afb7532f17 lnwallet: sort sig jobs before submission 2024-10-22 09:05:42 +02:00
ed5d748a9f lnwallet: test aux signer shutdown handling 2024-10-22 09:05:42 +02:00
b6363a8da4 lnwallet: refactor test code for HTLC add and recv 2024-10-22 09:05:42 +02:00
afdd53194b multi: allow mock aux signer to customize sig jobs 2024-10-22 09:05:41 +02:00
6f0d7f9a87 Merge branch '0-18-4-branch-rc1-9195' into 0-18-4-branch-rc1 2024-10-21 13:26:23 +02:00
f09b638343 lntest: add method AssertTxnsNotInMempool
So we only need to do one `GetRawMempool` lookup when checking the
exclusion of multiple txns.
2024-10-21 13:26:09 +02:00
56e05a3e1e lntest: remove unused return value 2024-10-21 13:26:09 +02:00
1aae94f17d itest+lntest: stop using pointer to chainhash.Hash
This commit fixes the methods used in `lntest` so they stop using
pointers to chainhash.
2024-10-21 13:26:09 +02:00
3b8b738be9 Merge branch '0-18-4-branch-rc1-9059' into 0-18-4-branch-rc1 2024-10-16 16:00:25 +02:00
55e6460707 docs: add release notes 2024-10-16 15:59:54 +02:00
34ea769501 mod: fix unit tests by updating error matching in btcwallet 2024-10-16 15:59:52 +02:00
57e7b41510 lnwallet: turn off RBF detection in test 2024-10-16 15:58:00 +02:00
6aec5b00ad lntest: avoid port collision on Tor listen port
bitcoind now seems to listen on the -bind port at all times. So we need
to make sure multiple instances don't collide by using a unique port.
2024-10-16 15:58:00 +02:00