nautechsystems/nautilus_trader · error

validated proxy target address

Error message

validated proxy target address

What it means

This helper resolves a proxy's target contract in the manifest to derive its deployment identity. It parses proxy.target_address with expect() because the manifest is pre-validated; a panic means the address string is not valid 20-byte hex. Like its siblings it is an internal invariant check, not a runtime condition.

Source

Thrown at crates/adapters/blockchain/src/rpc/verification.rs:1322

                    && storage_value[12..] == *target.as_slice(),
                "Proxy target binding is invalid"
            );
        }

        for probe in &contract.probes {
            Bytes::from_str(&probe.call_data)
                .map_err(|_| anyhow::anyhow!("Manifest probe call data is invalid"))?;
            Bytes::from_str(&probe.expected_output)
                .map_err(|_| anyhow::anyhow!("Manifest probe output is invalid"))?;
        }
    }

    for contract in &manifest.contracts {
        let Some(proxy) = &contract.proxy else {
            continue;
        };
        let target =
            Address::from_str(&proxy.target_address).expect("validated proxy target address");
        let target_contract = manifest
            .contracts
            .iter()
            .find(|candidate| Address::from_str(&candidate.address).ok() == Some(target))
            .ok_or_else(|| {
                anyhow::anyhow!("Proxy target has no unique deployment manifest identity")
            })?;
        anyhow::ensure!(
            target_contract.role == BlockchainContractRole::Implementation
                && target_contract
                    .runtime_code_hash
                    .eq_ignore_ascii_case(&proxy.target_code_hash),
            "Proxy target role or code hash conflicts with its deployment identity"
        );
    }

    for required in [
        BlockchainContractRole::Router,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Validate proxy.target_address with Address::from_str before calling this API
  2. Ensure the proxy target address in the manifest is a real deployed contract address
  3. Regenerate the manifest with the deployment tooling rather than editing addresses by hand
  4. If the validator accepts a bad address, report the missing validation

Example fix

// before
let target = Address::from_str(&proxy.target_address)
    .expect("validated proxy target address");
// after
let target = Address::from_str(&proxy.target_address)
    .map_err(|e| ManifestError::InvalidProxyTarget(contract.address.clone(), e))?;
Defensive patterns

Strategy: validation

Validate before calling

fn validate_proxy_address(proxy: &ProxyConfig) -> Result<(), String> {
    Address::from_str(&proxy.target_address)
        .map(|_| ())
        .map_err(|e| format!("invalid proxy target_address '{}': {e}", proxy.target_address))
}

Type guard

fn is_valid_address(s: &str) -> bool {
    let h = s.trim_start_matches("0x");
    h.len() == 40 && h.chars().all(|c| c.is_ascii_hexdigit())
}

Prevention

When it happens

Trigger: Calling the manifest-identity function with a manifest whose proxy.target_address is empty, malformed, or contains checksum/EIP-55 casing the parser rejects (alloy's from_str accepts checksummed hex, but not non-hex text).

Common situations: Proxy entries pointing at an EOA or empty string because the target was not deployed; hand-edited manifests; tooling that wrote a name like 'implementation' instead of an address.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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