Commit Graph

641 Commits

Author SHA1 Message Date
Neil Booth
622f61e943 Don't do an initial sessions log 2016-12-21 19:47:26 +09:00
Neil Booth
50f02747de Throttle abusive logging 2016-12-21 19:47:25 +09:00
Neil Booth
01c2fad534 Log paused or low-priority sessions on exit 2016-12-21 07:28:32 +09:00
Neil Booth
6a6bbaa07b Tweak mempool logging 2016-12-21 07:28:32 +09:00
Neil Booth
a9b1bc16dd Prepare 0.9.15 2016-12-20 06:54:06 +09:00
Neil Booth
efe3ebd9ee Remove None from touched when backing up.
Fixes #84
2016-12-20 06:50:55 +09:00
Neil Booth
8b87a837b8 Prepare 0.9.14 2016-12-19 23:28:14 +09:00
Neil Booth
e91f49101b Don't start processing mempool until caught up
Print server manager settings once servers start
2016-12-19 23:25:37 +09:00
Neil Booth
7b8119d787 Prepare 0.9.13 2016-12-18 23:21:22 +09:00
Neil Booth
813d8ee7e3 Reduce logging verbosity for delayed requests
Only log when the delay changes
2016-12-18 23:17:03 +09:00
Neil Booth
6c7cf34bcd Prepare 0.9.12 2016-12-18 08:15:53 +09:00
Neil Booth
0dccb795dc Add pid to RPC getinfo
Closes #77
2016-12-18 08:13:17 +09:00
Neil Booth
3cf23c88bd Start up RPC server immediately
Don't wait for catch-up
Closes #78
2016-12-18 08:10:20 +09:00
Neil Booth
6679eea04c getinfo RPC: change height reporting
Also rename watched to subs
Closes #80
2016-12-18 07:57:48 +09:00
Neil Booth
ef54413054 Prepare 0.9.11 2016-12-18 00:02:16 +09:00
Neil Booth
645e60eaee Put peer at RHS of sessions log.
Then IPv6 addresses don't mess up the formatting.
2016-12-18 00:02:16 +09:00
Neil Booth
0665e1ac5c Clear the touched addresses if not caught up 2016-12-18 00:02:16 +09:00
Neil Booth
39af7a7463 Rework main block processor loop
It's less awkward and more explicit.
This brings back the efficiency lost in the 0.9.x series.
It also removes the special case hack: both when syncing and
caught up, block processing is done in the executor.

Fixes #58
2016-12-17 21:45:44 +09:00
Neil Booth
3f64a8dd6e Log block processing time only if not syncing
Prepare 0.9.10
2016-12-17 15:31:30 +09:00
Neil Booth
1ebebf08d9 Improve logging 2016-12-17 15:26:17 +09:00
Neil Booth
a30932fc86 Fix namespace of RPCError
Fixes #76
2016-12-17 14:43:27 +09:00
Neil Booth
35f07bd01e Prepare 0.9.9 2016-12-15 17:24:16 +09:00
Neil Booth
49714a45e6 Mempool tx processing to handle DBError
Fixes #74
2016-12-15 17:22:20 +09:00
Neil Booth
5c80b96d0f Prioritize mempool processing of sent txs
Closes #73
2016-12-15 17:22:19 +09:00
Neil Booth
ac48695db8 daemon: getting height optionally gets mempool
Improve daemon startup log message
2016-12-15 15:38:22 +09:00
Neil Booth
5fe49bb261 Synchronize daemon height and mempool fetching
Cleanup and simplify touched handling and its event, which is
now controlled and owned by the mempool.
The daemon object owns the set of current mempool hashes.
Clean up and simplify the mempool main loop.

Fixes #70.
2016-12-15 12:08:14 +09:00
Neil Booth
e88ea91e89 Defer address notifications whilst processing a block
Partial fix of #70
2016-12-15 12:08:14 +09:00
Neil Booth
1b2a0bd761 Append first. 2016-12-15 12:08:14 +09:00
Neil Booth
bffdfcc47f Prepare 0.9.7 2016-12-15 08:28:57 +09:00
Neil Booth
9972379533 Get history and UTXOs in executor for minimal latency. 2016-12-14 19:28:43 +09:00
Neil Booth
1c79a2d47e Fix delayed sessions issue for good 2016-12-14 06:07:37 +09:00
Neil Booth
ba862343b4 Fix issue for paused connections
Prepare 0.9.5
2016-12-14 00:07:26 +09:00
Neil Booth
ef65f9f281 Prepare 0.9.4 2016-12-13 22:52:00 +09:00
Neil Booth
e2f4847632 New env var MAX_SESSIONS
When the number of sessions reaches MAX_SESSIONS, which defaults
to 1,000, turn off TCP and SSL listening sockets to prevent new
connections.  When the session count falls below a low watermark,
currently 90% of MAX_SESSIONS, the listening sockets will be re-opened.
Helps prevent DoS and limit open file usage.

