Skip to content

Commit 5d61e35

Browse files
authored
Prefer sov_modules_api over direct sov_rollup_interface for modules (Sovereign-Labs#1125)
* Remove extensive usage of `sov-rollup-interface` * Remove non-needed feature passing
1 parent dc3d236 commit 5d61e35

File tree

17 files changed

+21
-29
lines changed

17 files changed

+21
-29
lines changed

Cargo.lock

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/demo-rollup/provers/risc0/guest-celestia/Cargo.lock

+4-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/demo-rollup/provers/risc0/guest-mock/Cargo.lock

+4-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

module-system/module-implementations/examples/sov-vec-setter/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ tempfile = { workspace = true }
2020
anyhow = { workspace = true }
2121
sov-modules-api = { path = "../../../sov-modules-api", default-features = false, features = ["macros"] }
2222
sov-state = { path = "../../../sov-state", default-features = false }
23-
sov-rollup-interface = { path = "../../../../rollup-interface" }
2423
schemars = { workspace = true, optional = true }
2524
serde = { workspace = true }
2625
serde_json = { workspace = true, optional = true }

module-system/module-implementations/integration-tests/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jsonrpsee = { workspace = true }
2020

2121
sov-modules-api = { path = "../../sov-modules-api", features = ["native"] }
2222
sov-state = { path = "../../sov-state", features = ["native"] }
23-
sov-rollup-interface = { path = "../../../rollup-interface" }
23+
sov-rollup-interface = { path = "../../../rollup-interface", features = ["mocks"] }
2424
sov-schema-db = { path = "../../../full-node/db/sov-schema-db" }
2525
sov-data-generators = { path = "../../utils/sov-data-generators" }
2626
sov-modules-stf-template = { path = "../../sov-modules-stf-template", features = ["native"] }

module-system/module-implementations/module-template/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ thiserror = { workspace = true }
2525
sov-bank = { path = "../sov-bank" }
2626
sov-modules-api = { path = "../../sov-modules-api" }
2727
sov-state = { path = "../../sov-state" }
28-
sov-rollup-interface = { path = "../../../rollup-interface" }
2928

3029

3130
[dev-dependencies]

module-system/module-implementations/sov-bank/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ thiserror = { workspace = true }
2323

2424
sov-modules-api = { path = "../../sov-modules-api", version = "0.3" }
2525
sov-state = { path = "../../sov-state", version = "0.3" }
26-
sov-rollup-interface = { path = "../../../rollup-interface", version = "0.3" }
2726

2827

2928
[dev-dependencies]

module-system/module-implementations/sov-blob-storage/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ clap = { workspace = true, optional = true }
3232

3333

3434
[dev-dependencies]
35-
sov-rollup-interface = { path = "../../../rollup-interface", features = ["mocks"] }
35+
sov-rollup-interface = { path = "../../../rollup-interface", version = "0.3", features = ["mocks"] }
3636
sov-blob-storage = { path = ".", features = ["native"] }
3737
sov-bank = { path = "../sov-bank" }
3838
tempfile = { workspace = true }

module-system/module-implementations/sov-chain-state/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ jsonrpsee = { workspace = true, features = ["macros", "client-core", "server"],
2020

2121
sov-modules-api = { path = "../../sov-modules-api", version = "0.3" }
2222
sov-state = { path = "../../sov-state", version = "0.3" }
23-
sov-rollup-interface = { path = "../../../rollup-interface", version = "0.3" }
2423

2524
[dev-dependencies]
2625
tempfile = { workspace = true }
2726
sov-data-generators = { path = "../../utils/sov-data-generators" }
2827
sov-chain-state = { path = ".", features = ["native"] }
29-
sov-rollup-interface = { path = "../../../rollup-interface", features = ["mocks"] }
28+
sov-rollup-interface = { path = "../../../rollup-interface", version = "0.3", features = ["mocks"] }
3029

3130

3231
[features]

module-system/module-implementations/sov-chain-state/src/genesis.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
22
use serde::{Deserialize, Serialize};
3+
use sov_modules_api::da::Time;
34
use sov_modules_api::WorkingSet;
4-
use sov_rollup_interface::da::Time;
55

66
use crate::{ChainState, TransitionHeight};
77

module-system/module-implementations/sov-chain-state/src/hooks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use sov_modules_api::da::BlockHeaderTrait;
12
use sov_modules_api::hooks::{FinalizeHook, SlotHooks};
23
use sov_modules_api::{AccessoryWorkingSet, Context, Spec, WorkingSet};
3-
use sov_rollup_interface::da::BlockHeaderTrait;
44
use sov_state::Storage;
55

66
use super::ChainState;

module-system/module-implementations/sov-chain-state/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use borsh::{BorshDeserialize, BorshSerialize};
2121
pub use query::*;
2222
use serde::de::DeserializeOwned;
2323
use serde::{Deserialize, Serialize};
24+
use sov_modules_api::da::Time;
2425
use sov_modules_api::{DaSpec, Error, ModuleInfo, ValidityConditionChecker, WorkingSet};
25-
use sov_rollup_interface::da::Time;
2626
use sov_state::codec::BcsCodec;
2727
use sov_state::Storage;
2828

module-system/module-implementations/sov-chain-state/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use sov_rollup_interface::da::{NanoSeconds, Time};
1+
use sov_modules_api::da::{NanoSeconds, Time};
22

33
use crate::ChainStateConfig;
44

module-system/module-implementations/sov-chain-state/tests/all_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use sov_chain_state::{ChainState, ChainStateConfig, StateTransitionId, TransitionInProgress};
2+
use sov_modules_api::da::BlockHeaderTrait;
23
use sov_modules_api::default_context::DefaultContext;
34
use sov_modules_api::hooks::SlotHooks;
45
use sov_modules_api::{Genesis, WorkingSet};
5-
use sov_rollup_interface::da::BlockHeaderTrait;
66
use sov_rollup_interface::mocks::{MockBlock, MockBlockHeader, MockDaSpec, MockValidityCond};
77
use sov_rollup_interface::storage::StorageManager;
88
use sov_state::config::Config;

module-system/module-implementations/sov-nft-module/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ tokio = { version = "1.33.0", features=["full"], optional = true }
2727
tracing = { workspace = true, optional = true }
2828

2929
[dev-dependencies]
30-
sov-rollup-interface = { path = "../../../rollup-interface" }
3130
sov-data-generators = { path = "../../utils/sov-data-generators" }
3231
tempfile = { workspace = true }
3332
sov-nft-module = { version = "*", features = ["native"], path = "." }

module-system/sov-modules-api/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ pub mod optimistic {
7070
pub use sov_rollup_interface::optimistic::{Attestation, ProofOfBond};
7171
}
7272

73+
pub mod da {
74+
pub use sov_rollup_interface::da::{BlockHeaderTrait, NanoSeconds, Time};
75+
}
76+
7377
impl AsRef<[u8]> for Address {
7478
fn as_ref(&self) -> &[u8] {
7579
&self.addr

module-system/sov-modules-stf-template/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ sov-zk-cycle-utils = { path = "../../utils/zk-cycle-utils", version = "0.3", opt
2828
risc0-zkvm = { workspace = true, default-features = false, features = ["std"], optional = true }
2929
risc0-zkvm-platform = { workspace = true, optional = true }
3030
jsonrpsee = { workspace = true, features = ["server"], optional = true }
31+
3132
[features]
3233
bench = ["sov-zk-cycle-macros/bench", "sov-zk-cycle-utils", "risc0-zkvm", "risc0-zkvm-platform"]
3334
default = []

0 commit comments

Comments
 (0)