{"record":{"id":"fe42dab7d331268e","repo":"datahaven-xyz/datahaven","slug":"messagetoolarge","errorCode":"MessageTooLarge","errorMessage":"MessageTooLarge","messagePattern":"MessageTooLarge","errorType":"error_code","errorClass":"SendError","httpStatus":null,"severity":"error","filePath":"operator/pallets/outbound-queue-v2/send_message_impl.rs","lineNumber":27,"sourceCode":"        // The inner payload should not be too large\n        let payload = message.encode();\n        ensure!(\n            payload.len() < T::MaxMessagePayloadSize::get() as usize,\n            SendError::MessageTooLarge\n        );\n\n        Ok(message.clone())","sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/datahaven-xyz/datahaven/blob/edcb13dbbcd3c29489eaa2480a6f60ee4cb1f3ec/operator/pallets/outbound-queue-v2/send_message_impl.rs#L27","documentation":"The outbound-queue-v2 `SendMessage::validate` implementation throws `SendError::MessageTooLarge` when the SCALE-encoded message payload is not smaller than `T::MaxMessagePayloadSize`. Large messages would exceed limits on the Ethereum side / message queue, so they are rejected at validation time before being enqueued for delivery.","triggerScenarios":"Calling `send`/`validate` on the outbound queue with a `Message` whose encoded payload (`message.encode().len()`) is >= `T::MaxMessagePayloadSize::get()`; also thrown in `deliver` when the encoded ticket cannot fit into the bounded message-queue slice.","commonSituations":"Bridging an asset or agent message with an oversized calldata/metadata payload; a caller stuffing large blob data into message params; runtime configured with a small MaxMessagePayloadSize while upstream senders assume the old larger limit.","solutions":["Reduce the message payload size (trim params, use a hash/commitment instead of full data, split into multiple messages).","Check the payload length against `MaxMessagePayloadSize` before calling `send` so the caller can handle it gracefully.","If the limit is genuinely too small for legitimate traffic, perform a runtime upgrade raising `MaxMessagePayloadSize` (accounting for Gas/queue limits)."],"exampleFix":"// before: oversized payload rejected at validate\nOutboundQueue::send(&message)?; // MessageTooLarge\n\n// after: pre-check size\nlet encoded = message.encode();\nensure!(encoded.len() < MaxMessagePayloadSize::get() as usize, \"payload too large\");\nOutboundQueue::send(&message)?;","handlingStrategy":"validation","validationCode":"const encoded = message.encode();\nif (encoded.length >= maxMessagePayloadSize) throw new Error('MessageTooLarge');","typeGuard":"function isWithinPayloadLimit(msg, limit) { return msg.encode().length < limit; }","tryCatchPattern":"try { outboundQueue.send(message); } catch (e) { if (e.kind === 'MessageTooLarge') { splitMessage(message); } else { throw e; } }","preventionTips":["Pre-validate encoded size before send","Avoid embedding large blobs in message params","Split oversized payloads","Review MaxMessagePayloadSize on runtime upgrades"],"tags":["substrate","bridge","payload-size","outbound-queue","snowbridge"],"backgroundTag":"payload-too-large","analyzedSha":"edcb13dbbcd3c29489eaa2480a6f60ee4cb1f3ec","analyzedAt":"2026-09-13T19:19:32.206Z","contentChangedAt":"2026-09-13T19:19:32.206Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}