Commit Graph

11012 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
f8dda6f0ee
Merge pull request #4865 from guggero/restore-logic-fix
chanrestore: flip case logic for old backup logic
2020-12-14 16:29:02 -08:00
Oliver Gugger
693d0f61b7
chanrestore: flip case logic
If a channel backup from an old node is restored and a channel contained
within that file was unconfirmed at the time of the backup, the whole
channel short ID is 0:0:0. Unfortunately we got stuck in just the first
case and didn't fall through to the second one. To avoid that, we flip
the case logic because for the second case, the block height in the
short channel ID cannot be zero.
2020-12-14 21:59:49 +01:00
Olaoluwa Osuntokun
90a45fe2cf
Merge pull request #4861 from guggero/go-version-update
GitHub+Travis+docker: update golang patch version to 1.15.6 everywhere
2020-12-14 12:31:35 -08:00
Oliver Gugger
91ed4d811e
GitHub+Travis: update to latest golang patch version 2020-12-12 11:26:00 +01:00
Oliver Gugger
e68c0bf18f
docker: update to latest golang base image 2020-12-12 11:25:22 +01:00
Oliver Gugger
71c19b480d
Merge pull request #4797 from Crypt-iQ/zpay32_fflags
make: add zpay32 to fuzz_flags.mk
2020-12-12 11:14:59 +01:00
Conner Fromknecht
4af24158c4
Merge pull request #4779 from halseth/anchor-htlc-aggregation
[anchors] HTLC second level aggregation in the sweeper
2020-12-11 16:22:17 -08:00
Olaoluwa Osuntokun
04e02a57ca
Merge pull request #4852 from guggero/docker-arm
GitHub: specify docker image platforms to enable ARM image builds
2020-12-11 14:30:18 -08:00
Olaoluwa Osuntokun
a623979e8f
Merge pull request #4856 from cfromknecht/lowscrypt-race
make: use low-scrypt + parallelization to speed up  unit-race
2020-12-11 14:29:17 -08:00
Olaoluwa Osuntokun
7c848baa52
Merge pull request #4858 from lightningnetwork/update-go-version-actions
actions: update to GO_VERSION 1.15.6
2020-12-11 14:28:01 -08:00
Olaoluwa Osuntokun
9554ea8d74
Merge pull request #4859 from guggero/neutrino-err-fix
itest: add neutrino errors to whitelist
2020-12-11 14:26:41 -08:00
Oliver Gugger
094545a300
itest: add neutrino errors to whitelist 2020-12-11 08:55:45 +01:00
Oliver Gugger
a2d4998962
GitHub: specify docker image platforms
To enable building docker images for ARM64 platforms as well,
we just need to specify the desired target platforms and the Docker
Buildx service will do the job for us (provided the base images support
the given platforms, which is the case for golang).
2020-12-11 08:51:33 +01:00
Conner Fromknecht
c2c520e431
make: pass dev tag to go-acc
Previously we were excluding non-dev test files from our coverage
report, which included interface_test.go as well as the bitcoindnotify
and btcdnotify dev tests.
2020-12-10 22:09:31 -08:00
Conner Fromknecht
ea8d02eb68
chainntnfs/test: parallelize iface tests by backend 2020-12-10 20:56:10 -08:00
Conner Fromknecht
24da512d1e
actions: update to GO_VERSION 1.15.6 2020-12-10 20:41:57 -08:00
Conner Fromknecht
d870bb5002
Merge pull request #4804 from wpaulino/proper-gossip-query-reply-chunk-splitting
discovery: adhere to proper channel chunk splitting for ReplyChannelRange
2020-12-10 18:10:07 -08:00
Olaoluwa Osuntokun
62a5cdbc60
Merge pull request #4857 from cfromknecht/meta-index-reinit
channeldb+tlv: add channel meta-index
2020-12-10 18:08:43 -08:00
Conner Fromknecht
0d57ff2432
lnwallet/test: execute ifacet tests for each backend in parallel 2020-12-10 17:42:26 -08:00
Conner Fromknecht
87787ce771
lnwallet: move interface_test.go to it's own package 2020-12-10 17:42:26 -08:00
Conner Fromknecht
1483ed119b
make: use low-scrypt to speed up unit-race
This predominately affects the lnwallet unit tests which are the bulk of
the execution time.
2020-12-10 17:42:26 -08:00
eugene
f4593f95f4
channeldb/migration20: TestMigrateOutpointIndex 2020-12-10 17:37:59 -08:00
eugene
204b6c51cf
channeldb: MigrateOutpointIndex, store indexStatus in outpoint index
Adds an outpoint index that stores a tlv stream. Currently the stream
only contains the outpoint's indexStatus. This should cut down on
big bbolt transactions in several places throughout the codebase.
2020-12-10 17:37:59 -08:00
Conner Fromknecht
08ee754a6d
channeldb/db: properly reinit wallet during Wipe
Previously we wouldn't recreate some of the top level buckets that are
now considered expected with our migration logic. This bug was
preexisting, but never surfaced because the other TLB buckets were not
touched by this unit test.
2020-12-10 17:37:58 -08:00
Olaoluwa Osuntokun
415680a1b9
Merge pull request #4854 from Roasbeef/neutrino-addrv2
build: update to addrv2 aware neutrino version
2020-12-10 15:36:43 -08:00
Johan T. Halseth
1627310fb0
itest: add HTLC aggregation test 2020-12-10 14:24:21 +01:00
Johan T. Halseth
42c51b662a
itest/channel_force_close test: handle HTLCs going through sweeper
Now that the HTLC second-level transactions are going through the
sweeper instead of the nursery, there are a few things we must account
for.
1. The sweeper sweeps the CSV locked HTLC output one block earlier than
   the nursery.
