feat(storage): add an option to return hashed transactions in block_with_senders (#5095)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Thomas Coratger
2023-10-20 00:56:01 +02:00
committed by GitHub
parent 5d217a2867
commit 93e837e28a
9 changed files with 59 additions and 22 deletions

View File

@ -19,7 +19,7 @@ use reth_primitives::{
};
use reth_provider::{
BlockReader, DatabaseProviderRW, ExecutorFactory, HeaderProvider, LatestStateProviderRef,
OriginalValuesKnown, ProviderError,
OriginalValuesKnown, ProviderError, TransactionVariant,
};
use std::{
ops::RangeInclusive,
@ -144,8 +144,10 @@ impl<EF: ExecutorFactory> ExecutionStage<EF> {
let td = provider
.header_td_by_number(block_number)?
.ok_or_else(|| ProviderError::HeaderNotFound(block_number.into()))?;
// we need the block's transactions but we don't need the transaction hashes
let block = provider
.block_with_senders(block_number)?
.block_with_senders(block_number, TransactionVariant::NoHash)?
.ok_or_else(|| ProviderError::BlockNotFound(block_number.into()))?;
fetch_block_duration += time.elapsed();