Bug fix: do not start serving paused connections until the buffer
socket is sufficiently drained.  Also, loop.
2016-12-13 22:47:03 +09:00
Neil Booth
067814e7d9 Remove numpeers and numsessions RPC calls
getinfo has that information and more.
2016-12-13 21:38:02 +09:00
Neil Booth
aaaa914cfa Tweak some constants to reduce group count 2016-12-13 20:09:40 +09:00
Neil Booth
444122122e Fix unconfirmed flag
Prepare 0.9.3
2016-12-12 08:21:55 +09:00
Neil Booth
bb17af1906 Fix mempool busy waiting
Prepare 0.9.2
2016-12-12 07:38:40 +09:00
Neil Booth
7037769598 Prepare 0.9.1 2016-12-12 07:25:22 +09:00
Neil Booth
f600d3bd87 Fix a couple of issues with 0.9.0
Fixes #69
2016-12-12 07:24:00 +09:00
Neil Booth
d36925d459 Prepare 0.9.0a 2016-12-12 00:44:04 +09:00
Neil Booth
f1ea36126c Fix typo 2016-12-12 00:42:57 +09:00
Neil Booth
72ae3eabfc Prepare 0.9.0 2016-12-12 00:11:48 +09:00
Neil Booth
1ef6a4d785 Split mempool out into new file.
Rework mempool handling
2016-12-12 00:05:42 +09:00
Neil Booth
ed3db731c2 Prepare 0.8.12 2016-12-10 18:06:14 +09:00
Neil Booth
263e88ad57 Tweak request handling
Pause serving sessions whose socket buffer is full (anti-DoS)
Serve requests in batches of 8
Don't store the session in the request
RPC has priority 0; every other session at least 1
Periodically consolidate small session groups into 1
2016-12-10 18:06:13 +09:00
Neil Booth
b3b3f047c2 Better columns 2016-12-10 18:06:13 +09:00
Neil Booth
cfb92a139f Prefer transport.abort() 2016-12-10 13:52:05 +09:00
Neil Booth
89d83349e1 Prepare 0.8.11 2016-12-10 11:08:44 +09:00
Neil Booth
d1e314a48b Show group session count in the groups RPC call 2016-12-10 11:05:57 +09:00
Neil Booth
c181f8df82 Put a try/except around socket.shutdown 2016-12-10 10:43:01 +09:00
Neil Booth
97d1397f2c Prepare 0.8.10 2016-12-10 09:08:28 +09:00
Neil Booth
6fcb8b0574 Fix cut-n-pasteo 2016-12-10 09:07:08 +09:00
Neil Booth
c9035795c7 Prepare 0.8.9 2016-12-10 08:56:05 +09:00
Neil Booth
99d7e65de8 Give sockets a grace period to close
Defaults to 15 seconds for now.
Update docs on systemd and process limits.
Fixes #62
2016-12-10 08:52:24 +09:00
Neil Booth
b8239c54d9 Catch UnicodeError in IRC gethostbyname
Fixes #68
2016-12-10 08:52:24 +09:00
Neil Booth
c523064632 Improve RPC groups call
Show columns correctly for RPC sessions call
2016-12-10 08:52:23 +09:00
Neil Booth
e5bda647df Update version 2016-12-09 22:41:26 +09:00
Neil Booth
9bdad7ad66 Fix column ordering. 2016-12-09 22:40:36 +09:00
Neil Booth
5f73fa02a3 Prepare 0.8.8 2016-12-09 22:10:59 +09:00
Neil Booth
2a461bd98c Serve sessions in a priority queue.
Add new RPC command requests.
Adjust sessions RPC command to show pending requests.
Only keep first 15 chars in version string.
Set socket timeout
Try more forceful closing of socket
Fixes #67
2016-12-09 22:06:04 +09:00
Neil Booth
1a9e8cdcd4 More work 2016-12-09 08:06:03 +09:00
Neil Booth
21d1825f09 Prepare 0.8.7 2016-12-09 07:41:24 +09:00
Neil Booth
7399452294 Temporary hack to fix initial sync slowdown 2016-12-08 22:47:29 +09:00
Neil Booth
cbb1e504cc Cache headers. 2016-12-08 06:31:15 +09:00
Neil Booth
e40db63beb Queue requests, which have a process method. 2016-12-08 00:29:46 +09:00
Neil Booth
2d411ab20a Prepare 0.8.6 2016-12-07 19:46:45 +09:00
Neil Booth
4e512343be Fix other JSON bugs introduced in 0.8.5
Further clean up the JSON code.
2016-12-07 19:44:36 +09:00
Neil Booth
b9f28ba9dc Prepare 0.8.5 2016-12-07 08:16:23 +09:00
Neil Booth
b2e4d32de6 Remove special-casing of all_seeing_eye 2016-12-07 08:11:30 +09:00
Neil Booth
f904ce2f5d Rework the JSON layer
Batch requests are now processed and encoded incrementally.
Their bandwidth usage is also incrementally added, and so overlarge
responses are rejected as soon as they become too large.
JSON text is also more memory efficient than the python data
structures they represent.
2016-12-07 08:11:30 +09:00
Neil Booth
b116040365 Clean up param verification code 2016-12-07 08:11:29 +09:00
Neil Booth
36a06ea2c2 Prepare 0.8.4 2016-12-06 06:40:19 +09:00
Neil Booth
1f1f0f42f8 Remove invalidated history cache on notifications 2016-12-06 06:36:11 +09:00
Neil Booth
643c990684 Revert "Add feature to rate limit connections"
This reverts commit a82ab0b075.
2016-12-05 23:27:36 +09:00
Neil Booth
be8adbbcd5 Fix some typos. 2016-12-04 23:41:07 +09:00
Neil Booth
a82ab0b075 Add feature to rate limit connections 2016-12-04 21:14:45 +09:00
Neil Booth
3f88bc1ab9 Prepare 0.8.3 2016-12-04 12:04:38 +09:00
Neil Booth
79a9e91994 Handle closing sessions a little differently
Move connection type to first flag letter.

