From 4cc7de19b6e5cdc8f2ba1dffde10f650897d9fce Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Tue, 7 Feb 2023 22:17:15 +0400 Subject: [PATCH 01/12] remove all transactional --- pallets/asset-registry/src/lib.rs | 8 ++++---- pallets/mixer/src/lib.rs | 4 ++-- pallets/vanchor/src/lib.rs | 4 ++-- pallets/xanchor/src/lib.rs | 2 +- standalone/runtime/src/lib.rs | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 5427e3a2b..e6cf33f80 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -269,7 +269,7 @@ pub mod pallet { /// Emits 'Registered` event when successful. #[pallet::weight(::WeightInfo::register())] #[pallet::call_index(0)] - #[transactional] + pub fn register( origin: OriginFor, name: BoundedVec, @@ -295,7 +295,7 @@ pub mod pallet { // TODO: No tests #[pallet::weight(::WeightInfo::update())] #[pallet::call_index(1)] - #[transactional] + pub fn update( origin: OriginFor, asset_id: T::AssetId, @@ -340,7 +340,7 @@ pub mod pallet { /// Emits `MetadataSet` event when successful. #[pallet::weight(::WeightInfo::set_metadata())] #[pallet::call_index(2)] - #[transactional] + pub fn set_metadata( origin: OriginFor, asset_id: T::AssetId, @@ -373,7 +373,7 @@ pub mod pallet { /// Emits `LocationSet` event when successful. #[pallet::weight(::WeightInfo::set_location())] #[pallet::call_index(3)] - #[transactional] + pub fn set_location( origin: OriginFor, asset_id: T::AssetId, diff --git a/pallets/mixer/src/lib.rs b/pallets/mixer/src/lib.rs index 140f2c41e..fce4a89af 100644 --- a/pallets/mixer/src/lib.rs +++ b/pallets/mixer/src/lib.rs @@ -242,7 +242,7 @@ pub mod pallet { Ok(().into()) } - #[transactional] + #[pallet::weight(>::WeightInfo::deposit())] #[pallet::call_index(1)] pub fn deposit( @@ -256,7 +256,7 @@ pub mod pallet { Ok(().into()) } - #[transactional] + #[pallet::weight(>::WeightInfo::withdraw())] #[pallet::call_index(2)] pub fn withdraw( diff --git a/pallets/vanchor/src/lib.rs b/pallets/vanchor/src/lib.rs index ca3b8b65d..62849b3a4 100644 --- a/pallets/vanchor/src/lib.rs +++ b/pallets/vanchor/src/lib.rs @@ -342,7 +342,7 @@ pub mod pallet { Ok(().into()) } - #[transactional] + #[pallet::weight(>::WeightInfo::transact())] #[pallet::call_index(1)] pub fn transact( @@ -356,7 +356,7 @@ pub mod pallet { Ok(().into()) } - #[transactional] + #[pallet::weight(>::WeightInfo::register_and_transact())] #[pallet::call_index(2)] pub fn register_and_transact( diff --git a/pallets/xanchor/src/lib.rs b/pallets/xanchor/src/lib.rs index fb89d34e7..346d8e5d7 100644 --- a/pallets/xanchor/src/lib.rs +++ b/pallets/xanchor/src/lib.rs @@ -318,7 +318,7 @@ pub mod pallet { /// **Note**: This method requires the `origin` to be a sibling /// parachain. - #[transactional] + #[pallet::weight(0)] #[pallet::call_index(2)] pub fn save_link_proposal( diff --git a/standalone/runtime/src/lib.rs b/standalone/runtime/src/lib.rs index 6b2fe6ba6..0ba161d52 100644 --- a/standalone/runtime/src/lib.rs +++ b/standalone/runtime/src/lib.rs @@ -1153,7 +1153,6 @@ impl pallet_mt::Config for Runtime { type Two = Two; type WeightInfo = pallet_mt::weights::WebbWeight; } - parameter_types! { pub const MaxParameterLength : u32 = 1000; } From 904457283b996639ab259987b82afe2f86dbaf64 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Tue, 7 Feb 2023 22:29:18 +0400 Subject: [PATCH 02/12] handle safe arithmetic --- pallets/asset-registry/src/lib.rs | 8 ++++---- pallets/mixer/src/lib.rs | 4 +--- pallets/mt/src/lib.rs | 6 +++--- pallets/vanchor/src/lib.rs | 5 +---- pallets/xanchor/src/lib.rs | 4 +++- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index e6cf33f80..4c583d55c 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -269,7 +269,7 @@ pub mod pallet { /// Emits 'Registered` event when successful. #[pallet::weight(::WeightInfo::register())] #[pallet::call_index(0)] - + pub fn register( origin: OriginFor, name: BoundedVec, @@ -295,7 +295,7 @@ pub mod pallet { // TODO: No tests #[pallet::weight(::WeightInfo::update())] #[pallet::call_index(1)] - + pub fn update( origin: OriginFor, asset_id: T::AssetId, @@ -340,7 +340,7 @@ pub mod pallet { /// Emits `MetadataSet` event when successful. #[pallet::weight(::WeightInfo::set_metadata())] #[pallet::call_index(2)] - + pub fn set_metadata( origin: OriginFor, asset_id: T::AssetId, @@ -373,7 +373,7 @@ pub mod pallet { /// Emits `LocationSet` event when successful. #[pallet::weight(::WeightInfo::set_location())] #[pallet::call_index(3)] - + pub fn set_location( origin: OriginFor, asset_id: T::AssetId, diff --git a/pallets/mixer/src/lib.rs b/pallets/mixer/src/lib.rs index fce4a89af..560db4c58 100644 --- a/pallets/mixer/src/lib.rs +++ b/pallets/mixer/src/lib.rs @@ -71,7 +71,7 @@ use frame_support::{ ensure, pallet_prelude::DispatchError, sp_runtime::traits::AccountIdConversion, traits::Get, PalletId, }; -use orml_traits::{currency::transactional, MultiCurrency}; +use orml_traits::MultiCurrency; use sp_std::prelude::*; use webb_primitives::{ hasher::InstanceHasher, @@ -242,7 +242,6 @@ pub mod pallet { Ok(().into()) } - #[pallet::weight(>::WeightInfo::deposit())] #[pallet::call_index(1)] pub fn deposit( @@ -256,7 +255,6 @@ pub mod pallet { Ok(().into()) } - #[pallet::weight(>::WeightInfo::withdraw())] #[pallet::call_index(2)] pub fn withdraw( diff --git a/pallets/mt/src/lib.rs b/pallets/mt/src/lib.rs index 1f61d75f0..0852d1f19 100644 --- a/pallets/mt/src/lib.rs +++ b/pallets/mt/src/lib.rs @@ -397,7 +397,7 @@ impl, I: 'static> TreeInterface, depth: u8) -> Result { // Setting the next tree id let tree_id = Self::next_tree_id(); - NextTreeId::::mutate(|id| *id += One::one()); + NextTreeId::::mutate(|id| id.saturating_add(One::one())); // get unit of two let two: T::LeafIndex = Self::two(); // get default edge nodes @@ -468,7 +468,7 @@ impl, I: 'static> TreeInterface::insert(id, root_index, hash); - NextLeafIndex::::mutate(id, |i| *i += One::one()); + NextLeafIndex::::mutate(id, |i| i.saturating_add(One::one())); // return the root Ok(hash) @@ -493,7 +493,7 @@ impl, I: 'static> TreeInspector>::WeightInfo::transact())] #[pallet::call_index(1)] pub fn transact( @@ -356,7 +354,6 @@ pub mod pallet { Ok(().into()) } - #[pallet::weight(>::WeightInfo::register_and_transact())] #[pallet::call_index(2)] pub fn register_and_transact( diff --git a/pallets/xanchor/src/lib.rs b/pallets/xanchor/src/lib.rs index 346d8e5d7..f7a880544 100644 --- a/pallets/xanchor/src/lib.rs +++ b/pallets/xanchor/src/lib.rs @@ -210,6 +210,8 @@ pub mod pallet { SendingLinkProposalFailed, /// Anchor Link is not found! AnchorLinkNotFound, + /// Invalid data for anchor update proposa + InvalidAnchorUpdateProposal } #[pallet::hooks] @@ -507,7 +509,7 @@ pub mod pallet { // get the anchor update proposal struct from the bytes let anchor_update_proposal = - AnchorUpdateProposal::try_from(anchor_update_proposal_bytes).unwrap(); + AnchorUpdateProposal::try_from(anchor_update_proposal_bytes).ok_or(Error::InvalidAnchorUpdateProposal)?; let (src_system, src_chain_id) = utils::parse_resource_id::( anchor_update_proposal.header().resource_id().into(), From c602f5a13cddefea5043c5309954e281c14e1155 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Tue, 7 Feb 2023 23:15:28 +0400 Subject: [PATCH 03/12] benchmark fixes --- pallets/asset-registry/Cargo.toml | 1 + pallets/asset-registry/src/benchmarking.rs | 10 +++++----- pallets/hasher/Cargo.toml | 1 + pallets/hasher/src/benchmarking.rs | 2 +- pallets/key-storage/Cargo.toml | 3 ++- pallets/key-storage/src/benchmarking.rs | 4 ++-- pallets/mt/Cargo.toml | 8 +++++--- pallets/mt/src/benchmarking.rs | 4 ++-- pallets/signature-bridge/src/benchmarking.rs | 6 +++--- pallets/vanchor-verifier/src/benchmarking.rs | 2 +- pallets/verifier/src/benchmarking.rs | 4 ++-- 11 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index 8d9c6ec20..109569b43 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -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", ] diff --git a/pallets/asset-registry/src/benchmarking.rs b/pallets/asset-registry/src/benchmarking.rs index 8ba633cdb..879001452 100644 --- a/pallets/asset-registry/src/benchmarking.rs +++ b/pallets/asset-registry/src/benchmarking.rs @@ -51,7 +51,7 @@ benchmarks! { 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::::to_bounded_name(new_name).unwrap(); assert_eq!(crate::Pallet::::asset_ids(&bname), Some(T::AssetId::from(1u8))); @@ -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,}; @@ -77,13 +77,13 @@ benchmarks! { let name = b"NAME".to_vec(); let ed = T::Balance::from(1_000_000u32); assert_eq!(crate::Pallet::::next_asset_id(), T::AssetId::from(0u8)); - let _ = crate::Pallet::::register(RawOrigin::Root.into(), name.clone(), AssetType::Token, ed); + let _ = crate::Pallet::::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::::to_bounded_name(name).unwrap(); let bsymbol= crate::Pallet::::to_bounded_name(max_symbol).unwrap(); @@ -108,7 +108,7 @@ benchmarks! { let name = b"NAME".to_vec(); let ed = T::Balance::from(1_000_000u32); assert_eq!(crate::Pallet::::next_asset_id(), T::AssetId::from(0u8)); - let _ = crate::Pallet::::register(RawOrigin::Root.into(), name.clone(), AssetType::Token, ed); + let _ = crate::Pallet::::register(RawOrigin::Root.into(), name.clone().try_into().unwrap(), AssetType::Token, ed); let asset_id = T::AssetId::from(1u8); diff --git a/pallets/hasher/Cargo.toml b/pallets/hasher/Cargo.toml index dccc45c64..cc0e668f7 100644 --- a/pallets/hasher/Cargo.toml +++ b/pallets/hasher/Cargo.toml @@ -54,6 +54,7 @@ std = [ "webb-primitives/hashing", ] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] \ No newline at end of file diff --git a/pallets/hasher/src/benchmarking.rs b/pallets/hasher/src/benchmarking.rs index 489d128db..a36578fb7 100644 --- a/pallets/hasher/src/benchmarking.rs +++ b/pallets/hasher/src/benchmarking.rs @@ -50,7 +50,7 @@ benchmarks_instance_pallet! { let c in 0..MAX_PARAMETER_LENGTH; let depositor: T::AccountId = account("depositor", 0, SEED); let parameters = vec![0u8;c as usize]; - }: _(RawOrigin::Root, parameters.clone()) + }: _(RawOrigin::Root, parameters.clone().try_into().unwrap()) verify { assert_eq!(Pallet::::parameters(), parameters); } diff --git a/pallets/key-storage/Cargo.toml b/pallets/key-storage/Cargo.toml index 98ae6a8f5..8d22a8707 100644 --- a/pallets/key-storage/Cargo.toml +++ b/pallets/key-storage/Cargo.toml @@ -21,6 +21,7 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } webb-primitives = { path = "../../primitives", default-features = false, features = ["verifying"] } frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] serde = { version = "1.0.119" } @@ -28,7 +29,6 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst 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" } pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } [features] default = ["std"] @@ -42,6 +42,7 @@ std = [ "frame-benchmarking/std" ] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] diff --git a/pallets/key-storage/src/benchmarking.rs b/pallets/key-storage/src/benchmarking.rs index 692dbdea1..4b5fad6d4 100644 --- a/pallets/key-storage/src/benchmarking.rs +++ b/pallets/key-storage/src/benchmarking.rs @@ -34,9 +34,9 @@ benchmarks_instance_pallet! { let c in 0..MAX_PARAMETER_LENGTH; let owner: T::AccountId = whitelisted_caller(); let public_key = vec![0u8;c as usize]; - }: _(RawOrigin::Signed(owner.clone()), owner.clone(), public_key.clone()) + }: _(RawOrigin::Signed(owner.clone()), owner.clone(), public_key.clone().try_into().unwrap()) verify { - assert_last_event::(Event::PublicKeyRegistration{owner, public_key}.into()); + assert_last_event::(Event::PublicKeyRegistration{owner, public_key : public_key.try_into().unwrap()}.into()); } } diff --git a/pallets/mt/Cargo.toml b/pallets/mt/Cargo.toml index 7bb6b0179..bf68c8a46 100644 --- a/pallets/mt/Cargo.toml +++ b/pallets/mt/Cargo.toml @@ -12,15 +12,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] 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"] } - 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-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" } webb-primitives = { path = "../../primitives", default-features = false } - +arkworks-setups = { version = "1.2.1", default-features = false } frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +pallet-hasher = {path = "../hasher", default-features = false} ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } [dev-dependencies] @@ -36,7 +36,7 @@ ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-featu ark-ff = { version = "^0.3.0", default-features = false } ark-std = { version = "^0.3.0", default-features = false } ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } -arkworks-setups = { version = "1.2.1", default-features = false } + [features] default = ["std"] @@ -49,8 +49,10 @@ std = [ "sp-std/std", "pallet-hasher/std", "webb-primitives/std", + "pallet-hasher/std" ] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] \ No newline at end of file diff --git a/pallets/mt/src/benchmarking.rs b/pallets/mt/src/benchmarking.rs index 24eaba343..10ecb747c 100644 --- a/pallets/mt/src/benchmarking.rs +++ b/pallets/mt/src/benchmarking.rs @@ -49,7 +49,7 @@ benchmarks_instance_pallet! { create { let d in 1..>::MaxTreeDepth::get() as u32; - pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params()).unwrap(); + pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params().try_into().unwrap()).unwrap(); let caller: T::AccountId = whitelisted_caller(); <>::Currency as Currency>::make_free_balance_be(&caller, BalanceOf::::max_value()); let tree_id = Pallet::::next_tree_id(); @@ -61,7 +61,7 @@ benchmarks_instance_pallet! { insert { let caller: T::AccountId = whitelisted_caller(); - pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params()).unwrap(); + pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params().try_into().unwrap()).unwrap(); let tree_id: T::TreeId = as TreeInterface<_,_,_>>::create(Some(caller.clone()), T::MaxTreeDepth::get()).unwrap(); let leaf_index = Pallet::::next_leaf_index(tree_id); let element: T::Element = T::DefaultZeroElement::get(); diff --git a/pallets/signature-bridge/src/benchmarking.rs b/pallets/signature-bridge/src/benchmarking.rs index 27437e850..3e2014240 100644 --- a/pallets/signature-bridge/src/benchmarking.rs +++ b/pallets/signature-bridge/src/benchmarking.rs @@ -65,7 +65,7 @@ fn make_proposal_data(encoded_r_id: Vec, nonce: [u8; 4], encoded_call: Vec, I: 'static>(pub_key: sp_core::ecdsa::Public) -> Vec { let maintainer_key = libsecp256k1::PublicKey::parse_compressed(&pub_key.0).unwrap().serialize()[1..].to_vec(); - Maintainer::::put(maintainer_key.clone()); + Maintainer::::put(maintainer_key.clone().try_into().unwrap()); maintainer_key } @@ -90,9 +90,9 @@ benchmarks_instance_pallet! { force_set_maintainer { let caller: T::AccountId = whitelisted_caller(); let new_maintainer = ecdsa_generate(DUMMY, None); - }: _(RawOrigin::Root, new_maintainer.encode()) + }: _(RawOrigin::Root, new_maintainer.encode().try_into().unwrap()) verify { - assert_last_event::(Event::MaintainerSet{old_maintainer: Default::default(), new_maintainer: new_maintainer.encode()}.into()); + assert_last_event::(Event::MaintainerSet{old_maintainer: Default::default(), new_maintainer: new_maintainer.encode().try_into().unwrap()}.into()); } set_resource { diff --git a/pallets/vanchor-verifier/src/benchmarking.rs b/pallets/vanchor-verifier/src/benchmarking.rs index 726eaeeac..c88f01fca 100644 --- a/pallets/vanchor-verifier/src/benchmarking.rs +++ b/pallets/vanchor-verifier/src/benchmarking.rs @@ -45,7 +45,7 @@ benchmarks_instance_pallet! { let c in 0..MAX_VERIFIER_LENGTH; let depositor: T::AccountId = account("depositor", 0, SEED); let parameters = vec![0u8;c as usize]; - }: _(RawOrigin::Root, (1u8,1u8), parameters.clone()) + }: _(RawOrigin::Root, (1u8,1u8), parameters.clone().try_into().unwrap()); verify { assert_eq!(Pallet::::parameters((1u8,1u8)), parameters); } diff --git a/pallets/verifier/src/benchmarking.rs b/pallets/verifier/src/benchmarking.rs index 4b800f15e..c7765ebfa 100644 --- a/pallets/verifier/src/benchmarking.rs +++ b/pallets/verifier/src/benchmarking.rs @@ -45,9 +45,9 @@ benchmarks_instance_pallet! { let c in 0..MAX_VERIFIER_LENGTH; let depositor: T::AccountId = account("depositor", 0, SEED); let parameters = vec![0u8;c as usize]; - }: _(RawOrigin::Root, parameters.clone()) + }: _(RawOrigin::Root, parameters.clone().try_into().unwrap()) verify { - assert_eq!(Pallet::::parameters(), parameters); + assert_eq!(Pallet::::parameters(), parameters.try_into().unwrap()); } } From d24ba26b3837f5e2484b4f732432c563f0aeb9ac Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Wed, 8 Feb 2023 23:21:01 +0400 Subject: [PATCH 04/12] benchmark fixes --- pallets/asset-registry/src/benchmarking.rs | 4 ++-- pallets/linkable-tree/Cargo.toml | 1 + pallets/mt/src/benchmarking.rs | 2 +- pallets/signature-bridge/src/benchmarking.rs | 15 ++++++++------- pallets/vanchor-verifier/src/benchmarking.rs | 2 +- pallets/verifier/src/benchmarking.rs | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pallets/asset-registry/src/benchmarking.rs b/pallets/asset-registry/src/benchmarking.rs index 879001452..eed5df331 100644 --- a/pallets/asset-registry/src/benchmarking.rs +++ b/pallets/asset-registry/src/benchmarking.rs @@ -33,7 +33,7 @@ benchmarks! { // In such case, one additional operation is performed to skip the id (aka worst case) assert_eq!(crate::Pallet::::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::::to_bounded_name(name).unwrap(); assert_eq!(crate::Pallet::::asset_ids(bname), Some(T::AssetId::from(1u8))); @@ -43,7 +43,7 @@ benchmarks! { let name = b"NAME".to_vec(); let ed = T::Balance::from(1_000_000u32); assert_eq!(crate::Pallet::::next_asset_id(), T::AssetId::from(0u8)); - let _ = crate::Pallet::::register(RawOrigin::Root.into(), name, AssetType::Token, ed); + let _ = crate::Pallet::::register(RawOrigin::Root.into(), name.try_into().unwrap(), AssetType::Token, ed); let new_name= vec![1; T::StringLimit::get() as usize]; diff --git a/pallets/linkable-tree/Cargo.toml b/pallets/linkable-tree/Cargo.toml index 1df574e8b..247ebe53a 100644 --- a/pallets/linkable-tree/Cargo.toml +++ b/pallets/linkable-tree/Cargo.toml @@ -61,6 +61,7 @@ std = [ "frame-benchmarking/std" ] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] \ No newline at end of file diff --git a/pallets/mt/src/benchmarking.rs b/pallets/mt/src/benchmarking.rs index 10ecb747c..0a8383aef 100644 --- a/pallets/mt/src/benchmarking.rs +++ b/pallets/mt/src/benchmarking.rs @@ -76,7 +76,7 @@ benchmarks_instance_pallet! { let default_hashes = vec![>::DefaultZeroElement::get();p as usize]; - }:_(RawOrigin::Root, default_hashes) + }:_(RawOrigin::Root, default_hashes.try_into().unwrap()) verify { assert_eq!(DefaultHashes::::get().len(), p as usize) } diff --git a/pallets/signature-bridge/src/benchmarking.rs b/pallets/signature-bridge/src/benchmarking.rs index 3e2014240..e5787b7d7 100644 --- a/pallets/signature-bridge/src/benchmarking.rs +++ b/pallets/signature-bridge/src/benchmarking.rs @@ -30,6 +30,7 @@ use webb_primitives::{ utils::{compute_chain_id_type, derive_resource_id}, webb_proposals::SubstrateTargetSystem, }; +use frame_support::BoundedVec; /// Helper function to test last event fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) { @@ -63,10 +64,10 @@ fn make_proposal_data(encoded_r_id: Vec, nonce: [u8; 4], encoded_call: Vec, I: 'static>(pub_key: sp_core::ecdsa::Public) -> Vec { - let maintainer_key = - libsecp256k1::PublicKey::parse_compressed(&pub_key.0).unwrap().serialize()[1..].to_vec(); - Maintainer::::put(maintainer_key.clone().try_into().unwrap()); - maintainer_key + let maintainer_key : BoundedVec = + libsecp256k1::PublicKey::parse_compressed(&pub_key.0).unwrap().serialize()[1..].to_vec().try_into().unwrap(); + Maintainer::::put(maintainer_key.clone()); + maintainer_key.into_inner() } /// Return the src_chain_id in correct format @@ -82,9 +83,9 @@ benchmarks_instance_pallet! { set_maintainer { let caller: T::AccountId = whitelisted_caller(); let (old_maintainer, message, signature) = generate_maintainer_signatures::(); - }: _(RawOrigin::Signed(caller), message.clone(), signature) + }: _(RawOrigin::Signed(caller), message.clone().try_into().unwrap(), signature.try_into().unwrap()) verify { - assert_last_event::(Event::MaintainerSet{old_maintainer: old_maintainer, new_maintainer: message}.into()); + assert_last_event::(Event::MaintainerSet{old_maintainer: old_maintainer.try_into().unwrap(), new_maintainer: message.try_into().unwrap()}.into()); } force_set_maintainer { @@ -135,7 +136,7 @@ benchmarks_instance_pallet! { let prop_data = make_proposal_data(r_id.encode(), nonce, call_encoded); let msg = keccak_256(&prop_data); let signature = ecdsa_sign_prehashed(DUMMY, &maintainer, &msg).unwrap(); - }: _(RawOrigin::Signed(caller), src_id.into(), prop_data, signature.encode()) + }: _(RawOrigin::Signed(caller), src_id.into(), prop_data.try_into().unwrap(), signature.encode().try_into().unwrap()) verify { assert_last_event::(Event::ProposalSucceeded{chain_id : src_id.into(), proposal_nonce : 1_u32.into()}.into()); } diff --git a/pallets/vanchor-verifier/src/benchmarking.rs b/pallets/vanchor-verifier/src/benchmarking.rs index c88f01fca..5c1ca3c0a 100644 --- a/pallets/vanchor-verifier/src/benchmarking.rs +++ b/pallets/vanchor-verifier/src/benchmarking.rs @@ -45,7 +45,7 @@ benchmarks_instance_pallet! { let c in 0..MAX_VERIFIER_LENGTH; let depositor: T::AccountId = account("depositor", 0, SEED); let parameters = vec![0u8;c as usize]; - }: _(RawOrigin::Root, (1u8,1u8), parameters.clone().try_into().unwrap()); + }: _(RawOrigin::Root, (1u8,1u8), parameters.clone().try_into().unwrap()) verify { assert_eq!(Pallet::::parameters((1u8,1u8)), parameters); } diff --git a/pallets/verifier/src/benchmarking.rs b/pallets/verifier/src/benchmarking.rs index c7765ebfa..1137857ba 100644 --- a/pallets/verifier/src/benchmarking.rs +++ b/pallets/verifier/src/benchmarking.rs @@ -47,7 +47,7 @@ benchmarks_instance_pallet! { let parameters = vec![0u8;c as usize]; }: _(RawOrigin::Root, parameters.clone().try_into().unwrap()) verify { - assert_eq!(Pallet::::parameters(), parameters.try_into().unwrap()); + assert_eq!(Pallet::::parameters().into_inner(), parameters); } } From 8452f29f1759585afb64ab62da52b2569e28af77 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Thu, 9 Feb 2023 00:09:05 +0400 Subject: [PATCH 05/12] benchmark build works --- Cargo.lock | 1 + pallets/linkable-tree/Cargo.toml | 3 +- pallets/mixer/Cargo.toml | 4 +-- pallets/signature-bridge/src/benchmarking.rs | 2 +- pallets/token-wrapper/Cargo.toml | 1 + pallets/token-wrapper/src/benchmarking.rs | 35 ++++++++++---------- pallets/vanchor/Cargo.toml | 15 ++++++--- pallets/vanchor/src/benchmarking.rs | 4 +-- pallets/vanchor/src/benchmarking_utils.rs | 6 ++-- standalone/node/Cargo.toml | 5 ++- standalone/runtime/src/lib.rs | 10 ++---- 11 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b3edee8f..2ed0ea57f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5281,6 +5281,7 @@ dependencies = [ "frame-support", "frame-system", "frame-system-benchmarking", + "getrandom 0.2.8", "orml-currencies", "orml-tokens", "orml-traits", diff --git a/pallets/linkable-tree/Cargo.toml b/pallets/linkable-tree/Cargo.toml index 247ebe53a..448d16d27 100644 --- a/pallets/linkable-tree/Cargo.toml +++ b/pallets/linkable-tree/Cargo.toml @@ -21,7 +21,7 @@ pallet-mt = { path = "../mt", default-features = false } webb-primitives = { path = "../../primitives", default-features = false } frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } - +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } serde = { version = "1.0.119", optional = true } @@ -42,7 +42,6 @@ ark-std = { version = "^0.3.0", default-features = false } ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] } arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } [features] default = ["std"] diff --git a/pallets/mixer/Cargo.toml b/pallets/mixer/Cargo.toml index 10b1538fb..ea831bf8f 100644 --- a/pallets/mixer/Cargo.toml +++ b/pallets/mixer/Cargo.toml @@ -20,7 +20,7 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li pallet-mt = {path = "../mt", default-features = false} 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" } - +frame-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-system-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] @@ -46,11 +46,11 @@ hex = "0.4" 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" } -frame-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } [features] default = ["std"] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] diff --git a/pallets/signature-bridge/src/benchmarking.rs b/pallets/signature-bridge/src/benchmarking.rs index e5787b7d7..48720730a 100644 --- a/pallets/signature-bridge/src/benchmarking.rs +++ b/pallets/signature-bridge/src/benchmarking.rs @@ -163,7 +163,7 @@ benchmarks_instance_pallet! { let prop_data = make_proposal_data(r_id.encode(), nonce, call_encoded); let msg = keccak_256(&prop_data); let signature = ecdsa_sign_prehashed(DUMMY, &maintainer, &msg).unwrap(); - }: _(RawOrigin::Signed(caller), src_id.into(), prop_data, signature.encode()) + }: _(RawOrigin::Signed(caller), src_id.into(), prop_data.try_into().unwrap(), signature.encode().try_into().unwrap()) verify { assert_last_event::(Event::ProposalSucceeded{chain_id : src_id.into(), proposal_nonce : 1_u32.into()}.into()); } diff --git a/pallets/token-wrapper/Cargo.toml b/pallets/token-wrapper/Cargo.toml index 2a0547971..283b139f4 100644 --- a/pallets/token-wrapper/Cargo.toml +++ b/pallets/token-wrapper/Cargo.toml @@ -39,6 +39,7 @@ webb-primitives = {path = "../../primitives", default-features = false} [features] default = ["std"] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] diff --git a/pallets/token-wrapper/src/benchmarking.rs b/pallets/token-wrapper/src/benchmarking.rs index 996429edb..068962471 100644 --- a/pallets/token-wrapper/src/benchmarking.rs +++ b/pallets/token-wrapper/src/benchmarking.rs @@ -22,7 +22,7 @@ use super::*; use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; - +use frame_support::BoundedVec; use crate::traits::TokenWrapperInterface; use asset_registry::{Registry, ShareTokenRegistry}; use frame_support::dispatch::DispatchError; @@ -40,18 +40,18 @@ benchmarks! { let existential_balance: u32 = 1000; let balance: u32 = 10_000; let recipient: T::AccountId = whitelisted_caller(); - let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool, DispatchError>>::create_asset( &b"shib".to_vec(), existential_balance.into(), ) .unwrap(); - let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool, DispatchError>>::create_asset( &b"doge".to_vec(), existential_balance.into(), ) .unwrap(); - let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, DispatchError>>::create_shared_asset( + let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, ::MaxAssetIdInPool, DispatchError>>::create_shared_asset( &b"meme".to_vec(), &vec![second_token_id, first_token_id], existential_balance.into(), @@ -85,18 +85,18 @@ benchmarks! { let existential_balance: u32 = 1000; let balance: u32 = 10_000; let recipient: T::AccountId = whitelisted_caller(); - let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"shib".to_vec(), existential_balance.into(), ) .unwrap(); - let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"doge".to_vec(), existential_balance.into(), ) .unwrap(); - let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, DispatchError>>::create_shared_asset( + let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_shared_asset( &b"meme".to_vec(), &vec![second_token_id, first_token_id], existential_balance.into(), @@ -127,18 +127,18 @@ benchmarks! { let existential_balance: u32 = 1000; let balance: u32 = 10_000; let recipient: T::AccountId = whitelisted_caller(); - let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"shib".to_vec(), existential_balance.into(), ) .unwrap(); - let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"doge".to_vec(), existential_balance.into(), ) .unwrap(); - let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, DispatchError>>::create_shared_asset( + let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_shared_asset( &b"meme".to_vec(), &vec![second_token_id, first_token_id], existential_balance.into(), @@ -158,18 +158,18 @@ benchmarks! { set_fee_recipient { let existential_balance: u32 = 1000; - let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"shib".to_vec(), existential_balance.into(), ) .unwrap(); - let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"doge".to_vec(), existential_balance.into(), ) .unwrap(); - let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, DispatchError>>::create_shared_asset( + let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_shared_asset( &b"meme".to_vec(), &vec![second_token_id, first_token_id], existential_balance.into(), @@ -190,18 +190,18 @@ benchmarks! { rescue_tokens { let existential_balance: u32 = 1000; - let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let first_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_asset( &b"shib".to_vec(), existential_balance.into(), ) .unwrap(); - let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec, DispatchError>>::create_asset( + let second_token_id = <::AssetRegistry as Registry<::AssetId, Vec, ::Balance, BoundedVec,::MaxAssetIdInPool, DispatchError>>::create_asset( &b"doge".to_vec(), existential_balance.into(), ) .unwrap(); let pool_asset_name = b"meme".to_vec(); - let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, DispatchError>>::create_shared_asset( + let pool_share_id = <::AssetRegistry as ShareTokenRegistry<::AssetId, Vec, T::Balance, BoundedVec, ::MaxAssetIdInPool,DispatchError>>::create_shared_asset( &pool_asset_name, &vec![second_token_id, first_token_id], existential_balance.into(), @@ -209,7 +209,8 @@ benchmarks! { .unwrap(); let fee_recipient: T::AccountId = whitelisted_caller(); - FeeRecipient::::insert(pool_asset_name, &fee_recipient); + let bounded_name : BoundedVec = pool_asset_name.try_into().unwrap(); + FeeRecipient::::insert(bounded_name, &fee_recipient); let amount: u32 = 10_000; <::Currency as MultiCurrency>::deposit( diff --git a/pallets/vanchor/Cargo.toml b/pallets/vanchor/Cargo.toml index 68c147923..51c3bea1f 100644 --- a/pallets/vanchor/Cargo.toml +++ b/pallets/vanchor/Cargo.toml @@ -18,17 +18,24 @@ frame-system = { default-features = false, git = "https://github.com/paritytech/ 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" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +pallet-hasher = { path = "../hasher", default-features = false } pallet-linkable-tree = { path = "../linkable-tree", default-features = false } pallet-mt = { path = "../mt", default-features = false } +pallet-vanchor-verifier = { path = "../vanchor-verifier", default-features = false } webb-primitives = { path = "../../primitives", default-features = false, features = ["hashing", "verifying", "field_ops"] } 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-token-wrapper = { path = "../token-wrapper", default-features = false } frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } +arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } arkworks-native-gadgets = { version = "1.2.0", default-features = false } ark-std = { version = "^0.3.0", default-features = false } ark-ff = { version = "^0.3.0", 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 } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } +getrandom = { version = "0.2", features = ["js"] } [dev-dependencies] serde = { version = "1.0.119" } @@ -38,12 +45,9 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-key-storage = {path = "../key-storage"} -pallet-hasher = { path = "../hasher", default-features = false } -pallet-vanchor-verifier = { path = "../vanchor-verifier", 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 } orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } rand = "0.8.4" -arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } 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 } @@ -53,7 +57,6 @@ ark-groth16 = { version = "^0.3.0", default-features = false } ark-std = { version = "^0.3.0", default-features = false } ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } ark-bls12-381 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } [features] default = ["std"] @@ -66,6 +69,7 @@ std = [ "sp-std/std", "pallet-hasher/std", "pallet-linkable-tree/std", + "pallet-vanchor-verifier/std", "pallet-asset-registry/std", "webb-primitives/std", "frame-benchmarking/std", @@ -73,6 +77,7 @@ std = [ "ark-std/std" ] runtime-benchmarks = [ + "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", -] +] \ No newline at end of file diff --git a/pallets/vanchor/src/benchmarking.rs b/pallets/vanchor/src/benchmarking.rs index 51f63655c..e26a8a83b 100644 --- a/pallets/vanchor/src/benchmarking.rs +++ b/pallets/vanchor/src/benchmarking.rs @@ -56,7 +56,7 @@ where T: pallet_hasher::Config, { // Initialize hasher pallet - pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params()) + pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params().try_into().unwrap()) .unwrap(); // 2. Initialize MerkleTree pallet. @@ -118,7 +118,7 @@ benchmarks_instance_pallet! { let i in 1..MAX_EDGES; let d in 1..>::MaxTreeDepth::get() as u32; - pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params()).unwrap(); + pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params().try_into().unwrap()).unwrap(); let asset_id = <>::NativeCurrencyId as Get>>::get(); }: _(RawOrigin::Root, i, d as u8, asset_id) diff --git a/pallets/vanchor/src/benchmarking_utils.rs b/pallets/vanchor/src/benchmarking_utils.rs index b33de4dcf..9b2cbf2c3 100644 --- a/pallets/vanchor/src/benchmarking_utils.rs +++ b/pallets/vanchor/src/benchmarking_utils.rs @@ -1,6 +1,6 @@ #![cfg(feature = "runtime-benchmarks")] use ark_ff::{BigInteger, PrimeField}; -use ark_std::{collections::BTreeMap, rand::thread_rng, vec::Vec}; +use ark_std::{collections::BTreeMap, vec::Vec}; use arkworks_native_gadgets::poseidon::Poseidon; use arkworks_setups::{ common::{setup_params, setup_tree_and_create_path}, @@ -34,7 +34,7 @@ pub fn setup_utxos( indices: Option<[u64; NUM_UTXOS]>, ) -> [Utxo; NUM_UTXOS] { let curve = Curve::Bn254; - let rng = &mut thread_rng(); + let rng = &mut ark_std::test_rng(); // Input Utxos let indices: [Option; NUM_UTXOS] = if indices.is_some() { let ind_unw = indices.unwrap(); @@ -75,7 +75,7 @@ pub fn setup_zk_circuit( custom_root: Element, ) -> (Vec, Vec) { let curve = Curve::Bn254; - let rng = &mut thread_rng(); + let rng = &mut ark_std::test_rng(); let leaf0 = in_utxos[0].commitment.into_repr().to_bytes_be(); let leaf1 = in_utxos[1].commitment.into_repr().to_bytes_be(); diff --git a/standalone/node/Cargo.toml b/standalone/node/Cargo.toml index f8971d341..7b2b6f85d 100644 --- a/standalone/node/Cargo.toml +++ b/standalone/node/Cargo.toml @@ -107,4 +107,7 @@ default = ["cli"] cli = [ "clap" ] -runtime-benchmarks = ["webb-runtime/runtime-benchmarks"] +runtime-benchmarks = ["webb-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", +] diff --git a/standalone/runtime/src/lib.rs b/standalone/runtime/src/lib.rs index 0ba161d52..ce1bb4122 100644 --- a/standalone/runtime/src/lib.rs +++ b/standalone/runtime/src/lib.rs @@ -990,8 +990,6 @@ impl pallet_assets::Config for Runtime { type Extra = (); type WeightInfo = pallet_assets::weights::SubstrateWeight; type RemoveItemsLimit = ConstU32<1000>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); } impl pallet_sudo::Config for Runtime { @@ -1165,7 +1163,7 @@ impl pallet_verifier::Config for Runtime { type WeightInfo = pallet_verifier::weights::WebbWeight; } -impl pallet_vanchor_verifier::Config for Runtime { +impl pallet_vanchor_verifier::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ForceOrigin = frame_system::EnsureRoot; type Verifier = ArkworksVerifierBn254; @@ -1471,7 +1469,7 @@ construct_runtime!( MixerVerifierBn254: pallet_verifier::::{Pallet, Call, Storage, Event, Config}, // VAnchor Verifier - VAnchorVerifier: pallet_vanchor_verifier::{Pallet, Call, Storage, Event, Config}, + VAnchorVerifier: pallet_vanchor_verifier::::{Pallet, Call, Storage, Event, Config}, // Merkle Tree MerkleTreeBn254: pallet_mt::::{Pallet, Call, Storage, Event, Config}, @@ -1768,11 +1766,9 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_mt, MerkleTreeBn254); list_benchmark!(list, extra, pallet_linkable_tree, LinkableTreeBn254); list_benchmark!(list, extra, pallet_vanchor, VAnchorBn254); - list_benchmark!(list, extra, pallet_vanchor_handler, VAnchorHandlerBn254); list_benchmark!(list, extra, pallet_mixer, MixerBn254); list_benchmark!(list, extra, pallet_verifier, MixerVerifierBn254); list_benchmark!(list, extra, pallet_token_wrapper, TokenWrapper); - list_benchmark!(list, extra, pallet_token_wrapper_handler, TokenWrapperHandler); list_benchmark!(list, extra, pallet_signature_bridge, SignatureBridge); list_benchmark!(list, extra, pallet_relayer_registry, RelayerRegistry); list_benchmark!(list, extra, pallet_key_storage, KeyStorage); @@ -1809,11 +1805,9 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_mt, MerkleTreeBn254); add_benchmark!(params, batches, pallet_linkable_tree, LinkableTreeBn254); add_benchmark!(params, batches, pallet_vanchor, VAnchorBn254); - add_benchmark!(params, batches, pallet_vanchor_handler, VAnchorHandlerBn254); add_benchmark!(params, batches, pallet_mixer, MixerBn254); add_benchmark!(params, batches, pallet_verifier, MixerVerifierBn254); add_benchmark!(params, batches, pallet_token_wrapper, TokenWrapper); - add_benchmark!(params, batches, pallet_token_wrapper_handler, TokenWrapperHandler); add_benchmark!(params, batches, pallet_signature_bridge, SignatureBridge); add_benchmark!(params, batches, pallet_relayer_registry, RelayerRegistry); add_benchmark!(params, batches, pallet_key_storage, KeyStorage); From 197456fe5a61ab1c98a7b9d4a0f2f474f79f10ad Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Thu, 9 Feb 2023 00:10:11 +0400 Subject: [PATCH 06/12] add benchmark check to ci --- .github/workflows/check.yml | 3 +++ pallets/signature-bridge/src/benchmarking.rs | 9 ++++++--- pallets/token-wrapper/src/benchmarking.rs | 5 ++--- pallets/vanchor/src/benchmarking.rs | 7 +++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5a37bee54..b40ed8c37 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -64,3 +64,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 diff --git a/pallets/signature-bridge/src/benchmarking.rs b/pallets/signature-bridge/src/benchmarking.rs index 48720730a..424f5fda9 100644 --- a/pallets/signature-bridge/src/benchmarking.rs +++ b/pallets/signature-bridge/src/benchmarking.rs @@ -20,6 +20,7 @@ use super::*; use frame_benchmarking::{ benchmarks_instance_pallet, impl_benchmark_test_suite, whitelisted_caller, }; +use frame_support::BoundedVec; use frame_system::RawOrigin; use sp_io::{ crypto::{ecdsa_generate, ecdsa_sign_prehashed}, @@ -30,7 +31,6 @@ use webb_primitives::{ utils::{compute_chain_id_type, derive_resource_id}, webb_proposals::SubstrateTargetSystem, }; -use frame_support::BoundedVec; /// Helper function to test last event fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) { @@ -64,8 +64,11 @@ fn make_proposal_data(encoded_r_id: Vec, nonce: [u8; 4], encoded_call: Vec, I: 'static>(pub_key: sp_core::ecdsa::Public) -> Vec { - let maintainer_key : BoundedVec = - libsecp256k1::PublicKey::parse_compressed(&pub_key.0).unwrap().serialize()[1..].to_vec().try_into().unwrap(); + let maintainer_key: BoundedVec = + libsecp256k1::PublicKey::parse_compressed(&pub_key.0).unwrap().serialize()[1..] + .to_vec() + .try_into() + .unwrap(); Maintainer::::put(maintainer_key.clone()); maintainer_key.into_inner() } diff --git a/pallets/token-wrapper/src/benchmarking.rs b/pallets/token-wrapper/src/benchmarking.rs index 068962471..c39f38502 100644 --- a/pallets/token-wrapper/src/benchmarking.rs +++ b/pallets/token-wrapper/src/benchmarking.rs @@ -21,11 +21,10 @@ use super::*; -use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; -use frame_support::BoundedVec; use crate::traits::TokenWrapperInterface; use asset_registry::{Registry, ShareTokenRegistry}; -use frame_support::dispatch::DispatchError; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller}; +use frame_support::{dispatch::DispatchError, BoundedVec}; use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_std::vec; diff --git a/pallets/vanchor/src/benchmarking.rs b/pallets/vanchor/src/benchmarking.rs index e26a8a83b..c37eb747c 100644 --- a/pallets/vanchor/src/benchmarking.rs +++ b/pallets/vanchor/src/benchmarking.rs @@ -56,8 +56,11 @@ where T: pallet_hasher::Config, { // Initialize hasher pallet - pallet_hasher::Pallet::::force_set_parameters(RawOrigin::Root.into(), hasher_params().try_into().unwrap()) - .unwrap(); + pallet_hasher::Pallet::::force_set_parameters( + RawOrigin::Root.into(), + hasher_params().try_into().unwrap(), + ) + .unwrap(); // 2. Initialize MerkleTree pallet. as OnInitialize<_>>::on_initialize(Default::default()); From 8ef6a02a8f677418bc8fd59ffe3d6222a2427c47 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Thu, 9 Feb 2023 16:17:03 +0400 Subject: [PATCH 07/12] fix tests --- pallets/linkable-tree/src/mock.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/linkable-tree/src/mock.rs b/pallets/linkable-tree/src/mock.rs index 73546a3e5..008d050f6 100644 --- a/pallets/linkable-tree/src/mock.rs +++ b/pallets/linkable-tree/src/mock.rs @@ -156,9 +156,9 @@ impl ElementTrait for Element { parameter_types! { #[derive(Debug, TypeInfo)] - pub const MaxEdges: u32 = 1000; + pub const MaxEdges: u32 = 100000; #[derive(Debug, TypeInfo)] - pub const MaxDefaultHashes: u32 = 1000; + pub const MaxDefaultHashes: u32 = 100000; } impl pallet_mt::Config for Test { From 7d7a1fad7fe3916814f07f817002e05b511636af Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:30:27 +0530 Subject: [PATCH 08/12] fix clippy --- client/src/lib.rs | 1 + pallets/asset-registry/src/lib.rs | 6 ++---- pallets/asset-registry/src/traits.rs | 1 + pallets/key-storage/src/lib.rs | 1 + pallets/mt/src/lib.rs | 1 + pallets/token-wrapper/src/traits.rs | 1 + pallets/vanchor-verifier/src/lib.rs | 2 +- primitives/src/types/mod.rs | 1 + primitives/src/types/vanchor.rs | 19 ++++++++++--------- 9 files changed, 19 insertions(+), 14 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index 90c0ba0f7..b1ec15dda 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1,2 +1,3 @@ +#![allow(clippy::too_many_arguments)] #[subxt::subxt(runtime_metadata_path = "metadata/protocol_substrate_runtime.scale")] pub mod webb_runtime {} diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 4c583d55c..4103ba1f4 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -14,12 +14,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. - +#![allow(clippy::type_complexity)] #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{ - dispatch::DispatchError, pallet_prelude::*, sp_runtime::traits::CheckedAdd, transactional, -}; +use frame_support::{dispatch::DispatchError, pallet_prelude::*, sp_runtime::traits::CheckedAdd}; use frame_system::pallet_prelude::*; use sp_arithmetic::traits::BaseArithmetic; use sp_std::{ diff --git a/pallets/asset-registry/src/traits.rs b/pallets/asset-registry/src/traits.rs index 3499c21e5..365b84dcf 100644 --- a/pallets/asset-registry/src/traits.rs +++ b/pallets/asset-registry/src/traits.rs @@ -1,3 +1,4 @@ +#![allow(clippy::ptr_arg, clippy::type_complexity)] use crate::*; use frame_support::dispatch::fmt::Debug; diff --git a/pallets/key-storage/src/lib.rs b/pallets/key-storage/src/lib.rs index d911c8987..68aecfa36 100644 --- a/pallets/key-storage/src/lib.rs +++ b/pallets/key-storage/src/lib.rs @@ -20,6 +20,7 @@ //! //! `register`: Registers a public key to it's account. // Ensure we're `no_std` when compiling for Wasm. +#![allow(clippy::ptr_arg, clippy::type_complexity)] #![cfg_attr(not(feature = "std"), no_std)] mod benchmarking; #[cfg(test)] diff --git a/pallets/mt/src/lib.rs b/pallets/mt/src/lib.rs index 0852d1f19..38f7c7194 100644 --- a/pallets/mt/src/lib.rs +++ b/pallets/mt/src/lib.rs @@ -44,6 +44,7 @@ //! * [`Support`](../frame_support/index.html) // Ensure we're `no_std` when compiling for Wasm. +#![allow(clippy::type_complexity)] #![cfg_attr(not(feature = "std"), no_std)] #[cfg(test)] diff --git a/pallets/token-wrapper/src/traits.rs b/pallets/token-wrapper/src/traits.rs index c288647be..00061f250 100644 --- a/pallets/token-wrapper/src/traits.rs +++ b/pallets/token-wrapper/src/traits.rs @@ -1,3 +1,4 @@ +#![allow(clippy::ptr_arg, clippy::type_complexity)] use frame_support::dispatch; use sp_std::vec::Vec; diff --git a/pallets/vanchor-verifier/src/lib.rs b/pallets/vanchor-verifier/src/lib.rs index 7e9c58d97..baa43a580 100644 --- a/pallets/vanchor-verifier/src/lib.rs +++ b/pallets/vanchor-verifier/src/lib.rs @@ -51,7 +51,7 @@ //! //! * [`System`](../frame_system/index.html) //! * [`Support`](../frame_support/index.html) - +#![allow(clippy::ptr_arg, clippy::type_complexity)] // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/primitives/src/types/mod.rs b/primitives/src/types/mod.rs index 33e5e72cf..20129f833 100644 --- a/primitives/src/types/mod.rs +++ b/primitives/src/types/mod.rs @@ -87,6 +87,7 @@ pub trait ElementTrait: } } +#[allow(clippy::wrong_self_convention)] pub trait IntoAbiToken { fn into_abi(&self) -> Token; fn encode_abi(&self) -> Vec { diff --git a/primitives/src/types/vanchor.rs b/primitives/src/types/vanchor.rs index 593bf76a6..fc8f8a4d3 100644 --- a/primitives/src/types/vanchor.rs +++ b/primitives/src/types/vanchor.rs @@ -82,15 +82,16 @@ impl IntoAbiToken for ExtData Date: Tue, 21 Feb 2023 17:30:45 +0530 Subject: [PATCH 09/12] fix toml files --- .taplo.toml | 5 + Cargo.toml | 44 ++++---- client/Cargo.toml | 24 ++--- pallets/anonymity-mining/Cargo.toml | 72 ++++++------- pallets/asset-registry/Cargo.toml | 12 +-- pallets/hasher/Cargo.toml | 46 ++++---- pallets/key-storage/Cargo.toml | 34 +++--- pallets/linkable-tree/Cargo.toml | 46 ++++---- pallets/linkable-tree/rpc/Cargo.toml | 26 ++--- .../linkable-tree/rpc/runtime-api/Cargo.toml | 20 ++-- pallets/mixer/Cargo.toml | 46 ++++---- pallets/mt/Cargo.toml | 50 ++++----- pallets/mt/rpc/Cargo.toml | 24 ++--- pallets/mt/rpc/runtime-api/Cargo.toml | 10 +- pallets/relayer-registry/Cargo.toml | 30 +++--- pallets/signature-bridge/Cargo.toml | 42 ++++---- pallets/token-wrapper-handler/Cargo.toml | 31 +++--- pallets/token-wrapper/Cargo.toml | 26 ++--- pallets/vanchor-handler/Cargo.toml | 82 +++++++------- pallets/vanchor-verifier/Cargo.toml | 28 ++--- pallets/vanchor/Cargo.toml | 100 +++++++++--------- pallets/verifier/Cargo.toml | 28 ++--- pallets/xanchor/Cargo.toml | 90 ++++++++-------- primitives/Cargo.toml | 74 ++++++------- rustfmt.toml | 10 +- standalone/node/Cargo.toml | 75 ++++++------- standalone/runtime/Cargo.toml | 46 ++++---- 27 files changed, 563 insertions(+), 558 deletions(-) create mode 100644 .taplo.toml diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 000000000..ee888fa80 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,5 @@ +exclude = ["target/*"] +[formatting] +array_auto_collapse = false +array_auto_expand = false +reorder_keys = true diff --git a/Cargo.toml b/Cargo.toml index f49cbfe16..16d60ae9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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/*", -] \ No newline at end of file + "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/*", +] diff --git a/client/Cargo.toml b/client/Cargo.toml index 8677eedbf..8f3173cbc 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -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"] } diff --git a/pallets/anonymity-mining/Cargo.toml b/pallets/anonymity-mining/Cargo.toml index 536032816..f3396f73b 100644 --- a/pallets/anonymity-mining/Cargo.toml +++ b/pallets/anonymity-mining/Cargo.toml @@ -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" } @@ -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", -] \ No newline at end of file diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index 109569b43..40dd0c9a5 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -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 @@ -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" } @@ -56,4 +56,4 @@ std = [ "sp-std/std", "sp-api/std", "sp-arithmetic/std", -] \ No newline at end of file +] diff --git a/pallets/hasher/Cargo.toml b/pallets/hasher/Cargo.toml index cc0e668f7..adba474ca 100644 --- a/pallets/hasher/Cargo.toml +++ b/pallets/hasher/Cargo.toml @@ -25,36 +25,36 @@ webb-primitives = { path = "../../primitives", default-features = false } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] -hex-literal = "0.2.1" +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 } +arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } hex = "0.4" +hex-literal = "0.2.1" +pallet-balances = { 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" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -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-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" ] } -arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } [features] default = ["std"] +runtime-benchmarks = [ + "frame-benchmarking", + "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", + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "webb-primitives/std", + "webb-primitives/hashing", ] -runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", -] \ No newline at end of file diff --git a/pallets/key-storage/Cargo.toml b/pallets/key-storage/Cargo.toml index 8d22a8707..01f7b285e 100644 --- a/pallets/key-storage/Cargo.toml +++ b/pallets/key-storage/Cargo.toml @@ -13,36 +13,36 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] 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"] } -log = { version = "0.4.14", default-features = false } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } 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" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +log = { version = "0.4.14", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } 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" } webb-primitives = { path = "../../primitives", default-features = false, features = ["verifying"] } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] +pallet-balances = { 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" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } [features] default = ["std"] -std = [ - "codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "webb-primitives/std", - "frame-benchmarking/std" -] runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-benchmarking", + "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", + "frame-benchmarking/std", ] diff --git a/pallets/linkable-tree/Cargo.toml b/pallets/linkable-tree/Cargo.toml index 448d16d27..5808a77d0 100644 --- a/pallets/linkable-tree/Cargo.toml +++ b/pallets/linkable-tree/Cargo.toml @@ -15,29 +15,29 @@ scale-info = { version = "2.1.1", default-features = false, features = ["derive" 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" } +pallet-mt = { path = "../mt", default-features = false } 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" } -pallet-mt = { path = "../mt", default-features = false } webb-primitives = { path = "../../primitives", default-features = false } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } serde = { version = "1.0.119", optional = true } [dev-dependencies] -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" } pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-hasher = { path = "../hasher", default-features = false } rand = "0.8.4" +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" } 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-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-serialize = { version = "^0.3.0", default-features = false, features = ["derive"] } ark-std = { version = "^0.3.0", default-features = false } ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] } @@ -45,22 +45,22 @@ arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = f [features] default = ["std"] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] std = [ - "serde", - "codec/std", - "scale-info/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "sp-io/std", - "pallet-hasher/std", - "pallet-mt/std", - "webb-primitives/std", - "frame-benchmarking/std" + "serde", + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "sp-io/std", + "pallet-hasher/std", + "pallet-mt/std", + "webb-primitives/std", + "frame-benchmarking/std", ] -runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", -] \ No newline at end of file diff --git a/pallets/linkable-tree/rpc/Cargo.toml b/pallets/linkable-tree/rpc/Cargo.toml index 58e9fb851..bb2b6ed5d 100644 --- a/pallets/linkable-tree/rpc/Cargo.toml +++ b/pallets/linkable-tree/rpc/Cargo.toml @@ -1,32 +1,32 @@ [package] -name = "pallet-linkable-tree-rpc" -version = "0.1.0" authors = ["Webb Tools"] edition = "2018" +name = "pallet-linkable-tree-rpc" +version = "0.1.0" [dependencies] jsonrpsee = { version = "0.16.2", features = ["server"] } -thiserror = "1.0" sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +thiserror = "1.0" codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -webb-primitives = { path = "../../../primitives", default-features = false } pallet-linkable-tree = { path = "../", default-features = false } pallet-linkable-tree-rpc-runtime-api = { path = "./runtime-api", default-features = false } +webb-primitives = { path = "../../../primitives", default-features = false } [features] default = ["std"] std = [ - "codec/std", - "webb-primitives/std", - "pallet-linkable-tree/std", - "pallet-linkable-tree-rpc-runtime-api/std", - "sp-core/std", - "sp-runtime/std", - "sp-api/std" -] \ No newline at end of file + "codec/std", + "webb-primitives/std", + "pallet-linkable-tree/std", + "pallet-linkable-tree-rpc-runtime-api/std", + "sp-core/std", + "sp-runtime/std", + "sp-api/std", +] diff --git a/pallets/linkable-tree/rpc/runtime-api/Cargo.toml b/pallets/linkable-tree/rpc/runtime-api/Cargo.toml index ac11c5f8a..9fe862e2a 100644 --- a/pallets/linkable-tree/rpc/runtime-api/Cargo.toml +++ b/pallets/linkable-tree/rpc/runtime-api/Cargo.toml @@ -1,28 +1,28 @@ [package] -name = "pallet-linkable-tree-rpc-runtime-api" -version = "1.0.0" authors = ["Webb"] +description = "Linkable tree RPC API for linkable tree pallet" edition = "2018" license = "Apache-2.0" -description = "Linkable tree RPC API for linkable tree pallet" +name = "pallet-linkable-tree-rpc-runtime-api" readme = "README.md" +version = "1.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-linkable-tree = { default-features = false, path = "../../" } +sp-api = { 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" } webb-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ - "codec/std", - "sp-api/std", - "sp-std/std", - "pallet-linkable-tree/std", - "webb-primitives/std", + "codec/std", + "sp-api/std", + "sp-std/std", + "pallet-linkable-tree/std", + "webb-primitives/std", ] diff --git a/pallets/mixer/Cargo.toml b/pallets/mixer/Cargo.toml index ea831bf8f..f831f7877 100644 --- a/pallets/mixer/Cargo.toml +++ b/pallets/mixer/Cargo.toml @@ -10,39 +10,39 @@ version = "1.0.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -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"]} +codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +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" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } log = "0.4" -webb-primitives = {path = "../../primitives", features = ["verifying"], 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" } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } -pallet-mt = {path = "../mt", default-features = false} -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" } -frame-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -frame-system-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +pallet-mt = { path = "../mt", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +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" } +webb-primitives = { path = "../../primitives", features = ["verifying"], default-features = false } [dev-dependencies] -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 } 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 } +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 } arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } -pallet-asset-registry = { path = "../asset-registry", default-features = false } -pallet-verifier = {path = "../verifier", default-features = false} -pallet-hasher = {path = "../hasher", default-features = false} -serde = { version = "1.0.119"} hex = "0.4" +pallet-asset-registry = { path = "../asset-registry", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } +pallet-hasher = { path = "../hasher", default-features = false } +pallet-verifier = { path = "../verifier", default-features = false } +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" } diff --git a/pallets/mt/Cargo.toml b/pallets/mt/Cargo.toml index bf68c8a46..b9169db64 100644 --- a/pallets/mt/Cargo.toml +++ b/pallets/mt/Cargo.toml @@ -10,49 +10,49 @@ version = "1.0.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] +ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] } +arkworks-setups = { version = "1.2.1", default-features = false } 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"] } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } 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" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +pallet-hasher = { path = "../hasher", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } 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" } webb-primitives = { path = "../../primitives", default-features = false } -arkworks-setups = { version = "1.2.1", default-features = false } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -pallet-hasher = {path = "../hasher", default-features = false} -ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } [dev-dependencies] -hex-literal = "0.2.1" +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-std = { version = "^0.3.0", default-features = false } hex = "0.4" +hex-literal = "0.2.1" +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +pallet-hasher = { path = "../hasher", default-features = false } 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" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -pallet-hasher = { path = "../hasher", default-features = false } -ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false } -ark-ff = { version = "^0.3.0", default-features = false } -ark-std = { version = "^0.3.0", default-features = false } -ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } [features] default = ["std"] -std = [ - "codec/std", - "scale-info/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "pallet-hasher/std", - "webb-primitives/std", - "pallet-hasher/std" -] runtime-benchmarks = [ "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", -] \ No newline at end of file +] +std = [ + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "pallet-hasher/std", + "webb-primitives/std", + "pallet-hasher/std", +] diff --git a/pallets/mt/rpc/Cargo.toml b/pallets/mt/rpc/Cargo.toml index 4427c8226..f6f1e327a 100644 --- a/pallets/mt/rpc/Cargo.toml +++ b/pallets/mt/rpc/Cargo.toml @@ -1,30 +1,30 @@ [package] -name = "pallet-mt-rpc" -version = "0.1.0" authors = ["Webb Tools"] edition = "2018" +name = "pallet-mt-rpc" +version = "0.1.0" [dependencies] jsonrpsee = { version = "0.16.2", features = ["server"] } -thiserror = "1.0" sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +thiserror = "1.0" codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -webb-primitives = { path = "../../../primitives", default-features = false } pallet-mt-rpc-runtime-api = { path = "./runtime-api", default-features = false } +webb-primitives = { path = "../../../primitives", default-features = false } [features] default = ["std"] std = [ - "codec/std", - "webb-primitives/std", - "pallet-mt-rpc-runtime-api/std", - "sp-core/std", - "sp-runtime/std", - "sp-api/std" -] \ No newline at end of file + "codec/std", + "webb-primitives/std", + "pallet-mt-rpc-runtime-api/std", + "sp-core/std", + "sp-runtime/std", + "sp-api/std", +] diff --git a/pallets/mt/rpc/runtime-api/Cargo.toml b/pallets/mt/rpc/runtime-api/Cargo.toml index deeb4e30d..9f80a333b 100644 --- a/pallets/mt/rpc/runtime-api/Cargo.toml +++ b/pallets/mt/rpc/runtime-api/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "pallet-mt-rpc-runtime-api" -version = "1.0.0" authors = ["Webb"] +description = "RPC runtime API for merkle tree pallet" edition = "2018" license = "Apache-2.0" -description = "RPC runtime API for merkle tree pallet" +name = "pallet-mt-rpc-runtime-api" readme = "README.md" +version = "1.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -17,6 +17,6 @@ webb-primitives = { path = "../../../../primitives", default-features = false } [features] default = ["std"] std = [ - "sp-api/std", - "webb-primitives/std", + "sp-api/std", + "webb-primitives/std", ] diff --git a/pallets/relayer-registry/Cargo.toml b/pallets/relayer-registry/Cargo.toml index 9419ffe57..15acaf44c 100644 --- a/pallets/relayer-registry/Cargo.toml +++ b/pallets/relayer-registry/Cargo.toml @@ -13,39 +13,39 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] 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"] } -log = { version = "0.4.14", 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" } +log = { version = "0.4.14", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } 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" } -pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } webb-primitives = { path = "../../primitives", default-features = false, features = ["verifying"] } [dev-dependencies] +pallet-balances = { 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" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } [features] default = ["std"] -std = [ - "codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "webb-primitives/std", - "pallet-identity/std", -] runtime-benchmarks = [ "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", -] \ No newline at end of file +] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "webb-primitives/std", + "pallet-identity/std", +] diff --git a/pallets/signature-bridge/Cargo.toml b/pallets/signature-bridge/Cargo.toml index 944d23220..19486efae 100644 --- a/pallets/signature-bridge/Cargo.toml +++ b/pallets/signature-bridge/Cargo.toml @@ -16,41 +16,41 @@ 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"] } -sp-std = { 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-io = { 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-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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } # frame 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" } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -webb-primitives = { path = "../../primitives", default-features = false } -libsecp256k1 = { version = "0.7.0", default-features = false, optional = true } impl-trait-for-tuples = "0.2.2" +libsecp256k1 = { version = "0.7.0", default-features = false, optional = true } +webb-primitives = { path = "../../primitives", default-features = false } [dev-dependencies] +hex-literal = "0.3.4" libsecp256k1 = "0.7.0" -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -hex-literal = "0.3.4" +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } [features] default = ["std"] -std = [ - "codec/std", - "sp-std/std", - "sp-runtime/std", - "sp-io/std", - "sp-core/std", - "frame-support/std", - "frame-system/std", - "pallet-balances/std", - "webb-primitives/std", -] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "libsecp256k1" + "frame-benchmarking/runtime-benchmarks", + "libsecp256k1", +] +std = [ + "codec/std", + "sp-std/std", + "sp-runtime/std", + "sp-io/std", + "sp-core/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "webb-primitives/std", ] diff --git a/pallets/token-wrapper-handler/Cargo.toml b/pallets/token-wrapper-handler/Cargo.toml index 31e0bd099..e86cc70b6 100644 --- a/pallets/token-wrapper-handler/Cargo.toml +++ b/pallets/token-wrapper-handler/Cargo.toml @@ -12,31 +12,31 @@ version = "1.0.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -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"]} -asset-registry = {package = "pallet-asset-registry", path = "../asset-registry", 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" } +asset-registry = { package = "pallet-asset-registry", path = "../asset-registry", default-features = false } +codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] } +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" } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } pallet-token-wrapper = { path = "../token-wrapper", default-features = false } -sp-arithmetic = {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" } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +sp-arithmetic = { 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" } #Optional dependencies -frame-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] -pallet-signature-bridge = { path = "../signature-bridge", default-features = false } +hex-literal = "0.3.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-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +pallet-signature-bridge = { path = "../signature-bridge", default-features = false } pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -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-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" } +webb-primitives = { path = "../../primitives", default-features = false } webb-proposals = { version = "0.5.4", default-features = false, features = ["scale", "substrate"] } -webb-primitives = {path = "../../primitives", default-features = false} -hex-literal = "0.3.4" [features] default = ["std"] @@ -57,4 +57,3 @@ std = [ "sp-arithmetic/std", "pallet-token-wrapper/std", ] - diff --git a/pallets/token-wrapper/Cargo.toml b/pallets/token-wrapper/Cargo.toml index 283b139f4..83428c1cd 100644 --- a/pallets/token-wrapper/Cargo.toml +++ b/pallets/token-wrapper/Cargo.toml @@ -12,29 +12,29 @@ version = "1.0.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -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"]} +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"] } -asset-registry = {package = "pallet-asset-registry", path = "../asset-registry", 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" } -sp-arithmetic = {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" } +asset-registry = { package = "pallet-asset-registry", path = "../asset-registry", 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" } +sp-arithmetic = { 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" } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } #Optional dependencies -frame-benchmarking = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] 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-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -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" } -webb-primitives = {path = "../../primitives", default-features = false} +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" } +webb-primitives = { path = "../../primitives", default-features = false } [features] default = ["std"] diff --git a/pallets/vanchor-handler/Cargo.toml b/pallets/vanchor-handler/Cargo.toml index 2450a3089..53987e62f 100644 --- a/pallets/vanchor-handler/Cargo.toml +++ b/pallets/vanchor-handler/Cargo.toml @@ -13,46 +13,46 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # third-party dependencies -serde = { version = "1.0.101", optional = true } codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] } +serde = { version = "1.0.101", optional = true } # frame dependencies -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } 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-std = { 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-io = { 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" } -pallet-mt = { path = "../mt", 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-linkable-tree = { path = "../linkable-tree", default-features = false } +pallet-mt = { path = "../mt", default-features = false } 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 } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +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-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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } webb-primitives = { path = "../../primitives", default-features = false } -pallet-asset-registry = { path = "../asset-registry", default-features = false } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] +ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false } +hex-literal = "0.3.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-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +pallet-hasher = { path = "../hasher", default-features = false } +pallet-key-storage = { path = "../key-storage" } +pallet-linkable-tree = { path = "../linkable-tree", default-features = false } +pallet-mt = { path = "../mt", default-features = false } pallet-signature-bridge = { path = "../signature-bridge", default-features = false } +pallet-token-wrapper = { path = "../token-wrapper", default-features = false } +pallet-vanchor-verifier = { path = "../vanchor-verifier", default-features = false } 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" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -pallet-hasher = { path = "../hasher", default-features = false } -pallet-mt = { path = "../mt", default-features = false } -pallet-linkable-tree = { path = "../linkable-tree", default-features = false } -pallet-vanchor-verifier = { path = "../vanchor-verifier", default-features = false } -pallet-token-wrapper = { path = "../token-wrapper", default-features = false } webb-primitives = { path = "../../primitives", default-features = false } -pallet-key-storage = {path = "../key-storage"} -ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], 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 } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } -hex-literal = "0.3.4" ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] } arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } @@ -60,27 +60,27 @@ webb-proposals = { version = "0.5.4", default-features = false, features = ["sca [features] default = ["std"] -std = [ - "codec/std", - "serde", - "sp-std/std", - "sp-runtime/std", - "sp-io/std", - "sp-core/std", - "sp-arithmetic/std", - "frame-support/std", - "frame-system/std", - "pallet-mt/std", - "pallet-vanchor/std", - "pallet-vanchor-verifier/std", - "pallet-signature-bridge/std", - "pallet-token-wrapper/std", - "orml-traits/std", - "webb-primitives/std", - "pallet-asset-registry/std", -] runtime-benchmarks = [ "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", ] +std = [ + "codec/std", + "serde", + "sp-std/std", + "sp-runtime/std", + "sp-io/std", + "sp-core/std", + "sp-arithmetic/std", + "frame-support/std", + "frame-system/std", + "pallet-mt/std", + "pallet-vanchor/std", + "pallet-vanchor-verifier/std", + "pallet-signature-bridge/std", + "pallet-token-wrapper/std", + "orml-traits/std", + "webb-primitives/std", + "pallet-asset-registry/std", +] diff --git a/pallets/vanchor-verifier/Cargo.toml b/pallets/vanchor-verifier/Cargo.toml index efde40bc3..c2b8f3c73 100644 --- a/pallets/vanchor-verifier/Cargo.toml +++ b/pallets/vanchor-verifier/Cargo.toml @@ -13,37 +13,37 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] 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"] } -log = { version = "0.4.14", 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" } +log = { version = "0.4.14", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } 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" } webb-primitives = { path = "../../primitives", default-features = false, features = ["verifying"] } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] +ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false } +pallet-balances = { 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" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false } [features] default = ["std"] -std = [ - "codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "webb-primitives/std", -] runtime-benchmarks = [ "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", -] \ No newline at end of file +] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "webb-primitives/std", +] diff --git a/pallets/vanchor/Cargo.toml b/pallets/vanchor/Cargo.toml index 51c3bea1f..0c1e7b9be 100644 --- a/pallets/vanchor/Cargo.toml +++ b/pallets/vanchor/Cargo.toml @@ -13,71 +13,71 @@ 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"] } +ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] } +ark-ff = { version = "^0.3.0", default-features = false } +ark-std = { version = "^0.3.0", default-features = false } +arkworks-native-gadgets = { version = "1.2.0", default-features = false } +arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } 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-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" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +getrandom = { version = "0.2", features = ["js"] } +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 } +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-hasher = { path = "../hasher", 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 } pallet-vanchor-verifier = { path = "../vanchor-verifier", default-features = false } +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" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } webb-primitives = { path = "../../primitives", default-features = false, features = ["hashing", "verifying", "field_ops"] } -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-token-wrapper = { path = "../token-wrapper", default-features = false } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } -ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } -arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } -arkworks-native-gadgets = { version = "1.2.0", default-features = false } -ark-std = { version = "^0.3.0", default-features = false } -ark-ff = { version = "^0.3.0", 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 } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } -getrandom = { version = "0.2", features = ["js"] } [dev-dependencies] -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" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -pallet-key-storage = {path = "../key-storage"} -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } -rand = "0.8.4" +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-relations = { version = "^0.3.0", default-features = false } -ark-serialize = { version = "^0.3.0", default-features = false, features = [ "derive" ]} +ark-ff = { version = "^0.3.0", default-features = false } ark-groth16 = { 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-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } -ark-bls12-381 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } +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-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +pallet-key-storage = { path = "../key-storage" } +pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +rand = "0.8.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" } [features] default = ["std"] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] std = [ - "codec/std", - "scale-info/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "pallet-hasher/std", - "pallet-linkable-tree/std", - "pallet-vanchor-verifier/std", - "pallet-asset-registry/std", - "webb-primitives/std", - "frame-benchmarking/std", - "pallet-token-wrapper/std", - "ark-std/std" + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "pallet-hasher/std", + "pallet-linkable-tree/std", + "pallet-vanchor-verifier/std", + "pallet-asset-registry/std", + "webb-primitives/std", + "frame-benchmarking/std", + "pallet-token-wrapper/std", + "ark-std/std", ] -runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", -] \ No newline at end of file diff --git a/pallets/verifier/Cargo.toml b/pallets/verifier/Cargo.toml index ceb181d4a..30cd76ff4 100644 --- a/pallets/verifier/Cargo.toml +++ b/pallets/verifier/Cargo.toml @@ -13,37 +13,37 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] 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"] } -log = { version = "0.4.14", 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" } +log = { version = "0.4.14", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } 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" } webb-primitives = { path = "../../primitives", default-features = false, features = ["verifying"] } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } [dev-dependencies] +ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false } +pallet-balances = { 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" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-features = false } [features] default = ["std"] -std = [ - "codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-std/std", - "webb-primitives/std", -] runtime-benchmarks = [ "frame-benchmarking", "frame-system/runtime-benchmarks", "frame-support/runtime-benchmarks", -] \ No newline at end of file +] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-std/std", + "webb-primitives/std", +] diff --git a/pallets/xanchor/Cargo.toml b/pallets/xanchor/Cargo.toml index 1df3097d9..ff309bcdf 100644 --- a/pallets/xanchor/Cargo.toml +++ b/pallets/xanchor/Cargo.toml @@ -1,94 +1,94 @@ [package] +edition = "2021" name = "pallet-xanchor" version = "0.1.0" -edition = "2021" [dependencies] 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"] } serde = { version = "1.0", optional = true, features = ["derive"] } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } 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" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", optional = true } 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" } +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-hasher = { path = "../hasher", default-features = false } -pallet-verifier = { path = "../verifier", default-features = false } -pallet-mt = { path = "../mt", default-features = false } pallet-linkable-tree = { path = "../linkable-tree", default-features = false } +pallet-mt = { path = "../mt", default-features = false } 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-verifier = { path = "../verifier", default-features = false } webb-primitives = { path = "../../primitives", default-features = false } -pallet-asset-registry = { path = "../asset-registry", default-features = false } webb-proposals = { version = "0.5.4", default-features = false, features = ["scale", "substrate"] } # XCM dependencies -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false } cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.36", default-features = false } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } [dev-dependencies] -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" } +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-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-preimage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", branch = "polkadot-v0.9.36", default-features = false } rand = "0.8.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-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-serialize = { version = "^0.3.0", default-features = false, features = ["derive"] } ark-std = { version = "^0.3.0", default-features = false } -ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } -ark-bls12-381 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } -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" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } -xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.36", default-features = false } [features] default = ["std"] std = [ - "codec/std", - "scale-info/std", - "serde", - "cumulus-primitives-core/std", - "cumulus-pallet-xcm/std", - "sp-std/std", - "sp-runtime/std", - "frame-support/std", - "frame-system/std", - "pallet-hasher/std", - "pallet-mt/std", - "pallet-verifier/std", - "pallet-vanchor/std", - "orml-traits/std", - "webb-primitives/std", - "pallet-asset-registry/std", - "frame-benchmarking/std", - "webb-proposals/std", + "codec/std", + "scale-info/std", + "serde", + "cumulus-primitives-core/std", + "cumulus-pallet-xcm/std", + "sp-std/std", + "sp-runtime/std", + "frame-support/std", + "frame-system/std", + "pallet-hasher/std", + "pallet-mt/std", + "pallet-verifier/std", + "pallet-vanchor/std", + "orml-traits/std", + "webb-primitives/std", + "pallet-asset-registry/std", + "frame-benchmarking/std", + "webb-proposals/std", ] runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", ] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 23f914785..6910ca7f0 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,32 +1,32 @@ [package] -name = "webb-primitives" -version = "0.1.0" authors = ["Drew Stone "] edition = "2018" +name = "webb-primitives" +version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde = { version = "1.0.119", optional = true, features = ["derive"] } codec = { default-features = false, features = ["derive", "max-encoded-len"], package = "parity-scale-codec", version = "3" } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } frame-support = { 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"] } +serde = { version = "1.0.119", optional = true, features = ["derive"] } +sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +sp-consensus-babe = { 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-std = { 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" } -sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -sp-consensus-babe = { 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" } # Arkworks -ark-ff = { version = "^0.3.0", default-features = false } +ark-bls12-381 = { version = "^0.3.0", default-features = false, features = ["curve"], optional = true } +ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"], optional = true } ark-ec = { version = "^0.3.0", default-features = false } -ark-std = { 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" ], optional = true } -ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ], optional = true } +ark-ff = { version = "^0.3.0", default-features = false } ark-groth16 = { 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-circom = { git = "https://github.com/gakonst/ark-circom.git", default-features = false } blake2 = { version = "0.9", default-features = false } @@ -41,33 +41,33 @@ webb-proposals = { version = "0.5.4", default-features = false, features = ["sca [features] default = ["std", "hashing", "verifying", "field_ops"] -std = [ - "serde", - "codec/std", - "frame-support/std", - "sp-core/std", - "sp-std/std", - "sp-io/std", - "sp-runtime/std", - "sp-consensus-aura/std", - "sp-consensus-babe/std", - "ark-ff/std", - "ark-ec/std", - "ark-std/std", - "ark-relations/std", - "webb-proposals/std" -] field_ops = [ - "ark-bls12-381", - "ark-bn254", + "ark-bls12-381", + "ark-bn254", ] hashing = [ - "arkworks-native-gadgets", - "ark-bls12-381", - "ark-bn254", + "arkworks-native-gadgets", + "ark-bls12-381", + "ark-bn254", +] +std = [ + "serde", + "codec/std", + "frame-support/std", + "sp-core/std", + "sp-std/std", + "sp-io/std", + "sp-runtime/std", + "sp-consensus-aura/std", + "sp-consensus-babe/std", + "ark-ff/std", + "ark-ec/std", + "ark-std/std", + "ark-relations/std", + "webb-proposals/std", ] verifying = [ - "arkworks-native-gadgets", - "ark-bls12-381", - "ark-bn254", + "arkworks-native-gadgets", + "ark-bls12-381", + "ark-bn254", ] diff --git a/rustfmt.toml b/rustfmt.toml index f4d7ad637..8b3be5e7d 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -11,13 +11,13 @@ newline_style = "Unix" comment_width = 100 wrap_comments = true # Misc -chain_width = 80 -spaces_around_ranges = false binop_separator = "Back" -reorder_impl_items = false -match_arm_leading_pipes = "Preserve" +chain_width = 80 match_arm_blocks = false +match_arm_leading_pipes = "Preserve" match_block_trailing_comma = true +reorder_impl_items = false +spaces_around_ranges = false trailing_comma = "Vertical" trailing_semicolon = false -use_field_init_shorthand = true \ No newline at end of file +use_field_init_shorthand = true diff --git a/standalone/node/Cargo.toml b/standalone/node/Cargo.toml index 7b2b6f85d..80543d445 100644 --- a/standalone/node/Cargo.toml +++ b/standalone/node/Cargo.toml @@ -24,90 +24,91 @@ targets = ["x86_64-unknown-linux-gnu"] substrate-build-script-utils = "3.0.0" [dependencies] -itertools = "0.10.0" array-bytes = "4.1" clap = { version = "4.0.9", features = ["derive"], optional = true } -serde = { version = "1.0.136", features = ["derive"] } -jsonrpsee = { version = "0.16.2", features = ["server"] } futures = "0.3.21" +itertools = "0.10.0" +jsonrpsee = { version = "0.16.2", features = ["server"] } log = "0.4.17" rand = "0.8" +serde = { version = "1.0.136", features = ["derive"] } -pallet-mt-rpc = { path = "../../pallets/mt/rpc", version = "0.1.0" } -pallet-mt-rpc-runtime-api = { path = "../../pallets/mt/rpc/runtime-api" } pallet-linkable-tree-rpc = { path = "../../pallets/linkable-tree/rpc", version = "0.1.0" } pallet-linkable-tree-rpc-runtime-api = { path = "../../pallets/linkable-tree/rpc/runtime-api" } +pallet-mt-rpc = { path = "../../pallets/mt/rpc", version = "0.1.0" } +pallet-mt-rpc-runtime-api = { path = "../../pallets/mt/rpc/runtime-api" } # Standalone runtimes -webb-runtime = { package = "webb-standalone-runtime", path = "../runtime", version = "0.1.0" } webb-primitives = { path = "../../primitives", version = "0.1.0" } +webb-runtime = { package = "webb-standalone-runtime", path = "../runtime", version = "0.1.0" } # Substrate dependencies sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sp-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-consensus-uncles = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-uncles = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" } +sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sp-transaction-storage-proof = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-consensus-babe-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } # RPC related dependencies jsonrpc-core = "18.0.0" -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } pallet-asset-tx-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sc-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } -sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36" } +ark-bn254 = { version = "^0.3.0", default-features = false, features = ["curve"] } arkworks-setups = { version = "1.2.1", features = ["r1cs"], default-features = false } -ark-bn254 = { version = "^0.3.0", default-features = false, features = [ "curve" ] } [features] -default = ["cli"] cli = [ - "clap" + "clap", ] -runtime-benchmarks = ["webb-runtime/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-benchmarking-cli/runtime-benchmarks", +default = ["cli"] +runtime-benchmarks = [ + "webb-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", ] diff --git a/standalone/runtime/Cargo.toml b/standalone/runtime/Cargo.toml index 6474cbd77..99a48cc89 100644 --- a/standalone/runtime/Cargo.toml +++ b/standalone/runtime/Cargo.toml @@ -14,35 +14,35 @@ targets = ["x86_64-unknown-linux-gnu"] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } [dependencies] -codec = {package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"]} +codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] } hex-literal = { version = '0.3.1', optional = true } log = { version = "0.4.14", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"]} -serde = { version = "1.0.101", optional = true, features = ["derive"]} +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +serde = { version = "1.0.101", optional = true, features = ["derive"] } smallvec = "1.6.1" static_assertions = "1.1.0" # local dependencies -webb-primitives = {path = "../../primitives", default-features = false, features = ["hashing"]} 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 } 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 = "../../pallets/vanchor", default-features = false } -pallet-vanchor-handler = {path = "../../pallets/vanchor-handler", default-features = false } -pallet-asset-registry = {path = "../../pallets/asset-registry", default-features = false } +pallet-asset-registry = { path = "../../pallets/asset-registry", default-features = false } +pallet-hasher = { path = "../../pallets/hasher", default-features = false } +pallet-key-storage = { path = "../../pallets/key-storage", default-features = false } +pallet-linkable-tree = { path = "../../pallets/linkable-tree", default-features = false } +pallet-linkable-tree-rpc-runtime-api = { path = "../../pallets/linkable-tree/rpc/runtime-api", default-features = false } +pallet-mixer = { path = "../../pallets/mixer", default-features = false } +pallet-mt = { path = "../../pallets/mt", default-features = false } +pallet-mt-rpc-runtime-api = { path = "../../pallets/mt/rpc/runtime-api", default-features = false } +pallet-relayer-registry = { path = "../../pallets/relayer-registry", default-features = false } pallet-signature-bridge = { path = "../../pallets/signature-bridge", default-features = false } -pallet-hasher = {path = "../../pallets/hasher", default-features = false } -pallet-mixer = {path = "../../pallets/mixer", default-features = false } -pallet-mt = {path = "../../pallets/mt", default-features = false } -pallet-linkable-tree = {path = "../../pallets/linkable-tree", default-features = false } -pallet-mt-rpc-runtime-api = {path = "../../pallets/mt/rpc/runtime-api", default-features = false } -pallet-linkable-tree-rpc-runtime-api = {path = "../../pallets/linkable-tree/rpc/runtime-api", default-features = false } -pallet-token-wrapper = {path = "../../pallets/token-wrapper", default-features = false } -pallet-token-wrapper-handler = {path = "../../pallets/token-wrapper-handler", default-features = false } -pallet-verifier = {path = "../../pallets/verifier", default-features = false } -pallet-vanchor-verifier = {path = "../../pallets/vanchor-verifier", default-features = false } -pallet-relayer-registry = {path = "../../pallets/relayer-registry", default-features = false } -pallet-key-storage = {path = "../../pallets/key-storage", default-features = false} +pallet-token-wrapper = { path = "../../pallets/token-wrapper", default-features = false } +pallet-token-wrapper-handler = { path = "../../pallets/token-wrapper-handler", default-features = false } +pallet-vanchor = { path = "../../pallets/vanchor", default-features = false } +pallet-vanchor-handler = { path = "../../pallets/vanchor-handler", default-features = false } +pallet-vanchor-verifier = { path = "../../pallets/vanchor-verifier", default-features = false } +pallet-verifier = { path = "../../pallets/verifier", default-features = false } +webb-primitives = { path = "../../primitives", default-features = false, features = ["hashing"] } # Substrate dependencies sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } @@ -84,11 +84,11 @@ pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/su pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } -pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-nomination-pools = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } +pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-preimage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false } @@ -100,7 +100,7 @@ pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "polk pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false, features = [ "historical", -]} +] } pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.36", default-features = false } @@ -132,7 +132,7 @@ runtime-benchmarks = [ "pallet-token-wrapper/runtime-benchmarks", "pallet-token-wrapper-handler/runtime-benchmarks", "pallet-relayer-registry/runtime-benchmarks", - "pallet-key-storage/runtime-benchmarks" + "pallet-key-storage/runtime-benchmarks", ] std = [ From d63349fb4e88fb64ccf7dc92c524e44fab8dc5a0 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:39:24 +0530 Subject: [PATCH 10/12] fix ci --- .github/workflows/check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b570bd06d..20e2fed9c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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: From 0d6392a5ac4c4e9d76d87f834472985951e64064 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Wed, 22 Feb 2023 00:24:18 +0530 Subject: [PATCH 11/12] fix failing test --- pallets/mt/src/lib.rs | 13 ++++++++++--- primitives/src/types/vanchor.rs | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pallets/mt/src/lib.rs b/pallets/mt/src/lib.rs index 38f7c7194..0c048b9f2 100644 --- a/pallets/mt/src/lib.rs +++ b/pallets/mt/src/lib.rs @@ -398,7 +398,10 @@ impl, I: 'static> TreeInterface, depth: u8) -> Result { // Setting the next tree id let tree_id = Self::next_tree_id(); - NextTreeId::::mutate(|id| id.saturating_add(One::one())); + NextTreeId::::mutate(|id| { + *id = id.saturating_add(One::one()); + *id + }); // get unit of two let two: T::LeafIndex = Self::two(); // get default edge nodes @@ -466,10 +469,14 @@ impl, I: 'static> TreeInterface::mutate(|i| { - *i = i.saturating_add(One::one()) % T::RootHistorySize::get() + *i = i.saturating_add(One::one()) % T::RootHistorySize::get(); + *i }); CachedRoots::::insert(id, root_index, hash); - NextLeafIndex::::mutate(id, |i| i.saturating_add(One::one())); + NextLeafIndex::::mutate(id, |i| { + *i = i.saturating_add(One::one()); + *i + }); // return the root Ok(hash) diff --git a/primitives/src/types/vanchor.rs b/primitives/src/types/vanchor.rs index fc8f8a4d3..6a4281f5d 100644 --- a/primitives/src/types/vanchor.rs +++ b/primitives/src/types/vanchor.rs @@ -1,7 +1,7 @@ use super::{ElementTrait, IntoAbiToken, Token}; use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -use sp_std::vec::Vec; +use sp_std::{vec, vec::Vec}; #[derive(Clone, Encode, Decode, TypeInfo, MaxEncodedLen)] pub struct VAnchorMetadata { From 3437fc98d1f6050800be5b53be7f05fa23868c55 Mon Sep 17 00:00:00 2001 From: 1xstj <106580853+1xstj@users.noreply.github.com> Date: Wed, 22 Feb 2023 09:52:15 +0530 Subject: [PATCH 12/12] fix merge issues --- Cargo.toml | 40 +++++------ pallets/anonymity-mining-claims/Cargo.toml | 76 ++++++++++----------- pallets/anonymity-mining-rewards/Cargo.toml | 3 + 3 files changed, 61 insertions(+), 58 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2dc860a95..d0cb8ef9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,24 +9,24 @@ strip = "symbols" [workspace] members = [ - "client", - "primitives", - "pallets/anonymity-mining-rewards", - "pallets/anonymity-mining-claims", - "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-rewards", + "pallets/anonymity-mining-claims", + "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/*", ] diff --git a/pallets/anonymity-mining-claims/Cargo.toml b/pallets/anonymity-mining-claims/Cargo.toml index ae65b5fb0..3b7129e65 100644 --- a/pallets/anonymity-mining-claims/Cargo.toml +++ b/pallets/anonymity-mining-claims/Cargo.toml @@ -15,15 +15,15 @@ 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 } -pallet-vanchor-handler = {path = "../../pallets/vanchor-handler", default-features = false } -pallet-signature-bridge = { path = "../../pallets/signature-bridge", 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-signature-bridge = { path = "../../pallets/signature-bridge", 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 } +pallet-vanchor-handler = { path = "../../pallets/vanchor-handler", 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" } @@ -32,51 +32,51 @@ 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 } arkworks-setups = { version = "1.2.1", features = ["r1cs"], 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", -] \ No newline at end of file diff --git a/pallets/anonymity-mining-rewards/Cargo.toml b/pallets/anonymity-mining-rewards/Cargo.toml index 8c1f01f9c..29aae1167 100644 --- a/pallets/anonymity-mining-rewards/Cargo.toml +++ b/pallets/anonymity-mining-rewards/Cargo.toml @@ -20,8 +20,10 @@ 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-linkable-tree = { path = "../linkable-tree", default-features = false } pallet-mt = { path = "../mt", default-features = false } +pallet-signature-bridge = { path = "../../pallets/signature-bridge", default-features = false } pallet-token-wrapper = { path = "../token-wrapper", default-features = false } pallet-vanchor = { path = "../vanchor", default-features = false } +pallet-vanchor-handler = { path = "../../pallets/vanchor-handler", 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" } @@ -38,6 +40,7 @@ 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 } +arkworks-setups = { version = "1.2.1", features = ["r1cs"], 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 }