Commit Graph

14739 Commits

Author SHA1 Message Date
Oliver Gugger
0bc82d3038
Merge pull request #7637 from yyforyongyu/fix-itest-panic
Fix panic when canceling rebroadcast for neutrino backend
2023-04-26 08:58:39 +02:00
yyforyongyu
403c1baca6
lnd: skip canceling rebroadcast for neutrino backend 2023-04-26 10:38:13 +08:00
Oliver Gugger
4355ce62d2
Merge pull request #7623 from ellemouton/queueBackupIDOnly
wtclient: queue backup id only
2023-04-24 15:36:09 +02:00
Elle Mouton
9a1ed8c7b2
docs: update release notes 2023-04-24 13:15:40 +02:00
Elle Mouton
08cde98869
wtclient: add mutex locking in perUpdate
Lock the `backupMu` when accessing `c.chanCommitHeights` in the `New`
function. It is not strictly necessary right now but good to add it so
that there is no accidental oversight if the `perUpdate` method is ever
extracted and reused in future.
2023-04-24 13:15:40 +02:00
Elle Mouton
65dc20f2cc
wtclient: let task pipeline only carry wtdb.BackupID
Since the retrubution info of a backup task is now only constructed at
the time that the task is being bound to a session, the in-memory queue
only needs to carry the BackupID of the task.
2023-04-24 13:15:40 +02:00
Elle Mouton
2371bbf09a
wtclient: only fetch retribution info when needed.
Only construct the retribution info at the time that the backup task is
being bound to a session.
2023-04-24 13:15:40 +02:00
Elle Mouton
458ac32146
multi: build retribution info in TowerClient
Since the TowerClient now has a callback that it can use to retrieve the
retribution for a certain channel and commit height, let it use this
call back instead of requiring the info to be passed to it through
BackupState.
2023-04-24 13:15:40 +02:00
Elle Mouton
530a8cae5d
wtclient: lint the package
This commit fixes some lints in the wtclient package. This is done so
that upcoming logic changes are easier to parse.
2023-04-24 13:15:40 +02:00
Elle Mouton
85ec38f447
multi: pass BuildBreachRetribution callback to tower client
In this commit, a new BuildBreachRetribution callback is added to the
tower client's Config struct. The main LND server provides the client
with an implementation of the callback.
2023-04-24 13:15:40 +02:00
Elle Mouton
fe2304efad
channeldb: add a FetchChannelByID method
Add a FetchChannelByID method that allows a caller to fetch an
OpenChannel using an lnwire.ChannelID.
2023-04-24 13:15:40 +02:00
Elle Mouton
63442cbe51
channeldb: factor out generic FetchChannel logic
This commit introduces a new `channelSelector` method and moves all
generic logic from `FetchChannel` to it. This refactor will make it
easier to add new methods that require the same open-channel db
traversal with slightly different channel selection logic.
2023-04-24 13:15:39 +02:00
Elle Mouton
908cb6060b
channeldb: optimise FetchChannel method
This commit adds a small optimisation to the FetchChannel method.
Instead of iterating over each channel bucket, an identifiable error is
thrown once the wanted channel is found so that the iteration can stop
early.
2023-04-24 13:10:13 +02:00
Elle Mouton
aebdd2375c
channeldb: lint FetchChannel method
A few lint fixes of the FetchChannel method.
2023-04-24 13:10:12 +02:00
Elle Mouton
cab0560d5e
wtclient: cleanup the test file
This commit just does some linting of the client_test.go file so that
future commits are easier to parse.
2023-04-24 13:10:12 +02:00
Olaoluwa Osuntokun
588a7eb9ca
Merge pull request #7599 from Roasbeef/sweeper-rebroadcaster-interaction
sweep: remove conflicted sweep txns from the rebroadcaster
2023-04-21 13:58:50 -07:00
Olaoluwa Osuntokun
3d2daeefd8
sweep: remove conflicted sweep txns from the rebroadcaster
In this commit, we an existing gap in our rebroadcast handling logic. As
is, if we're trying to sweep a transaction and a conflicting transaction
is mined (timeout lands on chain, anchor swept), then we'll continue to
try to rebroadcast the tx in the background.