All seeing eye is not stale.
2016-12-04 11:57:25 +09:00
Neil Booth
fcf696d3f3 Don't require 2 params for version requests 2016-12-04 10:54:22 +09:00
Neil Booth
9456b75a91 Prepare 0.8.2 2016-12-03 23:39:46 +09:00
Neil Booth
238b9e0285 Process blocks in the executor
This should eliminate latency when new blocks come in
and prevent sessions being dropped whilst they are processed.
2016-12-03 23:32:20 +09:00
Neil Booth
26de3f0261 Prepare 0.8.1 2016-12-03 20:24:53 +09:00
Neil Booth
656f749c70 Add LRU cache for history 2016-12-03 20:20:28 +09:00
Neil Booth
556574640f IRC encoding fix 2016-12-03 20:19:58 +09:00
Neil Booth
04369dd228 Forcefully drop stale sessions or if shutting down
Don't wait for the socket
2016-12-03 18:33:23 +09:00
Neil Booth
aaf0592f52 Fix typo 2016-12-03 15:10:57 +09:00
Neil Booth
33b1ce8f6d Prepare 0.8.0 2016-12-03 14:39:36 +09:00
Neil Booth
c4e7878407 Add session ID for each session
Show it in the logs with each session-specific message.
Show the sessions ID in the sessions list with an L suffix if logging.
Add RPC commands to toggle logging of, and disconnect, a session.
Closes #55
2016-12-03 14:32:09 +09:00
Neil Booth
3d2824218b Close stale sessions
New envvar SESSION_TIMEOUT
A session with no activity is cut off after this time
Fixes #56
2016-12-03 13:06:20 +09:00
Neil Booth
7e3ca6926d Prepare 0.7.20 2016-12-03 11:06:52 +09:00
Neil Booth
c16792fb89 Only wait 30 secsonds on shutdown 2016-12-03 11:03:27 +09:00
Neil Booth
f1e0676a47 Prepare 0.7.19 2016-12-02 18:44:36 +09:00
Neil Booth
62a531b1d0 Revert "Fix ref leak in mempool updates"
This reverts commit 6c95644ae0.
2016-12-02 18:43:15 +09:00
Neil Booth
35f118edc6 Prepare 0.7.18 2016-12-02 07:49:35 +09:00
Neil Booth
7a9e8c7fef Small tweaks to IRC code 2016-12-02 07:45:51 +09:00
Neil
9f90ae049e Merge pull request #53 from valesi/tor
Add IRC option to publish Tor address
2016-12-02 07:33:29 +09:00
Neil Booth
6c95644ae0 Fix ref leak in mempool updates 2016-12-02 07:22:30 +09:00
Shane Moore
0edff0056d Add Tor-specific port options for IRC 2016-12-01 03:21:52 -08:00
Shane Moore
33c5bd65aa Fix IRC port bug, more readable 2016-12-01 02:25:21 -08:00
Shane Moore
95c848a720 Add IRC option to publish Tor address 2016-11-30 23:50:20 -08:00
Neil Booth
d3f8ed31c2 0.7.17 release 2016-11-30 07:29:21 +09:00
Neil Booth
aa2baa9706 Prepare 0.7.16 2016-11-29 23:22:59 +09:00
Neil Booth
6b551973e8 queue -> tasks 2016-11-29 23:21:22 +09:00
Neil Booth
5e7f982427 Prepare 0.7.15 2016-11-29 23:04:06 +09:00
Neil Booth
0892b12036 Replace $DAEMON_VERSION and $DAEMON_SUBVERSION
in banner file.
2016-11-29 23:03:05 +09:00
Neil Booth
9c8f0283c9 Update version 2016-11-29 22:26:55 +09:00
Neil Booth
b65bcda504 Add per-session bandwidth limits 2016-11-29 22:19:12 +09:00
Neil Booth
c9a10be5ba Introduce incoming buffer size limit
- incoming buffered network requests limited to 150,000 bytes
  which I believe is ample for a genuine client