2. The sweeper aggregates several HTLC second levels into one
   transaction. This also means it is not enough to check txids of the
   transactions spent by the final sweep, but we must use the actual
   outpoint to distinguish.
2020-12-10 14:24:21 +01:00
Johan T. Halseth
4b9fbe2146
itest/local_chain_claim test: mine one less blocks for anchor sweeps
In case of anchor channel types, we mine one less block before we expect
the second level sweep to appear in the mempool, since the sweeper
sweeps one block earlier than the nursery.
2020-12-10 14:24:21 +01:00
Johan T. Halseth
70eb52643c
rpctest: increase sweeper BatchWindow during itests
Since we are checking HTLC aggregation, we must give the sweeper a bit
more time to aggregate them to avoid flakes.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
bb406c82a9
contractcourt/htlc_timeout_test: expand timeout tests 2020-12-10 14:24:20 +01:00
Johan T. Halseth
4992e41439
contraccourt+input: create resolver for timeout second level
In this commit we make the sweeper handle second level transactions for
HTLC timeout resolvers for anchor channels.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
0c3b64a3cd
contractcourt/timeout_resolver: extract logic into sweepSecondLevelTransaction
This commit moves the logic for sweeping the confirmed second-level
timeout transaction into its own method.

We do a small change to the logic: When setting the spending tx in the
report, we use the detected commitspend instead of the presigned tiemout
tx. This is to prepare for the coming change where the spending
transaction might actually be a re-signed timeout tx, and will therefore
have a different txid.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
2f33425509
contractcourt/timeout_resolver: extract logic into spendHtlcOutput
This commit moves the code doing the initial spend of the HTLC output of
the commit tx into its own method.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
aabba32b34
contractcourt: add TestHtlcSuccessSecondStageResolutionSweeper
Test success resolvers going through the sweeper.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
85ea181d67
contraccourt+input: create HtlcSecondLevelAnchorInput and resolver for
success tx

This commit makes the HTLC resolutions having non-nil SignDetails
(meaning we can re-sign the second-level transactions) go through the
sweeper. They will be offered to the sweeper which will cluster them and
arrange them on its sweep transaction. When that is done we will further
sweep the output on this sweep transaction as any other second-level tx.

In this commit we do this for the HTLC success resolver and the
accompanying HTLC success transaction.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
d02b486195
contractcourt: revamp HTLC success unit test
We add checkpoint assertions and resume the resolver from every
checkpoint to ensure it can handle restarts.
2020-12-10 14:24:20 +01:00
Johan T. Halseth
7142a302c9
contractcourt/success_resolver: remove sweep tx checkpoint
The sweep tx is not actually part of the resolver's encoded data, so the checkpointing was essentially a noop.
2020-12-10 14:24:19 +01:00
Johan T. Halseth
0b84d5f976
contractcourt/success_resolver: extract HTLC success handling into broadcastSuccessTx 2020-12-10 14:24:19 +01:00
Johan T. Halseth
9d33b00082
contractcourt/success_resolver: extract remoteHTLC sweep into resolveRemoteCommitOutput
This move the logic for sweeping the HTLC output on the remote
commitment into its own method.
2020-12-10 14:24:19 +01:00
Johan T. Halseth
9b08ef6d4e
contractcourt/[incoming|outgoing]_contest_resolver: make inner resolver pointer
To make the linter happy, make a pointer to the inner resolver.
Otherwise the linter would complain with

copylocks: literal copies lock value

since we'll add a mutex to the resolver in following commits.
2020-12-10 14:24:19 +01:00
Johan T. Halseth
4da2b290f9
contractcourt/succes+timeout resolver: extract waitForSpend logic 2020-12-10 14:24:19 +01:00
Johan T. Halseth
5f613147ad
contractcourt: decouple waitForHeight from commit sweep resolver
To make it usable from other resolvers.
2020-12-10 14:24:19 +01:00
Johan T. Halseth
65e50f6952
input/witnessgen: define witness type for HTLC 2nd level inputs
These will only be used for size upper bound estimations by the sweeper.
2020-12-10 14:24:19 +01:00
Johan T. Halseth
8eb6d7cf87
input/size: define witness constants needed
We define the witness constanst we need for fee estimation for this
HTLC second level type.
2020-12-10 14:24:19 +01:00
Johan T. Halseth
241e21a0d1
itest: use hex encoded hash in error message 2020-12-10 14:24:18 +01:00
Johan T. Halseth
09f2307d14
itest: increase htlc amt for local force close tests
Since the tests set a quite high fee rate before the node goes to chain,
the HTLCs wouldn't be economical to sweep at this fee rate.

Pre sweeper handling of the second-level transactions this was not a
problem, since the fees were set when the second-levels were created,
before the fee estimate was increased.
2020-12-10 14:24:18 +01:00
Johan T. Halseth
83f9aaec98
sweeper/tx_input_set: add logging for input set construction 2020-12-10 14:24:18 +01:00
Johan T. Halseth
6150995b46
sweep/txgenerator: log in case of no change output 2020-12-10 14:24:18 +01:00
Johan T. Halseth
1e68cdc8cf
input+lnwallet+contractcourt: define SignDetails for HTLC resolutions 2020-12-10 14:24:18 +01:00
Johan T. Halseth
eb8d22e194
lnwallet/channel: properly set SignDesc.Output
Only value was populated for some, which would cause code to rely on the
PkScript being there to fail.
2020-12-10 14:24:18 +01:00