Commit Graph

14505 Commits

Author SHA1 Message Date
yyforyongyu
baeb78e2cc
lntemp+itest: refactor testSwitchCircuitPersistence 2023-01-18 10:53:52 +08:00
Oliver Gugger
de94a4ea5e
Merge pull request #7157 from yyforyongyu/fix-peer
brontide: retry enabling channels
2023-01-17 23:37:44 +01:00
positiveblue
057d38e2fc
docs: update release notes 2023-01-17 14:26:48 -08:00
positiveblue
0a4f062e22
routing: fix race condition in TestUpdatePaymentState
The test cases in `TestUpdatePaymentState` run in parallel. One of the
parameters is a pointer and the value to the struct it points to gets
modified during the test.

The race condition was introduced in 8d49dfb07e
To test the fix run from the main folder `go test  ./routing/. -race`
before this fix and after.
2023-01-17 14:26:37 -08:00
yyforyongyu
b558c9c23e
docs: update release notes 2023-01-18 03:46:17 +08:00
yyforyongyu
a012a5e2ff
peer: skip retrying when reenableTimeout is greater than 1 min
This commit makes retrying enabling channels conditional. We now would
only retry sending the enable request when the `ChanActiveTimeout` is no
greater than 1 min.
2023-01-18 03:46:17 +08:00
yyforyongyu
2f9ba1594c
peer: retry enabling channels on ErrEnableInactiveChan
This commit adds a retry logic to the channels that failed with
`ErrEnableInactiveChan` when requesting enabling. We now subscribe the
channel events to decide what to do with the failed channels.
2023-01-18 03:46:16 +08:00
yyforyongyu
a81d4e9c5c
peer: add filterChannelsToEnable to filter channels for enabling 2023-01-18 03:46:16 +08:00
yyforyongyu
f632a58b3b
htlcswitch+peer: notify inactive link event when htlcManager exits 2023-01-18 03:46:16 +08:00
yyforyongyu
ced8833895
channelnotifier: add InactiveLinkEvent
This commit adds a new event `InactiveLinkEvent` to be used when a link
becomes inactive.
2023-01-18 03:46:16 +08:00
Oliver Gugger
d960fcd68a
multi: remove gomnd disable directives 2023-01-17 19:43:26 +01:00
Oliver Gugger
a306cbdec9
lint: disable gomnd 2023-01-17 19:20:57 +01:00
Olaoluwa Osuntokun
ea0eb2ce72
Merge pull request #7215 from positiveblue/invoices-channeldb-dep
Invoices: invert package dependency with `channeldb`
2023-01-17 10:13:22 -08:00
Oliver Gugger
04447927ea
Merge pull request #7055 from ellemouton/wtclientMigrations
watchtower: reduce AckedUpdate storage footprint
2023-01-17 10:37:52 +01:00
Oliver Gugger
b4febb382a
Merge pull request #6823 from yyforyongyu/4-new-itest
itest: continued itest refactor and fix - III
2023-01-17 09:38:31 +01:00
yyforyongyu
00a7909447
docs: update release docs 2023-01-17 07:34:48 +08:00
yyforyongyu
d4b2798570
itest: make sure SendToRoute stream is recieved with timeout 2023-01-17 07:34:48 +08:00
yyforyongyu
23ec7b23e1
lntemp: make sure mempool is synced when funding nodes 2023-01-17 07:26:58 +08:00
yyforyongyu
3353643006
itest: fix test testListPayments 2023-01-17 07:26:58 +08:00
yyforyongyu
fe376385d1
lntemp+lntest: fix make lint 2023-01-17 07:26:58 +08:00
yyforyongyu
f9ede5af73
funding+lnwallet: add more debug logs 2023-01-17 07:26:57 +08:00
yyforyongyu
59578d9f1a
routing: add more verbose logs 2023-01-17 07:26:57 +08:00
yyforyongyu
bc0bdfefc2
itest: refactor testWipeForwardingPackages 2023-01-17 07:26:57 +08:00
yyforyongyu
05f198f34e
itest: refactor testSingleHopInvoice 2023-01-17 07:26:57 +08:00
yyforyongyu
8a4d2741a3
lntemp+itest: refactor testStatelessInit 2023-01-17 07:26:57 +08:00
yyforyongyu
4b469eb0c5
itest: refactor testDeleteMacaroonID 2023-01-17 07:26:57 +08:00
yyforyongyu
64bf6f4e26
itest: refactor testBakeMacaroon 2023-01-17 07:26:57 +08:00
yyforyongyu
9794dbd7b2
itest: refactor testMacaroonAuthentication 2023-01-17 07:26:56 +08:00
yyforyongyu
84278d6a49
lntemp+itest: refactor testRPCMiddlewareInterceptor 2023-01-17 07:26:56 +08:00
yyforyongyu
ad77a45112
lntemp+itest: refactor node restart process
This commit refactors how the node restart is done. It removes the usage
of `HasSeed` and replaces it with `SkipUnlock` for clarity.
2023-01-17 07:26:56 +08:00
yyforyongyu
368635ef95
lntemp+itest: refactor testRouteFeeCutoff 2023-01-17 07:26:56 +08:00
yyforyongyu
b2dc9d8393
lntemp+itest: refactor testQueryRoutes 2023-01-17 07:26:56 +08:00
yyforyongyu
ba6a722ad8
itest: refactor testMultiHopOverPrivateChannels 2023-01-17 07:26:56 +08:00
yyforyongyu
5536f16d4b
itest: refactor testInvoiceRoutingHints 2023-01-17 07:26:56 +08:00
yyforyongyu
2ce93afd70
itest: refactor testPrivateChannels 2023-01-17 07:26:55 +08:00
yyforyongyu
25b6ff3336
itest: refactor testSendToRouteErrorPropagation 2023-01-17 07:26:55 +08:00
Oliver Gugger
be77572fa0
Merge pull request #7115 from C-Otto/log
lnwallet: add log message for edge case
2023-01-16 18:18:10 +01:00
positiveblue
4665770aaf
docs: update release notes
- Added a new entry for the changes in this PR.
- Properly format older entries.
- Delete duplicated contributors.
2023-01-16 07:31:14 -08:00
positiveblue
824e792dc2
config: expose the InvoiceDB interface in DatabaseInstances
By now the only implementation is still the one in channeldb but other
project can use their custom implementations if needed.
2023-01-16 07:31:13 -08:00
positiveblue
5ff5225245
multi: break invoice depenency on channeldb
Now that we have the new package `lnd/channeldb/models` we can invert the
depenency between `channeldb` and `invoices`.

