From 270a35badada9b7fccfeb5c342849d18c9c54411 Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 6 Aug 2023 14:10:59 +0100 Subject: [PATCH] Implement RPC batch limit --- CHANGELOG | 2 ++ eth_monitor/chain.py | 3 ++- eth_monitor/settings.py | 2 +- requirements.txt | 8 ++++---- setup.cfg | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 15d9212..166468f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.8.0 + * Implement RPC batch limits for syncer - 0.7.6 * Make rpc dialect work with chain interface - 0.7.5 diff --git a/eth_monitor/chain.py b/eth_monitor/chain.py index dd0f71d..408bb27 100644 --- a/eth_monitor/chain.py +++ b/eth_monitor/chain.py @@ -12,7 +12,8 @@ from chainlib.eth.tx import ( class EthChainInterface(ChainInterface): - def __init__(self, dialect_filter=None): + def __init__(self, dialect_filter=None, batch_limit=1): + self.batch_limit = batch_limit self._block_latest = block_latest self._block_by_number = block_by_number self._block_from_src = Block.from_src diff --git a/eth_monitor/settings.py b/eth_monitor/settings.py index 92d080f..e9d949a 100644 --- a/eth_monitor/settings.py +++ b/eth_monitor/settings.py @@ -364,7 +364,7 @@ def process_sync_interface(settings, config): def process_sync(settings, config): dialect_filter = settings.get('RPC_DIALECT_FILTER') - settings.set('SYNCER_INTERFACE', EthChainInterface(dialect_filter=dialect_filter)) + settings.set('SYNCER_INTERFACE', EthChainInterface(dialect_filter=dialect_filter, batch_limit=settings.get('RPC_BATCH_LIMIT'))) settings = process_sync_range(settings, config) return settings #def process_sync(settings, config): diff --git a/requirements.txt b/requirements.txt index eb97a84..6fe720b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -chainlib-eth~=0.4.17 -chainlib~=0.4.15 -chainsyncer~=0.7.0 +chainlib-eth~=0.5.0 +chainlib~=0.5.0 +chainsyncer~=0.8.0 leveldir~=0.3.0 -eth-cache~=0.2.0 +eth-cache~=0.3.0 confini~=0.6.3 diff --git a/setup.cfg b/setup.cfg index 56b8c79..718fed0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = eth-monitor -version = 0.7.6 +version = 0.8.0 description = Monitor and cache transactions using match filters author = Louis Holbrook author_email = dev@holbrook.no @@ -26,7 +26,7 @@ licence_files = [options] include_package_data = True -python_requires = >=3.7 +python_requires = >=3.8 packages = eth_monitor eth_monitor.importers