{"record":{"id":"6b534868a79f4899","repo":"nautechsystems/nautilus_trader","slug":"chain-anchor-name-is-required","errorCode":null,"errorMessage":"Chain anchor name is required","messagePattern":"Chain anchor name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1214,"sourceCode":"                identities[right]\n                    .failure_domain_ids\n                    .iter()\n                    .all(|domain| !left_domains.contains(domain)),\n                \"Provider failure domains must be pairwise disjoint\"\n            );\n        }\n    }\n\n    let endpoints = [\n        normalize_endpoint(authoritative_url)?,\n        normalize_endpoint(config.verifiers[0].http_rpc_url.expose_secret())?,\n        normalize_endpoint(config.verifiers[1].http_rpc_url.expose_secret())?,\n    ];\n    ensure_distinct(endpoints.iter().map(String::as_str), \"provider endpoints\")?;\n\n    let anchor = &config.chain_anchor;\n    anyhow::ensure!(anchor.chain_id != 0, \"Chain anchor ID must be nonzero\");\n    anyhow::ensure!(\n        !anchor.chain_name.trim().is_empty(),\n        \"Chain anchor name is required\"\n    );\n    let checkpoint_hash = B256::from_str(&anchor.checkpoint_hash)\n        .map_err(|_| anyhow::anyhow!(\"Chain checkpoint hash must contain 32 hexadecimal bytes\"))?;\n    anyhow::ensure!(\n        checkpoint_hash != B256::ZERO,\n        \"Chain checkpoint hash must be nonzero\"\n    );\n    anyhow::ensure!(\n        anchor.max_head_skew_blocks != 0\n            && anchor.max_head_age_secs != 0\n            && anchor.max_future_drift_secs != 0,\n        \"Chain head skew, age, and future-drift limits must be nonzero\"\n    );\n    anyhow::ensure!(\n        !config.manifest_version.trim().is_empty(),\n        \"Deployment manifest version is required\"","sourceCodeStart":1196,"sourceCodeEnd":1232,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1196-L1232","documentation":"`validate_config` requires `config.chain_anchor.chain_name` to be a non-empty, non-whitespace-only string, checked with `!anchor.chain_name.trim().is_empty()`. The chain name is used for human-readable identification of the anchored chain, and an empty name indicates a misconfigured anchor. The error is thrown when the field is empty or contains only whitespace.","triggerScenarios":"Loading a verification config where `verification.chain_anchor.chain_name` is missing, set to \"\", or set to whitespace like \"   \".","commonSituations":"Config templates left unfilled; environment-variable substitution failing and yielding an empty string; YAML/TOML key typo so the value defaults to empty; automated config generation emitting an empty field.","solutions":["Set `chain_anchor.chain_name` to the network's canonical name (e.g. \"mainnet\", \"sepolia\").","Check that env-var interpolation for the name actually resolves to a non-empty value.","Verify the exact key spelling (`chain_name`) in the config file so it is not silently defaulted.","Trim/validate the value at config-generation time to reject whitespace-only names."],"exampleFix":"// before\n[verification.chain_anchor]\nchain_name = \"\"\n\n// after\n[verification.chain_anchor]\nchain_name = \"mainnet\"","handlingStrategy":"validation","validationCode":"fn check_chain_name(anchor: &ChainAnchor) -> Result<(), String> {\n    if anchor.chain_name.trim().is_empty() {\n        return Err(\"chain_anchor.chain_name is required and must be non-blank\".into());\n    }\n    Ok(())\n}","typeGuard":"fn has_chain_name(anchor: &ChainAnchor) -> bool {\n    !anchor.chain_name.trim().is_empty()\n}","tryCatchPattern":"match validate_config(&cfg) {\n    Err(e) if e.to_string().contains(\"Chain anchor name is required\") => {\n        eprintln!(\"chain_anchor.chain_name missing or blank: {e}\");\n        std::process::exit(1);\n    }\n    other => other,\n}","preventionTips":["Trim and non-empty check all string config fields at load time in your config loader.","Watch for env-var interpolation producing empty strings; fail fast when a substituted value is blank.","Verify key spelling against the config schema so chain_name is not silently defaulted to empty."],"tags":["config","validation"],"backgroundTag":"empty-required-field","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"}