- Move all the invoice related types and errors to the
`invoices` package.

- Ensure that all the packages dealing with invoices use the types and
  interfaces defined in the `invoices` package.

- Implement the InvoiceDB interface (defined in `lnd/invoices`) in
  channeldb.

- Add new mock for InterfaceDB.

- `InvoiceRegistery` tests are now in its own subpacakge (they need to
  import both invoices & channeldb). This is temporary until we can
  decouple them.
2023-01-16 07:31:09 -08:00
positiveblue
383cb40f8d
multi: create channeldb/models package
Add a new subpackage to `lnd/channeldb` to hold some of the types that
are used in the package itself and in other packages that should not
depend on `channeldb`.
2023-01-16 07:14:55 -08:00
Carsten Otto
7f7a1e041d lnwallet: add log message for edge case
also see discussion in #7108
2023-01-16 12:26:04 +01:00
positiveblue
c602ac07e7
chainntnfs: move cache implementation to channeldb
This commit moves the `HeightHintCache` implementation to the
`channeldb` package and inverts the dependency relation between
`chainntnfs` and `channeldb`.

Many packages depend on channeldb for type definitions,
interfaces, etc. `chainntnfs` is an example of that. `chainntnfs`
defines the  `SpendHintCache` and `ConfirmHintCache` interfaces but
it also implments them (`HeightHintCache` struct). The implementation
uses logic that should not leak from channeldb (ex: bucket paths).
This makes our code highly coupled + it would not allow us to use any
of these interfaces in a package that is imported by `channeldb`
(circular dependency).
2023-01-16 03:13:17 -08:00
Oliver Gugger
681da4b2b5
Merge pull request #7321 from bshramin/fix-selfsigned-typos
Fix typos in selfsigned.go
2023-01-16 09:54:08 +01:00
yyforyongyu
787883870b
itest: refactor testMultiHopSendToRoute 2023-01-16 16:49:20 +08:00
yyforyongyu
c5785967aa
lntemp+itest: refactor testSingleHopSendToRoute 2023-01-16 16:49:19 +08:00
yyforyongyu
ede86cf08f
itest: send one more UTXO for neutrino backend
Send another UTXO if this is a neutrino backend. When sweeping anchors,
there are two transactions created, `local_sweep_tx` for sweeping
Alice's anchor on the local commitment, `remote_sweep_tx` for sweeping
her anchor on the remote commitment. Whenever the force close
transaction is published, Alice will always create these two
transactions to sweep her anchor.

On the other hand, when creating the sweep txes, the anchor itself is
not able to cover the fee, so another wallet UTXO is needed.  In our
test case, there's a change output that can be used from the above
funding process. And it's used by both sweep txes - when `lnd` happens
to create the `remote_sweep_tx` first, it will receive an error since
its parent tx, the remote commitment, is not known, hence freeing the
change output to be used by `local_sweep_tx`.  For neutrino client,
however, it will consider the transaction which sweeps the remote anchor
as an orphan tx, and it will neither send it to the mempool nor return
an error to free the change output.  Thus, if the change output is
already used in `remote_sweep_tx`, we won't have UTXO to create
`local_sweep_tx`.
2023-01-16 16:49:19 +08:00
yyforyongyu
8df5de3e43
lntest+itest: make sure mempool is cleaned in watcher tower test
This commit adds the missing check for anchor sweep in test
`revoked_uncooperative_close_retribution_altruist_watchtower`, also
change the mempool check a bit so it's easier to track.
2023-01-16 16:49:19 +08:00
yyforyongyu
6792ca17b4
lntemp+itest: refactor testRevokedCloseRetributionAltruistWatchtower 2023-01-16 16:49:19 +08:00
yyforyongyu
211aa4c6f2
itest: refactor testRevokedCloseRetributionRemoteHodl 2023-01-16 16:49:19 +08:00