From 4887f2bb29823330df3cc865bd96775626714176 Mon Sep 17 00:00:00 2001 From: Nikolai Golub Date: Fri, 3 Nov 2023 12:57:16 +0100 Subject: [PATCH] Integrate `sov-mock-da` (#6) --- Cargo.toml | 31 ++++++++++--------- crates/provers/risc0/guest-mock/Cargo.toml | 11 ++++--- .../risc0/guest-mock/src/bin/mock_da.rs | 2 +- crates/rollup/Cargo.toml | 4 +-- crates/rollup/src/bin/node.rs | 2 +- crates/rollup/src/lib.rs | 2 +- crates/rollup/tests/bank/mod.rs | 4 +-- crates/rollup/tests/test_helpers.rs | 4 +-- 8 files changed, 31 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 91d3f4a..4a7784f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,21 +16,22 @@ publish = false rust-version = "1.73" [workspace.dependencies] -sov-modules-api = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-state = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-accounts = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-bank = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-ledger-rpc = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-sequencer-registry = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-modules-stf-template = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-modules-rollup-template = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-stf-runner = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-db = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-sequencer = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-rollup-interface = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-risc0-adapter = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-first-read-last-write-cache = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-cli = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } +sov-modules-api = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-state = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-accounts = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-bank = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-ledger-rpc = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-sequencer-registry = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-modules-stf-template = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-modules-rollup-template = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-stf-runner = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-db = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-sequencer = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-rollup-interface = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-risc0-adapter = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-first-read-last-write-cache = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-cli = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-mock-da = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } stf-starter = { path = "./crates/stf" } serde = { version = "1.0.188", features = ["derive", "rc"] } diff --git a/crates/provers/risc0/guest-mock/Cargo.toml b/crates/provers/risc0/guest-mock/Cargo.toml index 86eecd7..faea1fa 100644 --- a/crates/provers/risc0/guest-mock/Cargo.toml +++ b/crates/provers/risc0/guest-mock/Cargo.toml @@ -14,11 +14,12 @@ risc0-zkvm-platform = "0.18" serde = { version = "1.0.188", features = ["derive", "rc"] } -sov-rollup-interface = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d", features = ["mocks"] } -sov-modules-stf-template = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-modules-api = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-risc0-adapter = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } -sov-state = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "dc3d236c499598b15fbf64c8e78b7f6018b5f13d" } +sov-rollup-interface = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-mock-da = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-modules-stf-template = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-modules-api = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-risc0-adapter = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } +sov-state = { git = "https://github.com/Sovereign-Labs/sovereign-sdk.git", rev = "b8a0642f909bdda06ebe0e0211e851d3003dec2a" } stf-starter = { path = "../../../stf" } diff --git a/crates/provers/risc0/guest-mock/src/bin/mock_da.rs b/crates/provers/risc0/guest-mock/src/bin/mock_da.rs index 2393df2..8b06490 100644 --- a/crates/provers/risc0/guest-mock/src/bin/mock_da.rs +++ b/crates/provers/risc0/guest-mock/src/bin/mock_da.rs @@ -6,7 +6,7 @@ use sov_modules_api::default_context::ZkDefaultContext; use sov_modules_stf_template::kernels::basic::BasicKernel; use sov_modules_stf_template::AppTemplate; use sov_risc0_adapter::guest::Risc0Guest; -use sov_rollup_interface::mocks::MockDaVerifier; +use sov_mock_da::MockDaVerifier; use sov_state::ZkStorage; use stf_starter::runtime::Runtime; use stf_starter::AppVerifier; diff --git a/crates/rollup/Cargo.toml b/crates/rollup/Cargo.toml index 3e7824c..e17eac9 100644 --- a/crates/rollup/Cargo.toml +++ b/crates/rollup/Cargo.toml @@ -24,8 +24,8 @@ sov-cli = { workspace = true, optional = true } sov-db = { workspace = true } sov-sequencer = { workspace = true } -sov-rollup-interface = { workspace = true, features = ["mocks"] } - +sov-rollup-interface = { workspace = true } +sov-mock-da = { workspace = true, features = ["native"] } anyhow = { workspace = true } async-trait = { workspace = true } diff --git a/crates/rollup/src/bin/node.rs b/crates/rollup/src/bin/node.rs index f883ca6..bb9d45e 100644 --- a/crates/rollup/src/bin/node.rs +++ b/crates/rollup/src/bin/node.rs @@ -3,7 +3,7 @@ use anyhow::Context; use clap::Parser; use sov_modules_rollup_template::{Rollup, RollupProverConfig, RollupTemplate}; -use sov_rollup_interface::mocks::MockDaConfig; +use sov_mock_da::MockDaConfig; use sov_rollup_starter::StarterRollup; use sov_stf_runner::{from_toml_path, RollupConfig}; use stf_starter::genesis_config::GenesisPaths; diff --git a/crates/rollup/src/lib.rs b/crates/rollup/src/lib.rs index 9aee9db..7374d7e 100644 --- a/crates/rollup/src/lib.rs +++ b/crates/rollup/src/lib.rs @@ -7,7 +7,7 @@ use sov_modules_api::default_context::{DefaultContext, ZkDefaultContext}; use sov_modules_api::Spec; use sov_modules_stf_template::kernels::basic::BasicKernel; use sov_risc0_adapter::host::Risc0Host; -use sov_rollup_interface::mocks::{MockDaConfig, MockDaService, MockDaSpec}; +use sov_mock_da::{MockDaConfig, MockDaService, MockDaSpec}; use sov_rollup_interface::services::da::DaService; use sov_state::config::Config as StorageConfig; use sov_state::{DefaultStorageSpec, ZkStorage}; diff --git a/crates/rollup/tests/bank/mod.rs b/crates/rollup/tests/bank/mod.rs index 78d394b..8b564d9 100644 --- a/crates/rollup/tests/bank/mod.rs +++ b/crates/rollup/tests/bank/mod.rs @@ -8,7 +8,7 @@ use sov_modules_api::default_signature::private_key::DefaultPrivateKey; use sov_modules_api::transaction::Transaction; use sov_modules_api::{PrivateKey, Spec}; use sov_modules_rollup_template::RollupProverConfig; -use sov_rollup_interface::mocks::MockDaSpec; +use sov_mock_da::MockDaSpec; use sov_sequencer::utils::SimpleClient; use stf_starter::genesis_config::GenesisPaths; use stf_starter::RuntimeCall; @@ -37,7 +37,7 @@ async fn bank_tx_tests() -> Result<(), anyhow::Error> { tokio::select! { err = rollup_task => err?, res = send_test_create_token_tx(port) => res?, - }; + } Ok(()) } diff --git a/crates/rollup/tests/test_helpers.rs b/crates/rollup/tests/test_helpers.rs index 9dc828a..8059f28 100644 --- a/crates/rollup/tests/test_helpers.rs +++ b/crates/rollup/tests/test_helpers.rs @@ -1,7 +1,7 @@ use std::net::SocketAddr; use sov_modules_rollup_template::{RollupProverConfig, RollupTemplate}; -use sov_rollup_interface::mocks::{MockAddress, MockDaConfig}; +use sov_mock_da::{MockAddress, MockDaConfig}; use sov_rollup_starter::StarterRollup; use sov_stf_runner::{RollupConfig, RpcConfig, RunnerConfig, StorageConfig}; use stf_starter::genesis_config::GenesisPaths; @@ -27,7 +27,7 @@ pub async fn start_rollup( }, }, da: MockDaConfig { - sender_address: MockAddress { addr: [0; 32] }, + sender_address: MockAddress::from([0; 32]), }, };