Skip to content

Commit 8ff01e4

Browse files
committed
feat: improve rpc namespace
1 parent aaf8985 commit 8ff01e4

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

crates/node/src/add_ons/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ where
134134
let (tx, rx) = tokio::sync::oneshot::channel();
135135
let rpc_config = rollup_node_manager_addon.config().rpc_args.clone();
136136

137-
// Register rollupNode API and optionally rollupNodeAdmin API
137+
// Register rollupNode API and rollupNodeAdmin API if enabled
138138
let rollup_node_rpc_ext = Arc::new(RollupNodeRpcExt::<N::Network>::new(rx));
139139

140140
rpc_add_ons = rpc_add_ons.extend_rpc_modules(move |ctx| {
141141
// Always register rollupNode API (read-only operations)
142-
if rpc_config.enabled {
142+
if rpc_config.basic_enabled {
143143
ctx.modules
144144
.merge_configured(RollupNodeApiServer::into_rpc(rollup_node_rpc_ext.clone()))?;
145145
}
@@ -156,7 +156,7 @@ where
156156
rollup_node_manager_addon.launch(ctx.clone(), rpc_handle.clone()).await?;
157157

158158
// Only send handle if RPC is enabled
159-
if rpc_config.enabled || rpc_config.admin_enabled {
159+
if rpc_config.basic_enabled || rpc_config.admin_enabled {
160160
tx.send(rollup_manager_handle.clone())
161161
.map_err(|_| eyre::eyre!("failed to send rollup manager handle"))?;
162162
}

crates/node/src/add_ons/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ where
5959
}
6060
}
6161

62-
/// Defines the `rollupNode` JSON-RPC namespace for read-only operations.
62+
/// Defines the `rollupNode` JSON-RPC namespace for basic operations.
6363
///
6464
/// This trait provides a custom RPC namespace that exposes rollup node status
6565
/// and query functionality to external clients. The namespace is exposed as `rollupNode`.

crates/node/src/args.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,9 @@ pub struct SignerArgs {
751751
/// The arguments for the rpc.
752752
#[derive(Debug, Default, Clone, clap::Args)]
753753
pub struct RpcArgs {
754-
/// A boolean to represent if the rollup node rpc should be enabled.
755-
#[arg(long = "rpc.rollup-node", num_args=0..=1, default_value_t = true, help = "Enable the rollup node RPC namespace(default: true)")]
756-
pub enabled: bool,
754+
/// A boolean to represent if the rollup node basic rpc should be enabled.
755+
#[arg(long = "rpc.rollup-node", num_args=0..=1, default_value_t = true, help = "Enable the rollup node basic RPC namespace(default: true)")]
756+
pub basic_enabled: bool,
757757
/// A boolean to represent if the rollup node admin rpc should be enabled.
758758
#[arg(long = "rpc.rollup-node-admin", help = "Enable the rollup node admin RPC namespace")]
759759
pub admin_enabled: bool,

crates/node/src/test_utils/fixture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl TestFixtureBuilder {
253253
gas_price_oracle_args: RollupNodeGasPriceOracleArgs::default(),
254254
consensus_args: ConsensusArgs::noop(),
255255
database: None,
256-
rpc_args: RpcArgs { enabled: true, admin_enabled: true },
256+
rpc_args: RpcArgs { basic_enabled: true, admin_enabled: true },
257257
}
258258
}
259259

crates/node/src/test_utils/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub fn default_test_scroll_rollup_node_config() -> ScrollRollupNodeConfig {
239239
gas_price_oracle_args: crate::RollupNodeGasPriceOracleArgs::default(),
240240
consensus_args: ConsensusArgs::noop(),
241241
database: None,
242-
rpc_args: RpcArgs { enabled: true, admin_enabled: true },
242+
rpc_args: RpcArgs { basic_enabled: true, admin_enabled: true },
243243
}
244244
}
245245

@@ -279,6 +279,6 @@ pub fn default_sequencer_test_scroll_rollup_node_config() -> ScrollRollupNodeCon
279279
gas_price_oracle_args: crate::RollupNodeGasPriceOracleArgs::default(),
280280
consensus_args: ConsensusArgs::noop(),
281281
database: None,
282-
rpc_args: RpcArgs { enabled: true, admin_enabled: true },
282+
rpc_args: RpcArgs { basic_enabled: true, admin_enabled: true },
283283
}
284284
}

0 commit comments

Comments
 (0)