To resolve this, we give the sweeper a new closure function that it can
use to mark conflicted transactions as no longer requiring rebroadcast.
2023-04-21 11:53:08 -07:00
Oliver Gugger
aff6d4c958
Merge pull request #7614 from yyforyongyu/fix-pprof-err
lntest+lnd: gracefully shutdown pprof server
2023-04-21 14:23:51 +02:00
yyforyongyu
e547118de0
lntest: increase channel close timeout 2023-04-20 18:52:46 +08:00
yyforyongyu
24c028ff52
lntest: make sure error from shutdown is caught 2023-04-20 18:52:46 +08:00
yyforyongyu
4243c5b95f
lnd: properly shutdown the optional pprof server
This commit makes sure when lnd is shutting down, the optional pprof
server is also gracefully shutting down.
2023-04-20 18:52:46 +08:00
Olaoluwa Osuntokun
f56c9e9c8a
Merge pull request #7609 from Roasbeef/80-block-cltv
chainreg: increase default CLTV value to 80 blocks (~13 hrs)
2023-04-19 11:42:27 -07:00
Olaoluwa Osuntokun
7e1628d89d
chainreg: increase default CLTV value to 80 blocks (~13 hrs)
In this commit, we increase the default CTLV value to 80 blocks.
Initially this was set to 144 blocks in the early days, but then was
lowered to 40 blocks as the lnd implementation matured. By setting this
to a higher value, we increase the safety window (MTTR) when it comes to
node downtime, and also add some buffer room around time locks which may
become more stressed in the future assuming the current mempool load
remains persistent.
2023-04-19 11:39:37 -07:00
Olaoluwa Osuntokun
d908becf73
Merge pull request #7613 from ellemouton/fndMgrDefaultPolicyValuesFix
funding: use default forwarding policy if persisted values not found
2023-04-19 11:29:23 -07:00
Elle Mouton
784dc8d530
funding: use default fwding policy if persisted values not found
In this commit, a bug is fixed in the funding manager that could result
in the funding process erroring out if the persisted initial forwarding
policy is not found. This could occur if a node restarts after opening a
channel that is not yet fully confirmed and also upgrades their node
from a pre-0.16 version to 0.16 since the values are only expected to be
persisted after 0.16.
2023-04-19 11:51:32 +02:00
Oliver Gugger
d9396741fa
Merge pull request #7607 from yyforyongyu/itest-fix-close-chan
lntest: add temporary wait when closing channels
2023-04-19 10:48:43 +02:00
Oliver Gugger
68dc01977c
Merge pull request #7608 from morehouse/docker_autoclean
make: clean up container after linting
2023-04-19 10:39:09 +02:00
Olaoluwa Osuntokun
ec3cb6939a
Merge pull request #7564 from yyforyongyu/mempool-watch
contractcourt: add mempool watcher to notify mempool events
2023-04-18 14:22:23 -07:00
Matt Morehouse
526075be57
make: clean up container after linting
Currently `make lint` creates a new container each time it runs. We can
automatically delete these containers once linting is done by using the
--rm flag.
2023-04-18 15:20:14 -05:00
yyforyongyu
66d1392f7f
chainreg: update bitcoind polling config 2023-04-19 01:24:04 +08:00
yyforyongyu
d5db1950cd
mod: update btcwallet version 2023-04-19 01:18:20 +08:00
yyforyongyu
f72d6dfaf5
docs: update release notes for mempool watch 2023-04-19 01:18:20 +08:00
yyforyongyu
e715b8ed1f
itest+lntest: add itest for mempool preimage watch 2023-04-19 01:18:19 +08:00
yyforyongyu
774db0dfe1
lntest: add more methods to assert mempool state 2023-04-19 01:18:19 +08:00
yyforyongyu
dccf9c77ca
lnd+contractcourt: add more debug logs
This commit adds more debug logs for witness beacon and channel
arbitrator.
2023-04-19 01:18:19 +08:00
yyforyongyu
e9c10bf0a1
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-19 01:18:19 +08:00
yyforyongyu
556c38fefd
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-19 01:18:19 +08:00
yyforyongyu
7ef8072724
contractcourt: refactor spendHtlcOutput for clarity
Also fixes the docs and rename `isSuccessSpend` to `isPreimageSpend`.
2023-04-19 01:18:19 +08:00
yyforyongyu
e81d62fc70
chainntnfs+chainreg: add interface MempoolWatcher
This commit adds the interface `MempoolWatcher` and uses it in the chain
registry.
2023-04-19 01:18:19 +08:00
yyforyongyu
ad5e798392
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-19 01:18:18 +08:00
yyforyongyu
454e76cbb6
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-19 01:18:18 +08:00
yyforyongyu
8b42151edc
chainntnfs: patch unit tests for mempool notifier 2023-04-19 01:18:18 +08:00
yyforyongyu
3b77e9c51f
chainntnfs: add method UnsubscribeEvent to cancel a subscription
This commit adds the method `UnsubscribeEvent` to cancel a single
subscription.
2023-04-19 01:18:18 +08:00
yyforyongyu
5743dd9601
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-19 01:18:18 +08:00
yyforyongyu
81ee3b9fbe
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-19 01:18:18 +08:00
yyforyongyu
6aaca568c1
lntest: add temporary wait when closing channels
A temporary solution to avoid the `link failed to shutdown` error.
2023-04-19 01:07:04 +08:00
Oliver Gugger
517f8ed842
Merge pull request #7597 from guggero/persistent-fee-params
Update `channelLink` policy correctly when opening channel with custom fee parameters
2023-04-18 13:36:24 +02:00
Oliver Gugger
d54bc8974a
docs: add release notes 2023-04-18 11:48:49 +02:00
Oliver Gugger
5fbaed6b06
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 11:47:03 +02:00
Oliver Gugger
7eafdd0e08
Merge pull request #7604 from ziggie1984/fmt-fix
Log Output Fix (Missing Value)
2023-04-18 11:04:54 +02:00