- if exceeded, the connection is dropped
- raise outgoing data limit for RPC connections to 5 MB - expect
  sessions calls can be long and connection is implicitly trusted
- similarly raise incoming buffered data limit to 5 MB for RPC
  connections
2016-11-29 20:24:58 +09:00
Neil Booth
c6d8440b3d Remove all RocksDB references on close 2016-11-29 19:50:44 +09:00
Neil Booth
5053101cee LOG_SESSIONS should use self.integer 2016-11-29 19:32:11 +09:00
Neil Booth
6713373aa2 Prepare 0.7.13 2016-11-29 08:03:51 +09:00
Neil Booth
c08ade5861 Add session logging facility
Move session logging code to protocol.py from electrum_rpc.py
Use it for periodic logging controlled by envvar LOG_SESSIONS
For each session, track sent transaction stats and show that
per-session instead of errors
2016-11-29 08:00:54 +09:00
Neil Booth
98c4ce3fef Prepare 0.7.12 2016-11-27 22:01:12 +09:00
Neil Booth
b8fc739590 Fix ordering in get_utxos 2016-11-27 21:54:05 +09:00
Neil Booth
f9cc21807f Further optimize the inner loop 2016-11-27 14:20:36 +09:00
Neil Booth
5c0b026158 Tasks queue just has null entries for now 2016-11-27 13:35:09 +09:00
Neil Booth
6aef79461f Don't shut down block processor by cancellation
The block processor needs to be able to close cleanly, and not
mid-block.  In order to be able to yield whilst processing blocks
we cannot forcefully close its coroutine with a cancellation.
2016-11-27 12:20:16 +09:00
Neil Booth
1b95bcd8ac Open DB differently depending on if syncing
If syncing, use a high max_open_files, otherwise lower it.
2016-11-27 07:25:28 +09:00
Neil Booth
0afddb7bc3 Give backing up its own flush function
Remove some excessive log messages
2016-11-26 20:59:59 +09:00
Neil Booth
f5384ccc98 Remove get_tx_hash
Anything in the DB should be on the disk.  Remove misleading
comment.
2016-11-26 20:09:18 +09:00
Neil Booth
4fc5e309ab Prepare 0.7.11 2016-11-26 18:20:40 +09:00
Neil Booth
9eb701f220 Replace $VERSION in the banner file
with the ElectrumX version string
2016-11-26 18:19:53 +09:00
Neil Booth
1aaed2e913 Create just one server connection
I hope this
Fixes #47
2016-11-26 18:10:03 +09:00
Neil Booth
3f743e9630 Distinguish undo_info being empty and not existing
Fixes #46
2016-11-26 16:16:17 +09:00
Neil Booth
af3ae6429e Fix logging bug 2016-11-26 15:35:55 +09:00
Neil Booth
4e26e0fe96 Bump default value of MAX_SEND to 1m bytes.
Otherwise historic large txs could not be served to clients.
2016-11-26 15:22:42 +09:00
Neil Booth
95a2de6dae Move DB undo code to db.py 2016-11-26 13:18:10 +09:00
Neil Booth
8d253c81d3 Move clean_db() to db.py 2016-11-26 13:15:45 +09:00
Neil Booth
db5d0dd6cb Merge branch 'serve_disk_only' into develop 2016-11-26 13:12:57 +09:00
Neil Booth
59244cc24e Move bulk of FS flush code to db.py
More logically belongs there.
Have servers use the flushed DB height not the block processor's height.
Get all headers only from disk.
2016-11-26 13:11:59 +09:00
Neil Booth
df3cb8535a Cleaner handling of touched addresses
Moved to local vars rather than an instance variable
2016-11-26 12:46:11 +09:00
Neil Booth
b97496d4a5 Set max_open_files for LevelDB to 256
On Linux it seems a bit greedy
2016-11-26 10:38:48 +09:00
Neil Booth
9544170c55 Prepare release-0.7.10 2016-11-26 09:53:47 +09:00
Neil Booth
292073f2c7 Log large requests and reject them 2016-11-26 09:32:29 +09:00
Neil Booth
59733e4609 Move bitcoin-specific coin defaults to Bitcoin 2016-11-26 08:32:30 +09:00
TheLazieR Yip
f3ecfe00e2 Remove unused variables 2016-11-25 07:45:45 -05:00
TheLazieR Yip
828727d41a Remove unneccessary local variables 2016-11-25 07:44:19 -05:00
TheLazieR Yip
e987510432 Replace double_sha256 with header_hash from coin 2016-11-25 07:25:57 -05:00
TheLazieR Yip
b3623f5455 replace header_hashes with header_prevhash , header_hash 2016-11-25 07:25:56 -05:00
Neil Booth
9f2bd981f0 Prepare 0.7.9 2016-11-25 21:23:14 +09:00
Neil Booth
42c00d32d2 Rewrite lib/jsonrpc.py to be a useful client too
Use for an improved electrumx_rpc.py, so it now handles responses spread
over several packets.  Also added a timeout of 5 seconds.

