{"record":{"id":"28f9e8971664702b","repo":"nautechsystems/nautilus_trader","slug":"deployment-manifest-chain-identity-does-not-match","errorCode":null,"errorMessage":"Deployment manifest chain identity does not match the chain anchor","messagePattern":"Deployment manifest chain identity does not match the chain anchor","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1256,"sourceCode":"        manifest_digest != B256::ZERO,\n        \"Deployment manifest digest must be nonzero\"\n    );\n    let manifest = &config.deployment_manifest;\n    anyhow::ensure!(\n        manifest.version == config.manifest_version,\n        \"Deployment manifest version does not match its configured identity\"\n    );\n    anyhow::ensure!(\n        manifest.chain_id == anchor.chain_id && manifest.chain_name == anchor.chain_name,\n        \"Deployment manifest chain identity does not match the chain anchor\"\n    );\n    let canonical_manifest = serde_json::to_vec(manifest)\n        .map_err(|_| anyhow::anyhow!(\"Failed to serialize the deployment manifest\"))?;\n    anyhow::ensure!(\n        keccak256(canonical_manifest) == manifest_digest,\n        \"Deployment manifest digest does not match its canonical content\"\n    );\n    anyhow::ensure!(\n        !manifest.contracts.is_empty() && !manifest.tokens.is_empty() && !manifest.pools.is_empty(),\n        \"Deployment manifest contracts, tokens, and pools are required\"\n    );\n    let mut contract_addresses = HashSet::new();\n    let mut roles = HashSet::new();\n\n    for contract in &manifest.contracts {\n        let address = Address::from_str(&contract.address)\n            .map_err(|_| anyhow::anyhow!(\"Deployment manifest contains an invalid address\"))?;\n        anyhow::ensure!(\n            contract_addresses.insert(address),\n            \"Deployment manifest contains a duplicate contract address\"\n        );\n        roles.insert(contract.role);\n        let code_hash = B256::from_str(&contract.runtime_code_hash)\n            .map_err(|_| anyhow::anyhow!(\"Deployment manifest contains an invalid code hash\"))?;\n        anyhow::ensure!(\n            code_hash != B256::ZERO,","sourceCodeStart":1238,"sourceCodeEnd":1274,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1238-L1274","documentation":"The validator requires the deployment manifest's chain identity (chain_id and chain_name) to match the corresponding chain anchor's. A mismatch means the manifest describes a different chain than the anchor it is being verified against, which could route verification against the wrong network. Validation fails with this message.","triggerScenarios":"Validating a DeploymentConfig where `manifest.chain_id != anchor.chain_id` or `manifest.chain_name != anchor.chain_name` (e.g. manifest generated for mainnet, anchor configured for a testnet).","commonSituations":"Reusing a manifest across environments (mainnet vs Sepolia) with different anchors; renaming a chain in the anchor config without regenerating the manifest; copying a deployment bundle between chains with the same contracts.","solutions":["Regenerate the deployment manifest for the target chain so chain_id and chain_name match the anchor.","Correct the anchor's chain_id/chain_name if the manifest is the source of truth.","Add a pre-deploy script that asserts manifest chain identity equals the anchor before submitting configs."],"exampleFix":"// before\nlet anchor = ChainAnchor { chain_id: 8453, chain_name: \"base\".into(), ..anchor }; // manifest is for sepolia (11155111)\n// after\nlet manifest = build_manifest_for(8453, \"base\"); // regenerate manifest for the anchored chain","handlingStrategy":"validation","validationCode":"assert_eq!(\n    config.deployment_manifest.chain_id, anchor.chain_id,\n    \"manifest chain_id must match anchor\"\n);\nassert_eq!(\n    config.deployment_manifest.chain_name, anchor.chain_name,\n    \"manifest chain_name must match anchor\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate the manifest per target chain; never reuse a manifest across chain_id boundaries.","Keep chain identity in a single source of truth that both anchor and manifest derive from.","Assert chain identity equality in a CI smoke test before deploying bundles."],"tags":["validation","mismatch","blockchain"],"backgroundTag":"type-mismatch","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}