1
0
Commit Graph

13384 Commits

Author SHA1 Message Date
ThomasV
61e7f7e75e Merge pull request #7065 from SomberNight/20210224_mpp_recv_amt_sum
lnpeer: MPP recv: only fulfill htlc if amt sum exact-matches total_msat
2021-02-25 10:27:55 +01:00
ThomasV
5dc7b5bffe Merge pull request #7069 from bitromortac/2102-mpp-split-params
mpp_split: optimize split parameters
2021-02-25 10:26:01 +01:00
bitromortac
bf87169469 mpp_split: tweak split parameters
Increases STARTING_CONFIGS to sample more starting configurations.
Reduces CANDIDATES_PER_LEVEL to reduce computational effort.
Increases REDISTRIBUTE.

The time it takes for a typical suggest_split call is about 2 msec a
desktop machine.
2021-02-25 08:37:39 +01:00
bitromortac
5081a83245 mpp_split: undo side effect in tearDown 2021-02-25 08:37:07 +01:00
SomberNight
16f0b30ced lnpeer: MPP recv: only fulfill htlc if amt sum exact-matches total_msat 2021-02-24 20:51:58 +01:00
SomberNight
9024419fdc lnpeer: MPP receive: require payment_secret for each htlc
BOLT-04 says:
The final node:
  if it supports basic_mpp:
    MUST require payment_secret for all HTLCs in the set

