Browse Source

Merge branch 'release-0.8.4'

master 0.8.4
Neil Booth 8 years ago
parent
commit
341c05af61
  1. 6
      README.rst
  2. 5
      RELEASE-NOTES
  3. 2
      electrumx_rpc.py
  4. 2
      lib/jsonrpc.py
  5. 12
      server/protocol.py
  6. 2
      server/version.py

6
README.rst

@ -113,10 +113,8 @@ be necessary.
Roadmap Pre-1.0 Roadmap Pre-1.0
=============== ===============
- minor code cleanups - minor code cleanups. It is unlikely DB format will change
- at most 1 more DB format change; I will make a weak attempt to - better DoS protections and mempool handling
retain 0.6 release's DB format if possible
- provision of bandwidth limit controls
- implement simple protocol to discover peers without resorting to IRC - implement simple protocol to discover peers without resorting to IRC

5
RELEASE-NOTES

@ -1,3 +1,8 @@
version 0.8.4
-------------
- remove invalidated histories from cache on new block
version 0.8.3 version 0.8.3
------------- -------------

2
electrumx_rpc.py

@ -58,7 +58,7 @@ def main():
args = parser.parse_args() args = parser.parse_args()
if args.port is None: if args.port is None:
args.port = int(environ.get('ELECTRUMX_RPC_PORT', 8000)) args.port = int(environ.get('RPC_PORT', 8000))
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
coro = loop.create_connection(RPCClient, 'localhost', args.port) coro = loop.create_connection(RPCClient, 'localhost', args.port)

2
lib/jsonrpc.py

@ -145,7 +145,7 @@ class JSONRPC(asyncio.Protocol, LoggedClass):
self.recv_size += len(data) self.recv_size += len(data)
self.using_bandwidth(len(data)) self.using_bandwidth(len(data))
# Close abuvsive connections where buffered data exceeds limit # Close abusive connections where buffered data exceeds limit
buffer_size = len(data) + sum(len(part) for part in self.parts) buffer_size = len(data) + sum(len(part) for part in self.parts)
if buffer_size > self.max_buffer_size: if buffer_size > self.max_buffer_size:
self.log_error('read buffer of {:,d} bytes exceeds {:,d} ' self.log_error('read buffer of {:,d} bytes exceeds {:,d} '

12
server/protocol.py

@ -15,7 +15,7 @@ import ssl
import time import time
import traceback import traceback
from collections import defaultdict, namedtuple from collections import defaultdict, namedtuple
from functools import partial, lru_cache from functools import partial
import pylru import pylru
@ -231,7 +231,7 @@ class ServerManager(util.LoggedClass):
self.max_subs = env.max_subs self.max_subs = env.max_subs
self.subscription_count = 0 self.subscription_count = 0
self.next_stale_check = 0 self.next_stale_check = 0
self.history_cache = pylru.lrucache(512) self.history_cache = pylru.lrucache(128)
self.futures = [] self.futures = []
env.max_send = max(350000, env.max_send) env.max_send = max(350000, env.max_send)
self.logger.info('session timeout: {:,d} seconds' self.logger.info('session timeout: {:,d} seconds'
@ -318,6 +318,10 @@ class ServerManager(util.LoggedClass):
def notify(self, touched): def notify(self, touched):
'''Notify sessions about height changes and touched addresses.''' '''Notify sessions about height changes and touched addresses.'''
# Remove invalidated history cache
hc = self.history_cache
for hash168 in set(hc).intersection(touched):
del hc[hash168]
cache = {} cache = {}
for session in self.sessions: for session in self.sessions:
if isinstance(session, ElectrumX): if isinstance(session, ElectrumX):
@ -537,8 +541,8 @@ class Session(JSONRPC):
'''Base class of ElectrumX JSON session protocols. '''Base class of ElectrumX JSON session protocols.
Each session runs its tasks in asynchronous parallelism with other Each session runs its tasks in asynchronous parallelism with other
sessions. To prevent some sessions blocking othersr, potentially sessions. To prevent some sessions blocking others, potentially
long-running requests should yield (not yet implemented). long-running requests should yield.
''' '''
def __init__(self, manager, bp, env, kind): def __init__(self, manager, bp, env, kind):

2
server/version.py

@ -1 +1 @@
VERSION = "ElectrumX 0.8.3" VERSION = "ElectrumX 0.8.4"

Loading…
Cancel
Save