From c951f4718e7cfdec0f7c8855cead2c3d3d87205f Mon Sep 17 00:00:00 2001 From: nolash Date: Mon, 3 May 2021 19:51:05 +0200 Subject: [PATCH] Clean up missing dependency change updates --- .../cic-cache/cic_cache/runnable/daemons/filters/faucet.py | 5 ++++- apps/cic-cache/cic_cache/runnable/daemons/tracker.py | 1 + apps/cic-cache/docker/Dockerfile | 2 +- apps/cic-cache/requirements.txt | 2 +- apps/cic-eth/cic_eth/eth/account.py | 7 ++++--- apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py | 2 +- apps/cic-eth/cic_eth/runnable/daemons/filters/register.py | 2 +- apps/cic-eth/cic_eth/runnable/daemons/filters/tx.py | 2 +- apps/cic-eth/docker/Dockerfile | 4 ++-- apps/cic-eth/requirements.txt | 5 +++-- 10 files changed, 19 insertions(+), 13 deletions(-) diff --git a/apps/cic-cache/cic_cache/runnable/daemons/filters/faucet.py b/apps/cic-cache/cic_cache/runnable/daemons/filters/faucet.py index b4488e0e..f8fc67b7 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/filters/faucet.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/filters/faucet.py @@ -25,7 +25,10 @@ class FaucetFilter(TagSyncFilter): def filter(self, conn, block, tx, db_session=None): - data = strip_0x(tx.payload) + try: + data = strip_0x(tx.payload) + except ValueError: + return False logg.debug('data {}'.format(data)) if Faucet.method_for(data[:8]) == None: return False diff --git a/apps/cic-cache/cic_cache/runnable/daemons/tracker.py b/apps/cic-cache/cic_cache/runnable/daemons/tracker.py index 785c8479..279176bd 100644 --- a/apps/cic-cache/cic_cache/runnable/daemons/tracker.py +++ b/apps/cic-cache/cic_cache/runnable/daemons/tracker.py @@ -72,6 +72,7 @@ def register_filter_tags(filters, session): session.commit() logg.info('added tag name "{}" domain "{}"'.format(tag[0], tag[1])) except sqlalchemy.exc.IntegrityError: + session.rollback() logg.debug('already have tag name "{}" domain "{}"'.format(tag[0], tag[1])) diff --git a/apps/cic-cache/docker/Dockerfile b/apps/cic-cache/docker/Dockerfile index 83304027..c4c783dd 100644 --- a/apps/cic-cache/docker/Dockerfile +++ b/apps/cic-cache/docker/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && \ # Copy shared requirements from top of mono-repo RUN echo "copying root req file ${root_requirement_file}" -RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2a76 +RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2b9 COPY cic-cache/requirements.txt ./ COPY cic-cache/setup.cfg \ diff --git a/apps/cic-cache/requirements.txt b/apps/cic-cache/requirements.txt index 9ea4ffd3..6095d479 100644 --- a/apps/cic-cache/requirements.txt +++ b/apps/cic-cache/requirements.txt @@ -1,4 +1,4 @@ -cic-base~=0.1.2b8 +cic-base~=0.1.2b9 alembic==1.4.2 confini~=0.3.6rc3 uwsgi==2.0.19.1 diff --git a/apps/cic-eth/cic_eth/eth/account.py b/apps/cic-eth/cic_eth/eth/account.py index de2e7f0b..0cf636b1 100644 --- a/apps/cic-eth/cic_eth/eth/account.py +++ b/apps/cic-eth/cic_eth/eth/account.py @@ -20,7 +20,8 @@ from chainlib.eth.tx import ( ) from chainlib.chain import ChainSpec from chainlib.error import JSONRPCException -from eth_accounts_index.registry import AccountRegistry # TODO, use interface module instead (needs gas limit method) +from eth_accounts_index.registry import AccountRegistry +from eth_accounts_index import AccountsIndex from sarafu_faucet import MinterFaucet from chainqueue.db.models.tx import TxCache @@ -127,12 +128,12 @@ def register(self, account_address, chain_spec_dict, writer_address=None): if writer_address == ZERO_ADDRESS: session.close() raise RoleMissingError('call address for resgistering {}'.format(account_address)) - account_registry_address = registry.by_name('AccountsIndex', sender_address=call_address) + account_registry_address = registry.by_name('AccountRegistry', sender_address=call_address) # Generate and sign transaction rpc_signer = RPCConnection.connect(chain_spec, 'signer') nonce_oracle = CustodialTaskNonceOracle(writer_address, self.request.root_id, session=session) #, default_nonce) - gas_oracle = self.create_gas_oracle(rpc, AccountsIndex.gas) + gas_oracle = self.create_gas_oracle(rpc, AccountRegistry.gas) account_registry = AccountsIndex(chain_spec, signer=rpc_signer, nonce_oracle=nonce_oracle, gas_oracle=gas_oracle) (tx_hash_hex, tx_signed_raw_hex) = account_registry.add(account_registry_address, writer_address, account_address, tx_format=TxFormat.RLP_SIGNED) rpc_signer.disconnect() diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py index e47c4a65..4fb6b543 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/callback.py @@ -8,11 +8,11 @@ from chainlib.status import Status as TxStatus from chainlib.eth.address import to_checksum_address from chainlib.eth.error import RequestMismatchException from chainlib.eth.constant import ZERO_ADDRESS -from chainlib.eth.erc20 import ERC20 from hexathon import ( strip_0x, add_0x, ) +from eth_erc20 import ERC20 from erc20_faucet import Faucet # local imports diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/register.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/register.py index 841e7d75..dc1bd778 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/register.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/register.py @@ -14,7 +14,7 @@ from .base import SyncFilter logg = logging.getLogger().getChild(__name__) -account_registry_add_log_hash = '0x5ed3bdd47b9af629827a8d129aa39c870b10c03f0153fe9ddb8e84b665061acd' +account_registry_add_log_hash = '0x9cc987676e7d63379f176ea50df0ae8d2d9d1141d1231d4ce15b5965f73c9430' class RegistrationFilter(SyncFilter): diff --git a/apps/cic-eth/cic_eth/runnable/daemons/filters/tx.py b/apps/cic-eth/cic_eth/runnable/daemons/filters/tx.py index 4e06e4d8..e2e4ed1f 100644 --- a/apps/cic-eth/cic_eth/runnable/daemons/filters/tx.py +++ b/apps/cic-eth/cic_eth/runnable/daemons/filters/tx.py @@ -30,7 +30,7 @@ class TxFilter(SyncFilter): if otx == None: logg.debug('tx {} not found locally, skipping'.format(tx_hash_hex)) return None - logg.info('tx filter match on {}'.format(otx.tx_hash)) + logg.debug('otx filter match on {}'.format(otx.tx_hash)) db_session.flush() SessionBase.release_session(db_session) s_final_state = celery.signature( diff --git a/apps/cic-eth/docker/Dockerfile b/apps/cic-eth/docker/Dockerfile index 163b3016..45902995 100644 --- a/apps/cic-eth/docker/Dockerfile +++ b/apps/cic-eth/docker/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update && \ apt install -y gcc gnupg libpq-dev wget make g++ gnupg bash procps git # Copy shared requirements from top of mono-repo -RUN echo "copying root req file ${root_requirement_file}" +RUN echo "copying root req file: ${root_requirement_file}" #COPY $root_requirement_file . #RUN pip install -r $root_requirement_file $pip_extra_index_url_flag RUN /usr/local/bin/python -m pip install --upgrade pip @@ -29,7 +29,7 @@ RUN /usr/local/bin/python -m pip install --upgrade pip # python merge_requirements.py | tee merged_requirements.txt #RUN cd cic-base && \ # pip install $pip_extra_index_url_flag -r ./merged_requirements.txt -RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2b8 +RUN pip install $pip_extra_index_url_flag cic-base[full_graph]==0.1.2b9 COPY cic-eth/scripts/ scripts/ COPY cic-eth/setup.cfg cic-eth/setup.py ./ diff --git a/apps/cic-eth/requirements.txt b/apps/cic-eth/requirements.txt index b296c93c..22750097 100644 --- a/apps/cic-eth/requirements.txt +++ b/apps/cic-eth/requirements.txt @@ -1,4 +1,4 @@ -cic-base==0.1.2b8 +cic-base==0.1.2b9 celery==4.4.7 crypto-dev-signer~=0.4.14b3 confini~=0.3.6rc3 @@ -18,6 +18,7 @@ chainlib~=0.0.3a1 hexathon~=0.0.1a7 chainsyncer[sql]~=0.0.2a4 chainqueue~=0.0.2a2 +sarafu-faucet==0.0.3a3 +erc20-faucet==0.2.1a4 coincurve==15.0.0 -sarafu-faucet==0.0.3a2 potaahto~=0.0.1a1