Commit Graph

11740 Commits

Author SHA1 Message Date
yyforyongyu
0759771134
itest: move channel openning related tests into one file
This commit creates the file lnd_open_channel_test.go to hold channel
opeopenning related tests.
2021-07-13 14:58:59 +08:00
yyforyongyu
12ca07c089
itest: move testFundingPersistence to lnd_funding_test.go 2021-07-13 14:58:59 +08:00
yyforyongyu
47c40373de
itest: move channel policy update test into one file 2021-07-13 14:58:58 +08:00
yyforyongyu
3f78a5da10
itest: move channel force close test into one file 2021-07-13 14:58:58 +08:00
yyforyongyu
e3f2cf1711
itest: move switch related tests into one file
This commit creates the lnd_switch_test.go file to hold switch related
tests, further breaking down the lnd_test.go file.
2021-07-13 14:58:58 +08:00
yyforyongyu
6ca068660c
itest: move revocation related tests into one file
This commit creates a new file lnd_revocation_test.go to hold
revocation-related tests, further breaking down the lnd_test.go file.
2021-07-13 14:58:56 +08:00
yyforyongyu
f62cdf7bfc
itest: move payment related tests into one file
This commit creates a new file lnd_payment_test.go to hold all payment
related tests, further breaking down the old large lnd_test.go.
2021-07-13 14:52:08 +08:00
yyforyongyu
b657a977e3
itest: refactor assertNumConnections to use wait.NoError
This commit refactors the function assertNumConnections to use
wait.NoError. Prior to this commit, `make lint` will fail on this
function. While fixing it, it's noticed that wait.NoError suits the
case so it's refactored to use it.
2021-07-13 14:52:08 +08:00
yyforyongyu
0612ced087
itest: use require in assertions 2021-07-13 14:52:08 +08:00
yyforyongyu
6f0da73ee1
itest: move assertions into one file
This commit breaks down the lnd_test.go file by moving assertion-related
functions into the file assertions.go.
2021-07-13 14:52:08 +08:00
Olaoluwa Osuntokun
c23d6fb0e2
Merge pull request #5504 from Zero-1729/patch-1
README: minor typo fix
2021-07-12 18:19:16 -07:00
Joost Jager
e9cba1a526
kvdb/test: add bolt test 2021-07-12 11:31:11 +02:00
Joost Jager
f592375d1b
kvdb/test: fix cursor tests to match bbolt semantics
From bbolt docs:
// Seek positions the cursor at the passed seek key. If the key does not exist,
// the cursor is moved to the next key after seek. Returns the new pair.
2021-07-12 11:31:09 +02:00
Joost Jager
84490466be
kvdb/test: remove invalid operations
Accessing buckets that have been removed is not an allowed operation.
2021-07-12 11:31:07 +02:00
Joost Jager
3c6d35ec41
kvdb/test: generalize etcd tests 2021-07-12 11:31:05 +02:00
Abubakar Nur Khalil
c93e309f49
README: minor grammar fix 2021-07-11 00:55:18 +01:00
Olaoluwa Osuntokun
c733c139e9
Merge pull request #5462 from ErikEk/typo-labeltx
trivial: walletrpc typo
2021-07-09 17:36:21 -07:00
Olaoluwa Osuntokun
8df611f74c
Merge pull request #5472 from joostjager/filter-leases
btcwallet: filter out expired leases
2021-07-09 17:31:03 -07:00
Olaoluwa Osuntokun
7e4b2b82f1
Merge pull request #5448 from xanoni/sample-lnd-conf-cleanup
sample-lnd.conf: remove duplicate setting and clean up section separators
2021-07-09 14:37:32 -07:00
Olaoluwa Osuntokun
ab1149f26d
Merge pull request #5471 from joostjager/db-itest-prep
itest: prepare for multiple db backends
2021-07-09 14:37:06 -07:00
Olaoluwa Osuntokun
47732ec59e
Merge pull request #5475 from katokishin/patch-1
Fixed typo in comment
2021-07-09 14:35:50 -07:00
Olaoluwa Osuntokun
ccd7421488
Merge pull request #5487 from C-Otto/fix-5367
htlcswitch: log amount for failures
2021-07-09 14:35:31 -07:00
Olaoluwa Osuntokun
db3819fcef
Merge pull request #5236 from offerm/preimage-to-settleevent
feature: expose preimage in forward+settle event
2021-07-09 14:35:11 -07:00
Carsten Otto
0396220b71 htlcswitch: log amount for failures
fixes #5367
2021-07-08 20:33:00 +02:00
Joost Jager
3026e5a826
build: bump btcwallet 2021-07-08 14:34:16 +02:00
Olaoluwa Osuntokun
583dee9916
Merge pull request #5479 from Roasbeef/fix-send-to-route-error-propagation
lnrpc/routerrrpc+routing: fix send to route error propagation
2021-07-07 16:01:56 -07:00
Olaoluwa Osuntokun
079ab1c2bf
channeldb: fix typo in PaymentControl.Fail 2021-07-07 15:31:27 -07:00
Olaoluwa Osuntokun
525ef594c7
routing: don't return an error from failPayment within handleSendError
In this commit, we fix a regression introduced by a recent bug fix in
this area. Before this change, we'd inspect the error returned by
`processSendError`, and then fail the payment from the PoV of mission
control using the returned error.

