-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Component
Anvil
Describe the feature you would like
Problem
Even with --fork-chain-id, Anvil still makes outgoing RPC requests for the fork block header and any uncached storage. That makes it impossible to run fork tests in CI pipelines or air-gapped dev environments, even when you’ve already cached the chain state.
Proposed feature
It would be great if there were an --offline-fork flag that lets you hand Anvil a pre-downloaded block header (and maybe a chain config) along with the state cache. In that mode Anvil could skip the network entirely and read everything from ~/.foundry/cache/rpc/<chain>/<block> so people could build the cache on a machine with internet, copy it into their container, and still run their fork tests.
Use case
While working in a locked down container, I tried to run a Base fork test using a cached block and --fork-chain-id. Anvil still tried to fetch the block header and missing state from https://mainnet.base.org and immediately failed with 403s because the network was blocked. If I could point Anvil at a saved block header and keep it fully offline, those tests would have worked. I imagine others with restricted setups would find this useful too.
Happy to discuss the details and contribute a PR if this sounds interesting.
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status