mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-05 12:34:57 -05:00
fix(rpc): add missing codes for witness (#11673)
This commit is contained in:
@@ -34,7 +34,7 @@ use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
|
||||
use reth_tasks::pool::BlockingTaskGuard;
|
||||
use reth_trie::{HashedPostState, HashedStorage};
|
||||
use revm::{
|
||||
db::CacheDB,
|
||||
db::{CacheDB, State},
|
||||
primitives::{db::DatabaseCommit, BlockEnv, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg},
|
||||
};
|
||||
use revm_inspectors::tracing::{
|
||||
@@ -614,12 +614,23 @@ where
|
||||
let _ = block_executor
|
||||
.execute_with_state_closure(
|
||||
(&block.clone().unseal(), block.difficulty).into(),
|
||||
|statedb| {
|
||||
|statedb: &State<_>| {
|
||||
codes = statedb
|
||||
.cache
|
||||
.contracts
|
||||
.iter()
|
||||
.map(|(hash, code)| (*hash, code.original_bytes()))
|
||||
.chain(
|
||||
// cache state does not have all the contracts, especially when
|
||||
// a contract is created within the block
|
||||
// the contract only exists in bundle state, therefore we need
|
||||
// to include them as well
|
||||
statedb
|
||||
.bundle_state
|
||||
.contracts
|
||||
.iter()
|
||||
.map(|(hash, code)| (*hash, code.original_bytes())),
|
||||
)
|
||||
.collect();
|
||||
|
||||
for (address, account) in &statedb.cache.accounts {
|
||||
|
||||
Reference in New Issue
Block a user