diff --git a/crates/consensus/beacon/src/engine/hooks/static_file.rs b/crates/consensus/beacon/src/engine/hooks/static_file.rs index b4b38239a03f..99387492c3bf 100644 --- a/crates/consensus/beacon/src/engine/hooks/static_file.rs +++ b/crates/consensus/beacon/src/engine/hooks/static_file.rs @@ -36,7 +36,11 @@ where Provider: StaticFileProviderFactory + DatabaseProviderFactory< Provider: StaticFileProviderFactory< - Primitives: NodePrimitives, + Primitives: NodePrimitives< + SignedTx: Value + Compact, + BlockHeader: Value + Compact, + Receipt: Value + Compact, + >, > + StageCheckpointReader + BlockReader + ChainStateBlockReader, @@ -152,7 +156,11 @@ where Provider: StaticFileProviderFactory + DatabaseProviderFactory< Provider: StaticFileProviderFactory< - Primitives: NodePrimitives, + Primitives: NodePrimitives< + SignedTx: Value + Compact, + BlockHeader: Value + Compact, + Receipt: Value + Compact, + >, > + StageCheckpointReader + BlockReader + ChainStateBlockReader, diff --git a/crates/static-file/static-file/src/segments/receipts.rs b/crates/static-file/static-file/src/segments/receipts.rs index bd808b4d839b..1490fb152241 100644 --- a/crates/static-file/static-file/src/segments/receipts.rs +++ b/crates/static-file/static-file/src/segments/receipts.rs @@ -1,7 +1,9 @@ use crate::segments::Segment; use alloy_primitives::BlockNumber; -use reth_db::tables; +use reth_codecs::Compact; +use reth_db::{table::Value, tables}; use reth_db_api::{cursor::DbCursorRO, transaction::DbTx}; +use reth_primitives_traits::NodePrimitives; use reth_provider::{ providers::StaticFileWriter, BlockReader, DBProvider, StaticFileProviderFactory, }; @@ -13,8 +15,11 @@ use std::ops::RangeInclusive; #[derive(Debug, Default)] pub struct Receipts; -impl Segment - for Receipts +impl Segment for Receipts +where + Provider: StaticFileProviderFactory> + + DBProvider + + BlockReader, { fn segment(&self) -> StaticFileSegment { StaticFileSegment::Receipts @@ -36,7 +41,10 @@ impl Segment()?; + let mut receipts_cursor = provider + .tx_ref() + .cursor_read::::Receipt>>( + )?; let receipts_walker = receipts_cursor.walk_range(block_body_indices.tx_num_range())?; static_file_writer.append_receipts( diff --git a/crates/static-file/static-file/src/static_file_producer.rs b/crates/static-file/static-file/src/static_file_producer.rs index 30a72561b235..66b01235a5d8 100644 --- a/crates/static-file/static-file/src/static_file_producer.rs +++ b/crates/static-file/static-file/src/static_file_producer.rs @@ -90,7 +90,11 @@ where Provider: StaticFileProviderFactory + DatabaseProviderFactory< Provider: StaticFileProviderFactory< - Primitives: NodePrimitives, + Primitives: NodePrimitives< + SignedTx: Value + Compact, + BlockHeader: Value + Compact, + Receipt: Value + Compact, + >, > + StageCheckpointReader + BlockReader, >, diff --git a/crates/storage/provider/src/providers/static_file/writer.rs b/crates/storage/provider/src/providers/static_file/writer.rs index b7f60c164423..3939e8b89456 100644 --- a/crates/storage/provider/src/providers/static_file/writer.rs +++ b/crates/storage/provider/src/providers/static_file/writer.rs @@ -11,7 +11,7 @@ use reth_nippy_jar::{NippyJar, NippyJarError, NippyJarWriter}; use reth_node_types::NodePrimitives; use reth_primitives::{ static_file::{SegmentHeader, SegmentRangeInclusive}, - Receipt, StaticFileSegment, + StaticFileSegment, }; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ @@ -615,7 +615,8 @@ impl StaticFileProviderRW { pub fn append_receipts(&mut self, receipts: I) -> ProviderResult> where I: Iterator>, - R: Borrow, + R: Borrow, + N::Receipt: Compact, { debug_assert!(self.writer.user_header().segment() == StaticFileSegment::Receipts);