mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat: add canonical_headers_range (#1795)
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user