Commit Graph

15301 Commits

Author SHA1 Message Date
yyforyongyu
5296509474
Makefile+action: add make unit-module to test submodules
This commit adds a new command `make unit-module` to run unit tests for
submodules to avoid future build errors.
2023-09-06 02:47:55 +08:00
yyforyongyu
08f4940e88
kvdb/sqlbase: fix params used in randRetryDelay 2023-09-06 02:47:55 +08:00
Oliver Gugger
f7cb44382e
Merge pull request #7944 from positiveblue/docker-build-img
multi: bump Go versions
2023-09-05 18:47:24 +00:00
positiveblue
49e099f0a0
lnrpc: run make rpc
The docker image have been updated so we are using another protobuf
version to generate the files. The generate files include the version of
the compiler used to creating them, so we need this commit to pass the
`rpc-check` step in our CI.
2023-09-05 10:11:51 -07:00
positiveblue
09d21345e1
multi: bump Go version
Bump all build go versions to v1.21.0
Bump the minimum build package version to v1.19.0

Debian "buster" is not longer supported. Security updates have been
discontinued since June 30th 2022. We will build using the latest
version, "bookworm".
2023-09-05 10:11:42 -07:00
Oliver Gugger
4d2481a0c3
Merge pull request #7957 from yyforyongyu/workspace-sync
gomod: sync versions for submodules
2023-09-05 13:05:35 +02:00
yyforyongyu
68e6cd5c2e
gomod: run go work sync to sync modules
This commit is the result of running `go work sync` and `go mod tidy`
that syncs module versions for all submodules.
2023-09-05 07:27:20 +08:00
yyforyongyu
61d882b999
gomod: fix version conflict in golang.org/x/time
This commit fixes the error,
```
go: version constraints conflict:
	github.com/dhui/dktest@v0.3.16 requires golang.org/x/time@v0.0.0-20220224211638-0e9765cccd65, but golang.org/x/time@v0.0.0-20210220033141-f8bda1e9f3ba is requested
	github.com/golang-migrate/migrate/v4@v4.16.1 requires golang.org/x/time@v0.0.0-20220224211638-0e9765cccd65, but golang.org/x/time@v0.0.0-20210220033141-f8bda1e9f3ba is requested
```

By calling `go get golang.org/x/time@v0.0.0-20220224211638-0e9765cccd65"
and `go mod tidy`.
2023-09-05 06:38:12 +08:00
yyforyongyu
036f2a0f03
kvdb: fix version conflict in github.com/ulikunitz/xz
Fix the following conflict,
```
go: conflicting replacements for github.com/ulikunitz/xz:
	github.com/ulikunitz/xz@v0.5.11
	github.com/ulikunitz/xz@v0.5.8
```
2023-09-05 05:48:36 +08:00
Olaoluwa Osuntokun
13568fd5b0
build: bump version to v0.17.0-rc2 (#7942) 2023-08-30 20:14:25 -07:00
Olaoluwa Osuntokun
01c64712a3
multi: ensure link is always torn down due to db failures, add exponential back off for sql-kvdb failures (#7927)
* lnwallet: fix log output msg

The log message is off by one.

* htlcswitch: fail channel when revoking it fails.

When the revocation of a channel state fails after receiving a new
CommitmentSigned msg we have to fail the channel otherwise we
continue with an unclean state.

* docs: update release-docs

* htlcswitch: tear down connection if revocation processing fails

If we couldn't revoke due to a DB error, then we want to also tear down
the connection, as we don't want the other party to continue to send
updates. That may lead to de-sync'd state an eventual force close.
Otherwise, the database might be able to recover come the next
reconnection attempt.

* kvdb: use sql.LevelSerializable for all backends

In this commit, we modify the default isolation level to be
`sql.LevelSerializable. This is the strictness isolation type for
postgres. For sqlite, there's only ever a single writer, so this doesn't
apply directly.

* kvdb/sqlbase: add randomized exponential backoff for serialization failures

In this commit, we add randomized exponential backoff for serialization
failures. For postgres, we''ll his this any time a transaction set fails
to be linearized. For sqlite, we'll his this if we have many writers
trying to grab the write lock at time same time, manifesting as a
`SQLITE_BUSY` error code.

As is, we'll retry up to 10 times, waiting a minimum of 50 miliseconds
between each attempt, up to 5 seconds without any delay at all. For
sqlite, this is also bounded by the busy timeout set, which applies on
top of this retry logic (block for busy timeout seconds, then apply this
back off logic).

* docs/release-notes: add entry for sqlite/postgres tx retry

---------

