From 11d9a2f6f4893d6d318787a23efe2c2af35733e4 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 29 Jan 2024 01:26:28 -0400 Subject: [PATCH] backfill touchups --- src/dexorder/base/chain.py | 4 ++-- src/dexorder/runner.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dexorder/base/chain.py b/src/dexorder/base/chain.py index 6c86e47..41bbb10 100644 --- a/src/dexorder/base/chain.py +++ b/src/dexorder/base/chain.py @@ -51,9 +51,9 @@ Goerli = Blockchain(5, 'Goerli') Polygon = Blockchain(137, 'Polygon') # POS not zkEVM Mumbai = Blockchain(80001, 'Mumbai') BSC = Blockchain(56, 'BSC') -Arbitrum = Blockchain(42161, 'Arbitrum', 3, batch_size=1000) # todo configure batch size... does it depend on log count? :( +Arbitrum = Blockchain(42161, 'Arbitrum', 3, batch_size=2000) # todo configure batch size Mock = Blockchain(31337, 'Mock', 3, batch_size=10000) -Alpha = Blockchain(1337, 'Dexorder Alpha', 3, batch_size=100) +Alpha = Blockchain(1337, 'Dexorder Alpha', 3, batch_size=1000) current_chain = ContextVar[Blockchain]('current_chain') diff --git a/src/dexorder/runner.py b/src/dexorder/runner.py index 20c22a4..f5946a6 100644 --- a/src/dexorder/runner.py +++ b/src/dexorder/runner.py @@ -19,6 +19,7 @@ from dexorder.database.model import Block from dexorder.database.model.block import current_block, latest_block from dexorder.util import hexstr, topic from dexorder.util.async_util import maywait, Maywaitable +from dexorder.util.shutdown import fatal log = logging.getLogger(__name__) @@ -342,10 +343,8 @@ class BlockStateRunner: except ValueError as e: if e.args[0].get('code') == -32602: # too many logs were returned in the batch, so decrease the batch size. - batch_size = int(chain.batch_size * 0.9) - chain.batch_size = batch_size - log.info(f'Decreasing batch size for {chain} to {batch_size}') - raise Retry + fatal(f'Decrease batch size for {chain}') + raise for log_event in log_events: try: parsed = event.process_log(log_event) if event is not None else log_event