Repository navigation
Fix Arbitrum deposit watcher: max_block_range was 100x too large - #20
Merged
Merged
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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=5000meant 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.