Commit Graph

11720 Commits

Author SHA1 Message Date
Johan T. Halseth
09b8bee865
mobile: remember walletunlocker.proto 2020-08-04 14:43:08 +02:00
Conner Fromknecht
f144dea3da
Merge pull request #4411 from bhandras/test_channeldb
kvdb+etcd+tests: change etcd flattened bucket key derivation to make it compatible with bbolt
2020-07-31 17:37:13 -07:00
Andras Banki-Horvath
5346ed8a5c
kvdb+etcd: assert on bucket/value key when putting value/bucket
This commit extends compatibility with the bbolt kvdb implementation,
which returns ErrIncompatibleValue in case of a bucket/value key
collision. Furthermore the commit also adds an extra precondition to the
transaction when a key doesn't exist. This is needed as we fix reads to
a snapshot revision and other writers may commit the key otherwise.
2020-08-01 00:29:01 +02:00
Conner Fromknecht
247b7530ca
build/version: use dot syntax for rc 2020-07-29 21:08:47 -07:00
Conner Fromknecht
608617975a
build/version: bump to 0.11.0-beta-rc1 2020-07-29 20:13:24 -07:00
Conner Fromknecht
26c363c6c6
Merge pull request #4494 from guggero/travis-sanity-check
travis: add sanity check stage
2020-07-29 17:03:08 -07:00
Olaoluwa Osuntokun
9f124ce6ad
Merge pull request #4438 from xplorfin/go1.13
chore: Update minimum golang version to 1.13
2020-07-29 16:55:33 -07:00
Olaoluwa Osuntokun
d36d22107c
Merge pull request #4432 from Crypt-iQ/peer_unsigned_fix_0702
channeldb+lnwallet: store updates the peer should sign under new key
2020-07-29 16:54:23 -07:00
nsa
c36840c2a5 lnwallet: add regression test TestChannelLocalUnsignedUpdatesFailure
This commit includes a regression test that checks that we remember
to restore updates that we sent to the peer but they haven't sent
us a signature for yet.
2020-07-29 19:03:44 -04:00
nsa
e4188ba9c2 channeldb+lnwallet: store updates the peer should sign under new key
This fixes a long-standing force close bug. When we receive a
revocation, store the updates that the remote should sign next under
a new database key. Previously, these were not persisted which would
lead to force closure.
2020-07-29 19:03:44 -04:00
Yaacov Akiba Slama
af01571fc6 Let invoice.Encode receive a function which hashes itself the message
Modify the SignCompact function passed to invoice.Encode to receive the
message before it's hashed and hash it itself.
With this modification, the SignMessage rpc function from the signrpc
subserver can be used and an invoice can be encoded outside of lnd.
2020-07-29 21:18:24 +03:00
Andras Banki-Horvath
b17ed28dea build: add all subservers to dev build 2020-07-29 14:33:25 +02:00
carla
2a614cc596
multi: add labels to lnd native transactions
Follow up labelling of external transactions with labels for the
transaction types we create within lnd. Since these labels will live
a life of string matching, a version number and rigid format is added
so that string matching is less painful. We start out with channel ID,
where available, and a transaction "type". External labels, added in a
previous PR, are not updated to this new versioned label because they
are not lnd-initiated transactions. Label matching can check this case,
then check for a version number.
2020-07-29 13:46:07 +02:00
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
yyforyongyu
86d5facaa2
docs: update no-macaroons option in macaroon 2020-07-22 22:53:46 +08:00
yyforyongyu
3a3b5413b9
lncfg: allow no auth on private addresses 2020-07-22 22:50:25 +08: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