Skip to content

Comments

bugfix: anvil fork sync incorrectly fetching fork block#1506

Merged
naps62 merged 1 commit intomainfrom
fix-fork-sync
Nov 28, 2025
Merged

bugfix: anvil fork sync incorrectly fetching fork block#1506
naps62 merged 1 commit intomainfrom
fix-fork-sync

Conversation

@naps62
Copy link
Member

@naps62 naps62 commented Nov 28, 2025

Fixes #1503

Copilot AI review requested due to automatic review settings November 28, 2025 11:58
@naps62 naps62 added the B-bugfix Something is working again label Nov 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the Anvil fork synchronization where the fork block number was being incorrectly fetched and used. The fix addresses issue #1503 by correcting the JSON path to access Anvil's fork configuration and adjusting the backfill start block calculation to properly skip the fork block itself.

Key changes:

  • Corrected the path to fetch forkBlockNumber from Anvil's anvil_nodeInfo RPC response (now properly accessing forkConfig.forkBlockNumber)
  • Fixed the HTTP provider's backfill logic to start from fork_block_number + 1 instead of fork_block_number
  • Minor formatting improvements to import ordering and struct initialization

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/sync/anvil/src/tracker/utils.rs Corrects the JSON path to access fork block number from Anvil's node info, now properly accessing it via forkConfig.forkBlockNumber
crates/sync/anvil/src/tracker/http.rs Fixes backfill starting block calculation to properly start from fork_block_number + 1 to avoid re-processing the fork block
crates/sync/anvil/src/expanders.rs Formatting changes: reordered imports and reformatted Tx struct initialization for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@naps62 naps62 merged commit bb66346 into main Nov 28, 2025
13 of 14 checks passed
@naps62 naps62 deleted the fix-fork-sync branch November 28, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-bugfix Something is working again

Projects

None yet

Development

Successfully merging this pull request may close these issues.

anvil --fork does not work properly with ethui

1 participant