Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
voidash committed Jan 15, 2025
1 parent f051ebf commit 3c93646
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/storage/provider/src/providers/consistent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,15 +630,15 @@ impl<N: ProviderNodeTypes> HeaderProvider for ConsistentProvider<N> {
self.get_in_memory_or_storage_by_block(
(*block_hash).into(),
|db_provider| db_provider.header(block_hash),
|block_state| Ok(Some(block_state.block_ref().recovered_block().header().clone())),
|block_state| Ok(Some(block_state.block_ref().recovered_block().clone_header())),
)
}

fn header_by_number(&self, num: BlockNumber) -> ProviderResult<Option<Self::Header>> {
self.get_in_memory_or_storage_by_block(
num.into(),
|db_provider| db_provider.header_by_number(num),
|block_state| Ok(Some(block_state.block_ref().recovered_block().header().clone())),
|block_state| Ok(Some(block_state.block_ref().recovered_block().clone_header())),
)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/storage/provider/src/writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ where
// Insert the blocks
for ExecutedBlock { recovered_block, execution_output, hashed_state, trie } in blocks {
self.database()
.insert_block(recovered_block.as_ref().clone(), StorageLocation::Both)?;
.insert_block(Arc::unwrap_or_clone(recovered_block), StorageLocation::Both)?;

// Write state and changesets to the database.
// Must be written after blocks because of the receipt lookup.
Expand Down

0 comments on commit 3c93646

Please sign in to comment.