Commit graph

14678 commits

Author SHA1 Message Date
yyforyongyu
e207424da8 docs: update release notes for mempool watch 2023-04-18 18:29:20 -07:00
yyforyongyu
7149b12cd9 itest+lntest: add itest for mempool preimage watch 2023-04-18 18:28:28 -07:00
yyforyongyu
946b4f0184 lntest: add more methods to assert mempool state 2023-04-18 18:28:28 -07:00
yyforyongyu
c15a38407f lnd+contractcourt: add more debug logs
This commit adds more debug logs for witness beacon and channel
arbitrator.
2023-04-18 18:28:28 -07:00
yyforyongyu
f9b1250ecf chainntnfs: remove subscriptions when the relevant tx is confirmed
This commit removes the subscribed inputs from mempool notifier when the
relevant transaction is confirmed.
2023-04-18 18:28:28 -07:00
yyforyongyu
1fa269425e contractcourt+lnd: watch for preimage reveal in mempool
This commit extends the current htlc timeout resolver to also watch for
preimage spend in mempool for a full node backend.

If mempool enabled, the resolver will watch the spend of the htlc output
in mempool and blocks **concurrently**, as if they are independent.

Ideally, a transaction will first appear in mempool then in a block.
However, there's no guarantee it will appear in **our** mempool since
there's no global mempool, thus we need to watch the spend in two places
in case it doesn't go through our mempool.

The current design favors the spend event found in blocks, that is, when
the tx is confirmed, we'd abort the monitoring and conitnue since the
outpoint cannot be double spent and re-appear in mempool again. This is
not true in the rare case of reorg, and we will handle reorg seperately.
2023-04-18 18:28:28 -07:00
yyforyongyu
2fac0af553 contractcourt: refactor spendHtlcOutput for clarity
Also fixes the docs and rename `isSuccessSpend` to `isPreimageSpend`.
2023-04-18 18:28:28 -07:00
yyforyongyu
b765c44539 chainntnfs+chainreg: add interface MempoolWatcher
This commit adds the interface `MempoolWatcher` and uses it in the chain
registry.
2023-04-18 18:28:28 -07:00
yyforyongyu
0e1aaad6d4 chainntnfs+chainreg: add mempool watcher to BtcdNotifier
This commit adds the mempool watcher to btcd notifier to allow the
notifier managing the starting and stopping of the watcher.
2023-04-18 18:28:28 -07:00
yyforyongyu
bf839461b4 chainntnfs+chainreg: add mempool watcher to BitcoindNotifier
This commit adds the mempool watcher to bitcoind notifier to allow the
notifier managing the starting and stopping of the watcher.
2023-04-18 18:28:28 -07:00
yyforyongyu
76ba68091f chainntnfs: patch unit tests for mempool notifier 2023-04-18 18:28:28 -07:00
yyforyongyu
35d1bff321 chainntnfs: add method UnsubscribeEvent to cancel a subscription
This commit adds the method `UnsubscribeEvent` to cancel a single
subscription.
2023-04-18 18:28:27 -07:00
yyforyongyu
318efa4c33 chainntnfs: allow multiple subscriber to the same input
This commit changes the `subscribedInputs` to store a map of subscribers
so multiple subscribers are allowed to receive events from the same
outpoint.
2023-04-18 18:28:27 -07:00
yyforyongyu
208628d7f2 chainntnfs: introduce mempool notifier
This commit adds a mempool notifier which notifies the subscriber the
spending event found in the mempool for a given input.
2023-04-18 18:28:27 -07:00
Olaoluwa Osuntokun
28ab3d5ccb Merge branch 'v0-16-1-branch-rc1-7597' into v0-16-1-branch-rc1 2023-04-18 18:27:36 -07:00
Oliver Gugger
a53b0a483c docs: add release notes 2023-04-18 18:27:36 -07:00
Oliver Gugger
24e1a0ec7d peer: add TODO about initial forwarding policy
The right way to solve the problem of the link not being up to date with
custom user set forwarding policies once the channel is announced would
be to pass in those custom values when the link is created initially.
This requires a bit more of a refactor and is not addressed in this bug
fix.
2023-04-18 18:27:36 -07:00
Oliver Gugger
3c4ba857cc itest: update channel open test to send payment
This commit enhances the custom fee policy channel open test by adding a
second channel and testing forwarding payments through the channel with
the custom forwarding policies.
This was able to reproduce the bug reported in #5796 which was fixed in
a previous commit of this PR.
2023-04-18 18:27:36 -07:00
Oliver Gugger
4cf9d7c982 itest: move lnd_custom_{message => message_test}.go
This recently added file didn't follow the golang naming convention for
tests.
2023-04-18 18:27:36 -07:00
Oliver Gugger
a74793ecbc funding+server: update switch after sending channel update
With this commit we give the funding manager the ability to inform the
switch about custom channel policies, right after we've announced the
channel to the network.
This change is necessary because before #6753 a channel could only be
opened with the default forwarding policies, so the switch automatically
had the "correct" default values. Since #6753 added the ability to
specify forwarding policies at channel open time, we announced those
policies to the network but never updated the switch to inform it about
the changed policies (previously changing the policies was only possible
through the UpdateChannelPolicy RPC which did call the switch).
2023-04-18 18:27:36 -07:00
Oliver Gugger
16f428f580 funding: refactor manager test 2023-04-18 18:27:36 -07:00
Olaoluwa Osuntokun
a49671d076 Merge branch 'v0-16-1-branch-rc1-7604' into v0-16-1-branch-rc1 2023-04-18 18:27:05 -07:00
ziggie
261461deeb docs: update release notes 2023-04-18 18:27:05 -07:00
ziggie
7ab6eb1140 netann: fix logging output 2023-04-18 18:27:05 -07:00
Olaoluwa Osuntokun
70bad093a9 Merge branch 'v0-16-1-branch-rc1-7603' into v0-16-1-branch-rc1 2023-04-18 18:26:44 -07:00
Torakushi
4e402082b3 update release-notes-0.16.1 2023-04-18 18:26:44 -07:00
Torakushi
02be618935 funding: use p2tr by default for batch_open_channel
In LND v0.15.1, batch_open_channel used p2tr by default
for change output. However, in a later version, a breaking
change has been fixed in FundPSBT to make the change type
configurable (default to p2wkh). As batch_open_channel
uses FundPsbt, we need to put back p2tr as default for
change output
2023-04-18 18:26:44 -07:00
Olaoluwa Osuntokun
239fda1894 Merge branch 'v0-16-1-branch-rc1-7473' into v0-16-1-branch-rc1 2023-04-18 18:24:42 -07:00
Emilio Ziniades
32b117b9df lnrpc: test witness type mapping 2023-04-18 18:24:42 -07:00
Emilio Ziniades
43660c2c31 input: note to update witness type protobuf 2023-04-18 18:24:42 -07:00
Emilio Ziniades
aca89c38aa lnrpc: add allWitnessTypes map
Refactor `PendingSweeps` to use `allWitnessTypes` map, and
return an error from `PendingSweeps` if an unknown witness
type is used, instead of logging a warning.
2023-04-18 18:24:42 -07:00
Emilio Ziniades
44dcfec947 lnrpc: update and regenerate witness type proto 2023-04-18 18:24:42 -07:00
Olaoluwa Osuntokun
cf88d105f3 Merge branch 'v0-16-1-branch-rc1-7464' into v0-16-1-branch-rc1 2023-04-18 18:24:01 -07:00
Oliver Gugger
91448274fa docs: add release notes 2023-04-18 18:24:01 -07:00
Oliver Gugger
2509000878 channeldb: use input.GenMultiSigScript 2023-04-18 18:24:01 -07:00
Oliver Gugger
7401de3348 input: set initial script allocation size
The default allocation of 500 bytes for the script that is
used in NewScriptBuilder is way too much for most of our scripts.
With the new functional option we can tune the allocation to exactly
what we need.
2023-04-18 18:24:01 -07:00
Oliver Gugger
020d79f18e input: add script size unit and benchmark tests 2023-04-18 18:24:01 -07:00
Oliver Gugger
3a4ab10806 mod: bump btcd version 2023-04-18 18:24:01 -07:00
Olaoluwa Osuntokun
6c8932a4e1 Merge branch 'v0-16-1-branch-rc1-7593' into v0-16-1-branch-rc1 2023-04-18 18:23:25 -07:00
Oliver Gugger
a7815b29f5 docs: update remote signing docs
With this commit we update the docs according to the latest changes that
were necessary to support loop and pool (which requires all 255
internally used accounts to be imported at wallet creation time).

