We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad56201 commit d4beb08Copy full SHA for d4beb08
sw_utils/event_scanner.py
@@ -58,8 +58,11 @@ def __init__(
58
self._contract_call = lambda from_block, to_block: getattr(
59
processor.contract.events, processor.contract_event
60
).get_logs(argument_filters=argument_filters, fromBlock=from_block, toBlock=to_block)
61
- # Scan in chunks, commit between
62
- self.chunk_size = chunk_size or self.max_scan_chunk_size // 2
+
+ # Start with half or max chunk size. 1kk chunks works only with powerful nodes.
63
+ start_chunk_size = self.max_scan_chunk_size // 2
64
+ # Scan in chunks, commit between.
65
+ self.chunk_size = chunk_size or start_chunk_size
66
67
async def process_new_events(self, to_block: BlockNumber) -> None:
68
current_from_block = await self.processor.get_from_block()
0 commit comments