Skip to content

Correct the Arbitrum fix: RPC endpoint, not block range - #21

Merged
alipishbin77 merged 1 commit into
mainfrom
fix-arbitrum-rpc-endpoint
Sep 30, 2026
Merged

alipishbin77 merged 1 commit into
mainfrom
fix-arbitrum-rpc-endpoint

Conversation

@alipishbin77

Copy link
Copy Markdown
Owner

Follow-up to #20, which was the wrong diagnosis. Root cause: publicnode's free Arbitrum endpoint refuses eth_getLogs whenever toBlock is more than ~50-100 blocks behind its live head, regardless of range width — confirmed narrow queries fail far from head, wide queries succeed at head. Since safe is always 240 blocks behind head by design, no block-range tuning could have fixed this. Switched to Arbitrum's own public RPC (arb1.arbitrum.io/rpc), verified directly: no archive restriction, just a 10k-matched-logs cap, max_block_range=500 stays comfortably under it. Also fixes 3 house.py portfolio tests sharing the same PRESETS entry (different path: /rpc not /), and updates the brief's stale RPC table. 181 tests pass, ruff clean.

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.
@alipishbin77
alipishbin77 merged commit 0b9603b into main Sep 30, 2026
3 checks passed
@alipishbin77
alipishbin77 deleted the fix-arbitrum-rpc-endpoint branch September 30, 2026 21:03
alipishbin77 added a commit that referenced this pull request Sep 30, 2026
Correct the Arbitrum fix: RPC endpoint, not block range
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