Commit Graph

11383 Commits

Author SHA1 Message Date
Johan T. Halseth
db66fef6cc
channeldb+htlcswitch: write wire messages using length prefix
In this commit, we modify the way we write wire messages across the
entire database. We'll now ensure that we always write wire messages
with a length prefix. We update the `codec.go` file to always write a 2
byte length prefix, this affects the way we write the `CommitDiff` and
`LogUpdates` struct to disk, and the network results bucket in the
switch as it includes a wire message.
2021-02-24 17:15:27 +01:00
Johan T. Halseth
4133b4d04e
channeldb/migration21: copy over legacy types+codec for migration21
The legacy encoding depends on the lnwire21 version of lnwire, so it will
let us change lnwire after the migration. To make sure it is separated
from the new encoding, we add it to a new package 'legacy'.

We also put common types in a new package 'common', which will house
types that won't change during the migration, and can be used by both
legacy and current serialization code.
2021-02-24 17:15:21 +01:00
Elliott Jin
215bf637ea itest: add test for new UpdateChanStatus RPC 2021-02-24 07:13:29 -08:00
Elliott Jin
5a54d787e1 brontide: log at debug, not error, when ignoring enable request 2021-02-24 07:13:28 -08:00
Elliott Jin
19e9ed5cdf lncli: add updatechanstatus command
The updatechanstatus command calls into the UpdateChanStatus RPC
in the router server.
2021-02-24 07:13:28 -08:00
Elliott Jin
6d01f140d9 routerrpc: implement UpdateChanStatus RPC in router server
Update UpdateChanStatus stub implementation to call into exposed
ChanStatusManager methods in RouterBackend.
2021-02-24 07:13:28 -08:00
Elliott Jin
ce2796257e multi: move GetChanPointFundingTxid from lnd to lnrpc
This refactor-only change makes the GetChanPointFundingTxid helper
function available from sub-systems outside of the root lnd package.
2021-02-24 07:13:28 -08:00
Elliott Jin
db76b970ac routerrpc: expose SetChannel* methods from Router backend
Allow router RPC requests to call into the ChanStatusManager to
manually update channel state.
2021-02-24 07:13:28 -08:00
Elliott Jin
4e4f4bc194 routerrpc: add UpdateChanStatus RPC to Router service
Update router.proto and rest-annotations.yaml, recompile protos,
add a stub implementation to routerrpc.Server.
2021-02-24 07:13:28 -08:00
Elliott Jin
a259317d72 netann: add test for RequestAuto 2021-02-24 07:13:28 -08:00
Elliott Jin
59bd617c97 netann: add RequestAuto for restoring auto chan state management
If a channel was manually disabled, subsequent automatic / background
requests to update that channel's state will be ignored. A RequestAuto
call restores automatic / background state management and indicates
that such requests should no longer be ignored.
2021-02-24 07:13:28 -08:00
Elliott Jin
e1709f20eb netann: add tests for manually enabling/disabling channels 2021-02-24 07:13:28 -08:00
Elliott Jin
dbabc2e696 netann: add bool param to chan_status_manager_test
Add boolean parameter for test functions without changing any
existing functionality. All current tests set manual = false, but
Future tests can set manual = true to test manual requests to
update channel state.
2021-02-24 07:13:28 -08:00
Elliott Jin
542c89ad5d netann: update channel status transitions to handle manual requests 2021-02-24 07:13:28 -08:00
Elliott Jin
c40d291488 netann: add ChanStatusManuallyDisabled state
Add new value for ChanStatus without changing any existing
functionality. The new value indicates that a user manually
requested disabling a channel.
2021-02-24 07:13:28 -08:00
Elliott Jin
e9baf0e4a2 multi: add bool param to channel enable/disable methods
Add a new boolean parameter without changing any existing
functionality. The parameter will be used to indicate
whether a request to update a channel's status was made
manually by a user (currently always false).
2021-02-24 07:13:28 -08:00
Johan T. Halseth
90d36dbdd4
channeldb: rename Encode/Decode to serializeLogUpdate/deserializeLogUpdate
To more easily use different version of it post-/pre-migration, we
rename the method and make it take the LogUpdate as an argument.
2021-02-24 14:34:57 +01:00
Johan T. Halseth
7569cca19b
channeldb/migration: copy current lnwire to migration dir
To avoid code changing underneath the static migrations, we copy the
lnwire dependency in its current form into the migration directory.

