Commit Graph

11720 Commits

Author SHA1 Message Date
Joost Jager
9b1b92bf98
lncli: fix psbt fund parameter parsing
The sat_per_vbyte parameter was ignored because of a default value for
conf_target.
2021-06-28 11:23:13 +02:00
yyforyongyu
4a23c08b60
routing: rename method and add err check when launch shard
A followup commit for PR#5332. In this commit we add more docs, rename
function updatePaymentState to fetchePaymentState, and add back the
check for channeldb.ErrPaymentTerminal after we launch shard.
2021-06-27 17:48:32 +08:00
Olaoluwa Osuntokun
e62f0e1f3a
Merge pull request #5429 from Roasbeef/itest-recovery-shutdown
lntest: retry node shutdown attempts to recovery tests
2021-06-24 18:43:39 -07:00
Olaoluwa Osuntokun
198ac3482c
Merge pull request #5332 from yyforyongyu/5259-routing-fix-state
routing: fix payment state and refactor payment lifecycle tests
2021-06-24 18:42:17 -07:00
Olaoluwa Osuntokun
6a97e6432d
Merge pull request #5419 from LN-Zap/upstream/fix-no-payment-address
lnd: only set payment address if not empty in PaymentRequest
2021-06-24 15:46:41 -07:00
Olaoluwa Osuntokun
5bd84e2a60
lntest: retry node shutdown attempts to recovery tests
In #5364 we added a new error path in the `StopDaemon` method to return
an error if shutdown was attempted while a rescan/recover instance was
in progress. Since the wallet actually won't fully stop (atm)
mid-recovery, the call effectively didn't do anything in that scenario,
so we started to return an error to properly reflect that. However this
causes certain itests to fail, as during recovery, the stop attempt will
fail leading to the test itself failing.

In this commit, we wrap the calls to stop a running daemon within a
`wait.NoError` call so we'll continually try to shut down the daemon
rather than quit on the first try.

Fixes #5423.
2021-06-24 15:37:32 -07:00
Olaoluwa Osuntokun
6dd7321a3f
Merge pull request #5355 from carlaKC/4656-maxhtlcnumber
multi: set zero bandwidth hint for channels that do not have any available slots
2021-06-24 15:18:20 -07:00
Wilmer Paulino
6bbe790535
lnwallet: prevent anchor reserve enforcement on legacy inbound channel
This commit aims to address a flaw in our anchor reserve enforcement
logic in which an inbound "legacy" channel (i.e. a channel with a
commitment type that precedes anchors) would be rejected by the
recipient if they have at least one opened channel using the anchors
commitment type and do not have enough on-chain funds to meet the
anchors reserve.
2021-06-23 18:24:31 -07:00
Wilmer Paulino
d7299802d4
itest: extend testAnchorReservedValue to open additional channels
We do this to trigger a bug that will be resolved in a follow-up commit.
This bug prevents inbound legacy channels from being rejected by the
recipient if they have at least one anchor channel already opened
without an on-chain balance.
2021-06-23 18:24:30 -07:00
Olaoluwa Osuntokun
1287328678
Merge pull request #5335 from guggero/abandonchannel-no-dev
RPC/CLI: Allow abandonchannel to be used in regular build
2021-06-23 16:05:34 -07:00
yyforyongyu
cd35981569
routing: refactor update payment state tests
This commit refactors the resumePayment to extract some logics back to
paymentState so that the code is more testable. It also adds unit tests
for paymentState, and breaks the original MPPayment tests into independent tests
so that it's easier to maintain and debug. All the new tests are built
using mock so that the control flow is eaiser to setup and change.
2021-06-23 20:35:29 +08:00
yyforyongyu
e79e46ed21
routing: add mock structs for testing
This commit uses the package mock to create new mock structs, replacing
the old ones for better control when writing tests.
2021-06-23 20:35:29 +08:00
yyforyongyu
f5de56a40d
mod: add package stretchr/testify mock 2021-06-23 20:35:29 +08:00
yyforyongyu
289d97fbfb
routing: rename mock structs to make them obsolete
This commit renames the mock structs by appending Old in their names. In
doing so the old tests stay unchanged and new mock structs can be added
in the following commit.
2021-06-23 20:35:28 +08:00
yyforyongyu
54ed6c271b
itest: silence depreciation warnings 2021-06-23 20:35:28 +08:00
yyforyongyu
193d149d48
itest: test channel policy update in private channels 2021-06-23 20:35:28 +08:00
yyforyongyu
319cc533a6
itest: fix make lint 2021-06-23 20:35:28 +08:00
yyforyongyu
e10bd84a4f
itest: moving routing related tests into one file 2021-06-23 20:35:23 +08:00
yyforyongyu
735e89ca37
routing: add TestSendPaymentPrivateEdgeUpdateFeeExceedsLimit 2021-06-23 18:13:04 +08:00
yyforyongyu
e05b78fb9c
routing: refactor TestSendPaymentErrorFeeInsufficientPrivateEdge 2021-06-23 18:13:04 +08:00
yyforyongyu
f31001e103
routing: make shardHandler aware of payment session
This commit adds payment session to shardHandler to enable private edge
policies being updated in shardHandler. The relevant interface and mock
are updated. From now on, upon seeing a ChannelUpdate message,
shardHandler will first try to find the target policy in additionalEdges
and update it. If nothing found, it will then check the database for
edge policy to update.
2021-06-23 18:13:04 +08:00
yyforyongyu
5df776e80b
routing: add method UpdateAdditionalEdge and GetAdditionalEdgePolicy
This commit adds the method UpdateAdditionalEdge in PaymentSession,
which allows the addtional channel edge policy to be updated from a
ChannelUpdate message. Another method, GetAdditionalEdgePolicy is added
to allow querying additional edge policies.
2021-06-23 18:13:04 +08:00
yyforyongyu
cf2b5744a1
routing: move sendErr handling in shardHandler
This commit moves the handleSendError method from ChannelRouter to
shardHandler. In doing so, shardHandler can now apply updates to the
in-memory paymentSession if they are found in the error message.
2021-06-23 18:13:04 +08:00
yyforyongyu
1656611358
routing: use shardHandler to process err in SendToRoute 2021-06-23 18:13:03 +08:00
yyforyongyu
54aacacc11
routing: use require in router test
This commit refactors some of the tests in router_test.go to use the
require package.
2021-06-23 18:13:03 +08:00
yyforyongyu
8172811e74
routing: rm hardcoded channel id in router test 2021-06-23 18:13:03 +08:00
yyforyongyu
ae6d8a9a8f
routing: parse Channel ID from json file 2021-06-23 18:13:03 +08:00
bluetegu
37d0e21f05
routing: test private edge on fee error 2021-06-23 18:13:03 +08:00
bluetegu
242a844012
routing: fix TestSendPaymentErrorRepeatedFeeInsufficient
The simulated error returned was rejected due to signature failure,
and didn't simulate correctly the insufficient fees error as
intended. Fix error by including correct signature.
2021-06-23 18:13:03 +08:00
bluetegu
fc113c7508
routing: add private key attribute in router test 2021-06-23 18:13:02 +08:00
yyforyongyu
9062ab1671
routing: make payment lifecycle test more verbose 2021-06-23 18:13:02 +08:00
Olaoluwa Osuntokun
29d0b6491e
Merge pull request #5404 from Roasbeef/revert-no-router-fetch
Revert "routing: no backend call to fetch best block"
2021-06-22 17:31:28 -07:00
Olaoluwa Osuntokun
ff8153c332
docs/release-notes: add router height bug fix to 0.13.1 2021-06-22 17:24:17 -07:00
Olaoluwa Osuntokun
df6dd30af7 Revert "routing: no backend call to fetch best block"
This reverts commit cdddaaca75bba03f408991702e30d581df80daad.
2021-06-22 17:22:38 -07:00
Olaoluwa Osuntokun
d49643c6d0
Merge pull request #5417 from Roasbeef/in-repo-change-log
docs/release-notes: add new in-tree location for release notes
2021-06-22 17:20:10 -07:00
carla
6aa37066b2
server: send 0 bandwidth hints for links that can't add htlc 2021-06-22 15:39:33 +02:00
carla
5d717cb039
multi: surface may add outgoing hltc 2021-06-22 13:56:08 +02:00
carla
e3a4d6e989
lnwallet: refactor add htlc sanity checks to separate methods 2021-06-22 13:56:07 +02:00
Bjarne Magnussen
4d0601c648
lnd: only set payment address if not empty in PaymentRequest 2021-06-22 11:18:29 +02:00
Olaoluwa Osuntokun
5d29e9b099
Merge pull request #5409 from vwoo/docfix_neutrino_routing_options_move
sample-lnd.conf: fix, move astray neutrino and routing options
2021-06-21 19:43:43 -07:00
Olaoluwa Osuntokun
d983263362
docs/release-notes: add new in-tree location for release notes
In this commit, we add a new folder within the `docs` directory that will
house the release notes for all versions of `lnd` going forward.  Moving to
use `git` for the release notes rather than the normal drafting procedure
lets us keep track of the set of changes more consistency over time, lets
contributors add their release notes over time, and also means we'll no
longer need to do a crunch at the tail end of the release process to fill in
the set of release notes.

