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:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8965,6 +8965,7 @@ name = "reth-rpc-api"
|
|||||||
version = "1.1.5"
|
version = "1.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy-eips",
|
"alloy-eips",
|
||||||
|
"alloy-genesis",
|
||||||
"alloy-json-rpc",
|
"alloy-json-rpc",
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"alloy-rpc-types",
|
"alloy-rpc-types",
|
||||||
|
|||||||
@ -32,6 +32,7 @@ alloy-rpc-types-admin.workspace = true
|
|||||||
alloy-serde.workspace = true
|
alloy-serde.workspace = true
|
||||||
alloy-rpc-types-beacon.workspace = true
|
alloy-rpc-types-beacon.workspace = true
|
||||||
alloy-rpc-types-engine.workspace = true
|
alloy-rpc-types-engine.workspace = true
|
||||||
|
alloy-genesis.workspace = true
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
jsonrpsee = { workspace = true, features = ["server", "macros"] }
|
jsonrpsee = { workspace = true, features = ["server", "macros"] }
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
use alloy_eips::{BlockId, BlockNumberOrTag};
|
use alloy_eips::{BlockId, BlockNumberOrTag};
|
||||||
|
use alloy_genesis::ChainConfig;
|
||||||
use alloy_primitives::{Address, Bytes, B256};
|
use alloy_primitives::{Address, Bytes, B256};
|
||||||
use alloy_rpc_types_debug::ExecutionWitness;
|
use alloy_rpc_types_debug::ExecutionWitness;
|
||||||
use alloy_rpc_types_eth::{transaction::TransactionRequest, Block, Bundle, StateContext};
|
use alloy_rpc_types_eth::{transaction::TransactionRequest, Block, Bundle, StateContext};
|
||||||
@ -186,6 +187,10 @@ pub trait DebugApi {
|
|||||||
#[method(name = "chaindbCompact")]
|
#[method(name = "chaindbCompact")]
|
||||||
async fn debug_chaindb_compact(&self) -> RpcResult<()>;
|
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.
|
/// Returns leveldb properties of the key-value database.
|
||||||
#[method(name = "chaindbProperty")]
|
#[method(name = "chaindbProperty")]
|
||||||
async fn debug_chaindb_property(&self, property: String) -> RpcResult<()>;
|
async fn debug_chaindb_property(&self, property: String) -> RpcResult<()>;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
use alloy_consensus::BlockHeader;
|
use alloy_consensus::BlockHeader;
|
||||||
use alloy_eips::{eip2718::Encodable2718, BlockId, BlockNumberOrTag};
|
use alloy_eips::{eip2718::Encodable2718, BlockId, BlockNumberOrTag};
|
||||||
|
use alloy_genesis::ChainConfig;
|
||||||
use alloy_primitives::{Address, Bytes, B256, U256};
|
use alloy_primitives::{Address, Bytes, B256, U256};
|
||||||
use alloy_rlp::{Decodable, Encodable};
|
use alloy_rlp::{Decodable, Encodable};
|
||||||
use alloy_rpc_types_debug::ExecutionWitness;
|
use alloy_rpc_types_debug::ExecutionWitness;
|
||||||
@ -14,7 +15,7 @@ use alloy_rpc_types_trace::geth::{
|
|||||||
};
|
};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use jsonrpsee::core::RpcResult;
|
use jsonrpsee::core::RpcResult;
|
||||||
use reth_chainspec::EthereumHardforks;
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_evm::{
|
use reth_evm::{
|
||||||
env::EvmEnv,
|
env::EvmEnv,
|
||||||
execute::{BlockExecutorProvider, Executor},
|
execute::{BlockExecutorProvider, Executor},
|
||||||
@ -1035,6 +1036,10 @@ where
|
|||||||
Ok(())
|
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<()> {
|
async fn debug_chaindb_property(&self, _property: String) -> RpcResult<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user