90468030d5/04-onion-routing.md (basic-multi-part-payments)
2021-02-24 20:34:34 +01:00
SomberNight
691ebaf4f8 lnworker/lnpeer: add some type hints, force some kwargs 2021-02-24 20:03:12 +01:00
SomberNight
d800f88bfc (trivial) wallet: fix over-indentation 2021-02-24 19:01:02 +01:00
ThomasV
c9d6d11604 create_trampoline_route: check that we can pay the amount and the fees, and that the route is sane 2021-02-24 18:25:49 +01:00
SomberNight
ab9bf07a79 (trivial) lnrouter: fix type of TrampolineEdge.short_channel_id
also, use keyword arguments inside attr.ib() as PyCharm was complaining
2021-02-24 16:46:59 +01:00
ThomasV
bf1d516959 lnworker: add fees from private path to the amount passed to find_route.
(see #7050)
2021-02-24 16:32:08 +01:00
ThomasV
391dba7117 Refactor find_route_for_payment
- remove duplicated code
 - rename variable names to be consistent with the
'path', 'route' terminology
 - compute private route before route
2021-02-24 16:26:53 +01:00
ThomasV
152894e6a9 calc_hops_data: total_msat should be optional 2021-02-24 16:14:19 +01:00
SomberNight
0a5b714643 lnworker: add "endurance" ACINQ testnet node as hardcoded trampoline 2021-02-24 13:38:04 +01:00
SomberNight
52eb9dcad9 tests: fix thinko in ElectrumTestCase base class
can't see why it was cross-calling the setUpClass from the
individual test setUp
2021-02-24 13:32:29 +01:00
SomberNight
a9d0e3fca9 tests: try to eliminate random failures from mpp_split tests
closes: #7062
2021-02-24 12:54:43 +01:00
SomberNight
228c4b4597 synchronizer: better handle history-status mismatch
When receiving the history of an address, the client behaved unexpectedly
if either of two checks failed.
The client checked that the txids in the history are unique, and that the
history matches the previously announced status. If either failed, it
would just log a line and do nothing. Importantly, the synchronizer could
even consider itself is_up_to_date, i.e. the GUI could show the wallet is
synced.

This is now changed such that:
- if the txid uniqueness test fails, we simply disconnect
- if the history is not consistent with previously announced status,
  we wait a bit, make sure is_up_to_date is False in the meantime,
  and then potentially disconnect
See rationale for these in the comments.

related: https://github.com/spesmilo/electrum/issues/7058#issuecomment-783613084
2021-02-24 12:32:54 +01:00
SomberNight
4a8286c744 qrscanner: nicer error messages 2021-02-23 22:38:53 +01:00
ThomasV
22a14d42b2 Merge pull request #7061 from zebra-lucky/add_kivy_scan_qr_non_android
kivy: add app.scan_qr_non_android
2021-02-23 12:03:13 +01:00
zebra-lucky
f6011dc31a kivy: add app.scan_qr_non_android 2021-02-23 12:51:23 +02:00
ThomasV
10611876ee qt: update swap button together with can_send 2021-02-23 10:58:21 +01:00
ThomasV
618b008c54 Merge pull request #7060 from bitromortac/mpp-test-fix
mpp_split: fix tests for python versions < 3.8
2021-02-23 10:23:35 +01:00
bitromortac
9b0b78eca1 mpp_split: fix tests for python versions < 3.8 2021-02-23 08:02:02 +01:00
SomberNight
4937fd2788 scripts: add script that broadcasts tx to lots of servers
useful when trying to RBF a tx that did not opt-in to RBF
2021-02-23 04:19:47 +01:00
SomberNight
26d73cba0e interface.get_history: enforce sorted order of heights
related: #7058
2021-02-23 02:13:16 +01:00
SomberNight
99845942e5 DeviceMgr: don't mark client as failing if create_client() is None
Otherwise the exception raised by client.label() would seem important.
2021-02-22 20:11:14 +01:00
SomberNight
e42120cac5 lnutil.LnFeatures: update LN_FEATURES_IMPLEMENTED 2021-02-22 20:04:47 +01:00
SomberNight
baad8ab3ff lnutil.LnFeatures: update context for "option_support_large_channel"
this was changed in https://github.com/lightningnetwork/lightning-rfc/pull/773
2021-02-22 20:01:45 +01:00
SomberNight
4aab843f17 lnutil.LnFeatures: impl and use "supports" method for feature-bit-tests
Note that for a required feature, BOLT-09 allows setting either:
- only the REQ bit
- both the REQ bit and the OPT bit

Hence, when checking if a feature is supported by e.g. an invoice, both
bits should be checked.

Note that in lnpeer.py, in self.features specifically, REQ implies OPT,
as it is set by ln_compare_features.
2021-02-22 19:53:01 +01:00
ThomasV
0369829e5e MPP: can_send/can_receive is now the sum, no longer the max 2021-02-22 16:42:27 +01:00
ThomasV
827cd344d5 enable MPP with trampoline 2021-02-22 15:55:22 +01:00
ThomasV
6922b416d6 follow-up prev commit 2021-02-22 15:38:19 +01:00
ThomasV
64c9ddb88d MPP: refactor code 2021-02-22 14:24:23 +01:00
ThomasV
9ea2c275ce Merge pull request #7050 from bitromortac/mpp-send
Complete multipart payment sending support
2021-02-22 13:51:59 +01:00
bitromortac
e9fe0ed22b lnworker: use suggest_splits for multiple routes 2021-02-22 11:25:01 +01:00
bitromortac
9f84fa9580 lnonion: add total_msat to onion payment data 2021-02-22 11:25:00 +01:00
bitromortac
613bab145d mpp_split: implement splitting logic 2021-02-22 11:25:00 +01:00
ThomasV
1c52203346 wizard: focus password field (fix #7048) 2021-02-21 11:41:34 +01:00
SomberNight
8bdbcf73d9 network.py: update bitcoin core error msg whitelist
Also add descriptive text for some of the common messages people ask
for help with.

closes #6760
related #5851
related #6985
2021-02-21 04:48:36 +01:00
ThomasV
3a40d48a6e lnpeer: remove recursve call in maybe_fulfill_htlc 2021-02-20 14:20:55 +01:00
ThomasV
9b7f9219a3 fix travis builds (update openssl) 2021-02-19 15:49:37 +01:00
Marius Baisan
55fdddb0b8 Add back the 'to_height' and 'from_height' to onchain_history command
Exclude unconfirmed transactions from --to_height and include them into --from_height.
The reason being that an unconfirmed transaction will end up eventually into the last
block which most of the time will be higher than --from_height
2021-02-19 13:12:09 +01:00
bitromortac
3ddb83fad3 lnworker: move NoPathFound to lnutil 2021-02-19 09:27:49 +01:00
SomberNight
d75f9c6e80 kivy: receive request: fix RefLabel for "Address" so it can be exported
It is 'data' rather than 'text' that should be set for a RefLabel.

fixes #7042
2021-02-19 02:29:00 +01:00
SomberNight
1ee99cf9c4 interface: "block.headers": nicer error if server uses too low 'max'
related 4ff6a9c4f0
2021-02-18 20:40:38 +01:00
ThomasV
d906819b03 minor fix following method rename 2021-02-18 13:36:54 +01:00
ThomasV
998f41256f Merge pull request #7041 from SomberNight/20200218_invoice_amt_oob
invoices: validate 'amount' not to be out-of-bounds
2021-02-18 12:01:48 +01:00
ThomasV
ba5e73d978 kivy: show routing options explicitly 2021-02-18 11:39:52 +01:00
ThomasV
880353287d lnrater: fix #6764 2021-02-18 10:59:45 +01:00
SomberNight
0aa36ab5ac invoices: validate 'amount' not to be out-of-bounds 2021-02-18 06:11:09 +01:00