Skip to content

Fix Arbitrum deposit watcher: max_block_range was 100x too large - #20

Merged
alipishbin77 merged 1 commit into
mainfrom
fix-arbitrum-deposit-watcher
Sep 30, 2026
Merged

alipishbin77 merged 1 commit into
mainfrom
fix-arbitrum-deposit-watcher

Conversation

@alipishbin77

Copy link
Copy Markdown
Owner

Every Arbitrum eth_getLogs poll has failed since deploy — not a confirmations/lag issue, the free publicnode.com endpoint refuses any range above ~50-99 blocks with 'Archive requests require a personal token,' measured directly against the live endpoint regardless of query shape or recency. max_block_range=5000 meant the chain cursor never advanced — confirmed stuck ~455k blocks behind the safe head. No real deposit was ever missed (zero Arbitrum deposits have occurred), but a real one would have been silently unrecognized. Set to 40, regression test added, plus a one-time manual cursor advance via direct DB update (nothing to backfill). 181 tests pass, ruff clean.

…the free RPC

Every eth_getLogs poll for Arbitrum has failed since deploy with 'Archive requests
require a personal token' — not a confirmations or cursor-lag issue. Measured directly
against the live publicnode.com endpoint: it answers ranges up to ~50-99 blocks, refuses
anything larger regardless of recency or query shape (confirmed address-only, topic-only,
and combined-filter queries all fail the same way above that floor). max_block_range=5000
meant the chain cursor never advanced at all — confirmed stuck ~455k blocks behind the
safe head. No real deposit was ever missed (zero Arbitrum deposits have occurred), but
any real one would have been silently unrecognized.

Set to 40, safely under the measured threshold, plus a regression test. Also manually
advanced the stuck ChainCursor row (chain_id=42161) to near the current safe head via a
direct UPDATE — nothing to backfill since there was never a real deposit in the
unreachable gap.

181 tests pass, ruff clean.
@alipishbin77
alipishbin77 merged commit 1ec3159 into main Sep 30, 2026
3 checks passed
@alipishbin77
alipishbin77 deleted the fix-arbitrum-deposit-watcher branch September 30, 2026 20:55
alipishbin77 added a commit that referenced this pull request Sep 30, 2026
Fix Arbitrum deposit watcher: max_block_range was 100x too large
alipishbin77 added a commit that referenced this pull request Sep 30, 2026
PR #20's max_block_range=40 was the wrong diagnosis. Measured again, more carefully:
publicnode's free endpoint refuses eth_getLogs whenever toBlock is more than ~50-100
blocks behind its *live* head, regardless of range width (a 10-block, already-narrow
query fails at 100 blocks behind head; a 1000-block query succeeds right at head).
Since 'safe' is always confirmations(240) blocks behind head by design, every query
against that endpoint was structurally unreachable — reducing the range couldn't have
fixed it, and confirmed it still didn't (same error after the PR #20 deploy).

Switched to Arbitrum's own public RPC (arb1.arbitrum.io/rpc), verified directly: no
archive restriction, just a 10,000-matched-logs cap. max_block_range=500 measured at
~2,700 logs/1000 blocks for USDC on Arbitrum, comfortable margin.

Also fixes the three house.py portfolio tests that share the same PRESETS entry:
arb1.arbitrum.io's path is /rpc, not /, so the test fixtures needed a second mock
registration. OPENCLAW_BRIEF.md's RPC reference table updated to match.

Manually re-advanced the still-stuck ChainCursor row (chain_id=42161) via direct UPDATE
to the new safe head — same nothing-to-backfill situation as before.

181 tests pass, ruff clean. Verified against the live endpoints, not just diagnosed.
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