fix: add debug namespace to auth module in op-reth (#15048)

This commit is contained in:
Alessandro Mazza
2025-03-14 21:06:42 +01:00
committed by GitHub
parent 8d43d6d770
commit 2882991173
5 changed files with 20 additions and 6 deletions

View File

@@ -42,6 +42,7 @@ use reth_optimism_rpc::{
};
use reth_optimism_txpool::{conditional::MaybeConditionalTransaction, OpPooledTx};
use reth_provider::{providers::ProviderFactoryBuilder, CanonStateSubscriptions, EthStorage};
use reth_rpc_api::DebugApiServer;
use reth_rpc_eth_api::ext::L2EthApiExtServer;
use reth_rpc_eth_types::error::FromEvmError;
use reth_rpc_server_types::RethRpcModule;
@@ -309,8 +310,9 @@ where
ctx.node.pool().clone(),
ctx.node.provider().clone(),
);
rpc_add_ons
.launch_add_ons_with(ctx, move |modules, auth_modules| {
.launch_add_ons_with(ctx, move |modules, auth_modules, registry| {
debug!(target: "reth::cli", "Installing debug payload witness rpc endpoint");
modules.merge_if_module_configured(RethRpcModule::Debug, debug_ext.into_rpc())?;
@@ -322,10 +324,16 @@ where
// install the miner extension in the authenticated if configured
if modules.module_config().contains_any(&RethRpcModule::Miner) {
debug!(target: "reth::cli", "Installing miner DA rpc enddpoint");
debug!(target: "reth::cli", "Installing miner DA rpc endpoint");
auth_modules.merge_auth_methods(miner_ext.into_rpc())?;
}
// install the debug namespace in the authenticated if configured
if modules.module_config().contains_any(&RethRpcModule::Debug) {
debug!(target: "reth::cli", "Installing debug rpc endpoint");
auth_modules.merge_auth_methods(registry.debug_api().into_rpc())?;
}
if enable_tx_conditional {
// extend the eth namespace if configured in the regular http server
modules.merge_if_module_configured(