A recent refactoring removed `processSendError` and combined the logic
with `tryApplyChannelUpdate` in order to introduce a new
`handleSendError` method that consolidates the logic within the
`shardHandler`. Along the way, the behavior of the prior check was
replicated in the form of a new internal `failPayment` closure. However,
the new function closure ends up returning a `channeldb.FailureReason`
instance, which is actually an `error`.

In the wild, when `SendToRoute` fails due to an error at the
destination, then this new logic caused the `handleSendErorr` method to
fail with an error, returning an unstructured error back to the caller,
instead of the usual payment failure details.

We fix this by no longer checking the `handleSendErorr` for an error as
normal. The `handleSendErorr` function as is will always return an error
of type `*channeldb.FailureReason`, therefore we don't need to treat it
as a normal error. Instead, we check for the type of error returned, and
update the control tower state accordingly.

With this commit, the test added in the prior commit now passes.

Fixes #5477.
2021-07-07 15:31:22 -07:00
Olaoluwa Osuntokun
b24edb2833
routing: modify TestSendToRouteStructuredError to return non-second chance error
In this commit, we modify the existing `TestSendToRouteStructuredError`
test to return an error that doesn't trigger the second chance logic.
Otherwise, we'll get a nil failure result from the mission control
interpretation, meaning we won't exercise the full code path. Instead,
we use a terminal error to ensure that the expected code path is hit.

As is, this test will fail as a recent refactoring causes us to return a
`channeldb.FailureReason` error, since the newly added `handleSendError`
code path in the `SendToRoute` method will return the raw error, rather
than the `shardError`, which is of the expected type.
2021-07-07 15:31:19 -07:00
Olaoluwa Osuntokun
9c9f821ded
Merge pull request #5478 from Roasbeef/fix-may-add-htlc
lnwallet: fix payment regression introduced by MayAddOutgoingHtlc
2021-07-07 14:35:03 -07:00
Olaoluwa Osuntokun
af43a863cb
lnwallet: ensure MayAddOutgoingHtlc doesn't add zero-value HTLCs
In this commit, in order to allow the test added in the prior commit to
pass, we'll increment the mockHTLCAmt value by 1 to ensure we never
attempt to add a zero value HTLC.

Fixes #5468
2021-07-06 16:50:19 -07:00
Olaoluwa Osuntokun
49b18b4d35
lnwallet: add test case to exercise MayAddOutgoingHtlc bug
As is, if the remote party proposes a min HTLC of 0 `mSat` to us, then
we won't ever be able to _send outgoing_ in the channel as the
`MayAddOutgoingHtlc` will attempt to add a zero-value HTLC, which isn't
allowed within the protocol.

