diff --git a/Cargo.lock b/Cargo.lock
index fcf67aea6f..a96d113edb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -38,7 +38,7 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
[[package]]
name = "alloy-consensus"
version = "0.1.0"
-source = "git+https://github.com/clabby/alloy?branch=cl/alloy-consensus-no-std#349762ad9d5b754a0696823a2ea1c7795cc036af"
+source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -49,7 +49,7 @@ dependencies = [
[[package]]
name = "alloy-eips"
version = "0.1.0"
-source = "git+https://github.com/clabby/alloy?branch=cl/alloy-consensus-no-std#349762ad9d5b754a0696823a2ea1c7795cc036af"
+source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d"
dependencies = [
"alloy-primitives",
"alloy-rlp",
@@ -99,7 +99,7 @@ dependencies = [
[[package]]
name = "alloy-serde"
version = "0.1.0"
-source = "git+https://github.com/clabby/alloy?branch=cl/alloy-consensus-no-std#349762ad9d5b754a0696823a2ea1c7795cc036af"
+source = "git+https://github.com/alloy-rs/alloy?rev=e3f2f07#e3f2f075a9e7ad9753a255dbe71dbad6a91ba96d"
dependencies = [
"alloy-primitives",
"serde",
diff --git a/crates/derive/Cargo.toml b/crates/derive/Cargo.toml
index 1ddac3330b..a374daab46 100644
--- a/crates/derive/Cargo.toml
+++ b/crates/derive/Cargo.toml
@@ -16,8 +16,8 @@ anyhow.workspace = true
alloy-primitives = { version = "0.7.0", default-features = false, features = ["rlp"] }
alloy-rlp = { version = "0.3.4", default-features = false, features = ["derive"] }
alloy-sol-types = { version = "0.7.0", default-features = false }
-alloy-consensus = { git = "https://github.com/clabby/alloy", branch = "cl/alloy-consensus-no-std", default-features = false }
-alloy-eips = { git = "https://github.com/clabby/alloy", branch = "cl/alloy-consensus-no-std", default-features = false }
+alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "e3f2f07", default-features = false }
+alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "e3f2f07", default-features = false }
async-trait = "0.1.77"
hashbrown = "0.14.3"
unsigned-varint = "0.8.0"
diff --git a/crates/derive/src/lib.rs b/crates/derive/src/lib.rs
index 904895c890..b4c3572dad 100644
--- a/crates/derive/src/lib.rs
+++ b/crates/derive/src/lib.rs
@@ -6,6 +6,11 @@
extern crate alloc;
+use alloc::sync::Arc;
+use core::fmt::Debug;
+use traits::{ChainProvider, TelemetryProvider};
+use types::RollupConfig;
+
mod params;
pub use params::{
ChannelID, CHANNEL_ID_LENGTH, CONFIG_UPDATE_EVENT_VERSION_0, CONFIG_UPDATE_TOPIC,
@@ -21,3 +26,28 @@ pub mod types;
/// The derivation pipeline is responsible for deriving L2 inputs from L1 data.
#[derive(Debug, Clone, Copy)]
pub struct DerivationPipeline;
+
+impl DerivationPipeline {
+ /// Creates a new instance of the [DerivationPipeline].
+ pub fn new
(
+ _rollup_config: Arc,
+ _chain_provider: P,
+ _telemetry: Arc,
+ ) -> Self
+ where
+ P: ChainProvider + Clone + Debug + Send,
+ T: TelemetryProvider + Clone + Debug + Send + Sync,
+ {
+ // let l1_traversal = L1Traversal::new(chain_provider, rollup_config.clone(),
+ // telemetry.clone()); let l1_retrieval = L1Retrieval::new(l1_traversal, dap_source,
+ // telemetry.clone()); let frame_queue = FrameQueue::new(l1_retrieval,
+ // telemetry.clone()); let channel_bank = ChannelBank::new(rollup_config.clone(),
+ // frame_queue, telemetry.clone()); let channel_reader =
+ // ChannelReader::new(channel_bank, telemetry.clone()); let batch_queue =
+ // BatchQueue::new(rollup_config.clone(), channel_reader, telemetry.clone(), fetcher);
+ // let attributes_queue = AttributesQueue::new(rollup_config.clone(), batch_queue,
+ // telemetry.clone(), builder);
+
+ unimplemented!()
+ }
+}
diff --git a/crates/derive/src/sources/blobs.rs b/crates/derive/src/sources/blobs.rs
index ba07e75d12..b53b526271 100644
--- a/crates/derive/src/sources/blobs.rs
+++ b/crates/derive/src/sources/blobs.rs
@@ -76,6 +76,7 @@ where
(tx.to(), tx.input.clone(), Some(tx.blob_versioned_hashes.clone()))
}
},
+ _ => continue,
};
let TxKind::Call(to) = tx_kind else { continue };
diff --git a/crates/derive/src/sources/factory.rs b/crates/derive/src/sources/factory.rs
index 3be673d397..231d42c2e5 100644
--- a/crates/derive/src/sources/factory.rs
+++ b/crates/derive/src/sources/factory.rs
@@ -35,7 +35,7 @@ where
B: BlobProvider + Clone + Debug,
{
/// Creates a new factory.
- pub fn new(provider: C, blobs: B, cfg: RollupConfig) -> Self {
+ pub fn new(provider: C, blobs: B, cfg: &RollupConfig) -> Self {
Self {
chain_provider: provider,
blob_provider: blobs,
diff --git a/crates/derive/src/stages/attributes_queue.rs b/crates/derive/src/stages/attributes_queue.rs
index 9db254334f..286b2c361f 100644
--- a/crates/derive/src/stages/attributes_queue.rs
+++ b/crates/derive/src/stages/attributes_queue.rs
@@ -163,7 +163,7 @@ where
T: TelemetryProvider + Send + Debug,
AB: AttributesBuilder + Send + Debug,
{
- async fn reset(&mut self, _: BlockInfo, _: SystemConfig) -> StageResult<()> {
+ async fn reset(&mut self, _: BlockInfo, _: &SystemConfig) -> StageResult<()> {
self.telemetry.write(Bytes::from("resetting attributes queue"), LogLevel::Info);
// TODO: metrice the reset using telemetry
// telemetry can provide a method of logging and metricing
diff --git a/crates/derive/src/stages/batch_queue.rs b/crates/derive/src/stages/batch_queue.rs
index 6e98099327..7c51800622 100644
--- a/crates/derive/src/stages/batch_queue.rs
+++ b/crates/derive/src/stages/batch_queue.rs
@@ -382,7 +382,7 @@ where
BF: SafeBlockFetcher + Send + Debug,
T: TelemetryProvider + Send + Debug + Sync,
{
- async fn reset(&mut self, base: BlockInfo, _: SystemConfig) -> StageResult<()> {
+ async fn reset(&mut self, base: BlockInfo, _: &SystemConfig) -> StageResult<()> {
// Copy over the Origin from the next stage.
// It is set in the engine queue (two stages away)
// such that the L2 Safe Head origin is the progress.
diff --git a/crates/derive/src/stages/channel_bank.rs b/crates/derive/src/stages/channel_bank.rs
index a63a3eab18..cb50a4b794 100644
--- a/crates/derive/src/stages/channel_bank.rs
+++ b/crates/derive/src/stages/channel_bank.rs
@@ -219,7 +219,7 @@ where
P: ChannelBankProvider + OriginProvider + Send + Debug,
T: TelemetryProvider + Send + Sync + Debug,
{
- async fn reset(&mut self, _: BlockInfo, _: SystemConfig) -> StageResult<()> {
+ async fn reset(&mut self, _: BlockInfo, _: &SystemConfig) -> StageResult<()> {
self.channels.clear();
self.channel_queue = VecDeque::with_capacity(10);
Err(StageError::Eof)
diff --git a/crates/derive/src/stages/frame_queue.rs b/crates/derive/src/stages/frame_queue.rs
index 3ae37e8f8f..648f5669b2 100644
--- a/crates/derive/src/stages/frame_queue.rs
+++ b/crates/derive/src/stages/frame_queue.rs
@@ -1,16 +1,15 @@
//! This module contains the [FrameQueue] stage of the derivation pipeline.
-use core::fmt::Debug;
-
use crate::{
stages::ChannelBankProvider,
traits::{LogLevel, OriginProvider, ResettableStage, TelemetryProvider},
types::{into_frames, BlockInfo, Frame, StageError, StageResult, SystemConfig},
};
-use alloc::{boxed::Box, collections::VecDeque};
+use alloc::{boxed::Box, collections::VecDeque, sync::Arc};
use alloy_primitives::Bytes;
use anyhow::anyhow;
use async_trait::async_trait;
+use core::fmt::Debug;
/// Provides data frames for the [FrameQueue] stage.
#[async_trait]
@@ -35,7 +34,7 @@ where
/// The previous stage in the pipeline.
pub prev: P,
/// Telemetry
- pub telemetry: T,
+ pub telemetry: Arc,
/// The current frame queue.
queue: VecDeque,
}
@@ -46,7 +45,7 @@ where
T: TelemetryProvider + Debug,
{
/// Create a new [FrameQueue] stage with the given previous [L1Retrieval] stage.
- pub fn new(prev: P, telemetry: T) -> Self {
+ pub fn new(prev: P, telemetry: Arc) -> Self {
Self { prev, telemetry, queue: VecDeque::new() }
}
}
@@ -55,7 +54,7 @@ where
impl ChannelBankProvider for FrameQueue
where
P: FrameQueueProvider + OriginProvider + Send + Debug,
- T: TelemetryProvider + Send + Debug,
+ T: TelemetryProvider + Send + Debug + Sync,
{
async fn next_frame(&mut self) -> StageResult {
if self.queue.is_empty() {
@@ -107,9 +106,9 @@ where
impl
ResettableStage for FrameQueue
where
P: FrameQueueProvider + OriginProvider + Send + Debug,
- T: TelemetryProvider + Send + Debug,
+ T: TelemetryProvider + Send + Debug + Sync,
{
- async fn reset(&mut self, _: BlockInfo, _: SystemConfig) -> StageResult<()> {
+ async fn reset(&mut self, _: BlockInfo, _: &SystemConfig) -> StageResult<()> {
self.queue = VecDeque::default();
Err(StageError::Eof)
}
@@ -147,7 +146,7 @@ pub(crate) mod tests {
#[tokio::test]
async fn test_frame_queue_empty_bytes() {
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let data = vec![Ok(Bytes::from(vec![0x00]))];
let mock = MockFrameQueueProvider { data };
let mut frame_queue = FrameQueue::new(mock, telemetry);
@@ -157,7 +156,7 @@ pub(crate) mod tests {
#[tokio::test]
async fn test_frame_queue_no_frames_decoded() {
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let data = vec![Err(StageError::Eof), Ok(Bytes::default())];
let mock = MockFrameQueueProvider { data };
let mut frame_queue = FrameQueue::new(mock, telemetry);
@@ -167,7 +166,7 @@ pub(crate) mod tests {
#[tokio::test]
async fn test_frame_queue_wrong_derivation_version() {
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let data = vec![Ok(Bytes::from(vec![0x01]))];
let mock = MockFrameQueueProvider { data };
let mut frame_queue = FrameQueue::new(mock, telemetry);
@@ -177,7 +176,7 @@ pub(crate) mod tests {
#[tokio::test]
async fn test_frame_queue_frame_too_short() {
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let data = vec![Ok(Bytes::from(vec![0x00, 0x01]))];
let mock = MockFrameQueueProvider { data };
let mut frame_queue = FrameQueue::new(mock, telemetry);
@@ -188,7 +187,7 @@ pub(crate) mod tests {
#[tokio::test]
async fn test_frame_queue_single_frame() {
let data = new_encoded_test_frames(1);
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let mock = MockFrameQueueProvider { data: vec![Ok(data)] };
let mut frame_queue = FrameQueue::new(mock, telemetry);
let frame_decoded = frame_queue.next_frame().await.unwrap();
@@ -200,7 +199,7 @@ pub(crate) mod tests {
#[tokio::test]
async fn test_frame_queue_multiple_frames() {
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let data = new_encoded_test_frames(3);
let mock = MockFrameQueueProvider { data: vec![Ok(data)] };
let mut frame_queue = FrameQueue::new(mock, telemetry);
diff --git a/crates/derive/src/stages/l1_retrieval.rs b/crates/derive/src/stages/l1_retrieval.rs
index c8a5e1893a..11f9783c8d 100644
--- a/crates/derive/src/stages/l1_retrieval.rs
+++ b/crates/derive/src/stages/l1_retrieval.rs
@@ -7,7 +7,7 @@ use crate::{
},
types::{BlockInfo, StageError, StageResult, SystemConfig},
};
-use alloc::boxed::Box;
+use alloc::{boxed::Box, sync::Arc};
use alloy_primitives::Address;
use anyhow::anyhow;
use async_trait::async_trait;
@@ -40,7 +40,7 @@ where
/// The previous stage in the pipeline.
pub prev: P,
/// Telemetry provider for the L1 retrieval stage.
- pub telemetry: T,
+ pub telemetry: Arc,
/// The data availability provider to use for the L1 retrieval stage.
pub provider: DAP,
/// The current data iterator.
@@ -55,7 +55,7 @@ where
{
/// Creates a new [L1Retrieval] stage with the previous [L1Traversal]
/// stage and given [DataAvailabilityProvider].
- pub fn new(prev: P, provider: DAP, telemetry: T) -> Self {
+ pub fn new(prev: P, provider: DAP, telemetry: Arc) -> Self {
Self { prev, telemetry, provider, data: None }
}
}
@@ -65,7 +65,7 @@ impl FrameQueueProvider for L1Retrieval
where
DAP: DataAvailabilityProvider + Send,
P: L1RetrievalProvider + OriginProvider + Send,
- T: TelemetryProvider + Send,
+ T: TelemetryProvider + Send + Sync,
{
type Item = DAP::Item;
@@ -106,9 +106,9 @@ impl ResettableStage for L1Retrieval
where
DAP: DataAvailabilityProvider + Send,
P: L1RetrievalProvider + OriginProvider + Send,
- T: TelemetryProvider + Send,
+ T: TelemetryProvider + Send + Sync,
{
- async fn reset(&mut self, base: BlockInfo, cfg: SystemConfig) -> StageResult<()> {
+ async fn reset(&mut self, base: BlockInfo, cfg: &SystemConfig) -> StageResult<()> {
self.data = Some(self.provider.open_data(&base, cfg.batcher_addr).await?);
Ok(())
}
@@ -129,7 +129,7 @@ mod tests {
let traversal = new_populated_test_traversal();
let dap = TestDAP { results: vec![] };
let telemetry = TestTelemetry::new();
- let retrieval = L1Retrieval::new(traversal, dap, telemetry);
+ let retrieval = L1Retrieval::new(traversal, dap, Arc::new(telemetry));
let expected = BlockInfo::default();
assert_eq!(retrieval.origin(), Some(&expected));
}
@@ -140,7 +140,7 @@ mod tests {
let results = vec![Err(StageError::Eof), Ok(Bytes::default())];
let dap = TestDAP { results };
let telemetry = TestTelemetry::new();
- let mut retrieval = L1Retrieval::new(traversal, dap, telemetry);
+ let mut retrieval = L1Retrieval::new(traversal, dap, Arc::new(telemetry));
assert_eq!(retrieval.data, None);
let data = retrieval.next_data().await.unwrap();
assert_eq!(data, Bytes::default());
@@ -164,7 +164,7 @@ mod tests {
// Create a new traversal with no blocks or receipts.
// This would bubble up an error if the prev stage
// (traversal) is called in the retrieval stage.
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let traversal = new_test_traversal(vec![], vec![]);
let dap = TestDAP { results: vec![] };
let mut retrieval =
@@ -182,7 +182,7 @@ mod tests {
open_data_calls: vec![(BlockInfo::default(), Address::default())],
results: vec![Err(StageError::Eof)],
};
- let telemetry = TestTelemetry::new();
+ let telemetry = Arc::new(TestTelemetry::new());
let traversal = new_populated_test_traversal();
let dap = TestDAP { results: vec![] };
let mut retrieval =
diff --git a/crates/derive/src/stages/l1_traversal.rs b/crates/derive/src/stages/l1_traversal.rs
index 9eb5defbbd..0b5f5dc4ce 100644
--- a/crates/derive/src/stages/l1_traversal.rs
+++ b/crates/derive/src/stages/l1_traversal.rs
@@ -23,7 +23,7 @@ pub struct L1Traversal {
/// The data source for the traversal stage.
data_source: Provider,
/// The telemetry provider for the traversal stage.
- telemetry: Telemetry,
+ telemetry: Arc,
/// Signals whether or not the traversal stage is complete.
done: bool,
/// The system config.
@@ -49,7 +49,7 @@ impl L1RetrievalProvider for L1Traversal
impl L1Traversal {
/// Creates a new [L1Traversal] instance.
- pub fn new(data_source: F, cfg: Arc, telemetry: T) -> Self {
+ pub fn new(data_source: F, cfg: Arc, telemetry: Arc) -> Self {
Self {
block: Some(BlockInfo::default()),
data_source,
@@ -118,11 +118,13 @@ impl OriginProvider for L1Traversal ResettableStage for L1Traversal {
- async fn reset(&mut self, base: BlockInfo, cfg: SystemConfig) -> StageResult<()> {
+impl ResettableStage
+ for L1Traversal
+{
+ async fn reset(&mut self, base: BlockInfo, cfg: &SystemConfig) -> StageResult<()> {
self.block = Some(base);
self.done = false;
- self.system_config = cfg;
+ self.system_config = *cfg;
Err(StageError::Eof)
}
}
@@ -173,7 +175,7 @@ pub(crate) mod tests {
receipts: alloc::vec::Vec,
) -> L1Traversal {
let mut provider = TestChainProvider::default();
- let telemetry = TestTelemetry::default();
+ let telemetry = Arc::new(TestTelemetry::default());
let rollup_config = RollupConfig {
l1_system_config_address: L1_SYS_CONFIG_ADDR,
..RollupConfig::default()
diff --git a/crates/derive/src/traits/ecrecover.rs b/crates/derive/src/traits/ecrecover.rs
index e20ccbdae1..94e47f18e7 100644
--- a/crates/derive/src/traits/ecrecover.rs
+++ b/crates/derive/src/traits/ecrecover.rs
@@ -35,6 +35,7 @@ impl SignedRecoverable for TxEnvelope {
TxEnvelope::Eip4844(signed_tx) => {
recover_public_key(*signed_tx.signature(), &signed_tx.signature_hash())
}
+ _ => unreachable!("Impossible case"),
}
}
}
diff --git a/crates/derive/src/traits/stages.rs b/crates/derive/src/traits/stages.rs
index 2c006de3ee..49a925905c 100644
--- a/crates/derive/src/traits/stages.rs
+++ b/crates/derive/src/traits/stages.rs
@@ -8,5 +8,5 @@ use async_trait::async_trait;
#[async_trait]
pub trait ResettableStage {
/// Resets the derivation stage to its initial state.
- async fn reset(&mut self, base: BlockInfo, cfg: SystemConfig) -> StageResult<()>;
+ async fn reset(&mut self, base: BlockInfo, cfg: &SystemConfig) -> StageResult<()>;
}
diff --git a/crates/derive/src/types/batch/mod.rs b/crates/derive/src/types/batch/mod.rs
index 3f0c6298a3..cf47aed9ea 100644
--- a/crates/derive/src/types/batch/mod.rs
+++ b/crates/derive/src/types/batch/mod.rs
@@ -17,7 +17,7 @@ pub use validity::BatchValidity;
mod span_batch;
pub use span_batch::{
- RawSpanBatch, SpanBatch, SpanBatchBits, SpanBatchBuilder, SpanBatchEip1559TransactionData,
+ RawSpanBatch, SpanBatch, SpanBatchBits, SpanBatchEip1559TransactionData,
SpanBatchEip2930TransactionData, SpanBatchElement, SpanBatchError,
SpanBatchLegacyTransactionData, SpanBatchPayload, SpanBatchPrefix, SpanBatchTransactionData,
SpanBatchTransactions, SpanDecodingError, MAX_SPAN_BATCH_SIZE,
diff --git a/crates/derive/src/types/batch/span_batch/builder.rs b/crates/derive/src/types/batch/span_batch/builder.rs
deleted file mode 100644
index ccfe2c992b..0000000000
--- a/crates/derive/src/types/batch/span_batch/builder.rs
+++ /dev/null
@@ -1,71 +0,0 @@
-//! Span Batch Builder
-
-#![allow(unused)]
-
-use crate::types::{RawSpanBatch, SingleBatch, SpanBatch, SpanBatchElement};
-use alloc::vec::Vec;
-use alloy_primitives::FixedBytes;
-
-/// The span batch builder builds a [SpanBatch] by adding
-/// [SpanBatchElement] iteratively. Provides a way to stack
-/// [SingleBatch]s and convert to [RawSpanBatch] for encoding.
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub struct SpanBatchBuilder {
- /// The genesis timestamp of the span
- genesis_timestamp: u64,
- /// The chain ID of the span
- chain_id: u64,
- /// The span batch
- span_batch: SpanBatch,
- /// The origin changed bit
- origin_changed_bit: u8,
-}
-
-impl SpanBatchBuilder {
- /// Create a new span batch builder
- pub fn new(genesis_timestamp: u64, chain_id: u64) -> Self {
- SpanBatchBuilder {
- genesis_timestamp,
- chain_id,
- span_batch: SpanBatch::default(),
- origin_changed_bit: 0,
- }
- }
-
- /// Gets the current lock count.
- pub fn get_block_count(&self) -> usize {
- self.span_batch.batches.len()
- }
-
- /// Resets the span batch builder.
- pub fn reset(&mut self) {
- self.span_batch = SpanBatch::default();
- self.origin_changed_bit = 0;
- }
-
- /// Returns the raw span batch ready for encoding.
- pub fn get_raw_span_batch(&self) -> RawSpanBatch {
- // self.span_batch.to_raw_span_batch(
- // self.origin_changed_bit,
- // self.genesis_timestamp,
- // self.chain_id,
- // )
- unimplemented!()
- }
-
- /// Append a singular batch to the span batch and update the origin changed bit
- pub fn append_singular_batch(&mut self, _singular_batch: &SingleBatch, _seq_num: u64) {
- // if self.get_block_count() == 0 {
- // self.origin_changed_bit = 0;
- // if seq_num == 0 {
- // self.origin_changed_bit = 1;
- // }
- // }
- // self.span_batch.batches.push(SpanBatchElement {
- // epoch_num: singular_batch.epoch_num,
- // timestamp: singular_batch.timestamp,
- // transactions: singular_batch.transactions.clone(),
- // });
- unimplemented!()
- }
-}
diff --git a/crates/derive/src/types/batch/span_batch/mod.rs b/crates/derive/src/types/batch/span_batch/mod.rs
index 11cf60401b..c266058482 100644
--- a/crates/derive/src/types/batch/span_batch/mod.rs
+++ b/crates/derive/src/types/batch/span_batch/mod.rs
@@ -38,9 +38,6 @@ pub use raw::RawSpanBatch;
mod element;
pub use element::SpanBatchElement;
-mod builder;
-pub use builder::SpanBatchBuilder;
-
mod signature;
pub(crate) use signature::SpanBatchSignature;
diff --git a/crates/derive/src/types/batch/span_batch/transactions.rs b/crates/derive/src/types/batch/span_batch/transactions.rs
index 8d1be24d01..815a822a07 100644
--- a/crates/derive/src/types/batch/span_batch/transactions.rs
+++ b/crates/derive/src/types/batch/span_batch/transactions.rs
@@ -360,7 +360,9 @@ impl SpanBatchTransactions {
self.y_parity_bits.set_bit((i + offset) as usize, y_parity_bit);
self.tx_nonces.push(nonce);
self.tx_datas.push(tx_data_buf);
- self.tx_gases.push(gas);
+ self.tx_gases.push(gas.try_into().map_err(|_| {
+ SpanBatchError::Decoding(SpanDecodingError::InvalidTransactionData)
+ })?);
self.tx_types.push(tx_type);
}
self.total_block_tx_count += total_block_tx_count;
diff --git a/crates/derive/src/types/batch/span_batch/tx_data/eip1559.rs b/crates/derive/src/types/batch/span_batch/tx_data/eip1559.rs
index 6707e70780..d0e05a6dca 100644
--- a/crates/derive/src/types/batch/span_batch/tx_data/eip1559.rs
+++ b/crates/derive/src/types/batch/span_batch/tx_data/eip1559.rs
@@ -44,7 +44,7 @@ impl SpanBatchEip1559TransactionData {
|_| SpanBatchError::Decoding(SpanDecodingError::InvalidTransactionData),
)?,
),
- gas_limit: gas,
+ gas_limit: gas as u128,
to: if let Some(to) = to { TxKind::Call(to) } else { TxKind::Create },
value: self.value,
input: self.data.clone().into(),
diff --git a/crates/derive/src/types/batch/span_batch/tx_data/eip2930.rs b/crates/derive/src/types/batch/span_batch/tx_data/eip2930.rs
index 5024c31a96..d9e7885762 100644
--- a/crates/derive/src/types/batch/span_batch/tx_data/eip2930.rs
+++ b/crates/derive/src/types/batch/span_batch/tx_data/eip2930.rs
@@ -37,7 +37,7 @@ impl SpanBatchEip2930TransactionData {
SpanBatchError::Decoding(SpanDecodingError::InvalidTransactionData)
})?,
),
- gas_limit: gas,
+ gas_limit: gas as u128,
to: if let Some(to) = to { TxKind::Call(to) } else { TxKind::Create },
value: self.value,
input: self.data.clone().into(),
diff --git a/crates/derive/src/types/batch/span_batch/tx_data/legacy.rs b/crates/derive/src/types/batch/span_batch/tx_data/legacy.rs
index 112e619c51..6aaa6e4ac4 100644
--- a/crates/derive/src/types/batch/span_batch/tx_data/legacy.rs
+++ b/crates/derive/src/types/batch/span_batch/tx_data/legacy.rs
@@ -34,7 +34,7 @@ impl SpanBatchLegacyTransactionData {
SpanBatchError::Decoding(SpanDecodingError::InvalidTransactionData)
})?,
),
- gas_limit: gas,
+ gas_limit: gas as u128,
to: if let Some(to) = to { TxKind::Call(to) } else { TxKind::Create },
value: self.value,
input: self.data.clone().into(),
diff --git a/crates/derive/src/types/mod.rs b/crates/derive/src/types/mod.rs
index d4f359eaf1..5efa146760 100644
--- a/crates/derive/src/types/mod.rs
+++ b/crates/derive/src/types/mod.rs
@@ -19,10 +19,10 @@ pub use rollup_config::RollupConfig;
pub mod batch;
pub use batch::{
Batch, BatchType, BatchValidity, BatchWithInclusionBlock, RawSpanBatch, SingleBatch, SpanBatch,
- SpanBatchBits, SpanBatchBuilder, SpanBatchEip1559TransactionData,
- SpanBatchEip2930TransactionData, SpanBatchElement, SpanBatchError,
- SpanBatchLegacyTransactionData, SpanBatchPayload, SpanBatchPrefix, SpanBatchTransactionData,
- SpanBatchTransactions, SpanDecodingError, MAX_SPAN_BATCH_SIZE,
+ SpanBatchBits, SpanBatchEip1559TransactionData, SpanBatchEip2930TransactionData,
+ SpanBatchElement, SpanBatchError, SpanBatchLegacyTransactionData, SpanBatchPayload,
+ SpanBatchPrefix, SpanBatchTransactionData, SpanBatchTransactions, SpanDecodingError,
+ MAX_SPAN_BATCH_SIZE,
};
mod payload;