From 90b313f476e429102269e9649bba57d8663843bb Mon Sep 17 00:00:00 2001 From: Dmitry Savonin Date: Thu, 9 Nov 2023 00:56:41 +0300 Subject: [PATCH] reverted historical proofs --- crates/rpc/rpc/src/eth/api/state.rs | 6 +++--- crates/storage/provider/src/providers/state/historical.rs | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/rpc/rpc/src/eth/api/state.rs b/crates/rpc/rpc/src/eth/api/state.rs index 7b7816187..4cf4a69a6 100644 --- a/crates/rpc/rpc/src/eth/api/state.rs +++ b/crates/rpc/rpc/src/eth/api/state.rs @@ -103,9 +103,9 @@ where }; // TODO: remove when HistoricalStateProviderRef::proof is implemented - // if !is_latest_block { - // return Err(EthApiError::InvalidBlockRange) - // } + if !is_latest_block { + return Err(EthApiError::InvalidBlockRange) + } let this = self.clone(); self.inner diff --git a/crates/storage/provider/src/providers/state/historical.rs b/crates/storage/provider/src/providers/state/historical.rs index d9796da15..d91d2f589 100644 --- a/crates/storage/provider/src/providers/state/historical.rs +++ b/crates/storage/provider/src/providers/state/historical.rs @@ -10,7 +10,7 @@ use reth_db::{ transaction::DbTx, BlockNumberList, }; -use reth_interfaces::{RethError, RethResult}; +use reth_interfaces::RethResult; use reth_primitives::{ trie::AccountProof, Account, Address, BlockNumber, Bytecode, StorageKey, StorageValue, B256, }; @@ -240,10 +240,8 @@ impl<'b, TX: DbTx> StateProvider for HistoricalStateProviderRef<'b, TX> { } /// Get account and storage proofs. - fn proof(&self, address: Address, keys: &[B256]) -> RethResult { - let proof = reth_trie::proof::Proof::new(self.tx); - proof.account_proof(address, keys) - .map_err(|_| RethError::Custom("proof generation failed".to_string())) + fn proof(&self, _address: Address, _keys: &[B256]) -> RethResult { + Err(ProviderError::StateRootNotAvailableForHistoricalBlock.into()) } }