Skip to content

Conversation

frisitano
Copy link
Collaborator

Overview

This PR adds a method that allows the user to fetch a L1 message by its index. This method intentionally returns the L1MessageEnvelope which wraps the raw transaction and includes additional metadata. We should confirm if its desireable to return the L1MessageEnvelope instead of the internal TxL1Message.

/// A L1 message envelope, containing extra information about the message.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct L1MessageEnvelope {
/// The L1 transaction.
pub transaction: TxL1Message,
/// The L1 block number at which the L1 message was generated.
pub l1_block_number: u64,
/// The L2 block number at which the L1 message was processed.
pub l2_block_number: Option<u64>,
/// The queue hash for the message.
pub queue_hash: Option<B256>,
}

This has been implemented by introducing the DatabaseQuery command variant and a DatabaseQuery enum such that this pattern can be extended easily to perform other database lookups.

Copy link

codspeed-hq bot commented Oct 19, 2025

CodSpeed Performance Report

Merging #370 will not alter performance

Comparing feat/get_l1_message_by_index_rpc (3a4469f) with main (243b212)

Summary

✅ 2 untouched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant