Commit Graph

10053 Commits

Author SHA1 Message Date
Oliver Gugger
77fc1ac68f
travis: add sanity check stage 2020-07-29 10:16:47 +02:00
Jake Sylvestre
678e5c5736 chore: Update minimum golang version to 1.13 2020-07-28 19:46:52 -04:00
Olaoluwa Osuntokun
a39c91fbcb
Merge pull request #4408 from guggero/travis-arm
travis: add integration test on ARM
2020-07-28 16:21:30 -07:00
Andras Banki-Horvath
12a341ba59
etcd: remove the lock set concept
This commit removes the lock set which was used to only add bucket keys
to the tx predicate while also bumping their mod version.
This was useful to reduce the size of the compare set but wasn't useful
to reduce contention as top level buckets were always in the lock set.
2020-07-28 17:57:30 +02:00
Andras Banki-Horvath
3cdbb341da
lnd: utxo nursery test to use channeldb.MakeTestDB 2020-07-28 17:57:30 +02:00
Andras Banki-Horvath
905990eb54
sweep: use channeldb.MakeTestDB 2020-07-28 17:57:30 +02:00
Andras Banki-Horvath
f2a08e420e
lnd: use channeldb.MakeTestDB in nursery store tests 2020-07-28 17:57:29 +02:00
Andras Banki-Horvath
cbce8e8872
channeldb: move makeTestDB out of test to make it available for other tests
This commit moves makeTestDB to db.go and exports it so that we'll be
able to use this function in other unit tests to make them testable with
etcd if needed.
2020-07-28 17:57:29 +02:00
Andras Banki-Horvath
63e9d6102f
kvdb+etcd: change flattened bucket key derivation algorithm
This commit changes the key derivation algo we use to emulate buckets
similar to bbolt. The issue with prefixing keys with either a bucket or
a value prefix is that the cursor couldn't effectively iterate trough
all keys in a bucket, as it skipped the bucket keys.
While there are multiple ways to fix that issue (eg. two pointers,
iterating value keys then bucket keys, etc), the cleanest is to instead
of prefixes in keys we use a postfix indicating whether a key is a
bucket or a value. This also simplifies all operations where we
(recursively) iterate a bucket and is equivalent with the prefixing key
derivation with the addition that bucket and value keys are now
continous.
2020-07-28 17:57:29 +02:00
Andras Banki-Horvath
9173958f9c
kvdb: s/hu/en/g 2020-07-28 17:57:28 +02:00
Andras Banki-Horvath
70a69ce990
kvdb: make etcd tests use testify require instead of assert 2020-07-28 17:57:24 +02:00
Conner Fromknecht
22cd1203fe
Merge pull request #4431 from Crypt-iQ/unsigned_acked_fix_0702
channeldb/channel.go: remove unsignedAckedUpdatesKey when we receive revocation
2020-07-27 16:19:28 -07:00
nsa
b6eff5b0ec lnwallet: add regression test TestChannelUnsignedAckedFailure
This commit includes a regression test that checks that a force
close won't occur and that unsigned acked updates are properly
restored.
2020-07-27 16:18:11 -04:00
nsa
8c002a08a7 lnwallet: properly restore removeCommitHeightRemote
Previously, we could sign a pending commitment for the remote party,
disconnect, and not restore these signed remote updates as having been
removed at the pending commitment height. This commit fixes that to
look up whether the update under the unsigned acked updates key is
present on the pending commitment or not and appropriately set
the remove commit heights.
2020-07-27 15:41:48 -04:00
nsa
2149157d49 channeldb: filter out unsigned acked updates in AdvanceCommitChainTail
This commit moves the deletion of all updates under the unsigned
acked updates key from AppendRemoteCommitChain to
AdvanceCommitChainTail. This is done because if we went down after
signing for these updates but before receiving a revocation, we would
incorrectly reject their commitment signature:

Alice                Bob
      -----add----->
      -----sig----->
      <----rev------
      <----sig------
      -----rev----->
      <----fail-----
      <----sig------
      -----rev----->
      -----sig----->
      *reconnect*
      <----rev------
      <----add------
      x----sig------

It is also important to note that filtering is required when we
receive a revocation to ensure that we aren't erroneously deleting
remote updates. Take the following state transitions:

 Alice                Bob
       -----add----->
       -----sig----->
       <----rev------
       <----sig------
       -----rev----->
       -----add----->
       -----sig----->
       <----fail-----
       <----sig------
       -----rev-----> (alice stores updates here)
       <----rev------

In the above case, if Alice deleted all updates rather than filtering
when receiving the final revocation from Bob, then Alice would have
to force close the channel due to missing updates. Since Alice hasn't
signed for any of the unsigned acked updates, she should not filter any
of them out.
2020-07-27 15:41:48 -04:00
Conner Fromknecht
36eb666cb7
Merge pull request #4480 from CandleHater/patch-1
lncli: remove new line from password confirmation
2020-07-27 12:10:47 -07:00
Olaoluwa Osuntokun
2aff7d0bb8
Merge pull request #4390 from bhandras/etcd_docs
docs: documentation for the experimental etcd feature
2020-07-27 11:44:12 -07:00
Conner Fromknecht
5b376bfdb8
Merge pull request #4430 from Crypt-iQ/sync_bug_fix_0701
lnwallet/channel.go: restore bug fixes
2020-07-27 11:25:52 -07:00
Olaoluwa Osuntokun
da16a196a3
Merge pull request #4488 from cfromknecht/enforce-min-cltv-18
multi: enforce conservative minimum for user-chosen CLTV deltas
2020-07-27 11:18:08 -07:00
Oliver Gugger
da447233c8
mod: update to latest x/crypto version w/o broken ARM assembly
This update previously happened in 1589810 but was overwritten again by
a later PR. We need to use a version that doesn't include the broken ARM
assembly for poly1305. We might as well use the latest version of the
library.
2020-07-27 14:15:44 +02:00
Oliver Gugger
ecca1f9653
itest: fix flakiness around/startup/reconnect 2020-07-27 14:15:36 +02:00
Conner Fromknecht
53ab22305d
zpay32: rename to DefaultAssumedFinalCLTVDelta
This renames the paramter to clarify that this value is only used when
no CLTV value was decoded from the payment request
2020-07-24 13:14:03 -07:00
Conner Fromknecht
6622c4814e
multi: enforce routing.MinCLTVDelta=18 for invoices + chanupd
This commit clamps all user-chosen CLTVs in LND to be at least 18, which
is the new conservative value used in the sepc. This minimum is applied
uniformly to forwarding CLTV deltas (via channel updates) as well as
final CLTV deltas for new invoices.
2020-07-24 13:13:56 -07:00
Conner Fromknecht
213c51a281
channeldb/migration_01_to_11: isolate zpay32 decoding
This commit copies over the relevant zpay32 decoding logic to ensure
that our prior migrations aren't affected by upcoming changes to the
zpay32 package, most notably changes to the default final_cltv_expiry
and expiry values.
2020-07-24 13:13:47 -07:00
Conner Fromknecht
73256e6d0e
zpay32: fix linter errors in encode/decode 2020-07-24 13:13:39 -07:00
Conner Fromknecht
49c601e62a
zpay32: split off encoding/decoding into own files
As a preliminary step to isolating zpay32 in migrations 01-11, we'll
split out the encoding and decoding logic into separate files. Migration
11 only requires invoice decoding, so this prevents us from needing to
copy in the encoding logic that would otherwise be unused.
2020-07-24 13:13:29 -07:00
Oliver Gugger
5d5e6c369d
travis: add integration test on ARMv7 (32bit) 2020-07-24 09:49:43 +02:00
Johan T. Halseth
e64e71d86d
Merge pull request #4482 from guggero/travis-github-split
github+travis: split CI tasks between Travis and GitHub
2020-07-24 09:42:14 +02:00
Oliver Gugger
17b8b7ea0c
github+travis: split CI tasks between Travis and GitHub
To free up build in Travis, we decided to run the non-flaky parts of
the CI pipeline in GitHub Workflows/Actions only. The integration tests
on the other hand are removed from GitHub because individual actions
cannot be restarted there which caused us to restart the whole workflow
if one test was flaky.

This split should give us the best of both worlds: Fast run of small
checks, linting and unit tests with an easy overview of what failed in
the PR directly. And more free build slots on Travis to do more advanced
integration tests on other architectures and/or operating systems. And
the option to restart a single flaky integration test on Travis.
2020-07-23 15:06:05 +02:00
Oliver Gugger
8d2a3ce8ac
github: add mobile compilation to GitHub workflow 2020-07-23 15:06:04 +02:00
Candle
c8ad071011 lncli: remove new line from password confirmation
The password instruction in the same function and many other related
outputs use Printf except of Println.
2020-07-22 22:48:44 +02:00
nsa
3ec081af84 lnwallet: correct fetchParent godoc 2020-07-21 10:45:57 -04:00
nsa
73757eb84d lnwallet: properly set addCommitHeightLocal in restoreStateLogs
The `restoreStateLogs` function now properly restores the
`addCommitHeightLocal` field of a settle or fail's parent add.
Previously, any updates' parent in unsignedAckedUpdates would have
the field set to the default value of 0. This would cause a force
closure when receiving a commitment due to our belt-and-suspenders
checks for update logs during commitment validation.

The bug in question occurs because the `addCommitHeightLocal` field
is only populated for a restored add if the add is on the local
commitment. `TestChannelRestoreCommitHeight` is expanded in
`lnwallet/channel_test.go` to demonstrate restoration now works.

The faulty state transition:
```
<----fail----
<----sig-----
-----rev----> (add no longer on Alice's commitment)
*Alice restores* (addCommitHeightLocal of failed htlc is 0)
```

NOTE: Alice dies after sending a revocation but before signing a
commitment. This is possible because there is a select block in the link
that can potentially exit after sending over the revocation but before
signing the next commitment state for the counterparty.
2020-07-21 10:45:57 -04:00
Olaoluwa Osuntokun
cfbc365c20
Merge pull request #4478 from bjarnemagnussen/features-typos
lnwire: fix minor typos in wumbo features
2020-07-20 16:34:13 -07:00
Olaoluwa Osuntokun
14a047ffba
Merge pull request #4455 from cfromknecht/psbt-no-publish
PSBT: add no_publish flag for safe batch channel opens v2
2020-07-20 12:04:10 -07:00
Bjarne Magnussen
954e292895
lnwire: fix minor typos in wumbo features 2020-07-20 08:36:39 +02:00
András Bánki-Horváth
77549f1fb8
Merge pull request #4384 from bhandras/atpl_bc_topk
add modified greedy topK centrality heuristic to autopilot
2020-07-17 18:27:42 +01:00
Andras Banki-Horvath
afbbeae4f2
autopilot+test: testify betweenness centrality tests
The commit also reindents the source to conform with ts=8 guideline.
2020-07-17 16:12:55 +02:00
Andras Banki-Horvath
ccabad8607
autopilot: add TopCentrality to the available heuristics 2020-07-17 16:12:54 +02:00
Andras Banki-Horvath
8373b2ad20
autopilot: add greedy "TopK" centrality heuristic
This commit creates a new autopilot heuristic which simply returns
normalized betweenness centrality values for the current graph. This
new heuristic will make it possible to prefer nodes with large
centrality when we're trying to open channels. The heuristic is also
somewhat dumb as it doesn't try to figure out the best nodes, as that'd
require adding ghost edges to the graph recalculating the centrality as
many times as many nodes there are (minus the one we already have
channels with).
2020-07-17 16:12:54 +02:00
Andras Banki-Horvath
82ddccee0b
autopilot+test: make centrality test data available for other tests 2020-07-17 16:12:53 +02:00
Andras Banki-Horvath
906b0b707b
atpl: remove unneeded extra filter on address availability
This commit removes an extra filter on address availability which is not
needed as the scored nodes are a already prefiltered subset of the whole
graph where address availability has already been checked.
2020-07-17 16:12:48 +02:00
Johan T. Halseth
0fab14502d
Merge pull request #4467 from cfromknecht/hh-cache-followup
chainntfns: disable height-hint cache followups
2020-07-17 09:57:37 +02:00
Johan T. Halseth
9d147c55d7
Merge pull request #4469 from halseth/mobile-global-config
mobile+make: restore mobile compilation
2020-07-17 09:55:35 +02:00
Johan T. Halseth
935fa7f12d
make+mobile: pass expected falafel version to build script 2020-07-17 08:49:03 +02:00
Johan T. Halseth
39241dcdc7
mobile: use single brackets for bash if check
Double brackets are sh specific.
2020-07-17 08:49:03 +02:00
Johan T. Halseth
d41ca81aad
make: add goimports dep
Required by mobile bindings generate script.
2020-07-17 08:49:02 +02:00
Johan T. Halseth
b55b7025b0
travis: sanity check mobile build compilation 2020-07-17 08:49:02 +02:00
Johan T. Halseth
fd8e6c98b9
make: fetch falafel dependency for mobile-rpc 2020-07-17 08:49:02 +02:00
Johan T. Halseth
7a30332619
mobile: use single "mobile" build tag instead of "ios" and "android"
Since the "android" build tag conflicts with a go compiler build tag, we instead use a single "mobile" tag for both platforms.
2020-07-17 08:49:02 +02:00