Fixes #43
2016-11-25 21:19:43 +09:00
Neil Booth
2dbb9f44f6 Prepare release 0.7.8 2016-11-25 08:10:53 +09:00
Neil Booth
ef2703177e Fix another assertion error during reorgs
Fixes #44
2016-11-25 08:10:11 +09:00
Neil Booth
86b0f7fa72 Prepare 0.7.7 2016-11-24 23:42:49 +09:00
Neil Booth
de4930b96d Introduce MAX_HIST environment variable. 2016-11-24 23:30:40 +09:00
Neil Booth
70ee7eebd8 Prepare 0.7.6 2016-11-23 22:52:23 +09:00
Neil Booth
956d1b8039 Fix IRC regression 2016-11-23 22:49:37 +09:00
Neil Booth
86086cac63 Prepare 0.7.5 2016-11-23 17:59:18 +09:00
Neil Booth
9e220820aa Rework futures and event handling 2016-11-23 17:52:09 +09:00
Neil Booth
bab0d162de Merge ServerManager and BlockServer 2016-11-23 17:52:08 +09:00
Neil Booth
d7887b62be Merge branch 'irc_vars' of https://github.com/thelazier/electrumx into thelazier-irc_vars 2016-11-23 10:21:16 +09:00
TheLazieR Yip
f075f0bb5f Add coin's IRC parameters 2016-11-23 08:15:03 +07:00
Neil Booth
f20859a8a6 Prepare 0.7.4 2016-11-23 09:55:54 +09:00
Neil Booth
640360c809 Add feature to simulate reorgs for debugging 2016-11-23 09:52:30 +09:00
Neil Booth
8970205e6c Remove obsolete debugging feature 2016-11-23 09:16:41 +09:00
Neil Booth
2df5aa746f Pop one from tx_counts for each block we back up.
Fixes #40
2016-11-23 09:11:49 +09:00
Neil Booth
26221e751e Remove dead code 2016-11-23 09:02:01 +09:00
Neil Booth
39021792ca Prepare 0.7.3 2016-11-22 08:11:05 +09:00
Neil Booth
d1ba4b1a76 Reset fs_height when backing up 2016-11-22 08:09:43 +09:00
Neil Booth
67bb01bf2c Fix reorgs with unspendable TXOs 2016-11-22 07:50:01 +09:00
Neil Booth
e5c4bb9743 Prepare 0.7.2 release 2016-11-22 07:03:37 +09:00
Neil Booth
aa9f106865 Add missing self; use max_secs where intended. 2016-11-20 23:11:35 +09:00
Neil Booth
285a66fceb Prepare 0.7.1 2016-11-20 22:03:04 +09:00
Neil Booth
fa30c5529b Fix missing qualifier 2016-11-20 22:01:44 +09:00
Neil Booth
dd0cd0156f Remove debug log 2016-11-20 20:56:12 +09:00
Neil Booth
87cdd2709d Implement daemon failover
Daemon URLs can be comma-separated in the DAEMON_URL env var.
Surrounding whitespace is stripped.
http:// is preprended if missing.
The coin's default port is supplied if missing.
A trailing / is supplied if missing.
Closes #33
2016-11-20 20:52:54 +09:00
Neil Booth
11558fd9d2 Add debug log 2016-11-20 20:52:54 +09:00
Neil Booth
1dc43b3020 Show connection total in connection log
Fix typo resulting in no mempool notifications
2016-11-20 19:29:58 +09:00
Neil Booth
009750bacb Merge branch 'async_mempool' into develop 2016-11-20 18:25:40 +09:00
Neil Booth
5eb92007ae Remove redundant log; IRC will emit one 2016-11-20 18:18:30 +09:00
Neil Booth
98fd178c62 Make mempool truly asynchronous
Mempool updates happen in parallel asynchronously to processing of
new blocks once caught up.  This means that, e.g., during the initial
slow mempool download incoming blocks can be processed and communicated
to clients without waiting for the downloaded mempool transaction
analysis to complete.  From a client's point of view the server won't
be seen as lagging.
2016-11-20 18:17:55 +09:00
Neil Booth
8b34d1c134 Log IRC errors, typically missing package 2016-11-20 18:09:32 +09:00
Neil Booth
dd5a31d0f4 Take a little more care cleaning up connections 2016-11-19 20:56:08 +09:00
Neil Booth
8617c82ec2 Floor disk_count at zero. 2016-11-19 20:56:08 +09:00
Neil Booth
ccf24fdc71 Wait 20 secs for sockets to close
10 seems a little low
2016-11-19 20:00:38 +09:00
Neil Booth
d856cbab90 Prepare 0.6.3 2016-11-19 17:10:58 +09:00
Neil Booth
52116539d4 Clean shutdown: wait for transports to close
We give 10 seconds for everything to be cleaned up, then close forcibly.
Fixes #30
2016-11-19 17:05:47 +09:00
Neil Booth
3d87e299ea Move formatted_time to library 2016-11-19 15:42:06 +09:00
Neil Booth
0b52376f23 Add subscription limits 2016-11-19 10:51:16 +09:00
Neil Booth
4a4d11ad7c Prepare release 0.6.2 2016-11-19 08:21:17 +09:00
Neil Booth
ffd6cd63b0 Fix thinko 2016-11-19 08:16:20 +09:00
Neil Booth
913d156786 Convert DaemonError to RPCError
To cleanly return errors to clients
getrawtransaction has the ugly API and still does its own thing

Fixes #32
2016-11-19 08:12:13 +09:00
Neil Booth
942d5d6b00 Fix import 2016-11-19 08:07:37 +09:00
Neil Booth
063a5469cc Move mempool to be with BlockServer
BlockProcessor doesn't really need a mempool; mempools are
only useful for servers.
Set first_sync before flushing, so it goes into DB state.
Start servers immediately on catchup; mempool fills asynchronously.

Fixes #31
2016-11-19 08:02:13 +09:00
Neil Booth
d6fa4a1564 More logging improvements
- log software and DB version at startup
- log more DB info at startup
- log software and DB version when first synced

Fixes #29
2016-11-19 07:29:17 +09:00
Neil Booth
3abddf4a51 Simplify sessions call 2016-11-19 00:02:56 +09:00
Neil Booth
6d7bc7595f Prepare release 0.6.1 2016-11-18 22:28:42 +09:00
Neil Booth
88185b0daa Bump log threshold up; tweak log 2016-11-18 22:20:48 +09:00
Neil Booth
24d9e5a95e Tweak flush logic
Aim to not check cache size if caught up; also reduces logs
2016-11-18 22:17:34 +09:00
Neil Booth
beeb60f324 Implement blockchain.address.get_mempool
Fixes #26
2016-11-18 21:41:27 +09:00
Neil Booth
e6058c3fd3 hex_hash is already hex 2016-11-18 21:16:34 +09:00
Neil Booth
7f3551e435 tx_merkle: catch bad hashes and report properly
Fixes #27
2016-11-18 20:56:53 +09:00
Neil Booth
4fe7e7dab2 Merge branch 'better_logs' into develop 2016-11-18 20:19:27 +09:00
Neil Booth
d2c575a24b Better, more concise logs, particularly when caught up. 2016-11-18 20:08:43 +09:00
Neil Booth
3f8b26291a At startup only log some things during initial sync 2016-11-18 19:21:45 +09:00
Neil Booth
66c493dbf4 Make the default reorg_limit a coin property 2016-11-18 19:21:38 +09:00
Neil Booth
022a919701 Prepare release 0.6 2016-11-17 23:08:19 +09:00
Neil Booth
4c7f72fe68 RPCError is not a global variable 2016-11-17 22:07:37 +09:00
Neil Booth
f4651c0ca4 Store tx_num in 'h' table key so keys are unique 2016-11-17 07:59:40 +09:00
Neil Booth
3c98053f5d Remove some dead code 2016-11-17 07:44:42 +09:00
Neil Booth
c5c7b6f438 Have all expensive requests yield. 2016-11-17 06:50:46 +09:00
Neil Booth
f17ad2ddf4 Put notifications on the session queue
This keeps the network in-order and means slow clients get slow
notifications, which seems fairer.

Add some simple logging
2016-11-17 06:04:08 +09:00
Neil Booth
a1eb446af4 Tweak notify handling 2016-11-17 05:37:37 +09:00
Neil Booth
cc2db4a62c Bump HIST_MB default to 300MB 2016-11-16 06:39:39 +09:00
Neil Booth
b60eb5ca17 Prepare 0.5.1 2016-11-15 21:34:08 +09:00
Neil Booth
d85034353f Remove useless re-raise of cancellation 2016-11-15 20:13:50 +09:00
Neil Booth
db187540d5 Have task coros handle cancelled exceptions 2016-11-15 20:09:38 +09:00
Neil Booth
a2280bbc93 Clean up futures handling 2016-11-15 20:09:38 +09:00
Neil Booth
8671e57183 Move fs flushes to same time as history flushes 2016-11-15 06:28:52 +09:00
Neil Booth
8c55f41305 Accept more SSL protocols 2016-11-14 23:13:34 +09:00
Neil Booth
95cc979465 Yield more during mempool load 2016-11-14 23:12:50 +09:00
Neil Booth
1830cae3de Remove a redundant message 2016-11-14 21:52:25 +09:00
Neil Booth
83674b1b7b Clarify peername() logic 2016-11-14 21:28:42 +09:00
Neil Booth
be45a9e228 Minor improvements to client handling
Don't create a task until ready to execute it
Log expensive tasks
Assume peers are for logging unless explicitly not stated
2016-11-14 21:15:09 +09:00
Neil Booth
14d3d85bd9 Need an array to take its len 2016-11-14 19:52:18 +09:00
Neil Booth
dc74c869a1 Await task after cancelling it. 2016-11-14 19:24:17 +09:00
Neil Booth
984a482590 Merge branch 'master' into develop 2016-11-14 08:11:40 +09:00
Neil Booth
12ed9f7069 Have session_count return a dictionary 2016-11-14 08:01:00 +09:00
Neil Booth
1b8881800d Move the RPC handlers to the manager 2016-11-14 07:56:48 +09:00
Johann Bauer
d45321927e Add optional option to anonymise logs (remove IP addresses) 2016-11-13 23:56:16 +01:00
Neil Booth
c22366c1cc Prepare 0.5 release 2016-11-13 22:41:11 +09:00
Neil Booth
451f9d026a Merge branch 'save_all_utxos' into develop 2016-11-13 20:42:43 +09:00
Neil Booth
85786b87a2 Save all UTXOs
Change the DB version
2016-11-13 20:35:03 +09:00
Neil Booth
4dac728984 Ignore the unspendable genesis coinbase
Fixes #17
2016-11-13 20:15:54 +09:00
Neil Booth
41ff6e5b11 Prepare 0.4.3 2016-11-13 17:55:50 +09:00
Neil Booth
57dd4ece9c Avoid annoying exception on shutdown 2016-11-13 17:52:08 +09:00
Neil Booth
e7e0dd15be Don't log new peers any more 2016-11-13 15:44:37 +09:00
Neil Booth
831225492e Better RPC sessions stats 2016-11-13 15:28:34 +09:00
Neil Booth
7523735f99 Split out server and session management 2016-11-13 14:43:13 +09:00
Neil Booth
3b6ab77e47 Break out JSONRPC into own file
- improved handling of JSON 2.0 RPC protocol
- permits batched requests (not yet supported by Electrum client)
2016-11-13 13:39:37 +09:00
Neil Booth
d816c21752 Prepare 0.4.1 2016-11-12 23:23:08 +09:00
Neil Booth
14d8ece7c6 Return a version the Electrum client expects
If you don't do this you don't appear in the network dialog box
2016-11-12 23:20:20 +09:00
Neil Booth
d84417e2d6 Add note about IRC package 2016-11-12 22:09:00 +09:00
Neil Booth
751bb2d970 Remove debug code 2016-11-12 21:52:50 +09:00
Neil Booth
5624809933 Prepare 0.4 2016-11-12 21:51:43 +09:00
Neil Booth
c93f6cb920 Final cleanup 2016-11-12 21:48:34 +09:00
Neil Booth
cb7b7dd1fe Move pretty printing of sessions to client
Tweak logging
2016-11-12 21:36:49 +09:00
Neil Booth
501807bf1a Implement IRC support and related queries from clients 2016-11-12 21:06:51 +09:00
Neil Booth
80fe427c89 Improve logging 2016-11-12 20:50:44 +09:00
Neil Booth
261682439d Prepare 0.3.3 2016-11-12 09:46:20 +09:00
Neil Booth
24df3cef7b Merge branch 'master' into release-0.3.3 2016-11-12 09:45:49 +09:00
Neil Booth
d8bb174f2b Use correct daemon API 2016-11-12 09:42:35 +09:00
Neil Booth
419ab68a38 Prepare 0.3.2 2016-11-12 09:27:46 +09:00
Neil Booth
59b2b2cb04 Better log formatting 2016-11-12 09:26:40 +09:00
Neil Booth
7496b511b8 Fix silly thinko 2016-11-12 09:25:34 +09:00
Neil Booth
312708e2e7 Fix daemon warming up 2016-11-12 09:20:46 +09:00
Neil Booth
3798ef80ef Prepare 0.3.1 2016-11-12 09:12:18 +09:00
Neil Booth
409ea2c784 Daemon's send takes a processor
Simplest way to process the result and still be able to raise exceptions
in the daemon request loop.  In particular, we can pass missing txs through
as None in getrawtransactions.