Ideally the migrations doesn't depend on any code that might change,
this takes us a step closer.
2021-02-24 14:34:57 +01:00
Olaoluwa Osuntokun
c6a8816043
channeldb: mark ApplyMigration as a test helper
With this change, errors from migrations will have the proper local line
number.
2021-02-24 14:34:57 +01:00
Johan T. Halseth
db23e34f74
Merge pull request #3191 from halseth/deleteallpayments-failedonly
Add option for deleting failed-only payments.
2021-02-22 21:40:16 +01:00
eugene
bc238ee84c
lnd+lnwallet: make capacity check stricter by adding fee
Also patches breacharbiter tests by using the correct commitment
fee and balances.
2021-02-22 12:07:21 -05:00
Johan T. Halseth
59f41e518d
channeldb: add failedHtlcsOnly option to DeletePayments 2021-02-22 12:50:25 +01:00
Johan T. Halseth
6eb42aec0a
channeldb/payments: use only Read bucket when iterating 2021-02-22 12:50:25 +01:00
Johan T. Halseth
7e3738d773
rpcserver+channeldb: delete only failed payments if requested 2021-02-22 12:50:25 +01:00
Johan T. Halseth
0ef2ca06c1
lnrpc: add failed_payments_only and failed_htlcs_only option to DeleteAllPayments 2021-02-22 12:50:24 +01:00
Johan T. Halseth
82fe6f5f59
channeldb/payments_test: handle that dupe payments will always have StatusSuccess
Legacy duplicate payments would only be migrated over if they had
succeeded. Alter the test to reflect this.
2021-02-22 12:50:24 +01:00
Conner Fromknecht
c9ed5927f6
Merge pull request #5038 from cfromknecht/debug-unit
make: add unit-debug target
2021-02-19 14:01:31 -08:00
Olaoluwa Osuntokun
203a669578
Merge pull request #5043 from cfromknecht/reduce-concurrent-router-validation
routing: dial back max concurrent block fetches
2021-02-18 16:36:57 -08:00
Olaoluwa Osuntokun
7f68e961e6
Merge pull request #5046 from cfromknecht/ws-close-whitelist
lntest/itest: add websocket close to error whitelist
2021-02-18 16:27:35 -08:00
Conner Fromknecht
17489ba6a3
lntest/itest: add websocket close to error whitelist 2021-02-18 12:14:50 -08:00
Conner Fromknecht
250bc8560e
routing: avoid modifying AssumeChannelValid in unit tests
This produces a race condition when reading AssumeChannelValid from a
different goroutine. Instead we isolate the test cases and initial
AssumeChannelValid properly.
2021-02-17 22:43:24 -08:00
Conner Fromknecht
f7c5236bf6
routing: dial back max concurrent block fetches
This commit reduces the number of concurrent validation operations the
router will perform when fully validating the channel graph. Reports
from several users indicate that GetInfo would hang for several minutes,
which is believed to be caused by attempting to validate massive amounts
of channels in parallel. This commit returns the limit back to its
original state before adding the batched gossip improvements.

