Skip to content

feat(anvil): add --no-fork-node-info to skip fork identity probes - #16778

Open
andreyobruchkov wants to merge 1 commit into
foundry-rs:masterfrom
andreyobruchkov:feat/anvil-no-fork-node-info
Open

feat(anvil): add --no-fork-node-info to skip fork identity probes#16778
andreyobruchkov wants to merge 1 commit into
foundry-rs:masterfrom
andreyobruchkov:feat/anvil-no-fork-node-info

Conversation

@andreyobruchkov

Copy link
Copy Markdown

Motivation

Anvil probes the fork URL with anvil_nodeInfo (and anvil_metadata if that succeeds) before it binds the listen port. That is how nested Anvil is detected.

Some public RPCs do not fail-fast on unknown methods. They retry/hedge at the gateway for ~18s, then return -32601. For those endpoints, Anvil can take ~30s to listen even though eth_chainId / eth_getBlockByNumber are fast.

Callers that wait on localhost RPC (and then SIGINT) hit a start timeout even though the chain itself is healthy.

Solution

Add --no-fork-node-info (requires --fork-url). When set, Anvil skips anvil_nodeInfo / anvil_metadata and treats the endpoint as a regular chain: eth_chainId, eth_getBlockByNumber, eth_gasPrice still run.

Example:

anvil --fork-url https://rpc.example --no-fork-node-info

This PR was written with Cursor (Grok). I specified the flag and the skip-probe behavior; the implementation and tests were generated in that session.

PR Checklist

  • Added Tests
  • Added Documentation (clap help on the flag)
  • Breaking changes

Made with Cursor

Some public RPCs retry unknown methods for tens of seconds instead of
returning method-not-found. Skipping anvil_nodeInfo/anvil_metadata lets
Anvil bind after the usual eth_* fork reads.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Changelog found

The deterministic check will validate the changed entry.

@mablr mablr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants