{"record":{"id":"25f594d260f754e8","repo":"FuelLabs/fuel-core","slug":"dry-run-count-overflow","errorCode":null,"errorMessage":"dry run count overflow","messagePattern":"dry run count overflow","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/schema/tx/assemble_tx.rs","lineNumber":817,"sourceCode":"            if !has_spendable_input {\n                script.inputs_mut().push(fake_input());\n            }\n\n            // We want to calculate `max_gas` for the script, but without script limit\n            *script.script_gas_limit_mut() = 0;\n\n            let gas_used_by_tx = script.max_gas(gas_costs, fee_params);\n\n            let max_gas_limit = max_tx_gas.saturating_sub(gas_used_by_tx);\n\n            *script.script_gas_limit_mut() = max_gas_limit;\n\n            let (updated_tx, new_status) = self.arguments.dry_run(script).await?;\n\n            self.dry_run_count = self\n                .dry_run_count\n                .checked_add(1)\n                .ok_or_else(|| anyhow::anyhow!(\"dry run count overflow\"))?;\n\n            let Transaction::Script(updated_script) = updated_tx else {\n                return Err(anyhow::anyhow!(\n                    \"During script gas limit estimation, \\\n                        dry-run returned incorrect transaction\"\n                ));\n            };\n\n            script = updated_script;\n            status = new_status;\n\n            if !has_spendable_input {\n                script.inputs_mut().pop();\n            }\n\n            let mut contracts_not_in_inputs = Vec::new();\n\n            match &status.result {","sourceCodeStart":799,"sourceCodeEnd":835,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/schema/tx/assemble_tx.rs#L799-L835","documentation":"dry_run_count tracks how many dry-runs the script gas limit estimation loop performed; it is incremented with checked_add and errors on usize overflow. Like the predicates counter, this is a defensive arithmetic guard — the dry_run_limit check earlier in the same loop bounds the count long before overflow.","triggerScenarios":"usize overflow of the dry-run counter inside one assemble call; unreachable through the GraphQL API because dry_run_count is compared against dry_run_limit each iteration.","commonSituations":"Custom forks that removed the dry_run_limit check; otherwise not observable.","solutions":["Treat as an internal invariant failure and report upstream with reproduction details","If you forked the node, keep the assemble_tx_dry_run_limit check intact"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (/dry run count overflow/.test(e.message)) { /* internal invariant: report upstream */ } else throw e; }","preventionTips":["Nothing client-side — dry_run_limit bounds the counter","Fork maintainers: keep assemble_tx_dry_run_limit finite"],"tags":["dry-run","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"}