{"record":{"id":"9da7f5052bc97fd1","repo":"FuelLabs/fuel-core","slug":"estimated-predicates-count-overflow","errorCode":null,"errorMessage":"estimated predicates count overflow","messagePattern":"estimated predicates count overflow","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/schema/tx/assemble_tx.rs","lineNumber":700,"sourceCode":"\n        let mut tx_to_estimate = self.tx;\n        let estimated_tx = tokio_rayon::spawn_fifo(move || {\n            let result = tx_to_estimate.estimate_predicates(\n                &parameters,\n                memory,\n                read_view.as_ref(),\n            );\n            result.map(|_| tx_to_estimate)\n        })\n        .await\n        .map_err(|err| anyhow::anyhow!(\"{:?}\", err))?;\n\n        self.tx = estimated_tx;\n\n        self.estimated_predicates_count = self\n            .estimated_predicates_count\n            .checked_add(1)\n            .ok_or_else(|| anyhow::anyhow!(\"estimated predicates count overflow\"))?;\n\n        Ok(self)\n    }\n\n    async fn estimate_script_if_possible(&mut self) -> anyhow::Result<()> {\n        if !self.is_runnable_script() {\n            return Ok(())\n        }\n\n        let Some(script_ref) = self.tx.as_script_mut() else {\n            unreachable!(\"The transaction is a script, checked above; qed\");\n        };\n\n        // Trick to avoid cloning `Script`\n        let dummy_script = Transaction::script(\n            Default::default(),\n            Default::default(),\n            Default::default(),","sourceCodeStart":682,"sourceCodeEnd":718,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/schema/tx/assemble_tx.rs#L682-L718","documentation":"estimated_predicates_count is incremented with checked_add after each predicate estimation round; the error fires only if the counter (a usize) overflows, i.e. after 2^64 estimation rounds on the same assembly. It is a defensive guard, not a condition a real workload can reach (the estimate_predicates_limit check trips far earlier).","triggerScenarios":"Theoretically usize::MAX estimation rounds within one assemble call; in practice unreachable because error 88's limit check fires first at the configured round limit.","commonSituations":"Custom forks that remove or raise estimate_predicates_limit to extreme values; otherwise never observed in the wild.","solutions":["Treat this as an internal invariant failure: report it upstream with the tx and node version","If you forked the node and disabled the round limit, restore a sane assemble_tx_estimate_predicates_limit"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (/estimated predicates count overflow/.test(e.message)) { /* internal invariant: report upstream with tx + node version */ } else throw e; }","preventionTips":["Nothing client-side — the estimate_predicates_limit check bounds this counter","Fork maintainers: keep a finite assemble_tx_estimate_predicates_limit"],"tags":["predicate","estimation","overflow","unreachable","assemble-tx"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}