{"record":{"id":"dcd4cf223c6142de","repo":"nautechsystems/nautilus_trader","slug":"eth-call-returned-no-result","errorCode":null,"errorMessage":"eth_call returned no result","messagePattern":"eth_call returned no result","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/rpc/http.rs","lineNumber":564,"sourceCode":"\n        if parsed.jsonrpc.is_none()\n            && let (Some(code), Some(message)) = (parsed.code, parsed.message)\n        {\n            if eth_call_error_is_revert(code, &message) {\n                return Ok(RpcCallResult::Reverted);\n            }\n            anyhow::bail!(\"eth_call RPC error {code}\");\n        }\n\n        if let Some(error) = parsed.error {\n            if eth_call_error_is_revert(error.code, &error.message) {\n                return Ok(RpcCallResult::Reverted);\n            }\n            anyhow::bail!(\"eth_call RPC error {}\", error.code);\n        }\n        let value = parsed\n            .result\n            .ok_or_else(|| anyhow::anyhow!(\"eth_call returned no result\"))?;\n        let stripped = value.strip_prefix(\"0x\").unwrap_or(&value);\n        let bytes = hex::decode(stripped)\n            .map_err(|_| anyhow::anyhow!(\"Failed to decode eth_call response\"))?;\n        Ok(RpcCallResult::Success(Bytes::from(bytes)))\n    }\n\n    /// Estimates the gas required for a transaction via `eth_estimateGas`.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the RPC call fails (including node-side revert of the simulated\n    /// transaction) or the result is missing or malformed.\n    pub async fn estimate_gas(\n        &self,\n        from: &Address,\n        to: &Address,\n        value: U256,\n        data: &[u8],","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/rpc/http.rs#L546-L582","documentation":"Raised in `call_result_at` when the parsed `eth_call` JSON-RPC response contains neither a `result` field nor an error code/message pair, so there is no value to decode. The library treats a missing `result` as fatal because `eth_call` must return either data or an error per the JSON-RPC spec.","triggerScenarios":"The node responds with a JSON-RPC envelope whose `result` field is absent or JSON `null` — e.g. some nodes omit `result` on internal errors, or a proxy strips the field; the response also lacks a recognizable `{code,message}` error object.","commonSituations":"Buggy or overloaded node returning `null` results; intermediary caching proxy dropping fields; mismatched node versions (e.g. pre-merge endpoints) that fail silently on certain eth_call payloads.","solutions":["Retry the call; transient node bugs often resolve on a second attempt or a different node","Check node logs for internal errors around the failed eth_call","Point the RPC client at a different execution client / provider","If a proxy sits between client and node, bypass it or fix its JSON handling"],"exampleFix":"// before: node returns {\"jsonrpc\":\"2.0\",\"id\":1} with no result\n// after: add fallback to a second provider\nmatch primary.call_at(tx, block).await {\n    Ok(res) => Ok(res),\n    Err(e) if e.to_string().contains(\"returned no result\") => fallback.call_at(tx, block).await,\n    Err(e) => Err(e),\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.call_at(&tx, block).await {\n    Ok(res) => Ok(res),\n    Err(e) if e.to_string().contains(\"eth_call returned no result\") => {\n        tokio::time::sleep(Duration::from_millis(250)).await;\n        client.call_at(&tx, block).await\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Retry once or twice with backoff — null results are often transient node bugs","Diversify across multiple execution providers and fail over on null results","Keep node software current; older clients have known null-result bugs","Route eth_call traffic away from caching proxies that mangle JSON-RPC responses"],"tags":["rpc","eth-call","empty-response"],"backgroundTag":"empty-response-body","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"}