We keep the 1000 concurrent validation request limit for
AssumeChannelValid, since we don't fetch blocks in that case. This
allows us to still keep the performance benefits on mobile/low-resource
devices.
2021-02-17 18:17:09 -08:00
Conner Fromknecht
1c75d92929
Merge pull request #5037 from guggero/make-docker-release
release: fix golang version issue in docker-release and shasum issue in verification script
2021-02-17 10:45:47 -08:00
Oliver Gugger
591954ff61
scripts: detect whether sha256sum or shasum is available
The shasum command isn't available in Alpine linux while the sha256sum
command isn't available on MacOS. We add a simple switch that tries to
detect which one is available.
2021-02-17 18:11:42 +01:00
Oliver Gugger
fdbd4da771
make: use make for docker-release
To fix an issue where the golang version would be picked up from the
host system if the docker-release command was used, we switch over to
using make inside of the container as well instead of feeding the
parameters into the release script manually.
We only pass in the flags that we might actually want to overwrite.
2021-02-17 18:11:42 +01:00
Conner Fromknecht
7f9dcc143f
make: add unit-debug target 2021-02-17 08:47:59 -08:00
Conner Fromknecht
db5af6fc14
Merge pull request #5017 from Roasbeef/default-max-parts
routing: if MaxShardAmt is set, then use that as a ceiling for our splits, use default of 16 for MaxParts
2021-02-16 09:43:34 -08:00
Olaoluwa Osuntokun
db69331db9
cmd/lncli: add max shard size parsing for payment commands 2021-02-15 19:31:58 -08:00
Olaoluwa Osuntokun
b73a6e2c61
routing: if MaxShardAmt is set, then use that as a ceiling for our splits
In this commit, we thread through the necessary state to allow users to
set a max shard amount. If this value is set, then this'll effectively
serve as a ceiling for all our split attempts. If we need to split,
we'll first try to use `paymentAmt/2`, if that's bigger than
`MaxShardAmt, then we'll use the latter instead.

Ideally in the future we have a dynamic way to automatically set both
the `MaxShardAmt` as well as `MaxParts` for users. Until then exposing
these two new fields will allow us to experiment with setting them
automatically using the RPC interface, and also give users a bit more
control over how we attempt to route payments, akin to coin control for
on-chain payments.

Fixes #4730
2021-02-15 19:31:52 -08:00
Olaoluwa Osuntokun
7398e59927
lnrpc/routerrpc+routing: add new MaxShardAmt field to LightningPayment 2021-02-15 19:31:49 -08:00
Olaoluwa Osuntokun
c70e53c791
lnrpc/routerrpc: add new max_shard_size_msat field to SendPaymentRequest 2021-02-15 19:31:46 -08:00
Olaoluwa Osuntokun
d5cf6043e6
lnrpc/routerrpc: use new default value of 16 for maxparts
In this commit, we raise the default value for the `MaxParts` field from
1 to 16. This change was motivated by the fact that many users either
forget, or don't even know this field is there in the first place. A
value of 16 was chosen rather arbitraliy (other than power of 2). In
the future, we should tune this value based on the expected number of
payment attempts for a given payment amount.
2021-02-15 19:31:43 -08:00
Conner Fromknecht
8c06eb57c5
Merge pull request #5026 from cfromknecht/init-mock-fee-estimator
htlcswitch: init mockFeeEstimator in other LinkChannelConfigs
2021-02-15 13:03:02 -08:00
Conner Fromknecht
4fcc82251e
Merge pull request #5016 from cfromknecht/extract-channel-whitelist
lntest: update error log whitelist
2021-02-15 12:50:33 -08:00
Conner Fromknecht
fd3dd2cfff
Merge pull request #5023 from cfromknecht/min-required-sigs-five
scripts/verify-install: require 5 of 7 signatures before accepting
2021-02-15 12:17:36 -08:00
Conner Fromknecht
774d29d890
htlcswitch: init mockFeeEstimator in other LinkChannelConfigs
If the tests don't execute quick enough, the link will try to sample the
network fee and cause a panic. This happens semi-regularly on travis.
2021-02-15 12:14:32 -08:00
Conner Fromknecht
95eadfee2f
scripts/verify-install.sh: combine final SUCCESS logs 2021-02-15 10:00:42 -08:00
Conner Fromknecht
c03f95a63b
scripts/verify-install: bump min required signatures to 5 2021-02-15 09:59:59 -08:00
Conner Fromknecht
12182d0fc9
Merge pull request #5019 from guggero/detach-sign
release: create and verify detached signatures, fix hashing command on MacOS
2021-02-15 09:48:17 -08:00
Oliver Gugger
85c42b0b79
scripts: add more verbose error messages to verification
We want to be more precise in what exactly went wrong and what the cause
could be.
2021-02-15 10:47:46 +01:00