Skip to content

Bugfix: align quick_audit.py wrapper with log_audit.py CLI and env vars - #179

Open
casks-mutters wants to merge 1 commit into
mainfrom
casks-mutters-patch-73
Open

Bugfix: align quick_audit.py wrapper with log_audit.py CLI and env vars#179
casks-mutters wants to merge 1 commit into
mainfrom
casks-mutters-patch-73

Conversation

@casks-mutters

Copy link
Copy Markdown
Owner

Summary

quick_audit.py is intended as a small convenience wrapper around log_audit.py, but currently:

  • It passes flags like --rpc-a, --rpc-b, --from-block, --to-block, which log_audit.py does not accept.
  • It reads RPC URLs from LOG_RPC_A / LOG_RPC_B, whereas log_audit.py uses RPC_A / RPC_B as defaults.

As a result, quick_audit.py does not work out-of-the-box.

This PR makes quick_audit.py compatible with the actual CLI of log_audit.py and aligns environment variable usage.

Changes

  • Update quick_audit.py to:
    • Read RPC defaults from the same env vars as log_audit.py (RPC_A / RPC_B).
    • Call log_audit.py using:
      • positional args: from_block, to_block, address, topic0
      • options: --rpcA and --rpcB (matching build_parser()).
    • If address or topic0 are omitted, pass "*" so that the filters behave as wildcards.

Rationale

  • Makes quick_audit.py usable without changing log_audit.py.
  • Keeps the wrapper small and simple while respecting the main script’s interface.
  • Avoids confusion for users who expect the wrapper to “just work”.

Example

export RPC_A=https://mainnet.infura.io/v3/your_key
export RPC_B=https://eth.llamarpc.com

python quick_audit.py --from-block 10000000 --to-block 10000100

## Summary

`quick_audit.py` is intended as a small convenience wrapper around `log_audit.py`, but currently:

- It passes flags like `--rpc-a`, `--rpc-b`, `--from-block`, `--to-block`, which `log_audit.py` does not accept.
- It reads RPC URLs from `LOG_RPC_A` / `LOG_RPC_B`, whereas `log_audit.py` uses `RPC_A` / `RPC_B` as defaults.

As a result, `quick_audit.py` does not work out-of-the-box.

This PR makes `quick_audit.py` compatible with the actual CLI of `log_audit.py` and aligns environment variable usage.

## Changes

- Update `quick_audit.py` to:
  - Read RPC defaults from the same env vars as `log_audit.py` (`RPC_A` / `RPC_B`).
  - Call `log_audit.py` using:
    - positional args: `from_block`, `to_block`, `address`, `topic0`
    - options: `--rpcA` and `--rpcB` (matching `build_parser()`).
  - If `address` or `topic0` are omitted, pass `"*"` so that the filters behave as wildcards.

## Rationale

- Makes `quick_audit.py` usable without changing `log_audit.py`.
- Keeps the wrapper small and simple while respecting the main script’s interface.
- Avoids confusion for users who expect the wrapper to “just work”.

## Example

```bash
export RPC_A=https://mainnet.infura.io/v3/your_key
export RPC_B=https://eth.llamarpc.com

python quick_audit.py --from-block 10000000 --to-block 10000100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant