fix(rpc): apply blockhashes update in witness RPC (#10419)

This commit is contained in:
Alexey Shekhirin
2024-08-21 15:49:07 +01:00
committed by GitHub
parent 5a522c81fb
commit 7a7c1c5b59

View File

@@ -10,7 +10,7 @@ use reth_provider::{
BlockReaderIdExt, ChainSpecProvider, EvmEnvProvider, HeaderProvider, StateProofProvider,
StateProviderFactory, TransactionVariant,
};
use reth_revm::database::StateProviderDatabase;
use reth_revm::{database::StateProviderDatabase, state_change::apply_blockhashes_update};
use reth_rpc_api::DebugApiServer;
use reth_rpc_eth_api::{
helpers::{Call, EthApiSpec, EthTransactions, TraceExt},
@@ -589,6 +589,16 @@ where
)
.map_err(|err| EthApiError::Internal(err.into()))?;
// apply eip-2935 blockhashes update
apply_blockhashes_update(
&mut db,
&this.inner.provider.chain_spec(),
block.timestamp,
block.number,
block.parent_hash,
)
.map_err(|err| EthApiError::Internal(err.into()))?;
// Re-execute all of the transactions in the block to load all touched accounts into
// the cache DB.
for tx in block.raw_transactions() {