Browse Source

Prepare 1.6pre1

patch-2
Neil Booth 7 years ago
parent
commit
362499778a
  1. 6
      docs/changelog.rst
  2. 2
      docs/conf.py
  3. 2
      docs/protocol-basics.rst
  4. 3
      electrumx/__init__.py
  5. 3
      electrumx/server/block_processor.py
  6. 16
      electrumx/server/controller.py
  7. 7
      electrumx/server/session.py
  8. 1
      electrumx/server/version.py
  9. 2
      setup.py

6
docs/changelog.rst

@ -7,6 +7,12 @@
and memory consumption whilst serving clients. Those problems
should not occur with Python 3.7.
Version 1.6
===========
* implement :ref:`version 1.4` of the protocol, with benefit for light
clients, particularly mobile
Version 1.5.2
=============

2
docs/conf.py

@ -15,7 +15,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
VERSION="1.5.2"
VERSION="ElectrumX 1.6"
# -- Project information -----------------------------------------------------

2
docs/protocol-basics.rst

@ -223,7 +223,7 @@ provided for the final header - the *prev_hash* links in the headers
are sufficient to prove the others valid.
Using this feature client software only needs to download the headers
it is interested in up to the checkpoint. HHeaders after the
it is interested in up to the checkpoint. Headers after the
checkpoint must all be downloaded and validated as before. The RPC
calls return the merkle root, so to embed a checkpoint in a client
simply make an RPC request to a couple of trusted servers for the

3
electrumx/__init__.py

@ -1,2 +1,5 @@
version = 'ElectrumX 1.6pre1'
version_short = version.split()[-1]
from electrumx.server.controller import Controller
from electrumx.server.env import Env

3
electrumx/server/block_processor.py

@ -15,6 +15,7 @@ from struct import pack, unpack
import time
from functools import partial
import electrumx
from electrumx.server.daemon import DaemonError
from electrumx.lib.hash import hash_to_hex_str, HASHX_LEN
from electrumx.lib.util import chunks, formatted_time, class_logger
@ -216,7 +217,7 @@ class BlockProcessor(electrumx.server.db.DB):
self.first_sync = False
await self.controller.run_in_executor(self.flush, True)
if self.utxo_db.for_sync:
self.logger.info(f'{self.controller.VERSION} synced to '
self.logger.info(f'{electrumx.version} synced to '
f'height {self.height:,d}')
self.open_dbs()
self.caught_up_event.set()

16
electrumx/server/controller.py

@ -20,6 +20,7 @@ from functools import partial
import pylru
from aiorpcx import RPCError, TaskSet, _version as aiorpcx_version
import electrumx
from electrumx.lib.hash import hash_to_hex_str, hex_str_to_hash
from electrumx.lib.hash import HASHX_LEN
from electrumx.lib.merkle import Merkle, MerkleCache
@ -30,7 +31,6 @@ from electrumx.server.daemon import DaemonError
from electrumx.server.mempool import MemPool
from electrumx.server.peers import PeerManager
from electrumx.server.session import LocalRPC, BAD_REQUEST, DAEMON_ERROR
from electrumx.server.version import VERSION
version_string = util.version_string
@ -62,7 +62,6 @@ class Controller(ServerBase):
PROTOCOL_MIN = '1.1'
PROTOCOL_MAX = '1.4'
AIORPCX_MIN = (0, 5, 6)
VERSION = VERSION
def __init__(self, env):
'''Initialize everything that doesn't require the event loop.'''
@ -71,7 +70,7 @@ class Controller(ServerBase):
raise RuntimeError('ElectrumX requires aiorpcX >= '
f'{version_string(self.AIORPCX_MIN)}')
self.logger.info(f'software version: {self.VERSION}')
self.logger.info(f'software version: {electrumx.version}')
self.logger.info(f'aiorpcX version: {version_string(aiorpcx_version)}')
self.logger.info(f'supported protocol versions: '
f'{self.PROTOCOL_MIN}-{self.PROTOCOL_MAX}')
@ -115,17 +114,12 @@ class Controller(ServerBase):
# Event triggered when electrumx is listening for incoming requests.
self.server_listening = asyncio.Event()
@classmethod
def short_version(cls):
'''Return e.g. "1.2" for ElectrumX 1.2'''
return cls.VERSION.split()[-1]
def server_features(self):
'''Return the server features dictionary.'''
return {
'hosts': self.env.hosts_dict(),
'pruning': None,
'server_version': self.VERSION,
'server_version': electrumx.version,
'protocol_min': self.PROTOCOL_MIN,
'protocol_max': self.PROTOCOL_MAX,
'genesis_hash': self.coin.GENESIS_HASH,
@ -134,7 +128,7 @@ class Controller(ServerBase):
def server_version_args(self):
'''The arguments to a server.version RPC call to a peer.'''
return [self.VERSION, [self.PROTOCOL_MIN, self.PROTOCOL_MAX]]
return [electrumx.version, [self.PROTOCOL_MIN, self.PROTOCOL_MAX]]
def protocol_tuple(self, client_protocol_str):
'''Given a client's protocol version string, return the negotiated
@ -421,7 +415,7 @@ class Controller(ServerBase):
'''A one-line summary of server state.'''
group_map = self._group_map()
return {
'version': VERSION,
'version': electrumx.version,
'daemon': self.daemon.logged_url(),
'daemon_height': self.daemon.cached_height(),
'db_height': self.bp.db_height,

7
electrumx/server/session.py

@ -15,6 +15,7 @@ from functools import partial
from aiorpcx import ServerSession, JSONRPCAutoDetect, RPCError
import electrumx
from electrumx.lib.hash import sha256, hash_to_hex_str
import electrumx.lib.util as util
from electrumx.server.daemon import DaemonError
@ -378,8 +379,8 @@ class ElectrumX(SessionBase):
revision //= 100
daemon_version = '{:d}.{:d}.{:d}'.format(major, minor, revision)
for pair in [
('$SERVER_VERSION', self.controller.short_version()),
('$SERVER_SUBVERSION', self.controller.VERSION),
('$SERVER_VERSION', electrumx.version_short),
('$SERVER_SUBVERSION', electrumx.version),
('$DAEMON_VERSION', daemon_version),
('$DAEMON_SUBVERSION', network_info['subversion']),
('$DONATION_ADDRESS', self.env.donation_address),
@ -448,7 +449,7 @@ class ElectrumX(SessionBase):
self.set_protocol_handlers(ptuple)
return (self.controller.VERSION, self.protocol_version)
return (electrumx.version, self.protocol_version)
async def transaction_broadcast(self, raw_tx):
'''Broadcast a raw transaction to the network.

1
electrumx/server/version.py

@ -1 +0,0 @@
VERSION = 'ElectrumX 1.5.2'

2
setup.py

@ -1,5 +1,5 @@
import setuptools
version = '1.5.2'
version = '1.6'
setuptools.setup(
name='electrumX',

Loading…
Cancel
Save