mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat: introduce debug witness api (#12567)
Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
@ -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>;
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user