{"record":{"id":"e3a41571ad7ead78","repo":"nautechsystems/nautilus_trader","slug":"manifest-probe-output-is-invalid","errorCode":null,"errorMessage":"Manifest probe output is invalid","messagePattern":"Manifest probe output is invalid","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1313,"sourceCode":"            let target = Address::from_str(&proxy.target_address)\n                .map_err(|_| anyhow::anyhow!(\"Proxy target address is invalid\"))?;\n            let target_hash = B256::from_str(&proxy.target_code_hash)\n                .map_err(|_| anyhow::anyhow!(\"Proxy target code hash is invalid\"))?;\n            anyhow::ensure!(\n                target != Address::ZERO\n                    && target != address\n                    && target_hash != B256::ZERO\n                    && storage_value[..12].iter().all(|byte| *byte == 0)\n                    && storage_value[12..] == *target.as_slice(),\n                \"Proxy target binding is invalid\"\n            );\n        }\n\n        for probe in &contract.probes {\n            Bytes::from_str(&probe.call_data)\n                .map_err(|_| anyhow::anyhow!(\"Manifest probe call data is invalid\"))?;\n            Bytes::from_str(&probe.expected_output)\n                .map_err(|_| anyhow::anyhow!(\"Manifest probe output is invalid\"))?;\n        }\n    }\n\n    for contract in &manifest.contracts {\n        let Some(proxy) = &contract.proxy else {\n            continue;\n        };\n        let target =\n            Address::from_str(&proxy.target_address).expect(\"validated proxy target address\");\n        let target_contract = manifest\n            .contracts\n            .iter()\n            .find(|candidate| Address::from_str(&candidate.address).ok() == Some(target))\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"Proxy target has no unique deployment manifest identity\")\n            })?;\n        anyhow::ensure!(\n            target_contract.role == BlockchainContractRole::Implementation","sourceCodeStart":1295,"sourceCodeEnd":1331,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1295-L1331","documentation":"The manifest validator parses each probe's expected_output with alloy's Bytes::from_str; this error means the expected output is not valid hex. The expected_output is the ABI-encoded return value the verifier compares against when executing the identity probe on-chain, so it must be a well-formed byte string.","triggerScenarios":"Running manifest verification where a probes[] entry has expected_output that is empty, odd-length hex, or contains non-hex characters — e.g. an ASCII string like 'WETH' instead of its ABI-encoded bytes.","commonSituations":"Hand-writing expected outputs instead of ABI-encoding them; copying a human-readable return value from a block explorer; truncating or corrupting hex during JSON editing; mixing 0X/0x casing tools reject.","solutions":["Set probe.expected_output to valid even-length hex of the ABI-encoded return value","Produce it with an ABI encoder for the probe's return type (e.g. cast abi-encode)","Regenerate the manifest programmatically rather than editing expected_output by hand"],"exampleFix":"// before\n{\"expected_output\": \"WETH\"}\n// after\n{\"expected_output\": \"0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045745544800000000000000000000000000000000000000000000000000000000\"}","handlingStrategy":"validation","validationCode":"fn valid_hex_bytes(s: &str) -> bool {\n    let h = s.strip_prefix(\"0x\").unwrap_or(s);\n    !h.is_empty() && h.len() % 2 == 0 && h.chars().all(|c| c.is_ascii_hexdigit())\n}\nassert!(manifest.contracts.iter().flat_map(|c| &c.probes).all(|p| valid_hex_bytes(&p.expected_output)));","typeGuard":null,"tryCatchPattern":"match validate_manifest(&config) {\n    Err(e) if e.to_string().contains(\"probe output\") => {\n        eprintln!(\"ABI-encode the expected return value into expected_output: {e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["ABI-encode expected return values (cast abi-encode) rather than writing ASCII/human-readable values","Capture expected_output from a real eth_call against the deployed contract when possible","Hex-validate manifest files in CI before verification"],"tags":["validation","hex-parsing","manifest"],"backgroundTag":"invalid-argument-format","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"}