nautechsystems/nautilus_trader · error

validated proxy target

Error message

validated proxy target

What it means

During proxy verification, the implementation contract address and its code hash are parsed with `.expect("validated proxy target")` / (adjacent) `.expect("validated proxy target hash")` on `proxy.target_address` and `proxy.target_code_hash`. These fields are guaranteed valid by the upstream `validate_config` pass, so the expects encode an internal invariant about already-validated manifests. A panic here indicates the manifest bypassed validation or contains corrupted proxy target fields.

Source

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

                        return VerificationOutcome::Disagreement(
                            self.failure(VerificationRead::DeploymentIdentity),
                        );
                    }
                    VerificationOutcome::Disagreement(failure) => {
                        return VerificationOutcome::Disagreement(failure);
                    }
                    VerificationOutcome::Unavailable(failure) => {
                        return VerificationOutcome::Unavailable(failure);
                    }
                    VerificationOutcome::Retryable(failure) => {
                        return VerificationOutcome::Retryable(failure);
                    }
                    VerificationOutcome::LocallyInvalid(failure) => {
                        return VerificationOutcome::LocallyInvalid(failure);
                    }
                }
                let target =
                    Address::from_str(&proxy.target_address).expect("validated proxy target");
                let target_hash =
                    B256::from_str(&proxy.target_code_hash).expect("validated proxy target hash");
                match self.verify_code(&target, block).await {
                    VerificationOutcome::Verified(verified)
                        if !verified.value.is_empty()
                            && keccak256(&verified.value) == target_hash => {}
                    VerificationOutcome::Verified(_) => {
                        return VerificationOutcome::Disagreement(
                            self.failure(VerificationRead::DeploymentIdentity),
                        );
                    }
                    VerificationOutcome::Disagreement(failure) => {
                        return VerificationOutcome::Disagreement(failure);
                    }
                    VerificationOutcome::Unavailable(failure) => {
                        return VerificationOutcome::Unavailable(failure);
                    }
                    VerificationOutcome::Retryable(failure) => {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Ensure every manifest passes `validate_config` before verification.
  2. Fix `proxy.target_address` (20-byte hex) and `proxy.target_code_hash` (32-byte hex, keccak of runtime code) in the manifest.
  3. Parse the fields explicitly with `Address::from_str`/`B256::from_str` in your own code and surface errors.
  4. Regenerate the manifest from its canonical source instead of manual edits.

Example fix

// before
let target = Address::from_str(&proxy.target_address).expect("validated proxy target");
// after
let target = Address::from_str(&proxy.target_address)
    .map_err(|e| anyhow::anyhow!("invalid proxy target_address {:?}: {e}", proxy.target_address))?;
Defensive patterns

Strategy: validation

Validate before calling

fn validate_proxy_target(proxy: &ProxyInfo) -> Result<(Address, B256), String> {
    let target = Address::from_str(proxy.target_address.trim())
        .map_err(|e| format!("bad target_address: {e}"))?;
    let hash = B256::from_str(proxy.target_code_hash.trim())
        .map_err(|e| format!("bad target_code_hash: {e}"))?;
    Ok((target, hash))
}

Try / catch

// Gate verification behind validate_config so these expects stay unreachable
validate_config(&manifest).map_err(|e| anyhow::anyhow!("invalid manifest: {e}"))?;

Prevention

When it happens

Trigger: Calling `verify_deployment_manifest` with a manifest whose `proxy.target_address` is not a valid 20-byte hex address, or whose `target_code_hash` is not valid 32-byte hex, without prior `validate_config` validation (direct JSON load, programmatic construction, tests).

Common situations: Hand-edited manifests with a checksummed/malformed target address; a code hash truncated or with wrong casing characters; test manifests skipping the validation entry point; schema changes between manifest versions leaving stale fields.

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/5928847f99d6f490. Report an issue: GitHub.