diff --git a/bin/citrea/src/main.rs b/bin/citrea/src/main.rs index 4d973fbf4..fa5d9a8de 100644 --- a/bin/citrea/src/main.rs +++ b/bin/citrea/src/main.rs @@ -10,7 +10,7 @@ use sov_mock_da::MockDaConfig; use sov_modules_api::Spec; use sov_modules_rollup_blueprint::RollupBlueprint; use sov_state::storage::NativeStorage; -use sov_stf_runner::{from_toml_path, ProverConfig, RollupConfig}; +use sov_stf_runner::{from_toml_path, FullNodeConfig, ProverConfig}; use tracing::{error, instrument}; #[cfg(test)] @@ -135,7 +135,7 @@ where S: CitreaRollupBlueprint, <::NativeContext as Spec>::Storage: NativeStorage, { - let rollup_config: RollupConfig = from_toml_path(rollup_config_path) + let rollup_config: FullNodeConfig = from_toml_path(rollup_config_path) .context("Failed to read rollup configuration") .unwrap(); let rollup_blueprint = S::new(); diff --git a/bin/citrea/src/rollup/bitcoin.rs b/bin/citrea/src/rollup/bitcoin.rs index 2d8c4a752..0fb80be21 100644 --- a/bin/citrea/src/rollup/bitcoin.rs +++ b/bin/citrea/src/rollup/bitcoin.rs @@ -16,7 +16,7 @@ use sov_prover_storage_manager::ProverStorageManager; use sov_rollup_interface::da::DaVerifier; use sov_rollup_interface::zk::{Zkvm, ZkvmHost}; use sov_state::{DefaultStorageSpec, Storage, ZkStorage}; -use sov_stf_runner::{ParallelProverService, ProverConfig, RollupConfig}; +use sov_stf_runner::{FullNodeConfig, ParallelProverService, ProverConfig}; use tracing::instrument; use crate::CitreaRollupBlueprint; @@ -92,7 +92,7 @@ impl RollupBlueprint for BitcoinRollup { #[instrument(level = "trace", skip_all, err)] fn create_storage_manager( &self, - rollup_config: &sov_stf_runner::RollupConfig, + rollup_config: &sov_stf_runner::FullNodeConfig, ) -> Result { let storage_config = StorageConfig { path: rollup_config.storage.path.clone(), @@ -103,7 +103,7 @@ impl RollupBlueprint for BitcoinRollup { #[instrument(level = "trace", skip_all)] async fn create_da_service( &self, - rollup_config: &RollupConfig, + rollup_config: &FullNodeConfig, ) -> Self::DaService { BitcoinService::new( rollup_config.da.clone(), @@ -119,7 +119,7 @@ impl RollupBlueprint for BitcoinRollup { async fn create_prover_service( &self, prover_config: ProverConfig, - _rollup_config: &RollupConfig, + _rollup_config: &FullNodeConfig, _da_service: &Self::DaService, ) -> Self::ProverService { let vm = Risc0BonsaiHost::new( diff --git a/bin/citrea/src/rollup/mock.rs b/bin/citrea/src/rollup/mock.rs index 973c00979..f258a6565 100644 --- a/bin/citrea/src/rollup/mock.rs +++ b/bin/citrea/src/rollup/mock.rs @@ -12,7 +12,7 @@ use sov_modules_stf_blueprint::StfBlueprint; use sov_prover_storage_manager::ProverStorageManager; use sov_rollup_interface::zk::{Zkvm, ZkvmHost}; use sov_state::{DefaultStorageSpec, Storage, ZkStorage}; -use sov_stf_runner::{ParallelProverService, ProverConfig, RollupConfig}; +use sov_stf_runner::{FullNodeConfig, ParallelProverService, ProverConfig}; use crate::CitreaRollupBlueprint; @@ -81,7 +81,7 @@ impl RollupBlueprint for MockDemoRollup { async fn create_da_service( &self, - rollup_config: &RollupConfig, + rollup_config: &FullNodeConfig, ) -> Self::DaService { MockDaService::new(rollup_config.da.sender_address, &rollup_config.da.db_path) } @@ -89,7 +89,7 @@ impl RollupBlueprint for MockDemoRollup { async fn create_prover_service( &self, prover_config: ProverConfig, - _rollup_config: &RollupConfig, + _rollup_config: &FullNodeConfig, _da_service: &Self::DaService, ) -> Self::ProverService { let vm = Risc0BonsaiHost::new( @@ -113,7 +113,7 @@ impl RollupBlueprint for MockDemoRollup { fn create_storage_manager( &self, - rollup_config: &RollupConfig, + rollup_config: &FullNodeConfig, ) -> anyhow::Result { let storage_config = StorageConfig { path: rollup_config.storage.path.clone(), diff --git a/bin/citrea/src/rollup/mod.rs b/bin/citrea/src/rollup/mod.rs index f9f3e7770..c458277dd 100644 --- a/bin/citrea/src/rollup/mod.rs +++ b/bin/citrea/src/rollup/mod.rs @@ -9,7 +9,7 @@ use sov_modules_api::Spec; use sov_modules_rollup_blueprint::RollupBlueprint; use sov_modules_stf_blueprint::{Runtime as RuntimeTrait, StfBlueprint}; use sov_state::storage::NativeStorage; -use sov_stf_runner::{InitVariant, ProverConfig, RollupConfig}; +use sov_stf_runner::{FullNodeConfig, InitVariant, ProverConfig}; use tracing::instrument; mod bitcoin; @@ -26,7 +26,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { Self::NativeContext, Self::DaSpec, >>::GenesisPaths, - rollup_config: RollupConfig, + rollup_config: FullNodeConfig, sequencer_config: SequencerConfig, ) -> Result, anyhow::Error> where @@ -92,7 +92,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { Self::NativeContext, Self::DaSpec, >>::GenesisPaths, - rollup_config: RollupConfig, + rollup_config: FullNodeConfig, ) -> Result, anyhow::Error> where ::Storage: NativeStorage, @@ -163,7 +163,7 @@ pub trait CitreaRollupBlueprint: RollupBlueprint { Self::NativeContext, Self::DaSpec, >>::GenesisPaths, - rollup_config: RollupConfig, + rollup_config: FullNodeConfig, prover_config: ProverConfig, ) -> Result, anyhow::Error> where diff --git a/bin/citrea/tests/test_helpers/mod.rs b/bin/citrea/tests/test_helpers/mod.rs index fb781eb13..991b829f8 100644 --- a/bin/citrea/tests/test_helpers/mod.rs +++ b/bin/citrea/tests/test_helpers/mod.rs @@ -12,7 +12,7 @@ use sov_mock_da::{MockAddress, MockDaConfig, MockDaService}; use sov_modules_api::default_signature::private_key::DefaultPrivateKey; use sov_modules_api::PrivateKey; use sov_stf_runner::{ - ProverConfig, RollupConfig, RollupPublicKeys, RpcConfig, RunnerConfig, StorageConfig, + FullNodeConfig, ProverConfig, RollupPublicKeys, RpcConfig, RunnerConfig, StorageConfig, }; use tempfile::TempDir; use tokio::sync::oneshot; @@ -39,7 +39,7 @@ pub async fn start_rollup( da_db_path: PathBuf, min_soft_confirmations_per_commitment: u64, include_tx_body: bool, - rollup_config: Option>, + rollup_config: Option>, sequencer_config: Option, test_mode: Option, deposit_mempool_fetch_limit: usize, @@ -124,8 +124,8 @@ pub fn create_default_rollup_config( rollup_path: &Path, da_path: &Path, node_mode: NodeMode, -) -> RollupConfig { - RollupConfig { +) -> FullNodeConfig { + FullNodeConfig { public_keys: RollupPublicKeys { sequencer_public_key: vec![ 32, 64, 64, 227, 100, 193, 15, 43, 236, 156, 31, 229, 0, 161, 205, 76, 36, 124, diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs index f54007f54..3c80d3156 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs @@ -85,7 +85,7 @@ pub struct RollupPublicKeys { } /// Rollup Configuration #[derive(Debug, Clone, PartialEq, Deserialize)] -pub struct RollupConfig { +pub struct FullNodeConfig { /// RPC configuration pub rpc: RpcConfig, /// Currently rollup config runner only supports storage path parameter @@ -176,10 +176,10 @@ mod tests { let config_file = create_config_from(&config); - let config: RollupConfig = + let config: FullNodeConfig = from_toml_path(config_file.path()).unwrap(); - let expected = RollupConfig { + let expected = FullNodeConfig { runner: Some(RunnerConfig { sequencer_client_url: "http://0.0.0.0:12346".to_owned(), include_tx_body: true, diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_initialization_tests.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_initialization_tests.rs index 8bccb620c..0d82dff4e 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_initialization_tests.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_initialization_tests.rs @@ -4,7 +4,7 @@ use sov_mock_zkvm::{MockCodeCommitment, MockZkvm}; use sov_prover_storage_manager::ProverStorageManager; use sov_state::{ArrayWitness, DefaultStorageSpec}; use sov_stf_runner::{ - InitVariant, ParallelProverService, RollupConfig, RollupPublicKeys, RpcConfig, RunnerConfig, + FullNodeConfig, InitVariant, ParallelProverService, RollupPublicKeys, RpcConfig, RunnerConfig, StateTransitionRunner, StorageConfig, }; @@ -67,7 +67,7 @@ fn initialize_runner( } let address = MockAddress::new([11u8; 32]); - let rollup_config = RollupConfig:: { + let rollup_config = FullNodeConfig:: { storage: StorageConfig { path: rollup_storage_path.clone(), }, diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_reorg_tests.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_reorg_tests.rs index 46f60b3ee..7bbbf45cd 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_reorg_tests.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/tests/runner_reorg_tests.rs @@ -5,7 +5,7 @@ use sov_mock_da::{ use sov_mock_zkvm::MockZkvm; use sov_modules_api::default_context::DefaultContext; use sov_stf_runner::{ - InitVariant, ParallelProverService, ProverGuestRunConfig, RollupConfig, RollupPublicKeys, + FullNodeConfig, InitVariant, ParallelProverService, ProverGuestRunConfig, RollupPublicKeys, RpcConfig, RunnerConfig, StateTransitionRunner, StorageConfig, }; @@ -118,7 +118,7 @@ async fn runner_execution( da_service: MockDaService, ) -> ([u8; 32], [u8; 32]) { let rollup_storage_path = storage_path.join("rollup").to_path_buf(); - let rollup_config = RollupConfig:: { + let rollup_config = FullNodeConfig:: { storage: StorageConfig { path: rollup_storage_path.clone(), }, diff --git a/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs b/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs index 3baf9ba7e..8ff7ac289 100644 --- a/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs +++ b/crates/sovereign-sdk/module-system/sov-modules-rollup-blueprint/src/lib.rs @@ -16,7 +16,7 @@ use sov_rollup_interface::zk::{Zkvm, ZkvmHost}; use sov_state::storage::NativeStorage; use sov_state::Storage; use sov_stf_runner::{ - InitVariant, ProverConfig, ProverService, RollupConfig, StateTransitionRunner, + FullNodeConfig, InitVariant, ProverConfig, ProverService, StateTransitionRunner, }; use tokio::sync::oneshot; use tracing::{instrument, Instrument}; @@ -83,7 +83,7 @@ pub trait RollupBlueprint: Sized + Send + Sync { Self::NativeContext, Self::DaSpec, >>::GenesisPaths, - _rollup_config: &RollupConfig, + _rollup_config: &FullNodeConfig, ) -> anyhow::Result< GenesisParams< >::GenesisConfig, @@ -102,14 +102,14 @@ pub trait RollupBlueprint: Sized + Send + Sync { /// Creates instance of [`DaService`]. async fn create_da_service( &self, - rollup_config: &RollupConfig, + rollup_config: &FullNodeConfig, ) -> Self::DaService; /// Creates instance of [`ProverService`]. async fn create_prover_service( &self, prover_config: ProverConfig, - rollup_config: &RollupConfig, + rollup_config: &FullNodeConfig, da_service: &Self::DaService, ) -> Self::ProverService; @@ -117,11 +117,11 @@ pub trait RollupBlueprint: Sized + Send + Sync { /// Panics if initialization fails. fn create_storage_manager( &self, - rollup_config: &RollupConfig, + rollup_config: &FullNodeConfig, ) -> Result; /// Creates instance of a LedgerDB. - fn create_ledger_db(&self, rollup_config: &RollupConfig) -> LedgerDB { + fn create_ledger_db(&self, rollup_config: &FullNodeConfig) -> LedgerDB { LedgerDB::with_path(&rollup_config.storage.path).expect("Ledger DB failed to open") } @@ -133,7 +133,7 @@ pub trait RollupBlueprint: Sized + Send + Sync { Self::NativeContext, Self::DaSpec, >>::GenesisPaths, - rollup_config: RollupConfig, + rollup_config: FullNodeConfig, ) -> Result, anyhow::Error> where ::Storage: NativeStorage,