Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion crates/derive/src/sources/calldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl<CP: ChainProvider + Send> CalldataSource<CP> {
TxEnvelope::Legacy(tx) => (tx.tx().to(), tx.tx().input()),
TxEnvelope::Eip2930(tx) => (tx.tx().to(), tx.tx().input()),
TxEnvelope::Eip1559(tx) => (tx.tx().to(), tx.tx().input()),
TxEnvelope::Eip7702(tx) => (tx.tx().to(), tx.tx().input()),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Super important that we never consider these txs just yet. We just want the ability to observe 7702 txs on L1, but skip over them, without the pipeline crashing due to the tx type being unknown.

_ => return None,
};
let to = tx_kind?;
Expand Down Expand Up @@ -91,7 +92,7 @@ mod tests {
use super::*;
use crate::{errors::PipelineErrorKind, test_utils::TestChainProvider};
use alloc::{vec, vec::Vec};
use alloy_consensus::{Signed, TxEip2930, TxEip4844, TxEip4844Variant, TxLegacy};
use alloy_consensus::{Signed, TxEip2930, TxEip4844, TxEip4844Variant, TxEip7702, TxLegacy};
use alloy_primitives::{address, Address, PrimitiveSignature as Signature, TxKind};

pub(crate) fn test_legacy_tx(to: Address) -> TxEnvelope {
Expand All @@ -112,6 +113,15 @@ mod tests {
))
}

pub(crate) fn test_eip7702_tx(to: Address) -> TxEnvelope {
let sig = Signature::test_signature();
TxEnvelope::Eip7702(Signed::new_unchecked(
TxEip7702 { to, ..Default::default() },
sig,
Default::default(),
))
}

pub(crate) fn test_blob_tx(to: Address) -> TxEnvelope {
let sig = Signature::test_signature();
TxEnvelope::Eip4844(Signed::new_unchecked(
Expand Down Expand Up @@ -216,6 +226,21 @@ mod tests {
assert!(source.open);
}

#[tokio::test]
async fn test_load_calldata_valid_eip7702_tx() {
let batch_inbox_address = address!("0123456789012345678901234567890123456789");
let mut source = default_test_calldata_source();
source.batch_inbox_address = batch_inbox_address;
let tx = test_eip7702_tx(batch_inbox_address);
source.signer = tx.recover_signer().unwrap();
let block_info = BlockInfo::default();
source.chain_provider.insert_block_with_transactions(0, block_info, vec![tx]);
assert!(!source.open); // Source is not open by default.
assert!(source.load_calldata(&BlockInfo::default()).await.is_ok());
assert!(!source.calldata.is_empty()); // Calldata is NOT empty.
assert!(source.open);
}

#[tokio::test]
async fn test_load_calldata_blob_tx_ignored() {
let batch_inbox_address = address!("0123456789012345678901234567890123456789");
Expand Down