Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

Fix Across in-transit check exceeding RPC max block range - #977

Merged
gemcoder21 merged 2 commits into
mainfrom
copilot/fix-in-transit-check-error
Mar 2, 2026
Merged

gemcoder21 merged 2 commits into
mainfrom
copilot/fix-in-transit-check-error

Conversation

Copilot AI commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

check_fill_on_chain queried logs from block 0x0 to latest, causing RPC failures on chains like Base where providers enforce a 100,000-block range limit (-32602).

Changes

  • across/mod.rs — Added FILL_LOOKBACK_BLOCKS = 100_000 constant
  • across/provider.rs — Fetch the destination chain's current block before querying logs; use current_block - 100_000 as fromBlock instead of genesis
let current_block = client.get_latest_block().await...;
let from_block = current_block.saturating_sub(FILL_LOOKBACK_BLOCKS);
let from_block_hex = format!("0x{:x}", from_block);

let logs = client.get_logs(deployment.spoke_pool, &topics, &from_block_hex, "latest").await...;

100,000 blocks safely covers the 6-hour fill timeout (DEFAULT_FILL_TIMEOUT) on the fastest supported chain (Arbitrum at ~0.25 s/block ≈ 7 hours of coverage).


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@semanticdiff-com

semanticdiff-com Bot commented Mar 2, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/swapper/src/across/provider.rs  57% smaller
  crates/swapper/src/across/mod.rs  0% smaller

Copilot AI changed the title [WIP] Fix in_transit check failure due to block range limit Fix Across in-transit check exceeding RPC max block range Mar 2, 2026
@gemcoder21
gemcoder21 marked this pull request as ready for review March 2, 2026 20:28
@gemcoder21
gemcoder21 merged commit 5c38b68 into main Mar 2, 2026
4 checks passed
@gemcoder21
gemcoder21 deleted the copilot/fix-in-transit-check-error branch March 2, 2026 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants