datahaven-xyz/datahaven · error · SendError

MessageTooLarge

MessageTooLarge

Error message

MessageTooLarge

What it means

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.

Solutions

  1. Reduce the message payload size (trim params, use a hash/commitment instead of full data, split into multiple messages).
  2. Check the payload length against `MaxMessagePayloadSize` before calling `send` so the caller can handle it gracefully.
  3. If the limit is genuinely too small for legitimate traffic, perform a runtime upgrade raising `MaxMessagePayloadSize` (accounting for Gas/queue limits).

Example fix

// before: oversized payload rejected at validate
OutboundQueue::send(&message)?; // MessageTooLarge

// after: pre-check size
let encoded = message.encode();
ensure!(encoded.len() < MaxMessagePayloadSize::get() as usize, "payload too large");
OutboundQueue::send(&message)?;
Defensive patterns

Strategy: validation

Validate before calling

const encoded = message.encode();
if (encoded.length >= maxMessagePayloadSize) throw new Error('MessageTooLarge');

Type guard

function isWithinPayloadLimit(msg, limit) { return msg.encode().length < limit; }

Try / catch

try { outboundQueue.send(message); } catch (e) { if (e.kind === 'MessageTooLarge') { splitMessage(message); } else { throw e; } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.

Related errors


AI-assisted analysis of datahaven-xyz/datahaven@edcb13dbbc (2026-09-13). Data as JSON: /api/errors/fe42dab7d331268e. Report an issue: GitHub.

Appendix: source

Thrown at operator/pallets/outbound-queue-v2/send_message_impl.rs:27

        // The inner payload should not be too large
        let payload = message.encode();
        ensure!(
            payload.len() < T::MaxMessagePayloadSize::get() as usize,
            SendError::MessageTooLarge
        );

        Ok(message.clone())

View on GitHub (pinned to edcb13dbbc)