Commit Graph

11720 Commits

Author SHA1 Message Date
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
xanoni
06ad5ecfe5 sample-lnd.conf: harmonize section separators
Harmonize formatting of section separators and clean up whitespace in
sample-lnd.conf
2021-06-30 01:14:58 -04:00
Olaoluwa Osuntokun
20ef37d87d
Merge pull request #5148 from yyforyongyu/4215-deadline-aware
sweeper+contractcourt: deadline aware in sweeping anchors
2021-06-29 16:39:12 -07:00
yyforyongyu
c081707a5b
docs/release-notes: add deadline aware to 0.13.1 2021-06-29 20:30:58 +08:00
yyforyongyu
7c64e0445a
itest: test anchor sweep with commitment deadline 2021-06-29 20:30:53 +08:00
yyforyongyu
26858da59d
itest: change feeServiceTarget to be 1 2021-06-29 20:25:47 +08:00
yyforyongyu
a77225ba9e
itest: allow set fee rate with conf target
In this commit, we add a method in fee service to allow specifying a fee
rate with a conf target.
2021-06-29 20:25:47 +08:00
yyforyongyu
614884dcb8
contractcourt: test commitment deadline logic
This commit adds two tests to check that a) the correct deadline is used
given different HTLC sets and b) when sweeping anchors the correct
deadlines are used.
2021-06-29 20:25:47 +08:00
yyforyongyu
0dc3190fec
contractcourt: update TestChannelArbitratorAnchors
This commit adds a deadline field to mockSweeper that can be used to
track the customized conf target (deadline) used for sweeping anchors.
The relevant test, TestChannelArbitratorAnchors is updated to reflect
that the deadlines are indeed taking effect.
2021-06-29 20:25:47 +08:00
yyforyongyu
391f240ccb
contractcourt: make anchor sweep deadline aware
In this commit, we made the change so that when sweeping anchors for the
commitment transactions, we will be aware of the deadline which is
derived from its HTLC set. It's very likely we will use a much larger
conf target from now on, and save us some sats.
2021-06-29 20:25:47 +08:00
yyforyongyu
adddc1442e
multi: refactor NewAnchorResolutions to return fixed values
This commit adds a new struct AnchorResolutions which wraps the anchor
resolutions for local/remote/pending remote commitment transactions. It
is then returned from NewAnchorResolutions. Thus the caller knows how to
retrieve a certain anchor resolution.
2021-06-29 20:25:47 +08:00
yyforyongyu
21626fed7c
lnwallet: remove unused variable zeroHash 2021-06-29 20:25:46 +08:00
yyforyongyu
1abc5f8b00
chainfee: change min conf target to be 1
This commit changes the minBlockTarget used by the WebAPIEstimator to be
1, inline with the bitcoind's accepted min conf target.
2021-06-29 20:25:46 +08:00
yyforyongyu
5f0561fdbc
chainfee: replace conf target when it exceeds the maxBlockTarget
In this commit, we add a check inside EstimateFeePerKW for bitcoind so
that when the conf target exceeds the maxBlockTarget, we will use
maxBlockTarget instead.
2021-06-29 20:25:46 +08:00
yyforyongyu
6242158d51
chainfee: fix maxBlockTarget value 2021-06-29 20:25:45 +08:00
Olaoluwa Osuntokun
cafa6246a9
Merge pull request #5431 from yyforyongyu/5259-follow-up
routing: rename method and add err check when launch shard
2021-06-28 16:16:13 -07:00
Olaoluwa Osuntokun
44e461b233
Merge pull request #5428 from wpaulino/enforce-anchor-reserve
lnwallet: prevent anchor reserve enforcement on legacy inbound channel
2021-06-28 16:08:43 -07:00
Olaoluwa Osuntokun
dac0797857
Merge pull request #5420 from yyforyongyu/itest-use-require-net
itest: use require inside net.EnsureConnected/net.ConnectNodes
2021-06-28 16:07:33 -07:00
Olaoluwa Osuntokun
1910e263a8
lncli: check for existence of tls file (#5416) 2021-06-28 16:06:55 -07:00
Linus Curiel Xanoni
dc7d79abc2
doc/sample-lnd.conf: remove deprecated protocol.anchors flag
Remove deprecated "protocol.anchors" setting from sample-lnd.conf
2021-06-28 12:25:04 -07:00
yyforyongyu
310e923170
itest: use require inside net.EnsureConnected/net.ConnectNodes 2021-06-29 01:41:48 +08:00