nautechsystems/nautilus_trader · critical · anyhow::Error

Verification chain anchor name does not match the configured

Error message

Verification chain anchor name does not match the configured chain

What it means

Thrown by `BlockchainExecutionClient::new` via `anyhow::ensure!` when `verification.chain_anchor.chain_name` differs from `config.chain.name`. Along with the chain ID check, this guarantees the verification coordinator anchors to the same named network the client is configured for.

Source

Thrown at crates/adapters/blockchain/src/execution/client.rs:190

        let transaction_limits = Self::transaction_limits(&config)?;
        let chain = Arc::new(config.chain.clone());
        let cache = BlockchainCache::new(chain.clone());
        let http_rpc_client = Arc::new(BlockchainHttpRpcClient::new(
            config.http_rpc_url.clone().into_inner(),
            config.rpc_requests_per_second,
            None,
        ));
        let verification_config = config.verification.as_ref().ok_or_else(|| {
            anyhow::anyhow!("Independent Blockchain execution verification is required")
        })?;
        anyhow::ensure!(
            verification_config.chain_anchor.chain_id == config.chain.chain_id,
            "Verification chain anchor ID does not match the configured chain"
        );
        anyhow::ensure!(
            verification_config.chain_anchor.chain_name == config.chain.name.to_string(),
            "Verification chain anchor name does not match the configured chain"
        );
        let verification = VerificationCoordinator::new(
            http_rpc_client.clone(),
            config.http_rpc_url.expose_secret(),
            verification_config,
            config.rpc_requests_per_second,
        )?;
        let wallet_address = validate_address(config.wallet_address.as_str())?;
        let erc20_contract = Erc20Contract::new_with_timeout(
            http_rpc_client.clone(),
            Some(EXECUTION_RPC_TIMEOUT_SECS),
            true,
        );

        let router_addresses = config
            .router_addresses
            .iter()
            .map(|address| validate_address(address.as_str()))
            .collect::<anyhow::Result<Vec<_>>>()?;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set `verification.chain_anchor.chain_name` to exactly `config.chain.name.to_string()` (match case and spelling).
  2. Derive the verification config from the same `chain` object instead of a separate hand-written file.
  3. If the name was changed upstream, regenerate or update the verification anchor to the new name.

Example fix

// before
chain_anchor: ChainAnchor { chain_id: 8453, chain_name: "base-mainnet".into() }, // chain.name = "base"
// after
chain_anchor: ChainAnchor { chain_id: config.chain.chain_id, chain_name: config.chain.name.to_string() },
Defensive patterns

Strategy: validation

Validate before calling

fn chain_names_match(config: &BlockchainExecutionClientConfig) -> bool {
    config.verification.as_ref()
        .map(|v| v.chain_anchor.chain_name == config.chain.name.to_string())
        .unwrap_or(false)
}

Try / catch

BlockchainExecutionClient::new(config.clone()).map_err(|e| {
    if e.to_string().contains("chain anchor name") {
        anyhow::anyhow!("verification.chain_anchor.chain_name must equal chain.name ({})", config.chain.name)
    } else { e }
})?;

Prevention

When it happens

Trigger: Constructing a `BlockchainExecutionClient` where `verification.chain_anchor.chain_name` (string) does not equal `config.chain.name.to_string()` — e.g. anchor says "mainnet" while chain name is "ethereum", or an edited/mismatched config section.

Common situations: Using a verification config produced for another deployment; inconsistent naming conventions between teams/config generators; typos or case differences in the chain name.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/765d337f9d8981af. Report an issue: GitHub.