{"record":{"id":"f44b572ec07a118a","repo":"linera-io/linera-protocol","slug":"unexpected-certificate-value","errorCode":null,"errorMessage":"Unexpected certificate value","messagePattern":"Unexpected certificate value","errorType":"validation","errorClass":"NodeError","httpStatus":null,"severity":"error","filePath":"linera-core/src/remote_node.rs","lineNumber":261,"sourceCode":"        &self,\n        chain_id: ChainId,\n        heights: Vec<BlockHeight>,\n    ) -> Result<Vec<ConfirmedBlockCertificate>, NodeError> {\n        let mut expected_heights = VecDeque::from(heights.clone());\n        let certificates = self\n            .node\n            .download_certificates_by_heights(chain_id, heights)\n            .await?;\n\n        if certificates.len() > expected_heights.len() {\n            return Err(NodeError::TooManyCertificatesReturned {\n                chain_id,\n                remote_node: Box::new(self.public_key),\n            });\n        }\n\n        for certificate in &certificates {\n            ensure!(\n                certificate.inner().chain_id() == chain_id,\n                NodeError::UnexpectedCertificateValue\n            );\n            if let Some(expected_height) = expected_heights.pop_front() {\n                ensure!(\n                    expected_height == certificate.inner().height(),\n                    NodeError::UnexpectedCertificateValue\n                );\n            } else {\n                return Err(NodeError::UnexpectedCertificateValue);\n            }\n        }\n\n        ensure!(\n            expected_heights.is_empty(),\n            NodeError::MissingCertificatesByHeights {\n                chain_id,\n                heights: expected_heights.into_iter().collect(),","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-core/src/remote_node.rs#L243-L279","documentation":"Raised in RemoteNode::download_certificates_by_heights while validating the batch a validator returned for a download_certificates_by_heights(chain_id, heights) call: every certificate whose inner chain_id differs from the requested chain_id triggers this error. It is a response-integrity check — a well-behaved validator must only return certificates of the chain that was asked for.","triggerScenarios":"Validator (or proxy) returns certificates belonging to another chain; corrupted deserialization routing responses between tenants; byzantine validator serving unrelated data. Only bites per-validator responses inspected directly; the client's scheduler hedges across validators and can drop a bad source.","commonSituations":"Shared validator infrastructure mixing responses across chains after a misconfiguration; a stale proxy cache serving another chain's certificates; adversarial testing of validator honesty.","solutions":["Exclude the offending validator from the download and retry with the remaining ones","Check the validator's and any proxy's configuration for cross-chain response mixing","Verify the requested chain_id and heights are what you intended (copy/paste mistakes make legitimate responses look wrong)","Report the validator if it reproducibly returns foreign certificates"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"fn is_unexpected_certificate_value(err: &NodeError) -> bool {\n    matches!(err, NodeError::UnexpectedCertificateValue)\n}","tryCatchPattern":"for node in validator_nodes {\n    match remote_node.download_certificates_by_heights(chain_id, heights.clone()).await {\n        Ok(certs) => return Ok(certs),\n        Err(NodeError::UnexpectedCertificateValue) => continue, // skip bad validator\n        Err(e) => return Err(e.into()),\n    }\n}\nreturn Err(NodeError::UnexpectedCertificateValue.into());","preventionTips":["Double-check the chain_id passed to download calls — a wrong id makes honest answers look invalid","Fence validators that repeatedly return foreign certificates from your download sources","Prefer height-ordered batch downloads from validators you health-check regularly"],"tags":["linera","validators","certificates","response-validation"],"backgroundTag":"invalid-validator-response","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}