Skip to content

Commit 2cf3932

Browse files
bibo7086pacrob
authored andcommitted
Update filters.rst
In the current implementation, estimated_end_block is calculated as current_block + chunk_size. This value could exceed end_block if the chunk size is large enough or if you’re near the end of the scan range. If estimated_end_block exceeds end_block, the scan might attempt to process blocks beyond the specified range, leading to issues.
1 parent b023c81 commit 2cf3932

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/filters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ The script can be run with: ``python ./eventscanner.py <your JSON-RPC API URL>``
724724
self.state.start_chunk(current_block, chunk_size)
725725
726726
# Print some diagnostics to logs to try to fiddle with real world JSON-RPC API performance
727-
estimated_end_block = current_block + chunk_size
727+
estimated_end_block = min(current_block + chunk_size, end_block)
728728
logger.debug(
729729
f"Scanning token transfers for blocks: {current_block} - {estimated_end_block}, chunk size {chunk_size}, last chunk scan took {last_scan_duration}, last logs found {last_logs_found}"
730730
)

0 commit comments

Comments
 (0)