feat: introduce debug witness api (#12567)

Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
Matthias Seitz
2024-11-15 11:54:02 +01:00
committed by GitHub
parent 72a52d5ea5
commit 305a1cee0b
2 changed files with 25 additions and 2 deletions

View File

@ -385,3 +385,26 @@ pub trait DebugApi {
#[method(name = "writeMutexProfile")]
async fn debug_write_mutex_profile(&self, file: String) -> RpcResult<()>;
}
/// An extension to the `debug_` namespace that provides additional methods for retrieving
/// witnesses.
///
/// This is separate from the regular `debug_` api, because this depends on the network specific
/// params. For optimism this will expect the optimism specific payload attributes
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "debug"))]
pub trait DebugExecutionWitnessApi<Attributes> {
/// The `debug_executePayload` method allows for re-execution of a group of transactions 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 argument is the block number or block hash. The second argument is the payload
/// attributes for the new block. The third argument is a list of transactions to be included.
#[method(name = "executePayload")]
async fn execute_payload(
&self,
parent_block_hash: B256,
attributes: Attributes,
) -> RpcResult<ExecutionWitness>;
}

View File

@ -37,7 +37,7 @@ pub use servers::*;
pub mod servers {
pub use crate::{
admin::AdminApiServer,
debug::DebugApiServer,
debug::{DebugApiServer, DebugExecutionWitnessApiServer},
engine::{EngineApiServer, EngineEthApiServer},
mev::{MevFullApiServer, MevSimApiServer},
net::NetApiServer,
@ -65,7 +65,7 @@ pub mod clients {
pub use crate::{
admin::AdminApiClient,
anvil::AnvilApiClient,
debug::DebugApiClient,
debug::{DebugApiClient, DebugExecutionWitnessApiClient},
engine::{EngineApiClient, EngineEthApiClient},
ganache::GanacheApiClient,
hardhat::HardhatApiClient,