{"record":{"id":"5928847f99d6f490","repo":"nautechsystems/nautilus_trader","slug":"validated-proxy-target","errorCode":null,"errorMessage":"validated proxy target","messagePattern":"validated proxy target","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":679,"sourceCode":"                        return VerificationOutcome::Disagreement(\n                            self.failure(VerificationRead::DeploymentIdentity),\n                        );\n                    }\n                    VerificationOutcome::Disagreement(failure) => {\n                        return VerificationOutcome::Disagreement(failure);\n                    }\n                    VerificationOutcome::Unavailable(failure) => {\n                        return VerificationOutcome::Unavailable(failure);\n                    }\n                    VerificationOutcome::Retryable(failure) => {\n                        return VerificationOutcome::Retryable(failure);\n                    }\n                    VerificationOutcome::LocallyInvalid(failure) => {\n                        return VerificationOutcome::LocallyInvalid(failure);\n                    }\n                }\n                let target =\n                    Address::from_str(&proxy.target_address).expect(\"validated proxy target\");\n                let target_hash =\n                    B256::from_str(&proxy.target_code_hash).expect(\"validated proxy target hash\");\n                match self.verify_code(&target, block).await {\n                    VerificationOutcome::Verified(verified)\n                        if !verified.value.is_empty()\n                            && keccak256(&verified.value) == target_hash => {}\n                    VerificationOutcome::Verified(_) => {\n                        return VerificationOutcome::Disagreement(\n                            self.failure(VerificationRead::DeploymentIdentity),\n                        );\n                    }\n                    VerificationOutcome::Disagreement(failure) => {\n                        return VerificationOutcome::Disagreement(failure);\n                    }\n                    VerificationOutcome::Unavailable(failure) => {\n                        return VerificationOutcome::Unavailable(failure);\n                    }\n                    VerificationOutcome::Retryable(failure) => {","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L661-L697","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Ensure every manifest passes `validate_config` before verification.","Fix `proxy.target_address` (20-byte hex) and `proxy.target_code_hash` (32-byte hex, keccak of runtime code) in the manifest.","Parse the fields explicitly with `Address::from_str`/`B256::from_str` in your own code and surface errors.","Regenerate the manifest from its canonical source instead of manual edits."],"exampleFix":"// before\nlet target = Address::from_str(&proxy.target_address).expect(\"validated proxy target\");\n// after\nlet target = Address::from_str(&proxy.target_address)\n    .map_err(|e| anyhow::anyhow!(\"invalid proxy target_address {:?}: {e}\", proxy.target_address))?;","handlingStrategy":"validation","validationCode":"fn validate_proxy_target(proxy: &ProxyInfo) -> Result<(Address, B256), String> {\n    let target = Address::from_str(proxy.target_address.trim())\n        .map_err(|e| format!(\"bad target_address: {e}\"))?;\n    let hash = B256::from_str(proxy.target_code_hash.trim())\n        .map_err(|e| format!(\"bad target_code_hash: {e}\"))?;\n    Ok((target, hash))\n}","typeGuard":null,"tryCatchPattern":"// Gate verification behind validate_config so these expects stay unreachable\nvalidate_config(&manifest).map_err(|e| anyhow::anyhow!(\"invalid manifest: {e}\"))?;","preventionTips":["Run validate_config on every manifest as the single entry point to verification.","Keep target addresses as lowercase hex and code hashes as full keccak 32-byte hex.","Version the manifest schema and migrate old files rather than reusing stale fields."],"tags":["panic","rust","hex","manifest-validation","proxy"],"backgroundTag":"internal-invariant-violation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}