Skip to content

fix(devnet): bind Anvil to --host so LAN clients can reach the manifest rpc_url - #200

Open
Nic-dorman wants to merge 1 commit into
mainfrom
bug/devnet-anvil-lan-host
Open

fix(devnet): bind Anvil to --host so LAN clients can reach the manifest rpc_url#200
Nic-dorman wants to merge 1 commit into
mainfrom
bug/devnet-anvil-lan-host

Conversation

@Nic-dorman

Copy link
Copy Markdown
Member

Linear issue

V2-950

Risk tier

  • T0 — docs / tooling / CI / pure UX-output. Repo CI only.
  • T1 — client-only, no network-facing behavior change. CI + prod compat smoke.
  • T2 — node/client logic with behavioral surface, no protocol/format/economics change. Dev testnet + ADR.
  • T3 — protocol / storage format / payments / routing. T2 evidence + adversarial testing.

Compatibility

  • Wire: none — dev harness binary only (ant-devnet); node code untouched.
  • Storage: none.
  • API: none. Behavioral (harness only): with --host <ip> --enable-evm and no explicit ANVIL_IP_ADDR, Anvil now binds the host IP and the manifest's rpc_url becomes LAN-reachable. An explicit ANVIL_IP_ADDR still wins; loopback devnets (no --host) keep Anvil's localhost default exactly as before.

Semver impact

  • breaking
  • feature
  • fix

Test evidence

  • Problem + fix verified live on a LAN box before writing the patch: stock behavior publishes http://localhost:<port>/ (other devices can join/download but not pay — an external-signer LAN validation had to tunnel the RPC over SSH); with the env var set as this patch now does automatically, the manifest published http://192.168.0.61:37365/ and eth_chainId answered from a second machine directly.
  • 3 new unit tests on the pure helper (anvil_ip_for_lan): host→ip, explicit-override-wins, loopback-devnet-untouched. cargo test --bin ant-devnet: 8/8.
  • cargo fmt --check clean; clippy (panic/unwrap/expect denied) clean on the bin.

New dependency

none

ADR

n/a

Mitigation / rollback

Revert the commit; operators can always set ANVIL_IP_ADDR by hand (which this patch never overrides).

🤖 Generated with Claude Code

…st rpc_url

--host LAN-exposes the nodes and the manifest server, but --enable-evm
left Anvil on localhost and published that loopback URL in the
manifest's rpc_url — other LAN devices could join and download but not
pay, which is the exact audience --host serves. evmlib already honors
ANVIL_IP_ADDR for both the bind and the published URL, so when --host
and --enable-evm are set and ANVIL_IP_ADDR is not, default it to the
host IP (an explicit override still wins). Verified live on a LAN box:
the manifest published http://<host-ip>:<port>/ and eth_chainId
answered from another machine with no tunnel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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