Commit Graph

135 Commits

Author SHA1 Message Date
Neil Booth
a81b8917d8 Logging tweaks 2016-12-21 21:15:48 +09:00
Neil Booth
4c4cd92c54 Banner: add $DONATION_ADDRESS meta variable
Replaced with the DONATION_ADDRESS environment variable
2016-12-21 20:31:42 +09:00
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
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
813d8ee7e3 Reduce logging verbosity for delayed requests
Only log when the delay changes
2016-12-18 23:17:03 +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
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
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
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
5c80b96d0f Prioritize mempool processing of sent txs
Closes #73
2016-12-15 17:22:19 +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
1b2a0bd761 Append first. 2016-12-15 12:08:14 +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
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
f600d3bd87 Fix a couple of issues with 0.9.0
Fixes #69
2016-12-12 07:24:00 +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
6fcb8b0574 Fix cut-n-pasteo 2016-12-10 09:07:08 +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
c523064632 Improve RPC groups call
Show columns correctly for RPC sessions call
2016-12-10 08:52:23 +09:00
Neil Booth
9bdad7ad66 Fix column ordering. 2016-12-09 22:40:36 +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
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
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
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
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
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