Fixes #9
2016-11-12 09:09:31 +09:00
Neil Booth
f05e51df2a Skip logging transient errors just once 2016-11-12 08:12:41 +09:00
Neil Booth
56274fb9ea Prefix internal methods with an underscore 2016-11-12 07:43:24 +09:00
Neil Booth
1b9a9b8927 Start saving DB version and checking it 2016-11-12 07:31:56 +09:00
Neil Booth
244a0f2fab Update release notes. 2016-11-11 21:18:51 +09:00
Neil Booth
15e052c728 Merge branch 'utxo_optimised' into develop 2016-11-11 21:04:39 +09:00
Neil Booth
f98dc9c351 Practise optimism like before 2016-11-11 21:03:09 +09:00
Neil Booth
5a2a8b4ec1 Prepare 0.2.3 release 2016-11-10 23:57:13 +09:00
Neil Booth
56098e0c52 Show up to 3 missing UTXOs
Fixes #15
2016-11-10 23:51:44 +09:00
Neil Booth
c6b5c577ab More robust daemon error handling
Fixes #6
2016-11-10 23:26:11 +09:00
Neil Booth
8188f7e909 Catch exceptions when trying to listen
Fixes #11
2016-11-10 22:49:20 +09:00
Neil Booth
311f7f9ffd Better optimised storage of UTXO set 2016-11-10 20:04:33 +09:00
Neil Booth
094fd44fc2 Merge UTXO cache into BlockProcessor 2016-11-10 07:49:01 +09:00
Neil Booth
bf6a8f58d5 Hotfixes for two issues in 0.2.2 2016-11-10 07:43:07 +09:00
Neil Booth
1737bb8354 Move some code back to correct place
Fixes #12
2016-11-10 07:41:56 +09:00
Neil Booth
06b6d695c2 Only attempt to flush if cancelled 2016-11-10 07:32:39 +09:00
Johann Bauer
1405057096 Fix getting the number of watched addresses
Resolves #13
2016-11-09 18:07:25 +01:00
Neil Booth
4e619c9f5e Prepare 0.2.2 2016-11-09 07:44:17 +09:00
Neil Booth
a07ed5876b Count missing UTXOs and log just once
They're a temporary phenomenon but it's handy to see how often
these things happen.  Fixes #10.
2016-11-09 07:30:48 +09:00
Neil Booth
55cc1d3d65 More regularly 2016-11-09 06:50:00 +09:00
Neil Booth
212d653b5b Yield during mempool updates 2016-11-09 06:45:24 +09:00
Neil Booth
c6a57daf6a Tweak daemon messages 2016-11-09 06:32:26 +09:00
Neil Booth
ed44c6ab73 Clean up startup procedure 2016-11-09 00:47:49 +09:00
Neil Booth
a510603b46 Better logging of initial mempool fill 2016-11-08 23:37:19 +09:00
Neil Booth
3972e18e98 Move the rest of fs_cache into BlockProcessor 2016-11-08 23:30:30 +09:00
Neil Booth
ad2dabf751 Remove the FS cache
Really belongs with BlockProcessor now
2016-11-08 20:06:06 +09:00
Neil Booth
5736e9cb70 Move utxo_cache to BlockProcessor where it belongs 2016-11-08 19:35:21 +09:00
Neil Booth
5c5e90d574 Move BlockServer to more appropriate location 2016-11-08 19:20:13 +09:00
Neil Booth
93d53bdd87 The controller is dead! 2016-11-08 08:29:56 +09:00
Neil Booth
2b028cc065 Create BlockServer
Controller now an empty shell
2016-11-08 08:09:59 +09:00
Neil Booth
c0a112f8ea Split out part of block processor into db.py
The part that doesn't actually do any block processing...
2016-11-08 07:38:16 +09:00
Neil Booth
1393f6a030 Move signal handling out of the controller 2016-11-08 00:04:10 +09:00
Neil Booth
9acd91615c Merge remote-tracking branch 'github/master' into release-0.2.1
Include's bauerj's storage.py improvements.
2016-11-07 23:11:34 +09:00
Neil Booth
e7912928c5 Prepare for release 2016-11-07 23:10:56 +09:00
Neil Booth
aaec784ef2 Merge branch 'daemon_throttle' into session_mgr 2016-11-07 22:48:12 +09:00
Neil Booth
782268cd3e Limit concurrent daemon requests
Fixes #7
2016-11-07 22:47:38 +09:00
Neil Booth
f05a5414c1 Make jobs truly asynchronous.
However we need to rate-limit the daemon...
2016-11-07 22:22:47 +09:00
Neil Booth
e452c0bca7 Fix read_headers 2016-11-07 19:59:49 +09:00
Neil Booth
7f03b0fa73 Move job handling out of the controller
Controller on its last legs...
2016-11-07 19:57:23 +09:00
Neil Booth
be975a3f7c Create docs directory 2016-11-07 05:35:00 +09:00
Johann Bauer
f6f674577f Fix RocksDB and LMDB 2016-11-06 18:16:43 +01:00
Neil Booth
f02acdfd46 A couple more tweaks. 2016-11-06 14:56:08 +09:00
Neil Booth
6deb05ab6f It was a mistake to use tuples 2016-11-06 14:42:12 +09:00
Neil Booth
3ab07c1fb6 Speed up script parsing for ~3% faster throughput
Also improves the coin abstraction
2016-11-06 14:32:27 +09:00
Neil Booth
3d41738a00 Allow daemon is None still 2016-11-06 12:09:41 +09:00
Neil Booth
e651530e5d Log immediately if mempool shrinks 2016-11-06 10:16:02 +09:00
Neil Booth
c2703c58a3 Better mempool log 2016-11-06 09:41:06 +09:00
Neil Booth
42b0e32f63 Prepare release 2016-11-06 09:27:25 +09:00
Neil Booth
c26bc43a00 Remove keys if value is empty 2016-11-06 08:54:56 +09:00
Neil Booth
48f0d5456c Release preparation 2016-11-06 08:48:38 +09:00
Neil Booth
db29121d58 Improved daemon logging 2016-11-06 08:41:16 +09:00
Neil Booth
18efa67f1d Various daemon improvements 2016-11-06 08:24:18 +09:00