Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move masp validation from SDK into shielded_token crate #3419

Merged
merged 3 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Moved shielded tx validation out of the SDK crate into shielded token crate.
([\#3419](https://github.com/anoma/namada/pull/3419))
11 changes: 7 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ bimap = {version = "0.6.2", features = ["serde"]}
bit-set = "0.5.2"
bitflags = { version = "2.5.0", features = ["serde"] }
blake2b-rs = "0.2.0"
bls12_381 = "0.8"
byte-unit = "4.0.13"
byteorder = "1.4.2"
borsh = {version = "1.2.0", features = ["unstable__schema", "derive"]}
Expand Down Expand Up @@ -125,8 +124,8 @@ libc = "0.2.97"
libloading = "0.7.2"
linkme = "0.3.24"
# branch = "main"
masp_primitives = { git = "https://github.com/anoma/masp", rev = "4ede1c42d76d6348af8224bc8bfac4404321fe82" }
masp_proofs = { git = "https://github.com/anoma/masp", rev = "4ede1c42d76d6348af8224bc8bfac4404321fe82", default-features = false, features = ["local-prover"] }
masp_primitives = { git = "https://github.com/anoma/masp", rev = "71b36beba21e35f8611f3ba6910ed5b78ec11af1" }
masp_proofs = { git = "https://github.com/anoma/masp", rev = "71b36beba21e35f8611f3ba6910ed5b78ec11af1", default-features = false, features = ["local-prover"] }
num256 = "0.3.5"
num_cpus = "1.13.0"
num-derive = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion crates/encoding_spec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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", features = ["rand", "tendermint-rpc"] }
borsh.workspace = true
itertools.workspace = true
lazy_static.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions crates/namada/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ testing = [
"namada_proof_of_stake/testing",
"namada_sdk/testing",
"namada_state/testing",
"namada_token/testing",
"async-client",
"proptest",
"tempfile",
Expand All @@ -72,8 +73,6 @@ multicore = [
"namada_sdk/multicore",
"namada_token/multicore",
]
# Download MASP params if they're not present
download-params = ["namada_sdk/download-params"]
rand = ["namada_sdk/rand"]
migrations = [
"namada_migrations",
Expand Down
2 changes: 1 addition & 1 deletion crates/namada/src/ledger/native_vp/masp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use namada_core::masp::{encode_asset_type, MaspEpoch};
use namada_core::storage::Key;
use namada_gas::GasMetering;
use namada_governance::storage::is_proposal_accepted;
use namada_sdk::masp::verify_shielded_tx;
use namada_state::{ConversionState, OptionExt, ResultExt, StateRead};
use namada_token::read_denom;
use namada_token::validation::verify_shielded_tx;
use namada_tx::BatchedTxRef;
use namada_vp_env::VpEnv;
use ripemd::Digest as RipemdDigest;
Expand Down
2 changes: 1 addition & 1 deletion crates/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ async fn run_aux(
};

tracing::info!("Loading MASP verifying keys.");
let _ = namada_sdk::masp::preload_verifying_keys();
let _ = namada::token::validation::preload_verifying_keys();
tracing::info!("Done loading MASP verifying keys.");

// Start ABCI server and broadcaster (the latter only if we are a validator
Expand Down
10 changes: 3 additions & 7 deletions crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ 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"]

multicore = ["masp_proofs/multicore"]

namada-sdk = ["tendermint-rpc", "masp_primitives/transparent-inputs"]

std = ["fd-lock"]
std = ["fd-lock", "download-params"]
rand = ["dep:rand", "rand_core", "namada_core/rand"]

# tendermint-rpc support
Expand Down Expand Up @@ -51,11 +51,9 @@ testing = [
"async-client",
"proptest",
"jubjub",
"bls12_381",
]

# Download MASP params if they're not present
download-params = ["masp_proofs/download-params"]
download-params = ["namada_token/download-params"]
migrations = [
"namada_migrations",
"namada_account/migrations",
Expand Down Expand Up @@ -92,7 +90,6 @@ namada_vote_ext = { path = "../vote_ext" }

async-trait = { workspace = true, optional = true }
bimap.workspace = true
bls12_381 = { workspace = true, optional = true }
borsh.workspace = true
borsh-ext.workspace = true
circular-queue.workspace = true
Expand Down Expand Up @@ -166,7 +163,6 @@ namada_vote_ext = {path = "../vote_ext"}

assert_matches.workspace = true
base58.workspace = true
bls12_381.workspace = true
jubjub.workspace = true
masp_primitives = { workspace = true, features = ["test-dependencies"] }
proptest.workspace = true
Expand Down
Loading
Loading