feat(rpc): debug_executionWitness (#9249)

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
This commit is contained in:
clabby
2024-08-01 16:10:14 -04:00
committed by GitHub
parent 217c21762e
commit d5d46a8611
4 changed files with 129 additions and 6 deletions

View File

@ -7,6 +7,7 @@ use reth_rpc_types::{
},
Bundle, RichBlock, StateContext, TransactionRequest,
};
use std::collections::HashMap;
/// Debug rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))]
@ -132,6 +133,18 @@ pub trait DebugApi {
opts: Option<GethDebugTracingCallOptions>,
) -> RpcResult<Vec<Vec<GethTrace>>>;
/// The `debug_executionWitness` method allows for re-execution of a block with the purpose of
/// generating an execution witness. The witness comprises of a map of all hashed trie nodes
/// to their preimages that were required during the execution of the block, including during
/// state root recomputation.
///
/// The first and only argument is the block number or block hash.
#[method(name = "executionWitness")]
async fn debug_execution_witness(
&self,
block: BlockNumberOrTag,
) -> RpcResult<HashMap<B256, Bytes>>;
/// 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
/// be printed to stderr.