{"record":{"id":"193b556ecb3ecb83","repo":"linera-io/linera-protocol","slug":"block-proposal-has-size-0-which-is-too-large","errorCode":null,"errorMessage":"Block proposal has size {0} which is too large","messagePattern":"Block proposal has size (.+?) which is too large","errorType":"validation","errorClass":"ChainError","httpStatus":null,"severity":"error","filePath":"linera-chain/src/data_types/mod.rs","lineNumber":143,"sourceCode":"    pub fn operations(&self) -> impl Iterator<Item = &Operation> {\n        self.transactions.iter().filter_map(|tx| match tx {\n            Transaction::ExecuteOperation(operation) => Some(operation),\n            Transaction::ReceiveMessages(_) => None,\n        })\n    }\n\n    /// Returns all incoming bundles in this block.\n    pub fn incoming_bundles(&self) -> impl Iterator<Item = &IncomingBundle> {\n        self.transactions.iter().filter_map(|tx| match tx {\n            Transaction::ReceiveMessages(bundle) => Some(bundle),\n            Transaction::ExecuteOperation(_) => None,\n        })\n    }\n\n    /// Checks that the serialized size of this block does not exceed the given maximum.\n    pub fn check_proposal_size(&self, maximum_block_proposal_size: u64) -> Result<(), ChainError> {\n        let size = bcs::serialized_size(self)?;\n        ensure!(\n            size <= usize::try_from(maximum_block_proposal_size).unwrap_or(usize::MAX),\n            ChainError::BlockProposalTooLarge(size)\n        );\n        Ok(())\n    }\n}\n\n#[async_graphql::ComplexObject]\nimpl ProposedBlock {\n    /// Metadata about the transactions in this block.\n    async fn transaction_metadata(&self) -> Vec<TransactionMetadata> {\n        self.transactions\n            .iter()\n            .map(TransactionMetadata::from_transaction)\n            .collect()\n    }\n}\n","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-chain/src/data_types/mod.rs#L125-L161","documentation":"ProposedBlock::check_proposal_size (linera-chain/src/data_types/mod.rs:141-148) bcs-serializes the block and rejects it if it exceeds the committee policy's maximum_block_proposal_size — 13,000,000 bytes in the default production policy (linera-execution/src/policy.rs:326), u64::MAX in the test default (policy.rs:241). Both stage_block_execution (linera-core/src/chain_worker/state.rs:2424) and try_handle_block_proposal (state.rs:2529) enforce the limit, so oversized proposals never execute.","triggerScenarios":"Blocks inlining large published blobs or many big transactions (check_proposal_size counts the whole serialized ProposedBlock); a committee that lowered maximum_block_proposal_size (it is configurable via genesis/policy, linera-service/src/cli/command.rs:317); tests deliberately setting tiny limits (e.g., fee_consumption.rs uses 61 bytes).","commonSituations":"Publishing large data (images, WASM bytecode, state blobs) inside the block instead of via the blob service; batch jobs packing thousands of operations into one block; a policy change shrinking limits while old batching logic remained.","solutions":["Split the block into several smaller proposals at the same or successive heights","Publish large data as blobs through the blob-storage flow first and reference them by BlobId in the block instead of inlining the bytes","If you operate the committee, raise maximum_block_proposal_size in the policy (genesis config or policy update path)"],"exampleFix":"// before: inlining a big blob's bytes into the block\nlet block = ProposedBlock { transactions: vec![Transaction::ExecuteOperation(\n    Operation::system(SystemOperation::PublishDataBlob(blob_bytes)),\n)], .. };\n\n// after: publish via blob service, reference by id in (smaller) blocks\nlet blob_id = client.publish_data_blob(blob_bytes).await?; // stored out-of-band\nlet block = ProposedBlock { transactions: vec![Transaction::ExecuteOperation(\n    Operation::system(SystemOperation::PublishBlob { blob_id }),\n)], .. };","handlingStrategy":"validation","validationCode":"// Cheap pre-submit mirror of check_proposal_size (data_types/mod.rs:141):\nlet size = bcs::serialized_size(&block)?;\nlet limit = usize::try_from(policy.maximum_block_proposal_size).unwrap_or(usize::MAX);\nif size > limit {\n    anyhow::bail!(\"block proposal is {size} bytes > limit {limit}; split it or use blobs\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(ChainError::BlockProposalTooLarge(size)) => {\n        // split the block, or move large payloads to the blob service and reference\n        // BlobIds; retrying the identical block cannot succeed\n    }\n    other => other?,\n}","preventionTips":["Publish large data via the blob service; reference blobs by id in blocks","Batch operations into multiple blocks instead of one maximal block","Know your committee's maximum_block_proposal_size (default 13 MB in production policy)"],"tags":["linera","block-size","limits","policy","serialization","rust"],"backgroundTag":"block-proposal-too-large","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}