feat: add canonical_headers_range (#1795)

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
Matthias Seitz
2023-03-17 01:06:32 +01:00
committed by GitHub
parent 57894f7b98
commit 241ec32abf
16 changed files with 114 additions and 49 deletions

View File

@ -462,7 +462,7 @@ impl<Client: HeaderProvider + BlockProvider + StateProviderFactory + EvmEnvProvi
}
// Attempt to look up terminal block hash
let local_hash = self.client.block_hash(U256::from(terminal_block_number.as_u64()))?;
let local_hash = self.client.block_hash(terminal_block_number.as_u64())?;
// Transition configuration exchange is successful if block hashes match
match local_hash {

View File

@ -310,8 +310,7 @@ where
}
}
let oldest_block_hash =
self.inner.client.block_hash(start_block.try_into().unwrap()).to_rpc_result()?.unwrap();
let oldest_block_hash = self.inner.client.block_hash(start_block).to_rpc_result()?.unwrap();
fee_history_cache_items.get_mut(&start_block).unwrap().hash = Some(oldest_block_hash);
fee_history_cache.get_mut(&start_block).unwrap().hash = Some(oldest_block_hash);

View File

@ -5,10 +5,7 @@ use crate::{
};
use async_trait::async_trait;
use jsonrpsee::{core::RpcResult, server::IdProvider};
use reth_primitives::{
filter::{Filter, FilterBlockOption, FilteredParams},
U256,
};
use reth_primitives::filter::{Filter, FilterBlockOption, FilteredParams};
use reth_provider::{BlockProvider, EvmEnvProvider};
use reth_rpc_api::EthFilterApiServer;
use reth_rpc_types::{FilterChanges, FilterId, Log};
@ -96,7 +93,7 @@ where
let block_hash = self
.inner
.client
.block_hash(U256::from(block_num))
.block_hash(block_num)
.to_rpc_result()?
.ok_or(EthApiError::UnknownBlockNumber)?;
block_hashes.push(block_hash);