mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
add debug_chainConfig endpoint (#14346)
This commit is contained in:
@ -32,6 +32,7 @@ alloy-rpc-types-admin.workspace = true
|
||||
alloy-serde.workspace = true
|
||||
alloy-rpc-types-beacon.workspace = true
|
||||
alloy-rpc-types-engine.workspace = true
|
||||
alloy-genesis.workspace = true
|
||||
|
||||
# misc
|
||||
jsonrpsee = { workspace = true, features = ["server", "macros"] }
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use alloy_eips::{BlockId, BlockNumberOrTag};
|
||||
use alloy_genesis::ChainConfig;
|
||||
use alloy_primitives::{Address, Bytes, B256};
|
||||
use alloy_rpc_types_debug::ExecutionWitness;
|
||||
use alloy_rpc_types_eth::{transaction::TransactionRequest, Block, Bundle, StateContext};
|
||||
@ -186,6 +187,10 @@ pub trait DebugApi {
|
||||
#[method(name = "chaindbCompact")]
|
||||
async fn debug_chaindb_compact(&self) -> RpcResult<()>;
|
||||
|
||||
/// Returns the current chain config.
|
||||
#[method(name = "chainConfig")]
|
||||
async fn debug_chain_config(&self) -> RpcResult<ChainConfig>;
|
||||
|
||||
/// Returns leveldb properties of the key-value database.
|
||||
#[method(name = "chaindbProperty")]
|
||||
async fn debug_chaindb_property(&self, property: String) -> RpcResult<()>;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
use alloy_consensus::BlockHeader;
|
||||
use alloy_eips::{eip2718::Encodable2718, BlockId, BlockNumberOrTag};
|
||||
use alloy_genesis::ChainConfig;
|
||||
use alloy_primitives::{Address, Bytes, B256, U256};
|
||||
use alloy_rlp::{Decodable, Encodable};
|
||||
use alloy_rpc_types_debug::ExecutionWitness;
|
||||
@ -14,7 +15,7 @@ use alloy_rpc_types_trace::geth::{
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use jsonrpsee::core::RpcResult;
|
||||
use reth_chainspec::EthereumHardforks;
|
||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||
use reth_evm::{
|
||||
env::EvmEnv,
|
||||
execute::{BlockExecutorProvider, Executor},
|
||||
@ -1035,6 +1036,10 @@ where
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn debug_chain_config(&self) -> RpcResult<ChainConfig> {
|
||||
Ok(self.provider().chain_spec().genesis().config.clone())
|
||||
}
|
||||
|
||||
async fn debug_chaindb_property(&self, _property: String) -> RpcResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user