diff --git a/crates/apps_lib/Cargo.toml b/crates/apps_lib/Cargo.toml index c769cff7fe0..82585e696d3 100644 --- a/crates/apps_lib/Cargo.toml +++ b/crates/apps_lib/Cargo.toml @@ -36,7 +36,7 @@ namada-eth-bridge = [ namada = {path = "../namada", features = ["multicore", "http-client", "tendermint-rpc", "std"]} namada_macros = {path = "../macros"} namada_migrations = {path = "../migrations", optional = true} -namada_sdk = {path = "../sdk", default-features = false, features = ["download-params", "std", "rand"]} +namada_sdk = {path = "../sdk", default-features = false, features = ["validation", "std", "rand"]} namada_test_utils = {path = "../test_utils", optional = true} async-trait.workspace = true diff --git a/crates/encoding_spec/Cargo.toml b/crates/encoding_spec/Cargo.toml index 487b7916da3..5db557c51c0 100644 --- a/crates/encoding_spec/Cargo.toml +++ b/crates/encoding_spec/Cargo.toml @@ -17,7 +17,7 @@ default = [] namada-eth-bridge = ["namada/namada-eth-bridge"] [dependencies] -namada = { path = "../namada", features = ["rand", "tendermint-rpc", "download-params"] } +namada = { path = "../namada" } borsh.workspace = true itertools.workspace = true lazy_static.workspace = true diff --git a/crates/namada/Cargo.toml b/crates/namada/Cargo.toml index a2f4ba22f14..e3fddc76cbc 100644 --- a/crates/namada/Cargo.toml +++ b/crates/namada/Cargo.toml @@ -73,8 +73,7 @@ multicore = [ "namada_sdk/multicore", "namada_token/multicore", ] -# Download MASP params if they're not present -download-params = ["namada_sdk/download-params"] +validation = ["namada_sdk/validation"] rand = ["namada_sdk/rand"] migrations = [ "namada_migrations", diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index 7e4d13b9c58..c9fe647f4e0 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -47,7 +47,7 @@ namada-eth-bridge = [ namada = {path = "../namada", features = ["multicore", "http-client", "tendermint-rpc", "std"]} namada_apps_lib = {path = "../apps_lib"} namada_migrations = {path = "../migrations", optional = true} -namada_sdk = {path = "../sdk", default-features = false, features = ["download-params", "std", "rand"]} +namada_sdk = {path = "../sdk", default-features = false, features = ["validation", "std", "rand"]} namada_test_utils = {path = "../test_utils", optional = true} arse-merkle-tree = { workspace = true, features = ["blake2b"] } diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index 64faf3d0bda..8278bdd0547 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -15,7 +15,7 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["tendermint-rpc", "download-params", "std", "rand", "migrations"] +default = ["tendermint-rpc", "std", "rand", "migrations"] mainnet = ["namada_core/mainnet", "namada_events/mainnet"] @@ -53,7 +53,7 @@ testing = [ "jubjub", ] -download-params = ["namada_token/download-params"] +validation = ["namada_token/validation"] migrations = [ "namada_migrations", "namada_account/migrations", diff --git a/crates/shielded_token/Cargo.toml b/crates/shielded_token/Cargo.toml index 6f4dac99922..85d065500ac 100644 --- a/crates/shielded_token/Cargo.toml +++ b/crates/shielded_token/Cargo.toml @@ -15,8 +15,12 @@ version.workspace = true [features] default = [] multicore = ["dep:rayon"] -# Download MASP params if they're not present -download-params = ["masp_proofs/download-params"] +validation = [ + "namada_gas", + "lazy_static", + "masp_proofs", + "rand_core", +] testing = [ "multicore", "namada_core/testing", @@ -26,16 +30,16 @@ testing = [ [dependencies] namada_controller = { path = "../controller" } namada_core = { path = "../core" } -namada_gas = { path = "../gas" } +namada_gas = { path = "../gas", optional = true } namada_parameters = { path = "../parameters" } namada_storage = { path = "../storage" } namada_trans_token = { path = "../trans_token" } borsh.workspace = true -lazy_static.workspace = true +lazy_static = { workspace = true, optional = true } masp_primitives.workspace = true -masp_proofs.workspace = true -rand_core.workspace = true +masp_proofs = { workspace = true, optional = true, features = ["download-params"] } +rand_core = { workspace = true, optional = true } rayon = { workspace = true, optional = true } serde.workspace = true smooth-operator.workspace = true diff --git a/crates/shielded_token/src/lib.rs b/crates/shielded_token/src/lib.rs index 50d137955c5..625a5318f9a 100644 --- a/crates/shielded_token/src/lib.rs +++ b/crates/shielded_token/src/lib.rs @@ -21,6 +21,7 @@ pub mod conversion; mod storage; pub mod storage_key; pub mod utils; +#[cfg(any(test, feature = "validation", feature = "testing"))] pub mod validation; use std::str::FromStr; diff --git a/crates/shielded_token/src/validation.rs b/crates/shielded_token/src/validation.rs index c52300b4d19..79a4caad627 100644 --- a/crates/shielded_token/src/validation.rs +++ b/crates/shielded_token/src/validation.rs @@ -75,7 +75,6 @@ lazy_static! { let [spend_path, convert_path, output_path] = [SPEND_NAME, CONVERT_NAME, OUTPUT_NAME].map(|p| params_dir.join(p)); - #[cfg(feature = "download-params")] if !spend_path.exists() || !convert_path.exists() || !output_path.exists() { let paths = masp_proofs::download_masp_parameters(None).expect( "MASP parameters were not present, expected the download to \ diff --git a/crates/tests/Cargo.toml b/crates/tests/Cargo.toml index 6c76c5d8168..dcb7e8d0832 100644 --- a/crates/tests/Cargo.toml +++ b/crates/tests/Cargo.toml @@ -33,7 +33,7 @@ namada-eth-bridge = [ [dependencies] namada = {path = "../namada", features = ["testing"]} namada_core = {path = "../core", features = ["testing"]} -namada_sdk = {path = "../sdk", default-features = false, features = ["tendermint-rpc", "download-params", "std", "rand"]} +namada_sdk = {path = "../sdk", default-features = false, features = ["tendermint-rpc", "validation", "std", "rand"]} namada_test_utils = {path = "../test_utils"} namada_tx_prelude = {path = "../tx_prelude"} namada_vp_prelude = {path = "../vp_prelude"} diff --git a/crates/token/Cargo.toml b/crates/token/Cargo.toml index 175f73b54ad..058f57f3a49 100644 --- a/crates/token/Cargo.toml +++ b/crates/token/Cargo.toml @@ -15,7 +15,7 @@ version.workspace = true [features] default = [] multicore = ["namada_shielded_token/multicore"] -download-params = ["namada_shielded_token/download-params"] +validation = ["namada_shielded_token/validation"] testing = ["namada_core/testing", "namada_shielded_token/testing", "proptest"] [dependencies]