{"record":{"id":"025e260e99b8d3b5","repo":"nautechsystems/nautilus_trader","slug":"verification-verifiers-must-contain-exactly-two","errorCode":null,"errorMessage":"`verification.verifiers` must contain exactly two providers","messagePattern":"`verification\\.verifiers` must contain exactly two providers","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/verification.rs","lineNumber":1162,"sourceCode":"    }\n\n    fn provider_ids(&self) -> [String; VERIFICATION_SOURCE_COUNT] {\n        source_provider_ids(&self.sources)\n    }\n\n    fn failure(&self, read: VerificationRead) -> VerificationFailure {\n        VerificationFailure {\n            read,\n            provider_ids: self.provider_ids(),\n        }\n    }\n}\n\nfn validate_config(\n    authoritative_url: &str,\n    config: &BlockchainVerificationConfig,\n) -> anyhow::Result<()> {\n    anyhow::ensure!(\n        config.verifiers.len() == VERIFICATION_PROVIDER_COUNT,\n        \"`verification.verifiers` must contain exactly two providers\"\n    );\n    validate_identity(&config.authoritative)?;\n    for verifier in &config.verifiers {\n        validate_identity(&verifier.identity)?;\n    }\n\n    let identities = [\n        &config.authoritative,\n        &config.verifiers[0].identity,\n        &config.verifiers[1].identity,\n    ];\n    ensure_distinct(\n        identities\n            .iter()\n            .map(|identity| identity.provider_id.as_str()),\n        \"provider IDs\",","sourceCodeStart":1144,"sourceCodeEnd":1180,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/verification.rs#L1144-L1180","documentation":"The blockchain verification subsystem requires exactly two independent verification providers (VERIFICATION_PROVIDER_COUNT = 2) in the `verification.verifiers` config list, validated in `validate_config`. This count constraint ensures cross-verification between a fixed pair of independent sources before results are trusted. The error is thrown by `anyhow::ensure!` at startup when the configured provider count differs from two.","triggerScenarios":"Calling `validate_config` (or the config-loading path that invokes it) with a BlockchainVerificationConfig whose `verifiers` vec has length 0, 1, or 3+.","commonSituations":"Operators leaving `verifiers` empty in the TOML/YAML config; adding a third provider for redundancy without realizing the count is fixed; deleting a provider entry during an outage; a config template with only one provider filled in.","solutions":["Configure exactly two entries under `verification.verifiers` in the config file.","Remove any extra verifier entries so the list length is exactly two.","Check for YAML/TOML list merge mistakes (an included file duplicating or dropping verifier entries).","Run the config through `validate_config` before deploy to catch the count early."],"exampleFix":"// before\n[verification]\nverifiers = [\"alchemy\"]\n\n// after\n[verification]\nverifiers = [\"alchemy\", \"infura\"]","handlingStrategy":"validation","validationCode":"const VERIFICATION_PROVIDER_COUNT: usize = 2;\nfn check_verifier_count(cfg: &BlockchainVerificationConfig) -> Result<(), String> {\n    if cfg.verifiers.len() != VERIFICATION_PROVIDER_COUNT {\n        return Err(format!(\n            \"verification.verifiers must contain exactly {} providers, got {}\",\n            VERIFICATION_PROVIDER_COUNT,\n            cfg.verifiers.len()\n        ));\n    }\n    Ok(())\n}","typeGuard":"fn has_exactly_two_verifiers(cfg: &BlockchainVerificationConfig) -> bool {\n    cfg.verifiers.len() == 2\n}","tryCatchPattern":"match validate_config(&cfg) {\n    Ok(()) => start_with_config(cfg),\n    Err(e) if e.to_string().contains(\"exactly two providers\") => {\n        eprintln!(\"Config error: {e}; fix verification.verifiers to list exactly 2 providers\");\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep a schema/JSON-Schema check for the config that enforces minItems/maxItems = 2 on verification.verifiers.","Run validate_config as part of CI config-lint so bad configs never reach deployment.","Document that the verifier count is fixed at two; do not add or remove entries ad hoc."],"tags":["config","validation","blockchain"],"backgroundTag":"missing-required-config-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"}