{"record":{"id":"e073d2154118d762","repo":"linera-io/linera-protocol","slug":"toomanypublishedblobs","errorCode":"TooManyPublishedBlobs","errorMessage":"Number of published blobs per block must not exceed {0}","messagePattern":"Number of published blobs per block must not exceed (.+?)","errorType":"validation","errorClass":"WorkerError","httpStatus":null,"severity":"error","filePath":"linera-core/src/chain_worker/state.rs","lineNumber":2280,"sourceCode":"    ) -> Result<ChainInfoResponse, WorkerError> {\n        let mut was_expected = self\n            .chain\n            .pending_validated_blobs\n            .maybe_insert(&blob)\n            .await?;\n        for (_, mut pending_blobs) in self\n            .chain\n            .pending_proposed_blobs\n            .try_load_all_entries_mut()\n            .await?\n        {\n            if !pending_blobs.validated.get() {\n                let (_, committee) = self.chain.current_committee().await?;\n                let policy = committee.policy();\n                policy\n                    .check_blob_size(blob.content())\n                    .with_execution_context(ChainExecutionContext::Block)?;\n                ensure!(\n                    u64::try_from(pending_blobs.pending_blobs.iterative_count().await?)\n                        .is_ok_and(|count| count < policy.maximum_published_blobs),\n                    WorkerError::TooManyPublishedBlobs(policy.maximum_published_blobs)\n                );\n            }\n            was_expected = was_expected || pending_blobs.maybe_insert(&blob).await?;\n        }\n        ensure!(was_expected, WorkerError::UnexpectedBlob);\n        self.save().await?;\n        self.chain_info_response().await\n    }\n\n    /// Returns a stored [`Certificate`] for the chain's block at the requested [`BlockHeight`].\n    ///\n    /// Does not need `&mut self` because the chain is eagerly initialized when the\n    /// chain handle is created.\n    #[cfg(with_testing)]\n    #[instrument(skip_all, fields(","sourceCodeStart":2262,"sourceCodeEnd":2298,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-core/src/chain_worker/state.rs#L2262-L2298","documentation":"The committee's resource-control policy caps how many blobs a single block may publish (policy.maximum_published_blobs). In handle_pending_blob, while inserting blobs for a proposed-but-not-yet-validated block, the worker enforces count < policy.maximum_published_blobs before each insert. Exceeding the cap rejects the blob and fails the request with TooManyPublishedBlobs; the check is skipped only for blob sets already validated by a quorum.","triggerScenarios":"handle_pending_blob (or send_pending_blobs / handle_message carrying a blob) for a proposal whose pending blob set has already reached policy.maximum_published_blobs; blocks from data-publishing applications that attach many blobs in one block.","commonSituations":"Genesis or committee policy configured with a low maximum_published_blobs; an application upgraded to publish more blobs per block; test chains using the default test policy cap of 10.","solutions":["Split the publication across several blocks so each stays within maximum_published_blobs.","Before proposing, count the blob ids in the block against policy.maximum_published_blobs from the chain's committee info.","If the workload legitimately needs more, have the committee raise maximum_published_blobs when creating or updating the committee configuration (e.g. --maximum-published-blobs)."],"exampleFix":"// before: one block publishes every blob\nlet mut builder = BlockBuilder::new(height, timestamp);\nfor blob in all_blobs {\n    builder = builder.with_published_blob(blob.id());\n}\n\n// after: chunk under the policy cap\nlet cap = policy.maximum_published_blobs as usize;\nfor chunk in all_blobs.chunks(cap) {\n    let mut builder = BlockBuilder::new(height, timestamp);\n    for blob in chunk {\n        builder = builder.with_published_blob(blob.id());\n    }\n    // confirm this block, then publish the next chunk\n}","handlingStrategy":"validation","validationCode":"// Read the cap from the committee policy before building the block.\nlet (_, committee) = client.current_committee(chain_id).await?;\nlet max = committee.policy().maximum_published_blobs;\nif u64::try_from(blob_ids.len()).is_ok_and(|n| n > max) {\n    return Err(WorkerError::TooManyPublishedBlobs(max));\n}","typeGuard":null,"tryCatchPattern":"match node.handle_pending_blob(blob).await {\n    Err(NodeError::WorkerError(err)) if matches!(*err, WorkerError::TooManyPublishedBlobs(_)) => {\n        // Split the pending block: re-propose with fewer blobs and confirm in batches.\n    }\n    result => result,\n}","preventionTips":["Publish blobs in batches well under the committee cap.","Check the policy on chain info before generating blob-heavy blocks.","Raise maximum_published_blobs deliberately at committee creation, not reactively after outages.","Monitor this error: it usually indicates an application emitting unbounded blob growth."],"tags":["rust","linera","blockchain","blobs","resource-policy","limits"],"backgroundTag":"resource-limit-exceeded","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}