Skip to content

feat: concurrent wallet scanning with real-time progress bar (Fixes #29)#41

Closed
lb1192176991-lab wants to merge 1 commit into
codegraphtheory:mainfrom
lb1192176991-lab:feat/concurrent-scan-29
Closed

feat: concurrent wallet scanning with real-time progress bar (Fixes #29)#41
lb1192176991-lab wants to merge 1 commit into
codegraphtheory:mainfrom
lb1192176991-lab:feat/concurrent-scan-29

Conversation

@lb1192176991-lab

Copy link
Copy Markdown
Contributor

What

Speeds up solana-rug wallet <ADDR> by scanning tokens concurrently and adds a real-time progress bar.

Implementation

New function: rug_check_wallet_concurrent(address)

  • Uses concurrent.futures.ThreadPoolExecutor (stdlib — zero new deps)
  • Default 4 workers, configurable via WALLET_SCAN_WORKERS env var (max 10)
  • Falls back to sequential mode when workers=1 or <=2 tokens
  • Thread-safe wrapper _rug_check_token_safe() catches all exceptions

Progress bar

  • Format: [████████░░] 45/500 (9%) | 3 risks | 12s elapsed ETA:2m30s
  • Uses carriage return (\r) — no scroll spam
  • Auto-disables when stdout is not a TTY (piped/JSON mode)
  • Tracks: completed count, risks found, elapsed time, estimated remaining
  • Unicode blocks: █ for completed, ░ for remaining

Compatibility

  • --sequential flag restores original sequential behavior
  • WALLET_SCAN_WORKERS=1 also forces sequential mode
  • Original rug_check_wallet() preserved unchanged
  • Results sorted by safety score ascending (riskiest first)

Env vars

Variable Default Description
WALLET_SCAN_WORKERS 4 Concurrent workers (1-10)

Fixes: #29

@codegraphtheory

Copy link
Copy Markdown
Owner

Superseded by #43 which was merged. KHHH2312 submitted a PR for the same issue first. Bounty for #29 awarded to them. Thanks for contributing!

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.

Concurrent wallet scanning with progress bar

2 participants