@@ -58,7 +58,7 @@ pub struct ScrollRollupNodeConfig {
5858 pub consensus_args : ConsensusArgs ,
5959 /// Database args
6060 #[ command( flatten) ]
61- pub database_args : DatabaseArgs ,
61+ pub database_args : RollupNodeDatabaseArgs ,
6262 /// Chain orchestrator args.
6363 #[ command( flatten) ]
6464 pub chain_orchestrator_args : ChainOrchestratorArgs ,
@@ -76,13 +76,16 @@ pub struct ScrollRollupNodeConfig {
7676 pub sequencer_args : SequencerArgs ,
7777 /// The network arguments
7878 #[ command( flatten) ]
79- pub network_args : NetworkArgs ,
79+ pub network_args : RollupNodeNetworkArgs ,
80+ /// The rpc arguments
81+ #[ command( flatten) ]
82+ pub rpc_args : RpcArgs ,
8083 /// The signer arguments
8184 #[ command( flatten) ]
8285 pub signer_args : SignerArgs ,
8386 /// The gas price oracle args
8487 #[ command( flatten) ]
85- pub gas_price_oracle_args : GasPriceOracleArgs ,
88+ pub gas_price_oracle_args : RollupNodeGasPriceOracleArgs ,
8689 /// The database connection (not parsed via CLI but hydrated after validation).
8790 #[ arg( skip) ]
8891 pub database : Option < Arc < Database > > ,
@@ -127,7 +130,7 @@ impl ScrollRollupNodeConfig {
127130 ) -> eyre:: Result < ( ) > {
128131 // Instantiate the database
129132 let db_path = node_config. datadir ( ) . db ( ) ;
130- let database_path = if let Some ( database_path) = & self . database_args . path {
133+ let database_path = if let Some ( database_path) = & self . database_args . rn_db_path {
131134 database_path. to_string_lossy ( ) . to_string ( )
132135 } else {
133136 // append the path using strings as using `join(...)` overwrites "sqlite://"
@@ -408,10 +411,14 @@ impl ScrollRollupNodeConfig {
408411
409412/// The database arguments.
410413#[ derive( Debug , Default , Clone , clap:: Args ) ]
411- pub struct DatabaseArgs {
414+ pub struct RollupNodeDatabaseArgs {
412415 /// Database path
413- #[ arg( long) ]
414- pub path : Option < PathBuf > ,
416+ #[ arg(
417+ long = "rollup-node-db.path" ,
418+ value_name = "DB_PATH" ,
419+ help = "The database path for the rollup node database"
420+ ) ]
421+ pub rn_db_path : Option < PathBuf > ,
415422}
416423
417424/// The database arguments.
@@ -510,7 +517,7 @@ impl Default for ChainOrchestratorArgs {
510517
511518/// The network arguments.
512519#[ derive( Debug , Clone , clap:: Args ) ]
513- pub struct NetworkArgs {
520+ pub struct RollupNodeNetworkArgs {
514521 /// A bool to represent if new blocks should be bridged from the eth wire protocol to the
515522 /// scroll wire protocol.
516523 #[ arg( long = "network.bridge" ) ]
@@ -530,7 +537,7 @@ pub struct NetworkArgs {
530537 pub signer_address : Option < Address > ,
531538}
532539
533- impl Default for NetworkArgs {
540+ impl Default for RollupNodeNetworkArgs {
534541 fn default ( ) -> Self {
535542 Self {
536543 enable_eth_scroll_wire_bridge : true ,
@@ -541,7 +548,7 @@ impl Default for NetworkArgs {
541548 }
542549}
543550
544- impl NetworkArgs {
551+ impl RollupNodeNetworkArgs {
545552 /// Get the default authorized signer address for the given chain.
546553 pub const fn default_authorized_signer ( chain : Option < NamedChain > ) -> Option < Address > {
547554 match chain {
@@ -673,6 +680,14 @@ pub struct SignerArgs {
673680 pub private_key : Option < PrivateKeySigner > ,
674681}
675682
683+ /// The arguments for the rpc.
684+ #[ derive( Debug , Default , Clone , clap:: Args ) ]
685+ pub struct RpcArgs {
686+ /// A boolean to represent if the rollup node rpc should be enabled.
687+ #[ arg( long = "rpc.rollup-node" , help = "Enable the rollup node RPC namespace" ) ]
688+ pub enabled : bool ,
689+ }
690+
676691impl SignerArgs {
677692 /// Create a signer based on the configured arguments
678693 pub async fn signer (
@@ -740,7 +755,7 @@ impl SignerArgs {
740755
741756/// The arguments for the sequencer.
742757#[ derive( Debug , Default , Clone , clap:: Args ) ]
743- pub struct GasPriceOracleArgs {
758+ pub struct RollupNodeGasPriceOracleArgs {
744759 /// Minimum suggested priority fee (tip) in wei, default `100`
745760 #[ arg( long, default_value_t = 100 ) ]
746761 #[ arg( long = "gpo.default-suggest-priority-fee" , id = "default_suggest_priority_fee" , value_name = "DEFAULT_SUGGEST_PRIORITY_FEE" , default_value_t = constants:: DEFAULT_SUGGEST_PRIORITY_FEE ) ]
@@ -773,20 +788,22 @@ mod tests {
773788 #[ test]
774789 fn test_network_args_default_authorized_signer ( ) {
775790 // Test Scroll mainnet
776- let mainnet_signer = NetworkArgs :: default_authorized_signer ( Some ( NamedChain :: Scroll ) ) ;
791+ let mainnet_signer =
792+ RollupNodeNetworkArgs :: default_authorized_signer ( Some ( NamedChain :: Scroll ) ) ;
777793 assert_eq ! ( mainnet_signer, Some ( constants:: SCROLL_MAINNET_SIGNER ) ) ;
778794
779795 // Test Scroll Sepolia
780796 let sepolia_signer =
781- NetworkArgs :: default_authorized_signer ( Some ( NamedChain :: ScrollSepolia ) ) ;
797+ RollupNodeNetworkArgs :: default_authorized_signer ( Some ( NamedChain :: ScrollSepolia ) ) ;
782798 assert_eq ! ( sepolia_signer, Some ( constants:: SCROLL_SEPOLIA_SIGNER ) ) ;
783799
784800 // Test other chains
785- let other_signer = NetworkArgs :: default_authorized_signer ( Some ( NamedChain :: Mainnet ) ) ;
801+ let other_signer =
802+ RollupNodeNetworkArgs :: default_authorized_signer ( Some ( NamedChain :: Mainnet ) ) ;
786803 assert_eq ! ( other_signer, None ) ;
787804
788805 // Test None chain
789- let none_signer = NetworkArgs :: default_authorized_signer ( None ) ;
806+ let none_signer = RollupNodeNetworkArgs :: default_authorized_signer ( None ) ;
790807 assert_eq ! ( none_signer, None ) ;
791808 }
792809
@@ -796,11 +813,11 @@ mod tests {
796813
797814 // Test with configured signer
798815 let network_args =
799- NetworkArgs { signer_address : Some ( custom_signer) , ..Default :: default ( ) } ;
816+ RollupNodeNetworkArgs { signer_address : Some ( custom_signer) , ..Default :: default ( ) } ;
800817 assert_eq ! ( network_args. effective_signer( Some ( NamedChain :: Scroll ) ) , Some ( custom_signer) ) ;
801818
802819 // Test without configured signer, fallback to default
803- let network_args_default = NetworkArgs :: default ( ) ;
820+ let network_args_default = RollupNodeNetworkArgs :: default ( ) ;
804821 assert_eq ! (
805822 network_args_default. effective_signer( Some ( NamedChain :: Scroll ) ) ,
806823 Some ( constants:: SCROLL_MAINNET_SIGNER )
@@ -818,18 +835,19 @@ mod tests {
818835 test : false ,
819836 sequencer_args : SequencerArgs { sequencer_enabled : true , ..Default :: default ( ) } ,
820837 signer_args : SignerArgs { key_file : None , aws_kms_key_id : None , private_key : None } ,
821- database_args : DatabaseArgs :: default ( ) ,
838+ database_args : RollupNodeDatabaseArgs :: default ( ) ,
822839 engine_driver_args : EngineDriverArgs :: default ( ) ,
823840 chain_orchestrator_args : ChainOrchestratorArgs :: default ( ) ,
824841 l1_provider_args : L1ProviderArgs :: default ( ) ,
825842 blob_provider_args : BlobProviderArgs :: default ( ) ,
826- network_args : NetworkArgs :: default ( ) ,
827- gas_price_oracle_args : GasPriceOracleArgs :: default ( ) ,
843+ network_args : RollupNodeNetworkArgs :: default ( ) ,
844+ gas_price_oracle_args : RollupNodeGasPriceOracleArgs :: default ( ) ,
828845 consensus_args : ConsensusArgs {
829846 algorithm : ConsensusAlgorithm :: SystemContract ,
830847 authorized_signer : None ,
831848 } ,
832849 database : None ,
850+ rpc_args : RpcArgs :: default ( ) ,
833851 } ;
834852
835853 let result = config. validate ( ) ;
@@ -849,18 +867,19 @@ mod tests {
849867 aws_kms_key_id : Some ( "key-id" . to_string ( ) ) ,
850868 private_key : None ,
851869 } ,
852- database_args : DatabaseArgs :: default ( ) ,
870+ database_args : RollupNodeDatabaseArgs :: default ( ) ,
853871 engine_driver_args : EngineDriverArgs :: default ( ) ,
854872 chain_orchestrator_args : ChainOrchestratorArgs :: default ( ) ,
855873 l1_provider_args : L1ProviderArgs :: default ( ) ,
856874 blob_provider_args : BlobProviderArgs :: default ( ) ,
857- network_args : NetworkArgs :: default ( ) ,
858- gas_price_oracle_args : GasPriceOracleArgs :: default ( ) ,
875+ network_args : RollupNodeNetworkArgs :: default ( ) ,
876+ gas_price_oracle_args : RollupNodeGasPriceOracleArgs :: default ( ) ,
859877 consensus_args : ConsensusArgs {
860878 algorithm : ConsensusAlgorithm :: SystemContract ,
861879 authorized_signer : None ,
862880 } ,
863881 database : None ,
882+ rpc_args : RpcArgs :: default ( ) ,
864883 } ;
865884
866885 let result = config. validate ( ) ;
@@ -878,15 +897,16 @@ mod tests {
878897 aws_kms_key_id : None ,
879898 private_key : None ,
880899 } ,
881- database_args : DatabaseArgs :: default ( ) ,
900+ database_args : RollupNodeDatabaseArgs :: default ( ) ,
882901 chain_orchestrator_args : ChainOrchestratorArgs :: default ( ) ,
883902 engine_driver_args : EngineDriverArgs :: default ( ) ,
884903 l1_provider_args : L1ProviderArgs :: default ( ) ,
885904 blob_provider_args : BlobProviderArgs :: default ( ) ,
886- network_args : NetworkArgs :: default ( ) ,
887- gas_price_oracle_args : GasPriceOracleArgs :: default ( ) ,
905+ network_args : RollupNodeNetworkArgs :: default ( ) ,
906+ gas_price_oracle_args : RollupNodeGasPriceOracleArgs :: default ( ) ,
888907 consensus_args : ConsensusArgs :: noop ( ) ,
889908 database : None ,
909+ rpc_args : RpcArgs :: default ( ) ,
890910 } ;
891911
892912 assert ! ( config. validate( ) . is_ok( ) ) ;
@@ -902,15 +922,16 @@ mod tests {
902922 aws_kms_key_id : Some ( "key-id" . to_string ( ) ) ,
903923 private_key : None ,
904924 } ,
905- database_args : DatabaseArgs :: default ( ) ,
925+ database_args : RollupNodeDatabaseArgs :: default ( ) ,
906926 engine_driver_args : EngineDriverArgs :: default ( ) ,
907927 chain_orchestrator_args : ChainOrchestratorArgs :: default ( ) ,
908928 l1_provider_args : L1ProviderArgs :: default ( ) ,
909929 blob_provider_args : BlobProviderArgs :: default ( ) ,
910- network_args : NetworkArgs :: default ( ) ,
911- gas_price_oracle_args : GasPriceOracleArgs :: default ( ) ,
930+ network_args : RollupNodeNetworkArgs :: default ( ) ,
931+ gas_price_oracle_args : RollupNodeGasPriceOracleArgs :: default ( ) ,
912932 consensus_args : ConsensusArgs :: noop ( ) ,
913933 database : None ,
934+ rpc_args : RpcArgs :: default ( ) ,
914935 } ;
915936
916937 assert ! ( config. validate( ) . is_ok( ) ) ;
@@ -922,15 +943,16 @@ mod tests {
922943 test : false ,
923944 sequencer_args : SequencerArgs { sequencer_enabled : false , ..Default :: default ( ) } ,
924945 signer_args : SignerArgs { key_file : None , aws_kms_key_id : None , private_key : None } ,
925- database_args : DatabaseArgs :: default ( ) ,
946+ database_args : RollupNodeDatabaseArgs :: default ( ) ,
926947 engine_driver_args : EngineDriverArgs :: default ( ) ,
927948 chain_orchestrator_args : ChainOrchestratorArgs :: default ( ) ,
928949 l1_provider_args : L1ProviderArgs :: default ( ) ,
929950 blob_provider_args : BlobProviderArgs :: default ( ) ,
930- network_args : NetworkArgs :: default ( ) ,
931- gas_price_oracle_args : GasPriceOracleArgs :: default ( ) ,
951+ network_args : RollupNodeNetworkArgs :: default ( ) ,
952+ gas_price_oracle_args : RollupNodeGasPriceOracleArgs :: default ( ) ,
932953 consensus_args : ConsensusArgs :: noop ( ) ,
933954 database : None ,
955+ rpc_args : RpcArgs :: default ( ) ,
934956 } ;
935957
936958 assert ! ( config. validate( ) . is_ok( ) ) ;
0 commit comments