Commit graph

32 commits

Author SHA1 Message Date
SomberNight
a7b13f4876
logging: make console log lines shorter 2019-05-02 15:19:11 +02:00
SomberNight
3385a94753
logging: basics 2019-05-02 15:19:03 +02:00
SomberNight
ecefa47b40
verifier: trivial clean-up 2019-04-12 20:29:05 +02:00
SomberNight
bca6ad5241
verifier: fix logic bug. after reorg, some verifs were not undone
after a reorg, in a many fork/orphan chains scenario,
we would sometimes not undo SPV for enough blocks

functions in blockchain.py somewhat based on kyuupichan/bitcoinX@5126bd15ef
2019-03-26 21:01:43 +01:00
ThomasV
791e680a96 abstract database away from wallet and address_synchronizer 2019-02-28 09:02:58 +01:00
SomberNight
38ab7ee554
network: catch untrusted exceptions from server in public methods
and re-raise a wrapper exception (that retains the original exc in a field)

closes #5111
2019-02-12 17:02:15 +01:00
chris-belcher
d5c8a0e0d0 Add flag --skipmerklecheck (#4957)
The --skipmerklecheck optional flag makes Electrum tolerate invalid
merkle proofs from the server. This is useful for building Electrum
servers that need a minimum amount of storage, though of course users
should only enable it if they completely trust the connected server.
2019-01-16 18:48:10 +01:00
SomberNight
c017f788ac
wallet: TxMinedInfo (merged TxMinedStatus and VerifiedTxInfo) 2018-12-07 20:47:28 +01:00
SomberNight
082a83dd85
rename crypto.Hash to sha256d 2018-10-25 22:28:24 +02:00
SomberNight
a88a2dea82
split bip32 from bitcoin.py 2018-10-25 22:20:33 +02:00
SomberNight
81cc20039e
more type annotations in core lib 2018-10-22 16:41:25 +02:00
SomberNight
e8bc025f5c
verifier: fix race in __init__ 2018-10-19 18:10:04 +02:00
SomberNight
372921b423
mv NetworkJobOnDefaultServer to util
break ref cycles
2018-10-12 16:09:41 +02:00
SomberNight
37206ec08e
network: auto-switch servers to preferred fork (or longest chain)
If auto_connect is enabled, allow jumping between forks too.
(Previously auto_connect was only switching servers on a given fork,
not across forks)
If there is a preferred fork set, jump to that (and stay);
if there isn't, always jump to the longest fork.
2018-10-11 20:07:19 +02:00
SomberNight
02f108d927
restructure synchronizer
fix CLI notify cmd. fix merchant websockets.
2018-10-03 17:13:46 +02:00
SomberNight
952e9b87e1
network: clean-up. make external API clear. rm interface_lock (mostly). 2018-09-25 16:44:39 +02:00
SomberNight
1b95cced5d
verifier: perf optimisations
blockchain.read_header is expensive. do cheap tests first
on a wallet with 11k txns, that is synced except for spv proofs,
finishing sync now takes 80 sec instead of 180 sec
2018-09-17 18:31:25 +02:00
SomberNight
aee2d8e120
verifier: fix a race during reorgs
related: 41e088693d
If our guess of a txn getting confirmed at the same height in the new chain
as it was at in the old chain is incorrect, there is a race between the
verifier and the synchronizer. If the verifier wins, the exception will cause
us to disconnect.
2018-09-17 03:35:25 +02:00
SomberNight
dcab22dcc7
verifier: small clean-up 2018-09-16 22:21:49 +02:00
SomberNight
819044221b
verifier: need to wait for reorg
fixes race between verifier and block header download.
scenario: client starts, connects to server. while client was offline,
there was a reorg. txn A was not mined in the old chain, but is mined
after reorg. client subscribes to addresses and starts downloading headers,
concurrently. server tells client txn A is mined at height H >= reorg height.
client sees it has block header at height H, asks for SPV proof for txn A.
but the header the client has is still the old one, the verifier was faster
than the block header download (race...). client receives proof. proof is
incorrect for old header. client disconnects.
2018-09-13 19:00:21 +02:00
SomberNight
e829d6bbcf
wallet: put Sync and Verifier in their own TaskGroup, and that into interface.group 2018-09-11 20:24:01 +02:00
SomberNight
77d86f074f
verifier: don't try to request same chunk multiple times 2018-09-08 19:11:02 +02:00
SomberNight
c49e563881
verifier: if we fail to verify SPV proof, disconnect from server 2018-09-08 18:10:21 +02:00
SomberNight
26172686b8
restructure synchronizer/verifier <--> interface coupling 2018-09-07 19:34:28 +02:00
SomberNight
2187615c08
verifier: request proofs in batches 2018-09-06 14:17:43 +02:00
Janus
e9ceeb85af
async block headers 2018-09-06 14:17:41 +02:00
Janus
8f36c9167d
aiorpcx: remove callback based code, add session to Interface 2018-09-06 14:17:29 +02:00
SomberNight
531cdeffa9
blockchain.py: rename 'checkpoint' to 'forkpoint' 2018-08-03 18:25:53 +02:00
SomberNight
a29e2218c8
wallet: introduce namedtuples TxMinedStatus and VerifiedTxInfo 2018-07-31 17:10:15 +02:00
SomberNight
41e088693d
verifier: better handle reorgs (and storage upgrade) 2018-07-31 15:51:05 +02:00
SomberNight
d2abaf54e8
verifier: small refactor 2018-07-23 19:59:05 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Renamed from lib/verifier.py (Browse further)