feat: add custom EVM network support for local Anvil testnets#72
Merged
mickvandijke merged 2 commits intoWithAutonomi:mainfrom Apr 15, 2026
Merged
Conversation
Introduces --evm-rpc-url, --evm-payment-token, and --evm-payment-vault CLI flags that override --evm-network, allowing nodes to point at a private Anvil instance with operator-deployed contracts instead of the public Arbitrum networks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds support for pointing ant-node at a private/local EVM (e.g., Anvil) by allowing RPC URL + operator-deployed contract addresses to override the preset Arbitrum networks.
Changes:
- Introduces
EvmNetworkConfig::Custom { rpc_url, payment_token_address, payment_vault_address }. - Adds
--evm-rpc-url,--evm-payment-token,--evm-payment-vaultCLI flags (and env vars) to select the custom network and override--evm-network. - Threads the new config through payment verifier network selection and wallet config construction.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/config.rs |
Adds Custom EVM network config variant and updates serde representation. |
src/bin/ant-node/cli.rs |
Adds CLI/env overrides to construct EvmNetworkConfig::Custom when --evm-rpc-url is set. |
src/node.rs |
Extends verifier setup to support EvmNetworkConfig::Custom. |
src/payment/wallet.rs |
Extends wallet config network mapping for Custom and adjusts constructor signature/tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses Copilot review feedback on PR WithAutonomi#72. - Add `EvmNetworkConfig::into_evm_network(self)` as the single place that resolves a config into the concrete `evmlib::Network`, removing the duplicated match arms in `node.rs` and `payment/wallet.rs`. - Revert `WalletConfig::new` to take `EvmNetworkConfig` by value, restoring the pre-existing API. Consuming `self` in `into_evm_network` keeps clippy's `needless_pass_by_value` happy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jacderida
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces
--evm-rpc-url,--evm-payment-token, and--evm-payment-vaultCLI flags (mirrored byANT_EVM_RPC_URL/ANT_EVM_PAYMENT_TOKEN/ANT_EVM_PAYMENT_VAULTenv vars) that override--evm-network, allowing nodes to point at a private Anvil instance with operator-deployed contracts instead of the public Arbitrum networks.Adds a
Custom { rpc_url, payment_token_address, payment_vault_address }variant toEvmNetworkConfigand threads it throughNodeBuilderandWalletConfigviaEvmNetwork::new_custom(...).This is the same change already on
mick/always-masque-relay(commit 8c3f0f3) — landing it onmainavoids merge conflicts when that branch is rebased.Motivation
The
deploy/testnet-v2/flow (and the externalant-testnetrepo'stestnet.py deploy) stands up a local Anvil droplet with the ANT token + payment vault deployed, then points every node at it. Without these flags,ant-nodecan only talk to Arbitrum One / Sepolia, so the testnet deploy fails with clap exit code 2 on unknown arguments.Behaviour
--evm-rpc-urlset + both address flags set → usesEvmNetworkConfig::Custom(overrides--evm-network).--evm-rpc-urlset but one of the address flags missing → hard error at startup.--evm-networkpreset applies).Test plan
cargo fmt --checkpassescargo clippy --all-targets -- -D warningspassescargo check --all-targetspasses🤖 Generated with Claude Code