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 (3f009df) with main (15c4b3b)

Summary

✅ 2 untouched

Copy link
Collaborator

@greged93 greged93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a suggestion on implementing get_l1_message

@frisitano frisitano merged commit 68b4b43 into main Oct 20, 2025
14 of 15 checks passed
@frisitano frisitano deleted the feat/get_l1_message_by_index_rpc branch October 20, 2025 13:40
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.

2 participants