Skip to content

Commit

Permalink
reverted historical proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry123 committed Nov 8, 2023
1 parent caf5bee commit 90b313f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions crates/rpc/rpc/src/eth/api/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions crates/storage/provider/src/providers/state/historical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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<AccountProof> {
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<AccountProof> {
Err(ProviderError::StateRootNotAvailableForHistoricalBlock.into())
}
}

Expand Down

0 comments on commit 90b313f

Please sign in to comment.