The default channels created actually already use a min HTLC value of
zero within the tests, so this test case fails as is.
2021-07-06 16:50:14 -07:00
Olaoluwa Osuntokun
bb5c3f3b51
Merge pull request #5447 from bhandras/etcd_le_docs
docs: leader election docs
2021-07-06 16:43:40 -07:00
Andras Banki-Horvath
f41771ce54
docs: leader election docs 2021-07-06 16:21:26 +02:00
Kishin Kato
e264e67764
Fixed typo in comment
Caught a typo, fixed it.
2021-07-06 18:35:54 +09:00
Joost Jager
98e75b486d
itest: add db backend flag 2021-07-05 10:10:02 +02:00
Joost Jager
387f1ef274
lntest: abstract db backup and restore 2021-07-05 09:20:19 +02:00
Olaoluwa Osuntokun
756a0ab392
Merge pull request #5463 from Roasbeef/v0.13.1-rc1-branch-prep
lnd: v0.13.1 rc1 branch prep
2021-07-02 17:40:46 -07:00
Olaoluwa Osuntokun
f67d4d346b
docs/release-notes: update release notes for 0.13.1 2021-07-01 18:26:10 -07:00
Olaoluwa Osuntokun
39ac0ebe41
lntest/itest: add new whitelisted error 2021-07-01 18:26:04 -07:00
Olaoluwa Osuntokun
2a59c43d14
Merge pull request #5457 from guggero/wallet-password-file-fallback
lnd+config+sample-lnd.conf: add wallet-unlock-allow-create flag
2021-07-01 18:04:38 -07:00
Olaoluwa Osuntokun
6d5ab035c5
Merge pull request #5280 from champo/interceptor_dont_leak_htlcs
htlcswitch: set sourceRef when resolving packets through interceptor
2021-07-01 17:35:26 -07:00
ErikEk
fec18f4e16 trivial-typo-walletrpc 2021-07-02 01:36:16 +02:00
Oliver Gugger
6ca38bc815
lnd+config+sample-lnd.conf: add wallet-unlock-allow-create flag
As requested by users of node bundle software. They want to use the
wallet-unlock-password-file configuration option in their
default/template config file. This makes the first-time lnd setup a bit
more tricky since lnd will fail with an error if no wallet exists yet
while that config option is used.
The new wallet-unlock-allow-create option instructs lnd to not fail if
no wallet exists yet but instead spin up its unlocker RPC as it would
without the wallet-unlock-password-file being present.
This is not recommended for auto-provisioned or high-security systems
because the wallet creation RPC is unauthenticated and an attacker could
inject a seed while lnd is in that state.
2021-07-01 11:10:25 +02:00
Olaoluwa Osuntokun
b04efec130
Merge pull request #5452 from guggero/export-aezeed
aezeed: export wordlist and properties
2021-06-30 17:58:11 -07:00
Olaoluwa Osuntokun
3dc375603f
Merge pull request #5441 from joostjager/cli-fix-fund-psbt
lncli: fix psbt fund parameter parsing
2021-06-30 17:56:34 -07:00
Olaoluwa Osuntokun
0ff5187dfe
Merge pull request #5371 from bitcoincore-dev/docs-dev-testing
docs: bump docker lnd dev and testing version
2021-06-30 17:56:04 -07:00
Juan Pablo Civile
6e4528515e lntest/itest: verify HTLC interceptor renotification bug 2021-06-30 09:42:52 -03:00
Oliver Gugger
5904efe9ed
aezeed: export wordlist and properties
To make it possible to use the wordlist used for aezeed outside of the
aezeed package we export certain properties of the word list and the
word list itself.
2021-06-30 14:20:32 +02:00
xanoni
54b55b924a sample-lnd.conf: remove duplicate setting
Remove duplicate `nolisten` setting in sample-lnd.conf
2021-06-30 01:17:16 -04:00