Skip to content

Feature: add --dry-run flag to display planned audit parameters without fetching logs #190

Description

@casks-mutters

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions