linera-io/linera-protocol · error

invalid logs list RLP: {e}

Error message

invalid logs list RLP: {e}

What it means

After skipping the three leading fields, the next RLP item — the logs list — failed header decoding. The receipt ends (or corrupts) exactly where the logs list should begin. Raised by decode_receipt_logs; surfaced as Permanent by generate_deposit_proof.

Source

Thrown at linera-bridge/src/proof/mod.rs:402

    let list_header =
        alloy_rlp::Header::decode(&mut data).map_err(|e| anyhow!("invalid receipt RLP: {e}"))?;
    ensure!(list_header.list, "receipt must be an RLP list");

    // Limit reads to the receipt's declared payload.
    ensure!(
        data.len() >= list_header.payload_length,
        "receipt payload extends past available data"
    );
    let mut data = &data[..list_header.payload_length];

    // Skip: status (0), cumulative_gas_used (1), logs_bloom (2)
    for i in 0..3 {
        skip_rlp_item(&mut data).map_err(|e| anyhow!("failed to skip receipt field {i}: {e}"))?;
    }

    // Decode the logs list
    let logs_header =
        alloy_rlp::Header::decode(&mut data).map_err(|e| anyhow!("invalid logs list RLP: {e}"))?;
    ensure!(logs_header.list, "logs must be an RLP list");
    ensure!(
        data.len() >= logs_header.payload_length,
        "logs payload extends past receipt boundary"
    );

    let mut logs_data = &data[..logs_header.payload_length];
    let mut logs = Vec::new();
    while !logs_data.is_empty() {
        logs.push(decode_log(&mut logs_data)?);
    }

    Ok(logs)
}

/// Parses a `DepositInitiated` event from a receipt log.
///
/// Verifies that `topic[0]` matches the event signature, that the log was emitted by

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Ensure the type byte was stripped only once before decoding
  2. Use complete canonical receipt bytes from Encodable2718 output
  3. For fixtures, build them with the crate's build_test_receipt helpers so the shape is guaranteed valid
Defensive patterns

Strategy: try-catch

Try / catch

match decode_receipt_logs(&receipt_rlp) {
    Err(e) if e.to_string().contains("invalid logs list RLP") => {
        // truncated before logs: re-derive the canonical receipt bytes
    }
    other => other?,
}

Prevention

When it happens

Trigger: A receipt whose payload ends after the bloom field (no logs list at all); truncated bytes; a stray type byte offsetting the cursor so the logs header is read from the wrong position.

Common situations: Truncated hex; receipts whose type-prefix handling was done twice (stripped once here and once upstream); malformed fixtures.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/82fc45f7182ba6bb. Report an issue: GitHub.