mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-12 07:55:11 -05:00
chore(rpc): remove include_preimage param on debug_execution_witness (#11466)
This commit is contained in:
@@ -170,12 +170,8 @@ where
|
||||
if let Some(healthy_node_client) = &self.healthy_node_client {
|
||||
// Compare the witness against the healthy node.
|
||||
let healthy_node_witness = futures::executor::block_on(async move {
|
||||
DebugApiClient::debug_execution_witness(
|
||||
healthy_node_client,
|
||||
block.number.into(),
|
||||
true,
|
||||
)
|
||||
.await
|
||||
DebugApiClient::debug_execution_witness(healthy_node_client, block.number.into())
|
||||
.await
|
||||
})?;
|
||||
|
||||
let healthy_path = self.save_file(
|
||||
|
||||
@@ -140,11 +140,8 @@ pub trait DebugApi {
|
||||
/// The first argument is the block number or block hash. The second argument is a boolean
|
||||
/// indicating whether to include the preimages of keys in the response.
|
||||
#[method(name = "executionWitness")]
|
||||
async fn debug_execution_witness(
|
||||
&self,
|
||||
block: BlockNumberOrTag,
|
||||
include_preimages: bool,
|
||||
) -> RpcResult<ExecutionWitness>;
|
||||
async fn debug_execution_witness(&self, block: BlockNumberOrTag)
|
||||
-> RpcResult<ExecutionWitness>;
|
||||
|
||||
/// Sets the logging backtrace location. When a backtrace location is set and a log message is
|
||||
/// emitted at that location, the stack of the goroutine executing the log statement will
|
||||
|
||||
@@ -603,7 +603,6 @@ where
|
||||
pub async fn debug_execution_witness(
|
||||
&self,
|
||||
block_id: BlockNumberOrTag,
|
||||
include_preimages: bool,
|
||||
) -> Result<ExecutionWitness, Eth::Error> {
|
||||
let this = self.clone();
|
||||
let block = this
|
||||
@@ -622,6 +621,7 @@ where
|
||||
let mut hashed_state = HashedPostState::default();
|
||||
let mut keys = HashMap::default();
|
||||
let mut codes = HashMap::default();
|
||||
|
||||
let _ = block_executor
|
||||
.execute_with_state_witness(
|
||||
(&block.clone().unseal(), block.difficulty).into(),
|
||||
@@ -646,24 +646,14 @@ where
|
||||
);
|
||||
|
||||
if let Some(account) = &account.account {
|
||||
if include_preimages {
|
||||
keys.insert(
|
||||
hashed_address,
|
||||
alloy_rlp::encode(address).into(),
|
||||
);
|
||||
}
|
||||
keys.insert(hashed_address, address.to_vec().into());
|
||||
|
||||
for (slot, value) in &account.storage {
|
||||
let slot = B256::from(*slot);
|
||||
let hashed_slot = keccak256(slot);
|
||||
storage.storage.insert(hashed_slot, *value);
|
||||
|
||||
if include_preimages {
|
||||
keys.insert(
|
||||
hashed_slot,
|
||||
alloy_rlp::encode(slot).into(),
|
||||
);
|
||||
}
|
||||
keys.insert(hashed_slot, slot.into());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -676,7 +666,7 @@ where
|
||||
Ok(ExecutionWitness {
|
||||
state: HashMap::from_iter(state.into_iter()),
|
||||
codes,
|
||||
keys: include_preimages.then_some(keys),
|
||||
keys: Some(keys),
|
||||
})
|
||||
})
|
||||
.await
|
||||
@@ -974,10 +964,9 @@ where
|
||||
async fn debug_execution_witness(
|
||||
&self,
|
||||
block: BlockNumberOrTag,
|
||||
include_preimages: bool,
|
||||
) -> RpcResult<ExecutionWitness> {
|
||||
let _permit = self.acquire_trace_permit().await;
|
||||
Self::debug_execution_witness(self, block, include_preimages).await.map_err(Into::into)
|
||||
Self::debug_execution_witness(self, block).await.map_err(Into::into)
|
||||
}
|
||||
|
||||
/// Handler for `debug_traceCall`
|
||||
|
||||
Reference in New Issue
Block a user