Summary
When running a large audit (e.g., thousands of blocks), it would be helpful to preview what the tool would do — which block range it will query, the RPC endpoints it will use, and the log filters (address, topic0). Currently, the tool immediately begins fetching logs, giving no way for users to confirm settings before potentially making thousands of RPC requests.
A --dry-run mode would allow users to verify configuration without performing any network calls.
Proposed Changes
- Add a new boolean CLI flag:
--dry-run to log_audit.py.
- When enabled:
- Print out the audit parameters:
- RPC A / RPC B URLs
- block range (
from_block → to_block)
- filters (
address, topic0)
- any advanced flags the user passed (e.g., concurrency or limits, if implemented)
- Exit immediately without making RPC requests, returning exit code 0.
- Document
--dry-run in README under usage examples.
Motivation
- Prevents accidental large/expensive RPC scans when parameters are mistyped.
- Helps confirm environment variables, addresses, and topic filters before running.
- Useful when scripting or automating audits: user can validate inputs before full execution.
Example
python log_audit.py 17000000 17001000 0xContractAddr 0xTopic0 \
--rpcA https://mainnet.infura.io/v3/... \
--rpcB https://eth.llamarpc.com \
--dry-run
Summary
When running a large audit (e.g., thousands of blocks), it would be helpful to preview what the tool would do — which block range it will query, the RPC endpoints it will use, and the log filters (address, topic0). Currently, the tool immediately begins fetching logs, giving no way for users to confirm settings before potentially making thousands of RPC requests.
A
--dry-runmode would allow users to verify configuration without performing any network calls.Proposed Changes
--dry-runtolog_audit.py.from_block → to_block)address,topic0)--dry-runin README under usage examples.Motivation
Example