Skip to content

Commit

Permalink
feat(provider): BlockReader::sealed_block_with_senders_range (#8750)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored and emhane committed Jun 13, 2024
1 parent a37d044 commit 34d8d0b
Show file tree
Hide file tree
Showing 9 changed files with 297 additions and 177 deletions.
6 changes: 6 additions & 0 deletions crates/primitives/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ pub struct Header {
pub extra_data: Bytes,
}

impl AsRef<Self> for Header {
fn as_ref(&self) -> &Self {
self
}
}

impl Default for Header {
fn default() -> Self {
Self {
Expand Down
2 changes: 1 addition & 1 deletion crates/stages/stages/src/stages/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ where
// Prepare the input for post unwind commit hook, where an `ExExNotification` will be sent.
if self.exex_manager_handle.has_exexs() {
// Get the blocks for the unwound range.
let blocks = provider.get_take_block_range::<false>(range.clone())?;
let blocks = provider.sealed_block_with_senders_range(range.clone())?;
let previous_input = self.post_unwind_commit_input.replace(Chain::new(
blocks,
bundle_state_with_receipts,
Expand Down
7 changes: 7 additions & 0 deletions crates/storage/provider/src/providers/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,13 @@ impl<DB: Database> BlockReader for ProviderFactory<DB> {
) -> ProviderResult<Vec<BlockWithSenders>> {
self.provider()?.block_with_senders_range(range)
}

fn sealed_block_with_senders_range(
&self,
range: RangeInclusive<BlockNumber>,
) -> ProviderResult<Vec<SealedBlockWithSenders>> {
self.provider()?.sealed_block_with_senders_range(range)
}
}

impl<DB: Database> TransactionsProvider for ProviderFactory<DB> {
Expand Down
Loading

0 comments on commit 34d8d0b

Please sign in to comment.