Johan T. Halseth
f98a3c9dac
Merge pull request #4848 from halseth/htlcswitch-log-infof
...
[trivial] htlcswitch: log with format
2020-12-08 14:20:25 +01:00
Johan T. Halseth
e13c97d621
Merge pull request #4841 from cfromknecht/send-coins-log-fix
...
rpcserver: replace sweep_all in log with send_all to match rpc arg
2020-12-08 13:56:41 +01:00
Johan T. Halseth
1a35c0055b
htlcswitch: log with format
2020-12-08 13:54:41 +01:00
Johan T. Halseth
0a12592b39
htlcswitch/link_test: double timeouts
...
Double the timeout to allow the htlcswitch tests to finish on slow
systems (darwin...).
2020-12-04 10:50:43 +01:00
Johan T. Halseth
548827fe89
htlcswitch/link_test: use require.Eventually
...
Intead of sleeping we use require.Eventually in two cases the flake was
flaky.
2020-12-04 10:50:35 +01:00
Johan T. Halseth
ef426be351
contractcourt/chainwatcher test: add test cases for future force close
...
This adds the scenario to the local force close test cases where a node
force closes one of its channels, then lose state (or do recovery)
before the commmitment is confirmed. Without the previous commit this
would go undetected.
2020-12-03 08:01:08 +01:00
Johan T. Halseth
2a7a34ae10
contractcourt+lnwallet: use state num instead of commit height when
...
outdated local state
This commit fixes a bug that would cause us to not sweep our local
output in case we force closed, then lost state or attempted recovery.
The reason being that we would use or local commit height when deriving
our scripts, which would be incorrect. Instead we use the extracted
state number to derive the correct scripts, allowing us to sweep the
output.
Allthough being an unlikely scenario, we would leave money on chain in
this case without any warning (since we would just end up with an empty
delay script) and forget about the spend.
2020-12-03 08:01:08 +01:00
Johan T. Halseth
5bb8996162
contractcourt/chain_watcher: handleUnknownLocalState
...
Similar to what we did for other states, we extract handling of acting
on a local future state into its own method.
2020-12-03 08:01:08 +01:00
Johan T. Halseth
93d917d82a
contractcourt/chain_watcher: handleUnknownRemoteState
...
This commit extracts the data loss protect recovery procedure into its
own method.
2020-12-03 08:01:08 +01:00
Johan T. Halseth
743ea7be74
contractcourt/chain_watcher: handleKnownRemoteState
...
Similar to what we did for the local state handling, we extract handling
all known remote states we can act on (breach, current, pending state)
into its own method.
Since we want to handle the case where we lost state (both in case of
local and remote close) last, we don't rely on the remote state number
to check which commit we are looking at, but match on TXIDs directly.
2020-12-03 08:01:08 +01:00
Johan T. Halseth
acc45934f8
contraccourt/chain_watcher: define handleKnownLocalState
...
We can only rely on the commit set and height being correct for the
current commit, so check that first.
2020-12-03 08:01:08 +01:00
Johan T. Halseth
450da3d2f4
contractcourt/chain_watcher test: do proper state rollback
...
The tests didn't really roll back the channel state, so we would only
rely on the state number to determine whether we had lost state. Now we
properly roll back the channel to a previous state, in preparation for
upcoming changes.
2020-12-03 08:00:02 +01:00
Johan T. Halseth
18f79e20d5
lnwallet/test_utils: set up asymmetric commits
...
The remote and local commits are not symmetric, so we correctly set them
up pointing to the correct commitment tx.
2020-12-03 08:00:01 +01:00
Johan T. Halseth
7dd3e18234
Merge pull request #4817 from Roasbeef/remove-codeowners
...
github: remove CODEOWNERS file
2020-12-02 10:41:26 +01:00
Johan T. Halseth
8ec4697fe3
Merge pull request #4810 from Roasbeef/gossip-throttle-config
...
multi: add new config option to toggle gossip rate limiting
2020-12-01 13:32:52 +01:00
Johan T. Halseth
42d7fcd2f9
Merge pull request #4806 from guggero/neutrino-tor-fix
...
Fix Onion v2 support for Neutrino backends
2020-12-01 11:30:39 +01:00
Johan T. Halseth
ef503bf14e
Merge pull request #4801 from halseth/router-lifecycle-logs
...
[logging] add more logging for failed payment shards
2020-11-24 20:49:08 +01:00
Johan T. Halseth
df049ad755
routing: promote shard logs on resume and terminal failure to Info
2020-11-24 14:59:39 +01:00
Johan T. Halseth
f8493a7522
routing: define errShardHandlerExiting
2020-11-24 14:59:39 +01:00
Johan T. Halseth
4d645ef97f
htlcswitch: add debug logs for fetching network result
2020-11-24 14:14:49 +01:00
Johan T. Halseth
87cdf3b797
htlcswitch/link: revert borking channels on received Errors
...
Since it turned out borking channels on every received error could cause
us to bork channels in case of a sync error with C-lightning, we revert
this for now.
2020-11-23 14:42:41 +01:00
Johan T. Halseth
ca91d50884
Merge pull request #4750 from halseth/sweeper-required-locktime-txout
...
Sweeper: support Inputs with required locktimes and txOuts
2020-11-21 11:54:34 +01:00
Johan T. Halseth
8d2e6deade
sweeper_test: add txOut sweep test
...
Add tests that inputs with required TXOuts gets aggregated and swept, while
keeping locktimes satisfied.
2020-11-21 10:17:10 +01:00
Johan T. Halseth
616503de3e
sweep: add required TxOuts to sweep tx
...
Now that inputs might have accompanied outputs to be added to the sweep
tx, we add them to the sweep transaction first, and account for it when
calculating the change amount.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
7f9df26efd
sweeper_test: return unique wallet utxos
...
We also increase the value of the wallet UTXO, as it is needed when we
want to afford fees for larger transactions.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
0cba47dac0
sweep/tx_input_set: account for required outputs in input set
...
If inputs require outputs to be added at the same time, this will
change the weight and amount calculations, so we must account for that.
We wait to get the weight estimator for the sweep tx until needed,
such that we can easily choose whether to include a change output or not
in the estimate. This is needed for the case where the second level
transactions can pay for their own fee, so no change output is needed.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
985b7838ab
sweep+input: add RequiredTxOut to inputs
...
This is needed to sweep second level HTLC transactions that are signed
using SINGLE|ANYONECANPAY, since the input and ouput must be aligned.
2020-11-20 13:06:54 +01:00
Johan T. Halseth
aa8fa9d0cf
sweep: pass dustLimit to CreateSweepTx
2020-11-20 13:06:53 +01:00
Johan T. Halseth
3d209059c1
input+sweep: let weightestimator take known TxOut
2020-11-20 13:06:53 +01:00
Johan T. Halseth
efd6bc9501
sweep+input: add RequiredLockTime to inputs
2020-11-20 13:06:53 +01:00
Johan T. Halseth
fa4fd02cf1
sweep: add mergeClusters
2020-11-20 13:06:53 +01:00
Johan T. Halseth
128087044f
sweeper: define method createInputClusters
2020-11-20 13:06:53 +01:00
Johan T. Halseth
ef8a61db99
Merge pull request #4423 from breez/enable-encode-invoice-via-rpc
...
Let invoice.Encode receive a function which hashes itself the message
2020-11-19 14:44:38 +01:00
Johan T. Halseth
2411168233
Merge pull request #4784 from yyforyongyu/autopilot-fix-typo
...
trivial: typo fix
2020-11-19 14:40:50 +01:00
Johan T. Halseth
a8b6966017
Merge pull request #4402 from bhandras/etcd_itest
...
itests: option to run our integration tests on etcd + boltdb (remote/local)
2020-11-18 19:48:03 +01:00
Johan T. Halseth
4587b6dbab
Merge pull request #4772 from halseth/log-levels-global-sub
...
build/log: support parsing global+subsystem levels
2020-11-18 19:44:12 +01:00
Johan T. Halseth
a2f45cb812
config: update debuglevel description + sample conf
2020-11-18 14:19:23 +01:00
Johan T. Halseth
c1d423dc07
build/log: support parsing global+subsystem levels
...
This makes it possible to specify both a global+subsystem loglevels,
like:
--debuglevel=debug,PEER=info,SRVR=trace
2020-11-18 14:17:53 +01:00
Johan T. Halseth
fcf2e7f687
build/log_test: add tests for parsing log levels
2020-11-18 14:16:23 +01:00
Johan T. Halseth
953443e10c
lnwallet/channel: correct dust calculation on incoming HTLC
...
Similar to the previous commit, we fix a bug resulting in the wrong
commit weight being calculated when an HTLC just above the remote's
duslimit was added from the remote. This was a result of using the
successFee instead of the timeoutFee when checking whether it was dust,
making us consider it dust when it shouldn't have been.
2020-11-13 12:02:03 +01:00
Johan T. Halseth
e0b133297d
lnwallet/channel: correct dust calculation on outgoing HTLC
...
In this commit we fix a bug resulting in the wrong commit weight being
calculated when an HTLC just below the remote's duslimit was added. This
was a result of using the timeoutFee instead of the successFee when
checking whether it was dust, making us consider it non-dust when it
should have been.
2020-11-13 11:58:52 +01:00
Johan T. Halseth
3f9a707531
Merge pull request #4737 from bhandras/itest_clean_state
...
itest: clean harness state before each icase and better naming for icase logs
2020-11-12 13:03:22 +01:00
Johan T. Halseth
fac355c5a0
Merge pull request #4756 from guggero/itest-flakehunt
...
itest: add parallel flakehunter
2020-11-11 12:57:33 +01:00
Johan T. Halseth
b525c04432
Merge pull request #4648 from halseth/option-no-tls
...
RPC: add --no-rest-tls option
2020-11-11 11:52:23 +01:00
Johan T. Halseth
b529d42929
sample-config: add no-rest-tls
2020-11-11 09:41:23 +01:00
Johan T. Halseth
4d0537d4c3
config: enforce safe use of TLS
2020-11-11 09:37:53 +01:00
Johan T. Halseth and nicolas.dorier
5be7e710c7
RPC: Add --notls to disable TLS for RPC endpoints
...
Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com >
2020-11-11 09:37:52 +01:00
Johan T. Halseth
a2a924e1e5
rpcserver: move TLS listen config to closure
2020-11-11 09:37:52 +01:00
Johan T. Halseth
428ca37301
Merge pull request #2018 from halseth/peer-remove-failed-chans
...
Mark channels borked in case of remote error
2020-11-10 18:50:47 +01:00
Johan T. Halseth
1c96cc7e10
Merge pull request #4546 from bjarnemagnussen/fix-coinselect-tests
...
chanfunding: Add/improve tests for CoinSelectSubtractFees
2020-11-05 10:21:30 +01:00
Johan T. Halseth
c3397d7e77
htlcswitch/link test: add test for permanent failure
2020-11-04 11:16:22 +01:00
Johan T. Halseth
dde6763cef
htlcswitch/link: set PermanentFailure in case of remote error
2020-11-04 11:16:22 +01:00
Johan T. Halseth
a97182b1e9
peer: mark channel borked in case of PermanentFailure
2020-11-04 11:16:22 +01:00
Johan T. Halseth
a6d2263569
htlcswitch: add PermanentFailure to LinkFailureError
2020-11-04 10:50:28 +01:00
Johan T. Halseth
ce17c3be96
Merge pull request #4268 from matheusdtech/itest-off-by-one
...
itest: fix off-by-one mining while waiting for CSV-encumbered outputs
2020-10-30 09:03:38 +01:00
Johan T. Halseth
c1705a28da
chanfitness/chaneventstore: stop ticker after goroutine
...
Stop the ticker after the goroutine reading from it has exited, to avoid
triggering the race detector.
2020-10-27 12:29:05 +01:00
Johan T. Halseth
d26001a69a
Merge pull request #4688 from carlaKC/4686-paymenttimeout
...
lncli: allow configurable timeout in send payment
2020-10-13 13:06:47 +02:00
Johan T. Halseth
22d7bb138c
Merge pull request #3131 from halseth/reliable-payments-switch-gc
...
[reliable payments] switch result store clean-up
2020-10-08 15:43:34 +02:00
Johan T. Halseth
90a59fe70f
router: call CleanStore on startup
2020-10-06 10:46:04 +02:00
Johan T. Halseth
b071278f07
htlcswitch: add cleanStore method
...
That let us clean up handed off payment results, as they will never be
queried again.
2020-10-06 10:46:03 +02:00
Johan T. Halseth
d1a118388d
payment_control: remove unused Attempts field
2020-10-06 10:41:25 +02:00
Johan T. Halseth
46225e2921
Merge pull request #4666 from halseth/autopilot-mis-totalfunds
...
[autopilot] Use local channel balance in allocation calculation
2020-10-05 14:56:20 +02:00
Johan T. Halseth
dbeafe8832
autopilot: rename to Capacity to Balance, define ChannelInfo()
...
We rename the field Capacity on local channels to Balance, define a new
method ChannelInfo on the manager config that let us query the database
for our latest channels state. Using this we will use the current local
balance instead of the channel capacity when doing allocation
calculations.
2020-10-05 12:24:07 +02:00
Johan T. Halseth
d40cf6b592
autopilot: split channel definition into LocalChannel/ChannelEdge
...
Since non-local channels won't have a balance field, we split the
definitions in anticipation of adding one.
2020-10-05 12:24:07 +02:00
Johan T. Halseth
3e1755ee99
autopilot: remove unimpleneted SpliceIn/Out methods
2020-10-05 12:16:50 +02:00
Johan T. Halseth
392d6ccc9f
autopilot: remove unused channel field FundedAmt
2020-10-05 12:16:50 +02:00
Johan T. Halseth
b6c161bcfc
Merge pull request #4671 from Roasbeef/health-check-logging
...
healthcheck: bump logging for failed healthchecks to info
2020-10-05 10:59:09 +02:00
Johan T. Halseth
ef0bca7a8e
Merge pull request #4660 from yyforyongyu/add-temp-miner-logs
...
itest: save temp miner's logs
2020-10-02 12:43:22 +02:00
Johan T. Halseth
1a73bc7d74
Merge pull request #4653 from LN-Zap/feat/spend-unconfirmed
...
Ability to spend unconfirmed coins when making onchain transactions
2020-10-02 08:40:45 +02:00
Johan T. Halseth
d560f9eab0
Merge pull request #4662 from Roasbeef/neutrino-dep-update-sept
...
build: update neutrino to latest version
2020-10-01 14:26:09 +02:00
Johan T. Halseth
74e62e5c5b
Merge pull request #4589 from yyforyongyu/itest-proper-cleanup
...
Itest: proper connect/disconnect miner
2020-09-25 10:31:56 +02:00
Johan T. Halseth
65865030d6
macaroons test: fix formatting
2020-09-24 11:59:08 +02:00
Johan T. Halseth
14960b1fb4
macaroons test: reverse macaroon time caveat check
...
This commit fixes a go 1.15 vet check.
In doing so it uncovers that the time caveat check is actually reversed.
Since we should check that the caveat is added, we should only fail the
check when the caveat prefix is not equal.
2020-09-24 11:22:20 +02:00
Johan T. Halseth
8ca5342b37
brontide test: fix go 1.15 vet check
2020-09-24 11:20:48 +02:00
Johan T. Halseth
df6606d37f
txnotifier test: add test for confirmation after cancellation
...
This test addition would cause the txnotifier to crash prior to the
previous commit.
2020-09-16 11:23:02 +02:00
Johan T. Halseth
2665836fa3
txnotifier: delete ntfn by confirm height always
...
When we cancel a confirmation request, we should remove the request from
the height map regardless of the current height. Otherwise we end up in
the situation when the height is reached, the notification is attempted
sent which results in a crash.
2020-09-16 11:20:37 +02:00
Johan T. Halseth
3a12b5867f
txnotifier test: use Cancel() directly
2020-09-16 11:19:53 +02:00
Johan T. Halseth
b8eb41f947
Merge pull request #4591 from hsjoberg/walletloader-unload
...
lnd: Call loader.UnloadWallet on shutdown
2020-09-15 13:54:46 +02:00
Johan T. Halseth
bf18929f0e
peer/brontide: fix pubkey log
2020-09-11 11:10:58 +02:00
Johan T. Halseth
a48c369250
lnwallet: check coop close fee negative balance
...
Also modify the test to check for this condition.
2020-09-11 11:10:58 +02:00
Johan T. Halseth
09a126b29f
lnwallet: add anchor size back to balance on coop close
...
To be spec compliant, we require the initiator to not pay the anchor
values into fees on coop close. We extract the balance calculation into
commitment.go, and add back the value of the anchors to the initiator's
balance.
2020-09-11 11:10:58 +02:00
Johan T. Halseth
07a57ae778
lnwallet: extract coop close balance calc into method
2020-09-11 11:10:58 +02:00
Johan T. Halseth
724f439b0b
lnwire: update anchor bit to spec
2020-09-11 11:10:58 +02:00
Johan T. Halseth
517fcd691a
channeldb: correct anchor comment
2020-09-11 11:10:58 +02:00
Johan T. Halseth
85b53c357f
htlcswitch: use kvdb.View for loading fwdpkgs
...
Not necessary to open a write tx.
2020-08-13 14:36:48 +02:00
Johan T. Halseth
09b8bee865
mobile: remember walletunlocker.proto
2020-08-04 14:43:08 +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
Johan T. Halseth
0fab14502d
Merge pull request #4467 from cfromknecht/hh-cache-followup
...
chainntfns: disable height-hint cache followups
2020-07-17 09:57:37 +02:00
Johan T. Halseth
9d147c55d7
Merge pull request #4469 from halseth/mobile-global-config
...
mobile+make: restore mobile compilation
2020-07-17 09:55:35 +02:00
Johan T. Halseth
935fa7f12d
make+mobile: pass expected falafel version to build script
2020-07-17 08:49:03 +02:00
Johan T. Halseth
39241dcdc7
mobile: use single brackets for bash if check
...
Double brackets are sh specific.
2020-07-17 08:49:03 +02:00
Johan T. Halseth
d41ca81aad
make: add goimports dep
...
Required by mobile bindings generate script.
2020-07-17 08:49:02 +02:00
Johan T. Halseth
b55b7025b0
travis: sanity check mobile build compilation
2020-07-17 08:49:02 +02:00
Johan T. Halseth
fd8e6c98b9
make: fetch falafel dependency for mobile-rpc
2020-07-17 08:49:02 +02:00
Johan T. Halseth
7a30332619
mobile: use single "mobile" build tag instead of "ios" and "android"
...
Since the "android" build tag conflicts with a go compiler build tag, we instead use a single "mobile" tag for both platforms.
2020-07-17 08:49:02 +02:00
Johan T. Halseth
f360ec71bf
mobile: restore config parsing for mobile bindings
...
A recent commit moved the config parsing out of lnd's Main method. This
commit makes the mobile bindings compile with this change.
2020-07-17 08:49:02 +02:00
Johan T. Halseth
5e72a4b77c
routing: exit on unexpected RequestRoute error
...
We whitelist a set of "expected" errors that can be returned from
RequestRoute, by converting them into a new type noRouteError. For any
other error returned by RequestRoute, we'll now exit immediately.
2020-04-02 19:31:24 +02:00
Johan T. Halseth and Joost Jager
fee5fd0093
itest: add testSendToRouteMultiPath
...
testSendToRouteMultiPath tests that we are able to successfully route a
payment using multiple shards across different paths, by using SendToRoute.
Co-authored-by: Joost Jager <joost.jager@gmail.com >
2020-04-02 19:31:23 +02:00
Johan T. Halseth
95c5a123c8
routing/router_test: add TestSendToRouteMultiShardSend
2020-04-02 19:31:23 +02:00
Johan T. Halseth
864e64e725
channeldb: validate MPP options when registering attempts
...
We add validation making sure we are not trying to register MPP shards
for non-MPP payments, and vice versa. We also add validtion of total
sent amount against payment value, and matching MPP options.
We also add methods for copying Route/Hop, since it is useful to use
for modifying the route amount in the test.
2020-04-02 19:31:23 +02:00