Co-authored-by: ziggie <ziggie1984@protonmail.com>
2023-08-30 16:48:00 -07:00
Olaoluwa Osuntokun
eb0d8af645
peer: eliminate circular waiting by calling maybeSendNodeAnn async (#7938)
In this commit, we attempt to fix circular waiting scenario introduced
inadvertently when [fixing a race condition
scenario](https://github.com/lightningnetwork/lnd/pull/7856). With that
PR, we added a new channel that would block `Disconnect`, and
`WaitForDisconnect` to ensure that only until the `Start` method has
finished would those calls be allowed to succeed.

The issue is that if the server is trying to disconnect a peer due to a
concurrent connection, but `Start` is blocked on `maybeSendNodeAnn`,
which then wants to grab the main server mutex, then `Start` can never
exit, which causes `startReady` to never be closed, which then causes
the server to be blocked.

This PR attempts to fix the issue by calling `maybeSendNodeAnn` in a
goroutine, so it can grab the server mutex and not block the `Start`
method.

Fixes https://github.com/lightningnetwork/lnd/issues/7924

Fixes https://github.com/lightningnetwork/lnd/issues/7928

Fixes https://github.com/lightningnetwork/lnd/issues/7866
2023-08-30 15:47:45 -07:00
Yong
d24f12bd0b
contractcourt: fix potential panic during startup (#7936)
Related to this fix 5a28582719, we may not
have the historical data for old channels so we skip it here too.
2023-08-29 10:27:09 -07:00
Oliver Gugger
73bf21e0f2
Merge pull request #7932 from guggero/psbt-funding-taproot-chans
psbt: fix channel funding address for simple taproot channels
2023-08-29 14:06:17 +02:00
Oliver Gugger
590dc0c3b3
itest: unify PSBT channel funding tests, add taproot
With this commit we unify three existing PSBT channel funding
integration tests into a single one with the goal of testing all three
cases with simple taproot channels as well.
2023-08-29 10:57:38 +02:00
Oliver Gugger
646444cdfe
chanfunding: fix PSBT funding for taproot chans 2023-08-29 10:57:38 +02:00
Oliver Gugger
c6fcceb35b
Merge pull request #7909 from patrickReiis/master
itest: fix typo [skip ci]
2023-08-28 16:39:40 +02:00
Jamal James
cbb4c27a44
docs: fix simple-taproot-channels typo [skip ci] (#7926) 2023-08-25 15:48:37 -07:00
Elle
15d2ff0c4d
netann+docs: remove nil value from variadic list (#7922)
The nil value in the variadic list causes a panic when the variadic
parameters are iterated over.
2023-08-24 11:47:42 -07:00
Olaoluwa Osuntokun
dde1495e1d
build: bump Go version to v1.21.0, lnd version to v0.17.0 rc1 (#7914)
* build: update Go version to 1.21.0

* build: bump version to v0.17.0 rc1
2023-08-23 17:33:11 -07:00
Suheb
c07ec0462c
docs/release-notes: update 0.17 release notes to new format (#7907)
Added a table of contents at the top and various sections to navigate to, to make it easy to parse and read the release notes.
2023-08-23 15:21:20 -07:00
Olaoluwa Osuntokun
251bcad899
Merge pull request #7877 from ellemouton/bumpOnion
multi: update lightning-onion version
2023-08-23 12:22:15 -07:00
P. Reis
5fc77b6ee5
doc: fix typo
Changed "chanenl" to "channel"
2023-08-23 12:55:01 -03:00
Elle Mouton
dfec4a65cb
multi: update lightning-onion version
Update the lighting-onion dependency to include the lates changes which
support route blinding.
2023-08-23 12:09:53 +02:00
Olaoluwa Osuntokun
e2f5374f67
Merge pull request #7904 from lightningnetwork/simple-taproot-chans-staging
multi: merge simple taproot channels staging branch into master
2023-08-22 19:24:31 -07:00
Olaoluwa Osuntokun
a87631c957
itest: add case for taproot chans to htlc timeout resolver itests 2023-08-22 17:43:51 -07:00
Olaoluwa Osuntokun
92da6b1d44
multi: fix linter warnings with updated linter 2023-08-22 16:34:47 -07:00
Olaoluwa Osuntokun
7506383074
itest: update zero conf multi-hop tests to remove extra blocks mined
In the master branch, the blocks are mined earlier, so we don't need to
mine an extra set.
2023-08-22 16:34:42 -07:00
Olaoluwa Osuntokun
562163ea3d
docs/release-notes: add release notes for taproot chans 2023-08-22 16:34:39 -07:00
Olaoluwa Osuntokun
3f8d33d7ab
funding: add SIMPLE_TAPROOT case to TestCommitmentTypeFundmaxSanityCheck 2023-08-22 16:34:36 -07:00
Olaoluwa Osuntokun
5f1e0bf772
multi: add new SCB version for the taproot chan type 2023-08-22 16:34:34 -07:00
Olaoluwa Osuntokun
94f45b2b82
itest: use explicit chan type negotiation for taproot chan cases
The prior commit removed implicit negotiation, so we'll need to make
sure to use the explicit chan type feature vector when we go to
negotiate.
2023-08-22 16:34:31 -07:00
Olaoluwa Osuntokun
384b1b1c12
feature: use +100 staging bit for taproot channels
In this commit, we carry out a new notion introduced during a recent
spec meeting to use a feature bit plus 100 before the feature has been
finalized in the spec.

We split into the Final and Staging bits.
2023-08-22 16:34:28 -07:00
Olaoluwa Osuntokun
fcbf6f2483
lnwallet: add taproot case to TestForceClose
This adds some extra assertions to ensure things like the taproot
commitment weight estimation is correct.
2023-08-22 16:34:25 -07:00
Olaoluwa Osuntokun
ff055ce0a4
lnwallet: uniformly use sighash default everywhere for taproot chans
We use a helper function to ensure that anytime we're about to make a
normal sighash, we consult the channel type to check if we should use
the default value or sighash all explicitly.
2023-08-22 16:34:23 -07:00
Olaoluwa Osuntokun
dd05dd55d4
funding: add explicit chan type support for zeroconf+scid+taproot
We also remove the old implicit negotiation as well, as we'll be
updating tests to use explciit when required.
2023-08-22 16:34:20 -07:00
Olaoluwa Osuntokun
4b65c71213
lnwallet: for musig2 coop close fee estimation
Co-op close for musig2 chans needs to use the proper witness size.
2023-08-22 16:34:17 -07:00
Olaoluwa Osuntokun
a2b277cf1d
multi: fix linter errors 2023-08-22 16:34:15 -07:00
Olaoluwa Osuntokun
d3e4bca772
itest: add taproot support to revocation itests 2023-08-22 16:34:12 -07:00
Olaoluwa Osuntokun
7c5be4d056
itest: add taproot support for all variants of runMultiHopHtlcClaimTest 2023-08-22 16:34:06 -07:00
Olaoluwa Osuntokun
5739061f13
lnwallet: add first+second level taptweaks to htlc retribution
The first and second level taptweaks need to be stored in order to
ensure the breach arb can play revocations at both the first and second
level.
2023-08-22 16:34:04 -07:00
Olaoluwa Osuntokun
28c086f1fc
htlcswitch: remove call to InitRemoteMusigNonces
In this commit, we remove the internal call to `InitRemoteMusigNonces`.
We don't need this since when we go to process the remote party's chan
reest message, we'll already call this method. Otherwise, we'll get an
error here since the pending verification nonce has been wiped out after
each call.
2023-08-22 16:34:02 -07:00
Olaoluwa Osuntokun
5379823346
itest: add taproot chans to testChannelForceClosure 2023-08-22 16:34:00 -07:00
Olaoluwa Osuntokun
82a5addd3d
lnwallet: add error logging to getSignedCommitTx 2023-08-22 16:33:58 -07:00
Olaoluwa Osuntokun
da3ab2728b
itest: add taproot chan support to basic channel funding
We keep in line with the existing test that uses implicit negotiation.
In the future, we should modify to also have explicit negotiation as
well.
2023-08-22 16:33:56 -07:00
Olaoluwa Osuntokun
2b952af629
feature+lncfg: restore simple- prefix for taproot chans arg 2023-08-22 16:33:54 -07:00
Olaoluwa Osuntokun
d98136e850
funding: add support for implicit negotiation for taproot chans
Otherwise, in the itests (which are mainly based on implicit
negotiation), we won't try to open taproot chans when we actually need
to.

We may want to revisit this however, since it may lock in parties trying
to use the defaults that aren't currently setting the explicit commit
type during funding.
2023-08-22 16:33:52 -07:00
Olaoluwa Osuntokun
bed9455d60
lnwallet: fix taproot co-op close nonce bug
The local nonce needs to be the one that's finalized to simulate us
receiving the remote nonce, then generating the local nonce in a JIT
style.
2023-08-22 16:33:50 -07:00
Olaoluwa Osuntokun
93e8428b6b
lnwallet: for taproot channels allow the co-op close tx to be RBF'd
This is a preparatory change for the upcoming "simple channel close"
feature which'll utilize RBF to allow either side to resign the co-op
close transaction for broadcast at any point.
2023-08-22 16:33:48 -07:00
Olaoluwa Osuntokun
4b0139c9ba
lnwallet: update channel state machine to use new ScriptDescriptor interface
In this commit, we update the channel state machine to use the new
ScriptDescriptor interface. This fixes some subtle issues with the
existing commits, as for p2wsh we always sign the same witness script,
but for p2tr, the witness script differs depending on which branch is
taken.

With the new abstractions, we can treat p2wsh and p2tr as the same
mostly, right up until we need to obtain a control block or a tap tweak.

All tests have been updated accordingly.
2023-08-22 16:33:46 -07:00