{"record":{"id":"597a129104db9cbd","repo":"FuelLabs/fuel-core","slug":"no-transactions","errorCode":null,"errorMessage":"No transactions","messagePattern":"No transactions","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/compression/src/decompress.rs","lineNumber":103,"sourceCode":"\n    let ctx = DecompressCtx {\n        config,\n        timestamp: block.consensus_header().time,\n        db,\n    };\n\n    let mut transactions = <Vec<Transaction> as DecompressibleBy<_>>::decompress_with(\n        block.transactions(),\n        &ctx,\n    )\n    .await?;\n\n    let transaction_count = transactions.len();\n\n    // patch mint transaction\n    let mint_tx = transactions\n        .last_mut()\n        .ok_or_else(|| anyhow::anyhow!(\"No transactions\"))?;\n    if let Transaction::Mint(mint) = mint_tx {\n        let tx_pointer = mint.tx_pointer_mut();\n        *tx_pointer = FuelTxPointer::new(\n            block.consensus_header().height,\n            #[allow(clippy::arithmetic_side_effects)]\n            u16::try_from(transaction_count - 1)?,\n        );\n    } else {\n        anyhow::bail!(\"Last transaction is not a mint\");\n    }\n\n    #[cfg(feature = \"fault-proving\")]\n    {\n        match block {\n            VersionedCompressedBlock::V0(_) => {}\n            VersionedCompressedBlock::V1(ref block) => {\n                let registry_root_after_decompression = ctx\n                    .db","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/compression/src/decompress.rs#L85-L121","documentation":"During decompression of a VersionedCompressedBlock, the code patches the mandatory final mint transaction (rewriting its tx_pointer to the block height and index). If the decompressed transaction list is empty, there is no last element and decompression fails with 'No transactions' (crates/compression/src/decompress.rs:103). Valid Fuel blocks always end with a mint transaction, so an empty list means the compressed block is malformed or was assembled incorrectly.","triggerScenarios":"Decompressing a compressed block whose transactions list is empty — hand-built blocks, truncated data, or a faulty producer that emitted zero transactions.","commonSituations":"Custom tooling that assembles VersionedCompressedBlock manually; serialization round-trip bugs dropping the transaction list; fuzzed or adversarial inputs in fault-proving setups.","solutions":["Feed decompression a well-formed compressed block produced by the standard compression path (it always includes the mint).","Validate the block's transaction count before decompressing (see validation snippet).","If you produce blocks yourself, always append the mint transaction last."],"exampleFix":"// before\nlet partial_block = decompress(&mut db, compressed_block).await?; // 'No transactions'\n\n// after — reject empty compressed blocks up front\nanyhow::ensure!(\n    !compressed_block.transactions().is_empty(),\n    \"compressed block carries no transactions\"\n);\nlet partial_block = decompress(&mut db, compressed_block).await?;","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    !compressed_block.transactions().is_empty(),\n    \"compressed block carries no transactions\"\n);\nlet partial_block = decompress(&mut db, compressed_block).await?;","typeGuard":"fn has_transactions(block: &VersionedCompressedBlock) -> bool {\n    !block.transactions().is_empty()\n}","tryCatchPattern":"match decompress(&mut db, compressed_block).await {\n    Err(e) if e.to_string().contains(\"No transactions\") => {\n        // malformed input: reject the block and alert the producer\n        return Err(e.context(\"received empty compressed block\"));\n    }\n    r => r?,\n}","preventionTips":["Only feed blocks produced by the standard compression path, which always includes the mint.","Validate transaction counts against the block header before decompressing.","In fuzzing/adversarial setups, expect this error and reject the input rather than retrying."],"tags":["rust","fuel-core","compression","decompression","block-format"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}