Fixes #7567.
2023-04-18 18:23:25 -07:00
Olaoluwa Osuntokun
b129e10da3 Merge branch 'v0-16-1-branch-rc1-7588' into v0-16-1-branch-rc1 2023-04-18 18:23:03 -07:00
Olaoluwa Osuntokun
d5be710b95 config: fix bug in walletrpc interaction due to mismatched coin type
In this commit, we fix a bug that would cause the walletrpc on the
simnet chain to not be able to respond to all RPC calls. The issue is
that for the SimNet backend, within chainparams.go:
6e0a67d05b/chainreg/chainparams.go (L45-L51),
we set a new CoinType for Simnet in order to match the RegTest value.

Later on, when we go to verify the on disk accounts against the
in-memory cointype, we fall through to an error case as the in-memory
cointype is 115, while the on disk cointype is 1.

To fix this, when we know we're doing simnet mode, we'll override the
cointype similar to the way we did/do for LTC.

Fixes https://github.com/lightningnetwork/lnd/issues/6807.
2023-04-18 18:23:03 -07:00
Olaoluwa Osuntokun
350f4293c7 Merge branch 'v0-16-1-branch-rc1-7513' into v0-16-1-branch-rc1 2023-04-18 18:22:32 -07:00
Oliver Gugger
c95205a94f docs: add release notes 2023-04-18 18:22:32 -07:00
Olaoluwa Osuntokun
2ded805858 Merge branch 'v0-16-1-branch-rc1-7563' into v0-16-1-branch-rc1 2023-04-18 18:21:49 -07:00
yyforyongyu
0b8ac4870d lnutils: add unit test for SyncMap 2023-04-18 18:21:49 -07:00
yyforyongyu
3d167b2687 lnutils: add methods ForEach, Len and LoadOrStore to SyncMap 2023-04-18 18:21:49 -07:00
Olaoluwa Osuntokun
86fb0d7b51 Merge branch 'v0-16-1-branch-rc1-7442' into v0-16-1-branch-rc1 2023-04-18 18:21:24 -07:00
84adam
2115e338ca docs: add notes on contents of Postgres DB as Key-Value store to Postgres.md 2023-04-18 18:21:24 -07:00
Olaoluwa Osuntokun
eba78e6786 Merge branch 'v0-16-1-branch-rc1-7582' into v0-16-1-branch-rc1 2023-04-18 18:20:58 -07:00