Files
wallet/crates
grenadeandClaude Opus 5.5 5d5baf1c21
ci / gate (push) Failing after 1m33s
fix(wormhole): one paced zk-tree scan for every open wallet, under the node's rate limit
With three phrase wallets open, the Accounts page showed "RPC rate limit
exceeded (-32999)" on every wormhole panel and on the pending reversible
transfers.

The Quantus node limits each connection to 300 calls a minute
(--rpc-rate-limit 300 in lair/quantus). The wallet keeps one WebSocket
per chain, so everything it asks shares those five calls a second. Each
wallet's first wormhole scan reads mainnet's zk-tree 500 leaves a call,
about 950 calls, and the three scans ran at once at full speed.

- The tree is public and the same for every wallet, so one scan now
  matches the wormhole accounts of every open phrase wallet in a single
  pass. It starts from the lowest cursor among them and records each
  wallet's leaves and frontier.
- Scans run one at a time behind a lock; a wallet whose turn comes after
  another's scan finds itself caught up.
- Bulk pages are paced at three a second, leaving room for balance and
  transfer reads on the same connection.
- under_rate_limit retries a call refused with -32999, backing off 1 to
  16 seconds, rather than putting the node's refusal on screen. The scan
  pages, the nullifier bucket reads, the leaf count and the pending
  reversible transfers all go through it.

Checked from an empty cache: the first scan of 481,540 leaves took 396 s,
with no error shown and no backoff needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUx7SPonBnB3ofU4mH41WT
2026-10-09 20:38:20 +03:00
..