Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 12 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
6 changes: 6 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
ci:
Expand Down Expand Up @@ -63,3 +66,6 @@ jobs:
- name: Test
run: |
SKIP_WASM_BUILD=1 cargo nextest run --release --workspace --exclude webb-client
- name: Check Benchmark Build
run: |
cargo build --features runtime-benchmarks
5 changes: 5 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exclude = ["target/*"]
[formatting]
array_auto_collapse = false
array_auto_expand = false
reorder_keys = true
1 change: 1 addition & 0 deletions Cargo.lock

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

44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[profile.release]
lto = "thin"
panic = "unwind"
strip = "symbols"
lto = "thin"

[profile.dev]
strip = "symbols"
debug = 0
strip = "symbols"

[workspace]
members = [
"client",
"primitives",
"pallets/anonymity-mining",
"pallets/asset-registry",
"pallets/hasher",
"pallets/verifier",
"pallets/mt",
"pallets/linkable-tree",
"pallets/mixer",
"pallets/signature-bridge",
"pallets/vanchor",
"pallets/vanchor-handler",
"pallets/vanchor-verifier",
# "pallets/xanchor",
"pallets/token-wrapper",
"pallets/token-wrapper-handler",
"pallets/relayer-registry",
"pallets/key-storage",
"standalone/*",
]
"client",
"primitives",
"pallets/anonymity-mining",
"pallets/asset-registry",
"pallets/hasher",
"pallets/verifier",
"pallets/mt",
"pallets/linkable-tree",
"pallets/mixer",
"pallets/signature-bridge",
"pallets/vanchor",
"pallets/vanchor-handler",
"pallets/vanchor-verifier",
# "pallets/xanchor",
"pallets/token-wrapper",
"pallets/token-wrapper-handler",
"pallets/relayer-registry",
"pallets/key-storage",
"standalone/*",
]
24 changes: 12 additions & 12 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
[package]
edition = "2021"
name = "webb-client"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
subxt = { version = "0.25.0" }
codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full", "bit-vec"] }
subxt = { version = "0.25.0" }

[dev-dependencies]
hex = "0.4"
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { version = "1.0.119" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-keyring = { default-features = false, version = "7.0.0" }
tokio = { version = "1.17.0", features = ["full"] }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
tokio = { version = "1.17.0", features = ["full"] }

# arkworks related deps
ark-bls12-381 = { version = "^0.3.0", default-features = false, features = ["curve"] }
ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] }
ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false}
ark-ec = { version = "^0.3.0", default-features = false}
ark-ff = { version = "^0.3.0", default-features = false}
ark-relations = { version = "^0.3.0", default-features = false}
ark-serialize = { version = "^0.3.0", default-features = false, features = ["derive"]}
ark-std = { version = "^0.3.0", default-features = false}
ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false }
ark-ec = { version = "^0.3.0", default-features = false }
ark-ff = { version = "^0.3.0", default-features = false }
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false, features = ["derive"] }
ark-std = { version = "^0.3.0", default-features = false }

# Webb deps
webb-primitives = { path = "../primitives", features = ["hashing", "verifying", "field_ops"] }
arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false }
arkworks-native-gadgets = { version = "1.2.0", default-features = false }
arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false }
webb-primitives = { path = "../primitives", features = ["hashing", "verifying", "field_ops"] }
1 change: 1 addition & 0 deletions client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#![allow(clippy::too_many_arguments)]
#[subxt::subxt(runtime_metadata_path = "metadata/protocol_substrate_runtime.scale")]
pub mod webb_runtime {}
72 changes: 36 additions & 36 deletions pallets/anonymity-mining/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }

pallet-vanchor = { path = "../vanchor", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false }
pallet-asset-registry = { path = "../asset-registry", default-features = false }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-mt = { path = "../mt", default-features = false }
pallet-linkable-tree = { path = "../linkable-tree", default-features = false }
pallet-mt = { path = "../mt", default-features = false }
pallet-token-wrapper = { path = "../token-wrapper", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false }
pallet-vanchor = { path = "../vanchor", default-features = false }

frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
Expand All @@ -30,50 +30,50 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr
webb-primitives = { path = "../../primitives", default-features = false }

[dev-dependencies]
hex = "0.4"
serde = { version = "1.0.119" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
ark-bls12-381 = { version = "^0.3.0", default-features = false, features = ["curve"] }
ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] }
ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false }
ark-ff = { version = "^0.3.0", default-features = false }
ark-ec = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false }
ark-ff = { version = "^0.3.0", default-features = false }
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false, features = [ "derive" ] }
ark-bls12-381 = { version = "^0.3.0", default-features = false, features = [ "curve" ] }
ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] }
ark-serialize = { version = "^0.3.0", default-features = false, features = ["derive"] }
ark-std = { version = "^0.3.0", default-features = false }
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
hex = "0.4"
orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false }
pallet-hasher = { path = "../hasher", default-features = false }
pallet-key-storage = {path = "../key-storage"}
pallet-key-storage = { path = "../key-storage" }
pallet-timestamp = { default-features = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" }
pallet-vanchor-verifier = { path = "../vanchor-verifier", default-features = false }
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
serde = { version = "1.0.119" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }

[features]
default = ["std"]
runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"frame-support/runtime-benchmarks",
]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"sp-runtime/std",
"sp-std/std",
"webb-primitives/std",
"webb-primitives/hashing",
"frame-benchmarking/std",
"orml-currencies/std",
"orml-tokens/std",
"orml-traits/std",
"pallet-asset-registry/std",
"pallet-balances/std",
"pallet-vanchor/std",
"pallet-mt/std",
"pallet-vanchor-verifier/std",
"pallet-token-wrapper/std"
"codec/std",
"frame-support/std",
"frame-system/std",
"sp-runtime/std",
"sp-std/std",
"webb-primitives/std",
"webb-primitives/hashing",
"frame-benchmarking/std",
"orml-currencies/std",
"orml-tokens/std",
"orml-traits/std",
"pallet-asset-registry/std",
"pallet-balances/std",
"pallet-vanchor/std",
"pallet-mt/std",
"pallet-vanchor-verifier/std",
"pallet-token-wrapper/std",

]
runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"frame-support/runtime-benchmarks",
]
13 changes: 7 additions & 6 deletions pallets/asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "pallet-asset-registry"
version = "0.1.0"
description = "Pallet for asset registry management"
authors = ["GalacticCouncil"]
description = "Pallet for asset registry management"
edition = "2018"
homepage = "https://github.com/galacticcouncil/basilisk-node"
license = "Apache 2.0"
name = "pallet-asset-registry"
repository = "https://github.com/galacticcouncil/basilisk-node"
version = "0.1.0"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
codec = { default-features = false, features = ["derive", "max-encoded-len"], package = "parity-scale-codec", version = "3" }
primitive-types = { default-features = false, version = "0.8.0" }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
serde = { features = ["derive"], optional = true, version = "1.0.101" }

# ORML dependencies
Expand All @@ -23,8 +23,8 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li
# Substrate dependencies
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }

Expand All @@ -40,6 +40,7 @@ webb-primitives = { path = "../../primitives", default-features = false }
[features]
default = ["std"]
runtime-benchmarks = [
"frame-benchmarking",
"frame-system/runtime-benchmarks",
"frame-support/runtime-benchmarks",
]
Expand All @@ -55,4 +56,4 @@ std = [
"sp-std/std",
"sp-api/std",
"sp-arithmetic/std",
]
]
14 changes: 7 additions & 7 deletions pallets/asset-registry/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ benchmarks! {
// In such case, one additional operation is performed to skip the id (aka worst case)
assert_eq!(crate::Pallet::<T>::next_asset_id(), T::AssetId::from(0u8));

}: _(RawOrigin::Root, name.clone(), AssetType::Token, ed)
}: _(RawOrigin::Root, name.clone().try_into().unwrap(), AssetType::Token, ed)
verify {
let bname = crate::Pallet::<T>::to_bounded_name(name).unwrap();
assert_eq!(crate::Pallet::<T>::asset_ids(bname), Some(T::AssetId::from(1u8)));
Expand All @@ -43,15 +43,15 @@ benchmarks! {
let name = b"NAME".to_vec();
let ed = T::Balance::from(1_000_000u32);
assert_eq!(crate::Pallet::<T>::next_asset_id(), T::AssetId::from(0u8));
let _ = crate::Pallet::<T>::register(RawOrigin::Root.into(), name, AssetType::Token, ed);
let _ = crate::Pallet::<T>::register(RawOrigin::Root.into(), name.try_into().unwrap(), AssetType::Token, ed);

let new_name= vec![1; T::StringLimit::get() as usize];

let asset_id = T::AssetId::from(1u8);

let new_ed = T::Balance::from(2_000_000u32);

}: _(RawOrigin::Root, asset_id, new_name.clone(), AssetType::PoolShare(vec![T::AssetId::from(10u8),T::AssetId::from(20u8)]), Some(new_ed))
}: _(RawOrigin::Root, asset_id, new_name.clone().try_into().unwrap(), AssetType::PoolShare(vec![T::AssetId::from(10u8),T::AssetId::from(20u8)].try_into().unwrap()), Some(new_ed))
verify {
let bname = crate::Pallet::<T>::to_bounded_name(new_name).unwrap();
assert_eq!(crate::Pallet::<T>::asset_ids(&bname), Some(T::AssetId::from(1u8)));
Expand All @@ -62,7 +62,7 @@ benchmarks! {
let stored = stored.unwrap();

let expected = AssetDetails{
asset_type: AssetType::PoolShare(vec![T::AssetId::from(10u8), T::AssetId::from(20u8)]),
asset_type: AssetType::PoolShare(vec![T::AssetId::from(10u8), T::AssetId::from(20u8)].try_into().unwrap()),
locked: false,
existential_deposit: new_ed,
name: bname,};
Expand All @@ -77,13 +77,13 @@ benchmarks! {
let name = b"NAME".to_vec();
let ed = T::Balance::from(1_000_000u32);
assert_eq!(crate::Pallet::<T>::next_asset_id(), T::AssetId::from(0u8));
let _ = crate::Pallet::<T>::register(RawOrigin::Root.into(), name.clone(), AssetType::Token, ed);
let _ = crate::Pallet::<T>::register(RawOrigin::Root.into(), name.clone().try_into().unwrap(), AssetType::Token, ed);

let asset_id = T::AssetId::from(1u8);

let max_symbol = vec![1; T::StringLimit::get() as usize];

}: _(RawOrigin::Root, asset_id, max_symbol.clone(), 10u8)
}: _(RawOrigin::Root, asset_id, max_symbol.clone().try_into().unwrap(), 10u8)
verify {
let bname = crate::Pallet::<T>::to_bounded_name(name).unwrap();
let bsymbol= crate::Pallet::<T>::to_bounded_name(max_symbol).unwrap();
Expand All @@ -108,7 +108,7 @@ benchmarks! {
let name = b"NAME".to_vec();
let ed = T::Balance::from(1_000_000u32);
assert_eq!(crate::Pallet::<T>::next_asset_id(), T::AssetId::from(0u8));
let _ = crate::Pallet::<T>::register(RawOrigin::Root.into(), name.clone(), AssetType::Token, ed);
let _ = crate::Pallet::<T>::register(RawOrigin::Root.into(), name.clone().try_into().unwrap(), AssetType::Token, ed);

let asset_id = T::AssetId::from(1u8);

Expand Down
Loading