feat(scripts): add resumable bounded log scanner - #365
Draft
yzwooyi wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue #83 needs a client-side workaround for wide
eth_getLogsrequests. This adds a Python standard-library reference scanner that stores raw logs and its cursor in SQLite, commits each successful prefix atomically, and resumes safely after interruption.latestto a numeric end block and verifies chain ID and end-block hash on resume.(blockHash, transactionHash, logIndex), and rolls back rows and cursor together on write failure.This addresses #83 as a client workaround and does not change the RPC server. Related: #79 contains a simple pagination snippet; this adds an executable crash-resumable tool.
Validation
python3 -m unittest discover -s scripts -p test_scan_logs.py -v— 25 tests passed under Python 3.12.14, including localhost HTTP transport fixtures.python3 -m py_compile scripts/scan_logs.py scripts/test_scan_logs.py— passed.git diff --check— passed.pruned history unavailable), which is correctly treated as fatal rather than a range timeout.No Rust or protocol changes are included. Full Rust and contract builds were not run because this is a client-script change; dedicated Python CI remains pending.