For the 0.13.1 release notes, I've done a scan and added anything that has
been merged since the last major version tag.  In a follow up change, we'll
add a new Github action that fails the build if an entry in the release
notes linking to the newly added PR isn't committed as well. Until then, any
PRs merged in should ensure that they add an entry within the relevant
milestone.
2021-06-21 19:24:49 -07:00
randymcmillan
6376d78b3e
docs: bump docker lnd dev and testing version 2021-06-21 20:58:19 -04:00
ErikEk
a6c32df31a lncli: check for existence of tls file 2021-06-22 01:32:54 +02:00
Vincent Woo
6ff53226d0 In sample-lnd.conf, move astray neutrino and routing options into their respective sections 2021-06-19 20:01:23 -07:00
Olaoluwa Osuntokun
f9a51882c4
Merge pull request #5376 from de6df1re/lnrpc-doc-fix
lnrpc: fix v1 switch API doc
2021-06-18 14:13:39 -07:00
Olaoluwa Osuntokun
fdc6d2607d
Merge pull request #5369 from Crypt-iQ/coop_close_sanity_06082021
lnwallet+funding: sanitize upfront_shutdown_script
2021-06-18 14:13:25 -07:00
Olaoluwa Osuntokun
2fd75ace9d
Merge pull request #5374 from yyforyongyu/itest-use-require-sendcoin
itest: use require inside net.SendCoins
2021-06-18 14:12:39 -07:00
Olaoluwa Osuntokun
9362f5d279
Merge pull request #5364 from guggero/prevent-stop-on-rescan
rpcserver: prevent shutdown during wallet recovery
2021-06-18 14:11:30 -07:00
Olaoluwa Osuntokun
2706f1972f
Merge pull request #5358 from ErikEk/lnrpc-log-connections-to-transaction-subscription-stream
rpcserver: log connections to transaction subscription stream
2021-06-18 14:09:57 -07:00
Olaoluwa Osuntokun
16bce31e46
Merge pull request #5348 from yyforyongyu/fix-itest-channel-close
itest: fix wrong node queried for balance
2021-06-18 14:09:19 -07:00