From 802926e84eacd614597033e8af693324aa551909 Mon Sep 17 00:00:00 2001 From: samelamin Date: Fri, 25 Aug 2023 11:50:29 +0100 Subject: [PATCH 001/192] add back sudo to rococo --- Cargo.lock | 1 + node/src/chain_spec.rs | 5 +- pallets/briefs/src/benchmarking.rs | 25 +-- pallets/briefs/src/lib.rs | 9 +- pallets/briefs/src/tests.rs | 1 + pallets/crowdfunding/src/benchmarking.rs | 48 +---- pallets/grants/src/lib.rs | 1 + pallets/proposals/src/benchmarking.rs | 30 ++- pallets/proposals/src/tests.rs | 22 +- runtime/imbue-kusama/Cargo.toml | 2 + runtime/imbue-kusama/src/lib.rs | 21 +- runtime/imbue-kusama/src/sanity.rs | 53 ++--- runtime/imbue-kusama/src/xcm_config.rs | 6 +- runtime/integration-tests/src/constants.rs | 6 +- .../integration-tests/src/kusama_test_net.rs | 203 +++++++++--------- runtime/integration-tests/src/lib.rs | 2 +- .../integration-tests/src/xcm_transfers.rs | 49 +++-- 17 files changed, 222 insertions(+), 262 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0c54d49..53661721 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4311,6 +4311,7 @@ dependencies = [ "pallet-proposals-rpc-runtime-api", "pallet-scheduler", "pallet-session", + "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index bbfb47e4..67099190 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -199,7 +199,7 @@ pub fn get_dev_session_keys( } fn development_genesis( - _root_key: AccountId, + root_key: AccountId, initial_authorities: Vec<(AccountId, AuraId)>, endowed_accounts: Vec, total_issuance: Option, @@ -238,6 +238,9 @@ fn development_genesis( }, balances: imbue_kusama_runtime::BalancesConfig { balances }, orml_asset_registry: Default::default(), + sudo: imbue_kusama_runtime::SudoConfig { + key: Some(root_key), + }, orml_tokens: imbue_kusama_runtime::OrmlTokensConfig { balances: token_balances, }, diff --git a/pallets/briefs/src/benchmarking.rs b/pallets/briefs/src/benchmarking.rs index 69ba67a1..3a5d2c98 100644 --- a/pallets/briefs/src/benchmarking.rs +++ b/pallets/briefs/src/benchmarking.rs @@ -32,16 +32,7 @@ mod benchmarks { // (origin, brief_owners, applicant, budget, initial_contribution, brief_id, currency_id, milestones) #[extrinsic_call] - create_brief( - RawOrigin::Signed(caller.clone()), - brief_owners, - applicant, - budget, - initial_contribution, - brief_id.clone(), - CurrencyId::Native, - milestones, - ); + create_brief(RawOrigin::Signed(caller.clone()), brief_owners, applicant, budget, initial_contribution, brief_id.clone(), CurrencyId::Native, milestones); assert_last_event::(Event::::BriefSubmitted(caller, brief_id).into()); } @@ -68,11 +59,7 @@ mod benchmarks { let brief_owner: T::AccountId = brief_owners[0].clone(); // (brief_owner, brief_id, contribution) #[extrinsic_call] - contribute_to_brief( - RawOrigin::Signed(brief_owner.clone()), - brief_id.clone(), - contribution, - ); + contribute_to_brief(RawOrigin::Signed(brief_owner.clone()), brief_id.clone(), contribution); assert_last_event::(Event::::BriefContribution(brief_owner, brief_id).into()); } @@ -126,11 +113,7 @@ mod benchmarks { assert_last_event::(Event::::BriefCanceled(brief_id).into()); } - impl_benchmark_test_suite!( - Briefs, - crate::mock::build_test_externality(), - crate::mock::Test - ); + impl_benchmark_test_suite!(Briefs,crate::mock::build_test_externality(),crate::mock::Test); } fn create_account_id(suri: &'static str, n: u32) -> T::AccountId { @@ -192,3 +175,5 @@ fn get_max_milestones() -> BoundedProposedMilestones { let max_milestones: u32 = ::MaxMilestonesPerBrief::get(); get_milestones::(max_milestones) } + + diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index fed5b458..f14fdc1e 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -25,9 +25,7 @@ mod migrations; #[frame_support::pallet] pub mod pallet { use common_types::{milestone_origin::FundingType, CurrencyId}; - use frame_support::{ - pallet_prelude::*, sp_runtime::Saturating, traits::Get, weights::Weight, BoundedBTreeMap, - }; + use frame_support::{pallet_prelude::*, sp_runtime::Saturating, traits::Get, BoundedBTreeMap, weights::Weight}; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_deposits::traits::DepositHandler; @@ -62,7 +60,7 @@ pub mod pallet { pub type BriefHash = H256; #[pallet::pallet] - pub struct Pallet(_); + pub struct Pallet(_); #[pallet::config] pub trait Config: frame_system::Config { @@ -411,4 +409,7 @@ pub mod pallet { fn commence_work() -> Weight; fn cancel_brief() -> Weight; } + } + + diff --git a/pallets/briefs/src/tests.rs b/pallets/briefs/src/tests.rs index 5b500a8f..d5356cc9 100644 --- a/pallets/briefs/src/tests.rs +++ b/pallets/briefs/src/tests.rs @@ -11,6 +11,7 @@ use sp_arithmetic::per_things::Percent; use std::convert::TryInto; + #[test] fn create_brief_not_approved_applicant() { build_test_externality().execute_with(|| { diff --git a/pallets/crowdfunding/src/benchmarking.rs b/pallets/crowdfunding/src/benchmarking.rs index e9751222..744fd5e8 100644 --- a/pallets/crowdfunding/src/benchmarking.rs +++ b/pallets/crowdfunding/src/benchmarking.rs @@ -27,23 +27,8 @@ mod benchmarks { let crowdfund_key = 0; // (Origin, agg_hash, ProposedMilestones, RequiredFunds, CurrencyId) #[extrinsic_call] - create_crowdfund( - RawOrigin::Signed(whitelisted_caller()), - agg_hash, - milestones, - required_funds.into(), - CurrencyId::Native, - ); - assert_last_event::( - Event::::CrowdFundCreated( - caller, - agg_hash, - crowdfund_key, - required_funds.into(), - CurrencyId::Native, - ) - .into(), - ); + create_crowdfund(RawOrigin::Signed(whitelisted_caller()), agg_hash, milestones, required_funds.into(), CurrencyId::Native); + assert_last_event::(Event::::CrowdFundCreated(caller, agg_hash, crowdfund_key, required_funds.into(), CurrencyId::Native).into()); } #[benchmark] @@ -56,14 +41,7 @@ mod benchmarks { // origin, crowdfund_key, proposed_milestones, required_funds, currency_id, agreement_hash #[extrinsic_call] - update_crowdfund( - RawOrigin::Signed(caller.clone()), - 0, - Some(milestones), - Some(required_funds.into()), - Some(currency_id), - Some(agg_hash), - ); + update_crowdfund(RawOrigin::Signed(caller.clone()), 0, Some(milestones), Some(required_funds.into()), Some(currency_id), Some(agg_hash)); assert_last_event::(Event::CrowdFundUpdated(caller, 0).into()); } @@ -71,7 +49,7 @@ mod benchmarks { fn add_crowdfund_whitelist() { let required_funds = u32::MAX; let caller = create_crowdfund_common::(required_funds); - let mut bbt: BoundedWhitelistSpots = BTreeMap::new().try_into().unwrap(); + let mut bbt : BoundedWhitelistSpots = BTreeMap::new().try_into().unwrap(); for i in 0..::MaxWhitelistPerCrowdFund::get() { bbt.try_insert(whitelisted_caller(), 100u32.into()).unwrap(); @@ -86,16 +64,12 @@ mod benchmarks { fn remove_crowdfund_whitelist() { let required_funds = u32::MAX; let caller = create_crowdfund_common::(required_funds); - let mut bbt: BoundedWhitelistSpots = BTreeMap::new().try_into().unwrap(); + let mut bbt : BoundedWhitelistSpots = BTreeMap::new().try_into().unwrap(); for i in 0..::MaxWhitelistPerCrowdFund::get() { bbt.try_insert(whitelisted_caller(), 100u32.into()).unwrap(); } - let _ = CrowdFunding::::add_crowdfund_whitelist( - RawOrigin::Signed(caller.clone()).into(), - 0, - bbt, - ); + let _ = CrowdFunding::::add_crowdfund_whitelist(RawOrigin::Signed(caller.clone()).into(), 0, bbt); // (Origin, CrowdFundKey) #[extrinsic_call] @@ -132,20 +106,18 @@ mod benchmarks { create_crowdfund_common::(required_funds); let alice: T::AccountId = create_funded_user::("candidate", 1, required_funds.into()); let _ = CrowdFunding::::open_contributions(RawOrigin::Root.into(), 0); - let _ = CrowdFunding::::contribute( - RawOrigin::Signed(alice.clone()).into(), - 0u32, - required_funds.into(), - ); + let _ = CrowdFunding::::contribute(RawOrigin::Signed(alice.clone()).into(), 0u32, required_funds.into()); //(Origin, CrowdFundKey) #[extrinsic_call] approve_crowdfund_for_milestone_submission(RawOrigin::Root, 0); - assert_last_event::(Event::::CrowdFundApproved(0).into()); + assert_last_event::(Event::::CrowdFundApproved(0).into()); } impl_benchmark_test_suite!(CrowdFunding, crate::mock::new_test_ext(), crate::mock::Test); } + + fn create_funded_user( string: &'static str, n: u32, diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index c0856fe3..388e88ce 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -192,3 +192,4 @@ pub mod pallet { fn create_and_convert() -> Weight; } } + diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 3a39f0c1..c8b4cbce 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -41,7 +41,8 @@ mod benchmarks { } #[benchmark] - fn vote_on_milestone() { + fn vote_on_milestone() + { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -71,7 +72,8 @@ mod benchmarks { } #[benchmark] - fn withdraw() { + fn withdraw() + { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -114,14 +116,11 @@ mod benchmarks { #[extrinsic_call] withdraw(RawOrigin::Signed(alice.clone()), project_key); - assert_last_event::( - Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native) - .into(), - ); + assert_last_event::(Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native).into()); } #[benchmark] - fn raise_vote_of_no_confidence() { + fn raise_vote_of_no_confidence(){ let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -141,7 +140,8 @@ mod benchmarks { } #[benchmark] - fn vote_on_no_confidence_round() { + fn vote_on_no_confidence_round() + { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -173,20 +173,16 @@ mod benchmarks { // Benchmark for a single loop of on_initialise as a voting round (most expensive). #[benchmark] - fn on_initialize() { + fn on_initialize() + { let block_number: ::BlockNumber = 100u32.into(); - let keys: BoundedVec< - (ProjectKey, RoundType, MilestoneKey), - ::ExpiringProjectRoundsPerBlock, - > = vec![(0, RoundType::VotingRound, 0)] - .try_into() - .expect("bound will be larger than 1;"); + let keys: BoundedVec<(ProjectKey, RoundType, MilestoneKey), ::ExpiringProjectRoundsPerBlock> = vec![(0, RoundType::VotingRound, 0)].try_into().expect("bound will be larger than 1;"); RoundsExpiring::::insert(block_number, keys); #[block] - { + { crate::Pallet::::on_initialize(block_number); - } + } } impl_benchmark_test_suite!( diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index c2da7edd..8fa161b8 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -3,7 +3,7 @@ use frame_support::{assert_noop, assert_ok}; use common_types::CurrencyId; use test_utils::*; -use crate::{mock::*, *}; +use crate::{*, mock::*}; #[test] fn submit_milestone_milestone_doesnt_exist() { @@ -897,10 +897,11 @@ fn vote_on_no_confidence_mutates_vote() { }); } + #[test] fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE, *CHARLIE, *ALICE], 100_000); + let cont = get_contributions::(vec![*BOB, *DAVE,*CHARLIE,*ALICE], 100_000); let prop_milestones = get_milestones(10); let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); @@ -939,23 +940,16 @@ fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { "Not all the votes has been recorded" ); assert!( - has_voted.contains_key(&BOB) - || has_voted.contains_key(&DAVE) - || has_voted.contains_key(&ALICE) - || has_voted.contains_key(&CHARLIE), + has_voted.contains_key(&BOB) || has_voted.contains_key(&DAVE) || has_voted.contains_key(&ALICE) || has_voted.contains_key(&CHARLIE) , "Bob,Alice,Dave charlie have voted." ); - assert_last_event::( - Event::::NoConfidenceRoundFinalised(*ALICE, project_key).into(), - ); - assert_eq!(Projects::::get(project_key), None); - assert_eq!( - Rounds::::get(project_key, RoundType::VoteOfNoConfidence), - None - ); + assert_last_event::(Event::::NoConfidenceRoundFinalised(*ALICE, project_key).into()); + assert_eq!(Projects::::get(project_key),None); + assert_eq!(Rounds::::get(project_key,RoundType::VoteOfNoConfidence),None); }); } + // todo: finalise voteof no confidence tests. // ^^ is connected to making the pallet generic over funding type. // Todo: assert the last event of each extrinsic/ diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 13aa2d9c..685351c2 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -51,6 +51,7 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "p pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["historical"] , branch = "polkadot-v0.9.43" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } @@ -154,6 +155,7 @@ std = [ "pallet-multisig/std", 'pallet-timestamp/std', 'pallet-scheduler/std', + 'pallet-sudo/std', 'pallet-utility/std', 'pallet-vesting/std', 'pallet-transaction-payment/std', diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 5764683b..d603b027 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -264,6 +264,12 @@ impl pallet_transaction_payment::Config for Runtime { type OperationalFeeMultiplier = OperationalFeeMultiplier; } +impl pallet_sudo::Config for Runtime { + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_sudo::weights::SubstrateWeight; +} + parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); @@ -502,7 +508,7 @@ impl pallet_democracy::Config for Runtime { type CancelProposalOrigin = HalfOfCouncil; type RuntimeEvent = RuntimeEvent; // To cancel a proposal which has been passed, 2/3 of the council must agree to it. - type CancellationOrigin = EnsureRootOr; + type CancellationOrigin = HalfOfCouncil; type CooloffPeriod = CooloffPeriod; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -513,7 +519,9 @@ impl pallet_democracy::Config for Runtime { type ExternalMajorityOrigin = HalfOfCouncil; /// A straight majority of the council can decide what their next motion is. type ExternalOrigin = HalfOfCouncil; - type FastTrackOrigin = FastTrackOrigin; + /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote + /// be tabled immediately and with a shorter voting/enactment period. + type FastTrackOrigin = HalfOfCouncil; type FastTrackVotingPeriod = FastTrackVotingPeriod; type InstantAllowed = InstantAllowed; type InstantOrigin = EnsureRootOr; @@ -577,13 +585,18 @@ impl frame_system::offchain::SigningTypes for Runtime { type Signature = Signature; } -/// Half of council members must vote yes to create this origin. +/// All council members must vote yes to create this origin. type HalfOfCouncil = EnsureProportionAtLeast; /// A majority of the Unit body from Rococo over XCM is our required administration origin. pub type AdminOrigin = EnsureRootOr; pub type MoreThanHalfCouncil = EnsureRootOr; pub type MoreThanHalfTechCommittee = EnsureRootOr; +// pub type MoreThanHalfCouncil = EnsureOneOf< +// EnsureRoot, +// pallet_collective::EnsureProportionMoreThan, +// >; + // Parameterize collator selection pallet parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); @@ -865,7 +878,7 @@ construct_runtime! { { System: frame_system::{Pallet, Call, Storage, Config, Event} = 1, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - // Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 3, + Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event} = 3, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 5, Treasury: pallet_treasury::{Pallet, Storage, Config, Event, Call} = 6, Council: pallet_collective::::{Pallet, Call, Storage, Origin, Event, Config} = 7, diff --git a/runtime/imbue-kusama/src/sanity.rs b/runtime/imbue-kusama/src/sanity.rs index 5be7b8b5..6f38b696 100644 --- a/runtime/imbue-kusama/src/sanity.rs +++ b/runtime/imbue-kusama/src/sanity.rs @@ -1,3 +1,4 @@ + use crate::Runtime; use common_runtime::MAXIMUM_BLOCK_WEIGHT; use pallet_proposals::{WeightInfo as PWeightInfo, WeightInfoT}; @@ -6,67 +7,45 @@ use sp_arithmetic::Percent; #[test] fn ensure_maximum_milestones_are_consistent_grants() { let max_milestone_grants = ::MaxMilestonesPerGrant::get(); - let max_milestone_proposals = - ::MaxMilestonesPerProject::get(); - assert_eq!( - max_milestone_grants, max_milestone_proposals, - "The grants max milestones and project max milestones must be equal." - ); + let max_milestone_proposals = ::MaxMilestonesPerProject::get(); + assert_eq!(max_milestone_grants, max_milestone_proposals, "The grants max milestones and project max milestones must be equal."); } #[test] fn ensure_maximum_milestones_are_consistent_briefs() { let max_milestone_briefs = ::MaxMilestonesPerBrief::get(); - let max_milestone_proposals = - ::MaxMilestonesPerProject::get(); - assert_eq!( - max_milestone_briefs, max_milestone_proposals, - "The briefs max milestones and project max milestones must be equal." - ); + let max_milestone_proposals = ::MaxMilestonesPerProject::get(); + assert_eq!(max_milestone_briefs, max_milestone_proposals, "The briefs max milestones and project max milestones must be equal."); } #[test] fn ensure_max_contributors_equal_max_approvers() { - let max_contributors_proposals = - ::MaximumContributorsPerProject::get(); + let max_contributors_proposals = ::MaximumContributorsPerProject::get(); let max_approvers = ::MaxApprovers::get(); - assert!( - max_contributors_proposals >= max_approvers, - "The max approvers must be less than or equal the max contributors." - ); + assert!(max_contributors_proposals >= max_approvers, "The max approvers must be less than or equal the max contributors."); } // A brief owner is used as the contibutors to a project so the maximums must be equal. #[test] fn ensure_max_contributors_equal_max_brief_owners() { - let max_contributors_proposals = - ::MaximumContributorsPerProject::get(); + let max_contributors_proposals = ::MaximumContributorsPerProject::get(); let max_brief_owners = ::MaxBriefOwners::get(); - assert!( - max_contributors_proposals >= max_brief_owners, - "Max brief owners must be less than or equal to the the max contributors" - ); + assert!(max_contributors_proposals >= max_brief_owners, "Max brief owners must be less than or equal to the the max contributors"); } #[test] fn ensure_proposals_initialize_is_less_than_10_percent_block() { let multiplier = ::ExpiringProjectRoundsPerBlock::get(); - let ref_time = - as WeightInfoT>::on_initialize().ref_time() * multiplier as u64; - let proof_size = - as WeightInfoT>::on_initialize().proof_size() * multiplier as u64; + let ref_time = as WeightInfoT>::on_initialize().ref_time() * multiplier as u64; + let proof_size = as WeightInfoT>::on_initialize().proof_size() * multiplier as u64; - let max_ref_time = Percent::from_percent(10u8).mul_floor(MAXIMUM_BLOCK_WEIGHT.ref_time()); + let max_ref_time = Percent::from_percent(10u8).mul_floor(MAXIMUM_BLOCK_WEIGHT.ref_time()); let max_proof_size = Percent::from_percent(10u8).mul_floor(MAXIMUM_BLOCK_WEIGHT.proof_size()); - assert!( - ref_time <= max_ref_time, - "ExpiringProjectRoundsPerBlock is exceeding ref time limits." - ); - assert!( - proof_size <= max_proof_size, - "ExpiringProjectRoundsPerBlock is exceeding proof size limits." - ); + assert!(ref_time <= max_ref_time, "ExpiringProjectRoundsPerBlock is exceeding ref time limits."); + assert!(proof_size <= max_proof_size, "ExpiringProjectRoundsPerBlock is exceeding proof size limits."); } + + diff --git a/runtime/imbue-kusama/src/xcm_config.rs b/runtime/imbue-kusama/src/xcm_config.rs index 83a3ff48..a8b60f09 100644 --- a/runtime/imbue-kusama/src/xcm_config.rs +++ b/runtime/imbue-kusama/src/xcm_config.rs @@ -1,6 +1,7 @@ use crate::{AllPalletsWithSystem, Balances, ConstU32}; use frame_system::EnsureRoot; -use sp_runtime::traits::Convert; +use sp_runtime::traits::{Convert}; + // A few exports that help ease life for downstream crates. pub use common_runtime::{ @@ -270,6 +271,7 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); + } impl orml_xcm::Config for Runtime { @@ -463,3 +465,5 @@ impl Convert for AccountIdToMultiLocation { .into() } } + + diff --git a/runtime/integration-tests/src/constants.rs b/runtime/integration-tests/src/constants.rs index 21830271..5f6be65a 100644 --- a/runtime/integration-tests/src/constants.rs +++ b/runtime/integration-tests/src/constants.rs @@ -1,5 +1,5 @@ use core::default::Default; -use polkadot_primitives::v4::{MAX_CODE_SIZE, MAX_POV_SIZE}; +use polkadot_primitives::v4::{ MAX_CODE_SIZE, MAX_POV_SIZE}; use grandpa::AuthorityId as GrandpaId; pub use imbue_kusama_runtime::{AccountId, AuraId, Balance, BlockNumber}; @@ -87,6 +87,7 @@ pub mod accounts { pub mod collators { use super::*; + pub fn invulnerables() -> Vec<(AccountId, AuraId)> { vec![ ( @@ -295,6 +296,9 @@ pub mod imbue { polkadot_xcm: imbue_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), }, + sudo: imbue_kusama_runtime::SudoConfig { + key: Some(get_account_id_from_seed::("Alice")), + }, ..Default::default() }; diff --git a/runtime/integration-tests/src/kusama_test_net.rs b/runtime/integration-tests/src/kusama_test_net.rs index fa3181f1..18811f84 100644 --- a/runtime/integration-tests/src/kusama_test_net.rs +++ b/runtime/integration-tests/src/kusama_test_net.rs @@ -13,146 +13,151 @@ //! Relay chain and parachains emulation. -use crate::constants::SAFE_XCM_VERSION; + + pub use imbue_kusama_runtime::{AccountId, AuraId, Balance, BlockNumber}; +use crate::constants::SAFE_XCM_VERSION; -use crate::constants::{ - accounts::{ALICE, BOB, CHARLIE, DAVE, EVE, FERDIE}, - imbue, kusama, + + +use xcm_emulator::{ + decl_test_networks, decl_test_parachains, decl_test_relay_chains, Parachain, RelayChain, + TestExt, }; pub use sp_core::{sr25519, storage::Storage, Get}; use xcm::prelude::*; -use xcm_emulator::{ - decl_test_networks, decl_test_parachains, decl_test_relay_chains, Parachain, RelayChain, - TestExt, -}; +use crate::constants::{imbue,kusama, accounts::{ALICE,BOB, CHARLIE, DAVE, EVE, FERDIE}}; -use crate::setup::{PARA_ID_DEVELOPMENT, PARA_ID_SIBLING}; use frame_support::{parameter_types, sp_io, sp_tracing}; -use xcm_builder::test_utils::XcmHash; +use crate::setup::{ + PARA_ID_DEVELOPMENT, + PARA_ID_SIBLING, +}; use xcm_executor::traits::Convert; +use xcm_builder::test_utils::XcmHash; decl_test_relay_chains! { - pub struct Kusama { - genesis = kusama::genesis(), - on_init = ( - // kusama_runtime::XcmPallet::force_default_xcm_version( + pub struct Kusama { + genesis = kusama::genesis(), + on_init = ( + // kusama_runtime::XcmPallet::force_default_xcm_version( // kusama_runtime::RuntimeOrigin::root(), // Some(SAFE_XCM_VERSION)), - // - // kusama_runtime::XcmPallet::force_xcm_version( + // + // kusama_runtime::XcmPallet::force_xcm_version( // kusama_runtime::RuntimeOrigin::root(), // Box::new(MultiLocation::new(1, X1(Parachain(PARA_ID_SIBLING)))), // SAFE_XCM_VERSION), - // - // kusama_runtime::XcmPallet::force_xcm_version( + // + // kusama_runtime::XcmPallet::force_xcm_version( // kusama_runtime::RuntimeOrigin::root(), // Box::new(MultiLocation::new(1, X1(Parachain(PARA_ID_DEVELOPMENT)))), // SAFE_XCM_VERSION), - kusama_runtime::XcmPallet::force_xcm_version( + kusama_runtime::XcmPallet::force_xcm_version( kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(0, X1(Parachain(PARA_ID_SIBLING)))), SAFE_XCM_VERSION), - kusama_runtime::XcmPallet::force_xcm_version( + kusama_runtime::XcmPallet::force_xcm_version( kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(0, X1(Parachain(PARA_ID_DEVELOPMENT)))), SAFE_XCM_VERSION), - ), - runtime = { - Runtime: kusama_runtime::Runtime, - RuntimeOrigin: kusama_runtime::RuntimeOrigin, - RuntimeCall: kusama_runtime::RuntimeCall, - RuntimeEvent: kusama_runtime::RuntimeEvent, - MessageQueue: kusama_runtime::MessageQueue, - XcmConfig: kusama_runtime::xcm_config::XcmConfig, - SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, - System: kusama_runtime::System, - Balances: kusama_runtime::Balances, - }, - pallets_extra = { - XcmPallet: kusama_runtime::XcmPallet, - } - } + ), + runtime = { + Runtime: kusama_runtime::Runtime, + RuntimeOrigin: kusama_runtime::RuntimeOrigin, + RuntimeCall: kusama_runtime::RuntimeCall, + RuntimeEvent: kusama_runtime::RuntimeEvent, + MessageQueue: kusama_runtime::MessageQueue, + XcmConfig: kusama_runtime::xcm_config::XcmConfig, + SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, + System: kusama_runtime::System, + Balances: kusama_runtime::Balances, + }, + pallets_extra = { + XcmPallet: kusama_runtime::XcmPallet, + } + } } decl_test_parachains! { - pub struct Development { - genesis = imbue::genesis(PARA_ID_DEVELOPMENT), - on_init = ( - imbue_kusama_runtime::PolkadotXcm::force_xcm_version( + pub struct Development { + genesis = imbue::genesis(PARA_ID_DEVELOPMENT), + on_init = ( + imbue_kusama_runtime::PolkadotXcm::force_xcm_version( imbue_kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(1, Here)), SAFE_XCM_VERSION), - ), - runtime = { - Runtime: imbue_kusama_runtime::Runtime, - RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, - RuntimeCall: imbue_kusama_runtime::RuntimeCall, - RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, - XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, - DmpMessageHandler: imbue_kusama_runtime::DmpQueue, - LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, - System: imbue_kusama_runtime::System, - Balances: imbue_kusama_runtime::Balances, - ParachainSystem: imbue_kusama_runtime::ParachainSystem, - ParachainInfo: imbue_kusama_runtime::ParachainInfo, - }, - pallets_extra = { - PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, - XTokens: imbue_kusama_runtime::XTokens, - } - }, - pub struct Sibling { - genesis = imbue::genesis(PARA_ID_SIBLING), - on_init = ( - imbue_kusama_runtime::PolkadotXcm::force_xcm_version( + ), + runtime = { + Runtime: imbue_kusama_runtime::Runtime, + RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, + RuntimeCall: imbue_kusama_runtime::RuntimeCall, + RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, + XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, + DmpMessageHandler: imbue_kusama_runtime::DmpQueue, + LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, + System: imbue_kusama_runtime::System, + Balances: imbue_kusama_runtime::Balances, + ParachainSystem: imbue_kusama_runtime::ParachainSystem, + ParachainInfo: imbue_kusama_runtime::ParachainInfo, + }, + pallets_extra = { + PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, + XTokens: imbue_kusama_runtime::XTokens, + } + }, + pub struct Sibling { + genesis = imbue::genesis(PARA_ID_SIBLING), + on_init = ( + imbue_kusama_runtime::PolkadotXcm::force_xcm_version( imbue_kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(1, Here)), SAFE_XCM_VERSION), - ), - runtime = { - Runtime: imbue_kusama_runtime::Runtime, - RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, - RuntimeCall: imbue_kusama_runtime::RuntimeCall, - RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, - XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, - DmpMessageHandler: imbue_kusama_runtime::DmpQueue, - LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, - System: imbue_kusama_runtime::System, - Balances: imbue_kusama_runtime::Balances, - ParachainSystem: imbue_kusama_runtime::ParachainSystem, - ParachainInfo: imbue_kusama_runtime::ParachainInfo, - }, - pallets_extra = { - PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, - XTokens: imbue_kusama_runtime::XTokens, - } - } + ), + runtime = { + Runtime: imbue_kusama_runtime::Runtime, + RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, + RuntimeCall: imbue_kusama_runtime::RuntimeCall, + RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, + XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, + DmpMessageHandler: imbue_kusama_runtime::DmpQueue, + LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, + System: imbue_kusama_runtime::System, + Balances: imbue_kusama_runtime::Balances, + ParachainSystem: imbue_kusama_runtime::ParachainSystem, + ParachainInfo: imbue_kusama_runtime::ParachainInfo, + }, + pallets_extra = { + PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, + XTokens: imbue_kusama_runtime::XTokens, + } + } } decl_test_networks! { - pub struct TestNet { - relay_chain = Kusama, - parachains = vec![ - Development, - Sibling, - // Karura, - ], - } + pub struct TestNet { + relay_chain = Kusama, + parachains = vec![ + Development, + Sibling, + // Karura, + ], + } } parameter_types! { - // Kusama - pub KusamaSender: AccountId = Kusama::account_id_of(ALICE); - pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB); - // Imbue Kusama - pub ImbueKusamaSender: AccountId = Development::account_id_of(CHARLIE); - pub ImbueKusamaReceiver: AccountId = Development::account_id_of(DAVE); - // Sibling Kusama - pub SiblingKusamaSender: AccountId = Sibling::account_id_of(EVE); - pub SiblingKusamaReceiver: AccountId = Sibling::account_id_of(FERDIE); + // Kusama + pub KusamaSender: AccountId = Kusama::account_id_of(ALICE); + pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB); + // Imbue Kusama + pub ImbueKusamaSender: AccountId = Development::account_id_of(CHARLIE); + pub ImbueKusamaReceiver: AccountId = Development::account_id_of(DAVE); + // Sibling Kusama + pub SiblingKusamaSender: AccountId = Sibling::account_id_of(EVE); + pub SiblingKusamaReceiver: AccountId = Sibling::account_id_of(FERDIE); } + // decl_test_parachains! { // pub struct Development { // Runtime = imbue_kusama_runtime::Runtime, diff --git a/runtime/integration-tests/src/lib.rs b/runtime/integration-tests/src/lib.rs index 8f1121ea..8dc537be 100644 --- a/runtime/integration-tests/src/lib.rs +++ b/runtime/integration-tests/src/lib.rs @@ -1,6 +1,6 @@ #![cfg(test)] -pub mod constants; mod kusama_test_net; mod setup; mod xcm_transfers; +pub mod constants; diff --git a/runtime/integration-tests/src/xcm_transfers.rs b/runtime/integration-tests/src/xcm_transfers.rs index d57fc444..f7ce56c7 100644 --- a/runtime/integration-tests/src/xcm_transfers.rs +++ b/runtime/integration-tests/src/xcm_transfers.rs @@ -17,19 +17,21 @@ use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, NetworkId} use common_runtime::{common_xcm::general_key, parachains}; -use crate::constants::SAFE_XCM_VERSION; -use crate::kusama_test_net::{ - Development, ImbueKusamaReceiver, ImbueKusamaSender, Kusama, KusamaReceiver, KusamaSender, - Sibling, SiblingKusamaReceiver, +use crate::kusama_test_net::{Development, Sibling, Kusama, KusamaSender, KusamaReceiver, ImbueKusamaSender, ImbueKusamaReceiver, SiblingKusamaReceiver}; +use crate::setup::{ + ksm_amount, native_amount, mgx_amount, PARA_ID_DEVELOPMENT, PARA_ID_SIBLING, }; -use crate::setup::{ksm_amount, mgx_amount, native_amount, PARA_ID_DEVELOPMENT, PARA_ID_SIBLING}; use common_runtime::Balance; use common_types::{CurrencyId, FundingType, TreasuryOrigin}; use imbue_kusama_runtime::{ - CanonicalImbuePerSecond, OrmlTokens, Runtime as R, RuntimeOrigin, XTokens, + CanonicalImbuePerSecond, OrmlTokens, + Runtime as R, RuntimeOrigin, XTokens, }; use orml_traits::MultiCurrency; use pallet_proposals::traits::RefundHandler; +use crate::constants::{SAFE_XCM_VERSION}; + + #[test] fn transfer_ksm_to_relay_chain() { @@ -64,7 +66,7 @@ fn transfer_ksm_to_relay_chain() { network: Some(NetworkId::Kusama), }) ) - .into() + .into() ), xcm_emulator::Unlimited )); @@ -80,12 +82,10 @@ fn test_xcm_refund_handler_to_kusama() { let kusama_treasury_address = ::RefundHandler::get_treasury_account_id(treasury_origin) .unwrap(); - let _kusama_treasury_balance_before = - Kusama::account_data_of(kusama_treasury_address.clone()).free; + let _kusama_treasury_balance_before = Kusama::account_data_of(kusama_treasury_address.clone()).free; let transfer_amount: Balance = ksm_amount(10); Development::execute_with(|| { - let ksm_balance = - OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get().into()); + let ksm_balance = OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get().into()); assert_eq!(ksm_balance, 0); }); @@ -105,8 +105,7 @@ fn test_xcm_refund_handler_to_kusama() { )); }); Development::execute_with(|| { - let ksm_balance = - OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get().into()); + let ksm_balance = OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get().into()); assert!(ksm_balance > 0); assert_ok!( ::RefundHandler::send_refund_message_to_treasury( @@ -118,8 +117,7 @@ fn test_xcm_refund_handler_to_kusama() { ); }); - let _kusama_treasury_balance_after = - Kusama::account_data_of(kusama_treasury_address.clone()).free; + let _kusama_treasury_balance_after = Kusama::account_data_of(kusama_treasury_address.clone()).free; #[cfg(not(feature = "runtime-benchmarks"))] assert!(_kusama_treasury_balance_after > _kusama_treasury_balance_before) } @@ -196,8 +194,7 @@ fn transfer_from_relay_chain() { }); Development::execute_with(|| { - let para_receiver_balance_after = - OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get().into()); + let para_receiver_balance_after = OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get().into()); assert!(para_receiver_balance_after > 0); }); } @@ -205,15 +202,16 @@ fn transfer_from_relay_chain() { #[test] fn transfer_native_to_sibling() { Development::execute_with(|| { - assert_ok!(imbue_kusama_runtime::PolkadotXcm::force_xcm_version( - RuntimeOrigin::root(), - Box::new(MultiLocation::new(1, X1(Parachain(PARA_ID_SIBLING)),)), - SAFE_XCM_VERSION - )); + assert_ok!(imbue_kusama_runtime::PolkadotXcm::force_xcm_version(RuntimeOrigin::root(), + Box::new(MultiLocation::new( + 1, + X1( + Parachain(PARA_ID_SIBLING) + ), + )),SAFE_XCM_VERSION)); }); let transfer_amount: Balance = native_amount(10); - let sibling_balance_before: Balance = - Sibling::account_data_of(SiblingKusamaReceiver::get().into()).free; + let sibling_balance_before: Balance = Sibling::account_data_of(SiblingKusamaReceiver::get().into()).free; Development::execute_with(|| { assert_ok!(XTokens::transfer( imbue_kusama_runtime::RuntimeOrigin::signed(ImbueKusamaSender::get().into()), @@ -240,8 +238,9 @@ fn transfer_native_to_sibling() { assert!(sibling_balance_after > sibling_balance_before); } + #[test] -fn transfer_mgx_from_sibling() { +fn transfer_mgx_from_sibling() { // TestNet::reset(); let transfer_amount = mgx_amount(1_000_000_000); Sibling::execute_with(|| { From f8b03b8d098a329b60b7eacaaf10a70118aeede2 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 12 Sep 2023 08:41:28 +0100 Subject: [PATCH 002/192] runtime api --- pallets/proposals/rpc/runtime-api/src/lib.rs | 2 ++ pallets/proposals/src/lib.rs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 0bdc3012..0504cde5 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,7 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] +use crate::ProjectWithVotingData; sp_api::decl_runtime_apis! { pub trait ProposalsApi where AccountId: codec::Codec { fn get_project_account_by_id(project_id: u32) -> AccountId; + fn get_project_milestone_votes(project_id: u32) -> AccountId; } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 7f9160cf..1ad3c741 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -578,6 +578,12 @@ pub struct Whitelist { max_cap: Balance, } +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] +#[scale_info(skip_type_params(T))] +struct ProjectVotingData { + votes: +} + pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; From b578bc39996f51c222f0ed31b440b5102f7c7e50 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 14 Sep 2023 12:54:33 +0100 Subject: [PATCH 003/192] runtime-api-wiring --- pallets/proposals/rpc/runtime-api/src/lib.rs | 7 +++--- pallets/proposals/rpc/src/lib.rs | 26 +++++++++++++++++--- pallets/proposals/src/impls.rs | 11 +++++++++ pallets/proposals/src/lib.rs | 7 +----- pallets/proposals/src/tests.rs | 2 ++ runtime/imbue-kusama/src/lib.rs | 9 ++++++- 6 files changed, 49 insertions(+), 13 deletions(-) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 0504cde5..8969a917 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,9 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] +use crate::pallet::{MilestoneKey, }; -use crate::ProjectWithVotingData; sp_api::decl_runtime_apis! { - pub trait ProposalsApi where AccountId: codec::Codec { + pub trait ProposalsApi where AccountId: codec::Codec { fn get_project_account_by_id(project_id: u32) -> AccountId; - fn get_project_milestone_votes(project_id: u32) -> AccountId; + fn get_project_individuals_votes(project_id: u32) -> BTreeMap>; + fn get_project_total_votes(project_id: u32) -> BTreeMap>; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index ea2c090d..37217618 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -11,9 +11,13 @@ use std::fmt::Display; use std::sync::Arc; #[rpc(client, server)] -pub trait ProposalsApi { +pub trait ProposalsApi { #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; + #[method(name = "proposals_getProjectIndividualVotes")] + fn project_individuals_votes(project_id: u32) -> BTreeMap>; + #[method(name = "proposals_getProjectTotalVotes")] + fn project_total_votes(project_id: u32) -> BTreeMap>; } pub struct Proposals { @@ -48,12 +52,12 @@ impl From for i32 { } } -impl ProposalsApiServer<::Hash, AccountId> for Proposals +impl ProposalsApiServer<::Hash, AccountId, Balance> for Proposals where C: sp_api::ProvideRuntimeApi, C: HeaderBackend, C: Send + Sync + 'static, - C::Api: ProposalsRuntimeApi, + C::Api: ProposalsRuntimeApi, B: BlockT, AccountId: Clone + Display + Codec + Send + 'static, { @@ -64,6 +68,22 @@ where api.get_project_account_by_id(at, project_id) .map_err(runtime_error_into_rpc_err) } + fn project_individuals_votes(&self, project_id: u32) -> RpcResult { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.get_project_individuals_votes(at, project_id) + .map_err(runtime_error_into_rpc_err) + } + + fn project_total_votes(&self, project_id: u32) -> RpcResult { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.get_project_total_votes(at, project_id) + .map_err(runtime_error_into_rpc_err) + } + } /// Converts a runtime trap into an RPC error. diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 706f605b..4c036493 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -434,5 +434,16 @@ impl Pallet { } + // Get the individual votes of a project, return an empty map on error. + //pub fn get_project_individuals_votes(project_key: ProjectKey) -> BTreeMap> { + // let out = BTreeMap::new(); + // if let Some(project) = Projects::::get(project_key) { + // project.milestones.keys().for_each(|(_)| { + // if let Some UserHasVoted::::get() + // (ProjectKey, RoundType, MilestoneKey) + // }) + // } + // out + //} } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 1ad3c741..7afd9e85 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -316,7 +316,7 @@ pub mod pallet { weight } } - +/* */ #[pallet::call] impl Pallet { /// Submit a milestones to be voted on. @@ -578,11 +578,6 @@ pub struct Whitelist { max_cap: Balance, } -#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] -#[scale_info(skip_type_params(T))] -struct ProjectVotingData { - votes: -} pub trait WeightInfoT { fn submit_milestone() -> Weight; diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index 96cbb6c3..6467ec53 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -366,6 +366,8 @@ fn vote_on_milestone_after_round_end_fails() { }); } + + #[test] fn vote_on_milestone_where_voting_round_is_active_but_not_the_correct_milestone() { build_test_externality().execute_with(|| { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 5764683b..18b77ab2 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1105,10 +1105,17 @@ impl_runtime_apis! { } } - impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { + impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { fn get_project_account_by_id(project_id: u32) -> AccountId { ImbueProposals::project_account_id(project_id) } + + fn get_project_individuals_votes(project_id: u32) -> BTreeMap> { + ImbueProposals::get_project_individuals_votes(project_key) + } + fn get_project_total_votes(project_id: u32) -> BTreeMap> { + ImbueProposals::get_project_total_votes(project_key) + } } #[cfg(feature = "runtime-benchmarks")] From 0a4c8f3467de15f01b25d97b772a4079a16e1b2c Mon Sep 17 00:00:00 2001 From: samelamin Date: Mon, 18 Sep 2023 07:57:56 +0100 Subject: [PATCH 004/192] some dummy log statements --- Cargo.lock | 1 + pallets/proposals/Cargo.toml | 1 + pallets/proposals/src/lib.rs | 2 +- pallets/proposals/src/migration.rs | 12 ++++++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 3522d07d..d325e320 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7214,6 +7214,7 @@ dependencies = [ "hex", "integer-sqrt", "lite-json", + "log", "orml-currencies", "orml-tokens", "orml-traits", diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 35ad7daa..3edd2b9b 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -19,6 +19,7 @@ serde = { version = "1.0.101", default-features=false} lite-json = {version="0.1.3", default-features=false, defaults=["no_std"]} hex = { version = "0.4.3", default-features = false, features = ["alloc"] } integer-sqrt = { version = '0.1.5', default-features = false } +log = { version = "0.4.17", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index cc195c2a..a7ae0846 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -485,7 +485,7 @@ pub enum RoundType { VoteOfNoConfidence, } -#[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen)] +#[derive(Encode, Decode, TypeInfo, Debug, PartialEq, MaxEncodedLen)] #[repr(u32)] pub enum Release { V0, diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index cf616ad1..5c6e48c4 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -421,15 +421,27 @@ pub(crate) mod v4 { // Essentially remove all votes that currenctly exist and force a resubmission of milestones. pub(crate) fn migrate_rounds_to_include_milestone_key() -> Weight { let mut weight = ::default(); + + let test = ProjectStorageVersion::::get(); + log::info!("***** ProjectStorageVersion is : {:?}", test); + if ProjectStorageVersion::::get() == Release::V3 { + log::info!( + "***** V4 Rounds count is : {:?}", + V4Rounds::::iter_values().count() + ); + V4Rounds::::drain().for_each(|(project_key, _, block_number)| { weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + log::info!("***** project key is : {:?}", project_key); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); crate::RoundsExpiring::::remove(block_number); weight = weight.saturating_add(T::DbWeight::get().reads(1)); if let Some(project) = crate::Projects::::get(project_key) { + log::info!("***** project key exists is : {:?}", project_key); for (milestone_key, _) in project.milestones.iter() { weight = weight.saturating_add(T::DbWeight::get().reads(1)); if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { From f93d21166652f2f7ae429197f231c4aa60db764c Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 19 Sep 2023 09:06:15 +0100 Subject: [PATCH 005/192] attempt 1 to add try-runtime --- Cargo.lock | 10 +++ libs/common-traits/Cargo.toml | 6 ++ libs/common-types/Cargo.toml | 5 ++ pallets/briefs/Cargo.toml | 9 ++- pallets/briefs/src/lib.rs | 12 +-- pallets/crowdfunding/Cargo.toml | 6 +- pallets/deposits/Cargo.toml | 6 +- pallets/fellowship/Cargo.toml | 6 +- pallets/grants/Cargo.toml | 6 +- pallets/proposals/Cargo.toml | 7 ++ pallets/proposals/rpc/Cargo.toml | 7 ++ pallets/proposals/rpc/runtime-api/Cargo.toml | 8 ++ pallets/proposals/src/lib.rs | 76 ++++++++++-------- pallets/proposals/src/migration.rs | 50 +++++++++--- runtime/common/Cargo.toml | 6 +- runtime/imbue-kusama/Cargo.toml | 81 +++++++++++++++++++- runtime/imbue-kusama/src/lib.rs | 52 ++++++++++--- 17 files changed, 285 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d325e320..9153ade1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1284,6 +1284,7 @@ name = "common-traits" version = "0.1.0" dependencies = [ "frame-support", + "frame-system", "parity-scale-codec 3.6.2", "sp-core", "sp-io", @@ -3336,6 +3337,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "frame-support", "frame-system", + "frame-try-runtime", "parity-scale-codec 3.6.2", "scale-info 2.8.0", "sp-core", @@ -4282,6 +4284,7 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex", "hex-literal 0.3.4", "log", @@ -6657,6 +6660,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "orml-currencies", "orml-tokens", "orml-traits", @@ -7209,6 +7213,7 @@ dependencies = [ "cumulus-pallet-xcm", "cumulus-primitives-core", "frame-benchmarking", + "frame-executive", "frame-support", "frame-system", "hex", @@ -7242,6 +7247,8 @@ dependencies = [ name = "pallet-proposals-rpc" version = "0.1.0" dependencies = [ + "frame-support", + "frame-system", "jsonrpsee", "pallet-proposals-rpc-runtime-api", "parity-scale-codec 3.6.2", @@ -7255,8 +7262,11 @@ dependencies = [ name = "pallet-proposals-rpc-runtime-api" version = "0.1.0" dependencies = [ + "frame-support", + "frame-system", "parity-scale-codec 3.6.2", "sp-api", + "sp-runtime", ] [[package]] diff --git a/libs/common-traits/Cargo.toml b/libs/common-traits/Cargo.toml index e421952a..e05ee1c6 100644 --- a/libs/common-traits/Cargo.toml +++ b/libs/common-traits/Cargo.toml @@ -15,6 +15,7 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } @@ -26,6 +27,11 @@ sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "po [features] default = ['std'] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] std = [ "codec/std", "frame-support/std", diff --git a/libs/common-types/Cargo.toml b/libs/common-types/Cargo.toml index dbc7d86b..7b07765f 100644 --- a/libs/common-types/Cargo.toml +++ b/libs/common-types/Cargo.toml @@ -34,6 +34,11 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "pol [features] default = ['std'] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] std = [ 'codec/std', 'sp-std/std', diff --git a/pallets/briefs/Cargo.toml b/pallets/briefs/Cargo.toml index a6a5975b..5bafa20e 100644 --- a/pallets/briefs/Cargo.toml +++ b/pallets/briefs/Cargo.toml @@ -15,6 +15,8 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } +log = { version = "0.4.17", default-features = false } + serde = { version = "1.0.101", default-features=false} scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } @@ -55,6 +57,7 @@ common-runtime = { path = "../../runtime/common"} [features] default = ['std'] + std = [ "codec/std", "serde/std", @@ -79,4 +82,8 @@ runtime-benchmarks = [ "common-runtime/runtime-benchmarks", ] -try-runtime = ["frame-support/try-runtime"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] \ No newline at end of file diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index 520c826e..53e88aae 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -25,7 +25,9 @@ mod migrations; #[frame_support::pallet] pub mod pallet { use common_types::{milestone_origin::FundingType, CurrencyId}; - use frame_support::{pallet_prelude::*, sp_runtime::Saturating, traits::Get, BoundedBTreeMap, weights::Weight}; + use frame_support::{ + pallet_prelude::*, sp_runtime::Saturating, traits::Get, weights::Weight, BoundedBTreeMap, + }; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_deposits::traits::DepositHandler; @@ -60,7 +62,7 @@ pub mod pallet { pub type BriefHash = H256; #[pallet::pallet] - pub struct Pallet(_); + pub struct Pallet(_); #[pallet::config] pub trait Config: frame_system::Config { @@ -158,6 +160,9 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_runtime_upgrade() -> Weight { + log::info!(target: "pallet-briefs", "****** STARTING MIGRATION in briefs *****"); + log::warn!(target: "pallet-briefs", "****** STARTING MIGRATION in briefs *****"); + log::error!(target: "pallet-briefs", "****** STARTING MIGRATION in briefs *****"); let mut weight: Weight = Zero::zero(); crate::migrations::v1::migrate_to_v1::(&mut weight); weight @@ -405,7 +410,4 @@ pub mod pallet { fn commence_work() -> Weight; fn cancel_brief() -> Weight; } - } - - diff --git a/pallets/crowdfunding/Cargo.toml b/pallets/crowdfunding/Cargo.toml index fba3227b..ab091c23 100644 --- a/pallets/crowdfunding/Cargo.toml +++ b/pallets/crowdfunding/Cargo.toml @@ -63,4 +63,8 @@ std = [ ] runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "common-runtime/runtime-benchmarks",] -try-runtime = ["frame-support/try-runtime"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] \ No newline at end of file diff --git a/pallets/deposits/Cargo.toml b/pallets/deposits/Cargo.toml index 81b9cabc..1c4d0908 100644 --- a/pallets/deposits/Cargo.toml +++ b/pallets/deposits/Cargo.toml @@ -48,4 +48,8 @@ std = [ "common-runtime/std" ] runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks"] -try-runtime = ["frame-support/try-runtime"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] \ No newline at end of file diff --git a/pallets/fellowship/Cargo.toml b/pallets/fellowship/Cargo.toml index d9e6c8ea..f9c7f03d 100644 --- a/pallets/fellowship/Cargo.toml +++ b/pallets/fellowship/Cargo.toml @@ -53,4 +53,8 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", ] -try-runtime = ["frame-support/try-runtime"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] \ No newline at end of file diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index bc50cc06..ac09e1ce 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -70,4 +70,8 @@ runtime-benchmarks = [ "pallet-xcm/runtime-benchmarks", "common-runtime/runtime-benchmarks" ] -try-runtime = ["frame-support/try-runtime"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] \ No newline at end of file diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 3edd2b9b..9dbb82e8 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -34,6 +34,7 @@ cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = " cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" , default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43", default-features = false } @@ -64,6 +65,12 @@ common-runtime = { path = "../../runtime/common"} [features] default = ['std'] runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "common-runtime/runtime-benchmarks"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] + std = [ "codec/std", "serde/std", diff --git a/pallets/proposals/rpc/Cargo.toml b/pallets/proposals/rpc/Cargo.toml index 08e8e935..b4dd6cb7 100644 --- a/pallets/proposals/rpc/Cargo.toml +++ b/pallets/proposals/rpc/Cargo.toml @@ -16,11 +16,18 @@ sp-api = { default-features = false, version = "4.0.0-dev", git = "https://githu sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } sp-blockchain = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } pallet-proposals-rpc-runtime-api = {path = "./runtime-api" } [features] default = ["std"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] std = [ "sp-api/std", "sp-runtime/std", diff --git a/pallets/proposals/rpc/runtime-api/Cargo.toml b/pallets/proposals/rpc/runtime-api/Cargo.toml index a78ea3ee..034e1d44 100644 --- a/pallets/proposals/rpc/runtime-api/Cargo.toml +++ b/pallets/proposals/rpc/runtime-api/Cargo.toml @@ -12,9 +12,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = ] } sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } [features] default = ["std"] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] std = [ "sp-api/std", ] \ No newline at end of file diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index a7ae0846..641df2cd 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -272,43 +272,51 @@ pub mod pallet { /// /// > fn on_runtime_upgrade() -> Weight { - migration::v4::migrate_rounds_to_include_milestone_key::() - } - - // SAFETY: ExpiringProjectRoundsPerBlock has to be sane to prevent overweight blocks. - fn on_initialize(n: BlockNumberFor) -> Weight { let mut weight = T::DbWeight::get().reads_writes(1, 1); - let key_type_vec = RoundsExpiring::::take(n); - - key_type_vec.iter().for_each(|item| { - let (project_key, round_type, milestone_key) = item; - weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - - // Remove the round prevents further voting. - Rounds::::remove((project_key, milestone_key), round_type); - match round_type { - // Voting rounds automatically finalise if its reached its threshold. - // Therefore we can remove it on round end. - RoundType::VotingRound => { - weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); - - MilestoneVotes::::remove(project_key, milestone_key); - UserHasVoted::::remove(( - project_key, - RoundType::VotingRound, - milestone_key, - )); - } - // Votes of no confidence do not finaliese automatically - RoundType::VoteOfNoConfidence => { - // for now keep the round in tact and let them finalise. - // todo, this should be handled in pallet-dispute. - } - } - }); - + log::info!(target: "pallet-proposals","****** STARTING MIGRATION *****"); + log::warn!(target: "pallet-proposals","****** STARTING MIGRATION *****"); + log::error!(target: "pallet-proposals", "****** STARTING MIGRATION *****"); + crate::migration::v4::migrate_to_v4::(&mut weight); + log::info!(target: "pallet-proposals", "****** ENDING MIGRATION *****"); + log::warn!(target: "pallet-proposals", "****** ENDING MIGRATION *****"); + log::error!(target: "pallet-proposals", "****** ENDING MIGRATION *****"); weight } + + // SAFETY: ExpiringProjectRoundsPerBlock has to be sane to prevent overweight blocks. + // fn on_initialize(n: BlockNumberFor) -> Weight { + // let mut weight = T::DbWeight::get().reads_writes(1, 1); + // let key_type_vec = RoundsExpiring::::take(n); + // + // key_type_vec.iter().for_each(|item| { + // let (project_key, round_type, milestone_key) = item; + // weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + // + // // Remove the round prevents further voting. + // Rounds::::remove((project_key, milestone_key), round_type); + // match round_type { + // // Voting rounds automatically finalise if its reached its threshold. + // // Therefore we can remove it on round end. + // RoundType::VotingRound => { + // weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); + // + // MilestoneVotes::::remove(project_key, milestone_key); + // UserHasVoted::::remove(( + // project_key, + // RoundType::VotingRound, + // milestone_key, + // )); + // } + // // Votes of no confidence do not finaliese automatically + // RoundType::VoteOfNoConfidence => { + // // for now keep the round in tact and let them finalise. + // // todo, this should be handled in pallet-dispute. + // } + // } + // }); + // + // weight + // } } #[pallet::call] diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 5c6e48c4..c468ce4b 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -1,4 +1,5 @@ use crate::*; +use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; pub use pallet::*; pub type TimestampOf = ::Moment; @@ -405,7 +406,7 @@ pub mod v3 { } } -pub(crate) mod v4 { +pub mod v4 { use super::*; #[storage_alias] pub type V4Rounds = StorageDoubleMap< @@ -419,9 +420,8 @@ pub(crate) mod v4 { >; // Essentially remove all votes that currenctly exist and force a resubmission of milestones. - pub(crate) fn migrate_rounds_to_include_milestone_key() -> Weight { - let mut weight = ::default(); - + pub fn migrate_to_v4(weight: &mut Weight) { + log::info!("***** starting migration in fn"); let test = ProjectStorageVersion::::get(); log::info!("***** ProjectStorageVersion is : {:?}", test); @@ -432,20 +432,20 @@ pub(crate) mod v4 { ); V4Rounds::::drain().for_each(|(project_key, _, block_number)| { - weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); log::info!("***** project key is : {:?}", project_key); - weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); crate::RoundsExpiring::::remove(block_number); - weight = weight.saturating_add(T::DbWeight::get().reads(1)); + *weight = weight.saturating_add(T::DbWeight::get().reads(1)); if let Some(project) = crate::Projects::::get(project_key) { log::info!("***** project key exists is : {:?}", project_key); for (milestone_key, _) in project.milestones.iter() { - weight = weight.saturating_add(T::DbWeight::get().reads(1)); + *weight = weight.saturating_add(T::DbWeight::get().reads(1)); if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { - weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); crate::MilestoneVotes::::remove(project_key, milestone_key); } else { break; @@ -455,7 +455,35 @@ pub(crate) mod v4 { }); ProjectStorageVersion::::set(Release::V4); } - weight + } + + pub struct MigrateToV4(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV4 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::info!(target: "pallet-proposals", "Running pre_upgrade()"); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads_writes(1, 1); + log::info!("****** STARTING MIGRATION *****"); + log::warn!("****** STARTING MIGRATION *****"); + crate::migration::v4::migrate_to_v4::(&mut weight); + log::warn!("****** ENDING MIGRATION *****"); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::info!(target: "pallet-proposals", "Running post_upgrade()"); + ensure!( + StorageVersion::get::>() >= 7, + "Storage version should be >= 7 after the migration" + ); + + Ok(()) + } } } @@ -772,7 +800,7 @@ mod test { crate::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); crate::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); - let _ = v4::migrate_rounds_to_include_milestone_key::(); + let _ = v4::migrate_to_v4::(); // assert that: // 1: the round has been removed (to allow resubmission) // 2: milestone votes have been reset (although resubmission resets this) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 8b75a641..8286fd3d 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -51,7 +51,11 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [features] default = ['std'] - +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] std = [ "serde/std", "codec/std", diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 685351c2..3e0d112c 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -60,6 +60,7 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "p pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } # Cumulus Dependencies @@ -107,7 +108,6 @@ common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } pallet-proposals-rpc-runtime-api = {path = "../../pallets/proposals/rpc/runtime-api", default-features = false} - [dev-dependencies] hex-literal = "0.3.1" hex = "0.4.3" @@ -118,6 +118,83 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [features] default = ['std'] +try-runtime = [ +# 'sp-api/try-runtime', +# 'sp-arithmetic/try-runtime', +# 'sp-block-builder/try-runtime', +# 'sp-core/try-runtime', +# 'sp-consensus-aura/try-runtime', +# 'sp-inherents/try-runtime', +# 'sp-io/try-runtime', +# 'sp-offchain/try-runtime', + 'sp-runtime/try-runtime', +# 'sp-session/try-runtime', +# 'sp-std/try-runtime', +# 'sp-transaction-pool/try-runtime', +# 'sp-version/try-runtime', + 'frame-executive/try-runtime', + 'frame-support/try-runtime', + 'frame-system/try-runtime', +# 'frame-system-rpc-runtime-api/try-runtime', + 'pallet-aura/try-runtime', + 'pallet-assets/try-runtime', + 'pallet-authorship/try-runtime', + 'pallet-balances/try-runtime', + 'pallet-collective/try-runtime', + 'pallet-democracy/try-runtime', + 'pallet-identity/try-runtime', + 'pallet-membership/try-runtime', + 'pallet-multisig/try-runtime', + 'pallet-preimage/try-runtime', + 'pallet-sudo/try-runtime', + 'pallet-session/try-runtime', + 'pallet-timestamp/try-runtime', +# 'pallet-transaction-payment/try-runtime', +# 'pallet-transaction-payment-rpc-runtime-api/try-runtime', + 'pallet-treasury/try-runtime', + 'pallet-scheduler/try-runtime', + 'pallet-vesting/try-runtime', + 'pallet-utility/try-runtime', + 'frame-try-runtime', + 'cumulus-pallet-aura-ext/try-runtime', + 'cumulus-pallet-parachain-system/try-runtime', + 'cumulus-pallet-dmp-queue/try-runtime', + 'cumulus-pallet-xcm/try-runtime', + 'cumulus-pallet-xcmp-queue/try-runtime', +# 'cumulus-primitives-core/try-runtime', +# 'cumulus-primitives-timestamp/try-runtime', +# 'cumulus-primitives-utility/try-runtime', + 'pallet-collator-selection/try-runtime', + 'parachain-info/try-runtime', +# 'xcm/try-runtime', +# 'xcm-builder/try-runtime', +# 'xcm-executor/try-runtime', + 'pallet-xcm/try-runtime', +# 'polkadot-parachain', + 'polkadot-runtime-common/try-runtime', + + 'orml-asset-registry/try-runtime', + 'orml-tokens/try-runtime', +# 'orml-traits/try-runtime', + 'orml-xcm/try-runtime', +# 'orml-xcm-support/try-runtime', + 'orml-xtokens/try-runtime', + 'orml-currencies/try-runtime', + 'orml-unknown-tokens/try-runtime', + +# 'frame-benchmarking/try-runtime', +# 'frame-system-benchmarking/try-runtime', + + 'common-runtime/try-runtime', + 'pallet-proposals/try-runtime', + 'pallet-briefs/try-runtime', + 'pallet-grants/try-runtime', + 'pallet-deposits/try-runtime', + 'common-traits/try-runtime', + 'common-types/try-runtime', + 'pallet-proposals-rpc-runtime-api/try-runtime', + +] std = [ 'codec/std', 'scale-info/std', @@ -175,7 +252,6 @@ std = [ 'cumulus-primitives-utility/std', 'common-traits/std', 'common-types/std', - 'pallet-proposals/std', 'pallet-proposals-rpc-runtime-api/std', 'pallet-briefs/std', @@ -195,7 +271,6 @@ runtime-benchmarks = [ 'pallet-xcm/runtime-benchmarks', 'xcm-builder/runtime-benchmarks', "common-runtime/runtime-benchmarks", - 'pallet-proposals/runtime-benchmarks', 'pallet-briefs/runtime-benchmarks', 'pallet-grants/runtime-benchmarks', diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 4317a8de..73c6e447 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -10,6 +10,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod sanity; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; + use sp_api::impl_runtime_apis; use sp_core::OpaqueMetadata; @@ -98,7 +99,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("imbue"), impl_name: create_runtime_str!("imbue"), authoring_version: 2, - spec_version: 9430, + spec_version: 94301, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -169,6 +170,28 @@ impl Contains for BaseCallFilter { } } } + +pub type Migrations = migrations::Unreleased; + +/// The runtime migrations per release. +#[allow(deprecated, missing_docs)] +pub mod migrations { + use super::*; + + /// Unreleased migrations. Add new ones here: + pub type Unreleased = (pallet_proposals::migration::v4::MigrateToV4,); +} + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, + Migrations, +>; + impl frame_system::Config for Runtime { type BaseCallFilter = Everything; type BlockWeights = RuntimeBlockWeights; @@ -947,14 +970,6 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, ->; #[cfg(feature = "runtime-benchmarks")] #[macro_use] @@ -1122,6 +1137,25 @@ impl_runtime_apis! { } } + #[cfg(feature = "try-runtime")] + impl frame_try_runtime::TryRuntime for Runtime { + fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + let weight = Executive::try_runtime_upgrade(checks).unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + + fn execute_block( + block: Block, + state_root_check: bool, + signature_check: bool, + select: frame_try_runtime::TryStateSelect, + ) -> Weight { + // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to + // have a backtrace here. + Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( From 897729f72979ed81025e94f541432a1f531d4699 Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 19 Sep 2023 09:15:39 +0100 Subject: [PATCH 006/192] second attempt --- runtime/imbue-kusama/Cargo.toml | 6 +++--- runtime/imbue-kusama/src/lib.rs | 35 +++++++++++++++++---------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 3e0d112c..3873288d 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -62,7 +62,6 @@ pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "po pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } - # Cumulus Dependencies cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" , default-features = false } cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" , default-features = false } @@ -155,7 +154,7 @@ try-runtime = [ 'pallet-scheduler/try-runtime', 'pallet-vesting/try-runtime', 'pallet-utility/try-runtime', - 'frame-try-runtime', + 'frame-try-runtime/try-runtime', 'cumulus-pallet-aura-ext/try-runtime', 'cumulus-pallet-parachain-system/try-runtime', 'cumulus-pallet-dmp-queue/try-runtime', @@ -193,7 +192,7 @@ try-runtime = [ 'common-traits/try-runtime', 'common-types/try-runtime', 'pallet-proposals-rpc-runtime-api/try-runtime', - + "pallet-transaction-payment/try-runtime" ] std = [ 'codec/std', @@ -214,6 +213,7 @@ std = [ 'frame-support/std', 'frame-executive/std', 'frame-system/std', + 'frame-try-runtime/std', 'frame-system-rpc-runtime-api/std', "orml-asset-registry/std", "orml-tokens/std", diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 73c6e447..453d5cf2 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1012,6 +1012,24 @@ impl_opaque_keys! { } impl_runtime_apis! { + #[cfg(feature = "try-runtime")] + impl frame_try_runtime::TryRuntime for Runtime { + fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + let weight = Executive::try_runtime_upgrade(checks).unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + + fn execute_block( + block: Block, + state_root_check: bool, + signature_check: bool, + select: frame_try_runtime::TryStateSelect, + ) -> Weight { + // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to + // have a backtrace here. + Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() + } + } impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION @@ -1137,24 +1155,7 @@ impl_runtime_apis! { } } - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, RuntimeBlockWeights::get().max_block) - } - fn execute_block( - block: Block, - state_root_check: bool, - signature_check: bool, - select: frame_try_runtime::TryStateSelect, - ) -> Weight { - // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to - // have a backtrace here. - Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() - } - } #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { From 33353bbc736662de4a0648f1334bd205ad396bee Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 19 Sep 2023 10:05:28 +0100 Subject: [PATCH 007/192] add to the cli --- Cargo.lock | 2 ++ libs/common-types/Cargo.toml | 7 ++--- node/Cargo.toml | 27 ++++++++++++++----- node/src/cli.rs | 8 ++++++ node/src/command.rs | 39 ++++++++++++++++++++++++++++ pallets/briefs/Cargo.toml | 17 ++++++++++-- pallets/crowdfunding/Cargo.toml | 11 +++++++- pallets/deposits/Cargo.toml | 6 ++++- pallets/fellowship/Cargo.toml | 5 +++- pallets/grants/Cargo.toml | 12 ++++++++- pallets/proposals/Cargo.toml | 14 ++++++++++ pallets/proposals/rpc/Cargo.toml | 9 ++++--- runtime/common/Cargo.toml | 4 +++ runtime/integration-tests/Cargo.toml | 2 +- 14 files changed, 143 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9153ade1..027b895e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4259,6 +4259,7 @@ dependencies = [ "tempfile", "tokio", "trie-root 0.15.2", + "try-runtime-cli", "xcm", "xcm-builder", ] @@ -13982,6 +13983,7 @@ dependencies = [ "async-trait", "clap 4.3.10", "frame-remote-externalities", + "frame-try-runtime", "hex", "log", "parity-scale-codec 3.6.2", diff --git a/libs/common-types/Cargo.toml b/libs/common-types/Cargo.toml index 7b07765f..cc7e3cbb 100644 --- a/libs/common-types/Cargo.toml +++ b/libs/common-types/Cargo.toml @@ -35,9 +35,10 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "pol [features] default = ['std'] try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", + "common-traits/try-runtime" ] std = [ 'codec/std', diff --git a/node/Cargo.toml b/node/Cargo.toml index de8b35b0..d690d70b 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -15,12 +15,7 @@ targets = ['x86_64-unknown-linux-gnu'] [[bin]] name = 'imbue' -[features] -default = [] -runtime-benchmarks = [ - 'polkadot-cli/runtime-benchmarks', - 'imbue-kusama-runtime/runtime-benchmarks', -] + [dependencies] async-trait = "0.1.57" @@ -78,6 +73,7 @@ sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } +try-runtime-cli = { git = "https://github.com/paritytech/substrate", optional = true , branch = "polkadot-v0.9.43" } # RPC related dependencies jsonrpsee = { version = "0.16.2", features = ["ws-client"] } @@ -124,3 +120,22 @@ rand = "0.7.3" tempfile = "3.2.0" tokio = { version = "1.10.0", features = ["macros"] } cargo-llvm-cov = "0.1.13" + +[features] +default = [] +runtime-benchmarks = [ + "try-runtime-cli/try-runtime", + "imbue-kusama-runtime/runtime-benchmarks", + "polkadot-cli/runtime-benchmarks", +] +try-runtime = [ + "try-runtime-cli/try-runtime", + "imbue-kusama-runtime/try-runtime", + "common-runtime/try-runtime", + "pallet-collective/try-runtime", + "pallet-proposals-rpc/try-runtime", + "pallet-xcm/try-runtime", + "polkadot-cli/try-runtime", + "polkadot-service/try-runtime", + "sp-runtime/try-runtime" +] diff --git a/node/src/cli.rs b/node/src/cli.rs index 535e293d..bb439275 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -35,6 +35,14 @@ pub enum Subcommand { /// The custom benchmark subcommmand benchmarking runtime pallets. #[clap(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), + + /// Try some testing command against a specified runtime state. + #[cfg(feature = "try-runtime")] + TryRuntime(try_runtime_cli::TryRuntimeCmd), + + /// Errors since the binary was not build with `--features try-runtime`. + #[cfg(not(feature = "try-runtime"))] + TryRuntime, } #[derive(Debug, Parser)] diff --git a/node/src/command.rs b/node/src/command.rs index 360b0c24..6f35e46e 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -263,6 +263,45 @@ pub fn run() -> Result<()> { } } + #[cfg(feature = "try-runtime")] + Some(Subcommand::TryRuntime(cmd)) => { + use imbue_kusama_runtime::MILLISECS_PER_BLOCK; + use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; + use try_runtime_cli::block_building_info::timestamp_with_aura_info; + + let runner = cli.create_runner(cmd)?; + + type HostFunctionsOf = ExtendedHostFunctions< + sp_io::SubstrateHostFunctions, + ::ExtendHostFunctions, + >; + + // grab the task manager. + let registry = &runner + .config() + .prometheus_config + .as_ref() + .map(|cfg| &cfg.registry); + let task_manager = + sc_service::TaskManager::new(runner.config().tokio_handle.clone(), *registry) + .map_err(|e| format!("Error: {:?}", e))?; + + let info_provider = timestamp_with_aura_info(MILLISECS_PER_BLOCK); + + runner.async_run(|_| { + Ok(( + cmd.run::, _>(Some( + info_provider, + )), + task_manager, + )) + }) + } + #[cfg(not(feature = "try-runtime"))] + Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \ + You can enable it with `--features try-runtime`." + .into()), + None => { let runner = cli.create_runner(&cli.run.normalize())?; let collator_options = cli.run.collator_options(); diff --git a/pallets/briefs/Cargo.toml b/pallets/briefs/Cargo.toml index 5bafa20e..98b70890 100644 --- a/pallets/briefs/Cargo.toml +++ b/pallets/briefs/Cargo.toml @@ -61,7 +61,7 @@ default = ['std'] std = [ "codec/std", "serde/std", - "frame-benchmarking?/std", + "frame-benchmarking/std", "frame-support/std", "frame-system/std", "scale-info/std", @@ -86,4 +86,17 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", -] \ No newline at end of file + "pallet-balances/try-runtime", + "pallet-proposals/try-runtime", + "common-runtime/try-runtime", + "pallet-xcm/try-runtime", + "pallet-deposits/try-runtime", + "pallet-deposits/try-runtime", + "common-traits/try-runtime", + "common-types/try-runtime", + "orml-currencies/try-runtime", + "orml-tokens/try-runtime", + "pallet-identity/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime" +] diff --git a/pallets/crowdfunding/Cargo.toml b/pallets/crowdfunding/Cargo.toml index ab091c23..f6ba47ed 100644 --- a/pallets/crowdfunding/Cargo.toml +++ b/pallets/crowdfunding/Cargo.toml @@ -67,4 +67,13 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", -] \ No newline at end of file + "common-runtime/try-runtime", + "common-types/try-runtime", + "orml-tokens/try-runtime", + "pallet-balances/try-runtime", + "pallet-deposits/try-runtime", + "pallet-identity/try-runtime", + "pallet-proposals/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-xcm/try-runtime" +] diff --git a/pallets/deposits/Cargo.toml b/pallets/deposits/Cargo.toml index 1c4d0908..cf3fcf4c 100644 --- a/pallets/deposits/Cargo.toml +++ b/pallets/deposits/Cargo.toml @@ -52,4 +52,8 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", -] \ No newline at end of file + "common-runtime/try-runtime", + "common-types/try-runtime", + "orml-tokens/try-runtime", + "pallet-xcm/try-runtime" +] diff --git a/pallets/fellowship/Cargo.toml b/pallets/fellowship/Cargo.toml index f9c7f03d..68ab54f1 100644 --- a/pallets/fellowship/Cargo.toml +++ b/pallets/fellowship/Cargo.toml @@ -57,4 +57,7 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", -] \ No newline at end of file + "common-traits/try-runtime", + "common-types/try-runtime", + "orml-tokens/try-runtime" +] diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index ac09e1ce..ae6e9730 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -74,4 +74,14 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", -] \ No newline at end of file + "common-runtime/try-runtime", + "common-traits/try-runtime", + "common-types/try-runtime", + "orml-tokens/try-runtime", + "pallet-balances/try-runtime", + "pallet-deposits/try-runtime", + "pallet-identity/try-runtime", + "pallet-proposals/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-xcm/try-runtime" +] diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 9dbb82e8..8081157d 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -69,6 +69,20 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", + "common-runtime/try-runtime", + "common-traits/try-runtime", + "common-types/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "frame-executive?/try-runtime", + "orml-currencies/try-runtime", + "orml-tokens/try-runtime", + "orml-xtokens/try-runtime", + "pallet-balances/try-runtime", + "pallet-deposits/try-runtime", + "pallet-identity/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-xcm/try-runtime" ] std = [ diff --git a/pallets/proposals/rpc/Cargo.toml b/pallets/proposals/rpc/Cargo.toml index b4dd6cb7..f65b1eae 100644 --- a/pallets/proposals/rpc/Cargo.toml +++ b/pallets/proposals/rpc/Cargo.toml @@ -24,11 +24,12 @@ pallet-proposals-rpc-runtime-api = {path = "./runtime-api" } [features] default = ["std"] try-runtime = [ - "frame-support/try-runtime", - "frame-system/try-runtime", - "sp-runtime/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", + "pallet-proposals-rpc-runtime-api/try-runtime" ] std = [ "sp-api/std", "sp-runtime/std", -] \ No newline at end of file +] diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 8286fd3d..5290643a 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -55,6 +55,10 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "sp-runtime/try-runtime", + "common-traits/try-runtime", + "common-types/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime" ] std = [ "serde/std", diff --git a/runtime/integration-tests/Cargo.toml b/runtime/integration-tests/Cargo.toml index 6b4f746c..c6500249 100644 --- a/runtime/integration-tests/Cargo.toml +++ b/runtime/integration-tests/Cargo.toml @@ -75,4 +75,4 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "pallet-proposals/runtime-benchmarks", "xcm-builder/runtime-benchmarks", -] \ No newline at end of file +] From fe1cb421ea6b751a7b3642a674f69849886a9743 Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 19 Sep 2023 13:53:00 +0100 Subject: [PATCH 008/192] fix warn issue --- runtime/imbue-kusama/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 453d5cf2..0555ff8e 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -544,7 +544,7 @@ impl pallet_democracy::Config for Runtime { type ExternalOrigin = HalfOfCouncil; /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote /// be tabled immediately and with a shorter voting/enactment period. - type FastTrackOrigin = HalfOfCouncil; + type FastTrackOrigin = FastTrackOrigin; type FastTrackVotingPeriod = FastTrackVotingPeriod; type InstantAllowed = InstantAllowed; type InstantOrigin = EnsureRootOr; From e3a5dd944b3c7e47c04b4300fcf2d28c426ec74c Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 19 Sep 2023 20:12:28 +0100 Subject: [PATCH 009/192] on initialise, remove on runtime upgrade proposasl --- pallets/proposals/src/lib.rs | 80 ++++++++++++------------------ pallets/proposals/src/migration.rs | 10 ++-- 2 files changed, 38 insertions(+), 52 deletions(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 641df2cd..43b88160 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -266,57 +266,41 @@ pub mod pallet { #[pallet::hooks] impl Hooks for Pallet { - /// - fn on_runtime_upgrade() -> Weight { + + // SAFETY: ExpiringProjectRoundsPerBlock has to be sane to prevent overweight blocks. + fn on_initialize(n: BlockNumberFor) -> Weight { let mut weight = T::DbWeight::get().reads_writes(1, 1); - log::info!(target: "pallet-proposals","****** STARTING MIGRATION *****"); - log::warn!(target: "pallet-proposals","****** STARTING MIGRATION *****"); - log::error!(target: "pallet-proposals", "****** STARTING MIGRATION *****"); - crate::migration::v4::migrate_to_v4::(&mut weight); - log::info!(target: "pallet-proposals", "****** ENDING MIGRATION *****"); - log::warn!(target: "pallet-proposals", "****** ENDING MIGRATION *****"); - log::error!(target: "pallet-proposals", "****** ENDING MIGRATION *****"); + let key_type_vec = RoundsExpiring::::take(n); + + key_type_vec.iter().for_each(|item| { + let (project_key, round_type, milestone_key) = item; + weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + + // Remove the round prevents further voting. + Rounds::::remove((project_key, milestone_key), round_type); + match round_type { + // Voting rounds automatically finalise if its reached its threshold. + // Therefore we can remove it on round end. + RoundType::VotingRound => { + weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); + + MilestoneVotes::::remove(project_key, milestone_key); + UserHasVoted::::remove(( + project_key, + RoundType::VotingRound, + milestone_key, + )); + } + // Votes of no confidence do not finaliese automatically + RoundType::VoteOfNoConfidence => { + // for now keep the round in tact and let them finalise. + // todo, this should be handled in pallet-dispute. + } + } + }); + weight } - - // SAFETY: ExpiringProjectRoundsPerBlock has to be sane to prevent overweight blocks. - // fn on_initialize(n: BlockNumberFor) -> Weight { - // let mut weight = T::DbWeight::get().reads_writes(1, 1); - // let key_type_vec = RoundsExpiring::::take(n); - // - // key_type_vec.iter().for_each(|item| { - // let (project_key, round_type, milestone_key) = item; - // weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - // - // // Remove the round prevents further voting. - // Rounds::::remove((project_key, milestone_key), round_type); - // match round_type { - // // Voting rounds automatically finalise if its reached its threshold. - // // Therefore we can remove it on round end. - // RoundType::VotingRound => { - // weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); - // - // MilestoneVotes::::remove(project_key, milestone_key); - // UserHasVoted::::remove(( - // project_key, - // RoundType::VotingRound, - // milestone_key, - // )); - // } - // // Votes of no confidence do not finaliese automatically - // RoundType::VoteOfNoConfidence => { - // // for now keep the round in tact and let them finalise. - // // todo, this should be handled in pallet-dispute. - // } - // } - // }); - // - // weight - // } } #[pallet::call] diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index c468ce4b..76ce7aa2 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -425,7 +425,6 @@ pub mod v4 { let test = ProjectStorageVersion::::get(); log::info!("***** ProjectStorageVersion is : {:?}", test); - if ProjectStorageVersion::::get() == Release::V3 { log::info!( "***** V4 Rounds count is : {:?}", V4Rounds::::iter_values().count() @@ -454,7 +453,6 @@ pub mod v4 { } }); ProjectStorageVersion::::set(Release::V4); - } } pub struct MigrateToV4(sp_std::marker::PhantomData); @@ -462,6 +460,10 @@ pub mod v4 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::info!(target: "pallet-proposals", "Running pre_upgrade()"); + ensure!( + ProjectStorageVersion::::get() == Release::V4, + "Required v3 before upgrading to v4" + ); Ok(Vec::new()) } @@ -478,8 +480,8 @@ pub mod v4 { fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { log::info!(target: "pallet-proposals", "Running post_upgrade()"); ensure!( - StorageVersion::get::>() >= 7, - "Storage version should be >= 7 after the migration" + ProjectStorageVersion::::get() == Release::V4, + "Storage version should be v4 after the migration" ); Ok(()) From c8d46b03985bd5aa533e92046ac87d5f64df9f77 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 21:15:46 +0100 Subject: [PATCH 010/192] add the new storage version migration --- pallets/briefs/src/migrations.rs | 74 ++++++++++++++++++++++++++--- pallets/grants/src/migrations.rs | 76 +++++++++++++++++++++++++++--- pallets/proposals/src/migration.rs | 72 +++++++++++++++++++++------- 3 files changed, 191 insertions(+), 31 deletions(-) diff --git a/pallets/briefs/src/migrations.rs b/pallets/briefs/src/migrations.rs index 0ed826ec..8a722980 100644 --- a/pallets/briefs/src/migrations.rs +++ b/pallets/briefs/src/migrations.rs @@ -1,14 +1,13 @@ use crate::*; -use common_types::CurrencyId; -use frame_support::{pallet_prelude::*, storage_alias, traits::Get, weights::Weight}; pub use pallet::*; +use common_types::CurrencyId; +use frame_support::{pallet_prelude::*, storage_alias, traits::{Get, OnRuntimeUpgrade}, weights::Weight}; +use frame_system::pallet_prelude::BlockNumberFor; use pallet_proposals::ProposedMilestone; use sp_arithmetic::Percent; use sp_std::convert::TryInto; use sp_std::vec::Vec; -type BlockNumberFor = ::BlockNumber; - mod v0 { use super::*; @@ -37,10 +36,11 @@ mod v0 { // Migrate the proposed milestones to use Percent over a u32. // Add a deposit id to BriefData. // Should be run with pallet_proposals::migrations::v3 +#[allow(dead_code)] pub(crate) mod v1 { use super::*; pub fn migrate_to_v1(weight: &mut Weight) { - if crate::StorageVersion::::get() == Release::V0 { + if v2::StorageVersion::::get() == v2::Release::V0 { crate::Briefs::::translate(|_, brief: v0::BriefDataV0| { *weight += T::DbWeight::get().reads_writes(2, 1); let maybe_milestones: Result, _> = brief @@ -78,9 +78,71 @@ pub(crate) mod v1 { } }) } - crate::StorageVersion::::put(Release::V1) + v2::StorageVersion::::put(v2::Release::V1) + } +} + +pub mod v2 { + use super::*; + + #[storage_alias] + pub type StorageVersion = StorageValue, Release, ValueQuery>; + + #[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen, Default)] + #[repr(u32)] + pub enum Release { + V0, + #[default] + V1, + } + + pub struct MigrateToV2(T); + impl OnRuntimeUpgrade for MigrateToV2 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + frame_support::ensure!( + StorageVersion::::get() == Release::V1, + "V1 is required before running V2" + ); + + Ok( as Default>::default()) + } + + fn on_runtime_upgrade() -> Weight { + let current = Pallet::::current_storage_version(); + let onchain = StorageVersion::::get(); + + if current == 2 && onchain == Release::V1 { + StorageVersion::::kill(); + current.put::>(); + + log::warn!("v2 has been successfully applied"); + T::DbWeight::get().reads_writes(2, 1) + } else { + log::warn!("Skipping v2, should be removed"); + T::DbWeight::get().reads(1) + } + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + frame_support::ensure!( + Pallet::::current_storage_version() == 2, + "v2 has not been applied" + ); + + ensure!( + !StorageVersion::::exists(), + "old storage version has not been removed." + ); + + Ok(()) + } } + } + + #[cfg(test)] mod test { use super::*; diff --git a/pallets/grants/src/migrations.rs b/pallets/grants/src/migrations.rs index 893e97b7..05adb149 100644 --- a/pallets/grants/src/migrations.rs +++ b/pallets/grants/src/migrations.rs @@ -1,9 +1,8 @@ use crate::*; +pub use pallet::*; use common_types::{CurrencyId, TreasuryOrigin}; use frame_support::{pallet_prelude::*, storage_alias, weights::Weight}; -pub use pallet::*; - -type BlockNumberFor = ::BlockNumber; +use frame_system::pallet_prelude::BlockNumberFor; #[allow(unused)] #[allow(dead_code)] @@ -59,11 +58,11 @@ mod v1 { pub fn rococo_migrate_to_v1(weight: &mut Weight) { // This is only for rococo so just clear the lot, (there were only 4 at time of writing) - if crate::StorageVersion::::get() == Release::V0 { + if v3::StorageVersion::::get() == v3::Release::V0 { let limit: u32 = 10; *weight += T::DbWeight::get().reads_writes(limit.into(), limit.into()); let _ = v0::PendingGrants::::clear(limit, None); - crate::StorageVersion::::put(Release::V1); + v3::StorageVersion::::put(v3::Release::V1); } } } @@ -74,10 +73,73 @@ pub(crate) mod v2 { use super::*; // We are not storing pending grants anymore and grants are going directly into projects. pub fn migrate_to_v2(weight: &mut Weight, limit: u32) { - if crate::StorageVersion::::get() == Release::V1 { + if v3::StorageVersion::::get() == v3::Release::V1 { *weight += T::DbWeight::get().reads_writes(limit.into(), limit.into()); let _ = v1::PendingGrants::::clear(limit, None); - crate::StorageVersion::::put(Release::V2); + v3::StorageVersion::::put(v3::Release::V2); } } } + + + + +pub mod v3 { + use super::*; + + #[storage_alias] + pub type StorageVersion = StorageValue, Release, ValueQuery>; + + #[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen, Default)] + #[repr(u32)] + pub enum Release { + V0, + V1, + #[default] + V2, + } + + pub struct MigrateToV3(T); + impl OnRuntimeUpgrade for MigrateToV3 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + frame_support::ensure!( + StorageVersion::::get() == v3::Release::V2, + "V2 is required before running V3" + ); + + Ok( as Default>::default()) + } + + fn on_runtime_upgrade() -> Weight { + let current = Pallet::::current_storage_version(); + let onchain = StorageVersion::::get(); + + if current == 3 && onchain == v3::Release::V2 { + StorageVersion::::kill(); + current.put::>(); + + log::warn!("v2 has been successfully applied"); + T::DbWeight::get().reads_writes(2, 1) + } else { + log::warn!("Skipping v2, should be removed"); + T::DbWeight::get().reads(1) + } + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + frame_support::ensure!( + Pallet::::current_storage_version() == 3, + "v2 has not been applied" + ); + + ensure!( + !StorageVersion::::exists(), + "old storage version has not been removed." + ); + + Ok(()) + } + } +} diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 76ce7aa2..dc2caf3d 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -1,7 +1,9 @@ use crate::*; use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; +use frame_system::pallet_prelude::BlockNumberFor; pub use pallet::*; + pub type TimestampOf = ::Moment; #[allow(unused)] @@ -114,7 +116,7 @@ mod v1 { let migrated_project: ProjectV1< T::AccountId, BalanceOf, - T::BlockNumber, + BlockNumberFor, TimestampOf, > = ProjectV1 { name: project.name, @@ -419,13 +421,27 @@ pub mod v4 { OptionQuery, >; + #[storage_alias] + pub type StorageVersion = StorageValue, Release, ValueQuery>; + + #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + #[repr(u32)] + pub enum Release { + V0, + V1, + V2, + #[default] + V3, + V4, + } + // Essentially remove all votes that currenctly exist and force a resubmission of milestones. - pub fn migrate_to_v4(weight: &mut Weight) { - log::info!("***** starting migration in fn"); - let test = ProjectStorageVersion::::get(); - log::info!("***** ProjectStorageVersion is : {:?}", test); + pub fn migrate_votes(weight: &mut Weight) { + log::warn!( "***** starting migration in fn"); + let test = StorageVersion::::get(); + log::warn!( "***** onchain storage version is is : {:?}", test); - log::info!( + log::warn!( "***** V4 Rounds count is : {:?}", V4Rounds::::iter_values().count() ); @@ -433,14 +449,14 @@ pub mod v4 { V4Rounds::::drain().for_each(|(project_key, _, block_number)| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - log::info!("***** project key is : {:?}", project_key); + log::warn!( "***** project key is : {:?}", project_key); *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); crate::RoundsExpiring::::remove(block_number); *weight = weight.saturating_add(T::DbWeight::get().reads(1)); if let Some(project) = crate::Projects::::get(project_key) { - log::info!("***** project key exists is : {:?}", project_key); + log::warn!( "***** project key exists is : {:?}", project_key); for (milestone_key, _) in project.milestones.iter() { *weight = weight.saturating_add(T::DbWeight::get().reads(1)); if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { @@ -452,16 +468,15 @@ pub mod v4 { } } }); - ProjectStorageVersion::::set(Release::V4); } - + pub struct MigrateToV4(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV4 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - log::info!(target: "pallet-proposals", "Running pre_upgrade()"); + log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); ensure!( - ProjectStorageVersion::::get() == Release::V4, + StorageVersion::::get() == Release::V3, "Required v3 before upgrading to v4" ); Ok(Vec::new()) @@ -469,18 +484,39 @@ pub mod v4 { fn on_runtime_upgrade() -> Weight { let mut weight = T::DbWeight::get().reads_writes(1, 1); - log::info!("****** STARTING MIGRATION *****"); - log::warn!("****** STARTING MIGRATION *****"); - crate::migration::v4::migrate_to_v4::(&mut weight); - log::warn!("****** ENDING MIGRATION *****"); + log::warn!( "****** STARTING MIGRATION *****"); + log::warn!( "****** STARTING MIGRATION *****"); + + let current = as GetStorageVersion>::current_storage_version(); + let onchain = StorageVersion::::get(); + + if current == 4 && onchain == Release::V3 { + migrate_votes::(&mut weight); + + StorageVersion::::kill(); + current.put::>(); + + log::warn!( "v4 has been successfully applied"); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); + } else { + log::warn!( "Skipping v4, should be removed"); + weight = weight.saturating_add(T::DbWeight::get().reads(1)); + } + + log::warn!( "****** ENDING MIGRATION *****"); weight } #[cfg(feature = "try-runtime")] fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { - log::info!(target: "pallet-proposals", "Running post_upgrade()"); + log::warn!( target: "pallet-proposals", "Running post_upgrade()"); + + ensure!(!StorageVersion::::exists(), + "Old storage version storage type should have been removed." + ); + ensure!( - ProjectStorageVersion::::get() == Release::V4, + Pallet::::current_storage_version() == 4, "Storage version should be v4 after the migration" ); From 661c2a88c69a9322aa4a426e0c0179abe372cef8 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 21:22:50 +0100 Subject: [PATCH 011/192] pick runtime --- runtime/imbue-kusama/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 0555ff8e..9b1bde86 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -99,7 +99,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("imbue"), impl_name: create_runtime_str!("imbue"), authoring_version: 2, - spec_version: 94301, + spec_version: 9432, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -174,12 +174,16 @@ impl Contains for BaseCallFilter { pub type Migrations = migrations::Unreleased; /// The runtime migrations per release. -#[allow(deprecated, missing_docs)] +#[allow(missing_docs)] pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = (pallet_proposals::migration::v4::MigrateToV4,); + pub type Unreleased = ( + pallet_proposals::migration::v5::MigrateToV5, + pallet_briefs::migration::v2::MigrateToV2, + pallet_grants::migration::v3::MigrateToV3, + ); } /// Executive: handles dispatch to the various modules. @@ -661,6 +665,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; + type AllowMultipleBlocksPerSlot = ConstBool; } parameter_type_with_key! { From 34b50042c19b95d94b280c3807535a9c34088f97 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 21:39:14 +0100 Subject: [PATCH 012/192] new migration for proposals --- pallets/briefs/src/lib.rs | 25 ++------- pallets/grants/src/lib.rs | 26 ++------- pallets/proposals/src/lib.rs | 37 ++++--------- pallets/proposals/src/migration.rs | 86 ++++++++++++++++++++++-------- 4 files changed, 82 insertions(+), 92 deletions(-) diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index 53e88aae..e1547254 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -61,7 +61,10 @@ pub mod pallet { pub type BriefHash = H256; + const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::config] @@ -98,16 +101,6 @@ pub mod pallet { pub type BriefContributions = StorageMap<_, Blake2_128Concat, BriefHash, BoundedBriefContributions, ValueQuery>; - #[pallet::storage] - pub type StorageVersion = StorageValue<_, Release, ValueQuery>; - - #[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen, Default)] - #[repr(u32)] - pub enum Release { - V0, - #[default] - V1, - } #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -157,18 +150,6 @@ pub mod pallet { MilestonesTotalPercentageMustEqual100, } - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - log::info!(target: "pallet-briefs", "****** STARTING MIGRATION in briefs *****"); - log::warn!(target: "pallet-briefs", "****** STARTING MIGRATION in briefs *****"); - log::error!(target: "pallet-briefs", "****** STARTING MIGRATION in briefs *****"); - let mut weight: Weight = Zero::zero(); - crate::migrations::v1::migrate_to_v1::(&mut weight); - weight - } - } - #[pallet::call] impl Pallet { /// Create a brief to be funded or amended. diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index aad17318..d00a4c21 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -17,8 +17,8 @@ mod benchmarking; #[cfg(any(feature = "runtime-benchmarks", test))] mod test_utils; +#[cfg(test)] mod migrations; -pub use migrations::v2::*; pub mod weights; pub use weights::*; @@ -48,7 +48,10 @@ pub mod pallet { pub(crate) type BoundedApprovers = BoundedVec, ::MaxApprovers>; pub type GrantId = H256; + const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::config] @@ -79,18 +82,6 @@ pub mod pallet { #[pallet::storage] pub type GrantCount = StorageValue<_, u32, ValueQuery>; - #[pallet::storage] - pub type StorageVersion = StorageValue<_, Release, ValueQuery>; - - #[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen, Default)] - #[repr(u32)] - pub enum Release { - V0, - V1, - #[default] - V2, - } - #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { @@ -112,15 +103,6 @@ pub mod pallet { TooManyMilestones, } - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - let mut weight: Weight = Zero::zero(); - crate::migrations::v2::migrate_to_v2::(&mut weight, 50); - weight - } - } - #[pallet::call] impl Pallet { /// Instead of iterating, create a project from the parameters of a grant. diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 43b88160..31d3fb34 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -16,6 +16,7 @@ use sp_core::H256; use sp_runtime::traits::{AccountIdConversion, Saturating, Zero}; use sp_std::{collections::btree_map::*, convert::TryInto, prelude::*}; + pub mod traits; use traits::{IntoProposal, RefundHandler}; @@ -61,6 +62,7 @@ type ContributionsFor = BoundedBTreeMap< ::MaximumContributorsPerProject, >; + #[frame_support::pallet] pub mod pallet { use super::*; @@ -75,15 +77,15 @@ pub mod pallet { type AuthorityOrigin: EnsureOrigin; type MultiCurrency: MultiReservableCurrency, CurrencyId = CurrencyId>; type WeightInfo: WeightInfoT; - type MaxWithdrawalExpiration: Get; + type MaxWithdrawalExpiration: Get>; /// The amount of time given, up to point of decision, when a vote of no confidence is held. - type NoConfidenceTimeLimit: Get; + type NoConfidenceTimeLimit: Get>; /// The minimum percentage of votes, inclusive, that is required for a vote to pass. type PercentRequiredForVoteToPass: Get; /// Maximum number of contributors per project. type MaximumContributorsPerProject: Get; /// Defines the length that a milestone can be voted on. - type MilestoneVotingWindow: Get; + type MilestoneVotingWindow: Get>; /// The type responisble for handling refunds. type RefundHandler: traits::RefundHandler, BalanceOf, CurrencyId>; type MaxMilestonesPerProject: Get; @@ -100,7 +102,10 @@ pub mod pallet { type PercentRequiredForVoteNoConfidenceToPass: Get; } + const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(PhantomData); #[pallet::storage] @@ -171,10 +176,6 @@ pub mod pallet { ValueQuery, >; - #[pallet::storage] - #[pallet::getter(fn storage_version)] - pub(super) type ProjectStorageVersion = StorageValue<_, Release, ValueQuery>; - #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { @@ -196,9 +197,9 @@ pub mod pallet { /// Successfully withdrawn funds from the project. ProjectFundsWithdrawn(T::AccountId, ProjectKey, BalanceOf, CurrencyId), /// Vote submited successfully. - VoteSubmitted(T::AccountId, ProjectKey, MilestoneKey, bool, T::BlockNumber), + VoteSubmitted(T::AccountId, ProjectKey, MilestoneKey, bool, BlockNumberFor), /// A milestone has been approved. - MilestoneApproved(T::AccountId, ProjectKey, MilestoneKey, T::BlockNumber), + MilestoneApproved(T::AccountId, ProjectKey, MilestoneKey, BlockNumberFor), /// You have created a vote of no confidence. NoConfidenceRoundCreated(T::AccountId, ProjectKey), /// You have voted upon a round of no confidence. @@ -265,7 +266,7 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { + impl Hooks> for Pallet { // SAFETY: ExpiringProjectRoundsPerBlock has to be sane to prevent overweight blocks. fn on_initialize(n: BlockNumberFor) -> Weight { @@ -477,22 +478,6 @@ pub enum RoundType { VoteOfNoConfidence, } -#[derive(Encode, Decode, TypeInfo, Debug, PartialEq, MaxEncodedLen)] -#[repr(u32)] -pub enum Release { - V0, - V1, - V2, - V3, - V4, -} - -impl Default for Release { - fn default() -> Self { - Self::V3 - } -} - /// The milestones provided by the user to define the milestones of a project. /// TODO: add ipfs hash like in the grants pallet and /// TODO: move these to a common repo (common_types will do) diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index dc2caf3d..fe323102 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -421,20 +421,7 @@ pub mod v4 { OptionQuery, >; - #[storage_alias] - pub type StorageVersion = StorageValue, Release, ValueQuery>; - - #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] - #[repr(u32)] - pub enum Release { - V0, - V1, - V2, - #[default] - V3, - V4, - } - + // Essentially remove all votes that currenctly exist and force a resubmission of milestones. pub fn migrate_votes(weight: &mut Weight) { log::warn!( "***** starting migration in fn"); @@ -469,15 +456,70 @@ pub mod v4 { } }); } - + pub struct MigrateToV4(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV4 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::info!(target: "pallet-proposals", "Running pre_upgrade()"); + ensure!( + v5::StorageVersion::::get() == v5::Release::V3, + "v3 is required to run this migration." + ); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + log::info!("****** STARTING MIGRATION *****"); + log::warn!("****** STARTING MIGRATION *****"); + let mut weight = T::DbWeight::get().reads_writes(1, 1); + + if v5::StorageVersion::::get() == v5::Release::V3 { + crate::migration::v4::migrate_to_v4::(&mut weight); + v5::StorageVersion::::put(v5::Release::V4); + } else { + log::warn!("skipping pallet-proposals v4 migration, should be removed"); + } + log::warn!("****** ENDING MIGRATION *****"); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::info!(target: "pallet-proposals", "Running post_upgrade()"); + ensure!( + v5::StorageVersion::::get() == v5::Release::V4, + "Storage version should be V4 after the migration" + ); + Ok(()) + } + } +} + + +pub mod v5 { + #[storage_alias] + pub type StorageVersion = StorageValue, Release, ValueQuery>; + + #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + #[repr(u32)] + pub enum Release { + V0, + V1, + V2, + #[default] + V3, + V4, + } + + pub struct MigrateToV5(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV4 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); ensure!( - StorageVersion::::get() == Release::V3, - "Required v3 before upgrading to v4" + StorageVersion::::get() == Release::V4, + "Required v4 before upgrading to v5" ); Ok(Vec::new()) } @@ -490,16 +532,16 @@ pub mod v4 { let current = as GetStorageVersion>::current_storage_version(); let onchain = StorageVersion::::get(); - if current == 4 && onchain == Release::V3 { + if current == 5 && onchain == Release::V4 { migrate_votes::(&mut weight); StorageVersion::::kill(); current.put::>(); - log::warn!( "v4 has been successfully applied"); + log::warn!( "v5 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); } else { - log::warn!( "Skipping v4, should be removed"); + log::warn!( "Skipping v5, should be removed from Executive"); weight = weight.saturating_add(T::DbWeight::get().reads(1)); } @@ -516,8 +558,8 @@ pub mod v4 { ); ensure!( - Pallet::::current_storage_version() == 4, - "Storage version should be v4 after the migration" + Pallet::::current_storage_version() == 5, + "Storage version should be v5 after the migration" ); Ok(()) From 163b02dea0639979bbfee31af5d7c710abcfec45 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 22:11:15 +0100 Subject: [PATCH 013/192] fmt --- Cargo.lock | 1 + pallets/briefs/src/lib.rs | 5 +- pallets/briefs/src/migrations.rs | 23 +- pallets/briefs/src/tests.rs | 1 - pallets/grants/Cargo.toml | 1 + pallets/grants/src/lib.rs | 6 +- pallets/grants/src/migrations.rs | 109 +++++----- pallets/proposals/src/benchmarking.rs | 30 +-- pallets/proposals/src/lib.rs | 21 +- pallets/proposals/src/migration.rs | 90 ++++---- runtime/imbue-kusama/src/lib.rs | 7 +- runtime/imbue-kusama/src/sanity.rs | 53 +++-- runtime/imbue-kusama/src/xcm_config.rs | 6 +- .../integration-tests/src/kusama_test_net.rs | 203 +++++++++--------- runtime/integration-tests/src/lib.rs | 2 +- 15 files changed, 285 insertions(+), 273 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 027b895e..b2ef165f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6943,6 +6943,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "orml-tokens", "orml-traits", "pallet-balances", diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index e1547254..ef47d570 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -20,7 +20,7 @@ mod benchmarking; #[cfg(any(feature = "runtime-benchmarks", test))] mod test_utils; -mod migrations; +pub mod migrations; #[frame_support::pallet] pub mod pallet { @@ -64,7 +64,7 @@ pub mod pallet { const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::config] @@ -101,7 +101,6 @@ pub mod pallet { pub type BriefContributions = StorageMap<_, Blake2_128Concat, BriefHash, BoundedBriefContributions, ValueQuery>; - #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { diff --git a/pallets/briefs/src/migrations.rs b/pallets/briefs/src/migrations.rs index 8a722980..3c8022a7 100644 --- a/pallets/briefs/src/migrations.rs +++ b/pallets/briefs/src/migrations.rs @@ -1,8 +1,13 @@ use crate::*; -pub use pallet::*; use common_types::CurrencyId; -use frame_support::{pallet_prelude::*, storage_alias, traits::{Get, OnRuntimeUpgrade}, weights::Weight}; +use frame_support::{ + pallet_prelude::*, + storage_alias, + traits::{Get, OnRuntimeUpgrade}, + weights::Weight, +}; use frame_system::pallet_prelude::BlockNumberFor; +pub use pallet::*; use pallet_proposals::ProposedMilestone; use sp_arithmetic::Percent; use sp_std::convert::TryInto; @@ -98,16 +103,16 @@ pub mod v2 { pub struct MigrateToV2(T); impl OnRuntimeUpgrade for MigrateToV2 { - #[cfg(feature = "try-runtime")] + #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, TryRuntimeError> { frame_support::ensure!( StorageVersion::::get() == Release::V1, "V1 is required before running V2" ); - + Ok( as Default>::default()) } - + fn on_runtime_upgrade() -> Weight { let current = Pallet::::current_storage_version(); let onchain = StorageVersion::::get(); @@ -117,14 +122,14 @@ pub mod v2 { current.put::>(); log::warn!("v2 has been successfully applied"); - T::DbWeight::get().reads_writes(2, 1) + T::DbWeight::get().reads_writes(2, 1) } else { log::warn!("Skipping v2, should be removed"); - T::DbWeight::get().reads(1) + T::DbWeight::get().reads(1) } } - #[cfg(feature = "try-runtime")] + #[cfg(feature = "try-runtime")] fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { frame_support::ensure!( Pallet::::current_storage_version() == 2, @@ -139,10 +144,8 @@ pub mod v2 { Ok(()) } } - } - #[cfg(test)] mod test { use super::*; diff --git a/pallets/briefs/src/tests.rs b/pallets/briefs/src/tests.rs index 67f6eb8e..32de3c45 100644 --- a/pallets/briefs/src/tests.rs +++ b/pallets/briefs/src/tests.rs @@ -11,7 +11,6 @@ use sp_arithmetic::per_things::Percent; use std::convert::TryInto; - #[test] fn create_brief_not_approved_applicant() { build_test_externality().execute_with(|| { diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index ae6e9730..a8ede1a1 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -29,6 +29,7 @@ pallet-proposals = { path = "../proposals", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +log = { version = "0.4.17", default-features = false } # Local common-traits = { path = "../../libs/common-traits", default-features = false } diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index d00a4c21..f20c9b66 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -17,8 +17,7 @@ mod benchmarking; #[cfg(any(feature = "runtime-benchmarks", test))] mod test_utils; -#[cfg(test)] -mod migrations; +pub mod migrations; pub mod weights; pub use weights::*; @@ -51,7 +50,7 @@ pub mod pallet { const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::config] @@ -169,4 +168,3 @@ pub mod pallet { fn create_and_convert() -> Weight; } } - diff --git a/pallets/grants/src/migrations.rs b/pallets/grants/src/migrations.rs index 05adb149..89276df3 100644 --- a/pallets/grants/src/migrations.rs +++ b/pallets/grants/src/migrations.rs @@ -1,8 +1,8 @@ use crate::*; -pub use pallet::*; use common_types::{CurrencyId, TreasuryOrigin}; -use frame_support::{pallet_prelude::*, storage_alias, weights::Weight}; +use frame_support::{pallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade, weights::Weight}; use frame_system::pallet_prelude::BlockNumberFor; +pub use pallet::*; #[allow(unused)] #[allow(dead_code)] @@ -81,65 +81,62 @@ pub(crate) mod v2 { } } +pub mod v3 { + use super::*; + #[storage_alias] + pub type StorageVersion = StorageValue, Release, ValueQuery>; + #[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen, Default)] + #[repr(u32)] + pub enum Release { + V0, + V1, + #[default] + V2, + } -pub mod v3 { - use super::*; - - #[storage_alias] - pub type StorageVersion = StorageValue, Release, ValueQuery>; - - #[derive(Encode, Decode, TypeInfo, PartialEq, MaxEncodedLen, Default)] - #[repr(u32)] - pub enum Release { - V0, - V1, - #[default] - V2, + pub struct MigrateToV3(T); + impl OnRuntimeUpgrade for MigrateToV3 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + frame_support::ensure!( + StorageVersion::::get() == v3::Release::V2, + "V2 is required before running V3" + ); + + Ok( as Default>::default()) } - pub struct MigrateToV3(T); - impl OnRuntimeUpgrade for MigrateToV3 { - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - frame_support::ensure!( - StorageVersion::::get() == v3::Release::V2, - "V2 is required before running V3" - ); - - Ok( as Default>::default()) - } - - fn on_runtime_upgrade() -> Weight { - let current = Pallet::::current_storage_version(); - let onchain = StorageVersion::::get(); - - if current == 3 && onchain == v3::Release::V2 { - StorageVersion::::kill(); - current.put::>(); - - log::warn!("v2 has been successfully applied"); - T::DbWeight::get().reads_writes(2, 1) - } else { - log::warn!("Skipping v2, should be removed"); - T::DbWeight::get().reads(1) - } - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { - frame_support::ensure!( - Pallet::::current_storage_version() == 3, - "v2 has not been applied" - ); - - ensure!( - !StorageVersion::::exists(), - "old storage version has not been removed." - ); - - Ok(()) + fn on_runtime_upgrade() -> Weight { + let current = Pallet::::current_storage_version(); + let onchain = StorageVersion::::get(); + + if current == 3 && onchain == v3::Release::V2 { + StorageVersion::::kill(); + current.put::>(); + + log::warn!("v2 has been successfully applied"); + T::DbWeight::get().reads_writes(2, 1) + } else { + log::warn!("Skipping v2, should be removed"); + T::DbWeight::get().reads(1) } } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + frame_support::ensure!( + Pallet::::current_storage_version() == 3, + "v2 has not been applied" + ); + + ensure!( + !StorageVersion::::exists(), + "old storage version has not been removed." + ); + + Ok(()) + } + } } diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 0a6f1733..e1384e4a 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -41,8 +41,7 @@ mod benchmarks { } #[benchmark] - fn vote_on_milestone() - { + fn vote_on_milestone() { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -72,8 +71,7 @@ mod benchmarks { } #[benchmark] - fn withdraw() - { + fn withdraw() { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -114,11 +112,14 @@ mod benchmarks { #[extrinsic_call] withdraw(RawOrigin::Signed(alice.clone()), project_key); - assert_last_event::(Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native).into()); + assert_last_event::( + Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native) + .into(), + ); } #[benchmark] - fn raise_vote_of_no_confidence(){ + fn raise_vote_of_no_confidence() { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -134,8 +135,7 @@ mod benchmarks { } #[benchmark] - fn vote_on_no_confidence_round() - { + fn vote_on_no_confidence_round() { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -163,16 +163,20 @@ mod benchmarks { // Benchmark for a single loop of on_initialise as a voting round (most expensive). #[benchmark] - fn on_initialize() - { + fn on_initialize() { let block_number: ::BlockNumber = 100u32.into(); - let keys: BoundedVec<(ProjectKey, RoundType, MilestoneKey), ::ExpiringProjectRoundsPerBlock> = vec![(0, RoundType::VotingRound, 0)].try_into().expect("bound will be larger than 1;"); + let keys: BoundedVec< + (ProjectKey, RoundType, MilestoneKey), + ::ExpiringProjectRoundsPerBlock, + > = vec![(0, RoundType::VotingRound, 0)] + .try_into() + .expect("bound will be larger than 1;"); RoundsExpiring::::insert(block_number, keys); #[block] - { + { crate::Pallet::::on_initialize(block_number); - } + } } impl_benchmark_test_suite!( diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 31d3fb34..78974c1b 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -16,7 +16,6 @@ use sp_core::H256; use sp_runtime::traits::{AccountIdConversion, Saturating, Zero}; use sp_std::{collections::btree_map::*, convert::TryInto, prelude::*}; - pub mod traits; use traits::{IntoProposal, RefundHandler}; @@ -62,7 +61,6 @@ type ContributionsFor = BoundedBTreeMap< ::MaximumContributorsPerProject, >; - #[frame_support::pallet] pub mod pallet { use super::*; @@ -105,7 +103,7 @@ pub mod pallet { const STORAGE_VERSION: StorageVersion = StorageVersion::new(4); #[pallet::pallet] - #[pallet::storage_version(STORAGE_VERSION)] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(PhantomData); #[pallet::storage] @@ -197,7 +195,13 @@ pub mod pallet { /// Successfully withdrawn funds from the project. ProjectFundsWithdrawn(T::AccountId, ProjectKey, BalanceOf, CurrencyId), /// Vote submited successfully. - VoteSubmitted(T::AccountId, ProjectKey, MilestoneKey, bool, BlockNumberFor), + VoteSubmitted( + T::AccountId, + ProjectKey, + MilestoneKey, + bool, + BlockNumberFor, + ), /// A milestone has been approved. MilestoneApproved(T::AccountId, ProjectKey, MilestoneKey, BlockNumberFor), /// You have created a vote of no confidence. @@ -267,16 +271,15 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - // SAFETY: ExpiringProjectRoundsPerBlock has to be sane to prevent overweight blocks. fn on_initialize(n: BlockNumberFor) -> Weight { let mut weight = T::DbWeight::get().reads_writes(1, 1); let key_type_vec = RoundsExpiring::::take(n); - + key_type_vec.iter().for_each(|item| { let (project_key, round_type, milestone_key) = item; weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - + // Remove the round prevents further voting. Rounds::::remove((project_key, milestone_key), round_type); match round_type { @@ -284,7 +287,7 @@ pub mod pallet { // Therefore we can remove it on round end. RoundType::VotingRound => { weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); - + MilestoneVotes::::remove(project_key, milestone_key); UserHasVoted::::remove(( project_key, @@ -299,7 +302,7 @@ pub mod pallet { } } }); - + weight } } diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index fe323102..96808e79 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -1,6 +1,7 @@ use crate::*; use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; + use frame_system::pallet_prelude::BlockNumberFor; pub use pallet::*; @@ -421,40 +422,36 @@ pub mod v4 { OptionQuery, >; - // Essentially remove all votes that currenctly exist and force a resubmission of milestones. pub fn migrate_votes(weight: &mut Weight) { - log::warn!( "***** starting migration in fn"); - let test = StorageVersion::::get(); - log::warn!( "***** onchain storage version is is : {:?}", test); - - log::warn!( - "***** V4 Rounds count is : {:?}", - V4Rounds::::iter_values().count() - ); - - V4Rounds::::drain().for_each(|(project_key, _, block_number)| { - *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - - log::warn!( "***** project key is : {:?}", project_key); - - *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - crate::RoundsExpiring::::remove(block_number); - - *weight = weight.saturating_add(T::DbWeight::get().reads(1)); - if let Some(project) = crate::Projects::::get(project_key) { - log::warn!( "***** project key exists is : {:?}", project_key); - for (milestone_key, _) in project.milestones.iter() { - *weight = weight.saturating_add(T::DbWeight::get().reads(1)); - if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { - *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - crate::MilestoneVotes::::remove(project_key, milestone_key); - } else { - break; - } + log::warn!("***** starting migration in fn"); + log::warn!( + "***** V4 Rounds count is : {:?}", + V4Rounds::::iter_values().count() + ); + + V4Rounds::::drain().for_each(|(project_key, _, block_number)| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + + log::warn!("***** project key is : {:?}", project_key); + + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + crate::RoundsExpiring::::remove(block_number); + + *weight = weight.saturating_add(T::DbWeight::get().reads(1)); + if let Some(project) = crate::Projects::::get(project_key) { + log::warn!("***** project key exists is : {:?}", project_key); + for (milestone_key, _) in project.milestones.iter() { + *weight = weight.saturating_add(T::DbWeight::get().reads(1)); + if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + crate::MilestoneVotes::::remove(project_key, milestone_key); + } else { + break; } } - }); + } + }); } pub struct MigrateToV4(sp_std::marker::PhantomData); @@ -463,7 +460,7 @@ pub mod v4 { fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::info!(target: "pallet-proposals", "Running pre_upgrade()"); ensure!( - v5::StorageVersion::::get() == v5::Release::V3, + v5::StorageVersion::::get() == v5::Release::V3, "v3 is required to run this migration." ); Ok(Vec::new()) @@ -475,7 +472,7 @@ pub mod v4 { let mut weight = T::DbWeight::get().reads_writes(1, 1); if v5::StorageVersion::::get() == v5::Release::V3 { - crate::migration::v4::migrate_to_v4::(&mut weight); + crate::migration::v4::migrate_votes::(&mut weight); v5::StorageVersion::::put(v5::Release::V4); } else { log::warn!("skipping pallet-proposals v4 migration, should be removed"); @@ -496,8 +493,8 @@ pub mod v4 { } } - pub mod v5 { + use super::*; #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; @@ -513,39 +510,37 @@ pub mod v5 { } pub struct MigrateToV5(sp_std::marker::PhantomData); - impl OnRuntimeUpgrade for MigrateToV4 { + impl OnRuntimeUpgrade for MigrateToV5 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); ensure!( - StorageVersion::::get() == Release::V4, - "Required v4 before upgrading to v5" - ); + StorageVersion::::get() == Release::V4, + "Required v4 before upgrading to v5" + ); Ok(Vec::new()) } fn on_runtime_upgrade() -> Weight { let mut weight = T::DbWeight::get().reads_writes(1, 1); - log::warn!( "****** STARTING MIGRATION *****"); - log::warn!( "****** STARTING MIGRATION *****"); + log::warn!("****** STARTING MIGRATION *****"); + log::warn!("****** STARTING MIGRATION *****"); let current = as GetStorageVersion>::current_storage_version(); let onchain = StorageVersion::::get(); if current == 5 && onchain == Release::V4 { - migrate_votes::(&mut weight); - StorageVersion::::kill(); current.put::>(); - log::warn!( "v5 has been successfully applied"); + log::warn!("v5 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); } else { - log::warn!( "Skipping v5, should be removed from Executive"); + log::warn!("Skipping v5, should be removed from Executive"); weight = weight.saturating_add(T::DbWeight::get().reads(1)); } - log::warn!( "****** ENDING MIGRATION *****"); + log::warn!("****** ENDING MIGRATION *****"); weight } @@ -553,10 +548,11 @@ pub mod v5 { fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running post_upgrade()"); - ensure!(!StorageVersion::::exists(), - "Old storage version storage type should have been removed." + ensure!( + !StorageVersion::::exists(), + "Old storage version storage type should have been removed." ); - + ensure!( Pallet::::current_storage_version() == 5, "Storage version should be v5 after the migration" diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 9b1bde86..93eb20da 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -41,7 +41,7 @@ pub use frame_support::{ dispatch::DispatchClass, ensure, parameter_types, traits::{ - fungibles, ConstU128, ConstU16, ConstU32, Contains, Currency as PalletCurrency, + fungibles, ConstBool, ConstU128, ConstU16, ConstU32, Contains, Currency as PalletCurrency, EitherOfDiverse, EnsureOriginWithArg, EqualPrivilegeOnly, Everything, Get, Imbalance, IsInVec, Nothing, OnUnbalanced, Randomness, WithdrawReasons, }, @@ -181,8 +181,8 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( pallet_proposals::migration::v5::MigrateToV5, - pallet_briefs::migration::v2::MigrateToV2, - pallet_grants::migration::v3::MigrateToV3, + pallet_briefs::migrations::v2::MigrateToV2, + pallet_grants::migrations::v3::MigrateToV3, ); } @@ -665,7 +665,6 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; - type AllowMultipleBlocksPerSlot = ConstBool; } parameter_type_with_key! { diff --git a/runtime/imbue-kusama/src/sanity.rs b/runtime/imbue-kusama/src/sanity.rs index 6f38b696..5be7b8b5 100644 --- a/runtime/imbue-kusama/src/sanity.rs +++ b/runtime/imbue-kusama/src/sanity.rs @@ -1,4 +1,3 @@ - use crate::Runtime; use common_runtime::MAXIMUM_BLOCK_WEIGHT; use pallet_proposals::{WeightInfo as PWeightInfo, WeightInfoT}; @@ -7,45 +6,67 @@ use sp_arithmetic::Percent; #[test] fn ensure_maximum_milestones_are_consistent_grants() { let max_milestone_grants = ::MaxMilestonesPerGrant::get(); - let max_milestone_proposals = ::MaxMilestonesPerProject::get(); - assert_eq!(max_milestone_grants, max_milestone_proposals, "The grants max milestones and project max milestones must be equal."); + let max_milestone_proposals = + ::MaxMilestonesPerProject::get(); + assert_eq!( + max_milestone_grants, max_milestone_proposals, + "The grants max milestones and project max milestones must be equal." + ); } #[test] fn ensure_maximum_milestones_are_consistent_briefs() { let max_milestone_briefs = ::MaxMilestonesPerBrief::get(); - let max_milestone_proposals = ::MaxMilestonesPerProject::get(); - assert_eq!(max_milestone_briefs, max_milestone_proposals, "The briefs max milestones and project max milestones must be equal."); + let max_milestone_proposals = + ::MaxMilestonesPerProject::get(); + assert_eq!( + max_milestone_briefs, max_milestone_proposals, + "The briefs max milestones and project max milestones must be equal." + ); } #[test] fn ensure_max_contributors_equal_max_approvers() { - let max_contributors_proposals = ::MaximumContributorsPerProject::get(); + let max_contributors_proposals = + ::MaximumContributorsPerProject::get(); let max_approvers = ::MaxApprovers::get(); - assert!(max_contributors_proposals >= max_approvers, "The max approvers must be less than or equal the max contributors."); + assert!( + max_contributors_proposals >= max_approvers, + "The max approvers must be less than or equal the max contributors." + ); } // A brief owner is used as the contibutors to a project so the maximums must be equal. #[test] fn ensure_max_contributors_equal_max_brief_owners() { - let max_contributors_proposals = ::MaximumContributorsPerProject::get(); + let max_contributors_proposals = + ::MaximumContributorsPerProject::get(); let max_brief_owners = ::MaxBriefOwners::get(); - assert!(max_contributors_proposals >= max_brief_owners, "Max brief owners must be less than or equal to the the max contributors"); + assert!( + max_contributors_proposals >= max_brief_owners, + "Max brief owners must be less than or equal to the the max contributors" + ); } #[test] fn ensure_proposals_initialize_is_less_than_10_percent_block() { let multiplier = ::ExpiringProjectRoundsPerBlock::get(); - let ref_time = as WeightInfoT>::on_initialize().ref_time() * multiplier as u64; - let proof_size = as WeightInfoT>::on_initialize().proof_size() * multiplier as u64; + let ref_time = + as WeightInfoT>::on_initialize().ref_time() * multiplier as u64; + let proof_size = + as WeightInfoT>::on_initialize().proof_size() * multiplier as u64; - let max_ref_time = Percent::from_percent(10u8).mul_floor(MAXIMUM_BLOCK_WEIGHT.ref_time()); + let max_ref_time = Percent::from_percent(10u8).mul_floor(MAXIMUM_BLOCK_WEIGHT.ref_time()); let max_proof_size = Percent::from_percent(10u8).mul_floor(MAXIMUM_BLOCK_WEIGHT.proof_size()); - assert!(ref_time <= max_ref_time, "ExpiringProjectRoundsPerBlock is exceeding ref time limits."); - assert!(proof_size <= max_proof_size, "ExpiringProjectRoundsPerBlock is exceeding proof size limits."); + assert!( + ref_time <= max_ref_time, + "ExpiringProjectRoundsPerBlock is exceeding ref time limits." + ); + assert!( + proof_size <= max_proof_size, + "ExpiringProjectRoundsPerBlock is exceeding proof size limits." + ); } - - diff --git a/runtime/imbue-kusama/src/xcm_config.rs b/runtime/imbue-kusama/src/xcm_config.rs index a8b60f09..83a3ff48 100644 --- a/runtime/imbue-kusama/src/xcm_config.rs +++ b/runtime/imbue-kusama/src/xcm_config.rs @@ -1,7 +1,6 @@ use crate::{AllPalletsWithSystem, Balances, ConstU32}; use frame_system::EnsureRoot; -use sp_runtime::traits::{Convert}; - +use sp_runtime::traits::Convert; // A few exports that help ease life for downstream crates. pub use common_runtime::{ @@ -271,7 +270,6 @@ impl pallet_xcm::Config for Runtime { type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); - } impl orml_xcm::Config for Runtime { @@ -465,5 +463,3 @@ impl Convert for AccountIdToMultiLocation { .into() } } - - diff --git a/runtime/integration-tests/src/kusama_test_net.rs b/runtime/integration-tests/src/kusama_test_net.rs index 18811f84..fa3181f1 100644 --- a/runtime/integration-tests/src/kusama_test_net.rs +++ b/runtime/integration-tests/src/kusama_test_net.rs @@ -13,151 +13,146 @@ //! Relay chain and parachains emulation. - - -pub use imbue_kusama_runtime::{AccountId, AuraId, Balance, BlockNumber}; use crate::constants::SAFE_XCM_VERSION; +pub use imbue_kusama_runtime::{AccountId, AuraId, Balance, BlockNumber}; - - -use xcm_emulator::{ - decl_test_networks, decl_test_parachains, decl_test_relay_chains, Parachain, RelayChain, - TestExt, +use crate::constants::{ + accounts::{ALICE, BOB, CHARLIE, DAVE, EVE, FERDIE}, + imbue, kusama, }; pub use sp_core::{sr25519, storage::Storage, Get}; use xcm::prelude::*; -use crate::constants::{imbue,kusama, accounts::{ALICE,BOB, CHARLIE, DAVE, EVE, FERDIE}}; +use xcm_emulator::{ + decl_test_networks, decl_test_parachains, decl_test_relay_chains, Parachain, RelayChain, + TestExt, +}; +use crate::setup::{PARA_ID_DEVELOPMENT, PARA_ID_SIBLING}; use frame_support::{parameter_types, sp_io, sp_tracing}; -use crate::setup::{ - PARA_ID_DEVELOPMENT, - PARA_ID_SIBLING, -}; -use xcm_executor::traits::Convert; use xcm_builder::test_utils::XcmHash; +use xcm_executor::traits::Convert; decl_test_relay_chains! { - pub struct Kusama { - genesis = kusama::genesis(), - on_init = ( - // kusama_runtime::XcmPallet::force_default_xcm_version( + pub struct Kusama { + genesis = kusama::genesis(), + on_init = ( + // kusama_runtime::XcmPallet::force_default_xcm_version( // kusama_runtime::RuntimeOrigin::root(), // Some(SAFE_XCM_VERSION)), - // - // kusama_runtime::XcmPallet::force_xcm_version( + // + // kusama_runtime::XcmPallet::force_xcm_version( // kusama_runtime::RuntimeOrigin::root(), // Box::new(MultiLocation::new(1, X1(Parachain(PARA_ID_SIBLING)))), // SAFE_XCM_VERSION), - // - // kusama_runtime::XcmPallet::force_xcm_version( + // + // kusama_runtime::XcmPallet::force_xcm_version( // kusama_runtime::RuntimeOrigin::root(), // Box::new(MultiLocation::new(1, X1(Parachain(PARA_ID_DEVELOPMENT)))), // SAFE_XCM_VERSION), - kusama_runtime::XcmPallet::force_xcm_version( + kusama_runtime::XcmPallet::force_xcm_version( kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(0, X1(Parachain(PARA_ID_SIBLING)))), SAFE_XCM_VERSION), - kusama_runtime::XcmPallet::force_xcm_version( + kusama_runtime::XcmPallet::force_xcm_version( kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(0, X1(Parachain(PARA_ID_DEVELOPMENT)))), SAFE_XCM_VERSION), - ), - runtime = { - Runtime: kusama_runtime::Runtime, - RuntimeOrigin: kusama_runtime::RuntimeOrigin, - RuntimeCall: kusama_runtime::RuntimeCall, - RuntimeEvent: kusama_runtime::RuntimeEvent, - MessageQueue: kusama_runtime::MessageQueue, - XcmConfig: kusama_runtime::xcm_config::XcmConfig, - SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, - System: kusama_runtime::System, - Balances: kusama_runtime::Balances, - }, - pallets_extra = { - XcmPallet: kusama_runtime::XcmPallet, - } - } + ), + runtime = { + Runtime: kusama_runtime::Runtime, + RuntimeOrigin: kusama_runtime::RuntimeOrigin, + RuntimeCall: kusama_runtime::RuntimeCall, + RuntimeEvent: kusama_runtime::RuntimeEvent, + MessageQueue: kusama_runtime::MessageQueue, + XcmConfig: kusama_runtime::xcm_config::XcmConfig, + SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf, + System: kusama_runtime::System, + Balances: kusama_runtime::Balances, + }, + pallets_extra = { + XcmPallet: kusama_runtime::XcmPallet, + } + } } decl_test_parachains! { - pub struct Development { - genesis = imbue::genesis(PARA_ID_DEVELOPMENT), - on_init = ( - imbue_kusama_runtime::PolkadotXcm::force_xcm_version( + pub struct Development { + genesis = imbue::genesis(PARA_ID_DEVELOPMENT), + on_init = ( + imbue_kusama_runtime::PolkadotXcm::force_xcm_version( imbue_kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(1, Here)), SAFE_XCM_VERSION), - ), - runtime = { - Runtime: imbue_kusama_runtime::Runtime, - RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, - RuntimeCall: imbue_kusama_runtime::RuntimeCall, - RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, - XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, - DmpMessageHandler: imbue_kusama_runtime::DmpQueue, - LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, - System: imbue_kusama_runtime::System, - Balances: imbue_kusama_runtime::Balances, - ParachainSystem: imbue_kusama_runtime::ParachainSystem, - ParachainInfo: imbue_kusama_runtime::ParachainInfo, - }, - pallets_extra = { - PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, - XTokens: imbue_kusama_runtime::XTokens, - } - }, - pub struct Sibling { - genesis = imbue::genesis(PARA_ID_SIBLING), - on_init = ( - imbue_kusama_runtime::PolkadotXcm::force_xcm_version( + ), + runtime = { + Runtime: imbue_kusama_runtime::Runtime, + RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, + RuntimeCall: imbue_kusama_runtime::RuntimeCall, + RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, + XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, + DmpMessageHandler: imbue_kusama_runtime::DmpQueue, + LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, + System: imbue_kusama_runtime::System, + Balances: imbue_kusama_runtime::Balances, + ParachainSystem: imbue_kusama_runtime::ParachainSystem, + ParachainInfo: imbue_kusama_runtime::ParachainInfo, + }, + pallets_extra = { + PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, + XTokens: imbue_kusama_runtime::XTokens, + } + }, + pub struct Sibling { + genesis = imbue::genesis(PARA_ID_SIBLING), + on_init = ( + imbue_kusama_runtime::PolkadotXcm::force_xcm_version( imbue_kusama_runtime::RuntimeOrigin::root(), Box::new(MultiLocation::new(1, Here)), SAFE_XCM_VERSION), - ), - runtime = { - Runtime: imbue_kusama_runtime::Runtime, - RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, - RuntimeCall: imbue_kusama_runtime::RuntimeCall, - RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, - XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, - DmpMessageHandler: imbue_kusama_runtime::DmpQueue, - LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, - System: imbue_kusama_runtime::System, - Balances: imbue_kusama_runtime::Balances, - ParachainSystem: imbue_kusama_runtime::ParachainSystem, - ParachainInfo: imbue_kusama_runtime::ParachainInfo, - }, - pallets_extra = { - PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, - XTokens: imbue_kusama_runtime::XTokens, - } - } + ), + runtime = { + Runtime: imbue_kusama_runtime::Runtime, + RuntimeOrigin: imbue_kusama_runtime::RuntimeOrigin, + RuntimeCall: imbue_kusama_runtime::RuntimeCall, + RuntimeEvent: imbue_kusama_runtime::RuntimeEvent, + XcmpMessageHandler: imbue_kusama_runtime::XcmpQueue, + DmpMessageHandler: imbue_kusama_runtime::DmpQueue, + LocationToAccountId: imbue_kusama_runtime::xcm_config::LocationToAccountId, + System: imbue_kusama_runtime::System, + Balances: imbue_kusama_runtime::Balances, + ParachainSystem: imbue_kusama_runtime::ParachainSystem, + ParachainInfo: imbue_kusama_runtime::ParachainInfo, + }, + pallets_extra = { + PolkadotXcm: imbue_kusama_runtime::PolkadotXcm, + XTokens: imbue_kusama_runtime::XTokens, + } + } } decl_test_networks! { - pub struct TestNet { - relay_chain = Kusama, - parachains = vec![ - Development, - Sibling, - // Karura, - ], - } + pub struct TestNet { + relay_chain = Kusama, + parachains = vec![ + Development, + Sibling, + // Karura, + ], + } } parameter_types! { - // Kusama - pub KusamaSender: AccountId = Kusama::account_id_of(ALICE); - pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB); - // Imbue Kusama - pub ImbueKusamaSender: AccountId = Development::account_id_of(CHARLIE); - pub ImbueKusamaReceiver: AccountId = Development::account_id_of(DAVE); - // Sibling Kusama - pub SiblingKusamaSender: AccountId = Sibling::account_id_of(EVE); - pub SiblingKusamaReceiver: AccountId = Sibling::account_id_of(FERDIE); + // Kusama + pub KusamaSender: AccountId = Kusama::account_id_of(ALICE); + pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB); + // Imbue Kusama + pub ImbueKusamaSender: AccountId = Development::account_id_of(CHARLIE); + pub ImbueKusamaReceiver: AccountId = Development::account_id_of(DAVE); + // Sibling Kusama + pub SiblingKusamaSender: AccountId = Sibling::account_id_of(EVE); + pub SiblingKusamaReceiver: AccountId = Sibling::account_id_of(FERDIE); } - // decl_test_parachains! { // pub struct Development { // Runtime = imbue_kusama_runtime::Runtime, diff --git a/runtime/integration-tests/src/lib.rs b/runtime/integration-tests/src/lib.rs index 8dc537be..8f1121ea 100644 --- a/runtime/integration-tests/src/lib.rs +++ b/runtime/integration-tests/src/lib.rs @@ -1,6 +1,6 @@ #![cfg(test)] +pub mod constants; mod kusama_test_net; mod setup; mod xcm_transfers; -pub mod constants; From c9cdf6e8e9c4bb7cb8fb32ce355cf61a9bcd3005 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 22:22:26 +0100 Subject: [PATCH 014/192] fix v3-v4 migration test --- pallets/grants/src/lib.rs | 2 +- pallets/proposals/src/migration.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index f20c9b66..ba773355 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -32,7 +32,7 @@ pub mod pallet { use pallet_proposals::{traits::IntoProposal, Contribution, ProposedMilestone}; use sp_arithmetic::{ per_things::Percent, - traits::{One, Zero}, + traits::{One}, }; use sp_core::H256; use sp_runtime::Saturating; diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 96808e79..bdd6336c 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -876,7 +876,7 @@ mod test { crate::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); crate::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); - let _ = v4::migrate_to_v4::(); + let _ = v4::migrate_votes::(); // assert that: // 1: the round has been removed (to allow resubmission) // 2: milestone votes have been reset (although resubmission resets this) From 4b150424a68eccb5175305fba00e95f939944175 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 22:24:14 +0100 Subject: [PATCH 015/192] fix 2 --- pallets/proposals/src/migration.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index bdd6336c..cdd04795 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -876,7 +876,8 @@ mod test { crate::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); crate::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); - let _ = v4::migrate_votes::(); + let mut weight = ::default(); + v4::migrate_votes::(&mut weight); // assert that: // 1: the round has been removed (to allow resubmission) // 2: milestone votes have been reset (although resubmission resets this) From cfee84e333e64ea475188988ec133f7dd3e980f5 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 22:26:45 +0100 Subject: [PATCH 016/192] fix brief migration test --- pallets/briefs/src/migrations.rs | 2 +- pallets/proposals/src/tests.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pallets/briefs/src/migrations.rs b/pallets/briefs/src/migrations.rs index 3c8022a7..c2e9022d 100644 --- a/pallets/briefs/src/migrations.rs +++ b/pallets/briefs/src/migrations.rs @@ -156,7 +156,7 @@ mod test { #[test] fn migrate_v0_to_v1() { build_test_externality().execute_with(|| { - crate::StorageVersion::::put(Release::V0); + v2::StorageVersion::::put(v2::Release::V0); let milestones: BoundedVec< v0::ProposedMilestoneV0, ::MaxMilestonesPerBrief, diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index ce1449af..800bc79d 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -211,9 +211,9 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { )); // Assert that the state is good before auto finalisation - let exp_block = Rounds::::get(&(project_key, milestone_key), RoundType::VotingRound) + let exp_block = Rounds::::get((project_key, milestone_key), RoundType::VotingRound) .expect("There should be a round here for the project_key"); - assert!(RoundsExpiring::::get(&exp_block).contains(&( + assert!(RoundsExpiring::::get(exp_block).contains(&( project_key, RoundType::VotingRound, milestone_key @@ -232,10 +232,10 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { )); assert!( - Rounds::::get(&(project_key, milestone_key), RoundType::VotingRound).is_none() + Rounds::::get((project_key, milestone_key), RoundType::VotingRound).is_none() ); assert_eq!( - RoundsExpiring::::get(&exp_block).len(), + RoundsExpiring::::get(exp_block).len(), 0, "This vec should have been emptied on auto finalisation." ); @@ -266,9 +266,9 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { )); // Assert that the state is good before auto finalisation - let exp_block = Rounds::::get(&(project_key, milestone_key), RoundType::VotingRound) + let exp_block = Rounds::::get((project_key, milestone_key), RoundType::VotingRound) .expect("There should be a round here for the project_key"); - assert!(RoundsExpiring::::get(&exp_block).contains(&( + assert!(RoundsExpiring::::get(exp_block).contains(&( project_key, RoundType::VotingRound, milestone_key @@ -287,10 +287,10 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { )); assert!( - Rounds::::get(&(project_key, milestone_key), RoundType::VotingRound).is_none() + Rounds::::get((project_key, milestone_key), RoundType::VotingRound).is_none() ); assert_eq!( - RoundsExpiring::::get(&exp_block).len(), + RoundsExpiring::::get(exp_block).len(), 0, "This vec should have been emptied on auto finalisation." ); From a078c2a8cd9d919b0d3155b4b30dab5ded2f02ee Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 22:50:22 +0100 Subject: [PATCH 017/192] clippy --- runtime/imbue-kusama/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 93eb20da..2090d32d 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1,6 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] +#![allow(clippy::items_after_test_module)] // Make the WASM binary available. #[cfg(feature = "std")] From e01a72f61d79de842ed0569ec2a3e80de0e5175f Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 20 Sep 2023 22:57:00 +0100 Subject: [PATCH 018/192] fmt --- pallets/grants/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index ba773355..8acdb320 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -30,10 +30,7 @@ pub mod pallet { use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_proposals::{traits::IntoProposal, Contribution, ProposedMilestone}; - use sp_arithmetic::{ - per_things::Percent, - traits::{One}, - }; + use sp_arithmetic::{per_things::Percent, traits::One}; use sp_core::H256; use sp_runtime::Saturating; use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; From 2b4ce5197e57a99463dc420574d10e7ce53dd3c9 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 09:47:24 +0100 Subject: [PATCH 019/192] new MilestoneVote implementation --- pallets/proposals/src/impls.rs | 18 ++++++--- pallets/proposals/src/lib.rs | 17 ++++---- pallets/proposals/src/migration.rs | 62 +++++++++++++++++++++++++----- pallets/proposals/src/tests.rs | 15 ++++---- 4 files changed, 83 insertions(+), 29 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 2462b2c1..ae693541 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -45,7 +45,12 @@ impl Pallet { })?; UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); - >::insert(project_key, milestone_key, Vote::default()); + MilestoneVotes::::try_mutate(project_key, |vote_btree| { + vote_btree.try_insert(milestone_key, Vote::default()).map_err(|_|Error::::TooManyMilestoneVotes)?; + + Ok::<(), DispatchError>(()) + })?; + Self::deposit_event(Event::MilestoneSubmitted(who, project_key, milestone_key)); Self::deposit_event(Event::VotingRoundCreated(project_key)); Ok(().into()) @@ -79,14 +84,14 @@ impl Pallet { })?; let vote: Vote> = - MilestoneVotes::::try_mutate(project_key, milestone_key, |vote| { - if let Some(v) = vote { + MilestoneVotes::::try_mutate(project_key, |vote_btree| { + if let Some(vote) = vote_btree.get_mut(&milestone_key) { if approve_milestone { - v.yay = v.yay.saturating_add(contribution_amount); + vote.yay = vote.yay.saturating_add(contribution_amount); } else { - v.nay = v.nay.saturating_add(contribution_amount); + vote.nay = vote.nay.saturating_add(contribution_amount); } - Ok::>, DispatchError>(v.clone()) + Ok::>, DispatchError>(vote.clone()) } else { Err(Error::::VotingRoundNotStarted.into()) } @@ -102,6 +107,7 @@ impl Pallet { user_has_voted_key, who.clone(), )?; + Self::deposit_event(Event::VoteSubmitted( who, project_key, diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index bf2fb1a9..b63206f4 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -122,14 +122,12 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn milestone_votes)] - pub(super) type MilestoneVotes = StorageDoubleMap< + pub(super) type MilestoneVotes = StorageMap< _, Identity, ProjectKey, - Identity, - MilestoneKey, - Vote>, - OptionQuery, + BoundedBTreeMap>, T::MaxMilestonesPerProject>, + ValueQuery, >; #[pallet::storage] @@ -267,6 +265,8 @@ pub mod pallet { TooManyMilestones, /// There are too many projects for a given account TooManyProjects, + /// There are too many milestone votes, this generally shouldnt be hit. + TooManyMilestoneVotes, } #[pallet::hooks] @@ -288,7 +288,10 @@ pub mod pallet { RoundType::VotingRound => { weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); - MilestoneVotes::::remove(project_key, milestone_key); + MilestoneVotes::::mutate(project_key, |vote_btree|{ + vote_btree.remove(&milestone_key); + }); + UserHasVoted::::remove(( project_key, RoundType::VotingRound, @@ -306,7 +309,7 @@ pub mod pallet { weight } } -/* */ + #[pallet::call] impl Pallet { /// Submit a milestones to be voted on. diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index cdd04795..aa0ae3c1 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -346,7 +346,7 @@ pub mod v3 { v3::OldMilestoneVotes::::drain().for_each(|(old_key, vote)| { *weight += T::DbWeight::get().reads(1); let (project_key, milestone_key) = old_key; - crate::MilestoneVotes::::insert(project_key, milestone_key, vote); + v5::MilestoneVotes::::insert(project_key, milestone_key, vote); *weight += T::DbWeight::get().reads_writes(1, 1); }); } @@ -443,9 +443,9 @@ pub mod v4 { log::warn!("***** project key exists is : {:?}", project_key); for (milestone_key, _) in project.milestones.iter() { *weight = weight.saturating_add(T::DbWeight::get().reads(1)); - if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { + if v5::MilestoneVotes::::contains_key(project_key, milestone_key) { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - crate::MilestoneVotes::::remove(project_key, milestone_key); + v5::MilestoneVotes::::remove(project_key, milestone_key); } else { break; } @@ -495,9 +495,21 @@ pub mod v4 { pub mod v5 { use super::*; + #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; + #[storage_alias] + pub(super) type MilestoneVotes = StorageDoubleMap< + Pallet, + Identity, + ProjectKey, + Identity, + MilestoneKey, + Vote>, + OptionQuery, + >; + #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[repr(u32)] pub enum Release { @@ -509,6 +521,34 @@ pub mod v5 { V4, } + fn migrate_milestone_votes(weight: &mut Weight) { + // Highly in-memory intensive but on the plus side not many reads/writes to db. + // I can write a less in memory one if anyone wants using crate::MilestoneVotes::mutate(). + let mut parent: BTreeMap>>> = Default::default(); + v5::MilestoneVotes::::drain().for_each(|(project_key, milestone_key, vote)| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + if let Some(child) = parent.get_mut(&project_key) { + child.insert(milestone_key, vote); + } else { + let mut child: BTreeMap>> = Default::default(); + child.insert(milestone_key, vote); + parent.insert(project_key, child); + } + }); + + parent.iter().for_each(|(key, btree)|{ + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + if let Ok(bounded_btree) = TryInto::>::try_into(btree.to_owned()) { + crate::MilestoneVotes::::insert(key, bounded_btree); + } else { + // chill bruh the bound has been violated. + // probs wont happen. + } + }) + } + + /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 + /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 pub struct MigrateToV5(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV5 { #[cfg(feature = "try-runtime")] @@ -530,9 +570,13 @@ pub mod v5 { let onchain = StorageVersion::::get(); if current == 5 && onchain == Release::V4 { + // 1 StorageVersion::::kill(); current.put::>(); + // 2 + migrate_milestone_votes::(&mut weight); + log::warn!("v5 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); } else { @@ -841,8 +885,8 @@ mod test { v3::OldMilestoneVotes::::get((10, 10)), Default::default() ); - assert!(crate::MilestoneVotes::::contains_key(10, 10)); - let v = crate::MilestoneVotes::::get(10, 10).unwrap(); + assert!(v5::MilestoneVotes::::contains_key(10, 10)); + let v = v5::MilestoneVotes::::get(10, 10).unwrap(); assert_eq!(v.yay, 100_000); assert_eq!(v.nay, 50_000); assert!(!v.is_approved); @@ -873,8 +917,8 @@ mod test { // insert a fake round to be mutated. v4::V4Rounds::::insert(project_key, crate::RoundType::VotingRound, expiry_block); crate::RoundsExpiring::::insert(expiry_block, rounds_expiring); - crate::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); - crate::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); + v5::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); + v5::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); let mut weight = ::default(); v4::migrate_votes::(&mut weight); @@ -887,8 +931,8 @@ mod test { crate::RoundType::VotingRound )); assert!(crate::RoundsExpiring::::get(expiry_block).is_empty()); - assert!(crate::MilestoneVotes::::get(project_key, milestone_key).is_none()); - assert!(crate::MilestoneVotes::::get(project_key, milestone_key + 1).is_none()); + assert!(v5::MilestoneVotes::::get(project_key, milestone_key).is_none()); + assert!(v5::MilestoneVotes::::get(project_key, milestone_key + 1).is_none()); }) } } diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index 15a189c9..e50ad725 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -86,7 +86,8 @@ fn submit_milestone_creates_non_bias_vote() { project_key, 1 )); - let created_vote = MilestoneVotes::::get(project_key, 1).expect("should exist"); + let total_vote = MilestoneVotes::::get(project_key); + let created_vote = total_vote.get(&1).expect("should exist"); assert_eq!(created_vote.nay, 0, "initial vote should be default"); assert_eq!(created_vote.yay, 0, "initial vote should be default"); @@ -124,11 +125,11 @@ fn submit_milestone_can_resubmit_during_voting_round() { 0usize, "User votes should be defaulted on resubmission." ); - let group_vote = MilestoneVotes::::get(project_key, milestone_key) + let group_vote = MilestoneVotes::::get(project_key).get(&milestone_key) .expect("group vote should exist."); assert_eq!( group_vote, - Default::default(), + & as Default>::default(), "Group vote should have defaulted on resubmission" ); }); @@ -332,12 +333,12 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { true )); let vote_0 = - MilestoneVotes::::get(project_key, milestone_key_0).expect("vote should exist"); + MilestoneVotes::::get(project_key).get(&milestone_key_0).expect("vote should exist"); assert!(vote_0.yay == 100_000u64); assert!(vote_0.nay == 0u64); let vote_1 = - MilestoneVotes::::get(project_key, milestone_key_1).expect("vote should exist"); + MilestoneVotes::::get(project_key).get(&milestone_key_1).expect("vote should exist"); assert!(vote_1.yay == 100_000u64); assert!(vote_1.nay == 0u64); }); @@ -491,7 +492,7 @@ fn vote_on_milestone_actually_adds_to_vote() { true )); let vote = - MilestoneVotes::::get(project_key, milestone_key).expect("vote should exist"); + MilestoneVotes::::get(project_key).get(&milestone_key).expect("vote should exist"); assert!(vote.yay == 100_000u64); assert!(vote.nay == 0u64); assert_ok!(Proposals::vote_on_milestone( @@ -501,7 +502,7 @@ fn vote_on_milestone_actually_adds_to_vote() { false )); let vote = - MilestoneVotes::::get(project_key, milestone_key).expect("vote should exist"); + MilestoneVotes::::get(project_key).get(&milestone_key).expect("vote should exist"); assert!(vote.yay == 100_000u64); assert!(vote.nay == 100_000u64); }); From a44b15a3592d14b26be2027c4a92d19405f24a22 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 09:51:07 +0100 Subject: [PATCH 020/192] fix implementation --- pallets/proposals/src/tests.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index e50ad725..fcc3c770 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -125,7 +125,9 @@ fn submit_milestone_can_resubmit_during_voting_round() { 0usize, "User votes should be defaulted on resubmission." ); - let group_vote = MilestoneVotes::::get(project_key).get(&milestone_key) + let total_vote = MilestoneVotes::::get(project_key); + + let group_vote = total_vote.get(&milestone_key) .expect("group vote should exist."); assert_eq!( group_vote, @@ -332,13 +334,15 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { milestone_key_1, true )); - let vote_0 = - MilestoneVotes::::get(project_key).get(&milestone_key_0).expect("vote should exist"); + let total_votes = + MilestoneVotes::::get(project_key); + + let vote_0 = total_votes.get(&milestone_key_0).expect("vote 0 should exist"); + assert!(vote_0.yay == 100_000u64); assert!(vote_0.nay == 0u64); - let vote_1 = - MilestoneVotes::::get(project_key).get(&milestone_key_1).expect("vote should exist"); + let vote_1 = total_votes.get(&milestone_key_1).expect("vote 1 should exist"); assert!(vote_1.yay == 100_000u64); assert!(vote_1.nay == 0u64); }); @@ -491,8 +495,8 @@ fn vote_on_milestone_actually_adds_to_vote() { milestone_key, true )); - let vote = - MilestoneVotes::::get(project_key).get(&milestone_key).expect("vote should exist"); + let total_votes = MilestoneVotes::::get(project_key); + let vote = total_votes.get(&milestone_key).expect("vote should exist"); assert!(vote.yay == 100_000u64); assert!(vote.nay == 0u64); assert_ok!(Proposals::vote_on_milestone( @@ -501,8 +505,9 @@ fn vote_on_milestone_actually_adds_to_vote() { milestone_key, false )); - let vote = - MilestoneVotes::::get(project_key).get(&milestone_key).expect("vote should exist"); + let total_votes = MilestoneVotes::::get(project_key); + let vote = total_votes.get(&milestone_key).expect("vote should exist"); + assert!(vote.yay == 100_000u64); assert!(vote.nay == 100_000u64); }); From 6548e9973d2b481c644a802480da2ae7d3859772 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 11:35:00 +0100 Subject: [PATCH 021/192] get project individual votes --- pallets/proposals/src/impls.rs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index ae693541..3cfe771f 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -468,16 +468,23 @@ impl Pallet { } - // Get the individual votes of a project, return an empty map on error. - //pub fn get_project_individuals_votes(project_key: ProjectKey) -> BTreeMap> { - // let out = BTreeMap::new(); - // if let Some(project) = Projects::::get(project_key) { - // project.milestones.keys().for_each(|(_)| { - // if let Some UserHasVoted::::get() - // (ProjectKey, RoundType, MilestoneKey) - // }) - // } - // out - //} + /// Get the individual votes of a project, return an empty map on error. + pub fn get_project_individuals_votes(project_key: ProjectKey) -> BTreeMap, (bool, BalanceOf)>> { + let mut out = BTreeMap::new(); + if let Some(project) = Projects::::get(project_key) { + project.milestones.keys().for_each(|milestone_key| { + let user_votes = UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); + let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); + user_votes.into_iter().for_each(|(acc, boolean_vote)| { + match project.contributions.get(&acc) { + Some(c) => inner.insert(acc, (boolean_vote, c.value)), + None => inner.insert(acc, (boolean_vote, Zero::zero())) + }; + }); + out.insert(milestone_key.to_owned(), inner); + }) + } + out + } } From 8b17b33d2fb4800855e08c33ac4e1b443eaab94d Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 11:43:47 +0100 Subject: [PATCH 022/192] remove total votes api --- pallets/proposals/rpc/runtime-api/src/lib.rs | 1 - pallets/proposals/rpc/src/lib.rs | 11 ----------- pallets/proposals/src/impls.rs | 2 ++ runtime/imbue-kusama/src/lib.rs | 3 --- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 8969a917..29a51a23 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -5,6 +5,5 @@ sp_api::decl_runtime_apis! { pub trait ProposalsApi where AccountId: codec::Codec { fn get_project_account_by_id(project_id: u32) -> AccountId; fn get_project_individuals_votes(project_id: u32) -> BTreeMap>; - fn get_project_total_votes(project_id: u32) -> BTreeMap>; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index edf6414f..5ab1e817 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -16,8 +16,6 @@ pub trait ProposalsApi { fn project_account_id(&self, project_id: u32) -> RpcResult; #[method(name = "proposals_getProjectIndividualVotes")] fn project_individuals_votes(project_id: u32) -> BTreeMap>; - #[method(name = "proposals_getProjectTotalVotes")] - fn project_total_votes(project_id: u32) -> BTreeMap>; } pub struct Proposals { @@ -75,15 +73,6 @@ where api.get_project_individuals_votes(at, project_id) .map_err(runtime_error_into_rpc_err) } - - fn project_total_votes(&self, project_id: u32) -> RpcResult { - let api = self.client.runtime_api(); - let at = self.client.info().best_hash; - - api.get_project_total_votes(at, project_id) - .map_err(runtime_error_into_rpc_err) - } - } /// Converts a runtime trap into an RPC error. diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 3cfe771f..fd30dfa9 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -487,4 +487,6 @@ impl Pallet { out } + + pub fn get_project_total_votes(project_key) -> BTreeMap>> } diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 66b4867b..860bf617 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1162,9 +1162,6 @@ impl_runtime_apis! { fn get_project_individuals_votes(project_id: u32) -> BTreeMap> { ImbueProposals::get_project_individuals_votes(project_key) } - fn get_project_total_votes(project_id: u32) -> BTreeMap> { - ImbueProposals::get_project_total_votes(project_key) - } } From 6431cbb83fd3484cbacecdd8ac71b5db26f7d02c Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 11:44:32 +0100 Subject: [PATCH 023/192] fmt --- pallets/proposals/rpc/runtime-api/src/lib.rs | 2 +- pallets/proposals/rpc/src/lib.rs | 7 +++++-- pallets/proposals/src/impls.rs | 20 +++++++++++--------- pallets/proposals/src/lib.rs | 3 +-- pallets/proposals/src/migration.rs | 13 +++++++++---- pallets/proposals/src/tests.rs | 18 ++++++++++-------- 6 files changed, 37 insertions(+), 26 deletions(-) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 29a51a23..d5d02407 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -use crate::pallet::{MilestoneKey, }; +use crate::pallet::MilestoneKey; sp_api::decl_runtime_apis! { pub trait ProposalsApi where AccountId: codec::Codec { diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index 5ab1e817..aa5794ba 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -15,7 +15,9 @@ pub trait ProposalsApi { #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; #[method(name = "proposals_getProjectIndividualVotes")] - fn project_individuals_votes(project_id: u32) -> BTreeMap>; + fn project_individuals_votes( + project_id: u32, + ) -> BTreeMap>; } pub struct Proposals { @@ -50,7 +52,8 @@ impl From for i32 { } } -impl ProposalsApiServer<::Hash, AccountId, Balance> for Proposals +impl ProposalsApiServer<::Hash, AccountId, Balance> + for Proposals where C: sp_api::ProvideRuntimeApi, C: HeaderBackend, diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index fd30dfa9..84fd4fde 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -46,7 +46,9 @@ impl Pallet { UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); MilestoneVotes::::try_mutate(project_key, |vote_btree| { - vote_btree.try_insert(milestone_key, Vote::default()).map_err(|_|Error::::TooManyMilestoneVotes)?; + vote_btree + .try_insert(milestone_key, Vote::default()) + .map_err(|_| Error::::TooManyMilestoneVotes)?; Ok::<(), DispatchError>(()) })?; @@ -467,18 +469,20 @@ impl Pallet { Ok(()) } - - /// Get the individual votes of a project, return an empty map on error. - pub fn get_project_individuals_votes(project_key: ProjectKey) -> BTreeMap, (bool, BalanceOf)>> { + /// Get the individual votes of a project, return an empty map on error. + pub fn get_project_individuals_votes( + project_key: ProjectKey, + ) -> BTreeMap, (bool, BalanceOf)>> { let mut out = BTreeMap::new(); if let Some(project) = Projects::::get(project_key) { project.milestones.keys().for_each(|milestone_key| { - let user_votes = UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); - let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); + let user_votes = + UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); + let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); user_votes.into_iter().for_each(|(acc, boolean_vote)| { match project.contributions.get(&acc) { Some(c) => inner.insert(acc, (boolean_vote, c.value)), - None => inner.insert(acc, (boolean_vote, Zero::zero())) + None => inner.insert(acc, (boolean_vote, Zero::zero())), }; }); out.insert(milestone_key.to_owned(), inner); @@ -487,6 +491,4 @@ impl Pallet { out } - - pub fn get_project_total_votes(project_key) -> BTreeMap>> } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index b63206f4..ed5b2b7d 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -288,7 +288,7 @@ pub mod pallet { RoundType::VotingRound => { weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); - MilestoneVotes::::mutate(project_key, |vote_btree|{ + MilestoneVotes::::mutate(project_key, |vote_btree| { vote_btree.remove(&milestone_key); }); @@ -555,7 +555,6 @@ pub struct Whitelist { max_cap: Balance, } - pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index aa0ae3c1..318a22c9 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -524,7 +524,8 @@ pub mod v5 { fn migrate_milestone_votes(weight: &mut Weight) { // Highly in-memory intensive but on the plus side not many reads/writes to db. // I can write a less in memory one if anyone wants using crate::MilestoneVotes::mutate(). - let mut parent: BTreeMap>>> = Default::default(); + let mut parent: BTreeMap>>> = + Default::default(); v5::MilestoneVotes::::drain().for_each(|(project_key, milestone_key, vote)| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); if let Some(child) = parent.get_mut(&project_key) { @@ -536,16 +537,20 @@ pub mod v5 { } }); - parent.iter().for_each(|(key, btree)|{ + parent.iter().for_each(|(key, btree)| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - if let Ok(bounded_btree) = TryInto::>::try_into(btree.to_owned()) { + if let Ok(bounded_btree) = + TryInto::>::try_into( + btree.to_owned(), + ) + { crate::MilestoneVotes::::insert(key, bounded_btree); } else { // chill bruh the bound has been violated. // probs wont happen. } }) - } + } /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index fcc3c770..c14040e6 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -126,8 +126,9 @@ fn submit_milestone_can_resubmit_during_voting_round() { "User votes should be defaulted on resubmission." ); let total_vote = MilestoneVotes::::get(project_key); - - let group_vote = total_vote.get(&milestone_key) + + let group_vote = total_vote + .get(&milestone_key) .expect("group vote should exist."); assert_eq!( group_vote, @@ -334,15 +335,18 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { milestone_key_1, true )); - let total_votes = - MilestoneVotes::::get(project_key); + let total_votes = MilestoneVotes::::get(project_key); - let vote_0 = total_votes.get(&milestone_key_0).expect("vote 0 should exist"); + let vote_0 = total_votes + .get(&milestone_key_0) + .expect("vote 0 should exist"); assert!(vote_0.yay == 100_000u64); assert!(vote_0.nay == 0u64); - let vote_1 = total_votes.get(&milestone_key_1).expect("vote 1 should exist"); + let vote_1 = total_votes + .get(&milestone_key_1) + .expect("vote 1 should exist"); assert!(vote_1.yay == 100_000u64); assert!(vote_1.nay == 0u64); }); @@ -404,8 +408,6 @@ fn vote_on_milestone_after_round_end_fails() { }); } - - #[test] fn vote_on_milestone_where_voting_round_is_active_but_not_the_correct_milestone() { build_test_externality().execute_with(|| { From 9719202ed8f50423fc764afc4b62ea4e3f663763 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 15:58:10 +0100 Subject: [PATCH 024/192] ummm --- Cargo.lock | 3 +++ pallets/proposals/rpc/Cargo.toml | 4 ++-- pallets/proposals/rpc/runtime-api/Cargo.toml | 3 +++ pallets/proposals/rpc/runtime-api/src/lib.rs | 14 ++++++++++--- pallets/proposals/rpc/src/lib.rs | 22 +++++++++++++++----- runtime/imbue-kusama/src/lib.rs | 5 +++-- 6 files changed, 39 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2ef165f..f36b4131 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7252,6 +7252,7 @@ dependencies = [ "frame-support", "frame-system", "jsonrpsee", + "pallet-proposals", "pallet-proposals-rpc-runtime-api", "parity-scale-codec 3.6.2", "sp-api", @@ -7266,9 +7267,11 @@ version = "0.1.0" dependencies = [ "frame-support", "frame-system", + "pallet-proposals", "parity-scale-codec 3.6.2", "sp-api", "sp-runtime", + "sp-std", ] [[package]] diff --git a/pallets/proposals/rpc/Cargo.toml b/pallets/proposals/rpc/Cargo.toml index f65b1eae..f272d2ad 100644 --- a/pallets/proposals/rpc/Cargo.toml +++ b/pallets/proposals/rpc/Cargo.toml @@ -18,8 +18,8 @@ sp-blockchain = { default-features = false, version = "4.0.0-dev", git = "https: sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } -pallet-proposals-rpc-runtime-api = {path = "./runtime-api" } - +pallet-proposals-rpc-runtime-api = { default-features = false, path = "./runtime-api" } +pallet-proposals = {default-features = false, path = "../"} [features] default = ["std"] diff --git a/pallets/proposals/rpc/runtime-api/Cargo.toml b/pallets/proposals/rpc/runtime-api/Cargo.toml index 034e1d44..5a2e62ce 100644 --- a/pallets/proposals/rpc/runtime-api/Cargo.toml +++ b/pallets/proposals/rpc/runtime-api/Cargo.toml @@ -12,10 +12,13 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = ] } sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} +sp-std = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } +pallet-proposals ={ path = "../..", default-features = false} + [features] default = ["std"] try-runtime = [ diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index d5d02407..d27ced7b 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,9 +1,17 @@ #![cfg_attr(not(feature = "std"), no_std)] -use crate::pallet::MilestoneKey; +use pallet_proposals::MilestoneKey; +use frame_support::{BoundedBTreeMap, pallet_prelude::Get}; +use sp_api::Decode; + + sp_api::decl_runtime_apis! { - pub trait ProposalsApi where AccountId: codec::Codec { + pub trait ProposalsApi, MaximumContributorsPerProject: Get> + where AccountId: codec::Codec, + BoundedBTreeMap, MaxMilestonesPerProject>: Decode + + { fn get_project_account_by_id(project_id: u32) -> AccountId; - fn get_project_individuals_votes(project_id: u32) -> BTreeMap>; + fn get_project_individuals_votes(project_id: u32) -> BoundedBTreeMap, MaxMilestonesPerProject>; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index aa5794ba..25b8509e 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -5,19 +5,28 @@ use jsonrpsee::{ types::error::{CallError, ErrorObject}, }; pub use pallet_proposals_rpc_runtime_api::ProposalsApi as ProposalsRuntimeApi; +use pallet_proposals::MilestoneKey; use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block as BlockT; +use frame_support::{BoundedBTreeMap, pallet_prelude::Get, Serialize}; +use sp_api::Decode; + use std::fmt::Display; use std::sync::Arc; +#[derive(Serialize, Deserialize)] +type IndividualVotes = BoundedBTreeMap, MaxMilestones> + #[rpc(client, server)] -pub trait ProposalsApi { +pub trait ProposalsApi, MaxContributors: Get> { + #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; #[method(name = "proposals_getProjectIndividualVotes")] fn project_individuals_votes( + &self, project_id: u32, - ) -> BTreeMap>; + ) -> RpcResult>; } pub struct Proposals { @@ -52,15 +61,18 @@ impl From for i32 { } } -impl ProposalsApiServer<::Hash, AccountId, Balance> +impl ProposalsApiServer<::Hash, AccountId, Balance, MilestoneBound, ContributorBound> for Proposals where C: sp_api::ProvideRuntimeApi, C: HeaderBackend, C: Send + Sync + 'static, - C::Api: ProposalsRuntimeApi, + C::Api: ProposalsRuntimeApi, B: BlockT, AccountId: Clone + Display + Codec + Send + 'static, + MilestoneBound: Get, + ContributorBound: Get, + BoundedBTreeMap, MilestoneBound>: Decode + Serialize { fn project_account_id(&self, project_id: u32) -> RpcResult { let api = self.client.runtime_api(); @@ -69,7 +81,7 @@ where api.get_project_account_by_id(at, project_id) .map_err(runtime_error_into_rpc_err) } - fn project_individuals_votes(&self, project_id: u32) -> RpcResult { + fn project_individuals_votes(&self, project_id: u32) -> RpcResult, MilestoneBound>> { let api = self.client.runtime_api(); let at = self.client.info().best_hash; diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 860bf617..4a7377cc 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1154,14 +1154,15 @@ impl_runtime_apis! { } } - impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { + impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { fn get_project_account_by_id(project_id: u32) -> AccountId { ImbueProposals::project_account_id(project_id) } - fn get_project_individuals_votes(project_id: u32) -> BTreeMap> { + fn get_project_individuals_votes(project_id: u32) -> BoundedBTreeMap, MaxMilestonesPerProject>; { ImbueProposals::get_project_individuals_votes(project_key) } + } From a9cee1ca774d6aa557511b2f4c6b740179fb72ba Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 21 Sep 2023 16:59:25 +0100 Subject: [PATCH 025/192] new format for Individual votes --- Cargo.lock | 3 +++ pallets/deposits/src/lib.rs | 2 ++ pallets/fellowship/Cargo.toml | 1 + pallets/fellowship/src/lib.rs | 2 ++ pallets/proposals/rpc/Cargo.toml | 1 - pallets/proposals/rpc/runtime-api/Cargo.toml | 2 ++ pallets/proposals/rpc/runtime-api/src/lib.rs | 22 +++++++++++++------- pallets/proposals/rpc/src/lib.rs | 21 ++++++++----------- pallets/proposals/src/impls.rs | 2 +- pallets/proposals/src/lib.rs | 1 + runtime/imbue-kusama/src/lib.rs | 6 +++--- 11 files changed, 38 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f36b4131..519f260a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6903,6 +6903,7 @@ dependencies = [ "orml-traits", "parity-scale-codec 3.6.2", "scale-info 2.8.0", + "serde", "sp-arithmetic", "sp-core", "sp-io", @@ -7269,6 +7270,8 @@ dependencies = [ "frame-system", "pallet-proposals", "parity-scale-codec 3.6.2", + "scale-info 2.8.0", + "serde", "sp-api", "sp-runtime", "sp-std", diff --git a/pallets/deposits/src/lib.rs b/pallets/deposits/src/lib.rs index b5b00da9..19167e31 100644 --- a/pallets/deposits/src/lib.rs +++ b/pallets/deposits/src/lib.rs @@ -172,4 +172,6 @@ pub mod pallet { amount: BalanceOf, currency_id: CurrencyId, } + } + diff --git a/pallets/fellowship/Cargo.toml b/pallets/fellowship/Cargo.toml index 68ab54f1..529538a3 100644 --- a/pallets/fellowship/Cargo.toml +++ b/pallets/fellowship/Cargo.toml @@ -16,6 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [ "derive", ] } +serde = { version = "1.0.101", features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 554be440..e7599dfb 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -399,4 +399,6 @@ pub mod pallet { BusinessDev, Approver, } + + } diff --git a/pallets/proposals/rpc/Cargo.toml b/pallets/proposals/rpc/Cargo.toml index f272d2ad..2a9f5e9c 100644 --- a/pallets/proposals/rpc/Cargo.toml +++ b/pallets/proposals/rpc/Cargo.toml @@ -10,7 +10,6 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } - # Substrate packages sp-api = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } diff --git a/pallets/proposals/rpc/runtime-api/Cargo.toml b/pallets/proposals/rpc/runtime-api/Cargo.toml index 5a2e62ce..0dbb11da 100644 --- a/pallets/proposals/rpc/runtime-api/Cargo.toml +++ b/pallets/proposals/rpc/runtime-api/Cargo.toml @@ -10,6 +10,8 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } +serde = { version = "1.0.101", features = ["derive"], default-features = false} +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} sp-std = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index d27ced7b..a740f343 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,17 +1,23 @@ #![cfg_attr(not(feature = "std"), no_std)] -use pallet_proposals::MilestoneKey; -use frame_support::{BoundedBTreeMap, pallet_prelude::Get}; +use pallet_proposals::{MilestoneKey}; +use frame_support::{BoundedBTreeMap, pallet_prelude::*}; use sp_api::Decode; +use sp_std::collections::btree_map::BTreeMap; - +#[cfg(feature = "std")] +use sp_runtime::serde::{Serialize, Deserialize}; +#[cfg_attr(feature = "std", derive(Serialize, Deserialize)) ] +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] +pub struct IndividualVotes { + inner: BTreeMap> +} sp_api::decl_runtime_apis! { - pub trait ProposalsApi, MaximumContributorsPerProject: Get> - where AccountId: codec::Codec, - BoundedBTreeMap, MaxMilestonesPerProject>: Decode - + pub trait ProposalsApi + where AccountId: codec::Codec + Ord, + IndividualVotes: sp_api::Decode + sp_api::Encode { fn get_project_account_by_id(project_id: u32) -> AccountId; - fn get_project_individuals_votes(project_id: u32) -> BoundedBTreeMap, MaxMilestonesPerProject>; + fn get_project_individuals_votes(project_id: u32) -> IndividualVotes; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index 25b8509e..0de29918 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -4,7 +4,7 @@ use jsonrpsee::{ proc_macros::rpc, types::error::{CallError, ErrorObject}, }; -pub use pallet_proposals_rpc_runtime_api::ProposalsApi as ProposalsRuntimeApi; +pub use pallet_proposals_rpc_runtime_api::{ProposalsApi as ProposalsRuntimeApi, IndividualVotes}; use pallet_proposals::MilestoneKey; use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block as BlockT; @@ -14,11 +14,10 @@ use sp_api::Decode; use std::fmt::Display; use std::sync::Arc; -#[derive(Serialize, Deserialize)] -type IndividualVotes = BoundedBTreeMap, MaxMilestones> +// Runtime api return type. #[rpc(client, server)] -pub trait ProposalsApi, MaxContributors: Get> { +pub trait ProposalsApi { #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; @@ -26,7 +25,7 @@ pub trait ProposalsApi, M fn project_individuals_votes( &self, project_id: u32, - ) -> RpcResult>; + ) -> RpcResult>; } pub struct Proposals { @@ -61,18 +60,16 @@ impl From for i32 { } } -impl ProposalsApiServer<::Hash, AccountId, Balance, MilestoneBound, ContributorBound> +impl ProposalsApiServer<::Hash, AccountId, Balance> for Proposals where C: sp_api::ProvideRuntimeApi, C: HeaderBackend, C: Send + Sync + 'static, - C::Api: ProposalsRuntimeApi, + C::Api: ProposalsRuntimeApi, B: BlockT, - AccountId: Clone + Display + Codec + Send + 'static, - MilestoneBound: Get, - ContributorBound: Get, - BoundedBTreeMap, MilestoneBound>: Decode + Serialize + AccountId: Clone + Display + Codec + Send + 'static + Ord, + IndividualVotes: sp_api::Decode + sp_api::Encode { fn project_account_id(&self, project_id: u32) -> RpcResult { let api = self.client.runtime_api(); @@ -81,7 +78,7 @@ where api.get_project_account_by_id(at, project_id) .map_err(runtime_error_into_rpc_err) } - fn project_individuals_votes(&self, project_id: u32) -> RpcResult, MilestoneBound>> { + fn project_individuals_votes(&self, project_id: u32) -> RpcResult> { let api = self.client.runtime_api(); let at = self.client.info().best_hash; diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 84fd4fde..700a0b94 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -472,7 +472,7 @@ impl Pallet { /// Get the individual votes of a project, return an empty map on error. pub fn get_project_individuals_votes( project_key: ProjectKey, - ) -> BTreeMap, (bool, BalanceOf)>> { + ) -> pallet_proposals_rpc_runtime_api::IndividualVotes, BalanceOf> { let mut out = BTreeMap::new(); if let Some(project) = Projects::::get(project_key) { project.milestones.keys().for_each(|milestone_key| { diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index ed5b2b7d..1b751fc6 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -555,6 +555,7 @@ pub struct Whitelist { max_cap: Balance, } + pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 4a7377cc..bfea2224 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1154,13 +1154,13 @@ impl_runtime_apis! { } } - impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { + impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { fn get_project_account_by_id(project_id: u32) -> AccountId { ImbueProposals::project_account_id(project_id) } - fn get_project_individuals_votes(project_id: u32) -> BoundedBTreeMap, MaxMilestonesPerProject>; { - ImbueProposals::get_project_individuals_votes(project_key) + fn get_project_individuals_votes(project_id: u32) -> pallet_proposals_rpc_runtime_api::IndividualVotes { + ImbueProposals::get_project_individuals_votes(project_id) } } From b58ab9d2cfab5c98422bf0432076e4a680e0c3e9 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 22 Sep 2023 10:15:52 +0100 Subject: [PATCH 026/192] boom baby, and a fmt --- Cargo.lock | 3 +-- node/src/rpc.rs | 2 +- pallets/deposits/src/lib.rs | 2 -- pallets/fellowship/src/lib.rs | 2 -- pallets/proposals/Cargo.toml | 1 + pallets/proposals/rpc/Cargo.toml | 3 ++- pallets/proposals/rpc/runtime-api/Cargo.toml | 2 -- pallets/proposals/rpc/runtime-api/src/lib.rs | 18 +++---------- pallets/proposals/rpc/src/lib.rs | 22 +++++++-------- pallets/proposals/src/impls.rs | 28 +++++++++++++++++--- pallets/proposals/src/lib.rs | 1 - runtime/common/src/lib.rs | 18 +++++++++++++ runtime/imbue-kusama/src/lib.rs | 7 ++--- 13 files changed, 66 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 519f260a..83e5e217 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7253,13 +7253,13 @@ dependencies = [ "frame-support", "frame-system", "jsonrpsee", - "pallet-proposals", "pallet-proposals-rpc-runtime-api", "parity-scale-codec 3.6.2", "sp-api", "sp-blockchain", "sp-rpc", "sp-runtime", + "sp-std", ] [[package]] @@ -7268,7 +7268,6 @@ version = "0.1.0" dependencies = [ "frame-support", "frame-system", - "pallet-proposals", "parity-scale-codec 3.6.2", "scale-info 2.8.0", "serde", diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 33a773b2..c6811cb9 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -42,7 +42,7 @@ where C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: BlockBuilder, - C::Api: pallet_proposals_rpc::ProposalsRuntimeApi, + C::Api: pallet_proposals_rpc::ProposalsRuntimeApi, P: TransactionPool + Sync + Send + 'static, { use pallet_proposals_rpc::{Proposals, ProposalsApiServer}; diff --git a/pallets/deposits/src/lib.rs b/pallets/deposits/src/lib.rs index 19167e31..b5b00da9 100644 --- a/pallets/deposits/src/lib.rs +++ b/pallets/deposits/src/lib.rs @@ -172,6 +172,4 @@ pub mod pallet { amount: BalanceOf, currency_id: CurrencyId, } - } - diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index e7599dfb..554be440 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -399,6 +399,4 @@ pub mod pallet { BusinessDev, Approver, } - - } diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 8081157d..f12650ec 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -47,6 +47,7 @@ orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-l # Local Dependencies common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } +common-runtime = { path = "../../runtime/common", default-features = false } pallet-deposits = { path = "../deposits", default-features = false } [dev-dependencies] diff --git a/pallets/proposals/rpc/Cargo.toml b/pallets/proposals/rpc/Cargo.toml index 2a9f5e9c..622bbc1b 100644 --- a/pallets/proposals/rpc/Cargo.toml +++ b/pallets/proposals/rpc/Cargo.toml @@ -18,7 +18,8 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } pallet-proposals-rpc-runtime-api = { default-features = false, path = "./runtime-api" } -pallet-proposals = {default-features = false, path = "../"} +sp-std = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} + [features] default = ["std"] diff --git a/pallets/proposals/rpc/runtime-api/Cargo.toml b/pallets/proposals/rpc/runtime-api/Cargo.toml index 0dbb11da..a68e717a 100644 --- a/pallets/proposals/rpc/runtime-api/Cargo.toml +++ b/pallets/proposals/rpc/runtime-api/Cargo.toml @@ -19,8 +19,6 @@ sp-runtime = { default-features = false, git = "https://github.com/paritytech/su frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } -pallet-proposals ={ path = "../..", default-features = false} - [features] default = ["std"] try-runtime = [ diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index a740f343..8410d645 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,23 +1,13 @@ #![cfg_attr(not(feature = "std"), no_std)] -use pallet_proposals::{MilestoneKey}; -use frame_support::{BoundedBTreeMap, pallet_prelude::*}; +use frame_support::{pallet_prelude::*, BoundedBTreeMap}; use sp_api::Decode; -use sp_std::collections::btree_map::BTreeMap; - -#[cfg(feature = "std")] -use sp_runtime::serde::{Serialize, Deserialize}; -#[cfg_attr(feature = "std", derive(Serialize, Deserialize)) ] -#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] -pub struct IndividualVotes { - inner: BTreeMap> -} +use sp_std::vec::Vec; sp_api::decl_runtime_apis! { - pub trait ProposalsApi + pub trait ProposalsApi where AccountId: codec::Codec + Ord, - IndividualVotes: sp_api::Decode + sp_api::Encode { fn get_project_account_by_id(project_id: u32) -> AccountId; - fn get_project_individuals_votes(project_id: u32) -> IndividualVotes; + fn get_project_individuals_votes(project_id: u32) -> Vec; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index 0de29918..ebcc3997 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -1,15 +1,15 @@ use codec::Codec; +use frame_support::{pallet_prelude::Get, BoundedBTreeMap, Serialize}; use jsonrpsee::{ core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorObject}, }; -pub use pallet_proposals_rpc_runtime_api::{ProposalsApi as ProposalsRuntimeApi, IndividualVotes}; -use pallet_proposals::MilestoneKey; +pub use pallet_proposals_rpc_runtime_api::ProposalsApi as ProposalsRuntimeApi; +use sp_api::Decode; use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block as BlockT; -use frame_support::{BoundedBTreeMap, pallet_prelude::Get, Serialize}; -use sp_api::Decode; +use sp_std::vec::Vec; use std::fmt::Display; use std::sync::Arc; @@ -17,15 +17,14 @@ use std::sync::Arc; // Runtime api return type. #[rpc(client, server)] -pub trait ProposalsApi { - +pub trait ProposalsApi +where + AccountId: Ord, +{ #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; #[method(name = "proposals_getProjectIndividualVotes")] - fn project_individuals_votes( - &self, - project_id: u32, - ) -> RpcResult>; + fn project_individuals_votes(&self, project_id: u32) -> RpcResult>; } pub struct Proposals { @@ -69,7 +68,6 @@ where C::Api: ProposalsRuntimeApi, B: BlockT, AccountId: Clone + Display + Codec + Send + 'static + Ord, - IndividualVotes: sp_api::Decode + sp_api::Encode { fn project_account_id(&self, project_id: u32) -> RpcResult { let api = self.client.runtime_api(); @@ -78,7 +76,7 @@ where api.get_project_account_by_id(at, project_id) .map_err(runtime_error_into_rpc_err) } - fn project_individuals_votes(&self, project_id: u32) -> RpcResult> { + fn project_individuals_votes(&self, project_id: u32) -> RpcResult> { let api = self.client.runtime_api(); let at = self.client.info().best_hash; diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 700a0b94..1e95438b 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -1,4 +1,5 @@ use crate::*; +use common_runtime::runtime_support::IndividualVotes; use common_types::milestone_origin::FundingType; use scale_info::prelude::format; use sp_runtime::traits::{Saturating, Zero}; @@ -472,7 +473,12 @@ impl Pallet { /// Get the individual votes of a project, return an empty map on error. pub fn get_project_individuals_votes( project_key: ProjectKey, - ) -> pallet_proposals_rpc_runtime_api::IndividualVotes, BalanceOf> { + ) -> IndividualVotes< + AccountIdOf, + BalanceOf, + T::MaxMilestonesPerProject, + T::MaximumContributorsPerProject, + > { let mut out = BTreeMap::new(); if let Some(project) = Projects::::get(project_key) { project.milestones.keys().for_each(|milestone_key| { @@ -485,10 +491,26 @@ impl Pallet { None => inner.insert(acc, (boolean_vote, Zero::zero())), }; }); - out.insert(milestone_key.to_owned(), inner); + let bounded_inner: BoundedBTreeMap< + AccountIdOf, + (bool, BalanceOf), + T::MaximumContributorsPerProject, + > = match inner.try_into() { + Ok(b) => b, + Err(_) => BoundedBTreeMap::new(), + }; + out.insert(milestone_key.to_owned(), bounded_inner); }) } + let bounded_out: BoundedBTreeMap< + u32, + BoundedBTreeMap, (bool, BalanceOf), T::MaximumContributorsPerProject>, + T::MaxMilestonesPerProject, + > = match out.try_into() { + Ok(b) => b, + Err(_) => BoundedBTreeMap::new(), + }; - out + IndividualVotes { inner: bounded_out } } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 1b751fc6..ed5b2b7d 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -555,7 +555,6 @@ pub struct Whitelist { max_cap: Balance, } - pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index eb956ac5..fd667c91 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -283,6 +283,24 @@ pub mod common_xcm { } } +pub mod runtime_support { + use codec::{Decode, Encode}; + use frame_support::{pallet_prelude::*, BoundedBTreeMap}; + #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + pub struct IndividualVotes< + AccountId: Ord, + Balance, + MaxMilestones: Get, + MaxContributions: Get, + > { + pub inner: BoundedBTreeMap< + u32, + BoundedBTreeMap, + MaxMilestones, + >, + } +} + pub mod storage_deposits { #[derive(PartialEq, Eq, Debug, Copy, Clone)] pub enum StorageDepositItems { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index bfea2224..71ed7577 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -12,7 +12,7 @@ mod sanity; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; -use sp_api::impl_runtime_apis; +use sp_api::{impl_runtime_apis, Encode}; use sp_core::OpaqueMetadata; use common_runtime::storage_deposits::StorageDepositItems; @@ -1159,8 +1159,9 @@ impl_runtime_apis! { ImbueProposals::project_account_id(project_id) } - fn get_project_individuals_votes(project_id: u32) -> pallet_proposals_rpc_runtime_api::IndividualVotes { - ImbueProposals::get_project_individuals_votes(project_id) + fn get_project_individuals_votes(project_id: u32) -> Vec { + let individual_votes = ImbueProposals::get_project_individuals_votes(project_id); + as Encode>::encode(&individual_votes) } } From 8c89cd3ba61e40c92b94a75f4122124d5c02b324 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 22 Sep 2023 10:17:33 +0100 Subject: [PATCH 027/192] clippy --- pallets/proposals/rpc/runtime-api/src/lib.rs | 4 ++-- pallets/proposals/rpc/src/lib.rs | 4 ++-- pallets/proposals/src/impls.rs | 1 + pallets/proposals/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 8410d645..e2fe7c28 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{pallet_prelude::*, BoundedBTreeMap}; -use sp_api::Decode; + + use sp_std::vec::Vec; sp_api::decl_runtime_apis! { diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index ebcc3997..37a1b5d6 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -1,12 +1,12 @@ use codec::Codec; -use frame_support::{pallet_prelude::Get, BoundedBTreeMap, Serialize}; + use jsonrpsee::{ core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorObject}, }; pub use pallet_proposals_rpc_runtime_api::ProposalsApi as ProposalsRuntimeApi; -use sp_api::Decode; + use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block as BlockT; use sp_std::vec::Vec; diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 1e95438b..4de4f466 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -471,6 +471,7 @@ impl Pallet { } /// Get the individual votes of a project, return an empty map on error. + #[allow(clippy::type_complexity)] pub fn get_project_individuals_votes( project_key: ProjectKey, ) -> IndividualVotes< diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index ed5b2b7d..95aa2a36 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -289,7 +289,7 @@ pub mod pallet { weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); MilestoneVotes::::mutate(project_key, |vote_btree| { - vote_btree.remove(&milestone_key); + vote_btree.remove(milestone_key); }); UserHasVoted::::remove(( From 92efaf5fe8b68bde37eb09fd9c9c8019298ebc32 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 22 Sep 2023 10:25:39 +0100 Subject: [PATCH 028/192] fix build --- pallets/proposals/src/migration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 72af7a42..3ff4818e 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -432,9 +432,9 @@ pub mod v4 { if let Some(project) = crate::Projects::::get(project_key) { for (milestone_key, _) in project.milestones.iter() { *weight = weight.saturating_add(T::DbWeight::get().reads(1)); - if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { + if v5::MilestoneVotes::::contains_key(project_key, milestone_key) { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - crate::MilestoneVotes::::remove(project_key, milestone_key); + v5::MilestoneVotes::::remove(project_key, milestone_key); } else { break; } From 0fc23874f4185ef5762814722c89a0a2c00e5507 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 22 Sep 2023 10:27:17 +0100 Subject: [PATCH 029/192] fmt --- pallets/proposals/rpc/runtime-api/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index e2fe7c28..790aec52 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,6 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] - use sp_std::vec::Vec; sp_api::decl_runtime_apis! { From 55c5782c17ece4c9668521da4024a74882bb00e7 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 22 Sep 2023 20:32:34 +0100 Subject: [PATCH 030/192] bump spec version --- runtime/imbue-kusama/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 71ed7577..6677ee2e 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -100,7 +100,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("imbue"), impl_name: create_runtime_str!("imbue"), authoring_version: 2, - spec_version: 9432, + spec_version: 9433, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, From 50bf45648987443253c53b3d2cf8def33d2944d4 Mon Sep 17 00:00:00 2001 From: f-gate Date: Sun, 24 Sep 2023 13:17:14 +0100 Subject: [PATCH 031/192] 1 --- pallets/proposals/src/impls.rs | 1 - pallets/proposals/src/lib.rs | 23 ++++++++++++++++++++++- runtime/common/src/lib.rs | 18 ------------------ runtime/imbue-kusama/src/lib.rs | 2 +- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 4de4f466..b8869a12 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -1,5 +1,4 @@ use crate::*; -use common_runtime::runtime_support::IndividualVotes; use common_types::milestone_origin::FundingType; use scale_info::prelude::format; use sp_runtime::traits::{Saturating, Zero}; diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 95aa2a36..6a73dcd9 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -120,6 +120,13 @@ pub mod pallet { ValueQuery, >; + pub type IndividualVoteStore = StorageMap< + _, + Blake2_128Concat, + ProjectKey, + IndividualVotes + > + #[pallet::storage] #[pallet::getter(fn milestone_votes)] pub(super) type MilestoneVotes = StorageMap< @@ -196,7 +203,7 @@ pub mod pallet { VoteSubmitted( T::AccountId, ProjectKey, - MilestoneKey, + MilestoneKey, bool, BlockNumberFor, ), @@ -555,6 +562,20 @@ pub struct Whitelist { max_cap: Balance, } +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + pub struct IndividualVotes< + AccountId: Ord, + Balance, + MaxMilestones: Get, + MaxContributions: Get, + > { + pub inner: BoundedBTreeMap< + u32, + BoundedBTreeMap, + MaxMilestones, + >, + } + pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index fd667c91..eb956ac5 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -283,24 +283,6 @@ pub mod common_xcm { } } -pub mod runtime_support { - use codec::{Decode, Encode}; - use frame_support::{pallet_prelude::*, BoundedBTreeMap}; - #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] - pub struct IndividualVotes< - AccountId: Ord, - Balance, - MaxMilestones: Get, - MaxContributions: Get, - > { - pub inner: BoundedBTreeMap< - u32, - BoundedBTreeMap, - MaxMilestones, - >, - } -} - pub mod storage_deposits { #[derive(PartialEq, Eq, Debug, Copy, Clone)] pub enum StorageDepositItems { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 6677ee2e..46a348c7 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1161,7 +1161,7 @@ impl_runtime_apis! { fn get_project_individuals_votes(project_id: u32) -> Vec { let individual_votes = ImbueProposals::get_project_individuals_votes(project_id); - as Encode>::encode(&individual_votes) + as Encode>::encode(&individual_votes) } } From 9683bfaea9b65b85deff04b008da7d8cd5760024 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 25 Sep 2023 11:12:03 +0100 Subject: [PATCH 032/192] individual votes impl with storage --- pallets/proposals/src/impls.rs | 46 +++++++++++++++++++++++++++++----- pallets/proposals/src/lib.rs | 35 +++++++++++++++++--------- 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index b8869a12..b1353240 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -486,10 +486,7 @@ impl Pallet { UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); user_votes.into_iter().for_each(|(acc, boolean_vote)| { - match project.contributions.get(&acc) { - Some(c) => inner.insert(acc, (boolean_vote, c.value)), - None => inner.insert(acc, (boolean_vote, Zero::zero())), - }; + inner.insert(acc, boolean_vote) }); let bounded_inner: BoundedBTreeMap< AccountIdOf, @@ -503,8 +500,8 @@ impl Pallet { }) } let bounded_out: BoundedBTreeMap< - u32, - BoundedBTreeMap, (bool, BalanceOf), T::MaximumContributorsPerProject>, + MilestoneKey, + BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, T::MaxMilestonesPerProject, > = match out.try_into() { Ok(b) => b, @@ -513,4 +510,41 @@ impl Pallet { IndividualVotes { inner: bounded_out } } + + impl IndividualVotes + { + /// Create a new set of individual votes bound to a set of milestone keys. + /// Instantiates the votes as defaults. + fn new(milestone_keys: BoundedVec) -> Self { + let outer_votes: BoundedBTreeMap< + MilestoneKey, + BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, + T::MaxMilestonesPerProject> = BTreeMap::new(); + + milestones.iter().for_each(|milestone_key|{ + let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); + outer_votes.try_insert(milestone_key, inner_votes).map_err(|_|Error::::TooManyContributions)?; + }) + + Self {inner: outer_votes} + } + + fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: AccountIdOf, vote: bool) -> Result<(), DispatchError> { + if let Some(votes) = self.get_mut(&milestone_key) { + if let Some(single_vote) = votes.get_mut(&account_id) { + if self.with_mutable_votes { + votes.insert(account_id, vote); + } else { + return Err(Error::::VotesAreImmutable) + } + } else { + votes.insert(account_id, vote); + } + } else { + Err(Error::::IndividualVoteNotFound) + } + + Ok(()) + } + } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index ce277c81..4c1f45ee 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -274,6 +274,8 @@ pub mod pallet { TooManyProjects, /// There are too many milestone votes, this generally shouldnt be hit. TooManyMilestoneVotes, + /// An internal error, a collection of votes for a milestone has been lost.s + IndividualVoteNotFound, } #[pallet::hooks] @@ -435,8 +437,12 @@ pub mod pallet { FundingType::Grant(_) => {} } + + // TODO: this milestone key has no relation to the milestones coming in except the order they come in. + // This could be a bug somewhere. let mut milestone_key: u32 = 0; let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); + let bounded_milestone_keys: BoundedVec = for milestone in proposed_milestones { let milestone = Milestone { project_key, @@ -447,9 +453,16 @@ pub mod pallet { milestones .try_insert(milestone_key, milestone) .map_err(|_| Error::::TooManyMilestones)?; + + bounded_milestone_keys.try_push(milestone_key) + .map_err(|_| Error::::TooManyMilestones)?; + milestone_key = milestone_key.saturating_add(1); } + let individual_votes = IndividualVotes::new(bounded_milestone_keys)?; + IndividualVoteStore::::insert(project_key, individual_votes); + let bounded_contributions: ContributionsFor = contributions .try_into() .map_err(|_| Error::::TooManyContributions)?; @@ -563,18 +576,16 @@ pub struct Whitelist { } #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] - pub struct IndividualVotes< - AccountId: Ord, - Balance, - MaxMilestones: Get, - MaxContributions: Get, - > { - pub inner: BoundedBTreeMap< - u32, - BoundedBTreeMap, - MaxMilestones, - >, - } +#[scale_info(skip_type_params(T))] +struct IndividualVotes +{ + inner: BoundedBTreeMap< + MilestoneKey, + BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, + T::MaxMilestonesPerProject, + >, + with_mutable_votes: bool, +} pub trait WeightInfoT { fn submit_milestone() -> Weight; From c043e3ee42c560d8a146936a1dc839cd5856aa0e Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 25 Sep 2023 19:40:10 +0100 Subject: [PATCH 033/192] fix buggy impl --- pallets/proposals/src/impls.rs | 133 ++++++++++++++++----------------- pallets/proposals/src/lib.rs | 13 ++-- 2 files changed, 74 insertions(+), 72 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index b1353240..995da651 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -469,82 +469,81 @@ impl Pallet { Ok(()) } - /// Get the individual votes of a project, return an empty map on error. - #[allow(clippy::type_complexity)] - pub fn get_project_individuals_votes( - project_key: ProjectKey, - ) -> IndividualVotes< - AccountIdOf, - BalanceOf, - T::MaxMilestonesPerProject, - T::MaximumContributorsPerProject, - > { - let mut out = BTreeMap::new(); - if let Some(project) = Projects::::get(project_key) { - project.milestones.keys().for_each(|milestone_key| { - let user_votes = - UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); - let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); - user_votes.into_iter().for_each(|(acc, boolean_vote)| { - inner.insert(acc, boolean_vote) - }); - let bounded_inner: BoundedBTreeMap< - AccountIdOf, - (bool, BalanceOf), - T::MaximumContributorsPerProject, - > = match inner.try_into() { - Ok(b) => b, - Err(_) => BoundedBTreeMap::new(), - }; - out.insert(milestone_key.to_owned(), bounded_inner); - }) - } - let bounded_out: BoundedBTreeMap< + // Get the individual votes of a project, return an empty map on error. + // #[allow(clippy::type_complexity)] + // pub fn get_project_individuals_votes( + // project_key: ProjectKey, + // ) -> IndividualVotes { + // let mut out = BTreeMap::new(); + // if let Some(project) = Projects::::get(project_key) { + // project.milestones.keys().for_each(|milestone_key| { + // let user_votes = + // UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); + // let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); + // user_votes.into_iter().for_each(|(acc, boolean_vote)| { + // inner.insert(acc, boolean_vote) + // }); + // let bounded_inner: BoundedBTreeMap< + // AccountIdOf, + // (bool, BalanceOf), + // T::MaximumContributorsPerProject, + // > = match inner.try_into() { + // Ok(b) => b, + // Err(_) => BoundedBTreeMap::new(), + // }; + // out.insert(milestone_key.to_owned(), bounded_inner); + // }) + // } + // let bounded_out: BoundedBTreeMap< + // MilestoneKey, + // BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, + // T::MaxMilestonesPerProject, + // > = match out.try_into() { + // Ok(b) => b, + // Err(_) => BoundedBTreeMap::new(), + // }; + + // IndividualVotes { inner: bounded_out } + // } +} + +impl IndividualVotes +{ + /// Create a new set of individual votes bound to a set of milestone keys. + /// Instantiates the votes as defaults. + pub(crate) fn new(milestone_keys: BoundedVec) -> Result { + let mut outer_votes: BoundedBTreeMap< MilestoneKey, BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, - T::MaxMilestonesPerProject, - > = match out.try_into() { - Ok(b) => b, - Err(_) => BoundedBTreeMap::new(), + T::MaxMilestonesPerProject> = BoundedBTreeMap::new(); + + for milestone_key in milestone_keys.iter() { + let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); + outer_votes.try_insert(milestone_key.to_owned(), inner_votes).map_err(|_|Error::::TooManyContributions)?; }; - IndividualVotes { inner: bounded_out } + // Always set as mutable votes for now. + Ok(Self { + inner: outer_votes, + with_mutable_votes: false, + }) } - impl IndividualVotes - { - /// Create a new set of individual votes bound to a set of milestone keys. - /// Instantiates the votes as defaults. - fn new(milestone_keys: BoundedVec) -> Self { - let outer_votes: BoundedBTreeMap< - MilestoneKey, - BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, - T::MaxMilestonesPerProject> = BTreeMap::new(); - - milestones.iter().for_each(|milestone_key|{ - let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); - outer_votes.try_insert(milestone_key, inner_votes).map_err(|_|Error::::TooManyContributions)?; - }) - - Self {inner: outer_votes} - } - - fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: AccountIdOf, vote: bool) -> Result<(), DispatchError> { - if let Some(votes) = self.get_mut(&milestone_key) { - if let Some(single_vote) = votes.get_mut(&account_id) { - if self.with_mutable_votes { - votes.insert(account_id, vote); - } else { - return Err(Error::::VotesAreImmutable) - } + pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: AccountIdOf, vote: bool) -> Result<(), DispatchError> { + if let Some(votes) = self.inner.get_mut(&milestone_key) { + if let Some(_existing_vote) = votes.get_mut(&account_id) { + if self.with_mutable_votes { + votes.try_insert(account_id, vote).map_err(|_|Error::::TooManyContributions)?; } else { - votes.insert(account_id, vote); - } + return Err(Error::::VotesAreImmutable.into()) + } } else { - Err(Error::::IndividualVoteNotFound) + votes.try_insert(account_id, vote).map_err(|_|Error::::TooManyContributions)?; } - - Ok(()) + } else { + return Err(Error::::IndividualVoteNotFound.into()) } + + Ok(()) } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 4c1f45ee..f658bb10 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -120,12 +120,14 @@ pub mod pallet { ValueQuery, >; + #[pallet::storage] pub type IndividualVoteStore = StorageMap< _, Blake2_128Concat, ProjectKey, - IndividualVotes - > + IndividualVotes, + OptionQuery, + >; #[pallet::storage] #[pallet::getter(fn milestone_votes)] @@ -442,7 +444,8 @@ pub mod pallet { // This could be a bug somewhere. let mut milestone_key: u32 = 0; let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); - let bounded_milestone_keys: BoundedVec = + let mut bounded_milestone_keys: BoundedVec = BoundedVec::new(); + for milestone in proposed_milestones { let milestone = Milestone { project_key, @@ -458,7 +461,7 @@ pub mod pallet { .map_err(|_| Error::::TooManyMilestones)?; milestone_key = milestone_key.saturating_add(1); - } + }; let individual_votes = IndividualVotes::new(bounded_milestone_keys)?; IndividualVoteStore::::insert(project_key, individual_votes); @@ -577,7 +580,7 @@ pub struct Whitelist { #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] -struct IndividualVotes +pub struct IndividualVotes { inner: BoundedBTreeMap< MilestoneKey, From c66693069b4034be0ac428a08c84fd66f670c229 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 25 Sep 2023 20:01:59 +0100 Subject: [PATCH 034/192] define immutability, update on vote --- pallets/proposals/src/impls.rs | 37 ++++++++++++++++++++-------------- pallets/proposals/src/lib.rs | 8 +++++--- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 995da651..140ba170 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -77,13 +77,12 @@ impl Pallet { let now = frame_system::Pallet::::block_number(); let user_has_voted_key = (project_key, RoundType::VotingRound, milestone_key); - UserHasVoted::::try_mutate(user_has_voted_key, |votes| { - ensure!(!votes.contains_key(&who), Error::::VotesAreImmutable); - votes - .try_insert(who.clone(), approve_milestone) - .map_err(|_| Error::::Overflow)?; - Ok::<(), DispatchError>(()) - })?; + IndividualVoteStore::::try_mutate(project_key, |maybe_individual_votes| { + if let Some(individual_votes) = maybe_individual_votes { + individual_votes.insert_individual_vote(milestone_key, &who, approve_milestone)?; + } + Ok::<(), DispatchError>(()); + }); let vote: Vote> = MilestoneVotes::::try_mutate(project_key, |vote_btree| { @@ -98,6 +97,7 @@ impl Pallet { Err(Error::::VotingRoundNotStarted.into()) } })?; + let funding_threshold: BalanceOf = T::PercentRequiredForVoteToPass::get().mul_floor(project.raised_funds); @@ -507,8 +507,9 @@ impl Pallet { // } } -impl IndividualVotes +impl ImmutableIndividualVotes { + // TODO: Test /// Create a new set of individual votes bound to a set of milestone keys. /// Instantiates the votes as defaults. pub(crate) fn new(milestone_keys: BoundedVec) -> Result { @@ -525,18 +526,15 @@ impl IndividualVotes // Always set as mutable votes for now. Ok(Self { inner: outer_votes, - with_mutable_votes: false, }) } - pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: AccountIdOf, vote: bool) -> Result<(), DispatchError> { + // TODO: Test + /// Insert the vote from an individual on a milestone. + pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: &AccountIdOf, vote: bool) -> Result<(), DispatchError> { if let Some(votes) = self.inner.get_mut(&milestone_key) { if let Some(_existing_vote) = votes.get_mut(&account_id) { - if self.with_mutable_votes { - votes.try_insert(account_id, vote).map_err(|_|Error::::TooManyContributions)?; - } else { - return Err(Error::::VotesAreImmutable.into()) - } + return Err(Error::::VotesAreImmutable.into()) } else { votes.try_insert(account_id, vote).map_err(|_|Error::::TooManyContributions)?; } @@ -546,4 +544,13 @@ impl IndividualVotes Ok(()) } + + /// Clear the votes for a given milestone. + /// Used when a milestone is submitted. + /// Skips if the milestone is not found. + pub(crate) fn clear_milestone_votes(&mut self, milestone_key: MilestoneKey) { + if let Some(btree) = self.inner.get_mut(milestone_key) { + btree = Default::default() + } + } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index f658bb10..d2fd70cf 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -125,7 +125,7 @@ pub mod pallet { _, Blake2_128Concat, ProjectKey, - IndividualVotes, + ImmutableIndividualVotes, OptionQuery, >; @@ -463,7 +463,7 @@ pub mod pallet { milestone_key = milestone_key.saturating_add(1); }; - let individual_votes = IndividualVotes::new(bounded_milestone_keys)?; + let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys)?; IndividualVoteStore::::insert(project_key, individual_votes); let bounded_contributions: ContributionsFor = contributions @@ -578,9 +578,11 @@ pub struct Whitelist { max_cap: Balance, } +// TODO: migrate so that current projects contain an individual vote that correctly represents the current state. +/// Stores the btree for each individual vote. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] -pub struct IndividualVotes +pub struct ImmutableIndividualVotes { inner: BoundedBTreeMap< MilestoneKey, From dbbef52161aeaf184fb26111268fdbe8cc6a2781 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 26 Sep 2023 10:33:52 +0100 Subject: [PATCH 035/192] use individual votes for oninit and submit and close voting + update migration --- pallets/proposals/src/impls.rs | 21 ++++-- pallets/proposals/src/lib.rs | 10 +-- pallets/proposals/src/migration.rs | 116 +++++++++++++++++++++-------- 3 files changed, 104 insertions(+), 43 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 140ba170..53edff2b 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -43,7 +43,14 @@ impl Pallet { .map_err(|_| Error::::Overflow)?; Ok::<(), DispatchError>(()) })?; - UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); + IndividualVoteStore::::mutate(|project_key, |maybe_votes| { + if let Some(individual_votes) = maybe_votes { + individual_votes.clear_milestone_votes(milestone_key); + } else { + Err(Error::::IndividualVoteNotFound.into()) + } + Ok::<(), DispatchError>(()) + }) MilestoneVotes::::try_mutate(project_key, |vote_btree| { vote_btree @@ -81,7 +88,7 @@ impl Pallet { if let Some(individual_votes) = maybe_individual_votes { individual_votes.insert_individual_vote(milestone_key, &who, approve_milestone)?; } - Ok::<(), DispatchError>(()); + Ok::<(), DispatchError>(()) }); let vote: Vote> = @@ -434,14 +441,14 @@ impl Pallet { } }); + Self::close_voting_round(project_key, user_has_voted_key)?; + Self::deposit_event(Event::MilestoneApproved( who, project_key, user_has_voted_key.2, >::block_number(), )); - - Self::close_voting_round(project_key, user_has_voted_key)?; } if vote.nay >= funding_threshold { @@ -465,7 +472,11 @@ impl Pallet { // Prevent hook from calling. RoundsExpiring::::remove(exp_block); // Allow future votes to occur on this milestone - UserHasVoted::::remove(user_has_voted_key); + IndividualVoteStore::::mutate(project_key, |maybe_individual_votes| { + if let Some(individual_votes) = maybe_individual_votes { + individual_votes.clear_milestone_votes(user_has_voted_key.2); + } + }) Ok(()) } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index d2fd70cf..7978f3db 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -303,11 +303,11 @@ pub mod pallet { vote_btree.remove(milestone_key); }); - UserHasVoted::::remove(( - project_key, - RoundType::VotingRound, - milestone_key, - )); + IndividualVoteStore::::mutate(project_key, |m_votes| { + if let Some(individual_votes) = m_votes { + individual_votes.clear_milestone_votes(mielstone_key); + } + }); } // Votes of no confidence do not finaliese automatically RoundType::VoteOfNoConfidence => { diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 3ff4818e..4a11d9da 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -488,6 +488,74 @@ pub mod v5 { #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; + #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + #[repr(u32)] + pub enum Release { + V0, + V1, + V2, + #[default] + V3, + V4, + } + + /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 + /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 + pub struct MigrateToV5(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV5 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); + ensure!( + StorageVersion::::get() == Release::V4, + "Required v4 before upgrading to v5" + ); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads_writes(1, 1); + log::warn!("****** STARTING MIGRATION *****"); + log::warn!("****** STARTING MIGRATION *****"); + + let current = as GetStorageVersion>::current_storage_version(); + let onchain = StorageVersion::::get(); + + if current == 5 && onchain == Release::V4 { + StorageVersion::::kill(); + current.put::>(); + + log::warn!("v5 has been successfully applied"); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); + } else { + log::warn!("Skipping v5, should be removed from Executive"); + weight = weight.saturating_add(T::DbWeight::get().reads(1)); + } + + log::warn!("****** ENDING MIGRATION *****"); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-proposals", "Running post_upgrade()"); + + ensure!( + !StorageVersion::::exists(), + "Old storage version storage type should have been removed." + ); + + ensure!( + Pallet::::current_storage_version() == 5, + "Storage version should be v5 after the migration" + ); + + Ok(()) + } + } +} + +pub mod v6 { #[storage_alias] pub(super) type MilestoneVotes = StorageDoubleMap< Pallet, @@ -499,16 +567,6 @@ pub mod v5 { OptionQuery, >; - #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] - #[repr(u32)] - pub enum Release { - V0, - V1, - V2, - #[default] - V3, - V4, - } fn migrate_milestone_votes(weight: &mut Weight) { // Highly in-memory intensive but on the plus side not many reads/writes to db. @@ -541,16 +599,17 @@ pub mod v5 { }) } - /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 - /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 - pub struct MigrateToV5(sp_std::marker::PhantomData); - impl OnRuntimeUpgrade for MigrateToV5 { + + pub struct MigrateToV6(T); + impl OnRuntimeUpgrade for MigrateToV6 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); + let current = as GetStorageVersion>::current_storage_version(); + let onchain = StorageVersion::::get(); ensure!( - StorageVersion::::get() == Release::V4, - "Required v4 before upgrading to v5" + current == 6 && onchain == 5, + "Current version must be set to v6 and onchain to v5" ); Ok(Vec::new()) } @@ -558,23 +617,16 @@ pub mod v5 { fn on_runtime_upgrade() -> Weight { let mut weight = T::DbWeight::get().reads_writes(1, 1); log::warn!("****** STARTING MIGRATION *****"); - log::warn!("****** STARTING MIGRATION *****"); let current = as GetStorageVersion>::current_storage_version(); let onchain = StorageVersion::::get(); - - if current == 5 && onchain == Release::V4 { - // 1 - StorageVersion::::kill(); - current.put::>(); - - // 2 + if current == 6 && onchain == 5, { migrate_milestone_votes::(&mut weight); - log::warn!("v5 has been successfully applied"); + log::warn!("v6 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); } else { - log::warn!("Skipping v5, should be removed from Executive"); + log::warn!("Skipping v6 due to mismatched version, this be removed from Executive"); weight = weight.saturating_add(T::DbWeight::get().reads(1)); } @@ -587,20 +639,18 @@ pub mod v5 { log::warn!( target: "pallet-proposals", "Running post_upgrade()"); ensure!( - !StorageVersion::::exists(), - "Old storage version storage type should have been removed." - ); - - ensure!( - Pallet::::current_storage_version() == 5, - "Storage version should be v5 after the migration" + Pallet::::current_storage_version() == 6, + "Storage version should be v6 after the migration" ); Ok(()) } } + } + + #[cfg(test)] mod test { use super::*; From 7767b8232f44cd324a157cb735b0b4a4bbf77e96 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 26 Sep 2023 10:48:17 +0100 Subject: [PATCH 036/192] fixing build --- pallets/proposals/src/impls.rs | 16 ++++++------ pallets/proposals/src/lib.rs | 5 ++-- pallets/proposals/src/migration.rs | 40 +++++++++++++++++++----------- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 53edff2b..706de66a 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -43,14 +43,14 @@ impl Pallet { .map_err(|_| Error::::Overflow)?; Ok::<(), DispatchError>(()) })?; - IndividualVoteStore::::mutate(|project_key, |maybe_votes| { + IndividualVoteStore::::mutate(project_key, |maybe_votes| { if let Some(individual_votes) = maybe_votes { individual_votes.clear_milestone_votes(milestone_key); } else { - Err(Error::::IndividualVoteNotFound.into()) - } + return Err(Error::::IndividualVoteNotFound.into()); + }; Ok::<(), DispatchError>(()) - }) + }); MilestoneVotes::::try_mutate(project_key, |vote_btree| { vote_btree @@ -476,7 +476,7 @@ impl Pallet { if let Some(individual_votes) = maybe_individual_votes { individual_votes.clear_milestone_votes(user_has_voted_key.2); } - }) + }); Ok(()) } @@ -547,7 +547,7 @@ impl ImmutableIndividualVotes if let Some(_existing_vote) = votes.get_mut(&account_id) { return Err(Error::::VotesAreImmutable.into()) } else { - votes.try_insert(account_id, vote).map_err(|_|Error::::TooManyContributions)?; + votes.try_insert(account_id.clone(), vote).map_err(|_|Error::::TooManyContributions)?; } } else { return Err(Error::::IndividualVoteNotFound.into()) @@ -560,8 +560,8 @@ impl ImmutableIndividualVotes /// Used when a milestone is submitted. /// Skips if the milestone is not found. pub(crate) fn clear_milestone_votes(&mut self, milestone_key: MilestoneKey) { - if let Some(btree) = self.inner.get_mut(milestone_key) { - btree = Default::default() + if let Some(btree) = self.inner.get_mut(&milestone_key) { + *btree = Default::default() } } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 7978f3db..68ff32c9 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -100,7 +100,7 @@ pub mod pallet { type PercentRequiredForVoteNoConfidenceToPass: Get; } - const STORAGE_VERSION: StorageVersion = StorageVersion::new(5); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -305,7 +305,7 @@ pub mod pallet { IndividualVoteStore::::mutate(project_key, |m_votes| { if let Some(individual_votes) = m_votes { - individual_votes.clear_milestone_votes(mielstone_key); + individual_votes.clear_milestone_votes(*milestone_key); } }); } @@ -589,7 +589,6 @@ pub struct ImmutableIndividualVotes BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, T::MaxMilestonesPerProject, >, - with_mutable_votes: bool, } pub trait WeightInfoT { diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 4a11d9da..5c9ebfcc 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -346,7 +346,7 @@ pub mod v3 { v3::OldMilestoneVotes::::drain().for_each(|(old_key, vote)| { *weight += T::DbWeight::get().reads(1); let (project_key, milestone_key) = old_key; - v5::MilestoneVotes::::insert(project_key, milestone_key, vote); + v6::MilestoneVotes::::insert(project_key, milestone_key, vote); *weight += T::DbWeight::get().reads_writes(1, 1); }); } @@ -432,9 +432,9 @@ pub mod v4 { if let Some(project) = crate::Projects::::get(project_key) { for (milestone_key, _) in project.milestones.iter() { *weight = weight.saturating_add(T::DbWeight::get().reads(1)); - if v5::MilestoneVotes::::contains_key(project_key, milestone_key) { + if v6::MilestoneVotes::::contains_key(project_key, milestone_key) { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - v5::MilestoneVotes::::remove(project_key, milestone_key); + v6::MilestoneVotes::::remove(project_key, milestone_key); } else { break; } @@ -500,7 +500,6 @@ pub mod v5 { } /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 - /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 pub struct MigrateToV5(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV5 { #[cfg(feature = "try-runtime")] @@ -556,6 +555,8 @@ pub mod v5 { } pub mod v6 { + use super::*; + #[storage_alias] pub(super) type MilestoneVotes = StorageDoubleMap< Pallet, @@ -567,13 +568,20 @@ pub mod v6 { OptionQuery, >; + // Since we are keeping the depricated vote of no confidence for the meantime + // only migrate the voting rounds awaiting the migration to remove no confidence rounds. + // User votes is now handled by IndividualVoteStore:: + fn migrate_user_has_voted(weight: &mut Weight) { + + } + /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 fn migrate_milestone_votes(weight: &mut Weight) { // Highly in-memory intensive but on the plus side not many reads/writes to db. // I can write a less in memory one if anyone wants using crate::MilestoneVotes::mutate(). let mut parent: BTreeMap>>> = Default::default(); - v5::MilestoneVotes::::drain().for_each(|(project_key, milestone_key, vote)| { + v6::MilestoneVotes::::drain().for_each(|(project_key, milestone_key, vote)| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); if let Some(child) = parent.get_mut(&project_key) { child.insert(milestone_key, vote); @@ -599,14 +607,13 @@ pub mod v6 { }) } - pub struct MigrateToV6(T); impl OnRuntimeUpgrade for MigrateToV6 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); let current = as GetStorageVersion>::current_storage_version(); - let onchain = StorageVersion::::get(); + let onchain = as GetStorageVersion>::on_chain_storage_version(); ensure!( current == 6 && onchain == 5, "Current version must be set to v6 and onchain to v5" @@ -619,9 +626,12 @@ pub mod v6 { log::warn!("****** STARTING MIGRATION *****"); let current = as GetStorageVersion>::current_storage_version(); - let onchain = StorageVersion::::get(); - if current == 6 && onchain == 5, { + let onchain = as GetStorageVersion>::on_chain_storage_version(); + if current == 6 && onchain == 5 { + + // Migrations migrate_milestone_votes::(&mut weight); + migrate_user_has_voted::(&mut weight); log::warn!("v6 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); @@ -929,8 +939,8 @@ mod test { v3::OldMilestoneVotes::::get((10, 10)), Default::default() ); - assert!(v5::MilestoneVotes::::contains_key(10, 10)); - let v = v5::MilestoneVotes::::get(10, 10).unwrap(); + assert!(v6::MilestoneVotes::::contains_key(10, 10)); + let v = v6::MilestoneVotes::::get(10, 10).unwrap(); assert_eq!(v.yay, 100_000); assert_eq!(v.nay, 50_000); assert!(!v.is_approved); @@ -961,8 +971,8 @@ mod test { // insert a fake round to be mutated. v4::V4Rounds::::insert(project_key, crate::RoundType::VotingRound, expiry_block); crate::RoundsExpiring::::insert(expiry_block, rounds_expiring); - v5::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); - v5::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); + v6::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); + v6::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); let mut weight = ::default(); v4::migrate_votes::(&mut weight); @@ -975,8 +985,8 @@ mod test { crate::RoundType::VotingRound )); assert!(crate::RoundsExpiring::::get(expiry_block).is_empty()); - assert!(v5::MilestoneVotes::::get(project_key, milestone_key).is_none()); - assert!(v5::MilestoneVotes::::get(project_key, milestone_key + 1).is_none()); + assert!(v6::MilestoneVotes::::get(project_key, milestone_key).is_none()); + assert!(v6::MilestoneVotes::::get(project_key, milestone_key + 1).is_none()); }) } } From 0a570fc30341bb622401602bfefae81d404ca842 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 09:41:00 +0100 Subject: [PATCH 037/192] seperated test files, tested ImmutableVotes --- pallets/proposals/src/impls.rs | 26 ++++++-- pallets/proposals/src/lib.rs | 14 ++-- pallets/proposals/src/test_utils.rs | 11 ++-- .../proposals/src/tests/individual_votes.rs | 64 +++++++++++++++++++ pallets/proposals/src/tests/mod.rs | 2 + .../src/{tests.rs => tests/pallet.rs} | 21 +++--- 6 files changed, 112 insertions(+), 26 deletions(-) create mode 100644 pallets/proposals/src/tests/individual_votes.rs create mode 100644 pallets/proposals/src/tests/mod.rs rename pallets/proposals/src/{tests.rs => tests/pallet.rs} (97%) diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 706de66a..dad41e81 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -43,14 +43,15 @@ impl Pallet { .map_err(|_| Error::::Overflow)?; Ok::<(), DispatchError>(()) })?; - IndividualVoteStore::::mutate(project_key, |maybe_votes| { + + IndividualVoteStore::::try_mutate(project_key, |maybe_votes| { if let Some(individual_votes) = maybe_votes { individual_votes.clear_milestone_votes(milestone_key); } else { - return Err(Error::::IndividualVoteNotFound.into()); + return Err(Error::::IndividualVoteNotFound.into()) }; Ok::<(), DispatchError>(()) - }); + })?; MilestoneVotes::::try_mutate(project_key, |vote_btree| { vote_btree @@ -89,7 +90,7 @@ impl Pallet { individual_votes.insert_individual_vote(milestone_key, &who, approve_milestone)?; } Ok::<(), DispatchError>(()) - }); + })?; let vote: Vote> = MilestoneVotes::::try_mutate(project_key, |vote_btree| { @@ -531,7 +532,8 @@ impl ImmutableIndividualVotes for milestone_key in milestone_keys.iter() { let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); - outer_votes.try_insert(milestone_key.to_owned(), inner_votes).map_err(|_|Error::::TooManyContributions)?; + // outer_votes and milestone_keys are bounded by the same binding so this will never fail. + outer_votes.try_insert(milestone_key.to_owned(), inner_votes).expect("milestone_keys and outer_votes have been bound by the same binding; qed"); }; // Always set as mutable votes for now. @@ -540,7 +542,6 @@ impl ImmutableIndividualVotes }) } - // TODO: Test /// Insert the vote from an individual on a milestone. pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: &AccountIdOf, vote: bool) -> Result<(), DispatchError> { if let Some(votes) = self.inner.get_mut(&milestone_key) { @@ -564,4 +565,17 @@ impl ImmutableIndividualVotes *btree = Default::default() } } + + /// Take a mutable reference to the inner individual votes item. + pub(crate) fn as_mut(&mut self) -> &mut IndividualVotes { + &mut self.inner + } +} + +impl AsRef> for ImmutableIndividualVotes { + fn as_ref(&self) -> &IndividualVotes { + &self.inner + } } + + diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 68ff32c9..5f9e2f08 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -40,6 +40,11 @@ pub mod impls; pub use impls::*; pub type ProjectKey = u32; pub type MilestoneKey = u32; +pub type IndividualVotes = BoundedBTreeMap< + MilestoneKey, + BoundedBTreeMap, bool, ::MaximumContributorsPerProject>, + ::MaxMilestonesPerProject>; + pub type AccountIdOf = ::AccountId; pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; pub type StorageItemOf = @@ -582,13 +587,8 @@ pub struct Whitelist { /// Stores the btree for each individual vote. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] -pub struct ImmutableIndividualVotes -{ - inner: BoundedBTreeMap< - MilestoneKey, - BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, - T::MaxMilestonesPerProject, - >, +pub struct ImmutableIndividualVotes { + inner: IndividualVotes, } pub trait WeightInfoT { diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index c071c299..f1ceca4f 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,9 +1,6 @@ use crate::Config; use crate::Pallet as Proposals; -use crate::{ - AccountIdOf, BalanceOf, Contribution, ContributionsFor, Milestone, MilestoneKey, Project, - ProjectKey, ProposedMilestone, -}; +use crate::*; use common_types::{CurrencyId, FundingType}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, Vec}; @@ -95,6 +92,7 @@ pub fn create_project( let mut milestone_key: u32 = 0; let mut milestones: BTreeMap = BTreeMap::new(); + let mut bounded_milestone_keys: BoundedVec = BoundedVec::new(); for ms in proposed_milestones { let milestone = Milestone { @@ -104,9 +102,14 @@ pub fn create_project( is_approved: false, }; milestones.insert(milestone_key, milestone); + let _ = bounded_milestone_keys.try_push(milestone_key); milestone_key = milestone_key.saturating_add(1); } + let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys).unwrap(); + IndividualVoteStore::::insert(project_key, individual_votes); + + let project = Project { milestones: milestones.try_into().expect("too many milestones"), contributions, diff --git a/pallets/proposals/src/tests/individual_votes.rs b/pallets/proposals/src/tests/individual_votes.rs new file mode 100644 index 00000000..c50e6b88 --- /dev/null +++ b/pallets/proposals/src/tests/individual_votes.rs @@ -0,0 +1,64 @@ +use frame_support::{assert_noop, assert_ok}; +use common_types::CurrencyId; +use test_utils::*; +use crate::{mock::*, *}; + +#[test] +fn individual_votes_new_inserts_all_milestone_keys() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + for key in milestone_keys { + assert!(i.as_ref().get(&key).unwrap().is_empty(), "A milestone key should have been inserted, and the map must be empty."); + } + }) +} + +#[test] +fn individual_votes_insert_vote_works() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let voting_key = milestone_keys[0]; + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + assert_ok!(i.insert_individual_vote(voting_key, &ALICE, true)); + assert_ok!(i.insert_individual_vote(voting_key, &BOB, false)); + assert_eq!(i.as_ref().get(&voting_key).unwrap().get(&ALICE).unwrap(), &true, "ALICE vote should exist and been voted true,"); + assert_eq!(i.as_ref().get(&voting_key).unwrap().get(&BOB).unwrap(), &false, "BOB vote should exist and been voted false."); + }) +} + + +#[test] +fn individual_votes_votes_are_immutable() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let voting_key = milestone_keys[0]; + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); + assert_noop!(i.insert_individual_vote(voting_key, &ALICE, false), Error::::VotesAreImmutable); + }) +} + +#[test] +fn individual_votes_cannot_vote_on_non_existant_milestone() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let voting_key = 4; + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + assert_noop!(i.insert_individual_vote(voting_key, &ALICE, true), Error::::IndividualVoteNotFound); + }) +} + +#[test] +fn individual_votes_clear_votes_actually_clears() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let voting_key = milestone_keys[0]; + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); + i.insert_individual_vote(voting_key, &BOB, true).unwrap(); + i.clear_milestone_votes(voting_key); + assert!(i.as_ref().get(&voting_key).unwrap().is_empty(), "The btree should have been emptied after a cleared vote."); + }) +} + diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs new file mode 100644 index 00000000..1db92e45 --- /dev/null +++ b/pallets/proposals/src/tests/mod.rs @@ -0,0 +1,2 @@ +pub mod pallet; +pub mod individual_votes; \ No newline at end of file diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests/pallet.rs similarity index 97% rename from pallets/proposals/src/tests.rs rename to pallets/proposals/src/tests/pallet.rs index c14040e6..b6415c11 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -222,9 +222,11 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { RoundType::VotingRound, milestone_key ))); + + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - UserHasVoted::::get((&project_key, RoundType::VotingRound, milestone_key)) - .contains_key(&BOB) + individual_votes.as_ref().get(&milestone_key).unwrap().get(&BOB).unwrap() == &true, + "IndividualVotesStore has not been mutated correctly." ); // Assert the storage has been cleared up after finalisation @@ -243,9 +245,9 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { 0, "This vec should have been emptied on auto finalisation." ); + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)) - .is_empty() + !individual_votes.as_ref().get(&milestone_key).unwrap().contains_key(&BOB) ); }); } @@ -277,11 +279,12 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { RoundType::VotingRound, milestone_key ))); + + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - UserHasVoted::::get((&project_key, RoundType::VotingRound, milestone_key)) - .contains_key(&BOB) + individual_votes.as_ref().get(&milestone_key).unwrap().get(&BOB).unwrap() == &false, + "IndividualVotesStore has not been mutated correctly." ); - // Assert the storage has been cleared up after finalisation assert_ok!(Proposals::vote_on_milestone( RuntimeOrigin::signed(*CHARLIE), @@ -298,9 +301,9 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { 0, "This vec should have been emptied on auto finalisation." ); + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)) - .is_empty() + !individual_votes.as_ref().get(&milestone_key).unwrap().contains_key(&BOB) ); }); } From 6f66e356a3966bc46b0c5fadbfc1ff40bb90f41f Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:17:27 +0100 Subject: [PATCH 038/192] fix runtime api, reorg proposals --- pallets/proposals/rpc/runtime-api/src/lib.rs | 2 +- pallets/proposals/rpc/src/lib.rs | 8 +-- .../proposals/src/impls/immutable_votes.rs | 60 +++++++++++++++++++ pallets/proposals/src/impls/mod.rs | 6 ++ .../src/{impls.rs => impls/pallet_impls.rs} | 59 ------------------ pallets/proposals/src/lib.rs | 2 +- ...individual_votes.rs => immutable_votes.rs} | 0 pallets/proposals/src/tests/mod.rs | 2 +- runtime/imbue-kusama/src/lib.rs | 17 ++++-- 9 files changed, 86 insertions(+), 70 deletions(-) create mode 100644 pallets/proposals/src/impls/immutable_votes.rs create mode 100644 pallets/proposals/src/impls/mod.rs rename pallets/proposals/src/{impls.rs => impls/pallet_impls.rs} (89%) rename pallets/proposals/src/tests/{individual_votes.rs => immutable_votes.rs} (100%) diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 790aec52..e3643b21 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -7,6 +7,6 @@ sp_api::decl_runtime_apis! { where AccountId: codec::Codec + Ord, { fn get_project_account_by_id(project_id: u32) -> AccountId; - fn get_project_individuals_votes(project_id: u32) -> Vec; + fn get_all_project_data(project_id: u32) -> Option<(Vec, Vec)>; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index 37a1b5d6..c8bd2a25 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -23,8 +23,8 @@ where { #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; - #[method(name = "proposals_getProjectIndividualVotes")] - fn project_individuals_votes(&self, project_id: u32) -> RpcResult>; + #[method(name = "proposals_getAllProjectData")] + fn all_project_data(&self, project_id: u32) -> RpcResult, Vec)>>; } pub struct Proposals { @@ -76,11 +76,11 @@ where api.get_project_account_by_id(at, project_id) .map_err(runtime_error_into_rpc_err) } - fn project_individuals_votes(&self, project_id: u32) -> RpcResult> { + fn all_project_data(&self, project_id: u32) -> RpcResult, Vec)>> { let api = self.client.runtime_api(); let at = self.client.info().best_hash; - api.get_project_individuals_votes(at, project_id) + api.get_all_project_data(at, project_id) .map_err(runtime_error_into_rpc_err) } } diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs new file mode 100644 index 00000000..ee99115f --- /dev/null +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -0,0 +1,60 @@ +use crate::*; +impl ImmutableIndividualVotes +{ + // TODO: Test + /// Create a new set of individual votes bound to a set of milestone keys. + /// Instantiates the votes as defaults. + pub(crate) fn new(milestone_keys: BoundedVec) -> Result { + let mut outer_votes: BoundedBTreeMap< + MilestoneKey, + BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, + T::MaxMilestonesPerProject> = BoundedBTreeMap::new(); + + for milestone_key in milestone_keys.iter() { + let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); + // outer_votes and milestone_keys are bounded by the same binding so this will never fail. + outer_votes.try_insert(milestone_key.to_owned(), inner_votes).expect("milestone_keys and outer_votes have been bound by the same binding; qed"); + }; + + // Always set as mutable votes for now. + Ok(Self { + inner: outer_votes, + }) + } + + /// Insert the vote from an individual on a milestone. + pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: &AccountIdOf, vote: bool) -> Result<(), DispatchError> { + if let Some(votes) = self.inner.get_mut(&milestone_key) { + if let Some(_existing_vote) = votes.get_mut(&account_id) { + return Err(Error::::VotesAreImmutable.into()) + } else { + votes.try_insert(account_id.clone(), vote).map_err(|_|Error::::TooManyContributions)?; + } + } else { + return Err(Error::::IndividualVoteNotFound.into()) + } + + Ok(()) + } + + /// Clear the votes for a given milestone. + /// Used when a milestone is submitted. + /// Skips if the milestone is not found. + pub(crate) fn clear_milestone_votes(&mut self, milestone_key: MilestoneKey) { + if let Some(btree) = self.inner.get_mut(&milestone_key) { + *btree = Default::default() + } + } + + /// Take a mutable reference to the inner individual votes item. + pub(crate) fn as_mut(&mut self) -> &mut IndividualVotes { + &mut self.inner + } +} + +impl AsRef> for ImmutableIndividualVotes { + fn as_ref(&self) -> &IndividualVotes { + &self.inner + } +} + diff --git a/pallets/proposals/src/impls/mod.rs b/pallets/proposals/src/impls/mod.rs new file mode 100644 index 00000000..e4c111c4 --- /dev/null +++ b/pallets/proposals/src/impls/mod.rs @@ -0,0 +1,6 @@ + +pub mod pallet_impls; +pub mod immutable_votes; + +pub use pallet_impls::*; +pub use immutable_votes::*; \ No newline at end of file diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls/pallet_impls.rs similarity index 89% rename from pallets/proposals/src/impls.rs rename to pallets/proposals/src/impls/pallet_impls.rs index dad41e81..ac3812f7 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -519,63 +519,4 @@ impl Pallet { // } } -impl ImmutableIndividualVotes -{ - // TODO: Test - /// Create a new set of individual votes bound to a set of milestone keys. - /// Instantiates the votes as defaults. - pub(crate) fn new(milestone_keys: BoundedVec) -> Result { - let mut outer_votes: BoundedBTreeMap< - MilestoneKey, - BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, - T::MaxMilestonesPerProject> = BoundedBTreeMap::new(); - - for milestone_key in milestone_keys.iter() { - let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); - // outer_votes and milestone_keys are bounded by the same binding so this will never fail. - outer_votes.try_insert(milestone_key.to_owned(), inner_votes).expect("milestone_keys and outer_votes have been bound by the same binding; qed"); - }; - - // Always set as mutable votes for now. - Ok(Self { - inner: outer_votes, - }) - } - - /// Insert the vote from an individual on a milestone. - pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: &AccountIdOf, vote: bool) -> Result<(), DispatchError> { - if let Some(votes) = self.inner.get_mut(&milestone_key) { - if let Some(_existing_vote) = votes.get_mut(&account_id) { - return Err(Error::::VotesAreImmutable.into()) - } else { - votes.try_insert(account_id.clone(), vote).map_err(|_|Error::::TooManyContributions)?; - } - } else { - return Err(Error::::IndividualVoteNotFound.into()) - } - - Ok(()) - } - - /// Clear the votes for a given milestone. - /// Used when a milestone is submitted. - /// Skips if the milestone is not found. - pub(crate) fn clear_milestone_votes(&mut self, milestone_key: MilestoneKey) { - if let Some(btree) = self.inner.get_mut(&milestone_key) { - *btree = Default::default() - } - } - - /// Take a mutable reference to the inner individual votes item. - pub(crate) fn as_mut(&mut self) -> &mut IndividualVotes { - &mut self.inner - } -} - -impl AsRef> for ImmutableIndividualVotes { - fn as_ref(&self) -> &IndividualVotes { - &self.inner - } -} - diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 5f9e2f08..a77c895b 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -37,7 +37,7 @@ pub use weights::*; pub mod migration; pub mod impls; -pub use impls::*; + pub type ProjectKey = u32; pub type MilestoneKey = u32; pub type IndividualVotes = BoundedBTreeMap< diff --git a/pallets/proposals/src/tests/individual_votes.rs b/pallets/proposals/src/tests/immutable_votes.rs similarity index 100% rename from pallets/proposals/src/tests/individual_votes.rs rename to pallets/proposals/src/tests/immutable_votes.rs diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs index 1db92e45..4d61fd26 100644 --- a/pallets/proposals/src/tests/mod.rs +++ b/pallets/proposals/src/tests/mod.rs @@ -1,2 +1,2 @@ pub mod pallet; -pub mod individual_votes; \ No newline at end of file +pub mod immutable_votes; \ No newline at end of file diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 46a348c7..76958d72 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1159,11 +1159,20 @@ impl_runtime_apis! { ImbueProposals::project_account_id(project_id) } - fn get_project_individuals_votes(project_id: u32) -> Vec { - let individual_votes = ImbueProposals::get_project_individuals_votes(project_id); - as Encode>::encode(&individual_votes) + /// (Project, ImmutableindividualVotes) + fn get_all_project_data(project_key: u32) -> Option<(Vec, Vec)> { + use pallet_proposals::{Project, Projects, ImmutableIndividualVotes, IndividualVoteStore}; + + if let Some(project) = Projects::::get(project_key) { + if let Some(individual_votes) = IndividualVoteStore::::get(project_key) { + Some(( as Encode>::encode(&project), as Encode>::encode(&individual_votes))) + } else { + None + } + } else { + None + } } - } From 15c5f1da615f67d0eed4eb361d61fd68c60fd69e Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:17:41 +0100 Subject: [PATCH 039/192] fmt --- .../proposals/src/impls/immutable_votes.rs | 50 ++++++++------ pallets/proposals/src/impls/mod.rs | 5 +- pallets/proposals/src/impls/pallet_impls.rs | 5 +- pallets/proposals/src/lib.rs | 31 ++++----- pallets/proposals/src/migration.rs | 12 +--- pallets/proposals/src/test_utils.rs | 4 +- .../proposals/src/tests/immutable_votes.rs | 65 ++++++++++++++----- pallets/proposals/src/tests/mod.rs | 2 +- pallets/proposals/src/tests/pallet.rs | 36 +++++++--- 9 files changed, 129 insertions(+), 81 deletions(-) diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs index ee99115f..4168343a 100644 --- a/pallets/proposals/src/impls/immutable_votes.rs +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -1,37 +1,50 @@ use crate::*; -impl ImmutableIndividualVotes -{ +impl ImmutableIndividualVotes { // TODO: Test /// Create a new set of individual votes bound to a set of milestone keys. /// Instantiates the votes as defaults. - pub(crate) fn new(milestone_keys: BoundedVec) -> Result { + pub(crate) fn new( + milestone_keys: BoundedVec, + ) -> Result { let mut outer_votes: BoundedBTreeMap< MilestoneKey, BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, - T::MaxMilestonesPerProject> = BoundedBTreeMap::new(); - + T::MaxMilestonesPerProject, + > = BoundedBTreeMap::new(); + for milestone_key in milestone_keys.iter() { - let inner_votes: BoundedBTreeMap, bool, T::MaximumContributorsPerProject> = BoundedBTreeMap::new(); + let inner_votes: BoundedBTreeMap< + AccountIdOf, + bool, + T::MaximumContributorsPerProject, + > = BoundedBTreeMap::new(); // outer_votes and milestone_keys are bounded by the same binding so this will never fail. - outer_votes.try_insert(milestone_key.to_owned(), inner_votes).expect("milestone_keys and outer_votes have been bound by the same binding; qed"); - }; + outer_votes + .try_insert(milestone_key.to_owned(), inner_votes) + .expect("milestone_keys and outer_votes have been bound by the same binding; qed"); + } // Always set as mutable votes for now. - Ok(Self { - inner: outer_votes, - }) + Ok(Self { inner: outer_votes }) } /// Insert the vote from an individual on a milestone. - pub(crate) fn insert_individual_vote(&mut self, milestone_key: MilestoneKey, account_id: &AccountIdOf, vote: bool) -> Result<(), DispatchError> { - if let Some(votes) = self.inner.get_mut(&milestone_key) { - if let Some(_existing_vote) = votes.get_mut(&account_id) { - return Err(Error::::VotesAreImmutable.into()) + pub(crate) fn insert_individual_vote( + &mut self, + milestone_key: MilestoneKey, + account_id: &AccountIdOf, + vote: bool, + ) -> Result<(), DispatchError> { + if let Some(votes) = self.inner.get_mut(&milestone_key) { + if let Some(_existing_vote) = votes.get_mut(&account_id) { + return Err(Error::::VotesAreImmutable.into()); } else { - votes.try_insert(account_id.clone(), vote).map_err(|_|Error::::TooManyContributions)?; + votes + .try_insert(account_id.clone(), vote) + .map_err(|_| Error::::TooManyContributions)?; } } else { - return Err(Error::::IndividualVoteNotFound.into()) + return Err(Error::::IndividualVoteNotFound.into()); } Ok(()) @@ -43,7 +56,7 @@ impl ImmutableIndividualVotes pub(crate) fn clear_milestone_votes(&mut self, milestone_key: MilestoneKey) { if let Some(btree) = self.inner.get_mut(&milestone_key) { *btree = Default::default() - } + } } /// Take a mutable reference to the inner individual votes item. @@ -57,4 +70,3 @@ impl AsRef> for ImmutableIndividualVotes { &self.inner } } - diff --git a/pallets/proposals/src/impls/mod.rs b/pallets/proposals/src/impls/mod.rs index e4c111c4..47d4888e 100644 --- a/pallets/proposals/src/impls/mod.rs +++ b/pallets/proposals/src/impls/mod.rs @@ -1,6 +1,5 @@ - -pub mod pallet_impls; pub mod immutable_votes; +pub mod pallet_impls; +pub use immutable_votes::*; pub use pallet_impls::*; -pub use immutable_votes::*; \ No newline at end of file diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index ac3812f7..2ad39438 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -48,7 +48,7 @@ impl Pallet { if let Some(individual_votes) = maybe_votes { individual_votes.clear_milestone_votes(milestone_key); } else { - return Err(Error::::IndividualVoteNotFound.into()) + return Err(Error::::IndividualVoteNotFound.into()); }; Ok::<(), DispatchError>(()) })?; @@ -105,7 +105,6 @@ impl Pallet { Err(Error::::VotingRoundNotStarted.into()) } })?; - let funding_threshold: BalanceOf = T::PercentRequiredForVoteToPass::get().mul_floor(project.raised_funds); @@ -518,5 +517,3 @@ impl Pallet { // IndividualVotes { inner: bounded_out } // } } - - diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index a77c895b..5eb31203 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -43,7 +43,8 @@ pub type MilestoneKey = u32; pub type IndividualVotes = BoundedBTreeMap< MilestoneKey, BoundedBTreeMap, bool, ::MaximumContributorsPerProject>, - ::MaxMilestonesPerProject>; + ::MaxMilestonesPerProject, +>; pub type AccountIdOf = ::AccountId; pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; @@ -126,13 +127,8 @@ pub mod pallet { >; #[pallet::storage] - pub type IndividualVoteStore = StorageMap< - _, - Blake2_128Concat, - ProjectKey, - ImmutableIndividualVotes, - OptionQuery, - >; + pub type IndividualVoteStore = + StorageMap<_, Blake2_128Concat, ProjectKey, ImmutableIndividualVotes, OptionQuery>; #[pallet::storage] #[pallet::getter(fn milestone_votes)] @@ -210,7 +206,7 @@ pub mod pallet { VoteSubmitted( T::AccountId, ProjectKey, - MilestoneKey, + MilestoneKey, bool, BlockNumberFor, ), @@ -282,7 +278,7 @@ pub mod pallet { /// There are too many milestone votes, this generally shouldnt be hit. TooManyMilestoneVotes, /// An internal error, a collection of votes for a milestone has been lost.s - IndividualVoteNotFound, + IndividualVoteNotFound, } #[pallet::hooks] @@ -444,12 +440,12 @@ pub mod pallet { FundingType::Grant(_) => {} } - // TODO: this milestone key has no relation to the milestones coming in except the order they come in. // This could be a bug somewhere. let mut milestone_key: u32 = 0; let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); - let mut bounded_milestone_keys: BoundedVec = BoundedVec::new(); + let mut bounded_milestone_keys: BoundedVec = + BoundedVec::new(); for milestone in proposed_milestones { let milestone = Milestone { @@ -461,12 +457,13 @@ pub mod pallet { milestones .try_insert(milestone_key, milestone) .map_err(|_| Error::::TooManyMilestones)?; - - bounded_milestone_keys.try_push(milestone_key) - .map_err(|_| Error::::TooManyMilestones)?; - + + bounded_milestone_keys + .try_push(milestone_key) + .map_err(|_| Error::::TooManyMilestones)?; + milestone_key = milestone_key.saturating_add(1); - }; + } let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys)?; IndividualVoteStore::::insert(project_key, individual_votes); diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 5c9ebfcc..6b07f3c0 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -523,7 +523,7 @@ pub mod v5 { if current == 5 && onchain == Release::V4 { StorageVersion::::kill(); current.put::>(); - + log::warn!("v5 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); } else { @@ -568,12 +568,10 @@ pub mod v6 { OptionQuery, >; - // Since we are keeping the depricated vote of no confidence for the meantime + // Since we are keeping the depricated vote of no confidence for the meantime // only migrate the voting rounds awaiting the migration to remove no confidence rounds. // User votes is now handled by IndividualVoteStore:: - fn migrate_user_has_voted(weight: &mut Weight) { - - } + fn migrate_user_has_voted(weight: &mut Weight) {} /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 fn migrate_milestone_votes(weight: &mut Weight) { @@ -628,7 +626,6 @@ pub mod v6 { let current = as GetStorageVersion>::current_storage_version(); let onchain = as GetStorageVersion>::on_chain_storage_version(); if current == 6 && onchain == 5 { - // Migrations migrate_milestone_votes::(&mut weight); migrate_user_has_voted::(&mut weight); @@ -656,11 +653,8 @@ pub mod v6 { Ok(()) } } - } - - #[cfg(test)] mod test { use super::*; diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index f1ceca4f..7c508b41 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -92,7 +92,8 @@ pub fn create_project( let mut milestone_key: u32 = 0; let mut milestones: BTreeMap = BTreeMap::new(); - let mut bounded_milestone_keys: BoundedVec = BoundedVec::new(); + let mut bounded_milestone_keys: BoundedVec = + BoundedVec::new(); for ms in proposed_milestones { let milestone = Milestone { @@ -109,7 +110,6 @@ pub fn create_project( let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys).unwrap(); IndividualVoteStore::::insert(project_key, individual_votes); - let project = Project { milestones: milestones.try_into().expect("too many milestones"), contributions, diff --git a/pallets/proposals/src/tests/immutable_votes.rs b/pallets/proposals/src/tests/immutable_votes.rs index c50e6b88..e336adb0 100644 --- a/pallets/proposals/src/tests/immutable_votes.rs +++ b/pallets/proposals/src/tests/immutable_votes.rs @@ -1,64 +1,97 @@ -use frame_support::{assert_noop, assert_ok}; +use crate::{mock::*, *}; use common_types::CurrencyId; +use frame_support::{assert_noop, assert_ok}; use test_utils::*; -use crate::{mock::*, *}; #[test] fn individual_votes_new_inserts_all_milestone_keys() { build_test_externality().execute_with(|| { - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); let i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); for key in milestone_keys { - assert!(i.as_ref().get(&key).unwrap().is_empty(), "A milestone key should have been inserted, and the map must be empty."); - } + assert!( + i.as_ref().get(&key).unwrap().is_empty(), + "A milestone key should have been inserted, and the map must be empty." + ); + } }) } #[test] fn individual_votes_insert_vote_works() { build_test_externality().execute_with(|| { - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); assert_ok!(i.insert_individual_vote(voting_key, &ALICE, true)); assert_ok!(i.insert_individual_vote(voting_key, &BOB, false)); - assert_eq!(i.as_ref().get(&voting_key).unwrap().get(&ALICE).unwrap(), &true, "ALICE vote should exist and been voted true,"); - assert_eq!(i.as_ref().get(&voting_key).unwrap().get(&BOB).unwrap(), &false, "BOB vote should exist and been voted false."); + assert_eq!( + i.as_ref().get(&voting_key).unwrap().get(&ALICE).unwrap(), + &true, + "ALICE vote should exist and been voted true," + ); + assert_eq!( + i.as_ref().get(&voting_key).unwrap().get(&BOB).unwrap(), + &false, + "BOB vote should exist and been voted false." + ); }) } - #[test] fn individual_votes_votes_are_immutable() { build_test_externality().execute_with(|| { - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); - assert_noop!(i.insert_individual_vote(voting_key, &ALICE, false), Error::::VotesAreImmutable); + assert_noop!( + i.insert_individual_vote(voting_key, &ALICE, false), + Error::::VotesAreImmutable + ); }) } #[test] fn individual_votes_cannot_vote_on_non_existant_milestone() { build_test_externality().execute_with(|| { - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); let voting_key = 4; let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); - assert_noop!(i.insert_individual_vote(voting_key, &ALICE, true), Error::::IndividualVoteNotFound); + assert_noop!( + i.insert_individual_vote(voting_key, &ALICE, true), + Error::::IndividualVoteNotFound + ); }) } #[test] fn individual_votes_clear_votes_actually_clears() { build_test_externality().execute_with(|| { - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = vec![0, 1, 2, 3].try_into().expect("should be smaller than bound."); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); i.insert_individual_vote(voting_key, &BOB, true).unwrap(); i.clear_milestone_votes(voting_key); - assert!(i.as_ref().get(&voting_key).unwrap().is_empty(), "The btree should have been emptied after a cleared vote."); + assert!( + i.as_ref().get(&voting_key).unwrap().is_empty(), + "The btree should have been emptied after a cleared vote." + ); }) } - diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs index 4d61fd26..0e42d240 100644 --- a/pallets/proposals/src/tests/mod.rs +++ b/pallets/proposals/src/tests/mod.rs @@ -1,2 +1,2 @@ +pub mod immutable_votes; pub mod pallet; -pub mod immutable_votes; \ No newline at end of file diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index b6415c11..b7992104 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -225,8 +225,14 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - individual_votes.as_ref().get(&milestone_key).unwrap().get(&BOB).unwrap() == &true, - "IndividualVotesStore has not been mutated correctly." + individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .get(&BOB) + .unwrap() + == &true, + "IndividualVotesStore has not been mutated correctly." ); // Assert the storage has been cleared up after finalisation @@ -246,9 +252,11 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { "This vec should have been emptied on auto finalisation." ); let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); - assert!( - !individual_votes.as_ref().get(&milestone_key).unwrap().contains_key(&BOB) - ); + assert!(!individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .contains_key(&BOB)); }); } @@ -282,8 +290,14 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - individual_votes.as_ref().get(&milestone_key).unwrap().get(&BOB).unwrap() == &false, - "IndividualVotesStore has not been mutated correctly." + individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .get(&BOB) + .unwrap() + == &false, + "IndividualVotesStore has not been mutated correctly." ); // Assert the storage has been cleared up after finalisation assert_ok!(Proposals::vote_on_milestone( @@ -302,9 +316,11 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { "This vec should have been emptied on auto finalisation." ); let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); - assert!( - !individual_votes.as_ref().get(&milestone_key).unwrap().contains_key(&BOB) - ); + assert!(!individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .contains_key(&BOB)); }); } From e0989aa03fac16224c5dcc4dc3b46c6f7e772def Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:18:18 +0100 Subject: [PATCH 040/192] fmt --- pallets/proposals/src/impls/immutable_votes.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs index 4168343a..4c12fa86 100644 --- a/pallets/proposals/src/impls/immutable_votes.rs +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -60,6 +60,7 @@ impl ImmutableIndividualVotes { } /// Take a mutable reference to the inner individual votes item. + #[allow(dead_code)] pub(crate) fn as_mut(&mut self) -> &mut IndividualVotes { &mut self.inner } From 31c9ff4dc39cf8e9f84edd93ddbd283e537e0ab6 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:19:25 +0100 Subject: [PATCH 041/192] clippy --- pallets/proposals/src/impls/immutable_votes.rs | 3 ++- pallets/proposals/src/migration.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs index 4c12fa86..d3353087 100644 --- a/pallets/proposals/src/impls/immutable_votes.rs +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -3,6 +3,7 @@ impl ImmutableIndividualVotes { // TODO: Test /// Create a new set of individual votes bound to a set of milestone keys. /// Instantiates the votes as defaults. + #[allow(clippy::type_complexity)] pub(crate) fn new( milestone_keys: BoundedVec, ) -> Result { @@ -36,7 +37,7 @@ impl ImmutableIndividualVotes { vote: bool, ) -> Result<(), DispatchError> { if let Some(votes) = self.inner.get_mut(&milestone_key) { - if let Some(_existing_vote) = votes.get_mut(&account_id) { + if let Some(_existing_vote) = votes.get_mut(account_id) { return Err(Error::::VotesAreImmutable.into()); } else { votes diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 6b07f3c0..d014179b 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -571,7 +571,7 @@ pub mod v6 { // Since we are keeping the depricated vote of no confidence for the meantime // only migrate the voting rounds awaiting the migration to remove no confidence rounds. // User votes is now handled by IndividualVoteStore:: - fn migrate_user_has_voted(weight: &mut Weight) {} + fn migrate_user_has_voted(_weight: &mut Weight) {} /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 fn migrate_milestone_votes(weight: &mut Weight) { From 8d32458cf53404373e5c101113eef0431cb0603d Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:31:58 +0100 Subject: [PATCH 042/192] migration, err handling --- pallets/proposals/src/impls/pallet_impls.rs | 44 +++------------------ pallets/proposals/src/migration.rs | 13 +++++- 2 files changed, 17 insertions(+), 40 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 2ad39438..d9f5e1b6 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -472,48 +472,14 @@ impl Pallet { // Prevent hook from calling. RoundsExpiring::::remove(exp_block); // Allow future votes to occur on this milestone - IndividualVoteStore::::mutate(project_key, |maybe_individual_votes| { + IndividualVoteStore::::trymutate(project_key, |maybe_individual_votes| { if let Some(individual_votes) = maybe_individual_votes { individual_votes.clear_milestone_votes(user_has_voted_key.2); + } else { + return Err(Error::::IndividualVoteNotFound.into()) } - }); + })?; + Ok(()) } - - // Get the individual votes of a project, return an empty map on error. - // #[allow(clippy::type_complexity)] - // pub fn get_project_individuals_votes( - // project_key: ProjectKey, - // ) -> IndividualVotes { - // let mut out = BTreeMap::new(); - // if let Some(project) = Projects::::get(project_key) { - // project.milestones.keys().for_each(|milestone_key| { - // let user_votes = - // UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)); - // let mut inner: BTreeMap, (bool, BalanceOf)> = BTreeMap::new(); - // user_votes.into_iter().for_each(|(acc, boolean_vote)| { - // inner.insert(acc, boolean_vote) - // }); - // let bounded_inner: BoundedBTreeMap< - // AccountIdOf, - // (bool, BalanceOf), - // T::MaximumContributorsPerProject, - // > = match inner.try_into() { - // Ok(b) => b, - // Err(_) => BoundedBTreeMap::new(), - // }; - // out.insert(milestone_key.to_owned(), bounded_inner); - // }) - // } - // let bounded_out: BoundedBTreeMap< - // MilestoneKey, - // BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, - // T::MaxMilestonesPerProject, - // > = match out.try_into() { - // Ok(b) => b, - // Err(_) => BoundedBTreeMap::new(), - // }; - - // IndividualVotes { inner: bounded_out } - // } } diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index d014179b..47d602b0 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -571,7 +571,18 @@ pub mod v6 { // Since we are keeping the depricated vote of no confidence for the meantime // only migrate the voting rounds awaiting the migration to remove no confidence rounds. // User votes is now handled by IndividualVoteStore:: - fn migrate_user_has_voted(_weight: &mut Weight) {} + fn migrate_user_has_voted(weight: &mut Weight) { + let mut out = BTreeMap::new(); + Projects::::iter().for_each(project_key, { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + project.milestones.keys().for_each(|milestone_key| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); + }) + IndividualVoteStore::::insert(project_key, ) + + }) + } /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 fn migrate_milestone_votes(weight: &mut Weight) { From af03d540c694786ef231f86ff81980d426f5e58a Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:55:30 +0100 Subject: [PATCH 043/192] fix migration --- pallets/proposals/src/impls/immutable_votes.rs | 4 ++-- pallets/proposals/src/impls/pallet_impls.rs | 5 +++-- pallets/proposals/src/lib.rs | 2 +- pallets/proposals/src/migration.rs | 14 +++++++++----- pallets/proposals/src/tests/immutable_votes.rs | 10 +++++----- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs index d3353087..cf46f43a 100644 --- a/pallets/proposals/src/impls/immutable_votes.rs +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -6,7 +6,7 @@ impl ImmutableIndividualVotes { #[allow(clippy::type_complexity)] pub(crate) fn new( milestone_keys: BoundedVec, - ) -> Result { + ) -> Self { let mut outer_votes: BoundedBTreeMap< MilestoneKey, BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, @@ -26,7 +26,7 @@ impl ImmutableIndividualVotes { } // Always set as mutable votes for now. - Ok(Self { inner: outer_votes }) + Self { inner: outer_votes } } /// Insert the vote from an individual on a milestone. diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index d9f5e1b6..eabf6d73 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -472,14 +472,15 @@ impl Pallet { // Prevent hook from calling. RoundsExpiring::::remove(exp_block); // Allow future votes to occur on this milestone - IndividualVoteStore::::trymutate(project_key, |maybe_individual_votes| { + IndividualVoteStore::::try_mutate(project_key, |maybe_individual_votes| { if let Some(individual_votes) = maybe_individual_votes { individual_votes.clear_milestone_votes(user_has_voted_key.2); } else { return Err(Error::::IndividualVoteNotFound.into()) } + Ok::<(), DispatchError>(()) })?; - + Ok(()) } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 5eb31203..2c42f26c 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -465,7 +465,7 @@ pub mod pallet { milestone_key = milestone_key.saturating_add(1); } - let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys)?; + let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys); IndividualVoteStore::::insert(project_key, individual_votes); let bounded_contributions: ContributionsFor = contributions diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 47d602b0..5af291b0 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -572,15 +572,19 @@ pub mod v6 { // only migrate the voting rounds awaiting the migration to remove no confidence rounds. // User votes is now handled by IndividualVoteStore:: fn migrate_user_has_voted(weight: &mut Weight) { - let mut out = BTreeMap::new(); - Projects::::iter().for_each(project_key, { + Projects::::iter().for_each(|(project_key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); project.milestones.keys().for_each(|milestone_key| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); - }) - IndividualVoteStore::::insert(project_key, ) - + if let Some(expiry) = Rounds::::take((project_key, milestone_key), RoundType::VotingRound) { + RoundsExpiring::::remove(expiry); + }; + }); + let bounded_keys: BoundedVec = project.milestones.keys().copied().collect::>().try_into().expect("milestone keys and bounded keys have the same bound; qed"); + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + let individual_votes = ImmutableIndividualVotes::::new(bounded_keys); + IndividualVoteStore::::insert(project_key, individual_votes); }) } diff --git a/pallets/proposals/src/tests/immutable_votes.rs b/pallets/proposals/src/tests/immutable_votes.rs index e336adb0..99e0b752 100644 --- a/pallets/proposals/src/tests/immutable_votes.rs +++ b/pallets/proposals/src/tests/immutable_votes.rs @@ -10,7 +10,7 @@ fn individual_votes_new_inserts_all_milestone_keys() { vec![0, 1, 2, 3] .try_into() .expect("should be smaller than bound."); - let i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + let i = ImmutableIndividualVotes::::new(milestone_keys.clone()); for key in milestone_keys { assert!( i.as_ref().get(&key).unwrap().is_empty(), @@ -28,7 +28,7 @@ fn individual_votes_insert_vote_works() { .try_into() .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); assert_ok!(i.insert_individual_vote(voting_key, &ALICE, true)); assert_ok!(i.insert_individual_vote(voting_key, &BOB, false)); assert_eq!( @@ -52,7 +52,7 @@ fn individual_votes_votes_are_immutable() { .try_into() .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); assert_noop!( i.insert_individual_vote(voting_key, &ALICE, false), @@ -69,7 +69,7 @@ fn individual_votes_cannot_vote_on_non_existant_milestone() { .try_into() .expect("should be smaller than bound."); let voting_key = 4; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); assert_noop!( i.insert_individual_vote(voting_key, &ALICE, true), Error::::IndividualVoteNotFound @@ -85,7 +85,7 @@ fn individual_votes_clear_votes_actually_clears() { .try_into() .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()).unwrap(); + let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); i.insert_individual_vote(voting_key, &BOB, true).unwrap(); i.clear_milestone_votes(voting_key); From 57f379a7d8fff18f3388461d18d73c1910785249 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:55:47 +0100 Subject: [PATCH 044/192] fmt --- pallets/proposals/src/impls/pallet_impls.rs | 2 +- pallets/proposals/src/migration.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index eabf6d73..33c59203 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -476,7 +476,7 @@ impl Pallet { if let Some(individual_votes) = maybe_individual_votes { individual_votes.clear_milestone_votes(user_has_voted_key.2); } else { - return Err(Error::::IndividualVoteNotFound.into()) + return Err(Error::::IndividualVoteNotFound.into()); } Ok::<(), DispatchError>(()) })?; diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 5af291b0..9155d63d 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -572,16 +572,24 @@ pub mod v6 { // only migrate the voting rounds awaiting the migration to remove no confidence rounds. // User votes is now handled by IndividualVoteStore:: fn migrate_user_has_voted(weight: &mut Weight) { - Projects::::iter().for_each(|(project_key, project)|{ + Projects::::iter().for_each(|(project_key, project)| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); project.milestones.keys().for_each(|milestone_key| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); - if let Some(expiry) = Rounds::::take((project_key, milestone_key), RoundType::VotingRound) { + if let Some(expiry) = + Rounds::::take((project_key, milestone_key), RoundType::VotingRound) + { RoundsExpiring::::remove(expiry); }; }); - let bounded_keys: BoundedVec = project.milestones.keys().copied().collect::>().try_into().expect("milestone keys and bounded keys have the same bound; qed"); + let bounded_keys: BoundedVec = project + .milestones + .keys() + .copied() + .collect::>() + .try_into() + .expect("milestone keys and bounded keys have the same bound; qed"); *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); let individual_votes = ImmutableIndividualVotes::::new(bounded_keys); IndividualVoteStore::::insert(project_key, individual_votes); From ca92226538bd85757beed07876c83f9b22e4da25 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:56:43 +0100 Subject: [PATCH 045/192] fix --- pallets/proposals/src/test_utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index 7c508b41..8e278366 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -107,7 +107,7 @@ pub fn create_project( milestone_key = milestone_key.saturating_add(1); } - let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys).unwrap(); + let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys); IndividualVoteStore::::insert(project_key, individual_votes); let project = Project { From c8000da2d4bafe59825757c44f37c9d1c67a60b2 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 10:57:44 +0100 Subject: [PATCH 046/192] clippy --- pallets/proposals/src/tests/immutable_votes.rs | 12 ++++++------ runtime/imbue-kusama/src/lib.rs | 6 +----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pallets/proposals/src/tests/immutable_votes.rs b/pallets/proposals/src/tests/immutable_votes.rs index 99e0b752..eef57c66 100644 --- a/pallets/proposals/src/tests/immutable_votes.rs +++ b/pallets/proposals/src/tests/immutable_votes.rs @@ -1,7 +1,7 @@ use crate::{mock::*, *}; -use common_types::CurrencyId; + use frame_support::{assert_noop, assert_ok}; -use test_utils::*; + #[test] fn individual_votes_new_inserts_all_milestone_keys() { @@ -28,7 +28,7 @@ fn individual_votes_insert_vote_works() { .try_into() .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); + let mut i = ImmutableIndividualVotes::::new(milestone_keys); assert_ok!(i.insert_individual_vote(voting_key, &ALICE, true)); assert_ok!(i.insert_individual_vote(voting_key, &BOB, false)); assert_eq!( @@ -52,7 +52,7 @@ fn individual_votes_votes_are_immutable() { .try_into() .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); + let mut i = ImmutableIndividualVotes::::new(milestone_keys); i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); assert_noop!( i.insert_individual_vote(voting_key, &ALICE, false), @@ -69,7 +69,7 @@ fn individual_votes_cannot_vote_on_non_existant_milestone() { .try_into() .expect("should be smaller than bound."); let voting_key = 4; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); + let mut i = ImmutableIndividualVotes::::new(milestone_keys); assert_noop!( i.insert_individual_vote(voting_key, &ALICE, true), Error::::IndividualVoteNotFound @@ -85,7 +85,7 @@ fn individual_votes_clear_votes_actually_clears() { .try_into() .expect("should be smaller than bound."); let voting_key = milestone_keys[0]; - let mut i = ImmutableIndividualVotes::::new(milestone_keys.clone()); + let mut i = ImmutableIndividualVotes::::new(milestone_keys); i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); i.insert_individual_vote(voting_key, &BOB, true).unwrap(); i.clear_milestone_votes(voting_key); diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 76958d72..e467574d 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1164,11 +1164,7 @@ impl_runtime_apis! { use pallet_proposals::{Project, Projects, ImmutableIndividualVotes, IndividualVoteStore}; if let Some(project) = Projects::::get(project_key) { - if let Some(individual_votes) = IndividualVoteStore::::get(project_key) { - Some(( as Encode>::encode(&project), as Encode>::encode(&individual_votes))) - } else { - None - } + IndividualVoteStore::::get(project_key).map(|individual_votes| ( as Encode>::encode(&project), as Encode>::encode(&individual_votes))) } else { None } From ceb62b730ee7f3c84aa9e000d17279dfad97ad54 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 11:05:04 +0100 Subject: [PATCH 047/192] update executive and spec version --- runtime/imbue-kusama/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index e467574d..1879ff00 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -100,7 +100,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("imbue"), impl_name: create_runtime_str!("imbue"), authoring_version: 2, - spec_version: 9433, + spec_version: 9434, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -181,9 +181,7 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( - pallet_proposals::migration::v5::MigrateToV5, - pallet_briefs::migrations::v2::MigrateToV2, - pallet_grants::migrations::v3::MigrateToV3, + pallet_proposals::migration::v6::MigrateToV6, ); } From d29530843ee16ec1b15de3d762671fdca98ffe3e Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 11:06:48 +0100 Subject: [PATCH 048/192] fmt --- pallets/proposals/src/tests/immutable_votes.rs | 1 - runtime/imbue-kusama/src/lib.rs | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pallets/proposals/src/tests/immutable_votes.rs b/pallets/proposals/src/tests/immutable_votes.rs index eef57c66..71ef84fc 100644 --- a/pallets/proposals/src/tests/immutable_votes.rs +++ b/pallets/proposals/src/tests/immutable_votes.rs @@ -2,7 +2,6 @@ use crate::{mock::*, *}; use frame_support::{assert_noop, assert_ok}; - #[test] fn individual_votes_new_inserts_all_milestone_keys() { build_test_externality().execute_with(|| { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 1879ff00..70f92919 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -180,9 +180,7 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - pallet_proposals::migration::v6::MigrateToV6, - ); + pub type Unreleased = (pallet_proposals::migration::v6::MigrateToV6,); } /// Executive: handles dispatch to the various modules. From 79f6966a6ac82103fe6b50f1d9a326269aebce56 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 11:08:56 +0100 Subject: [PATCH 049/192] remove todos --- pallets/proposals/src/impls/immutable_votes.rs | 1 - pallets/proposals/src/lib.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs index cf46f43a..93ceee38 100644 --- a/pallets/proposals/src/impls/immutable_votes.rs +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -1,6 +1,5 @@ use crate::*; impl ImmutableIndividualVotes { - // TODO: Test /// Create a new set of individual votes bound to a set of milestone keys. /// Instantiates the votes as defaults. #[allow(clippy::type_complexity)] diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 2c42f26c..22404984 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -512,7 +512,6 @@ pub enum RoundType { /// The milestones provided by the user to define the milestones of a project. /// TODO: add ipfs hash like in the grants pallet and /// TODO: move these to a common repo (common_types will do) -// MIGRATION! for briefs and grants #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub struct ProposedMilestone { pub percentage_to_unlock: Percent, @@ -580,7 +579,6 @@ pub struct Whitelist { max_cap: Balance, } -// TODO: migrate so that current projects contain an individual vote that correctly represents the current state. /// Stores the btree for each individual vote. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] From 0470140c25929b9fe3cc6d2f34cbf7a2c38fdba8 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 27 Sep 2023 11:27:56 +0100 Subject: [PATCH 050/192] remove wrong comment --- pallets/proposals/src/impls/immutable_votes.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs index 93ceee38..da9904c7 100644 --- a/pallets/proposals/src/impls/immutable_votes.rs +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -24,7 +24,6 @@ impl ImmutableIndividualVotes { .expect("milestone_keys and outer_votes have been bound by the same binding; qed"); } - // Always set as mutable votes for now. Self { inner: outer_votes } } From 15a044c1b47b4927164ccc4e384b7a340847ce19 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 28 Sep 2023 09:21:58 +0100 Subject: [PATCH 051/192] fix failing test --- pallets/proposals/src/tests/pallet.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index b7992104..c330ef65 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -232,7 +232,7 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { .get(&BOB) .unwrap() == &true, - "IndividualVotesStore has not been mutated correctly." + "IndividualVoteStore has not been mutated correctly." ); // Assert the storage has been cleared up after finalisation @@ -297,7 +297,7 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { .get(&BOB) .unwrap() == &false, - "IndividualVotesStore has not been mutated correctly." + "IndividualVoteStore has not been mutated correctly." ); // Assert the storage has been cleared up after finalisation assert_ok!(Proposals::vote_on_milestone( @@ -1176,15 +1176,22 @@ fn close_voting_round_works() { .try_into() .expect("smaller than bound: qed."); RoundsExpiring::::insert(100, r_expiring); - UserHasVoted::::insert((0, RoundType::VotingRound, 0), BoundedBTreeMap::new()); + + let milestone_keys = vec![0]; + let mut i_v = ImmutableIndividualVotes::::new(milestone_keys.try_into().unwrap()); + assert_ok!(i_v.insert_individual_vote(0, &ALICE, true)); + IndividualVoteStore::::insert(0, i_v); assert_ok!(crate::Pallet::::close_voting_round( 0, (0, RoundType::VotingRound, 0) )); + assert!(Rounds::::get((0, 0), RoundType::VotingRound).is_none()); assert!(RoundsExpiring::::get(100).len() == 0); - assert!(UserHasVoted::::get((0, RoundType::VotingRound, 0)).is_empty()); + let individual_votes = IndividualVoteStore::::get(0); + assert!(individual_votes.is_some()); + assert!(individual_votes.unwrap().as_ref().get(&0).unwrap().is_empty()); }) } From 5e6f7979a831080f378ee1f13a3eeba68dce9bf9 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 28 Sep 2023 09:26:10 +0100 Subject: [PATCH 052/192] fmt --- pallets/proposals/src/tests/pallet.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index c330ef65..895827e3 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -1176,7 +1176,7 @@ fn close_voting_round_works() { .try_into() .expect("smaller than bound: qed."); RoundsExpiring::::insert(100, r_expiring); - + let milestone_keys = vec![0]; let mut i_v = ImmutableIndividualVotes::::new(milestone_keys.try_into().unwrap()); assert_ok!(i_v.insert_individual_vote(0, &ALICE, true)); @@ -1191,7 +1191,12 @@ fn close_voting_round_works() { assert!(RoundsExpiring::::get(100).len() == 0); let individual_votes = IndividualVoteStore::::get(0); assert!(individual_votes.is_some()); - assert!(individual_votes.unwrap().as_ref().get(&0).unwrap().is_empty()); + assert!(individual_votes + .unwrap() + .as_ref() + .get(&0) + .unwrap() + .is_empty()); }) } From 283a617bab0d25f949489961c1b0ecba0e280ca1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 28 Sep 2023 13:15:09 +0100 Subject: [PATCH 053/192] rip the proposals changes --- pallets/proposals/Cargo.toml | 2 + pallets/proposals/src/benchmarking.rs | 3 +- pallets/proposals/src/impls.rs | 203 ++++++++++++++--------- pallets/proposals/src/lib.rs | 177 +++++++++++++------- pallets/proposals/src/mock.rs | 41 +++-- pallets/proposals/src/test_utils.rs | 117 +++++++------- pallets/proposals/src/tests.rs | 224 +++++++++++++++++++++----- pallets/proposals/src/todo | 8 + pallets/proposals/src/traits.rs | 48 +++--- 9 files changed, 546 insertions(+), 277 deletions(-) create mode 100644 pallets/proposals/src/todo diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 5afbe089..e4a12f64 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -46,6 +46,7 @@ orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-l common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } pallet-deposits = { path = "../deposits", default-features = false } +pallet-fellowship = { path = "../fellowship", default-features = false } [dev-dependencies] orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43"} @@ -59,6 +60,7 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} common-runtime = { path = "../../runtime/common"} +pallet-fellowship = { path = "../fellowship"} [features] default = ['std'] diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index e1384e4a..59902707 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -17,6 +17,7 @@ use sp_std::convert::TryInto; ::AccountId: AsRef<[u8]>, ::BlockNumber: From, )] + mod benchmarks { use super::*; @@ -51,7 +52,7 @@ mod benchmarks { let prop_milestones = get_max_milestones::(); let project_key = create_project::( alice.clone(), - contributions, + z contributions, prop_milestones, CurrencyId::Native, ); diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls.rs index 35349bb8..719c4141 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls.rs @@ -121,6 +121,7 @@ impl Pallet { ensure!(!project.cancelled, Error::::ProjectWithdrawn); ensure!(who == project.initiator, Error::::UserIsNotInitiator); + // Collect and calculate the amount that can be withdrawn. let mut unlocked_funds: BalanceOf = Zero::zero(); for (_, ms) in project.milestones.iter() { if ms.is_approved { @@ -137,13 +138,12 @@ impl Pallet { let fee = ::ImbueFee::get().mul_floor(withdrawable); let withdrawn = withdrawable.saturating_sub(fee); - let project_account = Self::project_account_id(project_key); - let pallet_account = Self::account_id(); - // Take the fee - T::MultiCurrency::transfer(project.currency_id, &project_account, &pallet_account, fee)?; + //TODO: Fee is not taken. + let pallet_account = Self::account_id(); + // Transfer to initiator T::MultiCurrency::transfer( project.currency_id, &project_account, @@ -151,6 +151,7 @@ impl Pallet { withdrawn, )?; + // Remove the project if the funds left are 0. Projects::::mutate_exists(project_key, |project| -> DispatchResult { if let Some(p) = project { p.withdrawn_funds = p.withdrawn_funds.saturating_add(withdrawable); @@ -234,7 +235,8 @@ impl Pallet { } /// Allows a contributer to agree or disagree with a vote of no confidence. - pub(crate) fn add_vote_no_confidence( + #[deprecated(since = "3.1.0", note = "Will be handled in pallet-dispute.")] + pub fn add_vote_no_confidence( who: T::AccountId, project_key: ProjectKey, is_yay: bool, @@ -290,42 +292,42 @@ impl Pallet { let project_account_id = Self::project_account_id(project_key); - match project.funding_type { - FundingType::Proposal => { - // Handle refunds on native chain, there is no need to deal with xcm here. - for (acc_id, contribution) in project.contributions.iter() { - let refund_amount = - locked_milestone_percentage.mul_floor(contribution.value); - ::MultiCurrency::transfer( - project.currency_id, - &project_account_id, - acc_id, - refund_amount, - )?; - } - } - - FundingType::Brief => { - //Have to handle it in the dispute pallet - } - - // Must a grant be treasury funded? - FundingType::Grant(_) => { - let mut refund_amount: BalanceOf = Zero::zero(); - // Sum the contributions and send a single xcm. - for (_acc_id, contribution) in project.contributions.iter() { - let per_contributor = - locked_milestone_percentage.mul_floor(contribution.value); - refund_amount = refund_amount.saturating_add(per_contributor); - } - ::RefundHandler::send_refund_message_to_treasury( - project_account_id, - refund_amount, - project.currency_id, - project.funding_type, - )?; - } - } + // match project.funding_type { + // FundingType::Proposal => { + // // Handle refunds on native chain, there is no need to deal with xcm here. + // for (acc_id, contribution) in project.contributions.iter() { + // let refund_amount = + // locked_milestone_percentage.mul_floor(contribution.value); + // ::MultiCurrency::transfer( + // project.currency_id, + // &project_account_id, + // acc_id, + // refund_amount, + // )?; + // } + // } + + // FundingType::Brief => { + // //Have to handle it in the dispute pallet + // } + + // // Must a grant be treasury funded? + // FundingType::Grant(_) => { + // let mut refund_amount: BalanceOf = Zero::zero(); + // // Sum the contributions and send a single xcm. + // for (_acc_id, contribution) in project.contributions.iter() { + // let per_contributor = + // locked_milestone_percentage.mul_floor(contribution.value); + // refund_amount = refund_amount.saturating_add(per_contributor); + // } + // ::RefundHandler::send_refund_message_to_treasury( + // project_account_id, + // refund_amount, + // project.currency_id, + // project.funding_type, + // )?; + // } + // } Projects::::remove(project_key); Rounds::::remove((project_key, 0), RoundType::VoteOfNoConfidence); ::DepositHandler::return_deposit(project.deposit_id)?; @@ -366,39 +368,39 @@ impl Pallet { let project_account_id = Self::project_account_id(project_key); // TODO: this should be generic and not bound to funding type.. - match project.funding_type { - FundingType::Brief | FundingType::Proposal => { - // - // Handle refunds on native chain, there is no need to deal with xcm here. - // Todo: Batch call using pallet-utility? - for (acc_id, contribution) in project.contributions.iter() { - let refund_amount = - locked_milestone_percentage.mul_floor(contribution.value); - ::MultiCurrency::transfer( - project.currency_id, - &project_account_id, - acc_id, - refund_amount, - )?; - } - } - // Must a grant be treasury funded? - FundingType::Grant(_) => { - let mut refund_amount: BalanceOf = Zero::zero(); - // Sum the contributions and send a single xcm. - for (_acc_id, contribution) in project.contributions.iter() { - let per_contributor = - locked_milestone_percentage.mul_floor(contribution.value); - refund_amount = refund_amount.saturating_add(per_contributor); - } - ::RefundHandler::send_refund_message_to_treasury( - project_account_id, - refund_amount, - project.currency_id, - project.funding_type, - )?; - } - } + // match project.funding_type { + // FundingType::Brief | FundingType::Proposal => { + // // + // // Handle refunds on native chain, there is no need to deal with xcm here. + // // Todo: Batch call using pallet-utility? + // for (acc_id, contribution) in project.contributions.iter() { + // let refund_amount = + // locked_milestone_percentage.mul_floor(contribution.value); + // ::MultiCurrency::transfer( + // project.currency_id, + // &project_account_id, + // acc_id, + // refund_amount, + // )?; + // } + // } + // // Must a grant be treasury funded? + // FundingType::Grant(_) => { + // let mut refund_amount: BalanceOf = Zero::zero(); + // // Sum the contributions and send a single xcm. + // for (_acc_id, contribution) in project.contributions.iter() { + // let per_contributor = + // locked_milestone_percentage.mul_floor(contribution.value); + // refund_amount = refund_amount.saturating_add(per_contributor); + // } + // ::RefundHandler::send_refund_message_to_treasury( + // project_account_id, + // refund_amount, + // project.currency_id, + // project.funding_type, + // )?; + // } + // } Projects::::remove(project_key); ::DepositHandler::return_deposit(project.deposit_id)?; @@ -409,6 +411,59 @@ impl Pallet { Ok(().into()) } + // TODO: test + /// Try and fund a project based on its FundingPath. + /// If the funds have actually been transferred this will return and Ok(true) + /// If the funds have not been transferred (i.e awaiting funding) then it will return Ok(false) + pub(crate) fn fund_project<'a>( + funding_path: &'a FundingPath, + contributions: &'a BTreeMap, Contribution, BlockNumberFor>>, + project_account_id: &'a T::AccountId, + currency_id: CurrencyId, + ) -> Result { + match *funding_path { + FundingPath::TakeFromReserved => { + for (acc, cont) in contributions.iter() { + <::MultiCurrency as MultiReservableCurrency< + AccountIdOf, + >>::unreserve(currency_id, acc, cont.value); + ::MultiCurrency::transfer( + currency_id, + acc, + project_account_id, + cont.value, + )?; + } + Ok(true) + } + FundingPath::WaitForFunding => Ok(false), + } + } + + // TODO: Test + /// Try and convert some proposed milestones to milestones. + /// Fails when the MaxMilestones bound is not respected + pub(crate) fn try_convert_to_milestones( + proposed_milestones: BoundedVec, + project_key: ProjectKey, + ) -> Result, DispatchError> { + let mut milestone_key: u32 = 0; + let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); + for milestone in proposed_milestones { + let milestone = Milestone { + project_key, + milestone_key, + percentage_to_unlock: milestone.percentage_to_unlock, + is_approved: false, + }; + milestones + .try_insert(milestone_key, milestone) + .map_err(|_| Error::::TooManyMilestones)?; + milestone_key = milestone_key.saturating_add(1); + } + Ok(milestones) + } + pub(crate) fn try_auto_finalise_milestone_voting( project_key: ProjectKey, vote: &Vote>, diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 6b483e2e..7a06572f 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -1,6 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode}; +use common_traits::MaybeConvert; use common_types::{CurrencyId, FundingType}; use frame_support::{ dispatch::EncodeLike, pallet_prelude::*, storage::bounded_btree_map::BoundedBTreeMap, @@ -10,11 +11,13 @@ use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; pub use pallet::*; use pallet_deposits::traits::DepositHandler; +use pallet_fellowship::{traits::EnsureRole, Role}; use scale_info::TypeInfo; use sp_arithmetic::per_things::Percent; use sp_core::H256; -use sp_runtime::traits::{AccountIdConversion, Saturating, Zero}; +use sp_runtime::traits::{AccountIdConversion, Convert, One, Saturating, Zero}; use sp_std::{collections::btree_map::*, convert::TryInto, prelude::*}; +use xcm::latest::MultiLocation; pub mod traits; use traits::{IntoProposal, RefundHandler}; @@ -34,13 +37,16 @@ pub(crate) mod tests; pub mod weights; pub use weights::*; -pub mod migration; +//pub mod migration; pub mod impls; pub use impls::*; + pub type ProjectKey = u32; pub type MilestoneKey = u32; pub type AccountIdOf = ::AccountId; +type VetterIdOf = AccountIdOf; + pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; pub type StorageItemOf = <::DepositHandler as DepositHandler, AccountIdOf>>::StorageItem; @@ -73,6 +79,7 @@ pub mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; type PalletId: Get; type AuthorityOrigin: EnsureOrigin; + /// The currency type. type MultiCurrency: MultiReservableCurrency, CurrencyId = CurrencyId>; type WeightInfo: WeightInfoT; type MaxWithdrawalExpiration: Get>; @@ -86,7 +93,9 @@ pub mod pallet { type MilestoneVotingWindow: Get>; /// The type responisble for handling refunds. type RefundHandler: traits::RefundHandler, BalanceOf, CurrencyId>; + /// Maximum milestones allowed in a project. type MaxMilestonesPerProject: Get; + /// Maximum project a user can submit, make sure its pretty big. type MaxProjectsPerAccount: Get; /// Imbue fee in percent 0-99 type ImbueFee: Get; @@ -96,8 +105,14 @@ pub mod pallet { type DepositHandler: DepositHandler, AccountIdOf>; /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; + /// If possible find the vetter responsible for the freelancer. + type ProjectToVetter: for<'a> MaybeConvert<&'a AccountIdOf, VetterIdOf>; + /// Turn an account role into a fee percentage. Handled in the fellowship pallet usually. + type RoleToPercentFee: Convert; /// The minimum percentage of votes, inclusive, that is required for a vote of no confidence to pass/finalize. type PercentRequiredForVoteNoConfidenceToPass: Get; + /// Maximum size of the accounts responsible for handling disputes. + type MaxJuryMembers: Get; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(5); @@ -267,6 +282,16 @@ pub mod pallet { TooManyMilestones, /// There are too many projects for a given account TooManyProjects, + /// Not enough funds in project account to distribute fees. + NotEnoughFundsForFees, + /// Conversion failed due to an error while funding the Project. + ProjectFundingFailed, + /// Conversion failed due to an error in milestone conversion (probably a bound has been abused). + MilestoneConversionFailed, + /// This project has too many refund locations. + TooManyRefundLocations, + /// This project has too many jury members. + TooManyJuryMembers, } #[pallet::hooks] @@ -379,15 +404,20 @@ pub mod pallet { where Project: EncodeLike>, { + type MaximumContributorsPerProject = T::MaximumContributorsPerProject; + type MaxMilestonesPerProject = T::MaxMilestonesPerProject; + type MaxJuryMembers = T::MaxJuryMembers; /// The caller is used to take the storage deposit from. /// With briefs and grants the caller is the beneficiary, so the fee will come from them. fn convert_to_proposal( currency_id: CurrencyId, - contributions: BTreeMap, Contribution, BlockNumberFor>>, - brief_hash: H256, + contributions: BoundedBTreeMap, Contribution, BlockNumberFor>, Self::MaximumContributorsPerProject>, + agreement_hash: H256, benificiary: AccountIdOf, - proposed_milestones: Vec, - funding_type: FundingType, + proposed_milestones: BoundedVec, + refund_locations: BoundedVec<(Locality>, Percent), Self::MaximumContributorsPerProject>, + jury: BoundedVec, Self::MaxJuryMembers>, + on_creation_funding: FundingPath, ) -> Result<(), DispatchError> { let project_key = crate::ProjectCount::::get().saturating_add(1); @@ -398,73 +428,50 @@ pub mod pallet { CurrencyId::Native, )?; + let project_account_id = crate::Pallet::::project_account_id(project_key); + // todo: Error handling here can be improved. + let is_funded = Self::fund_project( + &on_creation_funding, + &contributions, + &project_account_id, + currency_id, + ) + .map_err(|_| Error::::ProjectFundingFailed)?; + let converted_milestones = + Self::try_convert_to_milestones(proposed_milestones, project_key) + .map_err(|_| Error::::MilestoneConversionFailed)?; let sum_of_contributions = contributions .values() .fold(Default::default(), |acc: BalanceOf, x| { acc.saturating_add(x.value) }); - let project_account_id = crate::Pallet::::project_account_id(project_key); - - match funding_type { - FundingType::Proposal | FundingType::Brief => { - for (acc, cont) in contributions.iter() { - let project_account_id = - crate::Pallet::::project_account_id(project_key); - <::MultiCurrency as MultiReservableCurrency< - AccountIdOf, - >>::unreserve(currency_id, acc, cont.value); - ::MultiCurrency::transfer( - currency_id, - acc, - &project_account_id, - cont.value, - )?; - } - } - FundingType::Grant(_) => {} - } - - let mut milestone_key: u32 = 0; - let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); - for milestone in proposed_milestones { - let milestone = Milestone { - project_key, - milestone_key, - percentage_to_unlock: milestone.percentage_to_unlock, - is_approved: false, - }; - milestones - .try_insert(milestone_key, milestone) - .map_err(|_| Error::::TooManyMilestones)?; - milestone_key = milestone_key.saturating_add(1); - } - - let bounded_contributions: ContributionsFor = contributions - .try_into() - .map_err(|_| Error::::TooManyContributions)?; - let project: Project = Project { - milestones, - contributions: bounded_contributions, + agreement_hash, + milestones: converted_milestones, + contributions, currency_id, withdrawn_funds: 0u32.into(), raised_funds: sum_of_contributions, initiator: benificiary.clone(), created_on: frame_system::Pallet::::block_number(), cancelled: false, - agreement_hash: brief_hash, - funding_type, deposit_id, + refund_locations: refund_locations + .try_into() + .map_err(|_| Error::::TooManyRefundLocations)?, + jury: jury + .try_into() + .map_err(|_| Error::::TooManyJuryMembers)?, + on_creation_funding, }; Projects::::insert(project_key, project); - - ProjectCount::::mutate(|c| *c = c.saturating_add(1)); + ProjectCount::::put(project_key); Self::deposit_event(Event::ProjectCreated( benificiary, - brief_hash, + agreement_hash, project_key, sum_of_contributions, currency_id, @@ -472,6 +479,39 @@ pub mod pallet { )); Ok(()) } + + fn convert_contributions_to_refund_locations( + contributions: &BoundedBTreeMap, Contribution, BlockNumberFor>, Self::MaximumContributorsPerProject>, + ) -> BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> { + let sum_of_contributions = contributions + .values() + .fold(Default::default(), |acc: BalanceOf, x| { + acc.saturating_add(x.value) + }); + + let mut sum_of_percents: Percent = Zero::zero(); + let mut ret: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = contributions + .iter() + .map(|c| { + let percent = Percent::from_rational(c.1.value, sum_of_contributions); + sum_of_percents = sum_of_percents.saturating_add(percent); + // Since these are local we can use MultiLocation::Default; + (Locality::from_local(c.0.clone()), percent) + }) + .collect::>, Percent)>>().try_into().expect("Both input and output are bound by the same quantifier; qed"); + + // TEST THIS + if sum_of_percents != One::one() { + // We are missing a part of the fund so take the remainder and use the pallet_id as the return address. + //(as is used throughout the rest of the pallet for fees) + let diff = ::one().saturating_sub(sum_of_percents); + // TODO: IF THE CONTRIBUTION BOUND IS MAX ALREADY THEN WE CANNOT PUSH THE DUST ACCOUNT ON + // FAIL SILENTLY AND CLEAN UP ON FINAL WITHDRAW INSTEAD. + let _ = ret.try_push((Locality::from_local(Self::account_id()), diff)); + } + + ret + } } } @@ -519,6 +559,7 @@ impl> Default for Vote { } } +//TODO: MIGRATION FOR refund locations, jury, on_creation_funding /// The struct which contain milestones that can be submitted. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] @@ -532,8 +573,29 @@ pub struct Project { pub initiator: AccountIdOf, pub created_on: BlockNumberFor, pub cancelled: bool, - pub funding_type: FundingType, pub deposit_id: DepositIdOf, + /// Where do the refunds end up and what percent they get. + pub refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject>, + /// Who should deal with disputes. + pub jury: BoundedVec, T::MaxJuryMembers>, + /// When is the project funded and how is it taken. + pub on_creation_funding: FundingPath, +} + +/// For deriving the location of an account. +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] +pub enum Locality { + Local(AccountId), + Foreign(MultiLocation), +} + +impl Locality { + fn from_multilocation(m: MultiLocation) -> Self { + Self::Foreign(m) + } + fn from_local(l: AccountId) -> Self { + Self::Local(l) + } } /// The contribution users made to a proposal project. @@ -552,6 +614,13 @@ pub struct Whitelist { max_cap: Balance, } +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen, Default)] +pub enum FundingPath { + #[default] + TakeFromReserved, + WaitForFunding, +} + pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index f600865b..2b01d4be 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -183,7 +183,7 @@ parameter_types! { pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into(); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); - pub MaximumContributorsPerProject: u32 = 5000; + pub MaximumContributorsPerProject: u32 = 50; pub RefundsPerBlock: u8 = 2; pub IsIdentityRequired: bool = false; pub MilestoneVotingWindow: BlockNumber = 100800u64; @@ -193,6 +193,7 @@ parameter_types! { pub ProjectStorageItem: StorageItems = StorageItems::Project; pub MaxProjectsPerAccount: u16 = 50; pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); + pub MaxJuryMembers: u32 = 100; } impl pallet_proposals::Config for Test { @@ -215,6 +216,9 @@ impl pallet_proposals::Config for Test { type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; + type ProjectToVetter = Test; + type RoleToPercentFee = pallet_fellowship::impls::RoleToPercentFee; + type MaxJuryMembers = MaxJuryMembers; } parameter_types! { @@ -241,36 +245,33 @@ impl pallet_identity::Config for Test { type WeightInfo = (); } +parameter_types! { + pub MaxCandidatesPerShortlist: u32 = 100; + pub ShortlistPeriod: BlockNumber = 100; + pub MembershipDeposit: Balance = 50_000_000; + pub SlashAccount: AccountId = sr25519::Public::from_raw([1u8; 32]); + pub DepositCurrencyId: CurrencyId = CurrencyId::Native; +} + + parameter_types! { pub const UnitWeightCost: u64 = 10; pub const MaxInstructions: u32 = 100; } + pub static ALICE: Lazy = Lazy::new(|| sr25519::Public::from_raw([125u8; 32])); pub static BOB: Lazy = Lazy::new(|| sr25519::Public::from_raw([126u8; 32])); pub static CHARLIE: Lazy = Lazy::new(|| sr25519::Public::from_raw([127u8; 32])); pub static DAVE: Lazy = Lazy::new(|| sr25519::Public::from_raw([128u8; 32])); pub static JOHN: Lazy = Lazy::new(|| sr25519::Public::from_raw([255u8; 32])); +pub static EMPTY: Lazy = Lazy::new(|| sr25519::Public::from_raw([123u8; 32])); +pub static VETTER: Lazy = Lazy::new(|| sr25519::Public::from_raw([123u8; 32])); pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let t = frame_system::GenesisConfig::default() .build_storage::() .unwrap(); - // orml_tokens::GenesisConfig::::default() - // .assimilate_storage(&mut t) - // .unwrap(); - - // orml_tokens::GenesisConfig:: { - // balances: { - // vec![*ALICE, *BOB, *CHARLIE] - // .into_iter() - // .map(|id| (id, CurrencyId::Native, 1000000)) - // .collect::>() - // }, - // } - // .assimilate_storage(&mut t) - // .unwrap(); - let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { let initial_balance = 100_000_000u64; @@ -280,6 +281,7 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let _ = Tokens::deposit(CurrencyId::Native, &CHARLIE, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &DAVE, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &JOHN, initial_balance); + let _ = Tokens::deposit(CurrencyId::Native, &VETTER, initial_balance); }); ext } @@ -309,3 +311,10 @@ impl DepositHandler, crate::AccountIdOf Ok(()) } } + +type VetterId = AccountId; +impl MaybeConvert<&AccountId, VetterId> for Test { + fn maybe_convert(fellow: &AccountId) -> Option { + Some(*VETTER) + } +} diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index c071c299..d6b0157d 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,20 +1,21 @@ use crate::Config; use crate::Pallet as Proposals; use crate::{ - AccountIdOf, BalanceOf, Contribution, ContributionsFor, Milestone, MilestoneKey, Project, - ProjectKey, ProposedMilestone, + traits::IntoProposal, AccountIdOf, BalanceOf, BlockNumberFor, Contribution, ContributionsFor, + FundingPath, Milestone, MilestoneKey, MultiLocation, Project, ProjectCount, ProjectKey, + ProposedMilestone, Locality }; use common_types::{CurrencyId, FundingType}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, Vec}; -use frame_support::{assert_ok, traits::Hooks}; +use frame_support::{assert_ok, traits::Hooks, BoundedVec}; use frame_system::EventRecord; -use orml_traits::MultiCurrency; +use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_deposits::traits::DepositHandler; use sp_arithmetic::per_things::Percent; use sp_core::{Get, H256}; -use sp_runtime::SaturatedConversion; use sp_runtime::Saturating; +use sp_runtime::{DispatchError, SaturatedConversion}; use sp_std::{collections::btree_map::BTreeMap, convert::TryInto}; #[allow(dead_code)] @@ -61,70 +62,64 @@ pub fn get_max_milestones() -> Vec { get_milestones(::MaxMilestonesPerProject::get() as u8) } -/// Create a project for test purposes, this will not test the paths coming into this pallet via -/// the IntoProposal trait. -pub fn create_project( +// Using the FundingPath::TakeFromReserved create a project for testing funded milestones +// This will be called in the majority of test cases. +// IntoProposal assumes that funds have been reserved before calling it. +pub fn create_and_fund_project( beneficiary: AccountIdOf, contributions: ContributionsFor, proposed_milestones: Vec, currency_id: CurrencyId, -) -> ProjectKey { - let deposit_id = ::DepositHandler::take_deposit( - beneficiary.clone(), - ::ProjectStorageItem::get(), - CurrencyId::Native, - ) - .expect("this should work"); +) -> Result { + contributions.iter().for_each(|(acc, c)| { + ::MultiCurrency::reserve(currency_id, acc, c.value).unwrap(); + }); let agreement_hash: H256 = Default::default(); - - let project_key = crate::ProjectCount::::get().saturating_add(1); - - let mut raised_funds: BalanceOf = 0u32.into(); - let project_account_id = Proposals::::project_account_id(project_key); - - for (account, contribution) in contributions.iter() { - let amount = contribution.value; - assert_ok!(::MultiCurrency::transfer( - currency_id, - account, - &project_account_id, - amount - )); - raised_funds = raised_funds.saturating_add(amount); - } - - let mut milestone_key: u32 = 0; - let mut milestones: BTreeMap = BTreeMap::new(); - - for ms in proposed_milestones { - let milestone = Milestone { - project_key, - milestone_key, - percentage_to_unlock: ms.percentage_to_unlock, - is_approved: false, - }; - milestones.insert(milestone_key, milestone); - milestone_key = milestone_key.saturating_add(1); - } - - let project = Project { - milestones: milestones.try_into().expect("too many milestones"), - contributions, + let refund_locations = as IntoProposal< + AccountIdOf, + BalanceOf, + BlockNumberFor, + >>::convert_contributions_to_refund_locations( + &contributions.clone().into_inner() + ); + + // Reserve the assets from the contributors used. + as IntoProposal, BalanceOf, BlockNumberFor>>::convert_to_proposal( currency_id, - withdrawn_funds: 0u32.into(), - raised_funds, - initiator: beneficiary, - created_on: frame_system::Pallet::::block_number(), - cancelled: false, + contributions.into_inner(), agreement_hash, - funding_type: FundingType::Brief, - deposit_id, - }; - - crate::Projects::::insert(project_key, project); - crate::ProjectCount::::put(project_key); + beneficiary, + proposed_milestones, + refund_locations, + Vec::new(), + FundingPath::TakeFromReserved, + )?; + + Ok(ProjectCount::::get()) +} - project_key +// For testing grants and errors pre funding +pub fn create_project_awaiting_funding( + beneficiary: AccountIdOf, + contributions: ContributionsFor, + proposed_milestones: Vec, + currency_id: CurrencyId, + treasury_account: MultiLocation, +) -> Result { + let agreement_hash: H256 = Default::default(); + // Reserve the assets from the contributors used. + as IntoProposal, BalanceOf, BlockNumberFor>>::convert_to_proposal( + currency_id, + contributions.into_inner(), + agreement_hash, + beneficiary, + proposed_milestones, + vec![(Locality::Foreign(treasury_account), Percent::from_parts(100u8))], + Vec::new(), + FundingPath::WaitForFunding, + )?; + + Ok(ProjectCount::::get()) } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests.rs index 800bc79d..216914ff 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests.rs @@ -1,16 +1,17 @@ use frame_support::{assert_noop, assert_ok}; +use crate::{mock::*, *}; use common_types::CurrencyId; use test_utils::*; -use crate::{mock::*, *}; - #[test] fn submit_milestone_milestone_doesnt_exist() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, 11), Error::::MilestoneDoesNotExist @@ -33,7 +34,9 @@ fn submit_milestone_not_initiator() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::submit_milestone(RuntimeOrigin::signed(*BOB), project_key, 1), Error::::UserIsNotInitiator @@ -53,12 +56,13 @@ fn submit_milestones_too_many_this_block() { let prop_milestones = get_milestones(10); (0..=max).for_each(|i| { - let project_key = create_project::( + let project_key = create_and_fund_project::( *ALICE, cont.clone(), prop_milestones.clone(), CurrencyId::Native, - ); + ) + .unwrap(); if i != max { assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -80,7 +84,9 @@ fn submit_milestone_creates_non_bias_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), project_key, @@ -98,7 +104,9 @@ fn submit_milestone_can_resubmit_during_voting_round() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -139,7 +147,9 @@ fn submit_milestone_can_submit_again_after_failed_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), project_key, @@ -161,7 +171,9 @@ fn submit_milestone_cannot_submit_again_after_success_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -196,7 +208,7 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -251,7 +263,7 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -306,7 +318,7 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); let milestone_key_0 = 0; let milestone_key_1 = 1; assert_ok!(Proposals::submit_milestone( @@ -358,7 +370,9 @@ fn vote_on_milestone_before_round_starts_fails() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_noop!( Proposals::vote_on_milestone( @@ -377,7 +391,9 @@ fn vote_on_milestone_after_round_end_fails() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let expiring_block = frame_system::Pallet::::block_number() + ::MilestoneVotingWindow::get(); @@ -404,7 +420,9 @@ fn vote_on_milestone_where_voting_round_is_active_but_not_the_correct_milestone( build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), project_key, @@ -451,7 +469,9 @@ fn vote_on_milestone_not_contributor() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -475,7 +495,9 @@ fn vote_on_milestone_actually_adds_to_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -510,7 +532,9 @@ fn withdraw_not_initiator() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), @@ -547,7 +571,10 @@ fn withdraw_only_transfers_approved_milestones() { let per_contribution = 100_000; let cont = get_contributions::(vec![*BOB, *CHARLIE], per_contribution); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); + let project_account = crate::Pallet::::project_account_id(project_key); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) @@ -566,7 +593,6 @@ fn withdraw_only_transfers_approved_milestones() { true, ) .unwrap(); - let alice_before = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); assert_ok!(Proposals::withdraw( @@ -582,9 +608,6 @@ fn withdraw_only_transfers_approved_milestones() { alice_after, alice_expected_balance, "Alice account is not the expected balance" ); - - let project_account = crate::Pallet::::project_account_id(project_key); - assert_eq!( ::MultiCurrency::free_balance(CurrencyId::Native, &project_account), 180_000, @@ -598,7 +621,9 @@ fn withdraw_removes_project_after_all_funds_taken() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(1); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) @@ -628,7 +653,9 @@ fn store_project_info_after_project_is_completed() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(1); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) @@ -661,12 +688,13 @@ fn store_too_many_projects_for_account() { let prop_milestones = get_milestones(1); let milestone_key = 0; (0..=max).for_each(|i| { - let project_key = create_project::( + let project_key = create_and_fund_project::( *ALICE, cont.clone(), prop_milestones.clone(), CurrencyId::Native, - ); + ) + .unwrap(); let _ = Proposals::submit_milestone( RuntimeOrigin::signed(*ALICE), project_key, @@ -701,7 +729,9 @@ fn withdraw_takes_imbue_fee() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let pallet_account = crate::Pallet::::account_id(); let _ = @@ -732,7 +762,9 @@ fn withdraw_cannot_double_withdraw() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) @@ -760,7 +792,9 @@ fn withdraw_once_times_with_double_submissions() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, 0).unwrap(); let _ = Proposals::vote_on_milestone(RuntimeOrigin::signed(*BOB), project_key, 0, true) .unwrap(); @@ -790,7 +824,9 @@ fn withdraw_twice_with_intermitent_submission() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); // The first submission and withdraw let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, 0).unwrap(); @@ -842,7 +878,9 @@ fn withdraw_with_variable_percentage() { percentage_to_unlock: Percent::from_percent(30u8), }, ]; - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, 0).unwrap(); let _ = Proposals::vote_on_milestone(RuntimeOrigin::signed(*BOB), project_key, 0, true) .unwrap(); @@ -867,7 +905,9 @@ fn withdraw_fails_before_approval() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_noop!( Proposals::withdraw(RuntimeOrigin::signed(*ALICE), project_key), @@ -888,7 +928,9 @@ fn raise_no_confidence_round_already_started() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = @@ -917,7 +959,9 @@ fn raise_no_confidence_round_not_contributor() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::raise_vote_of_no_confidence(RuntimeOrigin::signed(*CHARLIE), project_key), Error::::OnlyContributorsCanVote @@ -940,7 +984,9 @@ fn raise_no_confidence_round_puts_initial_vote_is_isnay() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = @@ -982,7 +1028,9 @@ fn vote_on_no_confidence_round_not_in_round() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::vote_on_no_confidence_round( @@ -1000,7 +1048,9 @@ fn vote_on_no_confidence_round_not_contributor() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::raise_vote_of_no_confidence( RuntimeOrigin::signed(*BOB), @@ -1022,7 +1072,9 @@ fn vote_on_no_confidence_round_already_voted() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::raise_vote_of_no_confidence( RuntimeOrigin::signed(*BOB), @@ -1045,7 +1097,9 @@ fn vote_on_no_confidence_mutates_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::raise_vote_of_no_confidence( RuntimeOrigin::signed(*BOB), @@ -1083,7 +1137,10 @@ fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *DAVE, *CHARLIE, *ALICE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); + assert_ok!(Proposals::raise_vote_of_no_confidence( RuntimeOrigin::signed(*BOB), project_key @@ -1128,7 +1185,7 @@ fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { assert_last_event::( Event::::NoConfidenceRoundFinalised(*ALICE, project_key).into(), ); - assert_eq!(Projects::::get(project_key), None); + assert!(Projects::::get(project_key).is_none()); assert_eq!( Rounds::::get((project_key, 0), RoundType::VoteOfNoConfidence), None @@ -1137,6 +1194,87 @@ fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { } #[test] +fn convert_to_proposal_too_many_contributions() { + build_test_externality().execute_with(|| { + let agreement_hash: H256 = Default::default(); + let mut contributions: BTreeMap> = Default::default(); + let proposed_milestones = get_milestones(10); + (0..::MaximumContributorsPerProject::get()).for_each(|nth| { + contributions.insert( + sp_core::sr25519::Public::from_raw([nth.try_into().expect("lol if this fails"); 32]), + Contribution { + value: 100_000, + timestamp: One::one(), + } + ); + }); + + assert_noop!(>::convert_to_proposal( + CurrencyId::Native, + contributions, + agreement_hash, + *ALICE, + proposed_milestones, + vec![(Locality::Foreign(::default()), Percent::from_parts(100u8))], + Vec::new(), + FundingPath::WaitForFunding, + ), Error::::TooManyContributions); + }); +} +#[test] +fn convert_to_proposal_too_many_refund_locations() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + +#[test] +fn convert_to_proposal_too_many_jury_members() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + +#[test] +fn fund_project_success() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + +#[test] +fn fund_project_not_enough_to_reserve() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} +#[test] +fn try_convert_to_milestones_too_many_milestones() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + +#[test] +fn try_convert_to_milestones_works() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + +#[test] +fn convert_contributions_to_refund_locations_works() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + +fn convert_contributions_to_refund_locations_uses_treasury_for_dust_clearance() { + build_test_externality().execute_with(|| { + assert!(false); + }); +} + fn close_voting_round_works() { build_test_externality().execute_with(|| { Rounds::::insert((0, 0), RoundType::VotingRound, 100); diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo new file mode 100644 index 00000000..8ea36134 --- /dev/null +++ b/pallets/proposals/src/todo @@ -0,0 +1,8 @@ + +Take fee from withdraws, to treasury or fee account +complete the tests for the new impls +remove all no confidence logic + tests +migration for project pallet +10% fee if a vetter exists for the project. + + diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index bdc9072d..68da5bdf 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -1,28 +1,36 @@ -use crate::{AccountIdOf, BalanceOf, Contribution, ProposedMilestone}; +use crate::{AccountIdOf, BalanceOf, Contribution, FundingPath, ProposedMilestone, Locality}; use common_types::{CurrencyId, FundingType, TreasuryOrigin, TreasuryOriginConverter}; -use frame_support::{inherent::Vec, pallet_prelude::DispatchError, transactional, PalletId}; +use frame_support::{inherent::Vec, pallet_prelude::*, transactional, PalletId, BoundedBTreeMap}; use orml_traits::XcmTransfer; use orml_xtokens::Error; - +use sp_arithmetic::{traits::AtLeast32BitUnsigned, Percent}; use sp_core::H256; use sp_runtime::traits::AccountIdConversion; use sp_std::collections::btree_map::BTreeMap; use xcm::latest::{MultiLocation, WeightLimit}; -pub trait IntoProposal { - /// Convert a set of milestones into a proposal, the bounty must be fully funded before calling this. - /// If an Ok is returned the brief pallet will delete the brief from storage as its been converted. - /// (if using crate) This function should bypass the usual checks when creating a proposal and - /// instantiate everything carefully. - // TODO: Generic over currencyId: https://github.com/ImbueNetwork/imbue/issues/135 +pub trait IntoProposal { + type MaximumContributorsPerProject: Get; + type MaxMilestonesPerProject: Get; + type MaxJuryMembers: Get; + /// Convert the propoerties of a project into a project. + /// This is the main method when wanting to use pallet_proposals and is how one configures a project. fn convert_to_proposal( currency_id: CurrencyId, - current_contribution: BTreeMap>, + current_contribution: BoundedBTreeMap, Self::MaximumContributorsPerProject>, brief_hash: H256, benificiary: AccountId, - milestones: Vec, - funding_type: FundingType, + milestones: BoundedVec, + refund_locations: BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>, + jury: BoundedVec, + on_creation_funding: FundingPath, ) -> Result<(), DispatchError>; + + /// Convert a btreemap of contributions to multilocations with the Here junction. + /// Use when the contributors are the refund locations. + fn convert_contributions_to_refund_locations( + contributions: &BoundedBTreeMap, Self::MaximumContributorsPerProject>, + ) -> BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>; } pub trait RefundHandler { @@ -39,22 +47,6 @@ pub trait RefundHandler { -> Result; } -// Some implementations used in Imbue of the traits above. -type BlockNumberFor = ::BlockNumber; -// For test purposes -impl IntoProposal, BalanceOf, BlockNumberFor> for T { - fn convert_to_proposal( - _currency_id: CurrencyId, - _contributions: BTreeMap, Contribution, BlockNumberFor>>, - _brief_hash: H256, - _benificiary: AccountIdOf, - _proposed_milestones: Vec, - _funding_type: FundingType, - ) -> Result<(), DispatchError> { - Ok(()) - } -} - #[cfg(feature = "std")] pub struct MockRefundHandler(T); From a26c0f61d0d3d0277440ac45e226af4e75ea3022 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 28 Sep 2023 13:35:55 +0100 Subject: [PATCH 054/192] merge and fix tests --- Cargo.lock | 1 + pallets/proposals/src/lib.rs | 2 +- pallets/proposals/src/test_utils.rs | 17 ++++++++------- pallets/proposals/src/tests/pallet.rs | 30 +-------------------------- 4 files changed, 12 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83e5e217..d58b3460 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7229,6 +7229,7 @@ dependencies = [ "orml-xtokens", "pallet-balances", "pallet-deposits", + "pallet-fellowship", "pallet-identity", "pallet-timestamp", "pallet-transaction-payment", diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index ff8e4df7..ada764d0 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -452,7 +452,7 @@ pub mod pallet { ) .map_err(|_| Error::::ProjectFundingFailed)?; let converted_milestones = - Self::try_convert_to_milestones(proposed_milestones, project_key) + Self::try_convert_to_milestones(proposed_milestones.clone(), project_key) .map_err(|_| Error::::MilestoneConversionFailed)?; let sum_of_contributions = contributions .values() diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index b4f3312c..bec80d04 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,6 +1,7 @@ use crate::Config; use crate::Pallet as Proposals; use crate::*; +use crate::mock::*; use common_types::{CurrencyId, FundingType}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, Vec}; @@ -76,18 +77,18 @@ pub fn create_and_fund_project( BalanceOf, BlockNumberFor, >>::convert_contributions_to_refund_locations( - &contributions.clone().into_inner() + &contributions.clone() ); // Reserve the assets from the contributors used. as IntoProposal, BalanceOf, BlockNumberFor>>::convert_to_proposal( currency_id, - contributions.into_inner(), + contributions, agreement_hash, beneficiary, - proposed_milestones, + proposed_milestones.try_into().map_err(|_|Error::::TooManyMilestones)?, refund_locations, - Vec::new(), + BoundedVec::new(), FundingPath::TakeFromReserved, )?; @@ -106,12 +107,12 @@ pub fn create_project_awaiting_funding( // Reserve the assets from the contributors used. as IntoProposal, BalanceOf, BlockNumberFor>>::convert_to_proposal( currency_id, - contributions.into_inner(), + contributions, agreement_hash, beneficiary, - proposed_milestones, - vec![(Locality::Foreign(treasury_account), Percent::from_parts(100u8))], - Vec::new(), + proposed_milestones.try_into().map_err(|_|Error::::TooManyMilestones)?, + vec![(Locality::Foreign(treasury_account), Percent::from_parts(100u8))].try_into().map_err(|_|Error::::TooManyRefundLocations)?, + BoundedVec::new(), FundingPath::WaitForFunding, )?; diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 1f138786..902726d6 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -468,7 +468,7 @@ fn if_double_submission_and_one_finalises_voting_on_the_second_can_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![*BOB, *CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + let project_key = create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); let expiring_block = frame_system::Pallet::::block_number() + ::MilestoneVotingWindow::get(); assert_ok!(Proposals::submit_milestone( @@ -1222,34 +1222,6 @@ fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { }); } -#[test] -fn convert_to_proposal_too_many_contributions() { - build_test_externality().execute_with(|| { - let agreement_hash: H256 = Default::default(); - let mut contributions: BTreeMap> = Default::default(); - let proposed_milestones = get_milestones(10); - (0..::MaximumContributorsPerProject::get()).for_each(|nth| { - contributions.insert( - sp_core::sr25519::Public::from_raw([nth.try_into().expect("lol if this fails"); 32]), - Contribution { - value: 100_000, - timestamp: One::one(), - } - ); - }); - - assert_noop!(>::convert_to_proposal( - CurrencyId::Native, - contributions, - agreement_hash, - *ALICE, - proposed_milestones, - vec![(Locality::Foreign(::default()), Percent::from_parts(100u8))], - Vec::new(), - FundingPath::WaitForFunding, - ), Error::::TooManyContributions); - }); -} #[test] fn convert_to_proposal_too_many_refund_locations() { build_test_externality().execute_with(|| { From 2f046994c1dee175dabd3a7ae65623f67e2d24ea Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 28 Sep 2023 14:09:19 +0100 Subject: [PATCH 055/192] remove unused config items, reorg them, add test cases --- pallets/proposals/src/impls/pallet_impls.rs | 13 +++---- pallets/proposals/src/lib.rs | 35 +++++++++---------- pallets/proposals/src/mock.rs | 15 +++----- pallets/proposals/src/tests/into_proposals.rs | 0 pallets/proposals/src/tests/mod.rs | 1 + pallets/proposals/src/tests/pallet.rs | 4 +-- 6 files changed, 31 insertions(+), 37 deletions(-) create mode 100644 pallets/proposals/src/tests/into_proposals.rs diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 26c98346..0efaa2ca 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -8,10 +8,6 @@ impl Pallet { /// /// This actually does computation. If you need to keep using it, then make sure you cache the /// value and only call this once. - pub fn account_id() -> T::AccountId { - T::PalletId::get().into_account_truncating() - } - pub fn project_account_id(key: ProjectKey) -> AccountIdOf { T::PalletId::get().into_sub_account_truncating(format!("//{key}")) } @@ -155,8 +151,13 @@ impl Pallet { let withdrawn = withdrawable.saturating_sub(fee); let project_account = Self::project_account_id(project_key); - //TODO: Fee is not taken. - let pallet_account = Self::account_id(); + // Take the fee and send to ImbueFeeAccount + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &::ImbueFeeAccount::get(), + fee, + )?; // Transfer to initiator T::MultiCurrency::transfer( diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index ada764d0..f41dcedf 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -82,42 +82,41 @@ pub mod pallet { { /// Because this pallet emits events, it depends on the runtime's definition of an event. type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// The weights generated using the cli. + type WeightInfo: WeightInfoT; + /// The pallet_id used to generate sub accounts for each project fund pot. type PalletId: Get; - type AuthorityOrigin: EnsureOrigin; /// The currency type. type MultiCurrency: MultiReservableCurrency, CurrencyId = CurrencyId>; - type WeightInfo: WeightInfoT; - type MaxWithdrawalExpiration: Get>; /// The amount of time given, up to point of decision, when a vote of no confidence is held. type NoConfidenceTimeLimit: Get>; + /// Defines the length that a milestone can be voted on. + type MilestoneVotingWindow: Get>; /// The minimum percentage of votes, inclusive, that is required for a vote to pass. type PercentRequiredForVoteToPass: Get; + /// The minimum percentage of votes, inclusive, that is required for a vote of no confidence to pass/finalize. + type PercentRequiredForVoteNoConfidenceToPass: Get; /// Maximum number of contributors per project. type MaximumContributorsPerProject: Get; - /// Defines the length that a milestone can be voted on. - type MilestoneVotingWindow: Get>; - /// The type responisble for handling refunds. - type RefundHandler: traits::RefundHandler, BalanceOf, CurrencyId>; /// Maximum milestones allowed in a project. type MaxMilestonesPerProject: Get; /// Maximum project a user can submit, make sure its pretty big. type MaxProjectsPerAccount: Get; - /// Imbue fee in percent 0-99 - type ImbueFee: Get; + /// Maximum size of the accounts responsible for handling disputes. + type MaxJuryMembers: Get; /// The maximum projects to be dealt with per block. Must be small as is dealt with in the hooks. type ExpiringProjectRoundsPerBlock: Get; + /// Imbue fee in percent 0-99 + type ImbueFee: Get; + /// The account the imbue fee goes to. + type ImbueFeeAccount: Get> + /// The type responisble for handling refunds. + type RefundHandler: traits::RefundHandler, BalanceOf, CurrencyId>; /// The type responsible for storage deposits. type DepositHandler: DepositHandler, AccountIdOf>; /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; - /// If possible find the vetter responsible for the freelancer. - type ProjectToVetter: for<'a> MaybeConvert<&'a AccountIdOf, VetterIdOf>; - /// Turn an account role into a fee percentage. Handled in the fellowship pallet usually. - type RoleToPercentFee: Convert; - /// The minimum percentage of votes, inclusive, that is required for a vote of no confidence to pass/finalize. - type PercentRequiredForVoteNoConfidenceToPass: Get; - /// Maximum size of the accounts responsible for handling disputes. - type MaxJuryMembers: Get; + } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); @@ -532,7 +531,7 @@ pub mod pallet { let diff = ::one().saturating_sub(sum_of_percents); // TODO: IF THE CONTRIBUTION BOUND IS MAX ALREADY THEN WE CANNOT PUSH THE DUST ACCOUNT ON // FAIL SILENTLY AND CLEAN UP ON FINAL WITHDRAW INSTEAD. - let _ = ret.try_push((Locality::from_local(Self::account_id()), diff)); + let _ = ret.try_push((Locality::from_local(::ImbueFeeAccount::get()), diff)); } ret diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index 2b01d4be..e25945bd 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -194,6 +194,7 @@ parameter_types! { pub MaxProjectsPerAccount: u16 = 50; pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); pub MaxJuryMembers: u32 = 100; + } impl pallet_proposals::Config for Test { @@ -202,7 +203,6 @@ impl pallet_proposals::Config for Test { type AuthorityOrigin = EnsureRoot; type MultiCurrency = Tokens; type WeightInfo = crate::WeightInfo; - // Adding 2 weeks as th expiration time type MaxWithdrawalExpiration = TwoWeekBlockUnit; type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; @@ -211,13 +211,12 @@ impl pallet_proposals::Config for Test { type RefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; + type ImbueFeeAccount = type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; - type ProjectToVetter = Test; - type RoleToPercentFee = pallet_fellowship::impls::RoleToPercentFee; type MaxJuryMembers = MaxJuryMembers; } @@ -264,8 +263,8 @@ pub static BOB: Lazy = Lazy::new(|| sr25519::Public::from_raw([ pub static CHARLIE: Lazy = Lazy::new(|| sr25519::Public::from_raw([127u8; 32])); pub static DAVE: Lazy = Lazy::new(|| sr25519::Public::from_raw([128u8; 32])); pub static JOHN: Lazy = Lazy::new(|| sr25519::Public::from_raw([255u8; 32])); +pub static TREASURY: Lazy = Lazy::new(|| sr25519::Public::from_raw([246u8; 32])); pub static EMPTY: Lazy = Lazy::new(|| sr25519::Public::from_raw([123u8; 32])); -pub static VETTER: Lazy = Lazy::new(|| sr25519::Public::from_raw([123u8; 32])); pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let t = frame_system::GenesisConfig::default() @@ -282,6 +281,7 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let _ = Tokens::deposit(CurrencyId::Native, &DAVE, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &JOHN, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &VETTER, initial_balance); + let _ = Tokens::deposit(CurrencyId::Native, &TREASURY, initial_balance); }); ext } @@ -311,10 +311,3 @@ impl DepositHandler, crate::AccountIdOf Ok(()) } } - -type VetterId = AccountId; -impl MaybeConvert<&AccountId, VetterId> for Test { - fn maybe_convert(fellow: &AccountId) -> Option { - Some(*VETTER) - } -} diff --git a/pallets/proposals/src/tests/into_proposals.rs b/pallets/proposals/src/tests/into_proposals.rs new file mode 100644 index 00000000..e69de29b diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs index 0e42d240..84d6a8a3 100644 --- a/pallets/proposals/src/tests/mod.rs +++ b/pallets/proposals/src/tests/mod.rs @@ -1,2 +1,3 @@ pub mod immutable_votes; pub mod pallet; +pub mod into_proposals; diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 902726d6..8d9b0ccf 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -762,7 +762,7 @@ fn withdraw_takes_imbue_fee() { create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) .unwrap(); let milestone_key = 0; - let pallet_account = crate::Pallet::::account_id(); + let fee_account = crate::Pallet::::ImbueFeeAccount::get(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) .unwrap(); @@ -779,7 +779,7 @@ fn withdraw_takes_imbue_fee() { )); let expected_fee = ::ImbueFee::get().mul_floor(10_000); assert_eq!( - ::MultiCurrency::free_balance(CurrencyId::Native, &pallet_account), + ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account), expected_fee, "fee hasnt been taken out of project as expected." ); From 08041f3b1313fd56f1432a7d097dba96bad78db6 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 28 Sep 2023 14:21:32 +0100 Subject: [PATCH 056/192] actually add decent documentation in pallet-proposals --- pallets/proposals/src/lib.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index f41dcedf..65ce666b 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -125,11 +125,14 @@ pub mod pallet { #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(PhantomData); + /// Stores the projects of the pallet. #[pallet::storage] #[pallet::getter(fn projects)] pub type Projects = StorageMap<_, Identity, ProjectKey, Project, OptionQuery>; - // BTree of users that has voted, bounded by the number of contributors in a project. + /// BTree of users that has voted, bounded by the number of contributors in a project. + /// Now only stores the UserHasVoted for votes of no confidence. + // TODO: Remove this with vote of no confidence. #[pallet::storage] pub(super) type UserHasVoted = StorageMap< _, @@ -139,10 +142,12 @@ pub mod pallet { ValueQuery, >; + /// Stores the individuals votes on a given milestone key #[pallet::storage] pub type IndividualVoteStore = StorageMap<_, Blake2_128Concat, ProjectKey, ImmutableIndividualVotes, OptionQuery>; + /// Stores the total votes on a milestone. #[pallet::storage] #[pallet::getter(fn milestone_votes)] pub(super) type MilestoneVotes = StorageMap< @@ -153,6 +158,7 @@ pub mod pallet { ValueQuery, >; + /// Stores the completed project by a given initiator. #[pallet::storage] #[pallet::getter(fn completed_projects)] pub type CompletedProjects = StorageMap< @@ -169,6 +175,7 @@ pub mod pallet { pub(super) type NoConfidenceVotes = StorageMap<_, Identity, ProjectKey, Vote>, OptionQuery>; + /// The project count, used as an id for new projects on instantiation. #[pallet::storage] #[pallet::getter(fn project_count)] pub type ProjectCount = StorageValue<_, ProjectKey, ValueQuery>; @@ -589,13 +596,21 @@ impl> Default for Vote { pub struct Project { pub agreement_hash: H256, pub milestones: BoundedBTreeMilestones, + /// The contributions to a project, also known as milestone approvers. TODO: discuss name change. pub contributions: ContributionsFor, + /// The currency id of the Project's funds. pub currency_id: common_types::CurrencyId, + /// The amount of funds already withdrawn from the project. pub withdrawn_funds: BalanceOf, + /// The amount of money actually raised on instantiation of the Project. pub raised_funds: BalanceOf, + /// The initiator of the project, also known as the beneficiary: TODO: discuss name change. pub initiator: AccountIdOf, + /// The blocknumber the Project was created on pub created_on: BlockNumberFor, + /// is the project cancelled TODO: make an issue this is from legacy. pub cancelled: bool, + /// The deposit_id is reponsible for returning deposits held in pallet-deposits. pub deposit_id: DepositIdOf, /// Where do the refunds end up and what percent they get. pub refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject>, @@ -637,10 +652,16 @@ pub struct Whitelist { max_cap: Balance, } +/// Defines how a project is funded on its instantiation. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen, Default)] pub enum FundingPath { + // TODO: Possibly wise to change this to actually define where the reserves are coming from. + // This allows us to break the notion of a "contributor" finally and worry only about the "approvers". + + /// Take from the reserved amounts of the contributors account. #[default] TakeFromReserved, + /// Take nothing from the contributors and await funding from some outside source. WaitForFunding, } From 7ba1ec5a4884f76e9c12e0bc4c894ec877c47b5a Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 3 Oct 2023 13:35:48 +0100 Subject: [PATCH 057/192] run on gcp --- .github/workflows/build.yml | 61 ++++++++++ .github/workflows/collator_actions.yml | 148 ++++++++++++------------- Cargo.toml | 12 ++ 3 files changed, 147 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..f9af6512 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: build-on-self-hosted-runner +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - "**.md" + pull_request: + branches: + - main + paths-ignore: + - "**.md" + +jobs: + create-runner: + runs-on: ubuntu-latest + outputs: + label: ${{ steps.create-runner.outputs.label }} + steps: + - id: create-runner + uses: related-sciences/gce-github-runner@v0.10 + with: + token: ${{ secrets.GH_SA_TOKEN }} + project_id: ${{ secrets.GCP_PROJECT_ID }} + service_account_key: ${{ secrets.GCP_SA_KEY }} + image_project: ubuntu-os-cloud + image_family: ubuntu-2004-lts + machine_type: e2-highcpu-32 + disk_size: 200 + machine_zone: us-central1-b + + - uses: actions/checkout@v4 + + - name: Install Protobuf + run: sudo apt install protobuf-compiler + + - name: Install minimal nightly Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2023-05-22 + target: wasm32-unknown-unknown + override: true + components: rustfmt, clippy + + - name: 🫠 rustfmt 🫠 + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + + - name: Run tests with benchmarks + run: cargo test --features runtime-benchmarks + + - name: Delete runner VM + if: always() + run: > + gcloud compute instances delete + gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} + --quiet --zone us-central1-b \ No newline at end of file diff --git a/.github/workflows/collator_actions.yml b/.github/workflows/collator_actions.yml index 89415aed..360c9879 100644 --- a/.github/workflows/collator_actions.yml +++ b/.github/workflows/collator_actions.yml @@ -1,74 +1,74 @@ -name: rust -on: - workflow_dispatch: - push: - branches: - - main - paths-ignore: - - "**.md" - pull_request: - branches: - - main - paths-ignore: - - "**.md" - - env: - CARGO_TERM_COLOR: always - -jobs: - build-imbue-collator: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - - - name: Update submodules - run: git submodule update --recursive --remote - - - name: Clean unused directories - run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Install Protobuf - run: sudo apt install protobuf-compiler - - - name: Run tests with benchmarks - run: cargo test --features runtime-benchmarks - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Protobuf - run: sudo apt install protobuf-compiler - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - - name: Install clippy - run: rustup component add clippy - - name: Ensure executable - run: chmod +x ./ci/jobs/clippy.sh - - name: Run clippy - run: ./ci/jobs/clippy.sh - rustfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install rustfmt - run: rustup component add rustfmt - - name: Ensure executable - run: chmod +x ./ci/jobs/rustfmt.sh - - name: Run rustfmt - run: ./ci/jobs/rustfmt.sh \ No newline at end of file +#name: rust +#on: +# workflow_dispatch: +# push: +# branches: +# - main +# paths-ignore: +# - "**.md" +# pull_request: +# branches: +# - main +# paths-ignore: +# - "**.md" +# +# env: +# CARGO_TERM_COLOR: always +# +#jobs: +# build-imbue-collator: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# with: +# submodules: recursive +# +# - name: Install minimal nightly Rust +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2023-05-22 +# target: wasm32-unknown-unknown +# override: true +# +# - name: Update submodules +# run: git submodule update --recursive --remote +# +# - name: Clean unused directories +# run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" +# +# - name: Install Protobuf +# run: sudo apt install protobuf-compiler +# +# - name: Run tests with benchmarks +# run: cargo test --features runtime-benchmarks +# clippy: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install Protobuf +# run: sudo apt install protobuf-compiler +# - name: Install minimal nightly Rust +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2023-05-22 +# target: wasm32-unknown-unknown +# override: true +# - name: Install clippy +# run: rustup component add clippy +# - name: Ensure executable +# run: chmod +x ./ci/jobs/clippy.sh +# - name: Run clippy +# run: ./ci/jobs/clippy.sh +# rustfmt: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install rustfmt +# run: rustup component add rustfmt +# - name: Ensure executable +# run: chmod +x ./ci/jobs/rustfmt.sh +# - name: Run rustfmt +# run: ./ci/jobs/rustfmt.sh \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 90acacc3..d0d38382 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [profile.release] panic = 'unwind' split-debuginfo = "unpacked" +opt-level = 3 [workspace.package] authors = ["imbue "] @@ -23,3 +24,14 @@ members = [ "runtime/imbue-kusama", "runtime/common", ] + +# make sure dev builds with backtrace do +# not slow us down +[profile.dev.package.backtrace] +inherits = "release" + +[profile.production] +inherits = "release" +lto = true +codegen-units = 1 + From e39b7c80177ae19971d9b6575125142c36d2dd97 Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 3 Oct 2023 13:47:37 +0100 Subject: [PATCH 058/192] bump to rebuild --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d0d38382..31216704 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,5 +33,4 @@ inherits = "release" [profile.production] inherits = "release" lto = true -codegen-units = 1 - +codegen-units = 1 \ No newline at end of file From 2d4025b9b6b1caf893af7a692fcb194bb8da3b10 Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 3 Oct 2023 16:25:13 +0100 Subject: [PATCH 059/192] use self hosted runner --- .github/workflows/build.yml | 71 ++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9af6512..54ac5ffb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build-on-self-hosted-runner +name: build-on-hosted-runner on: workflow_dispatch: push: @@ -12,28 +12,17 @@ on: paths-ignore: - "**.md" + env: + CARGO_TERM_COLOR: always + jobs: - create-runner: - runs-on: ubuntu-latest - outputs: - label: ${{ steps.create-runner.outputs.label }} + build-imbue-collator: + runs-on: self-hosted steps: - - id: create-runner - uses: related-sciences/gce-github-runner@v0.10 + - name: Checkout sources + uses: actions/checkout@v4 with: - token: ${{ secrets.GH_SA_TOKEN }} - project_id: ${{ secrets.GCP_PROJECT_ID }} - service_account_key: ${{ secrets.GCP_SA_KEY }} - image_project: ubuntu-os-cloud - image_family: ubuntu-2004-lts - machine_type: e2-highcpu-32 - disk_size: 200 - machine_zone: us-central1-b - - - uses: actions/checkout@v4 - - - name: Install Protobuf - run: sudo apt install protobuf-compiler + submodules: recursive - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 @@ -42,20 +31,36 @@ jobs: toolchain: nightly-2023-05-22 target: wasm32-unknown-unknown override: true - components: rustfmt, clippy - - name: 🫠 rustfmt 🫠 - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check + - name: Update submodules + run: git submodule update --recursive --remote - name: Run tests with benchmarks run: cargo test --features runtime-benchmarks - - - name: Delete runner VM - if: always() - run: > - gcloud compute instances delete - gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} - --quiet --zone us-central1-b \ No newline at end of file + clippy: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Install minimal nightly Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2023-05-22 + target: wasm32-unknown-unknown + override: true + - name: Install clippy + run: rustup component add clippy + - name: Ensure executable + run: chmod +x ./ci/jobs/clippy.sh + - name: Run clippy + run: ./ci/jobs/clippy.sh + rustfmt: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + - name: Install rustfmt + run: rustup component add rustfmt + - name: Ensure executable + run: chmod +x ./ci/jobs/rustfmt.sh + - name: Run rustfmt + run: ./ci/jobs/rustfmt.sh \ No newline at end of file From de09ee1a7b7438ec3cce58242db76de34d3fe6bf Mon Sep 17 00:00:00 2001 From: samelamin Date: Tue, 3 Oct 2023 17:52:31 +0100 Subject: [PATCH 060/192] already installed on runner --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54ac5ffb..cb1f71d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,16 +24,16 @@ jobs: with: submodules: recursive - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - - - name: Update submodules - run: git submodule update --recursive --remote +# - name: Install minimal nightly Rust +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2023-05-22 +# target: wasm32-unknown-unknown +# override: true +# +# - name: Update submodules +# run: git submodule update --recursive --remote - name: Run tests with benchmarks run: cargo test --features runtime-benchmarks From 774d8faa78fdb82ec33a1725c425571638c92224 Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 08:10:49 +0100 Subject: [PATCH 061/192] attempt auto scaling runner --- .github/workflows/build.yml | 77 ++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb1f71d8..e97243fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build-on-hosted-runner +name: build-on-self-hosted-runner on: workflow_dispatch: push: @@ -11,36 +11,32 @@ on: - main paths-ignore: - "**.md" - env: CARGO_TERM_COLOR: always - jobs: - build-imbue-collator: - runs-on: self-hosted + create-runner: + runs-on: ubuntu-latest + outputs: + label: ${{ steps.create-runner.outputs.label }} steps: - - name: Checkout sources - uses: actions/checkout@v4 + - id: create-runner + uses: related-sciences/gce-github-runner@v0.10 with: - submodules: recursive + token: ${{ secrets.GH_SA_TOKEN }} + project_id: ${{ secrets.GCP_PROJECT_ID }} + service_account_key: ${{ secrets.GCP_SA_KEY }} + image_project: ubuntu-os-cloud + image_family: ubuntu-2004-lts + machine_type: e2-highcpu-32 +# disk_size: 200 + machine_zone: us-central1-b + ephemeral: true -# - name: Install minimal nightly Rust -# uses: actions-rs/toolchain@v1 -# with: -# profile: minimal -# toolchain: nightly-2023-05-22 -# target: wasm32-unknown-unknown -# override: true -# -# - name: Update submodules -# run: git submodule update --recursive --remote - - - name: Run tests with benchmarks - run: cargo test --features runtime-benchmarks - clippy: - runs-on: self-hosted - steps: - uses: actions/checkout@v4 + + - name: Install Protobuf + run: sudo apt install protobuf-compiler + - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 with: @@ -48,19 +44,20 @@ jobs: toolchain: nightly-2023-05-22 target: wasm32-unknown-unknown override: true - - name: Install clippy - run: rustup component add clippy - - name: Ensure executable - run: chmod +x ./ci/jobs/clippy.sh - - name: Run clippy - run: ./ci/jobs/clippy.sh - rustfmt: - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - name: Install rustfmt - run: rustup component add rustfmt - - name: Ensure executable - run: chmod +x ./ci/jobs/rustfmt.sh - - name: Run rustfmt - run: ./ci/jobs/rustfmt.sh \ No newline at end of file + components: rustfmt, clippy + + - name: 🫠 rustfmt 🫠 + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + + - name: Run tests with benchmarks + run: cargo test --features runtime-benchmarks + + - name: Delete runner VM + if: always() + run: > + gcloud compute instances delete + gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} + --quiet --zone us-central1-b \ No newline at end of file From 982145847b2086ae12886f6c8afc12ccd22bc83f Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 08:12:07 +0100 Subject: [PATCH 062/192] increase disk size --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e97243fb..a6bde520 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: image_project: ubuntu-os-cloud image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 -# disk_size: 200 + disk_size: 400 machine_zone: us-central1-b ephemeral: true From 2395d74be0fd6fb463c2436cdd13cf2f2888d4f1 Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 08:14:54 +0100 Subject: [PATCH 063/192] bump to build again --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6bde520..56ea5aa7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,4 +60,5 @@ jobs: run: > gcloud compute instances delete gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} - --quiet --zone us-central1-b \ No newline at end of file + --quiet --zone us-central1-b + \ No newline at end of file From 8387d02068facb89a198093ec5cb2dfbecf14d2a Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 09:28:16 +0100 Subject: [PATCH 064/192] dont delete at the end of the job --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56ea5aa7..83d71d96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,10 +55,9 @@ jobs: - name: Run tests with benchmarks run: cargo test --features runtime-benchmarks - - name: Delete runner VM - if: always() - run: > - gcloud compute instances delete - gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} - --quiet --zone us-central1-b - \ No newline at end of file +# - name: Delete runner VM +# if: always() +# run: > +# gcloud compute instances delete +# gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} +# --quiet --zone us-central1-b From 21576f0ef29af56ea7c7f6da30204d252c47edc8 Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 11:32:34 +0100 Subject: [PATCH 065/192] remove unused directories --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83d71d96..b7c6d55c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,9 @@ jobs: - uses: actions/checkout@v4 + - name: Clean unused directories + run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Install Protobuf run: sudo apt install protobuf-compiler From 8b7a43b6c312e8fcb74a9a6f00894329dcb6f029 Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 11:38:40 +0100 Subject: [PATCH 066/192] bump --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7c6d55c..6fb81f80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,4 +63,4 @@ jobs: # run: > # gcloud compute instances delete # gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} -# --quiet --zone us-central1-b +# --quiet --zone us-central1-b \ No newline at end of file From 3c080e943a064ffc1656d512a6b78ba9c8713d42 Mon Sep 17 00:00:00 2001 From: samelamin Date: Wed, 4 Oct 2023 11:41:03 +0100 Subject: [PATCH 067/192] change region --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6fb81f80..4195cbad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 disk_size: 400 - machine_zone: us-central1-b + machine_zone: europe-west2-a ephemeral: true - uses: actions/checkout@v4 @@ -63,4 +63,4 @@ jobs: # run: > # gcloud compute instances delete # gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} -# --quiet --zone us-central1-b \ No newline at end of file +# --quiet --zone europe-west2-a \ No newline at end of file From d90513b2bec6c613d5d078672f4ccb1f02cfd8b7 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 07:49:35 +0100 Subject: [PATCH 068/192] split the jobs --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4195cbad..097e71c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,10 @@ jobs: disk_size: 400 machine_zone: europe-west2-a ephemeral: true - + test-features: + needs: create-runner + runs-on: ${{ needs.create-runner.outputs.label }} + steps: - uses: actions/checkout@v4 - name: Clean unused directories From c4096adff31ec4a4506108ab44f32618294ef2dc Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 07:57:07 +0100 Subject: [PATCH 069/192] add -y flag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 097e71c7..91bdc6c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Install Protobuf - run: sudo apt install protobuf-compiler + run: sudo apt -y install protobuf-compiler - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 From cf7e201263dc5adf7b3852a33337d7c362521b17 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 08:35:50 +0100 Subject: [PATCH 070/192] test menually installing rust --- .github/workflows/build.yml | 33 +++++++++++++++++++-------------- ci/jobs/clippy.sh | 0 ci/jobs/install_rust.sh | 11 +++++++++++ ci/jobs/rustfmt.sh | 0 4 files changed, 30 insertions(+), 14 deletions(-) mode change 100644 => 100755 ci/jobs/clippy.sh create mode 100755 ci/jobs/install_rust.sh mode change 100644 => 100755 ci/jobs/rustfmt.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91bdc6c3..5752f61f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,23 +43,28 @@ jobs: - name: Install Protobuf run: sudo apt -y install protobuf-compiler - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - components: rustfmt, clippy + - name: Install minimal nightly Rust + run: ./ci/jobs/install_rust.sh + + - name: Run tests with benchmarks + run: cargo nightly-2023-05-22 test --features runtime-benchmarks + + fmt_clippy: + needs: create-runner + runs-on: ${{ needs.create-runner.outputs.label }} + steps: + - uses: actions/checkout@v4 + - name: Install Protobuf + run: sudo apt -y install protobuf-compiler + + - name: Install minimal nightly Rust + run: ./ci/jobs/install_rust.sh - name: 🫠 rustfmt 🫠 - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check + run: ./ci/jobs/rustfmt.sh - - name: Run tests with benchmarks - run: cargo test --features runtime-benchmarks + - name: 🫠 clippy 🫠 + run: ./ci/jobs/clippy.sh # - name: Delete runner VM # if: always() diff --git a/ci/jobs/clippy.sh b/ci/jobs/clippy.sh old mode 100644 new mode 100755 diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh new file mode 100755 index 00000000..74b7d491 --- /dev/null +++ b/ci/jobs/install_rust.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail +sudo apt install build-essential +sudo apt install --assume-yes git clang curl libssl-dev protobuf-compiler +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +source $HOME/.cargo/env +rustup update +rustup toolchain install nightly-2023-05-22 +rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +rustup component add rustfmt +rustup component add clippy diff --git a/ci/jobs/rustfmt.sh b/ci/jobs/rustfmt.sh old mode 100644 new mode 100755 From 6063cd8c64600ebfcd78b880288e93e937306c60 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:06:41 +0100 Subject: [PATCH 071/192] -y flag --- ci/jobs/install_rust.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index 74b7d491..474bdde0 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -sudo apt install build-essential -sudo apt install --assume-yes git clang curl libssl-dev protobuf-compiler +sudo apt -y install build-essential +sudo apt -y install --assume-yes git clang curl libssl-dev protobuf-compiler curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env rustup update From 1727932f48a63817a176c4d2c744556527c9d246 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:10:57 +0100 Subject: [PATCH 072/192] more -y --- ci/jobs/install_rust.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index 474bdde0..420f913e 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -4,8 +4,8 @@ sudo apt -y install build-essential sudo apt -y install --assume-yes git clang curl libssl-dev protobuf-compiler curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env -rustup update -rustup toolchain install nightly-2023-05-22 -rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 -rustup component add rustfmt -rustup component add clippy +rustup -y update +rustup -y toolchain install nightly-2023-05-22 +rustup -y target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +rustup -y component add rustfmt +rustup -y component add clippy From b0724b30c457324ad8deaa2783bdb5c510d72820 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:12:11 +0100 Subject: [PATCH 073/192] remove double install of protobugf --- ci/jobs/install_rust.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index 420f913e..b90859d3 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail sudo apt -y install build-essential -sudo apt -y install --assume-yes git clang curl libssl-dev protobuf-compiler +sudo apt -y install --assume-yes git clang curl libssl-dev curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env rustup -y update From b0b30d74fe42146d6e6b1e99a7f679d8e27da446 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:17:02 +0100 Subject: [PATCH 074/192] -y --- ci/jobs/install_rust.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index b90859d3..d27e87c8 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -1,8 +1,8 @@ #!/bin/bash set -euo pipefail sudo apt -y install build-essential -sudo apt -y install --assume-yes git clang curl libssl-dev -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +sudo apt -y install --assume-yes git clang curl libssl-dev +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -y source $HOME/.cargo/env rustup -y update rustup -y toolchain install nightly-2023-05-22 From 286a0d71ef69d95b4838341bf21725d5d06f731a Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:28:05 +0100 Subject: [PATCH 075/192] trial 1 --- ci/jobs/install_rust.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index d27e87c8..edfdabe5 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -2,10 +2,10 @@ set -euo pipefail sudo apt -y install build-essential sudo apt -y install --assume-yes git clang curl libssl-dev -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -y +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env rustup -y update -rustup -y toolchain install nightly-2023-05-22 -rustup -y target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 -rustup -y component add rustfmt -rustup -y component add clippy +#rustup -y toolchain install nightly-2023-05-22 +#rustup -y target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +#rustup -y component add rustfmt +#rustup -y component add clippy From db2fcd5b76912f56b368db055811b1be73c18a15 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:37:05 +0100 Subject: [PATCH 076/192] fix --- ci/jobs/install_rust.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index edfdabe5..044452ba 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -2,10 +2,10 @@ set -euo pipefail sudo apt -y install build-essential sudo apt -y install --assume-yes git clang curl libssl-dev -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y source $HOME/.cargo/env -rustup -y update -#rustup -y toolchain install nightly-2023-05-22 -#rustup -y target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 -#rustup -y component add rustfmt -#rustup -y component add clippy +rustup update +rustup toolchain install nightly-2023-05-22 +rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +rustup component add rustfmt +rustup component add clippy From 055f82fac7c4e4b24976f29a4a7923f788a7c8c1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:38:13 +0100 Subject: [PATCH 077/192] fix2 --- ci/jobs/install_rust.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index 044452ba..19d8ad0d 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -2,10 +2,10 @@ set -euo pipefail sudo apt -y install build-essential sudo apt -y install --assume-yes git clang curl libssl-dev -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source $HOME/.cargo/env -rustup update -rustup toolchain install nightly-2023-05-22 -rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 -rustup component add rustfmt -rustup component add clippy +rustup -y update +rustup -y toolchain install nightly-2023-05-22 +rustup -y target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +rustup -y component add rustfmt +rustup -y component add clippy From 44377e6b6843a906e44cc5ce3b0d3f5f802e20b6 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 09:40:07 +0100 Subject: [PATCH 078/192] fix3 --- ci/jobs/install_rust.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh index 19d8ad0d..f868801d 100755 --- a/ci/jobs/install_rust.sh +++ b/ci/jobs/install_rust.sh @@ -4,8 +4,8 @@ sudo apt -y install build-essential sudo apt -y install --assume-yes git clang curl libssl-dev curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source $HOME/.cargo/env -rustup -y update -rustup -y toolchain install nightly-2023-05-22 -rustup -y target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 -rustup -y component add rustfmt -rustup -y component add clippy +rustup update +rustup toolchain install nightly-2023-05-22 +rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +rustup component add rustfmt +rustup component add clippy From 87a64031a3d2e5ba22a75d9b26756706fd3fe6d9 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 10:21:34 +0100 Subject: [PATCH 079/192] bump up --- .github/workflows/build.yml | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5752f61f..5c6e9b18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,8 +37,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Clean unused directories - run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" +# - name: Clean unused directories +# run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Install Protobuf run: sudo apt -y install protobuf-compiler @@ -47,24 +47,24 @@ jobs: run: ./ci/jobs/install_rust.sh - name: Run tests with benchmarks - run: cargo nightly-2023-05-22 test --features runtime-benchmarks + run: cargo +nightly test --features runtime-benchmarks - fmt_clippy: - needs: create-runner - runs-on: ${{ needs.create-runner.outputs.label }} - steps: - - uses: actions/checkout@v4 - - name: Install Protobuf - run: sudo apt -y install protobuf-compiler - - - name: Install minimal nightly Rust - run: ./ci/jobs/install_rust.sh - - - name: 🫠 rustfmt 🫠 - run: ./ci/jobs/rustfmt.sh - - - name: 🫠 clippy 🫠 - run: ./ci/jobs/clippy.sh +# fmt_clippy: +# needs: create-runner +# runs-on: ${{ needs.create-runner.outputs.label }} +# steps: +# - uses: actions/checkout@v4 +# - name: Install Protobuf +# run: sudo apt -y install protobuf-compiler +# +# - name: Install minimal nightly Rust +# run: ./ci/jobs/install_rust.sh +# +# - name: 🫠 rustfmt 🫠 +# run: ./ci/jobs/rustfmt.sh +# +# - name: 🫠 clippy 🫠 +# run: ./ci/jobs/clippy.sh # - name: Delete runner VM # if: always() From 7051bb07e911df6944017592bc0f7c2eb39cfe75 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 10:29:38 +0100 Subject: [PATCH 080/192] bump --- .github/workflows/build.yml | 39 ++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c6e9b18..888b0c76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 disk_size: 400 - machine_zone: europe-west2-a + machine_zone: europe-west1-a ephemeral: true test-features: needs: create-runner @@ -41,30 +41,25 @@ jobs: # run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Install Protobuf - run: sudo apt -y install protobuf-compiler + run: sudo apt install protobuf-compiler - - name: Install minimal nightly Rust - run: ./ci/jobs/install_rust.sh + - name: Install minimal nightly Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2023-05-22 + target: wasm32-unknown-unknown + override: true + components: rustfmt, clippy - - name: Run tests with benchmarks - run: cargo +nightly test --features runtime-benchmarks + - name: 🫠 rustfmt 🫠 + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check -# fmt_clippy: -# needs: create-runner -# runs-on: ${{ needs.create-runner.outputs.label }} -# steps: -# - uses: actions/checkout@v4 -# - name: Install Protobuf -# run: sudo apt -y install protobuf-compiler -# -# - name: Install minimal nightly Rust -# run: ./ci/jobs/install_rust.sh -# -# - name: 🫠 rustfmt 🫠 -# run: ./ci/jobs/rustfmt.sh -# -# - name: 🫠 clippy 🫠 -# run: ./ci/jobs/clippy.sh + - name: Run tests with benchmarks + run: cargo test --features runtime-benchmarks # - name: Delete runner VM # if: always() From 5745c246080c8372d74eadf6bcb0ab3f0f6976aa Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 10:32:15 +0100 Subject: [PATCH 081/192] change zone --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 888b0c76..6d5ca98f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 disk_size: 400 - machine_zone: europe-west1-a + machine_zone: europe-west3-a ephemeral: true test-features: needs: create-runner From 195c77da32d1b07f4baa80a82b4d393933cbf6a7 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 10:35:49 +0100 Subject: [PATCH 082/192] bump --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d5ca98f..75b67243 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,4 +66,4 @@ jobs: # run: > # gcloud compute instances delete # gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} -# --quiet --zone europe-west2-a \ No newline at end of file +# --quiet --zone europe-west2-a From e1f7670af1ef023908267ee004102495e7b2cbd0 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 10:38:29 +0100 Subject: [PATCH 083/192] lol -y --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75b67243..8bc73d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: # run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Install Protobuf - run: sudo apt install protobuf-compiler + run: sudo apt install protobuf-compiler -y - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 From 3c2d57e9e5989249328653c3b73da65961ae5963 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 11:31:57 +0100 Subject: [PATCH 084/192] bump --- .github/workflows/build.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bc73d1a..f8a8068e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,15 @@ jobs: disk_size: 400 machine_zone: europe-west3-a ephemeral: true + + - name: Install minimal nightly Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2023-05-22 + target: wasm32-unknown-unknown + override: true + test-features: needs: create-runner runs-on: ${{ needs.create-runner.outputs.label }} @@ -40,18 +49,10 @@ jobs: # - name: Clean unused directories # run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Install Protobuf run: sudo apt install protobuf-compiler -y - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - components: rustfmt, clippy - - name: 🫠 rustfmt 🫠 uses: actions-rs/cargo@v1 with: From 9768092767d52f7d3c8a80b0b0fdcdd75782db80 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 11:37:30 +0100 Subject: [PATCH 085/192] bump 2 --- .github/workflows/build.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8a8068e..9296995d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,11 @@ jobs: disk_size: 400 machine_zone: europe-west3-a ephemeral: true + test-features: + needs: create-runner + runs-on: ${{ needs.create-runner.outputs.label }} + steps: + - uses: actions/checkout@v4 - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 @@ -40,16 +45,6 @@ jobs: target: wasm32-unknown-unknown override: true - test-features: - needs: create-runner - runs-on: ${{ needs.create-runner.outputs.label }} - steps: - - uses: actions/checkout@v4 - -# - name: Clean unused directories -# run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Install Protobuf run: sudo apt install protobuf-compiler -y From 3094af1b27da377dc2f4c929c3184a55144ed719 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 11:41:59 +0100 Subject: [PATCH 086/192] set home directory --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9296995d..66f9cd19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ on: - "**.md" env: CARGO_TERM_COLOR: always + HOME: /home/ubuntu jobs: create-runner: runs-on: ubuntu-latest From 55d8ee7dc459ffa01d7f34fe8488dbf74a800156 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 11:57:41 +0100 Subject: [PATCH 087/192] try to run as user --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66f9cd19..cdbc2909 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ on: - "**.md" env: CARGO_TERM_COLOR: always - HOME: /home/ubuntu +# HOME: /home/ubuntu jobs: create-runner: runs-on: ubuntu-latest @@ -32,12 +32,20 @@ jobs: disk_size: 400 machine_zone: europe-west3-a ephemeral: true + + + - name: install as user + run: ./svc.sh install ubuntu + test-features: needs: create-runner runs-on: ${{ needs.create-runner.outputs.label }} steps: - uses: actions/checkout@v4 + - name: Run tests with benchmarks + run: cargo test --features runtime-benchmarks + - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 with: From 090cd0fb6883c6f9e762f9c23fb33712b731d3d3 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 12:41:20 +0100 Subject: [PATCH 088/192] init commit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdbc2909..8e65b035 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: install as user - run: ./svc.sh install ubuntu + run: $ACTION_DIR/svc.sh install ubuntu test-features: needs: create-runner From 52749f433a03bf25f0f2a8f2821be02387ebeefe Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 12:43:50 +0100 Subject: [PATCH 089/192] commit 2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e65b035..c8f17a5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: install as user - run: $ACTION_DIR/svc.sh install ubuntu + run: /actions-runner/svc.sh install ubuntu test-features: needs: create-runner From 82a14cdd1a0c13708e6a17e20e9554da714f009e Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 12:46:40 +0100 Subject: [PATCH 090/192] test --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8f17a5b..c8746bba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,6 @@ jobs: machine_zone: europe-west3-a ephemeral: true - - name: install as user run: /actions-runner/svc.sh install ubuntu From f4f9e86a8678f99bd87d4e349220bad287d1a5dc Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 12:50:44 +0100 Subject: [PATCH 091/192] test 3 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8746bba..1526f6eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: ephemeral: true - name: install as user - run: /actions-runner/svc.sh install ubuntu + run: sudo source /actions-runner/svc.sh install ubuntu test-features: needs: create-runner From 92b154259ce6c1cfa34d876bb28326bbd75df372 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 12:55:23 +0100 Subject: [PATCH 092/192] attempt 4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1526f6eb..f0fd9461 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: ephemeral: true - name: install as user - run: sudo source /actions-runner/svc.sh install ubuntu + run: cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu test-features: needs: create-runner From 68b2d09b786e28f025870835a28da21e270425e8 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 12:56:20 +0100 Subject: [PATCH 093/192] bump --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0fd9461..ad241ae4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,4 +70,4 @@ jobs: # run: > # gcloud compute instances delete # gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} -# --quiet --zone europe-west2-a +# --quiet --zone europe-west2-a \ No newline at end of file From 890fd28e59d4702cc055c70ffe2e91542a05819d Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:02:28 +0100 Subject: [PATCH 094/192] bump --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad241ae4..2bd1620f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,11 @@ jobs: ephemeral: true - name: install as user - run: cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu + run: > + gcloud compute ssh + gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} + --zone europe-west2-a + --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu" test-features: needs: create-runner From 65881c3fd3eef483b9663916f4b1dc8625a8ba87 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:09:12 +0100 Subject: [PATCH 095/192] bump --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2bd1620f..dc9fc086 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ on: - "**.md" env: CARGO_TERM_COLOR: always + GCP_ZONE: europe-west3-a # HOME: /home/ubuntu jobs: create-runner: @@ -30,14 +31,14 @@ jobs: image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 disk_size: 400 - machine_zone: europe-west3-a + machine_zone: ${{ env.GCP_ZONE }} ephemeral: true - name: install as user run: > gcloud compute ssh gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} - --zone europe-west2-a + --zone ${{ env.GCP_ZONE }} --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu" test-features: From f89193db0c804d470bc7241a7a782f5bcb511767 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:11:03 +0100 Subject: [PATCH 096/192] bump --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc9fc086..d9bd46f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,4 +75,4 @@ jobs: # run: > # gcloud compute instances delete # gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} -# --quiet --zone europe-west2-a \ No newline at end of file +# --quiet --zone europe-west2-a From fb9f295719674c8e30aa2ca0223a9dd1adaca239 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:12:39 +0100 Subject: [PATCH 097/192] bump --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9bd46f6..e73ea910 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,14 +31,14 @@ jobs: image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 disk_size: 400 - machine_zone: ${{ env.GCP_ZONE }} + machine_zone: europe-west3-a ephemeral: true - name: install as user run: > gcloud compute ssh gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} - --zone ${{ env.GCP_ZONE }} + --zone europe-west3-a --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu" test-features: From fc62ee11dd50855c33c53e19546e45a90bd0d8b7 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:17:18 +0100 Subject: [PATCH 098/192] reduce image size --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e73ea910..ce584c1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: image_project: ubuntu-os-cloud image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 - disk_size: 400 + disk_size: 100 machine_zone: europe-west3-a ephemeral: true @@ -39,7 +39,7 @@ jobs: gcloud compute ssh gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} --zone europe-west3-a - --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu" + --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu && sudo ./svc.sh start" test-features: needs: create-runner From 8bfe50031320507e0c546db2dec6d8c5335f2ec3 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:25:28 +0100 Subject: [PATCH 099/192] bump --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce584c1a..67116870 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: gcloud compute ssh gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} --zone europe-west3-a - --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu && sudo ./svc.sh start" + --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu && sudo ./svc.sh start && sudo ./runsvc.sh" test-features: needs: create-runner @@ -47,9 +47,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Run tests with benchmarks - run: cargo test --features runtime-benchmarks - - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 with: From 61b642cd31b3f48026cc94f56b5ce1b5afb00860 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:32:16 +0100 Subject: [PATCH 100/192] bump --- .github/workflows/build.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67116870..d4e6a5f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,13 +34,6 @@ jobs: machine_zone: europe-west3-a ephemeral: true - - name: install as user - run: > - gcloud compute ssh - gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} - --zone europe-west3-a - --command="cd /actions-runner && sudo ./svc.sh uninstall && sudo ./svc.sh install ubuntu && sudo ./svc.sh start && sudo ./runsvc.sh" - test-features: needs: create-runner runs-on: ${{ needs.create-runner.outputs.label }} From 2e32bb58cdd0d5a6f9bce545bb2ca7502afa2891 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:35:32 +0100 Subject: [PATCH 101/192] bump again --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4e6a5f8..46a94f19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,6 +40,9 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set HOME + run: echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} + - name: Install minimal nightly Rust uses: actions-rs/toolchain@v1 with: From 1007bf0f62f21edf2123c1f7ff5d5c1702fbecd9 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:39:59 +0100 Subject: [PATCH 102/192] add clippy --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46a94f19..bbee174c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,7 @@ jobs: toolchain: nightly-2023-05-22 target: wasm32-unknown-unknown override: true + components: rustfmt, clippy - name: Install Protobuf run: sudo apt install protobuf-compiler -y From 72982ef8f4a8603a4c8e3f4a929e87d79a03f8f3 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:48:58 +0100 Subject: [PATCH 103/192] build essentials --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbee174c..ccb8964c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,8 +52,8 @@ jobs: override: true components: rustfmt, clippy - - name: Install Protobuf - run: sudo apt install protobuf-compiler -y + - name: Install Dependencies + run: sudo apt install protobuf-compiler build-essential -y - name: 🫠 rustfmt 🫠 uses: actions-rs/cargo@v1 From 7e978a89dc117e2de4bc5345fe06172b43c43e00 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 5 Oct 2023 13:50:05 +0100 Subject: [PATCH 104/192] lock --- Cargo.lock | 1683 +++++++++++++++++++++++++++------------------------- 1 file changed, 865 insertions(+), 818 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6979a346..f454b2d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,16 +18,16 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli", + "gimli 0.27.3", ] [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli", + "gimli 0.28.0", ] [[package]] @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead 0.5.2", "aes 0.8.3", @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -217,30 +217,29 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -256,9 +255,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -266,9 +265,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -328,7 +327,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -344,7 +343,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -427,7 +426,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.23", + "rustix 0.37.24", "slab", "socket2 0.4.9", "waker-fn", @@ -444,13 +443,13 @@ dependencies = [ [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -461,7 +460,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -474,14 +473,14 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -511,16 +510,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.20.0", + "addr2line 0.21.0", "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.31.1", + "object 0.32.1", "rustc-demangle", ] @@ -550,9 +549,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -599,13 +598,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.12", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -643,38 +642,37 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", "cfg-if 1.0.0", - "constant_time_eq 0.3.0", - "digest 0.10.7", + "constant_time_eq", ] [[package]] @@ -739,7 +737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", ] @@ -761,12 +759,12 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" dependencies = [ "memchr", - "regex-automata 0.3.6", + "regex-automata 0.3.9", "serde", ] @@ -781,9 +779,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -799,9 +797,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" @@ -811,9 +809,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bzip2-sys" @@ -878,7 +876,7 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", ] @@ -891,7 +889,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -914,9 +912,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -944,11 +942,11 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ - "smallvec 1.11.0", + "smallvec 1.11.1", ] [[package]] @@ -996,17 +994,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -1131,24 +1128,23 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.21" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", - "clap_derive 4.3.12", - "once_cell", + "clap_derive 4.4.2", ] [[package]] name = "clap_builder" -version = "4.3.21" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", - "clap_lex 0.5.0", + "clap_lex 0.5.1", "strsim 0.10.0", ] @@ -1167,14 +1163,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -1188,9 +1184,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "cloudabi" @@ -1203,9 +1199,9 @@ dependencies = [ [[package]] name = "coarsetime" -version = "0.1.23" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" +checksum = "a73ef0d00d14301df35d0f13f5ea32344de6b00837485c358458f1e7f2d27db4" dependencies = [ "libc", "once_cell", @@ -1256,11 +1252,11 @@ dependencies = [ "orml-traits", "pallet-authorship", "pallet-balances", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "scale-info 1.0.0", "serde", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-arithmetic", "sp-consensus-aura", "sp-core", @@ -1276,7 +1272,7 @@ version = "0.1.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.6.2", + "parity-scale-codec 3.6.5", "sp-core", "sp-io", "sp-runtime", @@ -1291,7 +1287,7 @@ dependencies = [ "common-traits", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-runtime", @@ -1301,9 +1297,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -1327,12 +1323,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" -[[package]] -name = "constant_time_eq" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1419,11 +1409,11 @@ dependencies = [ "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli", + "gimli 0.27.3", "hashbrown 0.13.2", "log", "regalloc2", - "smallvec 1.11.0", + "smallvec 1.11.1", "target-lexicon", ] @@ -1459,7 +1449,7 @@ checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", - "smallvec 1.11.0", + "smallvec 1.11.1", "target-lexicon", ] @@ -1489,9 +1479,9 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", - "smallvec 1.11.0", + "smallvec 1.11.1", "wasmparser", "wasmtime-types", ] @@ -1529,11 +1519,11 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.3.21", + "clap 4.4.6", "criterion-plot", "futures 0.3.28", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -1555,17 +1545,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", + "itertools 0.10.5", ] [[package]] @@ -1631,9 +1611,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1695,8 +1675,8 @@ name = "cumulus-client-cli" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ - "clap 4.3.21", - "parity-scale-codec 3.6.4", + "clap 4.4.6", + "parity-scale-codec 3.6.5", "sc-chain-spec", "sc-cli", "sc-service", @@ -1714,7 +1694,7 @@ dependencies = [ "cumulus-client-network", "cumulus-primitives-core", "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -1741,7 +1721,7 @@ dependencies = [ "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-primitives", "polkadot-overseer", "polkadot-primitives", @@ -1778,7 +1758,7 @@ dependencies = [ "dyn-clone", "futures 0.3.28", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "sc-client-api", "sc-consensus", @@ -1839,7 +1819,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.28", "futures-timer", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-parachain", @@ -1863,7 +1843,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.28", "futures-timer", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1920,7 +1900,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-aura", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-application-crypto", "sp-consensus-aura", @@ -1937,7 +1917,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -1959,7 +1939,7 @@ dependencies = [ "frame-system", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "scale-info 2.9.0", "sp-core", @@ -1982,7 +1962,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -1993,7 +1973,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -2010,7 +1990,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-runtime-common", "rand_chacha 0.3.1", "scale-info 2.9.0", @@ -2026,7 +2006,7 @@ name = "cumulus-primitives-core" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-core-primitives", "polkadot-parachain", "polkadot-primitives", @@ -2047,7 +2027,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-test-relay-sproof-builder", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "scale-info 2.9.0", "sp-api", @@ -2068,7 +2048,7 @@ source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b899 dependencies = [ "cumulus-primitives-core", "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-inherents", "sp-std", "sp-timestamp", @@ -2082,7 +2062,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-runtime-common", "sp-io", "sp-runtime", @@ -2126,7 +2106,7 @@ dependencies = [ "cumulus-primitives-core", "futures 0.3.28", "jsonrpsee-core", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-overseer", "sc-client-api", "sp-api", @@ -2185,7 +2165,7 @@ dependencies = [ "futures-timer", "jsonrpsee", "lru 0.9.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-overseer", "sc-client-api", "sc-rpc-api", @@ -2209,7 +2189,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ "cumulus-primitives-core", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "sp-runtime", "sp-state-machine", @@ -2222,7 +2202,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ "polkadot-node-core-pvf-worker", - "toml 0.7.6", + "toml 0.7.8", ] [[package]] @@ -2241,7 +2221,7 @@ dependencies = [ "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api", "sp-block-builder", @@ -2263,7 +2243,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ "async-trait", - "clap 4.3.21", + "clap 4.4.6", "criterion", "cumulus-client-cli", "cumulus-client-consensus-common", @@ -2282,7 +2262,7 @@ dependencies = [ "jsonrpsee", "pallet-transaction-payment", "parachains-common", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-cli", "polkadot-node-subsystem", "polkadot-overseer", @@ -2347,23 +2327,37 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", "fiat-crypto", - "packed_simd_2", - "platforms 3.0.2", + "platforms 3.1.2", + "rustc_version 0.4.0", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "cxx" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666a3ec767f4bbaf0dcfcc3b4ea048b90520b254fdf88813e763f4c762636c14" +checksum = "bbe98ba1789d56fb3db3bee5e032774d4f421b685de7ba703643584ba24effbe" dependencies = [ "cc", "cxxbridge-flags", @@ -2373,9 +2367,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162bec16c4cc28b19e26db0197b60ba5480fdb9a4cbf0f4c6c104a937741b78e" +checksum = "c4ce20f6b8433da4841b1dadfb9468709868022d829d5ca1f2ffbda928455ea3" dependencies = [ "cc", "codespan-reporting", @@ -2383,24 +2377,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "cxxbridge-flags" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e8c238aadc4b9f2c00269d04c87abb23f96dd240803872536eed1a304bb40e" +checksum = "20888d9e1d2298e2ff473cee30efe7d5036e437857ab68bbfea84c74dba91da2" [[package]] name = "cxxbridge-macro" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d9ffb4193dd22180b8d5747b1e095c3d9c9c665ce39b0483a488948f437e06" +checksum = "2fa16a70dd58129e4dfffdff535fb1bce66673f7bbeec4a5a1765a504e1ccd84" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -2515,9 +2509,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derivative" @@ -2676,7 +2670,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -2738,9 +2732,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "ecdsa" @@ -2762,7 +2756,7 @@ checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der 0.7.8", "digest 0.10.7", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "rfc6979 0.4.0", "signature 2.1.0", "spki 0.7.2", @@ -2777,6 +2771,16 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", +] + [[package]] name = "ed25519-dalek" version = "1.0.1" @@ -2784,13 +2788,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek 3.2.0", - "ed25519", - "rand 0.7.3", - "serde", + "ed25519 1.5.3", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.1.1", + "ed25519 2.2.2", + "rand_core 0.6.4", + "serde", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "ed25519-zebra" version = "3.1.0" @@ -2835,12 +2851,12 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", @@ -2872,33 +2888,33 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "enumn" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -2941,9 +2957,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ "errno-dragonfly", "libc", @@ -3044,7 +3060,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -3070,9 +3086,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fatality" @@ -3130,9 +3146,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" [[package]] name = "file-per-thread-logger" @@ -3167,7 +3183,7 @@ dependencies = [ "futures-timer", "log", "num-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "scale-info 2.9.0", ] @@ -3192,9 +3208,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "libz-sys", @@ -3221,7 +3237,7 @@ name = "fork-tree" version = "3.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", ] [[package]] @@ -3249,7 +3265,7 @@ dependencies = [ "frame-system", "linregress", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "paste 1.0.14", "scale-info 2.9.0", "serde", @@ -3272,18 +3288,18 @@ dependencies = [ "Inflector", "array-bytes 4.2.0", "chrono", - "clap 4.3.21", + "clap 4.4.6", "comfy-table", "frame-benchmarking", "frame-support", "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rand 0.8.5", "rand_pcg 0.3.1", "sc-block-builder", @@ -3319,7 +3335,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -3330,7 +3346,7 @@ dependencies = [ "frame-election-provider-solution-type", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -3347,8 +3363,8 @@ dependencies = [ "frame-support", "frame-system", "frame-try-runtime", - "parity-scale-codec 3.6.2", - "scale-info 2.8.0" + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", "sp-core", "sp-io", "sp-runtime", @@ -3363,7 +3379,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ "cfg-if 1.0.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", ] @@ -3378,7 +3394,7 @@ dependencies = [ "indicatif", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "serde", "sp-core", "sp-io", @@ -3402,11 +3418,11 @@ dependencies = [ "k256", "log", "once_cell", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "paste 1.0.14", "scale-info 2.9.0", "serde", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-arithmetic", "sp-core", @@ -3432,11 +3448,11 @@ dependencies = [ "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -3448,7 +3464,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -3458,7 +3474,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -3469,7 +3485,7 @@ dependencies = [ "cfg-if 1.0.0", "frame-support", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -3488,7 +3504,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-runtime", @@ -3500,7 +3516,7 @@ name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", ] @@ -3510,7 +3526,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-support", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", "sp-runtime", "sp-std", @@ -3538,7 +3554,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.8", + "rustix 0.38.17", "windows-sys 0.48.0", ] @@ -3620,7 +3636,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "waker-fn", ] @@ -3632,7 +3648,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -3642,8 +3658,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.8", - "webpki 0.22.0", + "rustls 0.20.9", + "webpki 0.22.2", ] [[package]] @@ -3677,7 +3693,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "pin-utils", "slab", ] @@ -3774,6 +3790,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "glob" version = "0.3.1" @@ -3817,9 +3839,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -3842,9 +3864,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.3.7" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" dependencies = [ "log", "pest", @@ -3895,9 +3917,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -3925,9 +3947,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -4035,7 +4057,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -4078,7 +4100,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "socket2 0.4.9", "tokio", "tower-service", @@ -4095,11 +4117,27 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.20.8", + "rustls 0.20.9", "rustls-native-certs", "tokio", - "tokio-rustls", - "webpki-roots", + "tokio-rustls 0.23.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls 0.21.7", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.24.1", + "webpki-roots 0.23.1", ] [[package]] @@ -4188,7 +4226,7 @@ dependencies = [ "assert_cmd", "async-trait", "cargo-llvm-cov", - "clap 4.3.21", + "clap 4.4.6", "common-runtime", "cumulus-client-cli", "cumulus-client-collator", @@ -4219,7 +4257,7 @@ dependencies = [ "pallet-transaction-payment-rpc", "pallet-xcm", "parachains-common", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.10.2", "polkadot-cli", "polkadot-parachain", @@ -4333,7 +4371,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "parachain-info", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-runtime-common", "scale-info 2.9.0", @@ -4363,7 +4401,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", ] [[package]] @@ -4399,19 +4437,19 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] name = "indicatif" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", "instant", @@ -4478,7 +4516,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", "windows-sys 0.48.0", ] @@ -4495,7 +4533,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.4", "widestring", "windows-sys 0.48.0", "winreg", @@ -4513,8 +4551,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.8", + "hermit-abi 0.3.3", + "rustix 0.38.17", "windows-sys 0.48.0", ] @@ -4536,6 +4574,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -4562,9 +4609,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", @@ -4577,9 +4624,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", "http", @@ -4590,17 +4637,17 @@ dependencies = [ "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tracing", - "webpki-roots", + "webpki-roots 0.25.2", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", @@ -4626,13 +4673,13 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ "async-trait", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.1", "jsonrpsee-core", "jsonrpsee-types", "rustc-hash", @@ -4645,9 +4692,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ "heck 0.4.1", "proc-macro-crate", @@ -4658,9 +4705,9 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ "futures-channel", "futures-util", @@ -4680,9 +4727,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" dependencies = [ "anyhow", "beef", @@ -4694,9 +4741,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" +checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" dependencies = [ "http", "jsonrpsee-client-transport", @@ -4712,9 +4759,9 @@ checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", "ecdsa 0.16.8", - "elliptic-curve 0.13.5", + "elliptic-curve 0.13.6", "once_cell", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -4791,7 +4838,7 @@ dependencies = [ "pallet-whitelist", "pallet-xcm", "pallet-xcm-benchmarks", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -4799,7 +4846,7 @@ dependencies = [ "scale-info 2.9.0", "serde", "serde_derive", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-arithmetic", "sp-authority-discovery", @@ -4833,7 +4880,7 @@ dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -4845,7 +4892,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" dependencies = [ - "smallvec 1.11.0", + "smallvec 1.11.1", ] [[package]] @@ -4869,7 +4916,7 @@ dependencies = [ "parking_lot 0.12.1", "regex", "rocksdb", - "smallvec 1.11.0", + "smallvec 1.11.1", ] [[package]] @@ -4886,9 +4933,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -4900,12 +4947,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - [[package]] name = "libm" version = "0.2.7" @@ -4992,7 +5033,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "rw-stream-sink", - "smallvec 1.11.0", + "smallvec 1.11.1", "thiserror", "unsigned-varint", "void", @@ -5008,7 +5049,7 @@ dependencies = [ "libp2p-core", "log", "parking_lot 0.12.1", - "smallvec 1.11.0", + "smallvec 1.11.1", "trust-dns-resolver", ] @@ -5029,25 +5070,25 @@ dependencies = [ "lru 0.10.1", "quick-protobuf", "quick-protobuf-codec", - "smallvec 1.11.0", + "smallvec 1.11.1", "thiserror", "void", ] [[package]] name = "libp2p-identity" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ "bs58", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "log", "multiaddr", "multihash 0.17.0", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "zeroize", ] @@ -5072,8 +5113,8 @@ dependencies = [ "log", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", - "smallvec 1.11.0", + "sha2 0.10.8", + "smallvec 1.11.1", "thiserror", "uint", "unsigned-varint", @@ -5094,7 +5135,7 @@ dependencies = [ "libp2p-swarm", "log", "rand 0.8.5", - "smallvec 1.11.0", + "smallvec 1.11.1", "socket2 0.4.9", "tokio", "trust-dns-proto", @@ -5130,7 +5171,7 @@ dependencies = [ "once_cell", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "snow", "static_assertions", "thiserror", @@ -5172,7 +5213,7 @@ dependencies = [ "parking_lot 0.12.1", "quinn-proto", "rand 0.8.5", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "tokio", ] @@ -5190,7 +5231,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", - "smallvec 1.11.0", + "smallvec 1.11.1", ] [[package]] @@ -5209,7 +5250,7 @@ dependencies = [ "libp2p-swarm-derive", "log", "rand 0.8.5", - "smallvec 1.11.0", + "smallvec 1.11.1", "tokio", "void", ] @@ -5253,9 +5294,9 @@ dependencies = [ "libp2p-identity", "rcgen 0.10.0", "ring", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", - "webpki 0.22.0", + "webpki 0.22.2", "x509-parser 0.14.0", "yasna", ] @@ -5321,7 +5362,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -5437,9 +5478,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" +checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" dependencies = [ "nalgebra", ] @@ -5458,9 +5499,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lite-json" @@ -5609,9 +5650,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" dependencies = [ "autocfg 1.1.0", "rawpointer", @@ -5625,26 +5666,27 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if 1.0.0", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.17", ] [[package]] @@ -5754,7 +5796,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "futures 0.3.28", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sc-offchain", "sp-api", @@ -5773,7 +5815,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "anyhow", "jsonrpsee", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "serde", "sp-api", "sp-blockchain", @@ -5851,7 +5893,7 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "unsigned-varint", ] @@ -5865,7 +5907,7 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", + "sha2 0.10.8", "unsigned-varint", ] @@ -5899,7 +5941,7 @@ dependencies = [ "futures 0.3.28", "log", "pin-project", - "smallvec 1.11.0", + "smallvec 1.11.1", "unsigned-varint", ] @@ -6060,9 +6102,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg 1.1.0", "num-integer", @@ -6125,7 +6167,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] @@ -6149,9 +6191,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -6238,7 +6280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" dependencies = [ "expander 0.0.6", - "itertools", + "itertools 0.10.5", "petgraph", "proc-macro-crate", "proc-macro2", @@ -6264,7 +6306,7 @@ dependencies = [ "frame-system", "orml-traits", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-runtime", @@ -6283,7 +6325,7 @@ dependencies = [ "frame-system", "orml-traits", "orml-utilities", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-io", @@ -6299,7 +6341,7 @@ dependencies = [ "frame-support", "frame-system", "orml-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-arithmetic", @@ -6316,7 +6358,7 @@ dependencies = [ "impl-trait-for-tuples", "num-traits", "orml-utilities", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -6334,7 +6376,7 @@ dependencies = [ "frame-support", "frame-system", "orml-xcm-support", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-std", @@ -6347,7 +6389,7 @@ version = "0.4.1-dev" source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" dependencies = [ "frame-support", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-io", @@ -6363,7 +6405,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-std", "xcm", @@ -6376,7 +6418,7 @@ source = "git+https://github.com/open-web3-stack/open-runtime-module-library?bra dependencies = [ "frame-support", "orml-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-runtime", "sp-std", "xcm", @@ -6394,7 +6436,7 @@ dependencies = [ "orml-traits", "orml-xcm-support", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-io", @@ -6437,7 +6479,7 @@ checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -6448,17 +6490,7 @@ checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - -[[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" -dependencies = [ - "cfg-if 1.0.0", - "libm 0.1.4", + "sha2 0.10.8", ] [[package]] @@ -6470,7 +6502,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-transaction-payment", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -6487,7 +6519,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-runtime", @@ -6502,7 +6534,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-timestamp", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-application-crypto", "sp-consensus-aura", @@ -6518,7 +6550,7 @@ dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-application-crypto", "sp-authority-discovery", @@ -6534,7 +6566,7 @@ dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-runtime", "sp-std", @@ -6552,7 +6584,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "pallet-timestamp", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-application-crypto", "sp-consensus-babe", @@ -6575,7 +6607,7 @@ dependencies = [ "frame-system", "log", "pallet-balances", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -6593,7 +6625,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-runtime", "sp-std", @@ -6608,7 +6640,7 @@ dependencies = [ "frame-system", "pallet-authorship", "pallet-session", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-consensus-beefy", @@ -6631,7 +6663,7 @@ dependencies = [ "pallet-beefy", "pallet-mmr", "pallet-session", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -6652,7 +6684,7 @@ dependencies = [ "frame-system", "log", "pallet-treasury", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -6681,7 +6713,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -6703,7 +6735,7 @@ dependencies = [ "log", "pallet-bounties", "pallet-treasury", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -6722,7 +6754,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rand 0.8.5", "scale-info 2.9.0", "sp-runtime", @@ -6739,7 +6771,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -6756,7 +6788,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-io", @@ -6781,7 +6813,7 @@ dependencies = [ "pallet-proposals", "pallet-timestamp", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -6799,7 +6831,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -6820,7 +6852,7 @@ dependencies = [ "orml-tokens", "orml-traits", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -6838,7 +6870,7 @@ dependencies = [ "frame-system", "orml-tokens", "orml-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -6858,7 +6890,7 @@ dependencies = [ "frame-system", "log", "pallet-election-provider-support-benchmarking", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rand 0.8.5", "scale-info 2.9.0", "sp-arithmetic", @@ -6878,7 +6910,7 @@ dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-npos-elections", "sp-runtime", ] @@ -6892,7 +6924,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -6911,7 +6943,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -6930,7 +6962,7 @@ dependencies = [ "frame-system", "orml-tokens", "orml-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -6950,7 +6982,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-application-crypto", "sp-consensus-grandpa", @@ -6981,7 +7013,7 @@ dependencies = [ "pallet-proposals", "pallet-timestamp", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -6999,7 +7031,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7016,7 +7048,7 @@ dependencies = [ "frame-system", "log", "pallet-authorship", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-application-crypto", "sp-core", @@ -7034,7 +7066,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7052,7 +7084,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7069,7 +7101,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -7087,7 +7119,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7105,7 +7137,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7120,7 +7152,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -7136,7 +7168,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7157,7 +7189,7 @@ dependencies = [ "pallet-bags-list", "pallet-nomination-pools", "pallet-staking", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-runtime", "sp-runtime-interface", @@ -7171,7 +7203,7 @@ version = "1.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "pallet-nomination-pools", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", "sp-std", ] @@ -7185,7 +7217,7 @@ dependencies = [ "frame-system", "log", "pallet-balances", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-runtime", @@ -7210,7 +7242,7 @@ dependencies = [ "pallet-offences", "pallet-session", "pallet-staking", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-runtime", "sp-staking", @@ -7226,7 +7258,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7261,7 +7293,7 @@ dependencies = [ "pallet-timestamp", "pallet-transaction-payment", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -7282,7 +7314,7 @@ dependencies = [ "frame-system", "jsonrpsee", "pallet-proposals-rpc-runtime-api", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", "sp-blockchain", "sp-rpc", @@ -7295,7 +7327,7 @@ version = "0.1.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.6.2", + "parity-scale-codec 3.6.5", "sp-api", "sp-runtime", ] @@ -7308,7 +7340,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7324,7 +7356,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", "sp-core", @@ -7341,7 +7373,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7358,7 +7390,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-arithmetic", @@ -7376,7 +7408,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7394,7 +7426,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "pallet-timestamp", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7428,7 +7460,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rand_chacha 0.2.2", "scale-info 2.9.0", "sp-runtime", @@ -7447,7 +7479,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rand_chacha 0.2.2", "scale-info 2.9.0", "serde", @@ -7466,7 +7498,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -7483,7 +7515,7 @@ name = "pallet-staking-runtime-api" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", ] @@ -7496,7 +7528,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7512,7 +7544,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7528,7 +7560,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-inherents", "sp-io", @@ -7547,7 +7579,7 @@ dependencies = [ "frame-system", "log", "pallet-treasury", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -7563,7 +7595,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -7579,7 +7611,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", "sp-blockchain", "sp-core", @@ -7594,7 +7626,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", "sp-runtime", "sp-weights", @@ -7610,7 +7642,7 @@ dependencies = [ "frame-system", "impl-trait-for-tuples", "pallet-balances", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-runtime", @@ -7625,7 +7657,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-io", @@ -7642,7 +7674,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-runtime", "sp-std", @@ -7656,7 +7688,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api", "sp-runtime", @@ -7673,7 +7705,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -7693,7 +7725,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-io", "sp-runtime", @@ -7711,7 +7743,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", ] @@ -7728,7 +7760,7 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collator-selection", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "scale-info 2.9.0", "sp-consensus-aura", @@ -7744,9 +7776,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f19d20a0d2cc52327a88d131fa1c4ea81ea4a04714aedcfeca2dd410049cf8" +checksum = "ab512a34b3c2c5e465731cc7668edf79208bbe520be03484eeb05e63ed221735" dependencies = [ "blake2", "crc32fast", @@ -7776,16 +7808,16 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec", "byte-slice-cast", "bytes", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.6.4", + "parity-scale-codec-derive 3.6.5", "serde", ] @@ -7803,9 +7835,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7827,9 +7859,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" [[package]] name = "parking_lot" @@ -7895,7 +7927,7 @@ dependencies = [ "cloudabi", "libc", "redox_syscall 0.1.57", - "smallvec 1.11.0", + "smallvec 1.11.1", "winapi", ] @@ -7909,7 +7941,7 @@ dependencies = [ "instant", "libc", "redox_syscall 0.2.16", - "smallvec 1.11.0", + "smallvec 1.11.1", "winapi", ] @@ -7922,8 +7954,8 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.3.5", - "smallvec 1.11.0", - "windows-targets 0.48.1", + "smallvec 1.11.1", + "windows-targets 0.48.5", ] [[package]] @@ -8007,19 +8039,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" dependencies = [ "pest", "pest_generator", @@ -8027,36 +8060,36 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.0.2", ] [[package]] @@ -8076,7 +8109,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -8087,9 +8120,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -8131,9 +8164,9 @@ checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" [[package]] name = "platforms" -version = "3.0.2" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] name = "plotters" @@ -8202,7 +8235,7 @@ dependencies = [ "fatality", "futures 0.3.28", "lru 0.9.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8224,7 +8257,7 @@ dependencies = [ "fatality", "futures 0.3.28", "lru 0.9.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8242,7 +8275,7 @@ name = "polkadot-cli" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "clap 4.3.21", + "clap 4.4.6", "frame-benchmarking-cli", "futures 0.3.28", "log", @@ -8335,7 +8368,7 @@ name = "polkadot-core-primitives" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-runtime", @@ -8353,7 +8386,7 @@ dependencies = [ "futures-timer", "indexmap 1.9.3", "lru 0.9.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8372,7 +8405,7 @@ name = "polkadot-erasure-coding" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", @@ -8411,7 +8444,7 @@ dependencies = [ "bytes", "fatality", "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -8430,7 +8463,7 @@ version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8454,7 +8487,7 @@ dependencies = [ "kvdb", "lru 0.9.0", "merlin", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8480,7 +8513,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "kvdb", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8534,7 +8567,7 @@ dependencies = [ "async-trait", "futures 0.3.28", "futures-timer", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-core-pvf", "polkadot-node-metrics", "polkadot-node-primitives", @@ -8569,7 +8602,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "kvdb", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -8587,7 +8620,7 @@ dependencies = [ "futures 0.3.28", "kvdb", "lru 0.9.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -8641,7 +8674,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "libc", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "pin-project", "polkadot-core-primitives", "polkadot-node-metrics", @@ -8684,7 +8717,7 @@ dependencies = [ "cpu-time", "futures 0.3.28", "libc", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-core-pvf", "polkadot-parachain", "polkadot-primitives", @@ -8727,7 +8760,7 @@ dependencies = [ "lazy_static", "log", "mick-jaeger", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "polkadot-node-primitives", "polkadot-primitives", @@ -8746,7 +8779,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "prioritized-metered-channel", "sc-cli", @@ -8767,7 +8800,7 @@ dependencies = [ "fatality", "futures 0.3.28", "hex", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", @@ -8786,7 +8819,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42 dependencies = [ "bounded-vec", "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-primitives", "schnorrkel", @@ -8826,7 +8859,7 @@ dependencies = [ "polkadot-primitives", "polkadot-statement-table", "sc-network", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-consensus-babe", @@ -8844,11 +8877,11 @@ dependencies = [ "fatality", "futures 0.3.28", "futures-channel", - "itertools", + "itertools 0.10.5", "kvdb", "lru 0.9.0", "parity-db", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.11.2", "pin-project", "polkadot-node-jaeger", @@ -8898,7 +8931,7 @@ dependencies = [ "bounded-collections", "derive_more", "frame-support", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-core-primitives", "scale-info 2.9.0", "serde", @@ -8932,7 +8965,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42 dependencies = [ "bitvec", "hex-literal 0.4.1", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-core-primitives", "polkadot-parachain", "scale-info 2.9.0", @@ -9043,7 +9076,7 @@ dependencies = [ "pallet-vesting", "pallet-whitelist", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-constants", @@ -9052,7 +9085,7 @@ dependencies = [ "scale-info 2.9.0", "serde", "serde_derive", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-arithmetic", "sp-authority-discovery", @@ -9103,7 +9136,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "polkadot-runtime-parachains", "rustc-hex", @@ -9132,7 +9165,7 @@ dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -9144,7 +9177,7 @@ version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ "bs58", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "sp-std", "sp-tracing", @@ -9171,7 +9204,7 @@ dependencies = [ "pallet-staking", "pallet-timestamp", "pallet-vesting", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-metrics", @@ -9313,7 +9346,7 @@ dependencies = [ "fatality", "futures 0.3.28", "indexmap 1.9.3", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -9330,7 +9363,7 @@ name = "polkadot-statement-table" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-primitives", "sp-core", ] @@ -9363,7 +9396,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-vesting", "pallet-xcm", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -9372,7 +9405,7 @@ dependencies = [ "scale-info 2.9.0", "serde", "serde_derive", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -9461,7 +9494,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "windows-sys 0.48.0", ] @@ -9502,9 +9535,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" [[package]] name = "ppv-lite86" @@ -9530,7 +9563,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -9564,12 +9597,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -9649,14 +9682,14 @@ checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -9695,7 +9728,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -9716,7 +9749,7 @@ checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck 0.4.1", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -9737,7 +9770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -9802,27 +9835,27 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ "bytes", "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.20.8", + "rustls 0.20.9", "slab", "thiserror", "tinyvec", "tracing", - "webpki 0.22.0", + "webpki 0.22.2", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -10027,9 +10060,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -10037,14 +10070,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -10055,7 +10086,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time 0.3.25", + "time", "x509-parser 0.13.2", "yasna", ] @@ -10068,7 +10099,7 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", - "time 0.3.25", + "time", "yasna", ] @@ -10118,35 +10149,35 @@ dependencies = [ [[package]] name = "reed-solomon-novelpoly" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" +checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" dependencies = [ "derive_more", "fs-err", - "itertools", - "static_init 0.5.2", + "itertools 0.11.0", + "static_init", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -10158,19 +10189,19 @@ dependencies = [ "fxhash", "log", "slice-group-by", - "smallvec 1.11.0", + "smallvec 1.11.1", ] [[package]] name = "regex" -version = "1.9.3" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.3.9", + "regex-syntax 0.7.5", ] [[package]] @@ -10184,13 +10215,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -10201,9 +10232,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "resolv-conf" @@ -10315,7 +10346,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "pallet-xcm-benchmarks", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -10324,7 +10355,7 @@ dependencies = [ "scale-info 2.9.0", "serde", "serde_derive", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -10356,7 +10387,7 @@ dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -10495,7 +10526,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.19", ] [[package]] @@ -10523,9 +10554,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" dependencies = [ "bitflags 1.3.2", "errno", @@ -10537,14 +10568,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.5", + "linux-raw-sys 0.4.8", "windows-sys 0.48.0", ] @@ -10563,14 +10594,26 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring", + "sct 0.7.0", + "webpki 0.22.2", +] + +[[package]] +name = "rustls" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", + "rustls-webpki 0.101.6", "sct 0.7.0", - "webpki 0.22.0", ] [[package]] @@ -10591,7 +10634,27 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -10658,7 +10721,7 @@ dependencies = [ "libp2p", "log", "multihash 0.17.0", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "prost", "prost-build", "rand 0.8.5", @@ -10683,7 +10746,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -10703,7 +10766,7 @@ name = "sc-block-builder" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sp-api", "sp-block-builder", @@ -10740,7 +10803,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -10750,13 +10813,13 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "array-bytes 4.2.0", "chrono", - "clap 4.3.21", + "clap 4.4.6", "fdlimit", "futures 0.3.28", "libp2p-identity", "log", "names", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rand 0.8.5", "regex", "rpassword", @@ -10791,7 +10854,7 @@ dependencies = [ "fnv", "futures 0.3.28", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-executor", "sc-transaction-pool-api", @@ -10822,7 +10885,7 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-client-api", "sc-state-db", @@ -10869,7 +10932,7 @@ dependencies = [ "async-trait", "futures 0.3.28", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-block-builder", "sc-client-api", "sc-consensus", @@ -10902,7 +10965,7 @@ dependencies = [ "num-bigint", "num-rational", "num-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-client-api", "sc-consensus", @@ -10959,7 +11022,7 @@ dependencies = [ "fnv", "futures 0.3.28", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-client-api", "sc-consensus", @@ -10992,7 +11055,7 @@ dependencies = [ "futures 0.3.28", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-consensus-beefy", "sc-rpc", @@ -11009,7 +11072,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "fork-tree", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sc-consensus", "sp-blockchain", @@ -11030,7 +11093,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "rand 0.8.5", "sc-block-builder", @@ -11065,7 +11128,7 @@ dependencies = [ "futures 0.3.28", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sc-consensus-grandpa", "sc-rpc", @@ -11085,7 +11148,7 @@ dependencies = [ "futures 0.3.28", "futures-timer", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sc-consensus", "sc-telemetry", @@ -11105,7 +11168,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "lru 0.8.1", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-executor-common", "sc-executor-wasmtime", @@ -11201,7 +11264,7 @@ dependencies = [ "log", "lru 0.8.1", "mockall", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", @@ -11213,7 +11276,7 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "smallvec 1.11.0", + "smallvec 1.11.1", "snow", "sp-arithmetic", "sp-blockchain", @@ -11259,13 +11322,13 @@ dependencies = [ "futures 0.3.28", "futures-timer", "libp2p-identity", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "prost-build", "sc-consensus", "sc-peerset", "sc-utils", "serde", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", @@ -11304,7 +11367,7 @@ dependencies = [ "futures 0.3.28", "libp2p-identity", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "prost", "prost-build", "sc-client-api", @@ -11332,7 +11395,7 @@ dependencies = [ "log", "lru 0.8.1", "mockall", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "prost", "prost-build", "sc-client-api", @@ -11341,7 +11404,7 @@ dependencies = [ "sc-network-common", "sc-peerset", "sc-utils", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-arithmetic", "sp-blockchain", "sp-consensus", @@ -11361,7 +11424,7 @@ dependencies = [ "futures 0.3.28", "libp2p", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "pin-project", "sc-network", "sc-network-common", @@ -11383,11 +11446,11 @@ dependencies = [ "futures 0.3.28", "futures-timer", "hyper", - "hyper-rustls", + "hyper-rustls 0.23.2", "libp2p", "num_cpus", "once_cell", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "rand 0.8.5", "sc-client-api", @@ -11436,7 +11499,7 @@ dependencies = [ "futures 0.3.28", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-block-builder", "sc-chain-spec", @@ -11465,7 +11528,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "jsonrpsee", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-chain-spec", "sc-transaction-pool-api", "scale-info 2.9.0", @@ -11504,7 +11567,7 @@ dependencies = [ "hex", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-chain-spec", "sc-client-api", @@ -11531,7 +11594,7 @@ dependencies = [ "futures-timer", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", @@ -11576,7 +11639,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", - "static_init 1.0.3", + "static_init", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -11591,7 +11654,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sp-core", ] @@ -11601,7 +11664,7 @@ name = "sc-storage-monitor" version = "0.1.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "clap 4.3.21", + "clap 4.4.6", "fs4", "futures 0.3.28", "log", @@ -11618,7 +11681,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "jsonrpsee", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-chain-spec", "sc-client-api", "sc-consensus-babe", @@ -11708,7 +11771,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -11722,7 +11785,7 @@ dependencies = [ "linked-hash-map", "log", "num-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sc-client-api", "sc-transaction-pool-api", @@ -11788,7 +11851,7 @@ dependencies = [ "bitvec", "cfg-if 1.0.0", "derive_more", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info-derive 2.9.0", "serde", ] @@ -12003,9 +12066,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -12018,29 +12081,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -12071,9 +12134,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -12107,9 +12170,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -12128,9 +12191,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -12153,9 +12216,9 @@ checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" [[package]] name = "shlex" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "signal-hook-registry" @@ -12201,15 +12264,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg 1.1.0", ] @@ -12226,7 +12289,7 @@ version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ "enumn", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "paste 1.0.14", "sp-runtime", "sp-std", @@ -12252,9 +12315,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "snap" @@ -12264,18 +12327,18 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", "ring", "rustc_version 0.4.0", - "sha2 0.10.7", + "sha2 0.10.8", "subtle", ] @@ -12291,9 +12354,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -12323,7 +12386,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "hash-db 0.16.0", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api-proc-macro", "sp-core", @@ -12347,7 +12410,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -12355,7 +12418,7 @@ name = "sp-application-crypto" version = "7.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -12370,7 +12433,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-std", @@ -12382,7 +12445,7 @@ name = "sp-authority-discovery" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api", "sp-application-crypto", @@ -12395,7 +12458,7 @@ name = "sp-block-builder" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-api", "sp-inherents", "sp-runtime", @@ -12410,7 +12473,7 @@ dependencies = [ "futures 0.3.28", "log", "lru 0.8.1", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "sp-api", "sp-consensus", @@ -12441,7 +12504,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api", "sp-application-crypto", @@ -12459,7 +12522,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -12480,7 +12543,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "lazy_static", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -12500,7 +12563,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "finality-grandpa", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -12516,7 +12579,7 @@ name = "sp-consensus-slots" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-std", @@ -12543,7 +12606,7 @@ dependencies = [ "libsecp256k1", "log", "merlin", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "paste 1.0.14", "primitive-types", @@ -12575,7 +12638,7 @@ dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "sp-std", "twox-hash", @@ -12589,7 +12652,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -12608,7 +12671,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -12617,7 +12680,7 @@ version = "0.13.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "environmental", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-std", "sp-storage", ] @@ -12629,7 +12692,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "async-trait", "impl-trait-for-tuples", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-runtime", @@ -12643,12 +12706,12 @@ version = "7.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "bytes", - "ed25519", - "ed25519-dalek", + "ed25519 1.5.3", + "ed25519-dalek 1.0.1", "futures 0.3.28", "libsecp256k1", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "rustversion", "secp256k1", "sp-core", @@ -12680,7 +12743,7 @@ version = "0.13.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "serde", "sp-core", @@ -12703,7 +12766,7 @@ version = "0.1.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "frame-metadata", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-std", ] @@ -12715,7 +12778,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "ckb-merkle-mountain-range", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-api", @@ -12731,7 +12794,7 @@ name = "sp-npos-elections" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-arithmetic", @@ -12779,7 +12842,7 @@ dependencies = [ "hash256-std-hasher", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "paste 1.0.14", "rand 0.8.5", "scale-info 2.9.0", @@ -12799,7 +12862,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "bytes", "impl-trait-for-tuples", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -12819,7 +12882,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -12827,7 +12890,7 @@ name = "sp-session" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api", "sp-core", @@ -12841,7 +12904,7 @@ name = "sp-staking" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-core", @@ -12856,10 +12919,10 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "hash-db 0.16.0", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "rand 0.8.5", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-core", "sp-externalities", "sp-panic-handler", @@ -12875,7 +12938,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-api", "sp-application-crypto", @@ -12898,7 +12961,7 @@ version = "7.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "impl-serde", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "ref-cast", "serde", "sp-debug-derive", @@ -12913,7 +12976,7 @@ dependencies = [ "async-trait", "futures-timer", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-inherents", "sp-runtime", "sp-std", @@ -12925,7 +12988,7 @@ name = "sp-tracing" version = "6.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-std", "tracing", "tracing-core", @@ -12948,7 +13011,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "async-trait", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-core", "sp-inherents", @@ -12968,7 +13031,7 @@ dependencies = [ "lazy_static", "memory-db", "nohash-hasher", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parking_lot 0.12.1", "scale-info 2.9.0", "schnellru", @@ -12986,7 +13049,7 @@ version = "5.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "impl-serde", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "parity-wasm", "scale-info 2.9.0", "serde", @@ -13002,10 +13065,10 @@ name = "sp-version-proc-macro" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -13016,7 +13079,7 @@ dependencies = [ "anyhow", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-std", "wasmi", "wasmtime", @@ -13027,10 +13090,10 @@ name = "sp-weights" version = "4.0.0" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-arithmetic", "sp-core", "sp-debug-derive", @@ -13076,9 +13139,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.41.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc443bad666016e012538782d9e3006213a7db43e9fb1dda91657dc06a6fa08" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -13101,18 +13164,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "static_init" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" -dependencies = [ - "cfg_aliases", - "libc", - "parking_lot 0.11.2", - "static_init_macro 0.5.0", -] - [[package]] name = "static_init" version = "1.0.3" @@ -13124,23 +13175,10 @@ dependencies = [ "libc", "parking_lot 0.11.2", "parking_lot_core 0.8.6", - "static_init_macro 1.0.2", + "static_init_macro", "winapi", ] -[[package]] -name = "static_init_macro" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" -dependencies = [ - "cfg_aliases", - "memchr", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "static_init_macro" version = "1.0.2" @@ -13261,7 +13299,7 @@ dependencies = [ "futures 0.3.28", "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-rpc-api", "sc-transaction-pool-api", "sp-api", @@ -13303,7 +13341,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e dependencies = [ "jsonrpsee", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sc-rpc-api", "scale-info 2.9.0", @@ -13323,7 +13361,7 @@ dependencies = [ "array-bytes 4.2.0", "async-trait", "futures 0.3.28", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-client-api", "sc-client-db", "sc-consensus", @@ -13353,7 +13391,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum", "tempfile", - "toml 0.7.6", + "toml 0.7.8", "walkdir", "wasm-opt", ] @@ -13386,9 +13424,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -13442,22 +13480,22 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.0.0", + "fastrand 2.0.1", "redox_syscall 0.3.5", - "rustix 0.38.8", + "rustix 0.38.17", "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -13476,7 +13514,7 @@ dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -13499,22 +13537,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -13578,20 +13616,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -13602,15 +13629,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -13627,7 +13654,7 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -13661,9 +13688,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.31.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", "bytes", @@ -13671,9 +13698,9 @@ dependencies = [ "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -13686,7 +13713,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -13706,9 +13733,19 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.8", + "rustls 0.20.9", + "tokio", + "webpki 0.22.2", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.7", "tokio", - "webpki 0.22.0", ] [[package]] @@ -13718,22 +13755,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tokio", "tracing", ] @@ -13749,9 +13786,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -13770,11 +13807,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -13794,9 +13831,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "bitflags 2.4.0", "bytes", @@ -13805,7 +13842,7 @@ dependencies = [ "http", "http-body", "http-range-header", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", ] @@ -13830,7 +13867,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tracing-attributes", "tracing-core", ] @@ -13843,7 +13880,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -13886,7 +13923,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -13925,7 +13962,7 @@ dependencies = [ "serde", "serde_json", "sharded-slab", - "smallvec 1.11.0", + "smallvec 1.11.1", "thread_local", "tracing", "tracing-core", @@ -13943,7 +13980,7 @@ dependencies = [ "hashbrown 0.13.2", "log", "rustc-hex", - "smallvec 1.11.0", + "smallvec 1.11.1", ] [[package]] @@ -13981,7 +14018,7 @@ dependencies = [ "ipnet", "lazy_static", "rand 0.8.5", - "smallvec 1.11.0", + "smallvec 1.11.1", "socket2 0.4.9", "thiserror", "tinyvec", @@ -14003,7 +14040,7 @@ dependencies = [ "lru-cache", "parking_lot 0.12.1", "resolv-conf", - "smallvec 1.11.0", + "smallvec 1.11.1", "thiserror", "tokio", "tracing", @@ -14022,12 +14059,12 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "clap 4.3.21", + "clap 4.4.6", "frame-remote-externalities", "frame-try-runtime", "hex", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sc-cli", "sc-executor", "sc-service", @@ -14092,9 +14129,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -14122,9 +14159,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -14143,9 +14180,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -14175,9 +14212,9 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", "bytes", @@ -14193,9 +14230,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna 0.4.0", @@ -14267,15 +14304,15 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -14296,12 +14333,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -14329,7 +14360,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -14363,7 +14394,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14465,7 +14496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" dependencies = [ "downcast-rs", - "libm 0.2.7", + "libm", "memory_units", "num-rational", "num-traits", @@ -14525,14 +14556,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.2", + "base64 0.21.4", "bincode", "directories-next", "file-per-thread-logger", "log", "rustix 0.36.15", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "toml 0.5.11", "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", @@ -14550,7 +14581,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli", + "gimli 0.27.3", "log", "object 0.30.4", "target-lexicon", @@ -14569,7 +14600,7 @@ dependencies = [ "anyhow", "cranelift-codegen", "cranelift-native", - "gimli", + "gimli 0.27.3", "object 0.30.4", "target-lexicon", "wasmtime-environ", @@ -14583,7 +14614,7 @@ checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli", + "gimli 0.27.3", "indexmap 1.9.3", "log", "object 0.30.4", @@ -14605,7 +14636,7 @@ dependencies = [ "bincode", "cfg-if 1.0.0", "cpp_demangle", - "gimli", + "gimli 0.27.3", "log", "object 0.30.4", "rustc-demangle", @@ -14698,9 +14729,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "07ecc0cd7cac091bf682ec5efa18b1cff79d617b84181f38b3951dbe135f607f" dependencies = [ "ring", "untrusted", @@ -14712,9 +14743,24 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki 0.22.2", +] + +[[package]] +name = "webpki-roots" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +dependencies = [ + "rustls-webpki 0.100.3", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "webrtc" version = "0.6.0" @@ -14738,10 +14784,10 @@ dependencies = [ "sdp", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "stun", "thiserror", - "time 0.3.25", + "time", "tokio", "turn", "url", @@ -14773,12 +14819,12 @@ dependencies = [ [[package]] name = "webrtc-dtls" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" dependencies = [ "aes 0.6.0", - "aes-gcm 0.10.2", + "aes-gcm 0.10.3", "async-trait", "bincode", "block-modes", @@ -14790,25 +14836,24 @@ dependencies = [ "hkdf", "hmac 0.12.1", "log", - "oid-registry 0.6.1", "p256", "p384", "rand 0.8.5", "rand_core 0.6.4", - "rcgen 0.9.3", + "rcgen 0.10.0", "ring", "rustls 0.19.1", "sec1 0.3.0", "serde", "sha1", - "sha2 0.10.7", + "sha2 0.10.8", "signature 1.6.4", "subtle", "thiserror", "tokio", "webpki 0.21.4", "webrtc-util", - "x25519-dalek 2.0.0-pre.1", + "x25519-dalek 2.0.0", "x509-parser 0.13.2", ] @@ -14983,7 +15028,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "pallet-xcm-benchmarks", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-common", @@ -14992,7 +15037,7 @@ dependencies = [ "scale-info 2.9.0", "serde", "serde_derive", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -15025,7 +15070,7 @@ dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.0", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -15033,20 +15078,21 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.17", ] [[package]] name = "wide" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" +checksum = "ebecebefc38ff1860b4bc47550bbfa63af5746061cf0d29fcd7fa63171602598" dependencies = [ "bytemuck", "safe_arch", @@ -15076,9 +15122,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -15108,7 +15154,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -15126,7 +15172,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -15146,17 +15192,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -15167,9 +15213,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -15185,9 +15231,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -15203,9 +15249,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -15221,9 +15267,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -15239,9 +15285,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -15251,9 +15297,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -15269,15 +15315,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.10" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] @@ -15314,12 +15360,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.1", "rand_core 0.6.4", + "serde", "zeroize", ] @@ -15339,7 +15386,7 @@ dependencies = [ "ring", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -15357,7 +15404,7 @@ dependencies = [ "oid-registry 0.6.1", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -15369,7 +15416,7 @@ dependencies = [ "derivative", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "scale-info 2.9.0", "serde", "sp-weights", @@ -15386,7 +15433,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "pallet-transaction-payment", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "polkadot-parachain", "scale-info 2.9.0", "sp-arithmetic", @@ -15418,7 +15465,7 @@ dependencies = [ "pallet-message-queue", "parachain-info", "parachains-common", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "paste 1.0.14", "polkadot-primitives", "polkadot-runtime-parachains", @@ -15442,7 +15489,7 @@ dependencies = [ "frame-support", "impl-trait-for-tuples", "log", - "parity-scale-codec 3.6.4", + "parity-scale-codec 3.6.5", "sp-arithmetic", "sp-core", "sp-io", @@ -15460,7 +15507,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -15483,7 +15530,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.25", + "time", ] [[package]] @@ -15503,7 +15550,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] From 19875419f2ef11212970df57d99a332855a67261 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 13:54:49 +0100 Subject: [PATCH 105/192] clang --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccb8964c..77502350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: components: rustfmt, clippy - name: Install Dependencies - run: sudo apt install protobuf-compiler build-essential -y + run: sudo apt install protobuf-compiler clang build-essential -y - name: 🫠 rustfmt 🫠 uses: actions-rs/cargo@v1 From ded4454a3b512f0688c89997d5c2d0e917d51546 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 15:39:40 +0100 Subject: [PATCH 106/192] refactor --- .github/workflows/build.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77502350..dd096895 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,10 @@ on: - main paths-ignore: - "**.md" - env: - CARGO_TERM_COLOR: always - GCP_ZONE: europe-west3-a -# HOME: /home/ubuntu +env: + CARGO_TERM_COLOR: always + GCP_ZONE: europe-west3-a + jobs: create-runner: runs-on: ubuntu-latest @@ -40,6 +40,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: echo region + run: echo $GCP_ZONE + + - name: echo region2 + run: echo ${{ env.$GCP_ZONE }} + - name: Set HOME run: echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} @@ -62,11 +68,4 @@ jobs: args: --check - name: Run tests with benchmarks - run: cargo test --features runtime-benchmarks - -# - name: Delete runner VM -# if: always() -# run: > -# gcloud compute instances delete -# gce-gh-runner-${{ github.run_id }}-${{ github.run_attempt }} -# --quiet --zone europe-west2-a + run: cargo test --features runtime-benchmarks \ No newline at end of file From fb2c338e748f45f6212761a4cfe0cb265eaee19c Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 15:41:04 +0100 Subject: [PATCH 107/192] typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd096895..afbf6bbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: run: echo $GCP_ZONE - name: echo region2 - run: echo ${{ env.$GCP_ZONE }} + run: echo ${{ env.GCP_ZONE }} - name: Set HOME run: echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} From 03bee255c7f4b5fdcbbe3dd798c6f5531187f166 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 15:44:13 +0100 Subject: [PATCH 108/192] typo 2 --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afbf6bbd..974ccb2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,9 +40,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: echo region - run: echo $GCP_ZONE - - name: echo region2 run: echo ${{ env.GCP_ZONE }} From 13fecb1dc10e236182b7f195e6e43fce94df15f0 Mon Sep 17 00:00:00 2001 From: samelamin Date: Thu, 5 Oct 2023 15:46:34 +0100 Subject: [PATCH 109/192] make zone configurable --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 974ccb2c..039e8965 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: image_family: ubuntu-2004-lts machine_type: e2-highcpu-32 disk_size: 100 - machine_zone: europe-west3-a + machine_zone: ${{ env.GCP_ZONE }} ephemeral: true test-features: @@ -40,9 +40,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: echo region2 - run: echo ${{ env.GCP_ZONE }} - - name: Set HOME run: echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} From 84dd9970774c152361c89199547ef846b4f0d6a4 Mon Sep 17 00:00:00 2001 From: gatsey <42411328+f-gate@users.noreply.github.com> Date: Sat, 7 Oct 2023 09:21:55 +0100 Subject: [PATCH 110/192] project voting data api (#224) * add back sudo to rococo * runtime api * runtime-api-wiring * some dummy log statements * attempt 1 to add try-runtime * second attempt * add to the cli * fix warn issue * on initialise, remove on runtime upgrade proposasl * add the new storage version migration * pick runtime * new migration for proposals * fmt * fix v3-v4 migration test * fix 2 * fix brief migration test * clippy * fmt * new MilestoneVote implementation * fix implementation * get project individual votes * remove total votes api * fmt * ummm * new format for Individual votes * boom baby, and a fmt * clippy * fix build * fmt * bump spec version * 1 * individual votes impl with storage * fix buggy impl * define immutability, update on vote * use individual votes for oninit and submit and close voting + update migration * fixing build * seperated test files, tested ImmutableVotes * fix runtime api, reorg proposals * fmt * fmt * clippy * migration, err handling * fix migration * fmt * fix * clippy * update executive and spec version * fmt * remove todos * remove wrong comment * fix failing test * fmt * run on gcp * bump to rebuild * use self hosted runner * already installed on runner * attempt auto scaling runner * increase disk size * bump to build again * dont delete at the end of the job * remove unused directories * bump * change region * split the jobs * add -y flag * test menually installing rust * -y flag * more -y * remove double install of protobugf * -y * trial 1 * fix * fix2 * fix3 * bump up * bump * change zone * bump * lol -y * bump * bump 2 * set home directory * try to run as user * init commit * commit 2 * test * test 3 * attempt 4 * bump * bump * bump * bump * bump * reduce image size * bump * bump * bump again * add clippy * build essentials * clang * refactor * typo * typo 2 * make zone configurable --------- Co-authored-by: samelamin --- .github/workflows/build.yml | 65 ++++++++ .github/workflows/collator_actions.yml | 148 +++++++++--------- Cargo.lock | 5 + Cargo.toml | 11 ++ ci/jobs/clippy.sh | 0 ci/jobs/install_rust.sh | 11 ++ ci/jobs/rustfmt.sh | 0 node/src/rpc.rs | 2 +- pallets/fellowship/Cargo.toml | 1 + pallets/proposals/Cargo.toml | 1 + pallets/proposals/rpc/Cargo.toml | 4 +- pallets/proposals/rpc/runtime-api/Cargo.toml | 3 + pallets/proposals/rpc/runtime-api/src/lib.rs | 7 +- pallets/proposals/rpc/src/lib.rs | 27 +++- .../proposals/src/impls/immutable_votes.rs | 72 +++++++++ pallets/proposals/src/impls/mod.rs | 5 + .../src/{impls.rs => impls/pallet_impls.rs} | 53 +++++-- pallets/proposals/src/lib.rs | 62 ++++++-- pallets/proposals/src/migration.rs | 144 +++++++++++++++-- pallets/proposals/src/test_utils.rs | 11 +- .../proposals/src/tests/immutable_votes.rs | 96 ++++++++++++ pallets/proposals/src/tests/mod.rs | 2 + .../src/{tests.rs => tests/pallet.rs} | 93 ++++++++--- runtime/imbue-kusama/src/lib.rs | 23 ++- 24 files changed, 688 insertions(+), 158 deletions(-) create mode 100644 .github/workflows/build.yml mode change 100644 => 100755 ci/jobs/clippy.sh create mode 100755 ci/jobs/install_rust.sh mode change 100644 => 100755 ci/jobs/rustfmt.sh create mode 100644 pallets/proposals/src/impls/immutable_votes.rs create mode 100644 pallets/proposals/src/impls/mod.rs rename pallets/proposals/src/{impls.rs => impls/pallet_impls.rs} (91%) create mode 100644 pallets/proposals/src/tests/immutable_votes.rs create mode 100644 pallets/proposals/src/tests/mod.rs rename pallets/proposals/src/{tests.rs => tests/pallet.rs} (94%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..039e8965 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,65 @@ +name: build-on-self-hosted-runner +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - "**.md" + pull_request: + branches: + - main + paths-ignore: + - "**.md" +env: + CARGO_TERM_COLOR: always + GCP_ZONE: europe-west3-a + +jobs: + create-runner: + runs-on: ubuntu-latest + outputs: + label: ${{ steps.create-runner.outputs.label }} + steps: + - id: create-runner + uses: related-sciences/gce-github-runner@v0.10 + with: + token: ${{ secrets.GH_SA_TOKEN }} + project_id: ${{ secrets.GCP_PROJECT_ID }} + service_account_key: ${{ secrets.GCP_SA_KEY }} + image_project: ubuntu-os-cloud + image_family: ubuntu-2004-lts + machine_type: e2-highcpu-32 + disk_size: 100 + machine_zone: ${{ env.GCP_ZONE }} + ephemeral: true + + test-features: + needs: create-runner + runs-on: ${{ needs.create-runner.outputs.label }} + steps: + - uses: actions/checkout@v4 + + - name: Set HOME + run: echo "HOME=/home/ubuntu" >> ${GITHUB_ENV} + + - name: Install minimal nightly Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2023-05-22 + target: wasm32-unknown-unknown + override: true + components: rustfmt, clippy + + - name: Install Dependencies + run: sudo apt install protobuf-compiler clang build-essential -y + + - name: 🫠 rustfmt 🫠 + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + + - name: Run tests with benchmarks + run: cargo test --features runtime-benchmarks \ No newline at end of file diff --git a/.github/workflows/collator_actions.yml b/.github/workflows/collator_actions.yml index 89415aed..360c9879 100644 --- a/.github/workflows/collator_actions.yml +++ b/.github/workflows/collator_actions.yml @@ -1,74 +1,74 @@ -name: rust -on: - workflow_dispatch: - push: - branches: - - main - paths-ignore: - - "**.md" - pull_request: - branches: - - main - paths-ignore: - - "**.md" - - env: - CARGO_TERM_COLOR: always - -jobs: - build-imbue-collator: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - - - name: Update submodules - run: git submodule update --recursive --remote - - - name: Clean unused directories - run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Install Protobuf - run: sudo apt install protobuf-compiler - - - name: Run tests with benchmarks - run: cargo test --features runtime-benchmarks - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Protobuf - run: sudo apt install protobuf-compiler - - name: Install minimal nightly Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-05-22 - target: wasm32-unknown-unknown - override: true - - name: Install clippy - run: rustup component add clippy - - name: Ensure executable - run: chmod +x ./ci/jobs/clippy.sh - - name: Run clippy - run: ./ci/jobs/clippy.sh - rustfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install rustfmt - run: rustup component add rustfmt - - name: Ensure executable - run: chmod +x ./ci/jobs/rustfmt.sh - - name: Run rustfmt - run: ./ci/jobs/rustfmt.sh \ No newline at end of file +#name: rust +#on: +# workflow_dispatch: +# push: +# branches: +# - main +# paths-ignore: +# - "**.md" +# pull_request: +# branches: +# - main +# paths-ignore: +# - "**.md" +# +# env: +# CARGO_TERM_COLOR: always +# +#jobs: +# build-imbue-collator: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# with: +# submodules: recursive +# +# - name: Install minimal nightly Rust +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2023-05-22 +# target: wasm32-unknown-unknown +# override: true +# +# - name: Update submodules +# run: git submodule update --recursive --remote +# +# - name: Clean unused directories +# run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY" +# +# - name: Install Protobuf +# run: sudo apt install protobuf-compiler +# +# - name: Run tests with benchmarks +# run: cargo test --features runtime-benchmarks +# clippy: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install Protobuf +# run: sudo apt install protobuf-compiler +# - name: Install minimal nightly Rust +# uses: actions-rs/toolchain@v1 +# with: +# profile: minimal +# toolchain: nightly-2023-05-22 +# target: wasm32-unknown-unknown +# override: true +# - name: Install clippy +# run: rustup component add clippy +# - name: Ensure executable +# run: chmod +x ./ci/jobs/clippy.sh +# - name: Run clippy +# run: ./ci/jobs/clippy.sh +# rustfmt: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Install rustfmt +# run: rustup component add rustfmt +# - name: Ensure executable +# run: chmod +x ./ci/jobs/rustfmt.sh +# - name: Run rustfmt +# run: ./ci/jobs/rustfmt.sh \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index b2ef165f..83e5e217 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6903,6 +6903,7 @@ dependencies = [ "orml-traits", "parity-scale-codec 3.6.2", "scale-info 2.8.0", + "serde", "sp-arithmetic", "sp-core", "sp-io", @@ -7258,6 +7259,7 @@ dependencies = [ "sp-blockchain", "sp-rpc", "sp-runtime", + "sp-std", ] [[package]] @@ -7267,8 +7269,11 @@ dependencies = [ "frame-support", "frame-system", "parity-scale-codec 3.6.2", + "scale-info 2.8.0", + "serde", "sp-api", "sp-runtime", + "sp-std", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 90acacc3..31216704 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [profile.release] panic = 'unwind' split-debuginfo = "unpacked" +opt-level = 3 [workspace.package] authors = ["imbue "] @@ -23,3 +24,13 @@ members = [ "runtime/imbue-kusama", "runtime/common", ] + +# make sure dev builds with backtrace do +# not slow us down +[profile.dev.package.backtrace] +inherits = "release" + +[profile.production] +inherits = "release" +lto = true +codegen-units = 1 \ No newline at end of file diff --git a/ci/jobs/clippy.sh b/ci/jobs/clippy.sh old mode 100644 new mode 100755 diff --git a/ci/jobs/install_rust.sh b/ci/jobs/install_rust.sh new file mode 100755 index 00000000..f868801d --- /dev/null +++ b/ci/jobs/install_rust.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail +sudo apt -y install build-essential +sudo apt -y install --assume-yes git clang curl libssl-dev +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +source $HOME/.cargo/env +rustup update +rustup toolchain install nightly-2023-05-22 +rustup target add wasm32-unknown-unknown --toolchain nightly-2023-05-22 +rustup component add rustfmt +rustup component add clippy diff --git a/ci/jobs/rustfmt.sh b/ci/jobs/rustfmt.sh old mode 100644 new mode 100755 diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 33a773b2..c6811cb9 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -42,7 +42,7 @@ where C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: BlockBuilder, - C::Api: pallet_proposals_rpc::ProposalsRuntimeApi, + C::Api: pallet_proposals_rpc::ProposalsRuntimeApi, P: TransactionPool + Sync + Send + 'static, { use pallet_proposals_rpc::{Proposals, ProposalsApiServer}; diff --git a/pallets/fellowship/Cargo.toml b/pallets/fellowship/Cargo.toml index 6ef2e3eb..b80b1a35 100644 --- a/pallets/fellowship/Cargo.toml +++ b/pallets/fellowship/Cargo.toml @@ -15,6 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = [ "derive", ] } +serde = { version = "1.0.101", features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, optional = true } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 5afbe089..b912ba92 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -45,6 +45,7 @@ orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-l # Local Dependencies common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } +common-runtime = { path = "../../runtime/common", default-features = false } pallet-deposits = { path = "../deposits", default-features = false } [dev-dependencies] diff --git a/pallets/proposals/rpc/Cargo.toml b/pallets/proposals/rpc/Cargo.toml index 5ca20e2b..87563d6a 100644 --- a/pallets/proposals/rpc/Cargo.toml +++ b/pallets/proposals/rpc/Cargo.toml @@ -13,7 +13,6 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } - # Substrate packages sp-api = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } sp-rpc = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } @@ -21,7 +20,8 @@ sp-blockchain = { default-features = false, version = "4.0.0-dev", git = "https: sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } -pallet-proposals-rpc-runtime-api = {path = "./runtime-api" } +pallet-proposals-rpc-runtime-api = { default-features = false, path = "./runtime-api" } +sp-std = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} [features] diff --git a/pallets/proposals/rpc/runtime-api/Cargo.toml b/pallets/proposals/rpc/runtime-api/Cargo.toml index cd7e91c4..6d08d891 100644 --- a/pallets/proposals/rpc/runtime-api/Cargo.toml +++ b/pallets/proposals/rpc/runtime-api/Cargo.toml @@ -13,8 +13,11 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive", ] } +serde = { version = "1.0.101", features = ["derive"], default-features = false} +scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} +sp-std = {default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43"} sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" } diff --git a/pallets/proposals/rpc/runtime-api/src/lib.rs b/pallets/proposals/rpc/runtime-api/src/lib.rs index 0bdc3012..e3643b21 100644 --- a/pallets/proposals/rpc/runtime-api/src/lib.rs +++ b/pallets/proposals/rpc/runtime-api/src/lib.rs @@ -1,7 +1,12 @@ #![cfg_attr(not(feature = "std"), no_std)] +use sp_std::vec::Vec; + sp_api::decl_runtime_apis! { - pub trait ProposalsApi where AccountId: codec::Codec { + pub trait ProposalsApi + where AccountId: codec::Codec + Ord, + { fn get_project_account_by_id(project_id: u32) -> AccountId; + fn get_all_project_data(project_id: u32) -> Option<(Vec, Vec)>; } } diff --git a/pallets/proposals/rpc/src/lib.rs b/pallets/proposals/rpc/src/lib.rs index f42952f6..c8bd2a25 100644 --- a/pallets/proposals/rpc/src/lib.rs +++ b/pallets/proposals/rpc/src/lib.rs @@ -1,19 +1,30 @@ use codec::Codec; + use jsonrpsee::{ core::{Error as JsonRpseeError, RpcResult}, proc_macros::rpc, types::error::{CallError, ErrorObject}, }; pub use pallet_proposals_rpc_runtime_api::ProposalsApi as ProposalsRuntimeApi; + use sp_blockchain::HeaderBackend; use sp_runtime::traits::Block as BlockT; +use sp_std::vec::Vec; + use std::fmt::Display; use std::sync::Arc; +// Runtime api return type. + #[rpc(client, server)] -pub trait ProposalsApi { +pub trait ProposalsApi +where + AccountId: Ord, +{ #[method(name = "proposals_getProjectKitty")] fn project_account_id(&self, project_id: u32) -> RpcResult; + #[method(name = "proposals_getAllProjectData")] + fn all_project_data(&self, project_id: u32) -> RpcResult, Vec)>>; } pub struct Proposals { @@ -48,14 +59,15 @@ impl From for i32 { } } -impl ProposalsApiServer<::Hash, AccountId> for Proposals +impl ProposalsApiServer<::Hash, AccountId, Balance> + for Proposals where C: sp_api::ProvideRuntimeApi, C: HeaderBackend, C: Send + Sync + 'static, - C::Api: ProposalsRuntimeApi, + C::Api: ProposalsRuntimeApi, B: BlockT, - AccountId: Clone + Display + Codec + Send + 'static, + AccountId: Clone + Display + Codec + Send + 'static + Ord, { fn project_account_id(&self, project_id: u32) -> RpcResult { let api = self.client.runtime_api(); @@ -64,6 +76,13 @@ where api.get_project_account_by_id(at, project_id) .map_err(runtime_error_into_rpc_err) } + fn all_project_data(&self, project_id: u32) -> RpcResult, Vec)>> { + let api = self.client.runtime_api(); + let at = self.client.info().best_hash; + + api.get_all_project_data(at, project_id) + .map_err(runtime_error_into_rpc_err) + } } /// Converts a runtime trap into an RPC error. diff --git a/pallets/proposals/src/impls/immutable_votes.rs b/pallets/proposals/src/impls/immutable_votes.rs new file mode 100644 index 00000000..da9904c7 --- /dev/null +++ b/pallets/proposals/src/impls/immutable_votes.rs @@ -0,0 +1,72 @@ +use crate::*; +impl ImmutableIndividualVotes { + /// Create a new set of individual votes bound to a set of milestone keys. + /// Instantiates the votes as defaults. + #[allow(clippy::type_complexity)] + pub(crate) fn new( + milestone_keys: BoundedVec, + ) -> Self { + let mut outer_votes: BoundedBTreeMap< + MilestoneKey, + BoundedBTreeMap, bool, T::MaximumContributorsPerProject>, + T::MaxMilestonesPerProject, + > = BoundedBTreeMap::new(); + + for milestone_key in milestone_keys.iter() { + let inner_votes: BoundedBTreeMap< + AccountIdOf, + bool, + T::MaximumContributorsPerProject, + > = BoundedBTreeMap::new(); + // outer_votes and milestone_keys are bounded by the same binding so this will never fail. + outer_votes + .try_insert(milestone_key.to_owned(), inner_votes) + .expect("milestone_keys and outer_votes have been bound by the same binding; qed"); + } + + Self { inner: outer_votes } + } + + /// Insert the vote from an individual on a milestone. + pub(crate) fn insert_individual_vote( + &mut self, + milestone_key: MilestoneKey, + account_id: &AccountIdOf, + vote: bool, + ) -> Result<(), DispatchError> { + if let Some(votes) = self.inner.get_mut(&milestone_key) { + if let Some(_existing_vote) = votes.get_mut(account_id) { + return Err(Error::::VotesAreImmutable.into()); + } else { + votes + .try_insert(account_id.clone(), vote) + .map_err(|_| Error::::TooManyContributions)?; + } + } else { + return Err(Error::::IndividualVoteNotFound.into()); + } + + Ok(()) + } + + /// Clear the votes for a given milestone. + /// Used when a milestone is submitted. + /// Skips if the milestone is not found. + pub(crate) fn clear_milestone_votes(&mut self, milestone_key: MilestoneKey) { + if let Some(btree) = self.inner.get_mut(&milestone_key) { + *btree = Default::default() + } + } + + /// Take a mutable reference to the inner individual votes item. + #[allow(dead_code)] + pub(crate) fn as_mut(&mut self) -> &mut IndividualVotes { + &mut self.inner + } +} + +impl AsRef> for ImmutableIndividualVotes { + fn as_ref(&self) -> &IndividualVotes { + &self.inner + } +} diff --git a/pallets/proposals/src/impls/mod.rs b/pallets/proposals/src/impls/mod.rs new file mode 100644 index 00000000..47d4888e --- /dev/null +++ b/pallets/proposals/src/impls/mod.rs @@ -0,0 +1,5 @@ +pub mod immutable_votes; +pub mod pallet_impls; + +pub use immutable_votes::*; +pub use pallet_impls::*; diff --git a/pallets/proposals/src/impls.rs b/pallets/proposals/src/impls/pallet_impls.rs similarity index 91% rename from pallets/proposals/src/impls.rs rename to pallets/proposals/src/impls/pallet_impls.rs index 35349bb8..33c59203 100644 --- a/pallets/proposals/src/impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -43,9 +43,24 @@ impl Pallet { .map_err(|_| Error::::Overflow)?; Ok::<(), DispatchError>(()) })?; - UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); - >::insert(project_key, milestone_key, Vote::default()); + IndividualVoteStore::::try_mutate(project_key, |maybe_votes| { + if let Some(individual_votes) = maybe_votes { + individual_votes.clear_milestone_votes(milestone_key); + } else { + return Err(Error::::IndividualVoteNotFound.into()); + }; + Ok::<(), DispatchError>(()) + })?; + + MilestoneVotes::::try_mutate(project_key, |vote_btree| { + vote_btree + .try_insert(milestone_key, Vote::default()) + .map_err(|_| Error::::TooManyMilestoneVotes)?; + + Ok::<(), DispatchError>(()) + })?; + Self::deposit_event(Event::MilestoneSubmitted(who, project_key, milestone_key)); Self::deposit_event(Event::VotingRoundCreated(project_key)); Ok(().into()) @@ -70,23 +85,22 @@ impl Pallet { let now = frame_system::Pallet::::block_number(); let user_has_voted_key = (project_key, RoundType::VotingRound, milestone_key); - UserHasVoted::::try_mutate(user_has_voted_key, |votes| { - ensure!(!votes.contains_key(&who), Error::::VotesAreImmutable); - votes - .try_insert(who.clone(), approve_milestone) - .map_err(|_| Error::::Overflow)?; + IndividualVoteStore::::try_mutate(project_key, |maybe_individual_votes| { + if let Some(individual_votes) = maybe_individual_votes { + individual_votes.insert_individual_vote(milestone_key, &who, approve_milestone)?; + } Ok::<(), DispatchError>(()) })?; let vote: Vote> = - MilestoneVotes::::try_mutate(project_key, milestone_key, |vote| { - if let Some(v) = vote { + MilestoneVotes::::try_mutate(project_key, |vote_btree| { + if let Some(vote) = vote_btree.get_mut(&milestone_key) { if approve_milestone { - v.yay = v.yay.saturating_add(contribution_amount); + vote.yay = vote.yay.saturating_add(contribution_amount); } else { - v.nay = v.nay.saturating_add(contribution_amount); + vote.nay = vote.nay.saturating_add(contribution_amount); } - Ok::>, DispatchError>(v.clone()) + Ok::>, DispatchError>(vote.clone()) } else { Err(Error::::VotingRoundNotStarted.into()) } @@ -102,6 +116,7 @@ impl Pallet { user_has_voted_key, who.clone(), )?; + Self::deposit_event(Event::VoteSubmitted( who, project_key, @@ -426,14 +441,14 @@ impl Pallet { } }); + Self::close_voting_round(project_key, user_has_voted_key)?; + Self::deposit_event(Event::MilestoneApproved( who, project_key, user_has_voted_key.2, >::block_number(), )); - - Self::close_voting_round(project_key, user_has_voted_key)?; } if vote.nay >= funding_threshold { @@ -457,7 +472,15 @@ impl Pallet { // Prevent hook from calling. RoundsExpiring::::remove(exp_block); // Allow future votes to occur on this milestone - UserHasVoted::::remove(user_has_voted_key); + IndividualVoteStore::::try_mutate(project_key, |maybe_individual_votes| { + if let Some(individual_votes) = maybe_individual_votes { + individual_votes.clear_milestone_votes(user_has_voted_key.2); + } else { + return Err(Error::::IndividualVoteNotFound.into()); + } + Ok::<(), DispatchError>(()) + })?; + Ok(()) } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 6b483e2e..22404984 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -37,9 +37,15 @@ pub use weights::*; pub mod migration; pub mod impls; -pub use impls::*; + pub type ProjectKey = u32; pub type MilestoneKey = u32; +pub type IndividualVotes = BoundedBTreeMap< + MilestoneKey, + BoundedBTreeMap, bool, ::MaximumContributorsPerProject>, + ::MaxMilestonesPerProject, +>; + pub type AccountIdOf = ::AccountId; pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; pub type StorageItemOf = @@ -100,7 +106,7 @@ pub mod pallet { type PercentRequiredForVoteNoConfidenceToPass: Get; } - const STORAGE_VERSION: StorageVersion = StorageVersion::new(5); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -120,16 +126,18 @@ pub mod pallet { ValueQuery, >; + #[pallet::storage] + pub type IndividualVoteStore = + StorageMap<_, Blake2_128Concat, ProjectKey, ImmutableIndividualVotes, OptionQuery>; + #[pallet::storage] #[pallet::getter(fn milestone_votes)] - pub(super) type MilestoneVotes = StorageDoubleMap< + pub(super) type MilestoneVotes = StorageMap< _, Identity, ProjectKey, - Identity, - MilestoneKey, - Vote>, - OptionQuery, + BoundedBTreeMap>, T::MaxMilestonesPerProject>, + ValueQuery, >; #[pallet::storage] @@ -267,6 +275,10 @@ pub mod pallet { TooManyMilestones, /// There are too many projects for a given account TooManyProjects, + /// There are too many milestone votes, this generally shouldnt be hit. + TooManyMilestoneVotes, + /// An internal error, a collection of votes for a milestone has been lost.s + IndividualVoteNotFound, } #[pallet::hooks] @@ -288,12 +300,15 @@ pub mod pallet { RoundType::VotingRound => { weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 2)); - MilestoneVotes::::remove(project_key, milestone_key); - UserHasVoted::::remove(( - project_key, - RoundType::VotingRound, - milestone_key, - )); + MilestoneVotes::::mutate(project_key, |vote_btree| { + vote_btree.remove(milestone_key); + }); + + IndividualVoteStore::::mutate(project_key, |m_votes| { + if let Some(individual_votes) = m_votes { + individual_votes.clear_milestone_votes(*milestone_key); + } + }); } // Votes of no confidence do not finaliese automatically RoundType::VoteOfNoConfidence => { @@ -425,8 +440,13 @@ pub mod pallet { FundingType::Grant(_) => {} } + // TODO: this milestone key has no relation to the milestones coming in except the order they come in. + // This could be a bug somewhere. let mut milestone_key: u32 = 0; let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); + let mut bounded_milestone_keys: BoundedVec = + BoundedVec::new(); + for milestone in proposed_milestones { let milestone = Milestone { project_key, @@ -437,9 +457,17 @@ pub mod pallet { milestones .try_insert(milestone_key, milestone) .map_err(|_| Error::::TooManyMilestones)?; + + bounded_milestone_keys + .try_push(milestone_key) + .map_err(|_| Error::::TooManyMilestones)?; + milestone_key = milestone_key.saturating_add(1); } + let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys); + IndividualVoteStore::::insert(project_key, individual_votes); + let bounded_contributions: ContributionsFor = contributions .try_into() .map_err(|_| Error::::TooManyContributions)?; @@ -484,7 +512,6 @@ pub enum RoundType { /// The milestones provided by the user to define the milestones of a project. /// TODO: add ipfs hash like in the grants pallet and /// TODO: move these to a common repo (common_types will do) -// MIGRATION! for briefs and grants #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub struct ProposedMilestone { pub percentage_to_unlock: Percent, @@ -552,6 +579,13 @@ pub struct Whitelist { max_cap: Balance, } +/// Stores the btree for each individual vote. +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] +#[scale_info(skip_type_params(T))] +pub struct ImmutableIndividualVotes { + inner: IndividualVotes, +} + pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index fc2fa39c..9155d63d 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -346,7 +346,7 @@ pub mod v3 { v3::OldMilestoneVotes::::drain().for_each(|(old_key, vote)| { *weight += T::DbWeight::get().reads(1); let (project_key, milestone_key) = old_key; - crate::MilestoneVotes::::insert(project_key, milestone_key, vote); + v6::MilestoneVotes::::insert(project_key, milestone_key, vote); *weight += T::DbWeight::get().reads_writes(1, 1); }); } @@ -432,9 +432,9 @@ pub mod v4 { if let Some(project) = crate::Projects::::get(project_key) { for (milestone_key, _) in project.milestones.iter() { *weight = weight.saturating_add(T::DbWeight::get().reads(1)); - if crate::MilestoneVotes::::contains_key(project_key, milestone_key) { + if v6::MilestoneVotes::::contains_key(project_key, milestone_key) { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - crate::MilestoneVotes::::remove(project_key, milestone_key); + v6::MilestoneVotes::::remove(project_key, milestone_key); } else { break; } @@ -484,6 +484,7 @@ pub mod v4 { pub mod v5 { use super::*; + #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; @@ -498,6 +499,7 @@ pub mod v5 { V4, } + /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 pub struct MigrateToV5(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV5 { #[cfg(feature = "try-runtime")] @@ -552,6 +554,130 @@ pub mod v5 { } } +pub mod v6 { + use super::*; + + #[storage_alias] + pub(super) type MilestoneVotes = StorageDoubleMap< + Pallet, + Identity, + ProjectKey, + Identity, + MilestoneKey, + Vote>, + OptionQuery, + >; + + // Since we are keeping the depricated vote of no confidence for the meantime + // only migrate the voting rounds awaiting the migration to remove no confidence rounds. + // User votes is now handled by IndividualVoteStore:: + fn migrate_user_has_voted(weight: &mut Weight) { + Projects::::iter().for_each(|(project_key, project)| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + project.milestones.keys().for_each(|milestone_key| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + UserHasVoted::::remove((project_key, RoundType::VotingRound, milestone_key)); + if let Some(expiry) = + Rounds::::take((project_key, milestone_key), RoundType::VotingRound) + { + RoundsExpiring::::remove(expiry); + }; + }); + let bounded_keys: BoundedVec = project + .milestones + .keys() + .copied() + .collect::>() + .try_into() + .expect("milestone keys and bounded keys have the same bound; qed"); + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + let individual_votes = ImmutableIndividualVotes::::new(bounded_keys); + IndividualVoteStore::::insert(project_key, individual_votes); + }) + } + + /// 2: MilestoneVotes migration to use a BTree instead of a double map: https://github.com/ImbueNetwork/imbue/issues/213 + fn migrate_milestone_votes(weight: &mut Weight) { + // Highly in-memory intensive but on the plus side not many reads/writes to db. + // I can write a less in memory one if anyone wants using crate::MilestoneVotes::mutate(). + let mut parent: BTreeMap>>> = + Default::default(); + v6::MilestoneVotes::::drain().for_each(|(project_key, milestone_key, vote)| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + if let Some(child) = parent.get_mut(&project_key) { + child.insert(milestone_key, vote); + } else { + let mut child: BTreeMap>> = Default::default(); + child.insert(milestone_key, vote); + parent.insert(project_key, child); + } + }); + + parent.iter().for_each(|(key, btree)| { + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + if let Ok(bounded_btree) = + TryInto::>::try_into( + btree.to_owned(), + ) + { + crate::MilestoneVotes::::insert(key, bounded_btree); + } else { + // chill bruh the bound has been violated. + // probs wont happen. + } + }) + } + + pub struct MigrateToV6(T); + impl OnRuntimeUpgrade for MigrateToV6 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); + let current = as GetStorageVersion>::current_storage_version(); + let onchain = as GetStorageVersion>::on_chain_storage_version(); + ensure!( + current == 6 && onchain == 5, + "Current version must be set to v6 and onchain to v5" + ); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads_writes(1, 1); + log::warn!("****** STARTING MIGRATION *****"); + + let current = as GetStorageVersion>::current_storage_version(); + let onchain = as GetStorageVersion>::on_chain_storage_version(); + if current == 6 && onchain == 5 { + // Migrations + migrate_milestone_votes::(&mut weight); + migrate_user_has_voted::(&mut weight); + + log::warn!("v6 has been successfully applied"); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); + } else { + log::warn!("Skipping v6 due to mismatched version, this be removed from Executive"); + weight = weight.saturating_add(T::DbWeight::get().reads(1)); + } + + log::warn!("****** ENDING MIGRATION *****"); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-proposals", "Running post_upgrade()"); + + ensure!( + Pallet::::current_storage_version() == 6, + "Storage version should be v6 after the migration" + ); + + Ok(()) + } + } +} + #[cfg(test)] mod test { use super::*; @@ -830,8 +956,8 @@ mod test { v3::OldMilestoneVotes::::get((10, 10)), Default::default() ); - assert!(crate::MilestoneVotes::::contains_key(10, 10)); - let v = crate::MilestoneVotes::::get(10, 10).unwrap(); + assert!(v6::MilestoneVotes::::contains_key(10, 10)); + let v = v6::MilestoneVotes::::get(10, 10).unwrap(); assert_eq!(v.yay, 100_000); assert_eq!(v.nay, 50_000); assert!(!v.is_approved); @@ -862,8 +988,8 @@ mod test { // insert a fake round to be mutated. v4::V4Rounds::::insert(project_key, crate::RoundType::VotingRound, expiry_block); crate::RoundsExpiring::::insert(expiry_block, rounds_expiring); - crate::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); - crate::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); + v6::MilestoneVotes::::insert(project_key, milestone_key, Vote::default()); + v6::MilestoneVotes::::insert(project_key, milestone_key + 1, Vote::default()); let mut weight = ::default(); v4::migrate_votes::(&mut weight); @@ -876,8 +1002,8 @@ mod test { crate::RoundType::VotingRound )); assert!(crate::RoundsExpiring::::get(expiry_block).is_empty()); - assert!(crate::MilestoneVotes::::get(project_key, milestone_key).is_none()); - assert!(crate::MilestoneVotes::::get(project_key, milestone_key + 1).is_none()); + assert!(v6::MilestoneVotes::::get(project_key, milestone_key).is_none()); + assert!(v6::MilestoneVotes::::get(project_key, milestone_key + 1).is_none()); }) } } diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index c071c299..8e278366 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,9 +1,6 @@ use crate::Config; use crate::Pallet as Proposals; -use crate::{ - AccountIdOf, BalanceOf, Contribution, ContributionsFor, Milestone, MilestoneKey, Project, - ProjectKey, ProposedMilestone, -}; +use crate::*; use common_types::{CurrencyId, FundingType}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, Vec}; @@ -95,6 +92,8 @@ pub fn create_project( let mut milestone_key: u32 = 0; let mut milestones: BTreeMap = BTreeMap::new(); + let mut bounded_milestone_keys: BoundedVec = + BoundedVec::new(); for ms in proposed_milestones { let milestone = Milestone { @@ -104,9 +103,13 @@ pub fn create_project( is_approved: false, }; milestones.insert(milestone_key, milestone); + let _ = bounded_milestone_keys.try_push(milestone_key); milestone_key = milestone_key.saturating_add(1); } + let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys); + IndividualVoteStore::::insert(project_key, individual_votes); + let project = Project { milestones: milestones.try_into().expect("too many milestones"), contributions, diff --git a/pallets/proposals/src/tests/immutable_votes.rs b/pallets/proposals/src/tests/immutable_votes.rs new file mode 100644 index 00000000..71ef84fc --- /dev/null +++ b/pallets/proposals/src/tests/immutable_votes.rs @@ -0,0 +1,96 @@ +use crate::{mock::*, *}; + +use frame_support::{assert_noop, assert_ok}; + +#[test] +fn individual_votes_new_inserts_all_milestone_keys() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); + let i = ImmutableIndividualVotes::::new(milestone_keys.clone()); + for key in milestone_keys { + assert!( + i.as_ref().get(&key).unwrap().is_empty(), + "A milestone key should have been inserted, and the map must be empty." + ); + } + }) +} + +#[test] +fn individual_votes_insert_vote_works() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); + let voting_key = milestone_keys[0]; + let mut i = ImmutableIndividualVotes::::new(milestone_keys); + assert_ok!(i.insert_individual_vote(voting_key, &ALICE, true)); + assert_ok!(i.insert_individual_vote(voting_key, &BOB, false)); + assert_eq!( + i.as_ref().get(&voting_key).unwrap().get(&ALICE).unwrap(), + &true, + "ALICE vote should exist and been voted true," + ); + assert_eq!( + i.as_ref().get(&voting_key).unwrap().get(&BOB).unwrap(), + &false, + "BOB vote should exist and been voted false." + ); + }) +} + +#[test] +fn individual_votes_votes_are_immutable() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); + let voting_key = milestone_keys[0]; + let mut i = ImmutableIndividualVotes::::new(milestone_keys); + i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); + assert_noop!( + i.insert_individual_vote(voting_key, &ALICE, false), + Error::::VotesAreImmutable + ); + }) +} + +#[test] +fn individual_votes_cannot_vote_on_non_existant_milestone() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); + let voting_key = 4; + let mut i = ImmutableIndividualVotes::::new(milestone_keys); + assert_noop!( + i.insert_individual_vote(voting_key, &ALICE, true), + Error::::IndividualVoteNotFound + ); + }) +} + +#[test] +fn individual_votes_clear_votes_actually_clears() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); + let voting_key = milestone_keys[0]; + let mut i = ImmutableIndividualVotes::::new(milestone_keys); + i.insert_individual_vote(voting_key, &ALICE, true).unwrap(); + i.insert_individual_vote(voting_key, &BOB, true).unwrap(); + i.clear_milestone_votes(voting_key); + assert!( + i.as_ref().get(&voting_key).unwrap().is_empty(), + "The btree should have been emptied after a cleared vote." + ); + }) +} diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs new file mode 100644 index 00000000..0e42d240 --- /dev/null +++ b/pallets/proposals/src/tests/mod.rs @@ -0,0 +1,2 @@ +pub mod immutable_votes; +pub mod pallet; diff --git a/pallets/proposals/src/tests.rs b/pallets/proposals/src/tests/pallet.rs similarity index 94% rename from pallets/proposals/src/tests.rs rename to pallets/proposals/src/tests/pallet.rs index 800bc79d..895827e3 100644 --- a/pallets/proposals/src/tests.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -86,7 +86,8 @@ fn submit_milestone_creates_non_bias_vote() { project_key, 1 )); - let created_vote = MilestoneVotes::::get(project_key, 1).expect("should exist"); + let total_vote = MilestoneVotes::::get(project_key); + let created_vote = total_vote.get(&1).expect("should exist"); assert_eq!(created_vote.nay, 0, "initial vote should be default"); assert_eq!(created_vote.yay, 0, "initial vote should be default"); @@ -124,11 +125,14 @@ fn submit_milestone_can_resubmit_during_voting_round() { 0usize, "User votes should be defaulted on resubmission." ); - let group_vote = MilestoneVotes::::get(project_key, milestone_key) + let total_vote = MilestoneVotes::::get(project_key); + + let group_vote = total_vote + .get(&milestone_key) .expect("group vote should exist."); assert_eq!( group_vote, - Default::default(), + & as Default>::default(), "Group vote should have defaulted on resubmission" ); }); @@ -218,9 +222,17 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { RoundType::VotingRound, milestone_key ))); + + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - UserHasVoted::::get((&project_key, RoundType::VotingRound, milestone_key)) - .contains_key(&BOB) + individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .get(&BOB) + .unwrap() + == &true, + "IndividualVoteStore has not been mutated correctly." ); // Assert the storage has been cleared up after finalisation @@ -239,10 +251,12 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { 0, "This vec should have been emptied on auto finalisation." ); - assert!( - UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)) - .is_empty() - ); + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); + assert!(!individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .contains_key(&BOB)); }); } @@ -273,11 +287,18 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { RoundType::VotingRound, milestone_key ))); + + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); assert!( - UserHasVoted::::get((&project_key, RoundType::VotingRound, milestone_key)) - .contains_key(&BOB) + individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .get(&BOB) + .unwrap() + == &false, + "IndividualVoteStore has not been mutated correctly." ); - // Assert the storage has been cleared up after finalisation assert_ok!(Proposals::vote_on_milestone( RuntimeOrigin::signed(*CHARLIE), @@ -294,10 +315,12 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { 0, "This vec should have been emptied on auto finalisation." ); - assert!( - UserHasVoted::::get((project_key, RoundType::VotingRound, milestone_key)) - .is_empty() - ); + let individual_votes = IndividualVoteStore::::get(project_key).unwrap(); + assert!(!individual_votes + .as_ref() + .get(&milestone_key) + .unwrap() + .contains_key(&BOB)); }); } @@ -331,13 +354,18 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { milestone_key_1, true )); - let vote_0 = - MilestoneVotes::::get(project_key, milestone_key_0).expect("vote should exist"); + let total_votes = MilestoneVotes::::get(project_key); + + let vote_0 = total_votes + .get(&milestone_key_0) + .expect("vote 0 should exist"); + assert!(vote_0.yay == 100_000u64); assert!(vote_0.nay == 0u64); - let vote_1 = - MilestoneVotes::::get(project_key, milestone_key_1).expect("vote should exist"); + let vote_1 = total_votes + .get(&milestone_key_1) + .expect("vote 1 should exist"); assert!(vote_1.yay == 100_000u64); assert!(vote_1.nay == 0u64); }); @@ -488,8 +516,8 @@ fn vote_on_milestone_actually_adds_to_vote() { milestone_key, true )); - let vote = - MilestoneVotes::::get(project_key, milestone_key).expect("vote should exist"); + let total_votes = MilestoneVotes::::get(project_key); + let vote = total_votes.get(&milestone_key).expect("vote should exist"); assert!(vote.yay == 100_000u64); assert!(vote.nay == 0u64); assert_ok!(Proposals::vote_on_milestone( @@ -498,8 +526,9 @@ fn vote_on_milestone_actually_adds_to_vote() { milestone_key, false )); - let vote = - MilestoneVotes::::get(project_key, milestone_key).expect("vote should exist"); + let total_votes = MilestoneVotes::::get(project_key); + let vote = total_votes.get(&milestone_key).expect("vote should exist"); + assert!(vote.yay == 100_000u64); assert!(vote.nay == 100_000u64); }); @@ -1147,15 +1176,27 @@ fn close_voting_round_works() { .try_into() .expect("smaller than bound: qed."); RoundsExpiring::::insert(100, r_expiring); - UserHasVoted::::insert((0, RoundType::VotingRound, 0), BoundedBTreeMap::new()); + let milestone_keys = vec![0]; + let mut i_v = ImmutableIndividualVotes::::new(milestone_keys.try_into().unwrap()); + assert_ok!(i_v.insert_individual_vote(0, &ALICE, true)); + + IndividualVoteStore::::insert(0, i_v); assert_ok!(crate::Pallet::::close_voting_round( 0, (0, RoundType::VotingRound, 0) )); + assert!(Rounds::::get((0, 0), RoundType::VotingRound).is_none()); assert!(RoundsExpiring::::get(100).len() == 0); - assert!(UserHasVoted::::get((0, RoundType::VotingRound, 0)).is_empty()); + let individual_votes = IndividualVoteStore::::get(0); + assert!(individual_votes.is_some()); + assert!(individual_votes + .unwrap() + .as_ref() + .get(&0) + .unwrap() + .is_empty()); }) } diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 2090d32d..70f92919 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -12,7 +12,7 @@ mod sanity; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; -use sp_api::impl_runtime_apis; +use sp_api::{impl_runtime_apis, Encode}; use sp_core::OpaqueMetadata; use common_runtime::storage_deposits::StorageDepositItems; @@ -100,7 +100,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("imbue"), impl_name: create_runtime_str!("imbue"), authoring_version: 2, - spec_version: 9432, + spec_version: 9434, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, @@ -180,11 +180,7 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - pallet_proposals::migration::v5::MigrateToV5, - pallet_briefs::migrations::v2::MigrateToV2, - pallet_grants::migrations::v3::MigrateToV3, - ); + pub type Unreleased = (pallet_proposals::migration::v6::MigrateToV6,); } /// Executive: handles dispatch to the various modules. @@ -1154,10 +1150,21 @@ impl_runtime_apis! { } } - impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { + impl pallet_proposals_rpc_runtime_api::ProposalsApi for Runtime { fn get_project_account_by_id(project_id: u32) -> AccountId { ImbueProposals::project_account_id(project_id) } + + /// (Project, ImmutableindividualVotes) + fn get_all_project_data(project_key: u32) -> Option<(Vec, Vec)> { + use pallet_proposals::{Project, Projects, ImmutableIndividualVotes, IndividualVoteStore}; + + if let Some(project) = Projects::::get(project_key) { + IndividualVoteStore::::get(project_key).map(|individual_votes| ( as Encode>::encode(&project), as Encode>::encode(&individual_votes))) + } else { + None + } + } } From ed77239bcdf9ab05192d8a02dd4f19e0578da3ce Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 12 Oct 2023 12:49:32 +0100 Subject: [PATCH 111/192] refactoring --- pallets/proposals/src/impls/pallet_impls.rs | 7 +++---- pallets/proposals/src/lib.rs | 12 ++++-------- pallets/proposals/src/tests/pallet.rs | 2 ++ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 0efaa2ca..812f53c7 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -427,13 +427,13 @@ impl Pallet { Ok(().into()) } - // TODO: test /// Try and fund a project based on its FundingPath. + /// Will error is the /// If the funds have actually been transferred this will return and Ok(true) /// If the funds have not been transferred (i.e awaiting funding) then it will return Ok(false) pub(crate) fn fund_project<'a>( funding_path: &'a FundingPath, - contributions: &'a BTreeMap, Contribution, BlockNumberFor>>, + contributions: &'a ContributionsFor, project_account_id: &'a T::AccountId, currency_id: CurrencyId, ) -> Result { @@ -456,9 +456,8 @@ impl Pallet { } } - // TODO: Test /// Try and convert some proposed milestones to milestones. - /// Fails when the MaxMilestones bound is not respected + /// Will never fail so long as proposed_milestones and BoundedBTreeMilestones have the same bound. pub(crate) fn try_convert_to_milestones( proposed_milestones: BoundedVec, project_key: ProjectKey, diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index fac00157..0b570f6a 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -303,7 +303,6 @@ pub mod pallet { TooManyMilestones, /// There are too many projects for a given account TooManyProjects, -<<<<<<< HEAD /// Not enough funds in project account to distribute fees. NotEnoughFundsForFees, /// Conversion failed due to an error while funding the Project. @@ -314,8 +313,6 @@ pub mod pallet { TooManyRefundLocations, /// This project has too many jury members. TooManyJuryMembers, -======= ->>>>>>> origin /// There are too many milestone votes, this generally shouldnt be hit. TooManyMilestoneVotes, /// An internal error, a collection of votes for a milestone has been lost.s @@ -442,7 +439,7 @@ pub mod pallet { /// With briefs and grants the caller is the beneficiary, so the fee will come from them. fn convert_to_proposal( currency_id: CurrencyId, - contributions: BoundedBTreeMap, Contribution, BlockNumberFor>, Self::MaximumContributorsPerProject>, + contributions: ContributionsFor, agreement_hash: H256, benificiary: AccountIdOf, proposed_milestones: BoundedVec, @@ -522,8 +519,10 @@ pub mod pallet { Ok(()) } + /// Convert a set of contributions into their respective refund locations. + /// Only for local contributions. fn convert_contributions_to_refund_locations( - contributions: &BoundedBTreeMap, Contribution, BlockNumberFor>, Self::MaximumContributorsPerProject>, + contributions: &ContributionsFor, ) -> BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> { let sum_of_contributions = contributions .values() @@ -663,7 +662,6 @@ pub struct Whitelist { max_cap: Balance, } -<<<<<<< HEAD /// Defines how a project is funded on its instantiation. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen, Default)] pub enum FundingPath { @@ -677,8 +675,6 @@ pub enum FundingPath { WaitForFunding, } -======= ->>>>>>> origin /// Stores the btree for each individual vote. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 8d9b0ccf..d02cff53 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -1310,6 +1310,8 @@ fn close_voting_round_works() { }) } +try_convert_to_milestones + // todo: finalise voteof no confidence tests. // ^^ is connected to making the pallet generic over funding type. // Todo: assert the last event of each extrinsic/ From 1c0ed6d01f351ce8eda1978e9567df5586e982ee Mon Sep 17 00:00:00 2001 From: Shankar Rao Mata Date: Sat, 14 Oct 2023 17:33:36 -0400 Subject: [PATCH 112/192] mark the no_confidence as deprecated with the introduction of pallet-disputes --- pallets/proposals/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 28d68e00..231daa3d 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -364,6 +364,10 @@ pub mod pallet { /// In case of contributors losing confidence in the initiator a "Vote of no confidence" can be called. /// This will start a round which each contributor can vote on. /// The round will last as long as set in the Config. + + /// Deprecated: This function is no longer recommended for use as all the handling of dispute handling will + /// be taken care by the dedicated pallet called pallet-disputes. + #[deprecated(since = "0.1.0 of the disputes pallet", note = "all the disputes handling will be taken care by pallet-disputes")] #[pallet::call_index(12)] #[pallet::weight(::WeightInfo::raise_vote_of_no_confidence())] pub fn raise_vote_of_no_confidence( From 46270b1abcebc28b02672760e037ff2384b7a464 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 16 Oct 2023 13:42:45 +0100 Subject: [PATCH 113/192] migration for new fields --- Cargo.lock | 15608 ++++++++++++++++++++ libs/common-types/src/milestone_origin.rs | 9 +- pallets/proposals/src/lib.rs | 5 +- pallets/proposals/src/migration.rs | 82 + 4 files changed, 15692 insertions(+), 12 deletions(-) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..80df1bc7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,15608 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.3", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.0", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", +] + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array 0.14.7", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.4.4", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead 0.5.2", + "aes 0.8.3", + "cipher 0.4.4", + "ctr 0.9.2", + "ghash 0.5.0", + "subtle", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if 1.0.0", + "getrandom 0.2.10", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "always-assert" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4436e0292ab1bb631b42973c61205e704475fe8126af845c8d923c0996328127" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "array-bytes" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" + +[[package]] +name = "array-bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "asn1-rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +dependencies = [ + "asn1-rs-derive 0.1.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive 0.4.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "assert_cmd" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936fcf2c692b37c696cd0002c57752b2d9478402450c9ca4a463f6afae16d6f5" +dependencies = [ + "doc-comment", + "escargot", + "predicates 1.0.8", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg 1.1.0", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.25", + "slab", + "socket2 0.4.9", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "async-trait" +version = "0.1.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.13", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line 0.21.0", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object 0.32.1", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + +[[package]] +name = "binary-merkle-tree" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "hash-db 0.16.0", + "log", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "prettyplease 0.2.15", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.38", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq", +] + +[[package]] +name = "blake2s_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-modes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +dependencies = [ + "block-padding 0.2.1", + "cipher 0.2.5", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "bounded-collections" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +dependencies = [ + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", +] + +[[package]] +name = "bounded-vec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" +dependencies = [ + "thiserror", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bstr" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +dependencies = [ + "memchr", + "regex-automata 0.4.2", + "serde", +] + +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-llvm-cov" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b1166ec60eb02f25c98cefbc7c0ec2875f944b8c44d3483394c4b4e7ab96ca" +dependencies = [ + "anyhow", + "atty", + "camino", + "cargo_metadata 0.14.2", + "clap 3.2.25", + "duct", + "fs-err", + "glob", + "home", + "is_executable", + "opener", + "regex", + "rustc-demangle", + "serde", + "serde_json", + "shell-escape", + "termcolor", + "walkdir", +] + +[[package]] +name = "cargo-platform" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.20", + "serde", + "serde_json", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.20", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "casey" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614586263949597dcc18675da12ef9b429135e13628d92eb8b8c6fa50ca5656b" +dependencies = [ + "syn 1.0.109", +] + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "ccm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" +dependencies = [ + "aead 0.3.2", + "cipher 0.2.5", + "subtle", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-expr" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +dependencies = [ + "smallvec 1.11.1", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chacha20" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +dependencies = [ + "aead 0.4.3", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.48.5", +] + +[[package]] +name = "ciborium" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" + +[[package]] +name = "ciborium-ll" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "cid" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" +dependencies = [ + "core2", + "multibase", + "multihash 0.16.3", + "serde", + "unsigned-varint", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags 1.3.2", + "strsim 0.8.0", + "textwrap 0.11.0", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive 3.2.25", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.16.0", +] + +[[package]] +name = "clap" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +dependencies = [ + "clap_builder", + "clap_derive 4.4.2", +] + +[[package]] +name = "clap_builder" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.5.1", + "strsim 0.10.0", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "coarsetime" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a73ef0d00d14301df35d0f13f5ea32344de6b00837485c358458f1e7f2d27db4" +dependencies = [ + "libc", + "once_cell", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "comfy-table" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" +dependencies = [ + "strum", + "strum_macros", + "unicode-width", +] + +[[package]] +name = "common-runtime" +version = "2.0.0" +dependencies = [ + "common-traits", + "common-types", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "hex", + "hex-literal 0.3.4", + "orml-traits", + "pallet-authorship", + "pallet-balances", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "scale-info 1.0.0", + "serde", + "smallvec 1.11.1", + "sp-arithmetic", + "sp-consensus-aura", + "sp-core", + "sp-runtime", + "sp-std", + "substrate-wasm-builder", + "xcm", +] + +[[package]] +name = "common-traits" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "common-types" +version = "0.1.0" +dependencies = [ + "bitflags 1.3.2", + "common-traits", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "concurrent-queue" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "cpu-time" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e393a7668fe1fad3075085b86c781883000b4ede868f43627b34a87c8b7ded" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-bforest" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "cranelift-isle", + "gimli 0.27.3", + "hashbrown 0.13.2", + "log", + "regalloc2", + "smallvec 1.11.1", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" + +[[package]] +name = "cranelift-entity" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec 1.11.1", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" + +[[package]] +name = "cranelift-native" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.10.5", + "log", + "smallvec 1.11.1", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap 4.4.6", + "criterion-plot", + "futures 0.3.28", + "is-terminal", + "itertools 0.10.5", + "num-traits", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "tokio", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools 0.10.5", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard 1.2.0", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher 0.3.0", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", +] + +[[package]] +name = "cumulus-client-cli" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "clap 4.4.6", + "parity-scale-codec 3.6.5", + "sc-chain-spec", + "sc-cli", + "sc-service", + "sp-core", + "sp-runtime", + "url", +] + +[[package]] +name = "cumulus-client-collator" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-client-consensus-common", + "cumulus-client-network", + "cumulus-primitives-core", + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-consensus", + "sp-core", + "sp-runtime", + "tracing", +] + +[[package]] +name = "cumulus-client-consensus-aura" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-client-collator", + "cumulus-client-consensus-common", + "cumulus-client-consensus-proposer", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-interface", + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "polkadot-node-primitives", + "polkadot-overseer", + "polkadot-primitives", + "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-slots", + "sc-telemetry", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "cumulus-client-consensus-common" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-client-pov-recovery", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "dyn-clone", + "futures 0.3.28", + "log", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "sc-client-api", + "sc-consensus", + "schnellru", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-trie", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "cumulus-client-consensus-proposer" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "anyhow", + "async-trait", + "cumulus-primitives-parachain-inherent", + "sp-consensus", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "cumulus-client-consensus-relay-chain" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-client-consensus-common", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures 0.3.28", + "parking_lot 0.12.1", + "sc-consensus", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "cumulus-client-network" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-relay-chain-interface", + "futures 0.3.28", + "futures-timer", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-parachain", + "polkadot-primitives", + "sc-client-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "tracing", +] + +[[package]] +name = "cumulus-client-pov-recovery" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures 0.3.28", + "futures-timer", + "parity-scale-codec 3.6.5", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "rand 0.8.5", + "sc-client-api", + "sc-consensus", + "sp-consensus", + "sp-maybe-compressed-blob", + "sp-runtime", + "tracing", +] + +[[package]] +name = "cumulus-client-service" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-client-cli", + "cumulus-client-collator", + "cumulus-client-consensus-common", + "cumulus-client-network", + "cumulus-client-pov-recovery", + "cumulus-primitives-core", + "cumulus-relay-chain-inprocess-interface", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-minimal-node", + "futures 0.3.28", + "polkadot-primitives", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-sync", + "sc-network-transactions", + "sc-rpc", + "sc-service", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-transaction-pool", +] + +[[package]] +name = "cumulus-pallet-aura-ext" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "frame-support", + "frame-system", + "pallet-aura", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-pallet-dmp-queue" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "cumulus-pallet-parachain-system" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "bytes", + "cumulus-pallet-parachain-system-proc-macro", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "environmental", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "scale-info 2.9.0", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "xcm", +] + +[[package]] +name = "cumulus-pallet-parachain-system-proc-macro" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "cumulus-pallet-xcm" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "cumulus-pallet-xcmp-queue" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "polkadot-runtime-common", + "rand_chacha 0.3.1", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "cumulus-primitives-core" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "parity-scale-codec 3.6.5", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-primitives", + "scale-info 2.9.0", + "sp-api", + "sp-runtime", + "sp-std", + "sp-trie", + "xcm", +] + +[[package]] +name = "cumulus-primitives-parachain-inherent" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "parity-scale-codec 3.6.5", + "sc-client-api", + "scale-info 2.9.0", + "sp-api", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", + "tracing", +] + +[[package]] +name = "cumulus-primitives-timestamp" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "sp-inherents", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "cumulus-primitives-utility" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "log", + "parity-scale-codec 3.6.5", + "polkadot-runtime-common", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "cumulus-relay-chain-inprocess-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures 0.3.28", + "futures-timer", + "polkadot-cli", + "polkadot-client", + "polkadot-service", + "sc-cli", + "sc-client-api", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sp-api", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "cumulus-relay-chain-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "futures 0.3.28", + "jsonrpsee-core", + "parity-scale-codec 3.6.5", + "polkadot-overseer", + "sc-client-api", + "sp-api", + "sp-blockchain", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "cumulus-relay-chain-minimal-node" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "array-bytes 6.1.0", + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-rpc-interface", + "futures 0.3.28", + "lru 0.9.0", + "polkadot-availability-recovery", + "polkadot-collator-protocol", + "polkadot-core-primitives", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-authority-discovery", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-service", + "sc-tracing", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-runtime", + "tokio", + "tracing", +] + +[[package]] +name = "cumulus-relay-chain-rpc-interface" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "futures 0.3.28", + "futures-timer", + "jsonrpsee", + "lru 0.9.0", + "parity-scale-codec 3.6.5", + "polkadot-overseer", + "sc-client-api", + "sc-rpc-api", + "sc-service", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-core", + "sp-state-machine", + "sp-storage", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "cumulus-test-relay-sproof-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "sp-runtime", + "sp-state-machine", + "sp-std", +] + +[[package]] +name = "cumulus-test-relay-validation-worker-provider" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "polkadot-node-core-pvf-worker", + "toml 0.7.8", +] + +[[package]] +name = "cumulus-test-runtime" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "pallet-balances", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api", + "sp-block-builder", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", +] + +[[package]] +name = "cumulus-test-service" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "async-trait", + "clap 4.4.6", + "criterion", + "cumulus-client-cli", + "cumulus-client-consensus-common", + "cumulus-client-consensus-relay-chain", + "cumulus-client-pov-recovery", + "cumulus-client-service", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-inprocess-interface", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-minimal-node", + "cumulus-test-relay-validation-worker-provider", + "cumulus-test-runtime", + "frame-system", + "frame-system-rpc-runtime-api", + "jsonrpsee", + "pallet-transaction-payment", + "parachains-common", + "parity-scale-codec 3.6.5", + "polkadot-cli", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "polkadot-service", + "polkadot-test-service", + "rand 0.8.5", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", + "sp-tracing", + "sp-trie", + "substrate-test-client", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms 3.1.2", + "rustc_version 0.4.0", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "cxx" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c390c123d671cc547244943ecad81bdaab756c6ea332d9ca9c1f48d952a24895" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d3d3ac9ffb900304edf51ca719187c779f4001bb544f26c4511d621de905cf" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.38", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94415827ecfea0f0c74c8cad7d1a86ddb3f05354d6a6ddeda0adee5e875d2939" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33dbbe9f5621c9247f97ec14213b04f350bff4b6cebefe834c60055db266ecf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "data-encoding-macro" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" +dependencies = [ + "asn1-rs 0.3.1", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn 1.0.109", +] + +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "duct" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ae3fc31835f74c2a7ceda3aeede378b0ae2e74c8f1c36559fcc9ae2a4e7d3e" +dependencies = [ + "libc", + "once_cell", + "os_pipe", + "shared_child", +] + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dyn-clone" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + +[[package]] +name = "ecdsa" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +dependencies = [ + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.6", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519 1.5.3", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.1.1", + "ed25519 2.2.3", + "rand_core 0.6.4", + "serde", + "sha2 0.10.8", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array 0.14.7", + "group 0.12.1", + "hkdf", + "pem-rfc7468", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.3", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", + "subtle", + "zeroize", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "enumflags2" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "enumn" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "escargot" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "768064bd3a0e2bedcba91dc87ace90beea91acc41b6a01a3ca8e9aa8827461bf" +dependencies = [ + "log", + "once_cell", + "serde", + "serde_json", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "exit-future" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8013f441e38e31c670e7f34ec8f1d5d3a2bd9d303c1ff83976ca886005e8f48" +dependencies = [ + "futures 0.1.31", + "parking_lot 0.7.1", +] + +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures 0.3.28", +] + +[[package]] +name = "expander" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +dependencies = [ + "blake3", + "fs-err", + "proc-macro2", + "quote", +] + +[[package]] +name = "expander" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", +] + +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "expander" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fatality" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +dependencies = [ + "fatality-proc-macro", + "thiserror", +] + +[[package]] +name = "fatality-proc-macro" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +dependencies = [ + "expander 0.0.4", + "indexmap 1.9.3", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "thiserror", +] + +[[package]] +name = "fdlimit" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +dependencies = [ + "libc", +] + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" + +[[package]] +name = "file-per-thread-logger" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" +dependencies = [ + "env_logger 0.10.0", + "log", +] + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + +[[package]] +name = "finality-grandpa" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" +dependencies = [ + "either", + "futures 0.3.28", + "futures-timer", + "log", + "num-traits", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "scale-info 2.9.0", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "libz-sys", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fork-tree" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + +[[package]] +name = "frame-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-support-procedural", + "frame-system", + "linregress", + "log", + "parity-scale-codec 3.6.5", + "paste 1.0.14", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "static_assertions", +] + +[[package]] +name = "frame-benchmarking-cli" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "Inflector", + "array-bytes 4.2.0", + "chrono", + "clap 4.4.6", + "comfy-table", + "frame-benchmarking", + "frame-support", + "frame-system", + "gethostname", + "handlebars", + "itertools 0.10.5", + "lazy_static", + "linked-hash-map", + "log", + "parity-scale-codec 3.6.5", + "rand 0.8.5", + "rand_pcg 0.3.1", + "sc-block-builder", + "sc-cli", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-service", + "sc-sysinfo", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-externalities", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-storage", + "sp-trie", + "thiserror", + "thousands", +] + +[[package]] +name = "frame-election-provider-solution-type" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "frame-election-provider-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-executive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "frame-try-runtime", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "frame-metadata" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if 1.0.0", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", +] + +[[package]] +name = "frame-remote-externalities" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-recursion", + "futures 0.3.28", + "indicatif", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "spinners", + "substrate-rpc-client", + "tokio", + "tokio-retry", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "bitflags 1.3.2", + "environmental", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec 3.6.5", + "paste 1.0.14", + "scale-info 2.9.0", + "serde", + "smallvec 1.11.1", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-debug-derive", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-weights", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "frame-support-procedural-tools", + "itertools 0.10.5", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "frame-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "cfg-if 1.0.0", + "frame-support", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-version", + "sp-weights", +] + +[[package]] +name = "frame-system-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-system-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "parity-scale-codec 3.6.5", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fs4" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" +dependencies = [ + "rustix 0.38.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.13", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "futures-rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +dependencies = [ + "futures-io", + "rustls 0.20.9", + "webpki 0.22.4", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite 0.2.13", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.5.3", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.6.1", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +dependencies = [ + "fallible-iterator", + "indexmap 1.9.3", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 1.9.3", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "handlebars" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.7", + "hmac 0.8.1", +] + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite 0.2.13", +] + +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite 0.2.13", + "socket2 0.4.9", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "log", + "rustls 0.20.9", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.23.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls 0.21.7", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.24.1", + "webpki-roots 0.23.1", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows 0.48.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if-addrs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "if-watch" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb892e5777fe09e16f3d44de7802f4daa7267ecbe8c466f19d94e25bb0c303e" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures 0.3.28", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration", + "tokio", + "windows 0.51.1", +] + +[[package]] +name = "imbue" +version = "2.0.0" +dependencies = [ + "assert_cmd", + "async-trait", + "cargo-llvm-cov", + "clap 4.4.6", + "common-runtime", + "cumulus-client-cli", + "cumulus-client-collator", + "cumulus-client-consensus-aura", + "cumulus-client-consensus-common", + "cumulus-client-consensus-relay-chain", + "cumulus-client-network", + "cumulus-client-pov-recovery", + "cumulus-client-service", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-relay-chain-inprocess-interface", + "cumulus-relay-chain-interface", + "cumulus-relay-chain-minimal-node", + "cumulus-relay-chain-rpc-interface", + "derive_more", + "exit-future 0.1.4", + "frame-benchmarking", + "frame-benchmarking-cli", + "futures 0.3.28", + "hex-literal 0.3.4", + "imbue-kusama-runtime", + "jsonrpsee", + "log", + "nix 0.17.0", + "pallet-collective", + "pallet-proposals-rpc", + "pallet-transaction-payment-rpc", + "pallet-xcm", + "parachains-common", + "parity-scale-codec 3.6.5", + "parking_lot 0.10.2", + "polkadot-cli", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-service", + "rand 0.7.3", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-consensus-grandpa", + "sc-executor", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-network-transactions", + "sc-rpc", + "sc-service", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-timestamp", + "sp-transaction-pool", + "structopt", + "substrate-build-script-utils", + "substrate-frame-rpc-system", + "substrate-prometheus-endpoint", + "substrate-state-trie-migration-rpc", + "tempfile", + "tokio", + "trie-root 0.15.2", + "try-runtime-cli", + "xcm", + "xcm-builder", +] + +[[package]] +name = "imbue-kusama-runtime" +version = "2.0.0" +dependencies = [ + "common-runtime", + "common-traits", + "common-types", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex", + "hex-literal 0.3.4", + "log", + "orml-asset-registry", + "orml-currencies", + "orml-tokens", + "orml-traits", + "orml-unknown-tokens", + "orml-xcm", + "orml-xcm-support", + "orml-xtokens", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-briefs", + "pallet-collator-selection", + "pallet-collective", + "pallet-democracy", + "pallet-deposits", + "pallet-grants", + "pallet-identity", + "pallet-membership", + "pallet-multisig", + "pallet-preimage", + "pallet-proposals", + "pallet-proposals-rpc-runtime-api", + "pallet-scheduler", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "parachain-info", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "polkadot-runtime-common", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-arithmetic", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec 3.6.5", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg 1.1.0", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + +[[package]] +name = "indicatif" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "integer-encoding" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "interceptor" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" +dependencies = [ + "async-trait", + "bytes", + "log", + "rand 0.8.5", + "rtcp", + "rtp", + "thiserror", + "tokio", + "waitgroup", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.3", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ip_network" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" + +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2 0.5.4", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi 0.3.3", + "rustix 0.38.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "is_executable" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +dependencies = [ + "winapi", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "jsonrpsee-ws-client", + "tracing", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls 0.24.1", + "tokio-util", + "tracing", + "webpki-roots 0.25.2", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +dependencies = [ + "anyhow", + "arrayvec 0.7.4", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "globset", + "hyper", + "jsonrpsee-types", + "parking_lot 0.12.1", + "rand 0.8.5", + "rustc-hash", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-http-client" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls 0.24.1", + "jsonrpsee-core", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +dependencies = [ + "heck 0.4.1", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +dependencies = [ + "futures-channel", + "futures-util", + "http", + "hyper", + "jsonrpsee-core", + "jsonrpsee-types", + "serde", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +dependencies = [ + "http", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa 0.16.8", + "elliptic-curve 0.13.6", + "once_cell", + "sha2 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "kusama-runtime" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "kusama-runtime-constants", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-multisig", + "pallet-nis", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-ranked-collective", + "pallet-recovery", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-runtime-api", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info 2.9.0", + "serde", + "serde_derive", + "smallvec 1.11.1", + "sp-api", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "kusama-runtime-constants" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec 1.11.1", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "kvdb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" +dependencies = [ + "smallvec 1.11.1", +] + +[[package]] +name = "kvdb-memorydb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "kvdb-rocksdb" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" +dependencies = [ + "kvdb", + "num_cpus", + "parking_lot 0.12.1", + "regex", + "rocksdb", + "smallvec 1.11.1", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libp2p" +version = "0.51.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +dependencies = [ + "bytes", + "futures 0.3.28", + "futures-timer", + "getrandom 0.2.10", + "instant", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", + "libp2p-dns", + "libp2p-identify", + "libp2p-identity", + "libp2p-kad", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-noise", + "libp2p-ping", + "libp2p-quic", + "libp2p-request-response", + "libp2p-swarm", + "libp2p-tcp", + "libp2p-wasm-ext", + "libp2p-webrtc", + "libp2p-websocket", + "libp2p-yamux", + "multiaddr", + "pin-project", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-core" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +dependencies = [ + "either", + "fnv", + "futures 0.3.28", + "futures-timer", + "instant", + "libp2p-identity", + "log", + "multiaddr", + "multihash 0.17.0", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec 1.11.1", + "thiserror", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-dns" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" +dependencies = [ + "futures 0.3.28", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "smallvec 1.11.1", + "trust-dns-resolver", +] + +[[package]] +name = "libp2p-identify" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" +dependencies = [ + "asynchronous-codec", + "either", + "futures 0.3.28", + "futures-timer", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "lru 0.10.1", + "quick-protobuf", + "quick-protobuf-codec", + "smallvec 1.11.1", + "thiserror", + "void", +] + +[[package]] +name = "libp2p-identity" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" +dependencies = [ + "bs58", + "ed25519-dalek 2.0.0", + "log", + "multiaddr", + "multihash 0.17.0", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "thiserror", + "zeroize", +] + +[[package]] +name = "libp2p-kad" +version = "0.43.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" +dependencies = [ + "arrayvec 0.7.4", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures 0.3.28", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "smallvec 1.11.1", + "thiserror", + "uint", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" +dependencies = [ + "data-encoding", + "futures 0.3.28", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec 1.11.1", + "socket2 0.4.9", + "tokio", + "trust-dns-proto", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" +dependencies = [ + "libp2p-core", + "libp2p-identify", + "libp2p-kad", + "libp2p-ping", + "libp2p-swarm", + "prometheus-client", +] + +[[package]] +name = "libp2p-noise" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" +dependencies = [ + "bytes", + "curve25519-dalek 3.2.0", + "futures 0.3.28", + "libp2p-core", + "libp2p-identity", + "log", + "once_cell", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "snow", + "static_assertions", + "thiserror", + "x25519-dalek 1.1.1", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" +dependencies = [ + "either", + "futures 0.3.28", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.8.5", + "void", +] + +[[package]] +name = "libp2p-quic" +version = "0.7.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" +dependencies = [ + "bytes", + "futures 0.3.28", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-tls", + "log", + "parking_lot 0.12.1", + "quinn-proto", + "rand 0.8.5", + "rustls 0.20.9", + "thiserror", + "tokio", +] + +[[package]] +name = "libp2p-request-response" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" +dependencies = [ + "async-trait", + "futures 0.3.28", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "rand 0.8.5", + "smallvec 1.11.1", +] + +[[package]] +name = "libp2p-swarm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" +dependencies = [ + "either", + "fnv", + "futures 0.3.28", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm-derive", + "log", + "rand 0.8.5", + "smallvec 1.11.1", + "tokio", + "void", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" +dependencies = [ + "heck 0.4.1", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "libp2p-tcp" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" +dependencies = [ + "futures 0.3.28", + "futures-timer", + "if-watch", + "libc", + "libp2p-core", + "log", + "socket2 0.4.9", + "tokio", +] + +[[package]] +name = "libp2p-tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" +dependencies = [ + "futures 0.3.28", + "futures-rustls", + "libp2p-core", + "libp2p-identity", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.20.9", + "thiserror", + "webpki 0.22.4", + "x509-parser 0.14.0", + "yasna", +] + +[[package]] +name = "libp2p-wasm-ext" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" +dependencies = [ + "futures 0.3.28", + "js-sys", + "libp2p-core", + "parity-send-wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-webrtc" +version = "0.4.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bytes", + "futures 0.3.28", + "futures-timer", + "hex", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-noise", + "log", + "multihash 0.17.0", + "quick-protobuf", + "quick-protobuf-codec", + "rand 0.8.5", + "rcgen 0.9.3", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "webrtc", +] + +[[package]] +name = "libp2p-websocket" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" +dependencies = [ + "either", + "futures 0.3.28", + "futures-rustls", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "quicksink", + "rw-stream-sink", + "soketto", + "url", + "webpki-roots 0.22.6", +] + +[[package]] +name = "libp2p-yamux" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" +dependencies = [ + "futures 0.3.28", + "libp2p-core", + "log", + "thiserror", + "yamux", +] + +[[package]] +name = "librocksdb-sys" +version = "0.11.0+8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "tikv-jemalloc-sys", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libz-sys" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linked_hash_set" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "linregress" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +dependencies = [ + "nalgebra", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + +[[package]] +name = "lite-json" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0460d985423a026b4d9b828a7c6eed1bcf606f476322f3f9b507529686a61715" +dependencies = [ + "lite-parser", +] + +[[package]] +name = "lite-parser" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c50092e40e0ccd1bf2015a10333fde0502ff95b832b0895dc1ca0d7ac6c52f6" +dependencies = [ + "paste 0.1.18", +] + +[[package]] +name = "lock_api" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" +dependencies = [ + "owning_ref", + "scopeguard 0.3.3", +] + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard 1.2.0", +] + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg 1.1.0", + "scopeguard 1.2.0", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lru" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "lru" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "matrixmultiply" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +dependencies = [ + "autocfg 1.1.0", + "rawpointer", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if 1.0.0", + "digest 0.10.7", +] + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.19", +] + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db 0.16.0", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "mick-jaeger" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" +dependencies = [ + "futures 0.3.28", + "rand 0.8.5", + "thrift", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "mmr-gadget" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "log", + "parity-scale-codec 3.6.5", + "sc-client-api", + "sc-offchain", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mmr-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "anyhow", + "jsonrpsee", + "parity-scale-codec 3.6.5", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", +] + +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if 1.0.0", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates 2.1.5", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if 1.0.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash 0.17.0", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive", + "sha2 0.10.8", + "sha3", + "unsigned-varint", +] + +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "digest 0.10.7", + "multihash-derive", + "sha2 0.10.8", + "unsigned-varint", +] + +[[package]] +name = "multihash-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multistream-select" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" +dependencies = [ + "bytes", + "futures 0.3.28", + "log", + "pin-project", + "smallvec 1.11.1", + "unsigned-varint", +] + +[[package]] +name = "nalgebra" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" +dependencies = [ + "approx", + "matrixmultiply", + "nalgebra-macros", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nalgebra-macros" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "names" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" + +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste 1.0.14", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes", + "futures 0.3.28", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "bytes", + "futures 0.3.28", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if 1.0.0", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.4", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg 1.1.0", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg 1.1.0", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.3", + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "object" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap 1.9.3", + "memchr", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +dependencies = [ + "asn1-rs 0.3.1", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs 0.5.2", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "opener" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "293c15678e37254c15bd2f092314abb4e51d7fdde05c2021279c12631b54f005" +dependencies = [ + "bstr", + "winapi", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "orchestra" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "227585216d05ba65c7ab0a0450a3cf2cbd81a98862a54c4df8e14d5ac6adb015" +dependencies = [ + "async-trait", + "dyn-clonable", + "futures 0.3.28", + "futures-timer", + "orchestra-proc-macro", + "pin-project", + "prioritized-metered-channel", + "thiserror", + "tracing", +] + +[[package]] +name = "orchestra-proc-macro" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" +dependencies = [ + "expander 0.0.6", + "itertools 0.10.5", + "petgraph", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ordered-float" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +dependencies = [ + "num-traits", +] + +[[package]] +name = "orml-asset-registry" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "frame-system", + "orml-traits", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "orml-currencies" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "frame-system", + "orml-traits", + "orml-utilities", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "orml-tokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "frame-system", + "orml-traits", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-arithmetic", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "orml-traits" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "num-traits", + "orml-utilities", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "orml-unknown-tokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "frame-system", + "orml-xcm-support", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-std", + "xcm", +] + +[[package]] +name = "orml-utilities" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "orml-xcm" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "frame-system", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-std", + "xcm", +] + +[[package]] +name = "orml-xcm-support" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "frame-support", + "orml-traits", + "parity-scale-codec 3.6.5", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "orml-xtokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.43#28a2e6f0df9540d91db4018c7ecebb8bfc217a2a" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "orml-traits", + "orml-xcm-support", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "owning_ref" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", +] + +[[package]] +name = "pallet-asset-tx-payment" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-transaction-payment", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-aura" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "pallet-timestamp", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authorship" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-babe" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-bags-list" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "pallet-balances" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "pallet-authorship", + "pallet-session", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-consensus-beefy", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-beefy-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "binary-merkle-tree", + "frame-support", + "frame-system", + "log", + "pallet-beefy", + "pallet-mmr", + "pallet-session", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-consensus-beefy", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-bounties" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-treasury", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-briefs" +version = "0.1.0" +dependencies = [ + "common-runtime", + "common-traits", + "common-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "orml-currencies", + "orml-tokens", + "orml-traits", + "pallet-balances", + "pallet-deposits", + "pallet-identity", + "pallet-proposals", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-child-bounties" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-bounties", + "pallet-treasury", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-collator-selection" +version = "3.0.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec 3.6.5", + "rand 0.8.5", + "scale-info 2.9.0", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-conviction-voting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-crowdfunding" +version = "0.1.0" +dependencies = [ + "common-runtime", + "common-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-tokens", + "orml-traits", + "pallet-balances", + "pallet-deposits", + "pallet-identity", + "pallet-proposals", + "pallet-timestamp", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-democracy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-deposits" +version = "4.0.0-dev" +dependencies = [ + "common-runtime", + "common-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-tokens", + "orml-traits", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-disputes" +version = "0.1.0" +dependencies = [ + "common-traits", + "common-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-tokens", + "orml-traits", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-election-provider-multi-phase" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-election-provider-support-benchmarking", + "parity-scale-codec 3.6.5", + "rand 0.8.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "pallet-election-provider-support-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", + "parity-scale-codec 3.6.5", + "sp-npos-elections", + "sp-runtime", +] + +[[package]] +name = "pallet-elections-phragmen" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-fellowship" +version = "0.1.0" +dependencies = [ + "common-traits", + "common-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-tokens", + "orml-traits", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-application-crypto", + "sp-consensus-grandpa", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-grants" +version = "0.1.0" +dependencies = [ + "common-runtime", + "common-traits", + "common-types", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "orml-tokens", + "orml-traits", + "pallet-balances", + "pallet-deposits", + "pallet-identity", + "pallet-proposals", + "pallet-timestamp", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-identity" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-im-online" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-indices" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-membership" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-message-queue" +version = "7.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-mmr" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-multisig" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nis" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nomination-pools" +version = "1.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-nomination-pools-benchmarking" +version = "1.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "pallet-bags-list", + "pallet-nomination-pools", + "pallet-staking", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-runtime", + "sp-runtime-interface", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-nomination-pools-runtime-api" +version = "1.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "pallet-nomination-pools", + "parity-scale-codec 3.6.5", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-offences" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-offences-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-babe", + "pallet-balances", + "pallet-grandpa", + "pallet-im-online", + "pallet-offences", + "pallet-session", + "pallet-staking", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-preimage" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proposals" +version = "3.1.0" +dependencies = [ + "common-runtime", + "common-traits", + "common-types", + "cumulus-pallet-xcm", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "hex", + "integer-sqrt", + "lite-json", + "log", + "orml-currencies", + "orml-tokens", + "orml-traits", + "orml-xtokens", + "pallet-balances", + "pallet-deposits", + "pallet-fellowship", + "pallet-identity", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-std", + "xcm", +] + +[[package]] +name = "pallet-proposals-rpc" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "jsonrpsee", + "pallet-proposals-rpc-runtime-api", + "parity-scale-codec 3.6.5", + "sp-api", + "sp-blockchain", + "sp-rpc", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proposals-rpc-runtime-api" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proxy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ranked-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-recovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-referenda" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-scheduler" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-session-benchmarking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "pallet-staking", + "rand 0.8.5", + "sp-runtime", + "sp-session", + "sp-std", +] + +[[package]] +name = "pallet-society" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "rand_chacha 0.2.2", + "scale-info 2.9.0", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec 3.6.5", + "rand_chacha 0.2.2", + "scale-info 2.9.0", + "serde", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-staking-reward-curve" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "pallet-staking-reward-fn" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "log", + "sp-arithmetic", +] + +[[package]] +name = "pallet-staking-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "sp-api", +] + +[[package]] +name = "pallet-state-trie-migration" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-sudo" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "pallet-tips" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-treasury", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "jsonrpsee", + "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec 3.6.5", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-transaction-payment-rpc-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "pallet-transaction-payment", + "parity-scale-codec 3.6.5", + "sp-api", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-treasury" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-utility" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-vesting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-whitelist" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-xcm" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bounded-collections", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "pallet-xcm-benchmarks" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "parachain-info" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", +] + +[[package]] +name = "parachains-common" +version = "1.0.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "cumulus-primitives-utility", + "frame-support", + "frame-system", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "scale-info 2.9.0", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "parity-db" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" +dependencies = [ + "blake2", + "crc32fast", + "fs2", + "hex", + "libc", + "log", + "lz4", + "memmap2", + "parking_lot 0.12.1", + "rand 0.8.5", + "siphasher", + "snap", +] + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec 0.7.4", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 2.3.1", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec-derive 3.6.5", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-send-wrapper" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" + +[[package]] +name = "parking_lot" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" +dependencies = [ + "lock_api 0.1.5", + "parking_lot_core 0.4.0", +] + +[[package]] +name = "parking_lot" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +dependencies = [ + "lock_api 0.3.4", + "parking_lot_core 0.7.3", +] + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api 0.4.10", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api 0.4.10", + "parking_lot_core 0.9.8", +] + +[[package]] +name = "parking_lot_core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" +dependencies = [ + "libc", + "rand 0.6.5", + "rustc_version 0.2.3", + "smallvec 0.6.14", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93f386bb233083c799e6e642a9d73db98c24a5deeb95ffc85bf281255dffc98" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall 0.1.57", + "smallvec 1.11.1", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec 1.11.1", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.3.5", + "smallvec 1.11.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + +[[package]] +name = "paste" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" +dependencies = [ + "paste-impl", + "proc-macro-hack", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "paste-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" +dependencies = [ + "proc-macro-hack", +] + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "pest_meta" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.2", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "platforms" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" + +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + +[[package]] +name = "plotters" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" + +[[package]] +name = "plotters-svg" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "polkadot-approval-distribution" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-bitfield-distribution" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "derive_more", + "fatality", + "futures 0.3.28", + "lru 0.9.0", + "parity-scale-codec 3.6.5", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-availability-recovery" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "fatality", + "futures 0.3.28", + "lru 0.9.0", + "parity-scale-codec 3.6.5", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "sc-network", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-cli" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "clap 4.4.6", + "frame-benchmarking-cli", + "futures 0.3.28", + "log", + "polkadot-client", + "polkadot-node-core-pvf-worker", + "polkadot-node-metrics", + "polkadot-performance-test", + "polkadot-service", + "sc-cli", + "sc-executor", + "sc-service", + "sc-storage-monitor", + "sc-sysinfo", + "sc-tracing", + "sp-core", + "sp-io", + "sp-keyring", + "sp-maybe-compressed-blob", + "substrate-build-script-utils", + "thiserror", + "try-runtime-cli", +] + +[[package]] +name = "polkadot-client" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "frame-benchmarking", + "frame-benchmarking-cli", + "frame-system", + "frame-system-rpc-runtime-api", + "futures 0.3.28", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "polkadot-core-primitives", + "polkadot-node-core-parachains-inherent", + "polkadot-primitives", + "polkadot-runtime", + "polkadot-runtime-common", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-service", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-keyring", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", +] + +[[package]] +name = "polkadot-collator-protocol" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "always-assert", + "bitvec", + "fatality", + "futures 0.3.28", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-core-primitives" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-dispute-distribution" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "derive_more", + "fatality", + "futures 0.3.28", + "futures-timer", + "indexmap 1.9.3", + "lru 0.9.0", + "parity-scale-codec 3.6.5", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-network", + "sp-application-crypto", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-erasure-coding" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "parity-scale-codec 3.6.5", + "polkadot-node-primitives", + "polkadot-primitives", + "reed-solomon-novelpoly", + "sp-core", + "sp-trie", + "thiserror", +] + +[[package]] +name = "polkadot-gossip-support" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "futures-timer", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "rand_chacha 0.3.1", + "sc-network", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "tracing-gum", +] + +[[package]] +name = "polkadot-network-bridge" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "always-assert", + "async-trait", + "bytes", + "fatality", + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sc-network", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-collation-generation" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-maybe-compressed-blob", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-approval-voting" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "derive_more", + "futures 0.3.28", + "futures-timer", + "kvdb", + "lru 0.9.0", + "merlin", + "parity-scale-codec 3.6.5", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sc-keystore", + "schnorrkel", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-runtime", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-av-store" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "futures 0.3.28", + "futures-timer", + "kvdb", + "parity-scale-codec 3.6.5", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-consensus", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-backing" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "fatality", + "futures 0.3.28", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-bitfield-signing" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", + "wasm-timer", +] + +[[package]] +name = "polkadot-node-core-candidate-validation" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "parity-scale-codec 3.6.5", + "polkadot-node-core-pvf", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-parachain", + "polkadot-primitives", + "sp-maybe-compressed-blob", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-api" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-primitives", + "sc-client-api", + "sc-consensus-babe", + "sp-blockchain", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-chain-selection" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "futures-timer", + "kvdb", + "parity-scale-codec 3.6.5", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-dispute-coordinator" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "fatality", + "futures 0.3.28", + "kvdb", + "lru 0.9.0", + "parity-scale-codec 3.6.5", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sc-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-parachains-inherent" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "sp-blockchain", + "sp-inherents", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-provisioner" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "fatality", + "futures 0.3.28", + "futures-timer", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.5", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "always-assert", + "futures 0.3.28", + "futures-timer", + "libc", + "parity-scale-codec 3.6.5", + "pin-project", + "polkadot-core-primitives", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-parachain", + "polkadot-primitives", + "rand 0.8.5", + "slotmap", + "sp-core", + "sp-maybe-compressed-blob", + "sp-tracing", + "sp-wasm-interface", + "substrate-build-script-utils", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-checker" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-pvf-worker" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "assert_matches", + "cpu-time", + "futures 0.3.28", + "libc", + "parity-scale-codec 3.6.5", + "polkadot-node-core-pvf", + "polkadot-parachain", + "polkadot-primitives", + "rayon", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-core", + "sp-externalities", + "sp-io", + "sp-maybe-compressed-blob", + "sp-tracing", + "substrate-build-script-utils", + "tempfile", + "tikv-jemalloc-ctl", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "futures 0.3.28", + "lru 0.9.0", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sp-consensus-babe", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-jaeger" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "lazy_static", + "log", + "mick-jaeger", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "polkadot-node-primitives", + "polkadot-primitives", + "sc-network", + "sp-core", + "thiserror", + "tokio", +] + +[[package]] +name = "polkadot-node-metrics" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bs58", + "futures 0.3.28", + "futures-timer", + "log", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "prioritized-metered-channel", + "sc-cli", + "sc-service", + "sc-tracing", + "substrate-prometheus-endpoint", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-network-protocol" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-channel", + "async-trait", + "derive_more", + "fatality", + "futures 0.3.28", + "hex", + "parity-scale-codec 3.6.5", + "polkadot-node-jaeger", + "polkadot-node-primitives", + "polkadot-primitives", + "rand 0.8.5", + "sc-authority-discovery", + "sc-network", + "strum", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-primitives" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bounded-vec", + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "polkadot-primitives", + "schnorrkel", + "serde", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-maybe-compressed-blob", + "sp-runtime", + "thiserror", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "polkadot-node-subsystem" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-node-subsystem-types", + "polkadot-overseer", +] + +[[package]] +name = "polkadot-node-subsystem-types" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "derive_more", + "futures 0.3.28", + "orchestra", + "polkadot-node-jaeger", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-primitives", + "polkadot-statement-table", + "sc-network", + "smallvec 1.11.1", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "polkadot-node-subsystem-util" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "derive_more", + "fatality", + "futures 0.3.28", + "futures-channel", + "itertools 0.10.5", + "kvdb", + "lru 0.9.0", + "parity-db", + "parity-scale-codec 3.6.5", + "parking_lot 0.11.2", + "pin-project", + "polkadot-node-jaeger", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-primitives", + "prioritized-metered-channel", + "rand 0.8.5", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-overseer" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "lru 0.9.0", + "orchestra", + "parking_lot 0.12.1", + "polkadot-node-metrics", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "sc-client-api", + "sp-api", + "sp-core", + "tikv-jemalloc-ctl", + "tracing-gum", +] + +[[package]] +name = "polkadot-parachain" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bounded-collections", + "derive_more", + "frame-support", + "parity-scale-codec 3.6.5", + "polkadot-core-primitives", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "polkadot-performance-test" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "env_logger 0.9.3", + "kusama-runtime", + "log", + "polkadot-erasure-coding", + "polkadot-node-core-pvf-worker", + "polkadot-node-primitives", + "polkadot-primitives", + "quote", + "sc-executor-common", + "sp-maybe-compressed-blob", + "thiserror", +] + +[[package]] +name = "polkadot-primitives" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "hex-literal 0.4.1", + "parity-scale-codec 3.6.5", + "polkadot-core-primitives", + "polkadot-parachain", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "polkadot-rpc" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "jsonrpsee", + "mmr-rpc", + "pallet-transaction-payment-rpc", + "polkadot-primitives", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", + "sc-rpc", + "sc-sync-state-rpc", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-keystore", + "sp-runtime", + "substrate-frame-rpc-system", + "substrate-state-trie-migration-rpc", +] + +[[package]] +name = "polkadot-runtime" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-staking-runtime-api", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info 2.9.0", + "serde", + "serde_derive", + "smallvec 1.11.1", + "sp-api", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "polkadot-runtime-common" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info 2.9.0", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm", +] + +[[package]] +name = "polkadot-runtime-constants" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec 1.11.1", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "polkadot-runtime-metrics" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bs58", + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "sp-std", + "sp-tracing", +] + +[[package]] +name = "polkadot-runtime-parachains" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitflags 1.3.2", + "bitvec", + "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-message-queue", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rustc-hex", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "static_assertions", + "xcm", + "xcm-executor", +] + +[[package]] +name = "polkadot-service" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "async-trait", + "frame-benchmarking-cli", + "frame-support", + "frame-system-rpc-runtime-api", + "futures 0.3.28", + "hex-literal 0.4.1", + "kusama-runtime", + "kvdb", + "kvdb-rocksdb", + "log", + "lru 0.9.0", + "mmr-gadget", + "pallet-babe", + "pallet-im-online", + "pallet-staking", + "pallet-transaction-payment-rpc-runtime-api", + "parity-db", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-client", + "polkadot-collator-protocol", + "polkadot-dispute-distribution", + "polkadot-gossip-support", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-approval-voting", + "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", + "polkadot-node-core-chain-selection", + "polkadot-node-core-dispute-coordinator", + "polkadot-node-core-parachains-inherent", + "polkadot-node-core-provisioner", + "polkadot-node-core-pvf-checker", + "polkadot-node-core-runtime-api", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime", + "polkadot-runtime-constants", + "polkadot-runtime-parachains", + "polkadot-statement-distribution", + "rococo-runtime", + "sc-authority-discovery", + "sc-basic-authorship", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", + "sc-consensus-slots", + "sc-executor", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-offchain", + "sc-service", + "sc-sync-state-rpc", + "sc-sysinfo", + "sc-telemetry", + "sc-transaction-pool", + "serde", + "serde_json", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie", + "substrate-prometheus-endpoint", + "thiserror", + "tracing-gum", + "westend-runtime", +] + +[[package]] +name = "polkadot-statement-distribution" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "arrayvec 0.5.2", + "fatality", + "futures 0.3.28", + "indexmap 1.9.3", + "parity-scale-codec 3.6.5", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "sp-staking", + "thiserror", + "tracing-gum", +] + +[[package]] +name = "polkadot-statement-table" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "parity-scale-codec 3.6.5", + "polkadot-primitives", + "sp-core", +] + +[[package]] +name = "polkadot-test-runtime" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-grandpa", + "pallet-indices", + "pallet-offences", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-vesting", + "pallet-xcm", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info 2.9.0", + "serde", + "serde_derive", + "smallvec 1.11.1", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "test-runtime-constants", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "polkadot-test-service" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-benchmarking", + "frame-system", + "futures 0.3.28", + "hex", + "pallet-balances", + "pallet-staking", + "pallet-transaction-payment", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-overseer", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-rpc", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "polkadot-service", + "polkadot-test-runtime", + "rand 0.8.5", + "sc-authority-discovery", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-consensus-babe", + "sc-consensus-grandpa", + "sc-executor", + "sc-network", + "sc-service", + "sc-tracing", + "sc-transaction-pool", + "sp-arithmetic", + "sp-authority-discovery", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-grandpa", + "sp-core", + "sp-inherents", + "sp-keyring", + "sp-runtime", + "sp-state-machine", + "substrate-test-client", + "tempfile", + "test-runtime-constants", + "tokio", + "tracing-gum", +] + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg 1.1.0", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "concurrent-queue", + "libc", + "log", + "pin-project-lite 0.2.13", + "windows-sys 0.48.0", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.5.1", +] + +[[package]] +name = "portable-atomic" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "predicates" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +dependencies = [ + "difference", + "predicates-core", +] + +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools 0.10.5", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "prettyplease" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +dependencies = [ + "proc-macro2", + "syn 2.0.38", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info 2.9.0", + "uint", +] + +[[package]] +name = "prioritized-metered-channel" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382698e48a268c832d0b181ed438374a6bb708a82a8ca273bb0f61c74cf209c4" +dependencies = [ + "coarsetime", + "crossbeam-queue", + "derive_more", + "futures 0.3.28", + "futures-timer", + "nanorand", + "thiserror", + "tracing", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "proc-macro2" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.1", + "thiserror", +] + +[[package]] +name = "prometheus-client" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck 0.4.1", + "itertools 0.10.5", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease 0.1.25", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "quicksink" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project-lite 0.1.12", +] + +[[package]] +name = "quinn-proto" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.20.9", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki 0.22.4", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.8", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg 0.1.2", + "rand_xorshift", + "winapi", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "x509-parser 0.13.2", + "yasna", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.10", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reed-solomon-novelpoly" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" +dependencies = [ + "derive_more", + "fs-err", + "itertools 0.11.0", + "static_init", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "regalloc2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec 1.11.1", +] + +[[package]] +name = "regex" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaac441002f822bc9705a681810a4dd2963094b9ca0ddc41cb963a4c189189ea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.2", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5011c7e263a695dc8ca064cddb722af1be54e517a280b12a5356f98366899e5d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce3045ffa7c981a6ee93f640b538952e155f1ae3a1a02b84547fc7a56b7059a" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "rocksdb" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rococo-runtime" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "binary-merkle-tree", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-mmr", + "pallet-multisig", + "pallet-nis", + "pallet-offences", + "pallet-preimage", + "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", + "pallet-session", + "pallet-society", + "pallet-staking", + "pallet-state-trie-migration", + "pallet-sudo", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rococo-runtime-constants", + "scale-info 2.9.0", + "serde", + "serde_derive", + "smallvec 1.11.1", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "static_assertions", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "rococo-runtime-constants" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec 1.11.1", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "rpassword" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +dependencies = [ + "libc", + "rtoolbox", + "winapi", +] + +[[package]] +name = "rtcp" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" +dependencies = [ + "bytes", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures 0.3.28", + "log", + "netlink-packet-route", + "netlink-proto", + "nix 0.24.3", + "thiserror", + "tokio", +] + +[[package]] +name = "rtoolbox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "rtp" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" +dependencies = [ + "async-trait", + "bytes", + "rand 0.8.5", + "serde", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "runtime-integration-tests" +version = "0.1.0" +dependencies = [ + "common-runtime", + "common-traits", + "common-types", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", + "imbue-kusama-runtime", + "kusama-runtime", + "orml-tokens", + "orml-traits", + "orml-xcm-support", + "orml-xtokens", + "pallet-balances", + "pallet-im-online", + "pallet-proposals", + "pallet-xcm", + "parachain-info", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-parachains", + "polkadot-service", + "polkadot-test-service", + "sc-consensus-grandpa", + "sp-authority-discovery", + "sp-consensus-babe", + "sp-core", + "sp-io", + "sp-runtime", + "xcm", + "xcm-builder", + "xcm-emulator", + "xcm-executor", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.20", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.36.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6da3636faa25820d8648e0e31c5d519bbb01f72fdf57131f0f5f7da5fed36eab" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys 0.4.10", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring 0.16.20", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct 0.7.0", + "webpki 0.22.4", +] + +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring 0.16.20", + "rustls-webpki 0.101.6", + "sct 0.7.0", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +dependencies = [ + "futures 0.3.28", + "pin-project", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "safe_arch" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc-allocator" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "log", + "sp-core", + "sp-wasm-interface", + "thiserror", +] + +[[package]] +name = "sc-authority-discovery" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "ip_network", + "libp2p", + "log", + "multihash 0.17.0", + "parity-scale-codec 3.6.5", + "prost", + "prost-build", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-api", + "sp-authority-discovery", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-basic-authorship" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "futures-timer", + "log", + "parity-scale-codec 3.6.5", + "sc-block-builder", + "sc-client-api", + "sc-proposer-metrics", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-block-builder" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-inherents", + "sp-runtime", +] + +[[package]] +name = "sc-chain-spec" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "memmap2", + "sc-chain-spec-derive", + "sc-client-api", + "sc-executor", + "sc-network", + "sc-telemetry", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sc-chain-spec-derive" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sc-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "chrono", + "clap 4.4.6", + "fdlimit", + "futures 0.3.28", + "libp2p-identity", + "log", + "names", + "parity-scale-codec 3.6.5", + "rand 0.8.5", + "regex", + "rpassword", + "sc-client-api", + "sc-client-db", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-utils", + "serde", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-panic-handler", + "sp-runtime", + "sp-version", + "thiserror", + "tiny-bip39", + "tokio", +] + +[[package]] +name = "sc-client-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "fnv", + "futures 0.3.28", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-executor", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-database", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-state-machine", + "sp-statement-store", + "sp-storage", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-client-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "hash-db 0.16.0", + "kvdb", + "kvdb-memorydb", + "kvdb-rocksdb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-client-api", + "sc-state-db", + "schnellru", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sp-state-machine", + "sp-trie", +] + +[[package]] +name = "sc-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "libp2p-identity", + "log", + "mockall", + "parking_lot 0.12.1", + "sc-client-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "sp-state-machine", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-aura" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "log", + "parity-scale-codec 3.6.5", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-consensus-slots", + "sc-telemetry", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "fork-tree", + "futures 0.3.28", + "log", + "num-bigint", + "num-rational", + "num-traits", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-keystore", + "sc-telemetry", + "scale-info 2.9.0", + "sp-api", + "sp-application-crypto", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-babe-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "jsonrpsee", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-rpc-api", + "serde", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-keystore", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "async-channel", + "async-trait", + "fnv", + "futures 0.3.28", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-client-api", + "sc-consensus", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-network-sync", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-epochs" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "fork-tree", + "parity-scale-codec 3.6.5", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ahash 0.8.3", + "array-bytes 4.2.0", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures 0.3.28", + "futures-timer", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-grandpa-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "finality-grandpa", + "futures 0.3.28", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "sc-client-api", + "sc-consensus-grandpa", + "sc-rpc", + "serde", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-consensus-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "log", + "parity-scale-codec 3.6.5", + "sc-client-api", + "sc-consensus", + "sc-telemetry", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "sc-executor" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "lru 0.8.1", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-api", + "sp-core", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-trie", + "sp-version", + "sp-wasm-interface", + "tracing", +] + +[[package]] +name = "sc-executor-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "sc-allocator", + "sp-maybe-compressed-blob", + "sp-wasm-interface", + "thiserror", + "wasm-instrument", +] + +[[package]] +name = "sc-executor-wasmtime" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "anyhow", + "cfg-if 1.0.0", + "libc", + "log", + "once_cell", + "rustix 0.36.16", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface", + "sp-wasm-interface", + "wasmtime", +] + +[[package]] +name = "sc-informant" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ansi_term", + "futures 0.3.28", + "futures-timer", + "log", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-keystore" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "parking_lot 0.12.1", + "serde_json", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", +] + +[[package]] +name = "sc-network" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "async-channel", + "async-trait", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures 0.3.28", + "futures-timer", + "ip_network", + "libp2p", + "linked_hash_set", + "log", + "lru 0.8.1", + "mockall", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-network-common", + "sc-peerset", + "sc-utils", + "serde", + "serde_json", + "smallvec 1.11.1", + "snow", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "unsigned-varint", + "zeroize", +] + +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-channel", + "cid", + "futures 0.3.28", + "libp2p-identity", + "log", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "sc-network-common" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "async-trait", + "bitflags 1.3.2", + "bytes", + "futures 0.3.28", + "futures-timer", + "libp2p-identity", + "parity-scale-codec 3.6.5", + "prost-build", + "sc-consensus", + "sc-peerset", + "sc-utils", + "serde", + "smallvec 1.11.1", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "zeroize", +] + +[[package]] +name = "sc-network-gossip" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ahash 0.8.3", + "futures 0.3.28", + "futures-timer", + "libp2p", + "log", + "lru 0.8.1", + "sc-network", + "sc-network-common", + "sc-peerset", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + +[[package]] +name = "sc-network-light" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "async-channel", + "futures 0.3.28", + "libp2p-identity", + "log", + "parity-scale-codec 3.6.5", + "prost", + "prost-build", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-peerset", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-network-sync" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "async-channel", + "async-trait", + "fork-tree", + "futures 0.3.28", + "futures-timer", + "libp2p", + "log", + "lru 0.8.1", + "mockall", + "parity-scale-codec 3.6.5", + "prost", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-peerset", + "sc-utils", + "smallvec 1.11.1", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "futures 0.3.28", + "libp2p", + "log", + "parity-scale-codec 3.6.5", + "pin-project", + "sc-network", + "sc-network-common", + "sc-peerset", + "sc-utils", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "bytes", + "fnv", + "futures 0.3.28", + "futures-timer", + "hyper", + "hyper-rustls 0.23.2", + "libp2p", + "num_cpus", + "once_cell", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-peerset", + "sc-utils", + "sp-api", + "sp-core", + "sp-offchain", + "sp-runtime", + "threadpool", + "tracing", +] + +[[package]] +name = "sc-peerset" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "libp2p-identity", + "log", + "parking_lot 0.12.1", + "partial_sort", + "sc-utils", + "serde_json", + "sp-arithmetic", + "wasm-timer", +] + +[[package]] +name = "sc-proposer-metrics" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "log", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-rpc-api", + "sc-tracing", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-keystore", + "sp-offchain", + "sp-rpc", + "sp-runtime", + "sp-session", + "sp-statement-store", + "sp-version", + "tokio", +] + +[[package]] +name = "sc-rpc-api" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "jsonrpsee", + "parity-scale-codec 3.6.5", + "sc-chain-spec", + "sc-transaction-pool-api", + "scale-info 2.9.0", + "serde", + "serde_json", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-version", + "thiserror", +] + +[[package]] +name = "sc-rpc-server" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "http", + "jsonrpsee", + "log", + "serde_json", + "substrate-prometheus-endpoint", + "tokio", + "tower", + "tower-http", +] + +[[package]] +name = "sc-rpc-spec-v2" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "futures 0.3.28", + "futures-util", + "hex", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-chain-spec", + "sc-client-api", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-version", + "thiserror", + "tokio-stream", +] + +[[package]] +name = "sc-service" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "directories", + "exit-future 0.2.0", + "futures 0.3.28", + "futures-timer", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-network", + "sc-network-bitswap", + "sc-network-common", + "sc-network-light", + "sc-network-sync", + "sc-network-transactions", + "sc-offchain", + "sc-rpc", + "sc-rpc-server", + "sc-rpc-spec-v2", + "sc-storage-monitor", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime", + "sp-session", + "sp-state-machine", + "sp-storage", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie", + "sp-version", + "static_init", + "substrate-prometheus-endpoint", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "sc-state-db" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sp-core", +] + +[[package]] +name = "sc-storage-monitor" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "clap 4.4.6", + "fs4", + "futures 0.3.28", + "log", + "sc-client-db", + "sc-utils", + "sp-core", + "thiserror", + "tokio", +] + +[[package]] +name = "sc-sync-state-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "jsonrpsee", + "parity-scale-codec 3.6.5", + "sc-chain-spec", + "sc-client-api", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-consensus-grandpa", + "serde", + "serde_json", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-sysinfo" +version = "6.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "libc", + "log", + "rand 0.8.5", + "rand_pcg 0.3.1", + "regex", + "sc-telemetry", + "serde", + "serde_json", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sc-telemetry" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "chrono", + "futures 0.3.28", + "libp2p", + "log", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", + "sc-utils", + "serde", + "serde_json", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-tracing" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ansi_term", + "atty", + "chrono", + "lazy_static", + "libc", + "log", + "once_cell", + "parking_lot 0.12.1", + "regex", + "rustc-hash", + "sc-client-api", + "sc-rpc-server", + "sc-tracing-proc-macro", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "sp-tracing", + "thiserror", + "tracing", + "tracing-log", + "tracing-subscriber", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sc-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "futures-timer", + "linked-hash-map", + "log", + "num-traits", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sc-client-api", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "sp-tracing", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-transaction-pool-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "log", + "serde", + "sp-blockchain", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-utils" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-channel", + "futures 0.3.28", + "futures-timer", + "lazy_static", + "log", + "parking_lot 0.12.1", + "prometheus", + "sp-arithmetic", +] + +[[package]] +name = "scale-info" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" +dependencies = [ + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec 2.3.1", + "scale-info-derive 1.0.0", +] + +[[package]] +name = "scale-info" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +dependencies = [ + "bitvec", + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec 3.6.5", + "scale-info-derive 2.9.0", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scale-info-derive" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.3", + "cfg-if 1.0.0", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scratch" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "sdp" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" +dependencies = [ + "rand 0.8.5", + "substring", + "thiserror", + "url", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array 0.14.7", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "serde_json" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_child" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + +[[package]] +name = "shlex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "simba" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste 1.0.14", + "wide", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "slot-range-helper" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "enumn", + "parity-scale-codec 3.6.5", + "paste 1.0.14", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "smallvec" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" + +[[package]] +name = "snap" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" + +[[package]] +name = "snow" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +dependencies = [ + "aes-gcm 0.9.4", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.1.1", + "rand_core 0.6.4", + "ring 0.16.20", + "rustc_version 0.4.0", + "sha2 0.10.8", + "subtle", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "flate2", + "futures 0.3.28", + "http", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "hash-db 0.16.0", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api-proc-macro", + "sp-core", + "sp-metadata-ir", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "Inflector", + "blake2", + "expander 1.0.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sp-application-crypto" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-authority-discovery" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api", + "sp-application-crypto", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-block-builder" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "sp-api", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-blockchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "log", + "lru 0.8.1", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "sp-api", + "sp-consensus", + "sp-database", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures 0.3.28", + "log", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "thiserror", +] + +[[package]] +name = "sp-consensus-aura" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "lazy_static", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", + "strum", +] + +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-consensus-slots" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-std", + "sp-timestamp", +] + +[[package]] +name = "sp-core" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures 0.3.28", + "hash-db 0.16.0", + "hash256-std-hasher", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "paste 1.0.14", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info 2.9.0", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "sp-std", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn 2.0.38", +] + +[[package]] +name = "sp-database" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "kvdb", + "parking_lot 0.12.1", +] + +[[package]] +name = "sp-debug-derive" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sp-externalities" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "environmental", + "parity-scale-codec 3.6.5", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "bytes", + "ed25519 1.5.3", + "ed25519-dalek 1.0.1", + "futures 0.3.28", + "libsecp256k1", + "log", + "parity-scale-codec 3.6.5", + "rustversion", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "lazy_static", + "sp-core", + "sp-runtime", + "strum", +] + +[[package]] +name = "sp-keystore" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "serde", + "sp-core", + "sp-externalities", + "thiserror", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "thiserror", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-metadata", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-std", +] + +[[package]] +name = "sp-mmr-primitives" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ckb-merkle-mountain-range", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-npos-elections" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-offchain" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-panic-handler" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-rpc" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "rustc-hash", + "serde", + "sp-core", +] + +[[package]] +name = "sp-runtime" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.6.5", + "paste 1.0.14", + "rand 0.8.5", + "scale-info 2.9.0", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", +] + +[[package]] +name = "sp-runtime-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec 3.6.5", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sp-session" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api", + "sp-core", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "hash-db 0.16.0", + "log", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "rand 0.8.5", + "smallvec 1.11.1", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-std" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" + +[[package]] +name = "sp-storage" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "impl-serde", + "parity-scale-codec 3.6.5", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-timestamp" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "futures-timer", + "log", + "parity-scale-codec 3.6.5", + "sp-inherents", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-tracing" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-transaction-pool" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "sp-api", + "sp-runtime", +] + +[[package]] +name = "sp-transaction-storage-proof" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std", + "sp-trie", +] + +[[package]] +name = "sp-trie" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ahash 0.8.3", + "hash-db 0.16.0", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec 3.6.5", + "parking_lot 0.12.1", + "scale-info 2.9.0", + "schnellru", + "sp-core", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root 0.18.0", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "impl-serde", + "parity-scale-codec 3.6.5", + "parity-wasm", + "scale-info 2.9.0", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "sp-wasm-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.6.5", + "sp-std", + "wasmi", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "smallvec 1.11.1", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spinners" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" +dependencies = [ + "lazy_static", + "maplit", + "strum", +] + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", +] + +[[package]] +name = "ss58-registry" +version = "1.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.6", + "static_init_macro", + "winapi", +] + +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "structopt" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" +dependencies = [ + "clap 2.34.0", + "lazy_static", + "structopt-derive", +] + +[[package]] +name = "structopt-derive" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" +dependencies = [ + "heck 0.3.3", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "stun" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +dependencies = [ + "base64 0.13.1", + "crc", + "lazy_static", + "md-5", + "rand 0.8.5", + "ring 0.16.20", + "subtle", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "substrate-build-script-utils" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "platforms 2.0.0", +] + +[[package]] +name = "substrate-frame-rpc-system" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "frame-system-rpc-runtime-api", + "futures 0.3.28", + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "sc-rpc-api", + "sc-transaction-pool-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "hyper", + "log", + "prometheus", + "thiserror", + "tokio", +] + +[[package]] +name = "substrate-rpc-client" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "jsonrpsee", + "log", + "sc-rpc-api", + "serde", + "sp-runtime", +] + +[[package]] +name = "substrate-state-trie-migration-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "jsonrpsee", + "log", + "parity-scale-codec 3.6.5", + "sc-client-api", + "sc-rpc-api", + "scale-info 2.9.0", + "serde", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "trie-db", +] + +[[package]] +name = "substrate-test-client" +version = "2.0.1" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "array-bytes 4.2.0", + "async-trait", + "futures 0.3.28", + "parity-scale-codec 3.6.5", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-offchain", + "sc-service", + "serde", + "serde_json", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-keyring", + "sp-keystore", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "substrate-wasm-builder" +version = "5.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "ansi_term", + "build-helper", + "cargo_metadata 0.15.4", + "filetime", + "sp-maybe-compressed-blob", + "strum", + "tempfile", + "toml 0.7.8", + "walkdir", + "wasm-opt", +] + +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if 1.0.0", + "fastrand 2.0.1", + "redox_syscall 0.3.5", + "rustix 0.38.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "termcolor" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "test-runtime-constants" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec 1.11.1", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "thousands" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "thrift" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b82ca8f46f95b3ce96081fe3dd89160fdea970c254bb72925255d1b62aae692e" +dependencies = [ + "byteorder", + "integer-encoding", + "log", + "ordered-float", + "threadpool", +] + +[[package]] +name = "tikv-jemalloc-ctl" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" +dependencies = [ + "libc", + "paste 1.0.14", + "tikv-jemalloc-sys", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "time" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +dependencies = [ + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", +] + +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash", + "sha2 0.10.8", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite 0.2.13", + "signal-hook-registry", + "socket2 0.5.4", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki 0.22.4", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.7", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.13", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite 0.2.13", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.2", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "bitflags 2.4.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite 0.2.13", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +dependencies = [ + "log", + "pin-project-lite 0.2.13", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-gum" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "polkadot-node-jaeger", + "polkadot-primitives", + "tracing", + "tracing-gum-proc-macro", +] + +[[package]] +name = "tracing-gum-proc-macro" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "expander 2.0.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "parking_lot 0.11.2", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec 1.11.1", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +dependencies = [ + "hash-db 0.16.0", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec 1.11.1", +] + +[[package]] +name = "trie-root" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b779f7c1c8fe9276365d9d5be5c4b5adeacf545117bb3f64c974305789c5c0b" +dependencies = [ + "hash-db 0.15.2", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db 0.16.0", +] + +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand 0.8.5", + "smallvec 1.11.1", + "socket2 0.4.9", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if 1.0.0", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "smallvec 1.11.1", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "try-runtime-cli" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" +dependencies = [ + "async-trait", + "clap 4.4.6", + "frame-remote-externalities", + "frame-try-runtime", + "hex", + "log", + "parity-scale-codec 3.6.5", + "sc-cli", + "sc-executor", + "sc-service", + "serde", + "serde_json", + "sp-api", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-core", + "sp-debug-derive", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-rpc", + "sp-runtime", + "sp-state-machine", + "sp-timestamp", + "sp-transaction-storage-proof", + "sp-version", + "sp-weights", + "substrate-rpc-client", + "zstd 0.12.4", +] + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "turn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" +dependencies = [ + "async-trait", + "base64 0.13.1", + "futures 0.3.28", + "log", + "md-5", + "rand 0.8.5", + "ring 0.16.20", + "stun", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if 1.0.0", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures-io", + "futures-util", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna 0.4.0", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.10", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "waitgroup" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +dependencies = [ + "atomic-waker", +] + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.38", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "wasm-instrument" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasm-opt" +version = "0.112.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fef6d0d508f08334e0ab0e6877feb4c0ecb3956bcf2cb950699b22fedf3e9c" +dependencies = [ + "anyhow", + "libc", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "wasm-opt-cxx-sys", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-cxx-sys" +version = "0.112.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc816bbc1596c8f2e8127e137a760c798023ef3d378f2ae51f0f1840e2dfa445" +dependencies = [ + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-sys" +version = "0.112.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40199e4f68ef1071b3c6d0bd8026a12b481865d4b9e49c156932ea9a6234dd14" +dependencies = [ + "anyhow", + "cc", + "cxx", + "cxx-build", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures 0.3.28", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmi" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +dependencies = [ + "parity-wasm", + "wasmi-validation", + "wasmi_core", +] + +[[package]] +name = "wasmi-validation" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational", + "num-traits", +] + +[[package]] +name = "wasmparser" +version = "0.102.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +dependencies = [ + "indexmap 1.9.3", + "url", +] + +[[package]] +name = "wasmtime" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" +dependencies = [ + "anyhow", + "bincode", + "cfg-if 1.0.0", + "indexmap 1.9.3", + "libc", + "log", + "object 0.30.4", + "once_cell", + "paste 1.0.14", + "psm", + "rayon", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-cache", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "wasmtime-cache" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" +dependencies = [ + "anyhow", + "base64 0.21.4", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.36.16", + "serde", + "sha2 0.10.8", + "toml 0.5.11", + "windows-sys 0.45.0", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "wasmtime-cranelift" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.27.3", + "log", + "object 0.30.4", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli 0.27.3", + "indexmap 1.9.3", + "log", + "object 0.30.4", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" +dependencies = [ + "addr2line 0.19.0", + "anyhow", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "gimli 0.27.3", + "log", + "object 0.30.4", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" +dependencies = [ + "object 0.30.4", + "once_cell", + "rustix 0.36.16", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-runtime" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" +dependencies = [ + "anyhow", + "cc", + "cfg-if 1.0.0", + "indexmap 1.9.3", + "libc", + "log", + "mach", + "memfd", + "memoffset 0.8.0", + "paste 1.0.14", + "rand 0.8.5", + "rustix 0.36.16", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-types" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.4", + "untrusted 0.9.0", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki 0.22.4", +] + +[[package]] +name = "webpki-roots" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +dependencies = [ + "rustls-webpki 0.100.3", +] + +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + +[[package]] +name = "webrtc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "hex", + "interceptor", + "lazy_static", + "log", + "rand 0.8.5", + "rcgen 0.9.3", + "regex", + "ring 0.16.20", + "rtcp", + "rtp", + "rustls 0.19.1", + "sdp", + "serde", + "serde_json", + "sha2 0.10.8", + "stun", + "thiserror", + "time", + "tokio", + "turn", + "url", + "waitgroup", + "webrtc-data", + "webrtc-dtls", + "webrtc-ice", + "webrtc-mdns", + "webrtc-media", + "webrtc-sctp", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "webrtc-data" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" +dependencies = [ + "bytes", + "derive_builder", + "log", + "thiserror", + "tokio", + "webrtc-sctp", + "webrtc-util", +] + +[[package]] +name = "webrtc-dtls" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" +dependencies = [ + "aes 0.6.0", + "aes-gcm 0.10.3", + "async-trait", + "bincode", + "block-modes", + "byteorder", + "ccm", + "curve25519-dalek 3.2.0", + "der-parser 8.2.0", + "elliptic-curve 0.12.3", + "hkdf", + "hmac 0.12.1", + "log", + "p256", + "p384", + "rand 0.8.5", + "rand_core 0.6.4", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.19.1", + "sec1 0.3.0", + "serde", + "sha1", + "sha2 0.10.8", + "signature 1.6.4", + "subtle", + "thiserror", + "tokio", + "webpki 0.21.4", + "webrtc-util", + "x25519-dalek 2.0.0", + "x509-parser 0.13.2", +] + +[[package]] +name = "webrtc-ice" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" +dependencies = [ + "arc-swap", + "async-trait", + "crc", + "log", + "rand 0.8.5", + "serde", + "serde_json", + "stun", + "thiserror", + "tokio", + "turn", + "url", + "uuid", + "waitgroup", + "webrtc-mdns", + "webrtc-util", +] + +[[package]] +name = "webrtc-mdns" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" +dependencies = [ + "log", + "socket2 0.4.9", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-media" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" +dependencies = [ + "byteorder", + "bytes", + "rand 0.8.5", + "rtp", + "thiserror", +] + +[[package]] +name = "webrtc-sctp" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "crc", + "log", + "rand 0.8.5", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-srtp" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "aes-gcm 0.9.4", + "async-trait", + "byteorder", + "bytes", + "ctr 0.8.0", + "hmac 0.11.0", + "log", + "rtcp", + "rtp", + "sha-1", + "subtle", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix 0.24.3", + "rand 0.8.5", + "thiserror", + "tokio", + "winapi", +] + +[[package]] +name = "westend-runtime" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-collective", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-staking-runtime-api", + "pallet-state-trie-migration", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info 2.9.0", + "serde", + "serde_derive", + "smallvec 1.11.1", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "westend-runtime-constants", + "xcm", + "xcm-builder", + "xcm-executor", +] + +[[package]] +name = "westend-runtime-constants" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", + "smallvec 1.11.1", + "sp-core", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.19", +] + +[[package]] +name = "wide" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebecebefc38ff1860b4bc47550bbfa63af5746061cf0d29fcd7fa63171602598" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "widestring" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek 4.1.1", + "rand_core 0.6.4", + "serde", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" +dependencies = [ + "asn1-rs 0.3.1", + "base64 0.13.1", + "data-encoding", + "der-parser 7.0.0", + "lazy_static", + "nom", + "oid-registry 0.4.0", + "ring 0.16.20", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs 0.5.2", + "base64 0.13.1", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xcm" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "bounded-collections", + "derivative", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.6.5", + "scale-info 2.9.0", + "serde", + "sp-weights", + "xcm-procedural", +] + +[[package]] +name = "xcm-builder" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment", + "parity-scale-codec 3.6.5", + "polkadot-parachain", + "scale-info 2.9.0", + "sp-arithmetic", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm", + "xcm-executor", +] + +[[package]] +name = "xcm-emulator" +version = "0.1.0" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" +dependencies = [ + "casey", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", + "cumulus-test-service", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-message-queue", + "parachain-info", + "parachains-common", + "parity-scale-codec 3.6.5", + "paste 1.0.14", + "polkadot-primitives", + "polkadot-runtime-parachains", + "quote", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-trie", + "xcm", + "xcm-executor", +] + +[[package]] +name = "xcm-executor" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec 3.6.5", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", + "xcm", +] + +[[package]] +name = "xcm-procedural" +version = "0.9.43" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "yamux" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" +dependencies = [ + "futures 0.3.28", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.9+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/libs/common-types/src/milestone_origin.rs b/libs/common-types/src/milestone_origin.rs index af1429d0..a33058ef 100644 --- a/libs/common-types/src/milestone_origin.rs +++ b/libs/common-types/src/milestone_origin.rs @@ -43,14 +43,7 @@ pub enum TreasuryOriginError { NetworkUnsupported, } -#[derive( - Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, -)] -pub enum FundingType { - Proposal, - Brief, - Grant(TreasuryOrigin), -} + #[derive( Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 55666576..2376bf70 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -110,7 +110,7 @@ pub mod pallet { /// Imbue fee in percent 0-99 type ImbueFee: Get; /// The account the imbue fee goes to. - type ImbueFeeAccount: Get> + type ImbueFeeAccount: Get>; /// The type responisble for handling refunds. type RefundHandler: traits::RefundHandler, BalanceOf, CurrencyId>; /// The type responsible for storage deposits. @@ -663,7 +663,6 @@ pub struct Whitelist { max_cap: Balance, } -<<<<<<< HEAD /// Defines how a project is funded on its instantiation. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen, Default)] pub enum FundingPath { @@ -677,8 +676,6 @@ pub enum FundingPath { WaitForFunding, } -======= ->>>>>>> f5b65b648adb9abe1429374bd1a8d87acfc979cf /// Stores the btree for each individual vote. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 9155d63d..4cdb582f 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -488,6 +488,9 @@ pub mod v5 { #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; + #[storage_alias] + pub type Projects = StorageMap<_, Identity, ProjectKey, ProjectV5, OptionQuery>; + #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[repr(u32)] pub enum Release { @@ -499,6 +502,29 @@ pub mod v5 { V4, } + pub struct ProjectV5 { + pub agreement_hash: H256, + pub milestones: BoundedBTreeMilestones, + pub contributions: ContributionsFor, + pub currency_id: common_types::CurrencyId, + pub withdrawn_funds: BalanceOf, + pub raised_funds: BalanceOf, + pub initiator: AccountIdOf, + pub created_on: BlockNumberFor, + pub cancelled: bool, + pub funding_type: FundingType, + pub deposit_id: DepositIdOf, + } + + #[derive( + Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, + )] + pub enum FundingType { + Proposal, + Brief, + Grant(TreasuryOrigin), + } + /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 pub struct MigrateToV5(sp_std::marker::PhantomData); impl OnRuntimeUpgrade for MigrateToV5 { @@ -627,6 +653,62 @@ pub mod v6 { } }) } + pub struct ProjectV5 { + pub agreement_hash: H256, + pub milestones: BoundedBTreeMilestones, + pub contributions: ContributionsFor, + pub currency_id: common_types::CurrencyId, + pub withdrawn_funds: BalanceOf, + pub raised_funds: BalanceOf, + pub initiator: AccountIdOf, + pub created_on: BlockNumberFor, + pub cancelled: bool, + pub funding_type: FundingType, + pub deposit_id: DepositIdOf, + } + + refund locations, jury, on_creation_funding + fn migrate_new_fields(weight &mut Weight) { + v5::Projects::::drain().for_each(|(key, project)|{ + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + + let on_creation_funding = match project.funding_type { + Proposal => crate::FundingPath::TakeFromReserved, + Brief => crate::FundingPath::TakeFromReserved, + Grant(_) => crate::FundingPath::WaitForFunding, + } + + let jury = todo!(); + + let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match funding.funding_type { + Proposal => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), + Brief => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), + Grant(treasury_origin) => { + let beneficiary = PalletId(*b"py/trsry").into_account_truncating(); + Vec::from((Locality(treasury_origin.get_multi_location(beneficiary)), Percent::from_parts(100))).try_into().expect("1 is lower than bound; qed") + }, + }; + + let migrated_project = crate::Project { + agreement_hash: project.agreement_hash, + milestones: project.milestones, + contributions: project.contributions, + currency_id: project.currency_id, + withdrawn_funds: project.withdrawn_funds, + raised_funds: project.raised_funds, + initiator: project.initiator, + created_on: project.created_on, + cancelled: project.cancelled, + deposit_id: project.deposit_id, + refund_locations, + jury, + on_creation_funding, + }; + + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + crate::Projects::::insert(key, migrated_project); + }); + } pub struct MigrateToV6(T); impl OnRuntimeUpgrade for MigrateToV6 { From 91482a65a262c1e018721dfe6d1ffd1e90643b02 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 16 Oct 2023 14:08:13 +0100 Subject: [PATCH 114/192] add to runtime with dummy weights --- runtime/imbue-kusama/Cargo.toml | 1 + runtime/imbue-kusama/src/lib.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 650f0f66..fde64e71 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -102,6 +102,7 @@ pallet-proposals = { path = '../../pallets/proposals', default-features = false pallet-briefs = {path = '../../pallets/briefs', default-features = false } pallet-grants = {path = '../../pallets/grants', default-features = false } pallet-deposits = {path = '../../pallets/deposits', default-features = false } +pallet-fellowship = {path = '../../pallets/fellowship', default-features = false } common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } pallet-proposals-rpc-runtime-api = {path = "../../pallets/proposals/rpc/runtime-api", default-features = false} diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 70f92919..35035fd1 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -864,6 +864,26 @@ impl pallet_briefs::Config for Runtime { type DepositHandler = Deposits; } +parameter_types! { + pub MaxCandidatesPerShortlist: u32 = 50; + pub ShortlistPeriod: BlockNumber = 14 * DAYS; + pub MembershipDeposit: Balance = DOLLARS.saturating_mul(500); + pub DepositCurrencyId: CurrencyId = CurrencyId::Native; +} + +impl pallet_fellowship::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ForceAuthority = EnsureRootOr; + type MaxCandidatesPerShortlist = MaxCandidatesPerShortlist; + type ShortlistPeriod = ShortlistPeriod; + type MembershipDeposit = MembershipDeposit; + type DepositCurrencyId = DepositCurrencyId; + // Send slashes to the treasury. + type SlashAccount = TreasuryAccount; + type WeightInfo: (); +} + pub type DepositId = u64; pub struct ImbueDepositCalculator; impl DepositCalculator for ImbueDepositCalculator { @@ -949,6 +969,7 @@ construct_runtime! { ImbueBriefs: pallet_briefs::{Pallet, Call, Storage, Event} = 101, ImbueGrants: pallet_grants::{Pallet, Call, Storage, Event} = 102, Deposits: pallet_deposits::{Pallet, Storage, Event} = 103, + ImbueFellowship: pallet_fellowship::{Pallet, Call, Storage, Event} = 104, } } @@ -986,6 +1007,7 @@ mod benches { [pallet_proposals, ImbueProposals] [pallet_briefs, ImbueBriefs] [pallet_grants, ImbueGrants] + [pallet_fellowship, ImbueFellowship] ); } From e1e8124b3a3a6e1b870db64e1d8c6198634d4356 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 16 Oct 2023 14:41:16 +0100 Subject: [PATCH 115/192] add genesis config --- Cargo.lock | 1 + pallets/fellowship/src/lib.rs | 23 +++++++++++++++++++++++ runtime/imbue-kusama/src/lib.rs | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e5cb22cf..27e19aab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4353,6 +4353,7 @@ dependencies = [ "pallet-collective", "pallet-democracy", "pallet-deposits", + "pallet-fellowship", "pallet-grants", "pallet-identity", "pallet-membership", diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 554be440..e2cf5d35 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -103,6 +103,29 @@ pub mod pallet { pub type FellowToVetter = StorageMap<_, Blake2_128Concat, AccountIdOf, VetterIdOf, OptionQuery>; + #[pallet::genesis_config] + pub struct GenesisConfig { + pub initial_fellows: Vec<(T::AccountId, Role, Rank)> + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + initial_fellows: Vec::new() + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + for (account, role, rank) in &self.initial_fellows { + as FellowshipHandle>::add_to_fellowship(account, role, rank, None, false); + } + } + } + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 35035fd1..37d17ecf 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -881,7 +881,7 @@ impl pallet_fellowship::Config for Runtime { type DepositCurrencyId = DepositCurrencyId; // Send slashes to the treasury. type SlashAccount = TreasuryAccount; - type WeightInfo: (); + type WeightInfo = (); } pub type DepositId = u64; From ea33b7bfdf606b9da7c15202bf81acfd75e9750e Mon Sep 17 00:00:00 2001 From: Shankar Rao Mata Date: Mon, 16 Oct 2023 12:37:17 -0400 Subject: [PATCH 116/192] removed everything about no-confidence logic --- pallets/proposals/src/benchmarking.rs | 43 ---- pallets/proposals/src/impls/pallet_impls.rs | 228 ------------------ pallets/proposals/src/lib.rs | 40 ---- pallets/proposals/src/tests/pallet.rs | 253 -------------------- pallets/proposals/src/weights.rs | 38 --- 5 files changed, 602 deletions(-) diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index e1384e4a..733db566 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -118,49 +118,6 @@ mod benchmarks { ); } - #[benchmark] - fn raise_vote_of_no_confidence() { - let alice: T::AccountId = - create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = - create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); - // TODO: should update the contributors list to have maximum available length - let contributions = get_contributions::(vec![bob.clone()], 100_000_000_000_000_000u128); - let prop_milestones = get_max_milestones::(); - let project_key = - create_project::(alice, contributions, prop_milestones, CurrencyId::Native); - #[extrinsic_call] - raise_vote_of_no_confidence(RawOrigin::Signed(bob.clone()), project_key); - assert_last_event::(Event::::NoConfidenceRoundCreated(bob, project_key).into()); - } - - #[benchmark] - fn vote_on_no_confidence_round() { - let alice: T::AccountId = - create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = - create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); - let charlie: T::AccountId = - create_funded_user::("contributor", 2, 1_000_000_000_000_000_000u128); - // TODO: should update the contributors list to have maximum available length - let contributions = get_contributions::( - vec![bob.clone(), charlie.clone()], - 100_000_000_000_000_000u128, - ); - let prop_milestones = get_max_milestones::(); - let project_key = - create_project::(alice, contributions, prop_milestones, CurrencyId::Native); - - assert_ok!(Pallet::::raise_vote_of_no_confidence( - RawOrigin::Signed(bob).into(), - project_key - )); - - #[extrinsic_call] - vote_on_no_confidence_round(RawOrigin::Signed(charlie.clone()), project_key, true); - assert_last_event::(Event::::NoConfidenceRoundVotedUpon(charlie, project_key).into()); - } - // Benchmark for a single loop of on_initialise as a voting round (most expensive). #[benchmark] fn on_initialize() { diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 33c59203..bb6a4aa1 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -196,234 +196,6 @@ impl Pallet { Ok(().into()) } - /// This function raises a vote of no confidence. - /// This round can only be called once and there after can only be voted on. - pub(crate) fn raise_no_confidence_round( - who: T::AccountId, - project_key: ProjectKey, - ) -> DispatchResult { - //ensure that who is a contributor or root - let project = Self::projects(project_key).ok_or(Error::::ProjectDoesNotExist)?; - let contribution = project - .contributions - .get(&who) - .ok_or(Error::::OnlyContributorsCanVote)?; - - // Also ensure that a vote has not already been raised. - ensure!( - !NoConfidenceVotes::::contains_key(project_key), - Error::::RoundStarted - ); - - let vote = Vote { - yay: Zero::zero(), - nay: contribution.value, - is_approved: false, - }; - - let expiry_block = frame_system::Pallet::::block_number() - .saturating_add(::NoConfidenceTimeLimit::get()); - - Rounds::::insert( - (project_key, 0), - RoundType::VoteOfNoConfidence, - expiry_block, - ); - RoundsExpiring::::try_mutate(expiry_block, |keys| { - // The milestone key does not matter here as we are voting on the entire project. - keys.try_push((project_key, RoundType::VoteOfNoConfidence, 0)) - .map_err(|_| Error::::Overflow)?; - Ok::<(), DispatchError>(()) - })?; - UserHasVoted::::try_mutate((project_key, RoundType::VoteOfNoConfidence, 0), |votes| { - ensure!(!votes.contains_key(&who), Error::::VotesAreImmutable); - votes - .try_insert(who.clone(), false) - .map_err(|_| Error::::Overflow)?; - Ok::<(), DispatchError>(()) - })?; - - NoConfidenceVotes::::insert(project_key, vote); - Self::deposit_event(Event::NoConfidenceRoundCreated(who, project_key)); - Ok(()) - } - - /// Allows a contributer to agree or disagree with a vote of no confidence. - pub(crate) fn add_vote_no_confidence( - who: T::AccountId, - project_key: ProjectKey, - is_yay: bool, - ) -> DispatchResult { - ensure!( - Rounds::::contains_key((project_key, 0), RoundType::VoteOfNoConfidence), - Error::::ProjectNotInRound - ); - let project = Self::projects(project_key).ok_or(Error::::ProjectDoesNotExist)?; - let contribution = project - .contributions - .get(&who) - .ok_or(Error::::OnlyContributorsCanVote)?; - - let nay_vote = NoConfidenceVotes::::try_mutate(project_key, |maybe_vote| { - if let Some(v) = maybe_vote { - if is_yay { - v.yay = v.yay.saturating_add(contribution.value); - } else { - v.nay = v.nay.saturating_add(contribution.value); - } - Ok::, DispatchError>(v.nay) - } else { - Err(Error::::VotingRoundNotStarted.into()) - } - })?; - - UserHasVoted::::try_mutate((project_key, RoundType::VoteOfNoConfidence, 0), |votes| { - ensure!(!votes.contains_key(&who), Error::::VotesAreImmutable); - votes - .try_insert(who.clone(), false) - .map_err(|_| Error::::Overflow)?; - Ok::<(), DispatchError>(()) - })?; - - Self::deposit_event(Event::NoConfidenceRoundVotedUpon(who.clone(), project_key)); - - //once the voting is complete check if the confidence vote could be auto finalized - //getting the total threshold required for the total confidence - let voting_no_confidence_threshold: BalanceOf = - T::PercentRequiredForVoteNoConfidenceToPass::get().mul_floor(project.raised_funds); - - //verifying whether the no confidence vote has passed the threshold if so then auto finalize it - if nay_vote >= voting_no_confidence_threshold { - let locked_milestone_percentage = - project.milestones.iter().fold(Percent::zero(), |acc, ms| { - if !ms.1.is_approved { - acc.saturating_add(ms.1.percentage_to_unlock) - } else { - acc - } - }); - - let project_account_id = Self::project_account_id(project_key); - - match project.funding_type { - FundingType::Proposal => { - // Handle refunds on native chain, there is no need to deal with xcm here. - for (acc_id, contribution) in project.contributions.iter() { - let refund_amount = - locked_milestone_percentage.mul_floor(contribution.value); - ::MultiCurrency::transfer( - project.currency_id, - &project_account_id, - acc_id, - refund_amount, - )?; - } - } - - FundingType::Brief => { - //Have to handle it in the dispute pallet - } - - // Must a grant be treasury funded? - FundingType::Grant(_) => { - let mut refund_amount: BalanceOf = Zero::zero(); - // Sum the contributions and send a single xcm. - for (_acc_id, contribution) in project.contributions.iter() { - let per_contributor = - locked_milestone_percentage.mul_floor(contribution.value); - refund_amount = refund_amount.saturating_add(per_contributor); - } - ::RefundHandler::send_refund_message_to_treasury( - project_account_id, - refund_amount, - project.currency_id, - project.funding_type, - )?; - } - } - Projects::::remove(project_key); - Rounds::::remove((project_key, 0), RoundType::VoteOfNoConfidence); - ::DepositHandler::return_deposit(project.deposit_id)?; - Self::deposit_event(Event::NoConfidenceRoundFinalised(who, project_key)); - } - Ok(()) - } - - #[deprecated(since = "3.1.0", note = "autofinalisation has been implemented.")] - pub(crate) fn _call_finalise_no_confidence_vote( - who: T::AccountId, - project_key: ProjectKey, - majority_required: Percent, - ) -> DispatchResultWithPostInfo { - let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; - ensure!( - Rounds::::contains_key((project_key, 0), RoundType::VoteOfNoConfidence), - Error::::ProjectNotInRound - ); - ensure!( - project.contributions.contains_key(&who), - Error::::OnlyContributorsCanVote - ); - - let vote = NoConfidenceVotes::::get(project_key).ok_or(Error::::NoActiveRound)?; - let threshold_votes: BalanceOf = majority_required.mul_floor(project.raised_funds); - - if vote.nay >= threshold_votes { - let locked_milestone_percentage = - project.milestones.iter().fold(Percent::zero(), |acc, ms| { - if !ms.1.is_approved { - acc.saturating_add(ms.1.percentage_to_unlock) - } else { - acc - } - }); - - let project_account_id = Self::project_account_id(project_key); - - // TODO: this should be generic and not bound to funding type.. - match project.funding_type { - FundingType::Brief | FundingType::Proposal => { - // - // Handle refunds on native chain, there is no need to deal with xcm here. - // Todo: Batch call using pallet-utility? - for (acc_id, contribution) in project.contributions.iter() { - let refund_amount = - locked_milestone_percentage.mul_floor(contribution.value); - ::MultiCurrency::transfer( - project.currency_id, - &project_account_id, - acc_id, - refund_amount, - )?; - } - } - // Must a grant be treasury funded? - FundingType::Grant(_) => { - let mut refund_amount: BalanceOf = Zero::zero(); - // Sum the contributions and send a single xcm. - for (_acc_id, contribution) in project.contributions.iter() { - let per_contributor = - locked_milestone_percentage.mul_floor(contribution.value); - refund_amount = refund_amount.saturating_add(per_contributor); - } - ::RefundHandler::send_refund_message_to_treasury( - project_account_id, - refund_amount, - project.currency_id, - project.funding_type, - )?; - } - } - - Projects::::remove(project_key); - ::DepositHandler::return_deposit(project.deposit_id)?; - Self::deposit_event(Event::NoConfidenceRoundFinalised(who, project_key)); - } else { - return Err(Error::::VoteThresholdNotMet.into()); - } - Ok(().into()) - } - pub(crate) fn try_auto_finalise_milestone_voting( project_key: ProjectKey, vote: &Vote>, diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 231daa3d..e126302e 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -151,11 +151,6 @@ pub mod pallet { ValueQuery, >; - /// This holds the votes when a no confidence round is raised. - #[pallet::storage] - #[pallet::getter(fn no_confidence_votes)] - pub(super) type NoConfidenceVotes = - StorageMap<_, Identity, ProjectKey, Vote>, OptionQuery>; #[pallet::storage] #[pallet::getter(fn project_count)] @@ -360,39 +355,6 @@ pub mod pallet { let who = ensure_signed(origin)?; Self::new_withdrawal(who, project_key) } - - /// In case of contributors losing confidence in the initiator a "Vote of no confidence" can be called. - /// This will start a round which each contributor can vote on. - /// The round will last as long as set in the Config. - - /// Deprecated: This function is no longer recommended for use as all the handling of dispute handling will - /// be taken care by the dedicated pallet called pallet-disputes. - #[deprecated(since = "0.1.0 of the disputes pallet", note = "all the disputes handling will be taken care by pallet-disputes")] - #[pallet::call_index(12)] - #[pallet::weight(::WeightInfo::raise_vote_of_no_confidence())] - pub fn raise_vote_of_no_confidence( - origin: OriginFor, - project_key: ProjectKey, - ) -> DispatchResult { - let who = ensure_signed(origin)?; - Self::raise_no_confidence_round(who, project_key) - } - - /// pallet-disputes? - /// Vote on an already existing "Vote of no condidence" round. - /// is_yay is FOR the project's continuation. - /// so is_yay == false == against the project from continuing. - /// This autofinalises like in the milestone voting. - #[pallet::call_index(13)] - #[pallet::weight(::WeightInfo::vote_on_no_confidence_round())] - pub fn vote_on_no_confidence_round( - origin: OriginFor, - project_key: ProjectKey, - is_yay: bool, - ) -> DispatchResult { - let who = ensure_signed(origin)?; - Self::add_vote_no_confidence(who, project_key, is_yay) - } } impl IntoProposal, BalanceOf, BlockNumberFor> for crate::Pallet @@ -595,7 +557,5 @@ pub trait WeightInfoT { fn submit_milestone() -> Weight; fn vote_on_milestone() -> Weight; fn withdraw() -> Weight; - fn raise_vote_of_no_confidence() -> Weight; - fn vote_on_no_confidence_round() -> Weight; fn on_initialize() -> Weight; } diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 895827e3..2387c0e2 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -912,259 +912,6 @@ fn withdraw_fails_before_approval() { }); } -#[test] -fn raise_no_confidence_round_already_started() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - let milestone_key = 0; - - let _ = - Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) - .unwrap(); - let _ = Proposals::vote_on_milestone( - RuntimeOrigin::signed(*BOB), - project_key, - milestone_key, - true, - ) - .unwrap(); - assert_ok!(Proposals::raise_vote_of_no_confidence( - RuntimeOrigin::signed(*BOB), - project_key - )); - assert_noop!( - Proposals::raise_vote_of_no_confidence(RuntimeOrigin::signed(*BOB), project_key), - Error::::RoundStarted - ); - }); -} - -#[test] -fn raise_no_confidence_round_not_contributor() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - assert_noop!( - Proposals::raise_vote_of_no_confidence(RuntimeOrigin::signed(*CHARLIE), project_key), - Error::::OnlyContributorsCanVote - ); - }); -} - -#[test] -fn raise_no_confidence_round_no_project() { - build_test_externality().execute_with(|| { - assert_noop!( - Proposals::raise_vote_of_no_confidence(RuntimeOrigin::signed(*CHARLIE), 20), - Error::::ProjectDoesNotExist - ); - }); -} - -#[test] -fn raise_no_confidence_round_puts_initial_vote_is_isnay() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - let milestone_key = 0; - - let _ = - Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) - .unwrap(); - let _ = Proposals::vote_on_milestone( - RuntimeOrigin::signed(*BOB), - project_key, - milestone_key, - true, - ) - .unwrap(); - - assert_ok!(Proposals::raise_vote_of_no_confidence( - RuntimeOrigin::signed(*BOB), - project_key - )); - - let vote = NoConfidenceVotes::::get(project_key).expect("vote should exist"); - assert_eq!( - vote.nay, 100_000, - "Bobs vote does not equal expected amount." - ); - - let has_voted = UserHasVoted::::get((project_key, RoundType::VoteOfNoConfidence, 0)); - assert!( - has_voted.values().len() == 1usize, - "The btree should only have a single value, the caller of the round." - ); - assert!( - has_voted.contains_key(&BOB), - "Bob called the round so should be recorded as voted." - ); - }); -} - -#[test] -fn vote_on_no_confidence_round_not_in_round() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - - assert_noop!( - Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*CHARLIE), - project_key, - true - ), - Error::::ProjectNotInRound - ); - }); -} - -#[test] -fn vote_on_no_confidence_round_not_contributor() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - - assert_ok!(Proposals::raise_vote_of_no_confidence( - RuntimeOrigin::signed(*BOB), - project_key - )); - assert_noop!( - Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*CHARLIE), - project_key, - true - ), - Error::::OnlyContributorsCanVote - ); - }); -} - -#[test] -fn vote_on_no_confidence_round_already_voted() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - - assert_ok!(Proposals::raise_vote_of_no_confidence( - RuntimeOrigin::signed(*BOB), - project_key - )); - assert_ok!(Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*DAVE), - project_key, - true - )); - assert_noop!( - Proposals::vote_on_no_confidence_round(RuntimeOrigin::signed(*DAVE), project_key, true), - Error::::VotesAreImmutable - ); - }); -} - -#[test] -fn vote_on_no_confidence_mutates_vote() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - - assert_ok!(Proposals::raise_vote_of_no_confidence( - RuntimeOrigin::signed(*BOB), - project_key - )); - assert_ok!(Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*DAVE), - project_key, - true - )); - let vote = NoConfidenceVotes::::get(project_key).expect("vote should exist"); - assert_eq!( - vote.nay, 100_000, - "Total vote should equal half contributions here." - ); - assert_eq!( - vote.yay, 100_000, - "Total vote should equal half contributions here." - ); - - let has_voted = UserHasVoted::::get((project_key, RoundType::VoteOfNoConfidence, 0)); - assert!( - has_voted.values().len() == 2usize, - "The btree should only have a single value, the caller of the round." - ); - assert!( - has_voted.contains_key(&BOB) && has_voted.contains_key(&DAVE), - "Bob and charlie have voted." - ); - }); -} - -#[test] -fn auto_finalizing_vote_on_no_confidence_when_threshold_is_met() { - build_test_externality().execute_with(|| { - let cont = get_contributions::(vec![*BOB, *DAVE, *CHARLIE, *ALICE], 100_000); - let prop_milestones = get_milestones(10); - let project_key = create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); - assert_ok!(Proposals::raise_vote_of_no_confidence( - RuntimeOrigin::signed(*BOB), - project_key - )); - assert_ok!(Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*DAVE), - project_key, - true - )); - assert_ok!(Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*CHARLIE), - project_key, - false - )); - assert_ok!(Proposals::vote_on_no_confidence_round( - RuntimeOrigin::signed(*ALICE), - project_key, - false - )); - let vote = NoConfidenceVotes::::get(project_key).expect("vote should exist"); - assert_eq!( - vote.nay, 300_000, - "Total vote should equal half contributions here." - ); - assert_eq!( - vote.yay, 100000, - "Total vote should equal half contributions here." - ); - - let has_voted = UserHasVoted::::get((project_key, RoundType::VoteOfNoConfidence, 0)); - assert!( - has_voted.values().len() == 4usize, - "Not all the votes has been recorded" - ); - assert!( - has_voted.contains_key(&BOB) - || has_voted.contains_key(&DAVE) - || has_voted.contains_key(&ALICE) - || has_voted.contains_key(&CHARLIE), - "Bob,Alice,Dave charlie have voted." - ); - assert_last_event::( - Event::::NoConfidenceRoundFinalised(*ALICE, project_key).into(), - ); - assert_eq!(Projects::::get(project_key), None); - assert_eq!( - Rounds::::get((project_key, 0), RoundType::VoteOfNoConfidence), - None - ); - }); -} - #[test] fn close_voting_round_works() { build_test_externality().execute_with(|| { diff --git a/pallets/proposals/src/weights.rs b/pallets/proposals/src/weights.rs index 8bd3ac44..26d6d98c 100644 --- a/pallets/proposals/src/weights.rs +++ b/pallets/proposals/src/weights.rs @@ -95,44 +95,6 @@ impl crate::WeightInfoT for WeightInfo { .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) } - /// Storage: ImbueProposals Projects (r:1 w:0) - /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(260823), added: 263298, mode: MaxEncodedLen) - /// Storage: ImbueProposals NoConfidenceVotes (r:1 w:1) - /// Proof: ImbueProposals NoConfidenceVotes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ImbueProposals RoundsExpiring (r:1 w:1) - /// Proof: ImbueProposals RoundsExpiring (max_values: None, max_size: Some(471), added: 2946, mode: MaxEncodedLen) - /// Storage: ImbueProposals UserHasVoted (r:1 w:1) - /// Proof: ImbueProposals UserHasVoted (max_values: None, max_size: Some(165018), added: 167493, mode: MaxEncodedLen) - /// Storage: ImbueProposals Rounds (r:0 w:1) - /// Proof: ImbueProposals Rounds (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) - fn raise_vote_of_no_confidence() -> Weight { - // Proof Size summary in bytes: - // Measured: `961` - // Estimated: `264288` - // Minimum execution time: 21_212_000 picoseconds. - Weight::from_parts(21_625_000, 0) - .saturating_add(Weight::from_parts(0, 264288)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: ImbueProposals Rounds (r:1 w:0) - /// Proof: ImbueProposals Rounds (max_values: None, max_size: Some(41), added: 2516, mode: MaxEncodedLen) - /// Storage: ImbueProposals Projects (r:1 w:0) - /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(260823), added: 263298, mode: MaxEncodedLen) - /// Storage: ImbueProposals NoConfidenceVotes (r:1 w:1) - /// Proof: ImbueProposals NoConfidenceVotes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ImbueProposals UserHasVoted (r:1 w:1) - /// Proof: ImbueProposals UserHasVoted (max_values: None, max_size: Some(165018), added: 167493, mode: MaxEncodedLen) - fn vote_on_no_confidence_round() -> Weight { - // Proof Size summary in bytes: - // Measured: `1223` - // Estimated: `264288` - // Minimum execution time: 21_730_000 picoseconds. - Weight::from_parts(22_659_000, 0) - .saturating_add(Weight::from_parts(0, 264288)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } /// Storage: ImbueProposals RoundsExpiring (r:1 w:1) /// Proof: ImbueProposals RoundsExpiring (max_values: None, max_size: Some(471), added: 2946, mode: MaxEncodedLen) /// Storage: ImbueProposals Rounds (r:0 w:1) From d0be81f9974c21da6d5b17265c832f75bec01836 Mon Sep 17 00:00:00 2001 From: Shankar Rao Mata Date: Mon, 16 Oct 2023 12:42:10 -0400 Subject: [PATCH 117/192] fixed the format check as it was failing in the build --- pallets/proposals/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index e126302e..53d85327 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -151,7 +151,6 @@ pub mod pallet { ValueQuery, >; - #[pallet::storage] #[pallet::getter(fn project_count)] pub type ProjectCount = StorageValue<_, ProjectKey, ValueQuery>; From d512608e2093b361286eef7b71aca2a0ff576833 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 20 Oct 2023 12:23:56 +0100 Subject: [PATCH 118/192] add fellowship migration, add migration to runtime --- pallets/fellowship/src/lib.rs | 3 ++ pallets/fellowship/src/migration.rs | 68 +++++++++++++++++++++++++++ pallets/proposals/src/tests/pallet.rs | 20 +++++++- runtime/imbue-kusama/src/lib.rs | 5 +- 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 pallets/fellowship/src/migration.rs diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index e2cf5d35..f441775e 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -48,7 +48,10 @@ pub mod pallet { ::MaxCandidatesPerShortlist, >; + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); + #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::config] diff --git a/pallets/fellowship/src/migration.rs b/pallets/fellowship/src/migration.rs new file mode 100644 index 00000000..9f21ba55 --- /dev/null +++ b/pallets/fellowship/src/migration.rs @@ -0,0 +1,68 @@ +use sp_std::{vec, vec::Vec}; +use frame_support::traits::OnRuntimeUpgrade; +use frame_support::*; + +mod v0 { + use super::*; + + struct MigrateInitial(T); + impl MigrateInitial + where ::AccountId : From<[u8; 32]> + { + fn get_initial_fellows(initial_fellows: Vec<([u8; 32], crate::Role, crate::Rank)>) -> Vec<(::AccountId>, crate::Role, crate::Rank) { + initial_fellows.iter().map(|(bytes, _, _)|{ + (bytes.into(), _, _) + }).collect() + } + } + + impl OnRuntimeUpgrade for MigrateInitial { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-fellowship", "Running pre_upgrade()"); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads_writes(1, 1); + log::warn!("****** STARTING MIGRATION *****"); + + let current = as GetStorageVersion>::current_storage_version(); + + if current == 1 { + let initial_fellows: Vec<::AccountId> = vec![ + (b"5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr", Role::Freelancer, 10), + (b"5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq", Role::Freelancer, 10), + ]; + let accounts = Self::get_initial_fellows(initial_fellows); + for (acc, role, rank) in accounts.iter() { + as FellowshipHandle>::add_to_fellowship(acc, role, rank, None, false); + } + + log::warn!("v1 has been successfully applied"); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); + } else { + log::warn!("Skipping v1, should be removed from Executive"); + weight = weight.saturating_add(T::DbWeight::get().reads(1)); + } + + log::warn!("****** ENDING MIGRATION *****"); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-fellowship", "Running post_upgrade()"); + + ensure!( + Pallet::::current_storage_version() == 1, + "Storage version should be v1 after the migration" + ); + + Ok(()) + } + + } + + +} diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 895827e3..8b6bf478 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -2,9 +2,27 @@ use frame_support::{assert_noop, assert_ok}; use common_types::CurrencyId; use test_utils::*; - use crate::{mock::*, *}; +#[test] +fn get_type_info() { + build_test_externality().execute_with(|| { + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + vec![0, 1, 2, 3] + .try_into() + .expect("should be smaller than bound."); + let i = ImmutableIndividualVotes::::new(milestone_keys.clone()); + + let mut encoded = as Encode>::encode(&i); + + dbg!( as TypeInfo>::type_info()); + dbg!(&encoded); + dbg!( as Decode>::decode(&mut encoded.as_slice())); + assert!(false) + }); +} + + #[test] fn submit_milestone_milestone_doesnt_exist() { build_test_externality().execute_with(|| { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 37d17ecf..a3a4fb16 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -180,7 +180,10 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = (pallet_proposals::migration::v6::MigrateToV6,); + pub type Unreleased = ( + pallet_proposals::migration::v6::MigrateToV6, + pallet_fellowship::migration::v0::MigrateInitial, + ); } /// Executive: handles dispatch to the various modules. From 3eef97b27d10d06ff86c72c9042fb1c5fcf02598 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 20 Oct 2023 12:35:07 +0100 Subject: [PATCH 119/192] move migration to v7 after rococo upgrade --- pallets/proposals/src/migration.rs | 185 ++++++++++++++++++----------- runtime/imbue-kusama/src/lib.rs | 2 +- 2 files changed, 115 insertions(+), 72 deletions(-) diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 4cdb582f..f28900f7 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -488,8 +488,6 @@ pub mod v5 { #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; - #[storage_alias] - pub type Projects = StorageMap<_, Identity, ProjectKey, ProjectV5, OptionQuery>; #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[repr(u32)] @@ -502,20 +500,7 @@ pub mod v5 { V4, } - pub struct ProjectV5 { - pub agreement_hash: H256, - pub milestones: BoundedBTreeMilestones, - pub contributions: ContributionsFor, - pub currency_id: common_types::CurrencyId, - pub withdrawn_funds: BalanceOf, - pub raised_funds: BalanceOf, - pub initiator: AccountIdOf, - pub created_on: BlockNumberFor, - pub cancelled: bool, - pub funding_type: FundingType, - pub deposit_id: DepositIdOf, - } - + #[derive( Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, )] @@ -583,6 +568,23 @@ pub mod v5 { pub mod v6 { use super::*; + pub struct ProjectV6 { + pub agreement_hash: H256, + pub milestones: BoundedBTreeMilestones, + pub contributions: ContributionsFor, + pub currency_id: common_types::CurrencyId, + pub withdrawn_funds: BalanceOf, + pub raised_funds: BalanceOf, + pub initiator: AccountIdOf, + pub created_on: BlockNumberFor, + pub cancelled: bool, + pub funding_type: FundingType, + pub deposit_id: DepositIdOf, + } + + #[storage_alias] + pub type Projects = StorageMap<_, Identity, ProjectKey, ProjectV6, OptionQuery>; + #[storage_alias] pub(super) type MilestoneVotes = StorageDoubleMap< Pallet, @@ -598,7 +600,7 @@ pub mod v6 { // only migrate the voting rounds awaiting the migration to remove no confidence rounds. // User votes is now handled by IndividualVoteStore:: fn migrate_user_has_voted(weight: &mut Weight) { - Projects::::iter().for_each(|(project_key, project)| { + v6::Projects::::iter().for_each(|(project_key, project)| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); project.milestones.keys().for_each(|milestone_key| { *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -653,62 +655,8 @@ pub mod v6 { } }) } - pub struct ProjectV5 { - pub agreement_hash: H256, - pub milestones: BoundedBTreeMilestones, - pub contributions: ContributionsFor, - pub currency_id: common_types::CurrencyId, - pub withdrawn_funds: BalanceOf, - pub raised_funds: BalanceOf, - pub initiator: AccountIdOf, - pub created_on: BlockNumberFor, - pub cancelled: bool, - pub funding_type: FundingType, - pub deposit_id: DepositIdOf, - } - - refund locations, jury, on_creation_funding - fn migrate_new_fields(weight &mut Weight) { - v5::Projects::::drain().for_each(|(key, project)|{ - *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - - let on_creation_funding = match project.funding_type { - Proposal => crate::FundingPath::TakeFromReserved, - Brief => crate::FundingPath::TakeFromReserved, - Grant(_) => crate::FundingPath::WaitForFunding, - } - - let jury = todo!(); - - let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match funding.funding_type { - Proposal => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), - Brief => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), - Grant(treasury_origin) => { - let beneficiary = PalletId(*b"py/trsry").into_account_truncating(); - Vec::from((Locality(treasury_origin.get_multi_location(beneficiary)), Percent::from_parts(100))).try_into().expect("1 is lower than bound; qed") - }, - }; - let migrated_project = crate::Project { - agreement_hash: project.agreement_hash, - milestones: project.milestones, - contributions: project.contributions, - currency_id: project.currency_id, - withdrawn_funds: project.withdrawn_funds, - raised_funds: project.raised_funds, - initiator: project.initiator, - created_on: project.created_on, - cancelled: project.cancelled, - deposit_id: project.deposit_id, - refund_locations, - jury, - on_creation_funding, - }; - *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - crate::Projects::::insert(key, migrated_project); - }); - } pub struct MigrateToV6(T); impl OnRuntimeUpgrade for MigrateToV6 { @@ -760,6 +708,101 @@ pub mod v6 { } } +pub mod v7 { + + struct MigrateToV7(T); + + impl OnRuntimeUpgrade for MigrateToV7 { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); + let current = as GetStorageVersion>::current_storage_version(); + let onchain = as GetStorageVersion>::on_chain_storage_version(); + ensure!( + current == 7 && onchain == 6, + "Current version must be set to v7 and onchain to v6" + ); + Ok(Vec::new()) + } + + fn on_runtime_upgrade() -> Weight { + let mut weight = T::DbWeight::get().reads_writes(1, 1); + log::warn!("****** STARTING MIGRATION *****"); + + let current = as GetStorageVersion>::current_storage_version(); + let onchain = as GetStorageVersion>::on_chain_storage_version(); + if current == 7 && onchain == 6 { + + migrate_new_fields::() + current.put::>(); + log::warn!("v7 has been successfully applied"); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); + } else { + log::warn!("Skipping v7 due to mismatched version, this be removed from Executive"); + weight = weight.saturating_add(T::DbWeight::get().reads(1)); + } + + log::warn!("****** ENDING MIGRATION *****"); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + log::warn!( target: "pallet-proposals", "Running post_upgrade()"); + + ensure!( + Pallet::::current_storage_version() == 7, + "Storage version should be v7 after the migration" + ); + + Ok(()) + } + } + + fn migrate_new_fields(weight &mut Weight) { + v6::Projects::::drain().for_each(|(key, project)|{ + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + + let on_creation_funding = match project.funding_type { + Proposal => crate::FundingPath::TakeFromReserved, + Brief => crate::FundingPath::TakeFromReserved, + Grant(_) => crate::FundingPath::WaitForFunding, + } + + let jury = todo!(); + + let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match funding.funding_type { + Proposal => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), + Brief => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), + Grant(treasury_origin) => { + let beneficiary = PalletId(*b"py/trsry").into_account_truncating(); + Vec::from((Locality(treasury_origin.get_multi_location(beneficiary)), Percent::from_parts(100))).try_into().expect("1 is lower than bound; qed") + }, + }; + + let migrated_project = crate::Project { + agreement_hash: project.agreement_hash, + milestones: project.milestones, + contributions: project.contributions, + currency_id: project.currency_id, + withdrawn_funds: project.withdrawn_funds, + raised_funds: project.raised_funds, + initiator: project.initiator, + created_on: project.created_on, + cancelled: project.cancelled, + deposit_id: project.deposit_id, + refund_locations, + jury, + on_creation_funding, + }; + + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + crate::Projects::::insert(key, migrated_project); + }); + } + +} + #[cfg(test)] mod test { use super::*; diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 70f92919..164a89a8 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -180,7 +180,7 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = (pallet_proposals::migration::v6::MigrateToV6,); + pub type Unreleased = (pallet_proposals::migration::v7::MigrateToV7,); } /// Executive: handles dispatch to the various modules. From 0cc9b1909fdc432795d96d3bede0ef2cfe57c775 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 20 Oct 2023 14:46:06 +0100 Subject: [PATCH 120/192] fix migration --- pallets/fellowship/src/lib.rs | 49 ++++++++++++++++------------- pallets/fellowship/src/migration.rs | 44 ++++++++++++++++---------- 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index f441775e..4b8d2182 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -19,6 +19,8 @@ mod mock; #[cfg(test)] mod tests; +mod migration; + #[cfg(feature = "runtime-benchmarks")] mod benchmarking; @@ -106,28 +108,31 @@ pub mod pallet { pub type FellowToVetter = StorageMap<_, Blake2_128Concat, AccountIdOf, VetterIdOf, OptionQuery>; - #[pallet::genesis_config] - pub struct GenesisConfig { - pub initial_fellows: Vec<(T::AccountId, Role, Rank)> - } - - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self { - initial_fellows: Vec::new() - } - } - } - - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { - fn build(&self) { - for (account, role, rank) in &self.initial_fellows { - as FellowshipHandle>::add_to_fellowship(account, role, rank, None, false); - } - } - } + + // #[cfg(feature = "genesis")] + // #[pallet::genesis_config] + // pub struct GenesisConfig { + // pub initial_fellows: BoundedVec<(T::AccountId, Role, Rank), ConstU32<100>> + // } + + // #[cfg(feature = "std")] + // impl Default for GenesisConfig { + // fn default() -> Self { + // Self { + // initial_fellows: Vec::new() + // } + // } + // } + + // #[cfg(feature = "genesis")] + // #[pallet::genesis_build] + // impl GenesisBuild for GenesisConfig { + // fn build(&self) { + // for (account, role, rank) in &self.initial_fellows { + // as FellowshipHandle>::add_to_fellowship(account, role, rank, None, false); + // } + // } + // } #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] diff --git a/pallets/fellowship/src/migration.rs b/pallets/fellowship/src/migration.rs index 9f21ba55..38ff707c 100644 --- a/pallets/fellowship/src/migration.rs +++ b/pallets/fellowship/src/migration.rs @@ -1,22 +1,41 @@ -use sp_std::{vec, vec::Vec}; +use sp_std::{vec, vec::Vec, str::FromStr, fmt::Debug}; use frame_support::traits::OnRuntimeUpgrade; -use frame_support::*; +use frame_support::{*, pallet_prelude::*, dispatch::EncodeLike}; +use sp_runtime::AccountId32; +use crate::{*, traits::*}; mod v0 { use super::*; struct MigrateInitial(T); impl MigrateInitial - where ::AccountId : From<[u8; 32]> + where + ::AccountId: FromStr, + <::AccountId as FromStr>::Err : Debug + { - fn get_initial_fellows(initial_fellows: Vec<([u8; 32], crate::Role, crate::Rank)>) -> Vec<(::AccountId>, crate::Role, crate::Rank) { - initial_fellows.iter().map(|(bytes, _, _)|{ - (bytes.into(), _, _) - }).collect() + fn insert_initial_fellows(weight: &mut Weight) { + let initial_fellows: Vec<(::AccountId, crate::Role, crate::Rank)> = vec![ + // EARNEST + ( as FromStr>::from_str("5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr").unwrap(), Role::Freelancer, 10), + // ME + ( as FromStr>::from_str("5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq").unwrap(), Role::Freelancer, 10), + // BEA + ( as FromStr>::from_str("5DU2hcQnEmrSXCDUnjiwNX3A1uTf26ACpgs4KUFpsLJqAnjd").unwrap(), Role::Freelancer, 10), + ]; + for (acc, role, rank) in initial_fellows.into_iter() { + as FellowshipHandle>>::add_to_fellowship(&acc, role, rank, None, false); + *weight = weight.saturating_add(T::WeightInfo::add_to_fellowship()) + } } } - impl OnRuntimeUpgrade for MigrateInitial { + impl OnRuntimeUpgrade for MigrateInitial + where + ::AccountId: FromStr, + <::AccountId as FromStr>::Err : Debug + + { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-fellowship", "Running pre_upgrade()"); @@ -30,14 +49,7 @@ mod v0 { let current = as GetStorageVersion>::current_storage_version(); if current == 1 { - let initial_fellows: Vec<::AccountId> = vec![ - (b"5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr", Role::Freelancer, 10), - (b"5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq", Role::Freelancer, 10), - ]; - let accounts = Self::get_initial_fellows(initial_fellows); - for (acc, role, rank) in accounts.iter() { - as FellowshipHandle>::add_to_fellowship(acc, role, rank, None, false); - } + Self::insert_initial_fellows(&mut weight); log::warn!("v1 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); From 3be3c6a32c729e99a9bfb9fa4c945ea2f2b1709a Mon Sep 17 00:00:00 2001 From: f-gate Date: Sun, 22 Oct 2023 18:02:08 +0100 Subject: [PATCH 121/192] fix accountid trait bounds --- pallets/fellowship/src/impls.rs | 2 -- pallets/fellowship/src/lib.rs | 6 ++---- pallets/fellowship/src/migration.rs | 21 ++++++++------------- pallets/fellowship/src/tests.rs | 2 +- pallets/fellowship/src/weights.rs | 27 +++++++++++++++++++++++++++ runtime/imbue-kusama/src/lib.rs | 2 +- 6 files changed, 39 insertions(+), 21 deletions(-) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 4c24192f..3a25b88e 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -53,8 +53,6 @@ impl Convert for RoleToPercentFee { match role { Role::Vetter => Percent::from_percent(50u8), Role::Freelancer => Percent::from_percent(50u8), - Role::BusinessDev => Percent::from_percent(50u8), - Role::Approver => Percent::from_percent(50u8), } } } diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 4b8d2182..f8d0ec91 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -19,7 +19,7 @@ mod mock; #[cfg(test)] mod tests; -mod migration; +pub mod migration; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; @@ -50,7 +50,7 @@ pub mod pallet { ::MaxCandidatesPerShortlist, >; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -427,7 +427,5 @@ pub mod pallet { pub enum Role { Vetter, Freelancer, - BusinessDev, - Approver, } } diff --git a/pallets/fellowship/src/migration.rs b/pallets/fellowship/src/migration.rs index 38ff707c..827ffeec 100644 --- a/pallets/fellowship/src/migration.rs +++ b/pallets/fellowship/src/migration.rs @@ -2,26 +2,24 @@ use sp_std::{vec, vec::Vec, str::FromStr, fmt::Debug}; use frame_support::traits::OnRuntimeUpgrade; use frame_support::{*, pallet_prelude::*, dispatch::EncodeLike}; use sp_runtime::AccountId32; + use crate::{*, traits::*}; -mod v0 { +pub mod v0 { use super::*; - struct MigrateInitial(T); + pub struct MigrateInitial(T); impl MigrateInitial - where - ::AccountId: FromStr, - <::AccountId as FromStr>::Err : Debug - + where T: frame_system::Config { fn insert_initial_fellows(weight: &mut Weight) { let initial_fellows: Vec<(::AccountId, crate::Role, crate::Rank)> = vec![ // EARNEST - ( as FromStr>::from_str("5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr").unwrap(), Role::Freelancer, 10), + (AccountId32::try_from(b"5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr".as_slice()).unwrap(), Role::Freelancer, 10), // ME - ( as FromStr>::from_str("5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq").unwrap(), Role::Freelancer, 10), + (AccountId32::try_from(b"5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq".as_slice()).unwrap(), Role::Freelancer, 10), // BEA - ( as FromStr>::from_str("5DU2hcQnEmrSXCDUnjiwNX3A1uTf26ACpgs4KUFpsLJqAnjd").unwrap(), Role::Freelancer, 10), + (AccountId32::try_from(b"5DU2hcQnEmrSXCDUnjiwNX3A1uTf26ACpgs4KUFpsLJqAnjd".as_slice()).unwrap(), Role::Freelancer, 10), ]; for (acc, role, rank) in initial_fellows.into_iter() { as FellowshipHandle>>::add_to_fellowship(&acc, role, rank, None, false); @@ -31,10 +29,7 @@ mod v0 { } impl OnRuntimeUpgrade for MigrateInitial - where - ::AccountId: FromStr, - <::AccountId as FromStr>::Err : Debug - + where T: frame_system::Config { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { diff --git a/pallets/fellowship/src/tests.rs b/pallets/fellowship/src/tests.rs index ec01cd79..d07a228b 100644 --- a/pallets/fellowship/src/tests.rs +++ b/pallets/fellowship/src/tests.rs @@ -67,7 +67,7 @@ fn ensure_role_in_works() { None )); assert!( - EnsureFellowshipRole::::ensure_role_in(&BOB, vec![Role::Approver], None).is_err(), + EnsureFellowshipRole::::ensure_role_in(&BOB, vec![Role::Vetter], None).is_err(), "BOB is not of this Role." ); assert!( diff --git a/pallets/fellowship/src/weights.rs b/pallets/fellowship/src/weights.rs index 8b137891..151dde51 100644 --- a/pallets/fellowship/src/weights.rs +++ b/pallets/fellowship/src/weights.rs @@ -1 +1,28 @@ + +use frame_support::pallet_prelude::Weight; + +pub struct WeightInfo; +impl crate::traits::WeightInfoT for WeightInfo { + fn add_to_fellowship() -> Weight { + ::default() + } + fn force_add_fellowship() -> Weight { + ::default() + } + fn leave_fellowship() -> Weight { + ::default() + } + fn force_remove_and_slash_fellowship() -> Weight { + ::default() + } + fn add_candidate_to_shortlist() -> Weight { + ::default() + } + fn remove_candidate_from_shortlist() -> Weight { + ::default() + } + fn pay_deposit_to_remove_pending_status() -> Weight { + ::default() + } +} diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index a3a4fb16..cbf94777 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -884,7 +884,7 @@ impl pallet_fellowship::Config for Runtime { type DepositCurrencyId = DepositCurrencyId; // Send slashes to the treasury. type SlashAccount = TreasuryAccount; - type WeightInfo = (); + type WeightInfo = pallet_fellowship::weights::WeightInfo; } pub type DepositId = u64; From 8a1b81c3e577695e7ed311b6b9c500eca0b52503 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 10:36:13 +0100 Subject: [PATCH 122/192] fix dependancy issue: https://github.com/ImbueNetwork/imbue/issues/252 --- Cargo.lock | 1 + pallets/deposits/Cargo.toml | 2 +- runtime/common/Cargo.toml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 27e19aab..305c9b6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1252,6 +1252,7 @@ dependencies = [ "orml-traits", "pallet-authorship", "pallet-balances", + "pallet-xcm", "parity-scale-codec 3.6.5", "polkadot-primitives", "scale-info 1.0.0", diff --git a/pallets/deposits/Cargo.toml b/pallets/deposits/Cargo.toml index 3bdd2479..a457938f 100644 --- a/pallets/deposits/Cargo.toml +++ b/pallets/deposits/Cargo.toml @@ -47,7 +47,7 @@ std = [ "pallet-xcm/std", "common-runtime/std" ] -runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks"] +runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "common-runtime/runtime-benchmarks"] try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 30965aba..18e44057 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -23,6 +23,7 @@ pallet-authorship = { git = "https://github.com/paritytech/substrate" , branch = pallet-balances = { git = "https://github.com/paritytech/substrate" , branch = "polkadot-v0.9.43", default-features = false } frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43", optional = true } frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43", optional = true } +pallet-xcm = { default-features = false, git = "https://github.com/paritytech/polkadot.git", branch = "release-v0.9.43"} ## Substrate Primitive Dependencies sp-arithmetic = { git = "https://github.com/paritytech/substrate" , branch = "polkadot-v0.9.43", default-features = false } @@ -80,5 +81,6 @@ std = [ runtime-benchmarks = [ 'frame-support/runtime-benchmarks', "frame-system/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", "pallet-balances/runtime-benchmarks", ] From 23398a1a93c7e0622dad642e340405a842f7a6b5 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 10:53:20 +0100 Subject: [PATCH 123/192] add fellowship to runtime benchmarks --- pallets/fellowship/src/benchmarking.rs | 1 - runtime/imbue-kusama/Cargo.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/fellowship/src/benchmarking.rs b/pallets/fellowship/src/benchmarking.rs index c08a7e1f..d315180c 100644 --- a/pallets/fellowship/src/benchmarking.rs +++ b/pallets/fellowship/src/benchmarking.rs @@ -12,7 +12,6 @@ use orml_traits::MultiCurrency; use sp_runtime::SaturatedConversion; #[benchmarks( where ::AccountId: AsRef<[u8]>, crate::Event::: Into<::RuntimeEvent>)] -#[benchmarks] mod benchmarks { use super::*; #[benchmark] diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index fde64e71..f416259d 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -274,6 +274,7 @@ runtime-benchmarks = [ 'pallet-proposals/runtime-benchmarks', 'pallet-briefs/runtime-benchmarks', 'pallet-grants/runtime-benchmarks', + 'pallet-fellowship/runtime-benchmarks', ] # A feature that should be enabled when the runtime should be build for on-chain From 1a3b6f33d41505a877060b00477666717c5b97b5 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 11:03:00 +0100 Subject: [PATCH 124/192] generate fellowship weights --- pallets/fellowship/src/weights.rs | 184 ++++++++++++++++++++++++++---- runtime/imbue-kusama/src/lib.rs | 2 +- 2 files changed, 161 insertions(+), 25 deletions(-) diff --git a/pallets/fellowship/src/weights.rs b/pallets/fellowship/src/weights.rs index 151dde51..d9fdedf3 100644 --- a/pallets/fellowship/src/weights.rs +++ b/pallets/fellowship/src/weights.rs @@ -1,28 +1,164 @@ +//! Autogenerated weights for `pallet_fellowship` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-10-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("spec.json"), DB CACHE: 1024 -use frame_support::pallet_prelude::Weight; +// Executed Command: +// ./target/debug/imbue +// benchmark +// pallet +// --chain +// spec.json +// --execution +// wasm +// --wasm-execution +// compiled +// --pallet +// pallet-fellowship +// --extrinsic +// * +// --output +// weights.rs +// --steps +// 50 +// --repeat +// 20 -pub struct WeightInfo; -impl crate::traits::WeightInfoT for WeightInfo { - fn add_to_fellowship() -> Weight { - ::default() - } - fn force_add_fellowship() -> Weight { - ::default() - } - fn leave_fellowship() -> Weight { - ::default() - } - fn force_remove_and_slash_fellowship() -> Weight { - ::default() - } - fn add_candidate_to_shortlist() -> Weight { - ::default() - } - fn remove_candidate_from_shortlist() -> Weight { - ::default() - } - fn pay_deposit_to_remove_pending_status() -> Weight { - ::default() - } +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_fellowship`. +pub struct WeightInfo(PhantomData); +impl crate::traits::WeightInfoT for WeightInfo { + /// Storage: ImbueFellowship Roles (r:1 w:1) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowToVetter (r:0 w:1) + /// Proof: ImbueFellowship FellowToVetter (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowshipReserves (r:0 w:1) + /// Proof: ImbueFellowship FellowshipReserves (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + fn add_to_fellowship() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `3593` + // Minimum execution time: 278_433_000 picoseconds. + Weight::from_parts(288_562_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: ImbueFellowship Roles (r:1 w:1) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + fn force_add_fellowship() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3516` + // Minimum execution time: 143_034_000 picoseconds. + Weight::from_parts(149_322_000, 0) + .saturating_add(Weight::from_parts(0, 3516)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: ImbueFellowship Roles (r:1 w:1) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: ImbueFellowship PendingFellows (r:1 w:1) + /// Proof: ImbueFellowship PendingFellows (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowshipReserves (r:1 w:0) + /// Proof: ImbueFellowship FellowshipReserves (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowToVetter (r:0 w:1) + /// Proof: ImbueFellowship FellowToVetter (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn leave_fellowship() -> Weight { + // Proof Size summary in bytes: + // Measured: `410` + // Estimated: `3593` + // Minimum execution time: 429_483_000 picoseconds. + Weight::from_parts(447_299_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: ImbueFellowship Roles (r:1 w:1) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: ImbueFellowship PendingFellows (r:1 w:1) + /// Proof: ImbueFellowship PendingFellows (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowshipReserves (r:1 w:0) + /// Proof: ImbueFellowship FellowshipReserves (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowToVetter (r:0 w:1) + /// Proof: ImbueFellowship FellowToVetter (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn force_remove_and_slash_fellowship() -> Weight { + // Proof Size summary in bytes: + // Measured: `513` + // Estimated: `6196` + // Minimum execution time: 833_617_000 picoseconds. + Weight::from_parts(867_644_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: ImbueFellowship Roles (r:2 w:0) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ImbueFellowship ShortlistRound (r:1 w:0) + /// Proof: ImbueFellowship ShortlistRound (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: ImbueFellowship CandidateShortlist (r:1 w:1) + /// Proof: ImbueFellowship CandidateShortlist (max_values: None, max_size: Some(3421), added: 5896, mode: MaxEncodedLen) + fn add_candidate_to_shortlist() -> Weight { + // Proof Size summary in bytes: + // Measured: `289` + // Estimated: `6886` + // Minimum execution time: 253_046_000 picoseconds. + Weight::from_parts(263_305_000, 0) + .saturating_add(Weight::from_parts(0, 6886)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: ImbueFellowship Roles (r:1 w:0) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: ImbueFellowship ShortlistRound (r:1 w:0) + /// Proof: ImbueFellowship ShortlistRound (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: ImbueFellowship CandidateShortlist (r:1 w:1) + /// Proof: ImbueFellowship CandidateShortlist (max_values: None, max_size: Some(3421), added: 5896, mode: MaxEncodedLen) + fn remove_candidate_from_shortlist() -> Weight { + // Proof Size summary in bytes: + // Measured: `299` + // Estimated: `6886` + // Minimum execution time: 194_186_000 picoseconds. + Weight::from_parts(202_969_000, 0) + .saturating_add(Weight::from_parts(0, 6886)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: ImbueFellowship PendingFellows (r:1 w:1) + /// Proof: ImbueFellowship PendingFellows (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: ImbueFellowship Roles (r:0 w:1) + /// Proof: ImbueFellowship Roles (max_values: None, max_size: Some(51), added: 2526, mode: MaxEncodedLen) + /// Storage: ImbueFellowship FellowshipReserves (r:0 w:1) + /// Proof: ImbueFellowship FellowshipReserves (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) + fn pay_deposit_to_remove_pending_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `259` + // Estimated: `3593` + // Minimum execution time: 366_140_000 picoseconds. + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } } diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index cbf94777..36709177 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -884,7 +884,7 @@ impl pallet_fellowship::Config for Runtime { type DepositCurrencyId = DepositCurrencyId; // Send slashes to the treasury. type SlashAccount = TreasuryAccount; - type WeightInfo = pallet_fellowship::weights::WeightInfo; + type WeightInfo = pallet_fellowship::weights::WeightInfo; } pub type DepositId = u64; From 079affe8485ff597205fd2e6ddc0d06808acb54a Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 11:05:52 +0100 Subject: [PATCH 125/192] remove test test --- pallets/proposals/src/tests/pallet.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 8b6bf478..441b4040 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -4,25 +4,6 @@ use common_types::CurrencyId; use test_utils::*; use crate::{mock::*, *}; -#[test] -fn get_type_info() { - build_test_externality().execute_with(|| { - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - vec![0, 1, 2, 3] - .try_into() - .expect("should be smaller than bound."); - let i = ImmutableIndividualVotes::::new(milestone_keys.clone()); - - let mut encoded = as Encode>::encode(&i); - - dbg!( as TypeInfo>::type_info()); - dbg!(&encoded); - dbg!( as Decode>::decode(&mut encoded.as_slice())); - assert!(false) - }); -} - - #[test] fn submit_milestone_milestone_doesnt_exist() { build_test_externality().execute_with(|| { From 54df1f5573140e0361b173ace959253e9956afb8 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 11:06:10 +0100 Subject: [PATCH 126/192] fmt --- pallets/fellowship/src/lib.rs | 13 +++---- pallets/fellowship/src/migration.rs | 56 ++++++++++++++++++++------- pallets/proposals/src/tests/pallet.rs | 2 +- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index f8d0ec91..70d4fe34 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -108,7 +108,6 @@ pub mod pallet { pub type FellowToVetter = StorageMap<_, Blake2_128Concat, AccountIdOf, VetterIdOf, OptionQuery>; - // #[cfg(feature = "genesis")] // #[pallet::genesis_config] // pub struct GenesisConfig { @@ -117,21 +116,21 @@ pub mod pallet { // #[cfg(feature = "std")] // impl Default for GenesisConfig { - // fn default() -> Self { + // fn default() -> Self { // Self { // initial_fellows: Vec::new() // } - // } + // } // } // #[cfg(feature = "genesis")] // #[pallet::genesis_build] // impl GenesisBuild for GenesisConfig { - // fn build(&self) { - // for (account, role, rank) in &self.initial_fellows { + // fn build(&self) { + // for (account, role, rank) in &self.initial_fellows { // as FellowshipHandle>::add_to_fellowship(account, role, rank, None, false); - // } - // } + // } + // } // } #[pallet::event] diff --git a/pallets/fellowship/src/migration.rs b/pallets/fellowship/src/migration.rs index 827ffeec..8f8c7ff8 100644 --- a/pallets/fellowship/src/migration.rs +++ b/pallets/fellowship/src/migration.rs @@ -1,35 +1,64 @@ -use sp_std::{vec, vec::Vec, str::FromStr, fmt::Debug}; use frame_support::traits::OnRuntimeUpgrade; -use frame_support::{*, pallet_prelude::*, dispatch::EncodeLike}; +use frame_support::{dispatch::EncodeLike, pallet_prelude::*, *}; use sp_runtime::AccountId32; +use sp_std::{fmt::Debug, str::FromStr, vec, vec::Vec}; -use crate::{*, traits::*}; +use crate::{traits::*, *}; pub mod v0 { use super::*; pub struct MigrateInitial(T); - impl MigrateInitial - where T: frame_system::Config + impl MigrateInitial + where + T: frame_system::Config, { fn insert_initial_fellows(weight: &mut Weight) { - let initial_fellows: Vec<(::AccountId, crate::Role, crate::Rank)> = vec![ + let initial_fellows: Vec<( + ::AccountId, + crate::Role, + crate::Rank, + )> = vec![ // EARNEST - (AccountId32::try_from(b"5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr".as_slice()).unwrap(), Role::Freelancer, 10), + ( + AccountId32::try_from( + b"5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr".as_slice(), + ) + .unwrap(), + Role::Freelancer, + 10, + ), // ME - (AccountId32::try_from(b"5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq".as_slice()).unwrap(), Role::Freelancer, 10), + ( + AccountId32::try_from( + b"5DCzKK5EZvY77vxxWXeip7sp17TqB7sk7Fj1hXes7Bo6B5Eq".as_slice(), + ) + .unwrap(), + Role::Freelancer, + 10, + ), // BEA - (AccountId32::try_from(b"5DU2hcQnEmrSXCDUnjiwNX3A1uTf26ACpgs4KUFpsLJqAnjd".as_slice()).unwrap(), Role::Freelancer, 10), + ( + AccountId32::try_from( + b"5DU2hcQnEmrSXCDUnjiwNX3A1uTf26ACpgs4KUFpsLJqAnjd".as_slice(), + ) + .unwrap(), + Role::Freelancer, + 10, + ), ]; for (acc, role, rank) in initial_fellows.into_iter() { - as FellowshipHandle>>::add_to_fellowship(&acc, role, rank, None, false); + as FellowshipHandle>>::add_to_fellowship( + &acc, role, rank, None, false, + ); *weight = weight.saturating_add(T::WeightInfo::add_to_fellowship()) } } } - impl OnRuntimeUpgrade for MigrateInitial - where T: frame_system::Config + impl OnRuntimeUpgrade for MigrateInitial + where + T: frame_system::Config, { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { @@ -68,8 +97,5 @@ pub mod v0 { Ok(()) } - } - - } diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 441b4040..66632bdc 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -1,8 +1,8 @@ use frame_support::{assert_noop, assert_ok}; +use crate::{mock::*, *}; use common_types::CurrencyId; use test_utils::*; -use crate::{mock::*, *}; #[test] fn submit_milestone_milestone_doesnt_exist() { From fcabf77aab5fe29ef14351134cc87572f4c452ca Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 11:29:09 +0100 Subject: [PATCH 127/192] add jury selector trait --- pallets/fellowship/src/impls.rs | 6 ++++++ pallets/fellowship/src/traits.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 3a25b88e..f4a875b5 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -57,6 +57,12 @@ impl Convert for RoleToPercentFee { } } +impl SelectJury> for Pallet { + fn select_jury() -> Vec> { + + } +} + impl Pallet { /// Try take the membership deposit from who /// If the deposit was taken, this will return true, else false. diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index 9ce232bc..674f8a4c 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -33,6 +33,12 @@ pub trait EnsureRole { ) -> Result; } +/// Select a pseudo-random jury of a specified amount. +pub trait SelectJury { + fn select_jury() -> Vec +} + + pub trait WeightInfoT { fn add_to_fellowship() -> Weight; fn force_add_fellowship() -> Weight; From 583f9b78cf6aa95fe81bd5191ef7fcae39b406bb Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 11:31:31 +0100 Subject: [PATCH 128/192] run gcp on all pushes --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 039e8965..595ee8b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,6 @@ name: build-on-self-hosted-runner on: workflow_dispatch: push: - branches: - - main paths-ignore: - "**.md" pull_request: From 4fe68611e6ddc712a28d206e0cf3955f6ee67edd Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 11:46:26 +0100 Subject: [PATCH 129/192] restore --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 595ee8b2..039e8965 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: build-on-self-hosted-runner on: workflow_dispatch: push: + branches: + - main paths-ignore: - "**.md" pull_request: From 6c9511bd1cf0dfc81f624132ba5b0cd2137ead5f Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 23 Oct 2023 17:02:47 +0100 Subject: [PATCH 130/192] select a random jury given a jury length --- pallets/fellowship/Cargo.toml | 3 +++ pallets/fellowship/src/impls.rs | 23 ++++++++++++++++++++++- pallets/fellowship/src/lib.rs | 2 +- pallets/fellowship/src/traits.rs | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pallets/fellowship/Cargo.toml b/pallets/fellowship/Cargo.toml index b80b1a35..9852d4fd 100644 --- a/pallets/fellowship/Cargo.toml +++ b/pallets/fellowship/Cargo.toml @@ -25,6 +25,9 @@ common-types = { path = "../../libs/common-types", default-features = false} common-traits = { path = "../../libs/common-traits", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false} sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } +rand = { version = "0.7.3", default-features = false, features = ["alloc"]} + [dev-dependencies] sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index f4a875b5..5d04575c 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -8,6 +8,7 @@ use sp_runtime::{ DispatchError, Percent, }; use sp_std::vec::Vec; +use sp_core::H256; /// Ensure that a account is of a given role. /// Used in other pallets like an ensure origin. @@ -57,9 +58,29 @@ impl Convert for RoleToPercentFee { } } +/// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. impl SelectJury> for Pallet { - fn select_jury() -> Vec> { + fn select_jury(mut jury_size: u32) -> Vec> { + let out: Vec> = Vec::new(); + let mut rng = rand::thread_rng(); + let mut length = Roles::::iter_keys().count(); + + if jury_size > length { + jury_size = length; + } + // SAFETY: panics is jury_size > length. + let sample = rand::seq::index::sample(&mut rng, length, jury_size) + + let roles_keys_iterator = Roles::::iter_keys(); + for index in sample.to_vec().iter() { + if let Some(key) = roles_keys_iterator.position(|&x| x == index) { + if let Some(role) = Roles::::get(key) { + out.push(role); + } + } + } + out } } diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 70d4fe34..5255142a 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -27,7 +27,7 @@ mod benchmarking; #[frame_support::pallet] pub mod pallet { use common_types::CurrencyId; - use frame_support::{pallet_prelude::*, BoundedBTreeMap}; + use frame_support::{pallet_prelude::*, BoundedBTreeMap, traits::Randomness}; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use sp_runtime::traits::Zero; diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index 674f8a4c..d59f2ef1 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -35,7 +35,7 @@ pub trait EnsureRole { /// Select a pseudo-random jury of a specified amount. pub trait SelectJury { - fn select_jury() -> Vec + fn select_jury(size: u32) -> Vec } From dabc56644eff5f08976b77b2709913af6d5a56d1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 24 Oct 2023 11:55:28 +0100 Subject: [PATCH 131/192] fix randomer --- Cargo.lock | 1 + pallets/fellowship/src/impls.rs | 18 ++++++++---------- pallets/fellowship/src/traits.rs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2abdad06..d3673ba2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6957,6 +6957,7 @@ dependencies = [ "orml-tokens", "orml-traits", "parity-scale-codec 3.6.5", + "rand 0.7.3", "scale-info 2.9.0", "serde", "sp-arithmetic", diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 5d04575c..39d7d216 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -59,9 +59,9 @@ impl Convert for RoleToPercentFee { } /// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. -impl SelectJury> for Pallet { - fn select_jury(mut jury_size: u32) -> Vec> { - let out: Vec> = Vec::new(); +impl crate::traits::SelectJury> for Pallet { + fn select_jury(mut jury_size: usize) -> Vec> { + let mut out: Vec> = Vec::new(); let mut rng = rand::thread_rng(); let mut length = Roles::::iter_keys().count(); @@ -69,14 +69,12 @@ impl SelectJury> for Pallet { jury_size = length; } // SAFETY: panics is jury_size > length. - let sample = rand::seq::index::sample(&mut rng, length, jury_size) + let sample = rand::seq::index::sample(&mut rng, length, jury_size); - let roles_keys_iterator = Roles::::iter_keys(); - for index in sample.to_vec().iter() { - if let Some(key) = roles_keys_iterator.position(|&x| x == index) { - if let Some(role) = Roles::::get(key) { - out.push(role); - } + let mut roles_keys_iterator = Roles::::iter_keys(); + for index in sample.into_vec().iter() { + if let Some(key) = roles_keys_iterator.nth(*index) { + out.push(key) } } diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index d59f2ef1..d540e8da 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -35,7 +35,7 @@ pub trait EnsureRole { /// Select a pseudo-random jury of a specified amount. pub trait SelectJury { - fn select_jury(size: u32) -> Vec + fn select_jury(size: usize) -> Vec; } From d3bfdf8c0958eb4931720f65b8d90c92e7bb6326 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 24 Oct 2023 15:18:48 +0100 Subject: [PATCH 132/192] select jury tests --- pallets/fellowship/src/impls.rs | 14 +++--- pallets/fellowship/src/tests.rs | 79 +++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 6 deletions(-) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 39d7d216..48e2f919 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -64,20 +64,22 @@ impl crate::traits::SelectJury> for Pallet { let mut out: Vec> = Vec::new(); let mut rng = rand::thread_rng(); let mut length = Roles::::iter_keys().count(); - + if jury_size > length { jury_size = length; } + // SAFETY: panics is jury_size > length. let sample = rand::seq::index::sample(&mut rng, length, jury_size); - let mut roles_keys_iterator = Roles::::iter_keys(); - for index in sample.into_vec().iter() { - if let Some(key) = roles_keys_iterator.nth(*index) { - out.push(key) + let keys = Roles::::iter_keys().collect::>>(); + for index in sample.iter() { + // Defensive guard to avoid panic on indexing. + if index < keys.len() { + let key = &keys[index]; + out.push(key.clone()) } } - out } } diff --git a/pallets/fellowship/src/tests.rs b/pallets/fellowship/src/tests.rs index d07a228b..c568a9a8 100644 --- a/pallets/fellowship/src/tests.rs +++ b/pallets/fellowship/src/tests.rs @@ -733,3 +733,82 @@ fn e2e() { assert_eq!(Roles::::get(*EMPTY).unwrap(), (Role::Freelancer, 10)); }); } + + +#[test] +fn test_select_jury_doesnt_panic_amount_more_than_length() { + new_test_ext().execute_with(|| { + let size: u8 = 100; + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + let jury = as SelectJury>::select_jury(size as usize + 100usize); + assert_eq!(jury.len(), 100, "jury size should have been truncated to size of roles or not enough roles have been selected."); + }); +} + +#[test] +fn test_select_jury_is_random() { + new_test_ext().execute_with(|| { + let size: u8 = 255; + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + let jury_1 = as SelectJury>::select_jury(1); + let jury_2 = as SelectJury>::select_jury(1); + + assert!(jury_1[0] != jury_2[0]); + + let jury_1 = as SelectJury>::select_jury(100); + let jury_2 = as SelectJury>::select_jury(100); + + assert!(jury_1 != jury_2); + }); +} + + +#[test] +fn test_select_jury_stress_test() { + new_test_ext().execute_with(|| { + let size: u8 = 255; + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + for _ in 0..u8::MAX { + as SelectJury>::select_jury(255); + } + }); +} + +#[test] +fn test_select_jury_select_correct_amount_in_normal_conditions() { + new_test_ext().execute_with(|| { + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + + let jury = as SelectJury>::select_jury(50); + assert_eq!(jury.len(), 50, "jury members should be exactly 50.") + + }); +} From 90bae348cf64493d63c4e9a00f14f6dc285728f7 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 24 Oct 2023 15:25:41 +0100 Subject: [PATCH 133/192] refactor minor --- pallets/fellowship/src/impls.rs | 6 ++++-- pallets/fellowship/src/tests.rs | 4 ++-- pallets/fellowship/src/traits.rs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 48e2f919..c8f0e99a 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -59,11 +59,13 @@ impl Convert for RoleToPercentFee { } /// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. +/// Currently bound to u8 for size. impl crate::traits::SelectJury> for Pallet { - fn select_jury(mut jury_size: usize) -> Vec> { + fn select_jury(jury_size: u8) -> Vec> { + let mut jury_size = jury_size as usize; let mut out: Vec> = Vec::new(); let mut rng = rand::thread_rng(); - let mut length = Roles::::iter_keys().count(); + let length = Roles::::iter_keys().count(); if jury_size > length { jury_size = length; diff --git a/pallets/fellowship/src/tests.rs b/pallets/fellowship/src/tests.rs index c568a9a8..190cf716 100644 --- a/pallets/fellowship/src/tests.rs +++ b/pallets/fellowship/src/tests.rs @@ -747,7 +747,7 @@ fn test_select_jury_doesnt_panic_amount_more_than_length() { 10 )); } - let jury = as SelectJury>::select_jury(size as usize + 100usize); + let jury = as SelectJury>::select_jury(size + 100); assert_eq!(jury.len(), 100, "jury size should have been truncated to size of roles or not enough roles have been selected."); }); } @@ -798,7 +798,7 @@ fn test_select_jury_stress_test() { #[test] fn test_select_jury_select_correct_amount_in_normal_conditions() { new_test_ext().execute_with(|| { - for i in 0..size { + for i in 0..255 { assert_ok!(Fellowship::force_add_fellowship( RuntimeOrigin::root(), Public::from_raw([i as u8; 32]), diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index d540e8da..9f137549 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -35,7 +35,7 @@ pub trait EnsureRole { /// Select a pseudo-random jury of a specified amount. pub trait SelectJury { - fn select_jury(size: usize) -> Vec; + fn select_jury(size: u8) -> Vec; } From cc5de8bdb42dfaec14d2629009a4a54894094bd5 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 24 Oct 2023 15:32:35 +0100 Subject: [PATCH 134/192] remove genesis, add permissions, FellowshipPermissions trait --- pallets/fellowship/src/lib.rs | 30 +++++------------------------- pallets/fellowship/src/traits.rs | 6 ++++++ 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 70d4fe34..c859deaf 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -108,31 +108,6 @@ pub mod pallet { pub type FellowToVetter = StorageMap<_, Blake2_128Concat, AccountIdOf, VetterIdOf, OptionQuery>; - // #[cfg(feature = "genesis")] - // #[pallet::genesis_config] - // pub struct GenesisConfig { - // pub initial_fellows: BoundedVec<(T::AccountId, Role, Rank), ConstU32<100>> - // } - - // #[cfg(feature = "std")] - // impl Default for GenesisConfig { - // fn default() -> Self { - // Self { - // initial_fellows: Vec::new() - // } - // } - // } - - // #[cfg(feature = "genesis")] - // #[pallet::genesis_build] - // impl GenesisBuild for GenesisConfig { - // fn build(&self) { - // for (account, role, rank) in &self.initial_fellows { - // as FellowshipHandle>::add_to_fellowship(account, role, rank, None, false); - // } - // } - // } - #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { @@ -427,4 +402,9 @@ pub mod pallet { Vetter, Freelancer, } + + #[derive(Encode, Decode, PartialEq, Eq, Copy, Clone, Debug, MaxEncodedLen, TypeInfo)] + pub enum Permission { + + } } diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index 9ce232bc..95638b8c 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -33,6 +33,12 @@ pub trait EnsureRole { ) -> Result; } +/// Custom definition for permissions for each role. +pub trait FellowshipPermissions { + fn has_permission(role: Role) -> bool; + fn get_permisisons(role: Role) -> Vec; +} + pub trait WeightInfoT { fn add_to_fellowship() -> Weight; fn force_add_fellowship() -> Weight; From 24415bb8599c3397f9b5d5d171c966c20beefdb4 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 24 Oct 2023 16:18:46 +0100 Subject: [PATCH 135/192] permissions impl, mock impl --- pallets/fellowship/src/impls.rs | 10 ---------- pallets/fellowship/src/lib.rs | 31 +++++++++++++++---------------- pallets/fellowship/src/mock.rs | 12 ++++++++++++ pallets/fellowship/src/traits.rs | 6 +++--- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 3a25b88e..9649fa16 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -47,16 +47,6 @@ impl MaybeConvert<&AccountIdOf, VetterIdOf> for Pallet { } } -pub struct RoleToPercentFee; -impl Convert for RoleToPercentFee { - fn convert(role: Role) -> Percent { - match role { - Role::Vetter => Percent::from_percent(50u8), - Role::Freelancer => Percent::from_percent(50u8), - } - } -} - impl Pallet { /// Try take the membership deposit from who /// If the deposit was taken, this will return true, else false. diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index c859deaf..c4b3f1c8 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -35,7 +35,7 @@ pub mod pallet { use crate::impls::EnsureFellowshipRole; use crate::traits::WeightInfoT; - use crate::traits::{EnsureRole, FellowshipHandle}; + use crate::traits::{EnsureRole, FellowshipHandle, FellowshipPermissions}; pub(crate) type AccountIdOf = ::AccountId; pub(crate) type VetterIdOf = AccountIdOf; @@ -56,6 +56,8 @@ pub mod pallet { #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); + + // TODO: Use permissions instead of ensure role, leave ensure role in place #[pallet::config] pub trait Config: frame_system::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -73,6 +75,8 @@ pub mod pallet { type DepositCurrencyId: Get; /// Currently just send all slash deposits to a single account. type SlashAccount: Get>; + /// The permissions of a given role. + type Permissions: FellowshipPermissions; /// The weights generated by the benchmarks. type WeightInfo: WeightInfoT; } @@ -143,6 +147,8 @@ pub mod pallet { TooManyCandidates, /// The fellowship deposit has could not be found, contact development. FellowshipReserveDisapeared, + /// The role of the caller lacks the necessary permissions to run this. + RoleLacksPermission, } #[pallet::hooks] @@ -230,14 +236,10 @@ pub mod pallet { rank: Rank, ) -> DispatchResult { let who = ensure_signed(origin)?; + let (role, _) = Roles::::get(&who).ok_or(Error::::NotAFellow)?; ensure!( - EnsureFellowshipRole::::ensure_role_in( - &who, - vec![Role::Freelancer, Role::Vetter], - None - ) - .is_ok(), - Error::::NotAVetter + T::Permissions::has_permission(role, Permission::AddToShortlist), + Error::::RoleLacksPermission ); ensure!( Roles::::get(&candidate).is_none(), @@ -275,14 +277,10 @@ pub mod pallet { candidate: AccountIdOf, ) -> DispatchResult { let who = ensure_signed(origin)?; + let (role, _) = Roles::::get(&who).ok_or(Error::::NotAFellow)?; ensure!( - EnsureFellowshipRole::::ensure_role_in( - &who, - vec![Role::Freelancer, Role::Vetter], - None - ) - .is_ok(), - Error::::NotAVetter + T::Permissions::has_permission(role, Permission::RemoveFromShortlist), + Error::::RoleLacksPermission ); CandidateShortlist::::try_mutate(ShortlistRound::::get(), |m_shortlist| { m_shortlist.remove(&candidate); @@ -405,6 +403,7 @@ pub mod pallet { #[derive(Encode, Decode, PartialEq, Eq, Copy, Clone, Debug, MaxEncodedLen, TypeInfo)] pub enum Permission { - + AddToShortlist, + RemoveFromShortlist, } } diff --git a/pallets/fellowship/src/mock.rs b/pallets/fellowship/src/mock.rs index b7b9c577..754751f0 100644 --- a/pallets/fellowship/src/mock.rs +++ b/pallets/fellowship/src/mock.rs @@ -1,4 +1,5 @@ use crate as pallet_fellowship; +use crate::{Permission, Role}; use common_types::CurrencyId; use frame_support::once_cell::sync::Lazy; use frame_support::traits::{ConstU16, Nothing}; @@ -76,6 +77,7 @@ impl pallet_fellowship::Config for Test { type MembershipDeposit = MembershipDeposit; type DepositCurrencyId = DepositCurrencyId; type SlashAccount = SlashAccount; + type Permissions = Test; type WeightInfo = (); } @@ -127,6 +129,16 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { ext } +impl crate::traits::FellowshipPermissions for Test { + fn has_permission(role: Role, permission: Permission) -> bool { + true + } + + fn get_permisisons(role: Role) -> Vec { + Vec::new() + } +} + use frame_support::pallet_prelude::Weight; impl crate::traits::WeightInfoT for () { fn add_to_fellowship() -> Weight { diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index 95638b8c..10412e2f 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -34,9 +34,9 @@ pub trait EnsureRole { } /// Custom definition for permissions for each role. -pub trait FellowshipPermissions { - fn has_permission(role: Role) -> bool; - fn get_permisisons(role: Role) -> Vec; +pub trait FellowshipPermissions { + fn has_permission(role: Role, permission: Permission) -> bool; + fn get_permisisons(role: Role) -> Vec; } pub trait WeightInfoT { From d9ff6467aaa60958be57a757fc250f6fe30cfc3b Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 24 Oct 2023 16:30:19 +0100 Subject: [PATCH 136/192] fix tests --- pallets/fellowship/src/lib.rs | 10 ++++------ pallets/fellowship/src/tests.rs | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index c4b3f1c8..7a067a4f 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -135,8 +135,6 @@ pub mod pallet { RoleNotFound, /// This account is not a fellow. NotAFellow, - /// This account is not a Vetter. - NotAVetter, /// Already a fellow. AlreadyAFellow, /// The candidate must have the deposit amount to be put on the shortlst. @@ -236,9 +234,9 @@ pub mod pallet { rank: Rank, ) -> DispatchResult { let who = ensure_signed(origin)?; - let (role, _) = Roles::::get(&who).ok_or(Error::::NotAFellow)?; + let (caller_role, _) = Roles::::get(&who).ok_or(Error::::NotAFellow)?; ensure!( - T::Permissions::has_permission(role, Permission::AddToShortlist), + T::Permissions::has_permission(caller_role, Permission::AddToShortlist), Error::::RoleLacksPermission ); ensure!( @@ -277,9 +275,9 @@ pub mod pallet { candidate: AccountIdOf, ) -> DispatchResult { let who = ensure_signed(origin)?; - let (role, _) = Roles::::get(&who).ok_or(Error::::NotAFellow)?; + let (caller_role, _) = Roles::::get(&who).ok_or(Error::::NotAFellow)?; ensure!( - T::Permissions::has_permission(role, Permission::RemoveFromShortlist), + T::Permissions::has_permission(caller_role, Permission::RemoveFromShortlist), Error::::RoleLacksPermission ); CandidateShortlist::::try_mutate(ShortlistRound::::get(), |m_shortlist| { diff --git a/pallets/fellowship/src/tests.rs b/pallets/fellowship/src/tests.rs index d07a228b..21b91748 100644 --- a/pallets/fellowship/src/tests.rs +++ b/pallets/fellowship/src/tests.rs @@ -356,7 +356,7 @@ fn add_candidate_to_shortlist_not_a_vetter() { Role::Freelancer, 10 ), - Error::::NotAVetter + Error::::NotAFellow ); }); } @@ -489,7 +489,7 @@ fn remove_candidate_from_shortlist_not_a_vetter() { assert_noop!( Fellowship::remove_candidate_from_shortlist(RuntimeOrigin::signed(*CHARLIE), *ALICE), - Error::::NotAVetter + Error::::NotAFellow ); }); } From f89d954b3403d2f55c50cc366abba0b5e7421a8e Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 26 Oct 2023 10:53:49 +0100 Subject: [PATCH 137/192] organise tests, add permissions tests --- pallets/fellowship/src/impls.rs | 16 +++ pallets/fellowship/src/lib.rs | 1 + pallets/fellowship/src/mock.rs | 12 +- pallets/fellowship/src/tests/ensure_role.rs | 76 +++++++++++ .../src/tests/fellowship_permissions.rs | 32 +++++ pallets/fellowship/src/tests/mod.rs | 25 ++++ .../src/{tests.rs => tests/pallet_tests.rs} | 127 +----------------- pallets/fellowship/src/tests/test_utils.rs | 37 +++++ pallets/fellowship/src/traits.rs | 2 +- 9 files changed, 190 insertions(+), 138 deletions(-) create mode 100644 pallets/fellowship/src/tests/ensure_role.rs create mode 100644 pallets/fellowship/src/tests/fellowship_permissions.rs create mode 100644 pallets/fellowship/src/tests/mod.rs rename pallets/fellowship/src/{tests.rs => tests/pallet_tests.rs} (84%) create mode 100644 pallets/fellowship/src/tests/test_utils.rs diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 9649fa16..80f64548 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -65,3 +65,19 @@ impl Pallet { false } } + +pub struct VetterAndFreelancerAllPermissions; +impl crate::traits::FellowshipPermissions for VetterAndFreelancerAllPermissions { + fn has_permission(role: Role, permission: Permission) -> bool { + Self::get_permissions(role).contains(&permission) + } + + // Force match on all so we dont forget to add permissions when we add new roles. + fn get_permissions(role: Role) -> Vec { + match role { + Role::Freelancer => vec![Permission::AddToShortlist, Permission::RemoveFromShortlist], + Role::Vetter => vec![Permission::AddToShortlist, Permission::RemoveFromShortlist], + } + } +} + diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 7a067a4f..951406ce 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -403,5 +403,6 @@ pub mod pallet { pub enum Permission { AddToShortlist, RemoveFromShortlist, + None, } } diff --git a/pallets/fellowship/src/mock.rs b/pallets/fellowship/src/mock.rs index 754751f0..e36682ed 100644 --- a/pallets/fellowship/src/mock.rs +++ b/pallets/fellowship/src/mock.rs @@ -77,7 +77,7 @@ impl pallet_fellowship::Config for Test { type MembershipDeposit = MembershipDeposit; type DepositCurrencyId = DepositCurrencyId; type SlashAccount = SlashAccount; - type Permissions = Test; + type Permissions = crate::impls::VetterAndFreelancerAllPermissions; type WeightInfo = (); } @@ -129,16 +129,6 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { ext } -impl crate::traits::FellowshipPermissions for Test { - fn has_permission(role: Role, permission: Permission) -> bool { - true - } - - fn get_permisisons(role: Role) -> Vec { - Vec::new() - } -} - use frame_support::pallet_prelude::Weight; impl crate::traits::WeightInfoT for () { fn add_to_fellowship() -> Weight { diff --git a/pallets/fellowship/src/tests/ensure_role.rs b/pallets/fellowship/src/tests/ensure_role.rs new file mode 100644 index 00000000..d14f3276 --- /dev/null +++ b/pallets/fellowship/src/tests/ensure_role.rs @@ -0,0 +1,76 @@ +#[test] +fn ensure_role_in_works() { + new_test_ext().execute_with(|| { + Roles::::insert(*ALICE, (Role::Vetter, 10)); + Roles::::insert(*BOB, (Role::Freelancer, 10)); + + assert_ok!(EnsureFellowshipRole::::ensure_role_in( + &ALICE, + vec![Role::Vetter, Role::Freelancer], + None + )); + assert_ok!(EnsureFellowshipRole::::ensure_role_in( + &BOB, + vec![Role::Vetter, Role::Freelancer], + None + )); + assert!( + EnsureFellowshipRole::::ensure_role_in(&BOB, vec![Role::Vetter], None).is_err(), + "BOB is not of this Role." + ); + assert!( + EnsureFellowshipRole::::ensure_role_in(&ALICE, vec![Role::Freelancer], None) + .is_err(), + "ALICE is not of this Role." + ); + }); +} + +use super::*; + +#[test] +fn ensure_role_in_works_with_rank() { + new_test_ext().execute_with(|| { + Roles::::insert(*ALICE, (Role::Vetter, 10)); + assert_ok!(EnsureFellowshipRole::::ensure_role_in( + &ALICE, + vec![Role::Vetter], + Some(vec![10, 9]) + )); + + assert_noop!( + EnsureFellowshipRole::::ensure_role_in(&ALICE, vec![Role::Vetter], Some(vec![9])), + BadOrigin + ); + }); +} + +#[test] +fn ensure_role_works() { + new_test_ext().execute_with(|| { + Roles::::insert(*ALICE, (Role::Vetter, 0)); + assert_ok!(EnsureFellowshipRole::::ensure_role( + &ALICE, + Role::Vetter, + None + )); + assert!(EnsureFellowshipRole::::ensure_role(&ALICE, Role::Freelancer, None).is_err()); + }); +} + +#[test] +fn ensure_role_works_with_rank() { + new_test_ext().execute_with(|| { + Roles::::insert(*ALICE, (Role::Vetter, 10)); + assert_ok!(EnsureFellowshipRole::::ensure_role( + &ALICE, + Role::Vetter, + Some(10) + )); + + assert_noop!( + EnsureFellowshipRole::::ensure_role(&ALICE, Role::Vetter, Some(9)), + BadOrigin + ); + }); +} diff --git a/pallets/fellowship/src/tests/fellowship_permissions.rs b/pallets/fellowship/src/tests/fellowship_permissions.rs new file mode 100644 index 00000000..45f6027e --- /dev/null +++ b/pallets/fellowship/src/tests/fellowship_permissions.rs @@ -0,0 +1,32 @@ +use super::*; +use crate::impls::VetterAndFreelancerAllPermissions; + +#[test] +fn get_permission_works_implementation() { + new_test_ext().execute_with(|| { + let freelancer_permissions = <::Permissions as FellowshipPermissions>::get_permissions(Role::Freelancer); + let vetter_permissions = <::Permissions as FellowshipPermissions>::get_permissions(Role::Vetter); + let actual = vec![Permission::AddToShortlist, Permission::RemoveFromShortlist]; + + assert_eq!(freelancer_permissions, actual, "for implementation, freelancer should be able to modify shortlist"); + assert_eq!(vetter_permissions, actual, "for implementation, vetter should be able to modify shortlist"); + }); +} + +#[test] +fn has_permission_works() { + new_test_ext().execute_with(|| { + assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Freelancer, Permission::AddToShortlist)); + assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Freelancer, Permission::RemoveFromShortlist)); + assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Vetter, Permission::AddToShortlist)); + assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Vetter, Permission::RemoveFromShortlist)); + }); +} + +#[test] +fn has_permission_work_negative() { + new_test_ext().execute_with(|| { + assert!(!<::Permissions as FellowshipPermissions>::has_permission(Role::Freelancer, Permission::None)); + assert!(!<::Permissions as FellowshipPermissions>::has_permission(Role::Vetter, Permission::None)); + }); +} diff --git a/pallets/fellowship/src/tests/mod.rs b/pallets/fellowship/src/tests/mod.rs new file mode 100644 index 00000000..ff60cbff --- /dev/null +++ b/pallets/fellowship/src/tests/mod.rs @@ -0,0 +1,25 @@ +use crate::impls::*; +use crate::traits::*; +use crate::*; +use crate::{mock::*, Error, Event, FellowToVetter, Role, Roles}; +use common_traits::MaybeConvert; +use common_types::CurrencyId; +use frame_support::{ + assert_noop, assert_ok, once_cell::sync::Lazy, traits::Hooks, BoundedBTreeMap, +}; +use frame_system::Pallet as System; +use orml_tokens::Error as TokensError; +use orml_traits::{MultiCurrency, MultiReservableCurrency}; +use sp_arithmetic::traits::One; +use sp_core::sr25519::Public; +use sp_runtime::{traits::BadOrigin, DispatchError, Saturating}; +use sp_std::vec; + +pub(crate) static DEP_CURRENCY: Lazy = + Lazy::new(::DepositCurrencyId::get); + +mod pallet_tests; +mod ensure_role; +mod fellowship_permissions; +mod test_utils; +pub(crate) use test_utils::*; \ No newline at end of file diff --git a/pallets/fellowship/src/tests.rs b/pallets/fellowship/src/tests/pallet_tests.rs similarity index 84% rename from pallets/fellowship/src/tests.rs rename to pallets/fellowship/src/tests/pallet_tests.rs index 21b91748..b95abcca 100644 --- a/pallets/fellowship/src/tests.rs +++ b/pallets/fellowship/src/tests/pallet_tests.rs @@ -1,129 +1,4 @@ -use crate::impls::*; -use crate::traits::*; -use crate::*; -use crate::{mock::*, Error, Event, FellowToVetter, Role, Roles}; -use common_traits::MaybeConvert; -use common_types::CurrencyId; -use frame_support::{ - assert_noop, assert_ok, once_cell::sync::Lazy, traits::Hooks, BoundedBTreeMap, -}; -use frame_system::Pallet as System; -use orml_tokens::Error as TokensError; -use orml_traits::{MultiCurrency, MultiReservableCurrency}; -use sp_arithmetic::traits::One; -use sp_core::sr25519::Public; -use sp_runtime::{traits::BadOrigin, DispatchError, Saturating}; -use sp_std::vec; - -// Saves a bit of typing. -pub(crate) static DEP_CURRENCY: Lazy = - Lazy::new(::DepositCurrencyId::get); -fn add_to_fellowship_take_deposit( - who: &AccountIdOf, - role: Role, - rank: Rank, - vetter: Option<&VetterIdOf>, -) -> Result<(), DispatchError> { - >>::add_to_fellowship( - who, role, rank, vetter, true, - ); - Ok(()) -} - -fn revoke_fellowship(who: &AccountIdOf, slash_deposit: bool) -> Result<(), DispatchError> { - >>::revoke_fellowship(who, slash_deposit) -} - -pub fn run_to_block(n: T::BlockNumber) -where - T::BlockNumber: Into, -{ - loop { - let mut block: T::BlockNumber = frame_system::Pallet::::block_number(); - if block >= n { - break; - } - block = block.saturating_add(::one()); - frame_system::Pallet::::set_block_number(block); - frame_system::Pallet::::on_initialize(block); - Fellowship::on_initialize(block.into()); - } -} - -#[test] -fn ensure_role_in_works() { - new_test_ext().execute_with(|| { - Roles::::insert(*ALICE, (Role::Vetter, 10)); - Roles::::insert(*BOB, (Role::Freelancer, 10)); - - assert_ok!(EnsureFellowshipRole::::ensure_role_in( - &ALICE, - vec![Role::Vetter, Role::Freelancer], - None - )); - assert_ok!(EnsureFellowshipRole::::ensure_role_in( - &BOB, - vec![Role::Vetter, Role::Freelancer], - None - )); - assert!( - EnsureFellowshipRole::::ensure_role_in(&BOB, vec![Role::Vetter], None).is_err(), - "BOB is not of this Role." - ); - assert!( - EnsureFellowshipRole::::ensure_role_in(&ALICE, vec![Role::Freelancer], None) - .is_err(), - "ALICE is not of this Role." - ); - }); -} - -#[test] -fn ensure_role_in_works_with_rank() { - new_test_ext().execute_with(|| { - Roles::::insert(*ALICE, (Role::Vetter, 10)); - assert_ok!(EnsureFellowshipRole::::ensure_role_in( - &ALICE, - vec![Role::Vetter], - Some(vec![10, 9]) - )); - - assert_noop!( - EnsureFellowshipRole::::ensure_role_in(&ALICE, vec![Role::Vetter], Some(vec![9])), - BadOrigin - ); - }); -} - -#[test] -fn ensure_role_works() { - new_test_ext().execute_with(|| { - Roles::::insert(*ALICE, (Role::Vetter, 0)); - assert_ok!(EnsureFellowshipRole::::ensure_role( - &ALICE, - Role::Vetter, - None - )); - assert!(EnsureFellowshipRole::::ensure_role(&ALICE, Role::Freelancer, None).is_err()); - }); -} - -#[test] -fn ensure_role_works_with_rank() { - new_test_ext().execute_with(|| { - Roles::::insert(*ALICE, (Role::Vetter, 10)); - assert_ok!(EnsureFellowshipRole::::ensure_role( - &ALICE, - Role::Vetter, - Some(10) - )); - - assert_noop!( - EnsureFellowshipRole::::ensure_role(&ALICE, Role::Vetter, Some(9)), - BadOrigin - ); - }); -} +use super::*; #[test] fn freelancer_to_vetter_works() { diff --git a/pallets/fellowship/src/tests/test_utils.rs b/pallets/fellowship/src/tests/test_utils.rs new file mode 100644 index 00000000..a48173ed --- /dev/null +++ b/pallets/fellowship/src/tests/test_utils.rs @@ -0,0 +1,37 @@ +use super::*; + +pub(crate) static DEP_CURRENCY: Lazy = + Lazy::new(::DepositCurrencyId::get); + +// Saves a bit of typing. +pub(crate) fn add_to_fellowship_take_deposit( + who: &AccountIdOf, + role: Role, + rank: Rank, + vetter: Option<&VetterIdOf>, +) -> Result<(), DispatchError> { + >>::add_to_fellowship( + who, role, rank, vetter, true, + ); + Ok(()) +} + +pub(crate) fn revoke_fellowship(who: &AccountIdOf, slash_deposit: bool) -> Result<(), DispatchError> { + >>::revoke_fellowship(who, slash_deposit) +} + +pub fn run_to_block(n: T::BlockNumber) +where + T::BlockNumber: Into, +{ + loop { + let mut block: T::BlockNumber = frame_system::Pallet::::block_number(); + if block >= n { + break; + } + block = block.saturating_add(::one()); + frame_system::Pallet::::set_block_number(block); + frame_system::Pallet::::on_initialize(block); + Fellowship::on_initialize(block.into()); + } +} diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index 10412e2f..36decdfb 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -36,7 +36,7 @@ pub trait EnsureRole { /// Custom definition for permissions for each role. pub trait FellowshipPermissions { fn has_permission(role: Role, permission: Permission) -> bool; - fn get_permisisons(role: Role) -> Vec; + fn get_permissions(role: Role) -> Vec; } pub trait WeightInfoT { From d16f6660ba6a32101d74991273eb5a5e8842a81e Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 26 Oct 2023 11:02:10 +0100 Subject: [PATCH 138/192] add new config to runtime --- pallets/fellowship/src/impls.rs | 3 +-- runtime/imbue-kusama/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 80f64548..87d84862 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -7,8 +7,7 @@ use sp_runtime::{ traits::{BadOrigin, Convert}, DispatchError, Percent, }; -use sp_std::vec::Vec; - +use sp_std::{vec::Vec, vec}; /// Ensure that a account is of a given role. /// Used in other pallets like an ensure origin. pub struct EnsureFellowshipRole(T); diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 6f660c0b..c23b51fc 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -889,6 +889,7 @@ impl pallet_fellowship::Config for Runtime { type DepositCurrencyId = DepositCurrencyId; // Send slashes to the treasury. type SlashAccount = TreasuryAccount; + type Permissions = pallet_fellowship::impls::VetterAndFreelancerAllPermissions; type WeightInfo = pallet_fellowship::weights::WeightInfo; } From 322fe61dd9f142163a244bb97634e2c70b9686f3 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 26 Oct 2023 11:02:22 +0100 Subject: [PATCH 139/192] fmt --- pallets/fellowship/src/impls.rs | 11 ++-- pallets/fellowship/src/lib.rs | 3 +- .../src/tests/fellowship_permissions.rs | 61 ++++++++++++++++--- pallets/fellowship/src/tests/mod.rs | 4 +- pallets/fellowship/src/tests/test_utils.rs | 5 +- 5 files changed, 64 insertions(+), 20 deletions(-) diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 87d84862..41274e9a 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -7,7 +7,7 @@ use sp_runtime::{ traits::{BadOrigin, Convert}, DispatchError, Percent, }; -use sp_std::{vec::Vec, vec}; +use sp_std::{vec, vec::Vec}; /// Ensure that a account is of a given role. /// Used in other pallets like an ensure origin. pub struct EnsureFellowshipRole(T); @@ -66,9 +66,11 @@ impl Pallet { } pub struct VetterAndFreelancerAllPermissions; -impl crate::traits::FellowshipPermissions for VetterAndFreelancerAllPermissions { +impl crate::traits::FellowshipPermissions + for VetterAndFreelancerAllPermissions +{ fn has_permission(role: Role, permission: Permission) -> bool { - Self::get_permissions(role).contains(&permission) + Self::get_permissions(role).contains(&permission) } // Force match on all so we dont forget to add permissions when we add new roles. @@ -77,6 +79,5 @@ impl crate::traits::FellowshipPermissions for Ve Role::Freelancer => vec![Permission::AddToShortlist, Permission::RemoveFromShortlist], Role::Vetter => vec![Permission::AddToShortlist, Permission::RemoveFromShortlist], } - } + } } - diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 951406ce..d4af8ec3 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -56,7 +56,6 @@ pub mod pallet { #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); - // TODO: Use permissions instead of ensure role, leave ensure role in place #[pallet::config] pub trait Config: frame_system::Config { @@ -400,7 +399,7 @@ pub mod pallet { } #[derive(Encode, Decode, PartialEq, Eq, Copy, Clone, Debug, MaxEncodedLen, TypeInfo)] - pub enum Permission { + pub enum Permission { AddToShortlist, RemoveFromShortlist, None, diff --git a/pallets/fellowship/src/tests/fellowship_permissions.rs b/pallets/fellowship/src/tests/fellowship_permissions.rs index 45f6027e..84282b6c 100644 --- a/pallets/fellowship/src/tests/fellowship_permissions.rs +++ b/pallets/fellowship/src/tests/fellowship_permissions.rs @@ -4,29 +4,70 @@ use crate::impls::VetterAndFreelancerAllPermissions; #[test] fn get_permission_works_implementation() { new_test_ext().execute_with(|| { - let freelancer_permissions = <::Permissions as FellowshipPermissions>::get_permissions(Role::Freelancer); - let vetter_permissions = <::Permissions as FellowshipPermissions>::get_permissions(Role::Vetter); + let freelancer_permissions = <::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::get_permissions(Role::Freelancer); + let vetter_permissions = <::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::get_permissions(Role::Vetter); let actual = vec![Permission::AddToShortlist, Permission::RemoveFromShortlist]; - assert_eq!(freelancer_permissions, actual, "for implementation, freelancer should be able to modify shortlist"); - assert_eq!(vetter_permissions, actual, "for implementation, vetter should be able to modify shortlist"); + assert_eq!( + freelancer_permissions, actual, + "for implementation, freelancer should be able to modify shortlist" + ); + assert_eq!( + vetter_permissions, actual, + "for implementation, vetter should be able to modify shortlist" + ); }); } #[test] fn has_permission_works() { new_test_ext().execute_with(|| { - assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Freelancer, Permission::AddToShortlist)); - assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Freelancer, Permission::RemoveFromShortlist)); - assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Vetter, Permission::AddToShortlist)); - assert!(<::Permissions as FellowshipPermissions>::has_permission(Role::Vetter, Permission::RemoveFromShortlist)); + assert!(<::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::has_permission( + Role::Freelancer, Permission::AddToShortlist + )); + assert!(<::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::has_permission( + Role::Freelancer, + Permission::RemoveFromShortlist + )); + assert!(<::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::has_permission( + Role::Vetter, Permission::AddToShortlist + )); + assert!(<::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::has_permission( + Role::Vetter, Permission::RemoveFromShortlist + )); }); } #[test] fn has_permission_work_negative() { new_test_ext().execute_with(|| { - assert!(!<::Permissions as FellowshipPermissions>::has_permission(Role::Freelancer, Permission::None)); - assert!(!<::Permissions as FellowshipPermissions>::has_permission(Role::Vetter, Permission::None)); + assert!(!<::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::has_permission( + Role::Freelancer, Permission::None + )); + assert!(!<::Permissions as FellowshipPermissions< + crate::Role, + crate::Permission, + >>::has_permission(Role::Vetter, Permission::None)); }); } diff --git a/pallets/fellowship/src/tests/mod.rs b/pallets/fellowship/src/tests/mod.rs index ff60cbff..27a657b1 100644 --- a/pallets/fellowship/src/tests/mod.rs +++ b/pallets/fellowship/src/tests/mod.rs @@ -18,8 +18,8 @@ use sp_std::vec; pub(crate) static DEP_CURRENCY: Lazy = Lazy::new(::DepositCurrencyId::get); -mod pallet_tests; mod ensure_role; mod fellowship_permissions; +mod pallet_tests; mod test_utils; -pub(crate) use test_utils::*; \ No newline at end of file +pub(crate) use test_utils::*; diff --git a/pallets/fellowship/src/tests/test_utils.rs b/pallets/fellowship/src/tests/test_utils.rs index a48173ed..f28406b7 100644 --- a/pallets/fellowship/src/tests/test_utils.rs +++ b/pallets/fellowship/src/tests/test_utils.rs @@ -16,7 +16,10 @@ pub(crate) fn add_to_fellowship_take_deposit( Ok(()) } -pub(crate) fn revoke_fellowship(who: &AccountIdOf, slash_deposit: bool) -> Result<(), DispatchError> { +pub(crate) fn revoke_fellowship( + who: &AccountIdOf, + slash_deposit: bool, +) -> Result<(), DispatchError> { >>::revoke_fellowship(who, slash_deposit) } From f56025ab54a5d9fb0eedf95b92a255ff7c16feb1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 26 Oct 2023 12:18:58 +0100 Subject: [PATCH 140/192] add jury selector into migration --- pallets/proposals/src/migration.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 777bbeb5..182399bd 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -3,6 +3,7 @@ use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; use frame_system::pallet_prelude::BlockNumberFor; +use pallet_fellowship::traits::JurySelector; pub use pallet::*; pub type TimestampOf = ::Moment; @@ -710,9 +711,9 @@ pub mod v6 { pub mod v7 { - struct MigrateToV7(T); + struct MigrateToV7(T, U); - impl OnRuntimeUpgrade for MigrateToV7 { + impl OnRuntimeUpgrade for MigrateToV7 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); @@ -733,7 +734,7 @@ pub mod v7 { let onchain = as GetStorageVersion>::on_chain_storage_version(); if current == 7 && onchain == 6 { - migrate_new_fields::() + migrate_new_fields::() current.put::>(); log::warn!("v7 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); @@ -759,7 +760,7 @@ pub mod v7 { } } - fn migrate_new_fields(weight &mut Weight) { + fn migrate_new_fields(weight &mut Weight) { v6::Projects::::drain().for_each(|(key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -769,7 +770,7 @@ pub mod v7 { Grant(_) => crate::FundingPath::WaitForFunding, } - let jury = todo!(); + let jury = ::select_jury(::MaxJuryMembers::get()); let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match funding.funding_type { Proposal => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), @@ -792,7 +793,7 @@ pub mod v7 { cancelled: project.cancelled, deposit_id: project.deposit_id, refund_locations, - jury, + jury.try_into().expect("MaxJuryMembers is used in bound and creation; qed"), on_creation_funding, }; From b998a5d36e31510846a8bbddedfa2325890d20d7 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 27 Oct 2023 09:08:04 +0100 Subject: [PATCH 141/192] dispute hooks draft, pallet-dispute in runtime --- pallets/disputes/src/lib.rs | 2 -- pallets/disputes/src/traits.rs | 7 +++--- pallets/proposals/Cargo.toml | 1 + pallets/proposals/src/impls/pallet_impls.rs | 20 +++++++++++++++++ runtime/imbue-kusama/src/lib.rs | 24 ++++++++++++++++++++- 5 files changed, 48 insertions(+), 6 deletions(-) diff --git a/pallets/disputes/src/lib.rs b/pallets/disputes/src/lib.rs index 88fe0347..a7bb4b6c 100644 --- a/pallets/disputes/src/lib.rs +++ b/pallets/disputes/src/lib.rs @@ -69,8 +69,6 @@ pub mod pallet { + TypeInfo + Debug + Copy; - /// The max length for specifying the reason while raising the dispute - type MaxReasonLength: Get; /// The number of juries that can be assigned to a given dispute type MaxJurySize: Get; /// The number of specifics that can be assigned to a given dispute. diff --git a/pallets/disputes/src/traits.rs b/pallets/disputes/src/traits.rs index 6994a966..05b52cac 100644 --- a/pallets/disputes/src/traits.rs +++ b/pallets/disputes/src/traits.rs @@ -18,11 +18,12 @@ pub trait DisputeRaiser { ) -> Result<(), DispatchError>; } -pub trait DisputeHooks { - // Outcome - // handle the completed dispute +pub trait DisputeHooks { + /// On the completion of a dispute, this hooks is called. + /// Returning only the key that has been handled and the result of the dispute. fn on_dispute_complete( dispute_key: DisputeKey, + specifics: Vec dispute_result: crate::pallet::DisputeResult, ) -> Weight; } diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 04cc1d63..0a319b55 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -48,6 +48,7 @@ common-types = { path = "../../libs/common-types", default-features = false } common-runtime = { path = "../../runtime/common", default-features = false } pallet-deposits = { path = "../deposits", default-features = false } pallet-fellowship = { path = "../fellowship", default-features = false } +pallet-disputes = { path = "../fellowship"} [dev-dependencies] orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43"} diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 812f53c7..ad9dc3a6 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -2,6 +2,7 @@ use crate::*; use common_types::milestone_origin::FundingType; use scale_info::prelude::format; use sp_runtime::traits::{Saturating, Zero}; +use pallet_disputes::traits::DisputeHooks; impl Pallet { /// The account ID of the fund pot. @@ -539,3 +540,22 @@ impl Pallet { Ok(()) } } + +impl DisputeHooks for Pallet { + fn on_dispute_complete( + dispute_key: ProjectKey, + specifics: Vec + dispute_result: pallet_disputes::pallet::DisputeResult, + ) -> Weight { + // OnSuccess + // mark each of the milestones as ready for refund. + // This should allow the withdraw function to + // cancel the project + // Emit Event for withdrawl + + // OnFailure + // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. + // Emit event for failure?? check if pallet_disputes does this. + // revert anything that has happened as a result of calling a dispute (should be nothing as the 2 are independant.) + } +} diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index cecfa0ba..96e59e11 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -182,7 +182,7 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( pallet_proposals::migration::v7::MigrateToV7, - pallet_fellowship::migration::v0::MigrateInitial, + pallet_fellowship::migration::v0::MigrateInitial, ); } @@ -916,6 +916,27 @@ impl pallet_deposits::Config for Runtime { type DepositSlashAccount = TreasuryAccount; } +parameter_types! { + pub MaxJurySize: u32 = 100; + pub MaxDisputesPerBlock: u32 = 50; + pub VotingTimeLimit: BlockNumber = DAYS * 14; +} + +impl pallet_disputes::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type DisputeKey = u32; + type SpecificId = u32; + type MaxJurySize = MaxJurySize; + // TODO: this syntax for each max milestones per brief grant and projet. + // it binds automatically. + type MaxSpecifics = ::MaxMilestonesPerProject; + type MaxDisputesPerBlock = MaxDisputesPerBlock; + type VotingTimeLimit = VotingTimeLimit; + type ForceOrigin = EnsureRootOr; + type DisputeHooks = todo!(); + type WeightInfo = todo!(); +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -1069,6 +1090,7 @@ impl_runtime_apis! { fn initialize_block(header: &::Header) { Executive::initialize_block(header) } + } impl sp_api::Metadata for Runtime { From 9dbfc9cc658012faa152423d2d50d44221edeffc Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 30 Oct 2023 12:23:30 +0000 Subject: [PATCH 142/192] raise disputes and hooks skeleton --- pallets/disputes/src/impls.rs | 1 - pallets/proposals/src/impls/pallet_impls.rs | 32 +++++++++++++++++++++ pallets/proposals/src/lib.rs | 19 ++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) diff --git a/pallets/disputes/src/impls.rs b/pallets/disputes/src/impls.rs index 48fdd905..1393bdea 100644 --- a/pallets/disputes/src/impls.rs +++ b/pallets/disputes/src/impls.rs @@ -8,7 +8,6 @@ use traits::DisputeRaiser; impl DisputeRaiser> for Pallet { type DisputeKey = T::DisputeKey; type SpecificId = T::SpecificId; - type MaxReasonLength = ::MaxReasonLength; type MaxJurySize = ::MaxJurySize; type MaxSpecifics = ::MaxSpecifics; diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index ad9dc3a6..8bf53d29 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -471,6 +471,8 @@ impl Pallet { milestone_key, percentage_to_unlock: milestone.percentage_to_unlock, is_approved: false, + can_refund: false, + is_refunded: false, }; milestones .try_insert(milestone_key, milestone) @@ -547,6 +549,36 @@ impl DisputeHooks for Pallet { specifics: Vec dispute_result: pallet_disputes::pallet::DisputeResult, ) -> Weight { + let mut weight: Weight = ::zero(); + let maybe_project = Projects::::get(dispute_key); + *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + + match maybe_project { + Some(project) => { + for milestone_key in specifics.iter() { + if let Some(milestone) = project.milestones.get(milestone_key) { + milestone. + } + } + }, + // Looks like the project was deleted somehow during the dispute. + // The only way this is possible is through a refund or final withdraw. + // Not a massive issue as either way the project has been finalised. + // Just ignore and return weight. + None => { + weight + } + } + let weight = match dispute_result { + DisputeResult::Success => { + for milestone_key in specifics { + + } + }, + DisputeResult::Failure => { + + } + }; // OnSuccess // mark each of the milestones as ready for refund. // This should allow the withdraw function to diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 0ccf0cdc..afdfc351 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -12,6 +12,7 @@ use orml_traits::{MultiCurrency, MultiReservableCurrency}; pub use pallet::*; use pallet_deposits::traits::DepositHandler; use pallet_fellowship::{traits::EnsureRole, Role}; +use pallet_disputes::traits::DisputeRaiser; use scale_info::TypeInfo; use sp_arithmetic::per_things::Percent; use sp_core::H256; @@ -118,6 +119,8 @@ pub mod pallet { /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; + // Potencially need to bind the assocaited types to bounds in this pallet: todo! + type DisputeRaiser: DisputeRaiser>; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); @@ -427,6 +430,18 @@ pub mod pallet { let who = ensure_signed(origin)?; Self::add_vote_no_confidence(who, project_key, is_yay) } + + /// Raise a dispute using the + #[pallet::call_index(14)] + #[pallet::weight(::zero())] + pub fn raise_dispute( + origin: OriginFor, + project_key: ProjectKey, + milestone_keys: BoundedVec, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + Self::add_vote_no_confidence(who, project_key, is_yay) + } } impl IntoProposal, BalanceOf, BlockNumberFor> for crate::Pallet @@ -574,12 +589,16 @@ pub struct ProposedMilestone { /// The contribution users made to a project project. /// TODO: move these to a common repo (common_types will do) /// TODO: add ipfs hash like in the grants pallet and + +// TODO: MIGRATION FOR MILESTONES #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub struct Milestone { pub project_key: ProjectKey, pub milestone_key: MilestoneKey, pub percentage_to_unlock: Percent, pub is_approved: bool, + pub can_refund: bool, + pub is_refunded: bool, } /// The vote struct is used to From af54044517b2d2eb0111db49a80169d03d0a8108 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 31 Oct 2023 08:33:46 +0000 Subject: [PATCH 143/192] forgot --- libs/common-types/src/milestone_origin.rs | 2 -- pallets/fellowship/src/impls.rs | 2 +- pallets/fellowship/src/lib.rs | 2 +- pallets/fellowship/src/tests/pallet_tests.rs | 3 --- pallets/fellowship/src/traits.rs | 2 +- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libs/common-types/src/milestone_origin.rs b/libs/common-types/src/milestone_origin.rs index a33058ef..9be6d7c3 100644 --- a/libs/common-types/src/milestone_origin.rs +++ b/libs/common-types/src/milestone_origin.rs @@ -43,8 +43,6 @@ pub enum TreasuryOriginError { NetworkUnsupported, } - - #[derive( Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, )] diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 73a2ab06..14bcd5d6 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -49,7 +49,7 @@ impl MaybeConvert<&AccountIdOf, VetterIdOf> for Pallet { /// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. /// Currently bound to u8 for size. impl crate::traits::SelectJury> for Pallet { - fn select_jury(jury_size: u8) -> Vec> { + fn select_jury(jury_size: u8) -> Vec> { let mut jury_size = jury_size as usize; let mut out: Vec> = Vec::new(); let mut rng = rand::thread_rng(); diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index e889d7d4..07e341b6 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -27,7 +27,7 @@ mod benchmarking; #[frame_support::pallet] pub mod pallet { use common_types::CurrencyId; - use frame_support::{pallet_prelude::*, BoundedBTreeMap, traits::Randomness}; + use frame_support::{pallet_prelude::*, traits::Randomness, BoundedBTreeMap}; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use sp_runtime::traits::Zero; diff --git a/pallets/fellowship/src/tests/pallet_tests.rs b/pallets/fellowship/src/tests/pallet_tests.rs index 9cbc328f..4e42c64d 100644 --- a/pallets/fellowship/src/tests/pallet_tests.rs +++ b/pallets/fellowship/src/tests/pallet_tests.rs @@ -609,7 +609,6 @@ fn e2e() { }); } - #[test] fn test_select_jury_doesnt_panic_amount_more_than_length() { new_test_ext().execute_with(|| { @@ -651,7 +650,6 @@ fn test_select_jury_is_random() { }); } - #[test] fn test_select_jury_stress_test() { new_test_ext().execute_with(|| { @@ -684,6 +682,5 @@ fn test_select_jury_select_correct_amount_in_normal_conditions() { let jury = as SelectJury>::select_jury(50); assert_eq!(jury.len(), 50, "jury members should be exactly 50.") - }); } diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index 0228aca8..dfb9728a 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -35,7 +35,7 @@ pub trait EnsureRole { /// Select a pseudo-random jury of a specified amount. pub trait SelectJury { - fn select_jury(size: u8) -> Vec; + fn select_jury(size: u8) -> Vec; } /// Custom definition for permissions for each role. From ce63beaaa4d2e5953f98a2b78eb4f196623aee01 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 1 Nov 2023 14:57:53 +0000 Subject: [PATCH 144/192] trait bounds impl, todos --- pallets/proposals/src/lib.rs | 20 ++++++++++++-------- pallets/proposals/src/todo | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index afdfc351..6dc6bfba 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -118,9 +118,7 @@ pub mod pallet { type DepositHandler: DepositHandler, AccountIdOf>; /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; - - // Potencially need to bind the assocaited types to bounds in this pallet: todo! - type DisputeRaiser: DisputeRaiser>; + type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxJurySize = Self::MaxJuryMembers, MaxSpecifics = Self::MaxMilestonesPerProject>; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); @@ -321,6 +319,8 @@ pub mod pallet { TooManyMilestoneVotes, /// An internal error, a collection of votes for a milestone has been lost.s IndividualVoteNotFound, + /// Only a contributor can raise a dispute. + OnlyContributorsCanRaiseDispute } #[pallet::hooks] @@ -431,7 +431,7 @@ pub mod pallet { Self::add_vote_no_confidence(who, project_key, is_yay) } - /// Raise a dispute using the + /// Raise a dispute using the handle DisputeRaiser in the Config. #[pallet::call_index(14)] #[pallet::weight(::zero())] pub fn raise_dispute( @@ -440,7 +440,11 @@ pub mod pallet { milestone_keys: BoundedVec, ) -> DispatchResult { let who = ensure_signed(origin)?; - Self::add_vote_no_confidence(who, project_key, is_yay) + let project = Project::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; + ensure!(project.contributors.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute)?; + ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys)?; + + } } impl IntoProposal, BalanceOf, BlockNumberFor> @@ -609,11 +613,11 @@ pub struct Vote { is_approved: bool, } -impl> Default for Vote { +impl Default for Vote { fn default() -> Self { Self { - yay: Balance::from(Zero::zero()), - nay: Balance::from(Zero::zero()), + yay: Zero::zero(), + nay: Zero::zero(), is_approved: false, } } diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index 471fac56..4ec339ec 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -1,6 +1,16 @@ +raise-dispute extrinsic. +tests for above implementation. +benchmark for raise dispute extrinsic +prevent voting on a submitted milestone if a project is in dispute. + + + +OnDisputeCompleteHooks. +tests for above implementation. +benchmark for hooks to return weight. + +removal of old no confidence logic. +get jury in each pallet (briefs, grants, crowdfunding.) -complete the tests for the new impls -migration for project pallet -10% fee if a vetter exists for the project. From 4cc859a695b531c570c4a0c120e0d4cd783dcdb1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 2 Nov 2023 15:04:34 +0000 Subject: [PATCH 145/192] bugs --- Cargo.lock | 1 + pallets/briefs/src/mock.rs | 2 +- pallets/crowdfunding/src/mock.rs | 2 +- pallets/disputes/src/lib.rs | 11 ++-- pallets/disputes/src/mock.rs | 3 +- pallets/disputes/src/traits.rs | 4 +- pallets/grants/src/mock.rs | 2 +- pallets/proposals/Cargo.toml | 2 +- pallets/proposals/src/impls/pallet_impls.rs | 58 +++++++++---------- pallets/proposals/src/lib.rs | 17 +----- pallets/proposals/src/mock.rs | 2 +- pallets/proposals/src/traits.rs | 18 +++--- runtime/imbue-kusama/src/lib.rs | 2 +- .../integration-tests/src/xcm_transfers.rs | 8 +-- 14 files changed, 62 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d3673ba2..c0fcae96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7285,6 +7285,7 @@ dependencies = [ "orml-xtokens", "pallet-balances", "pallet-deposits", + "pallet-disputes", "pallet-fellowship", "pallet-identity", "pallet-timestamp", diff --git a/pallets/briefs/src/mock.rs b/pallets/briefs/src/mock.rs index 05a623fd..cfa322d5 100644 --- a/pallets/briefs/src/mock.rs +++ b/pallets/briefs/src/mock.rs @@ -258,7 +258,7 @@ impl pallet_proposals::Config for Test { type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; - type RefundHandler = pallet_proposals::traits::MockRefundHandler; + type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; diff --git a/pallets/crowdfunding/src/mock.rs b/pallets/crowdfunding/src/mock.rs index 3f4c27a8..5f4dbb44 100644 --- a/pallets/crowdfunding/src/mock.rs +++ b/pallets/crowdfunding/src/mock.rs @@ -194,7 +194,7 @@ impl pallet_proposals::Config for Test { type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; - type RefundHandler = pallet_proposals::traits::MockRefundHandler; + type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; diff --git a/pallets/disputes/src/lib.rs b/pallets/disputes/src/lib.rs index a7bb4b6c..43d3a3d5 100644 --- a/pallets/disputes/src/lib.rs +++ b/pallets/disputes/src/lib.rs @@ -80,7 +80,7 @@ pub mod pallet { /// The origin used to force cancel and pass disputes. type ForceOrigin: EnsureOrigin; /// External hooks to handle the completion of a dispute. - type DisputeHooks: DisputeHooks; + type DisputeHooks: DisputeHooks; } /// Used to store the disputes that is being raised, given the dispute key it returns the Dispute @@ -158,8 +158,9 @@ pub mod pallet { let result = dispute.calculate_winner(); // TODO: actually benchmark. let hook_weight = - >::on_dispute_complete( + >::on_dispute_complete( *dispute_id, + dispute.specifiers.into_inner(), result, ); @@ -229,7 +230,7 @@ pub mod pallet { } // Dont mind if this fails as the autofinalise will skip. }); - T::DisputeHooks::on_dispute_complete(dispute_key, DisputeResult::Failure); + T::DisputeHooks::on_dispute_complete(dispute_key, dispute.specifiers.into_inner(), DisputeResult::Failure); Self::deposit_event(Event::::DisputeCompleted { dispute_key, dispute_result: DisputeResult::Failure, @@ -257,7 +258,7 @@ pub mod pallet { } // Dont mind if this fails as the autofinalise will skip. }); - T::DisputeHooks::on_dispute_complete(dispute_key, DisputeResult::Success); + T::DisputeHooks::on_dispute_complete(dispute_key, dispute.specifiers.into_inner(), DisputeResult::Success); Self::deposit_event(Event::::DisputeCompleted { dispute_key, dispute_result: DisputeResult::Success, @@ -415,7 +416,7 @@ pub mod pallet { }); // Dont need to return the weight here. - let _ = T::DisputeHooks::on_dispute_complete(dispute_key, result); + let _ = T::DisputeHooks::on_dispute_complete(dispute_key, dispute.specifiers.into_inner(), result); Ok(()) } diff --git a/pallets/disputes/src/mock.rs b/pallets/disputes/src/mock.rs index fb34797a..c1178921 100644 --- a/pallets/disputes/src/mock.rs +++ b/pallets/disputes/src/mock.rs @@ -128,9 +128,10 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { ext } -impl crate::traits::DisputeHooks for Test { +impl crate::traits::DisputeHooks for Test { fn on_dispute_complete( _dispute_key: u32, + _specifics: u32, _dispute_result: crate::pallet::DisputeResult, ) -> Weight { ::default() diff --git a/pallets/disputes/src/traits.rs b/pallets/disputes/src/traits.rs index 05b52cac..1f033cf5 100644 --- a/pallets/disputes/src/traits.rs +++ b/pallets/disputes/src/traits.rs @@ -2,11 +2,11 @@ use codec::{FullCodec, FullEncode, MaxEncodedLen}; use frame_support::pallet_prelude::*; use scale_info::TypeInfo; use sp_runtime::{traits::AtLeast32BitUnsigned, BoundedVec, DispatchError}; +use sp_std::vec::Vec; pub trait DisputeRaiser { type DisputeKey: AtLeast32BitUnsigned + FullEncode + FullCodec + MaxEncodedLen + TypeInfo; type SpecificId: AtLeast32BitUnsigned + FullEncode + FullCodec + MaxEncodedLen + TypeInfo; - type MaxReasonLength: Get; type MaxJurySize: Get; type MaxSpecifics: Get; @@ -23,7 +23,7 @@ pub trait DisputeHooks { /// Returning only the key that has been handled and the result of the dispute. fn on_dispute_complete( dispute_key: DisputeKey, - specifics: Vec + specifics: Vec, dispute_result: crate::pallet::DisputeResult, ) -> Weight; } diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index 221513ba..2960c1f5 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -195,7 +195,7 @@ impl pallet_proposals::Config for Test { type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; - type RefundHandler = pallet_proposals::traits::MockRefundHandler; + type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 0a319b55..9c616d22 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -48,7 +48,7 @@ common-types = { path = "../../libs/common-types", default-features = false } common-runtime = { path = "../../runtime/common", default-features = false } pallet-deposits = { path = "../deposits", default-features = false } pallet-fellowship = { path = "../fellowship", default-features = false } -pallet-disputes = { path = "../fellowship"} +pallet-disputes = { path = "../disputes", default-features = false} [dev-dependencies] orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.43"} diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 8bf53d29..e9cebafd 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -2,7 +2,10 @@ use crate::*; use common_types::milestone_origin::FundingType; use scale_info::prelude::format; use sp_runtime::traits::{Saturating, Zero}; -use pallet_disputes::traits::DisputeHooks; +use pallet_disputes::{ + traits::DisputeHooks, + DisputeResult, +}; impl Pallet { /// The account ID of the fund pot. @@ -337,7 +340,7 @@ impl Pallet { // locked_milestone_percentage.mul_floor(contribution.value); // refund_amount = refund_amount.saturating_add(per_contributor); // } - // ::RefundHandler::send_refund_message_to_treasury( + // ::ExternalRefundHandler::send_refund_message_to_treasury( // project_account_id, // refund_amount, // project.currency_id, @@ -410,7 +413,7 @@ impl Pallet { // locked_milestone_percentage.mul_floor(contribution.value); // refund_amount = refund_amount.saturating_add(per_contributor); // } - // ::RefundHandler::send_refund_message_to_treasury( + // ::ExternalRefundHandler::send_refund_message_to_treasury( // project_account_id, // refund_amount, // project.currency_id, @@ -546,7 +549,7 @@ impl Pallet { impl DisputeHooks for Pallet { fn on_dispute_complete( dispute_key: ProjectKey, - specifics: Vec + specifics: Vec, dispute_result: pallet_disputes::pallet::DisputeResult, ) -> Weight { let mut weight: Weight = ::zero(); @@ -555,11 +558,28 @@ impl DisputeHooks for Pallet { match maybe_project { Some(project) => { - for milestone_key in specifics.iter() { - if let Some(milestone) = project.milestones.get(milestone_key) { - milestone. - } - } + match dispute_result { + DisputeResult::Success => { + // OnSuccess + // mark each of the milestones as ready for refund. + // This should allow the withdraw function to + // cancel the project + // Emit Event for withdrawl + for milestone_key in specifics.iter() { + if let Some(milestone) = project.milestones.get(milestone_key) { + + } + } + }, + DisputeResult::Failue => { + // OnFailure + // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. + // Emit event for failure?? check if pallet_disputes does this. + // revert anything that has happened as a result of calling a dispute (should be nothing as the 2 are independant.) + }, + }; + + weight }, // Looks like the project was deleted somehow during the dispute. // The only way this is possible is through a refund or final withdraw. @@ -569,25 +589,5 @@ impl DisputeHooks for Pallet { weight } } - let weight = match dispute_result { - DisputeResult::Success => { - for milestone_key in specifics { - - } - }, - DisputeResult::Failure => { - - } - }; - // OnSuccess - // mark each of the milestones as ready for refund. - // This should allow the withdraw function to - // cancel the project - // Emit Event for withdrawl - - // OnFailure - // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. - // Emit event for failure?? check if pallet_disputes does this. - // revert anything that has happened as a result of calling a dispute (should be nothing as the 2 are independant.) } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 6dc6bfba..ef109f51 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -2,7 +2,7 @@ use codec::{Decode, Encode}; use common_traits::MaybeConvert; -use common_types::{CurrencyId, FundingType}; +use common_types::CurrencyId; use frame_support::{ dispatch::EncodeLike, pallet_prelude::*, storage::bounded_btree_map::BoundedBTreeMap, traits::EnsureOrigin, PalletId, @@ -21,7 +21,7 @@ use sp_std::{collections::btree_map::*, convert::TryInto, prelude::*}; use xcm::latest::MultiLocation; pub mod traits; -use traits::{IntoProposal, RefundHandler}; +use traits::{IntoProposal, ExternalRefundHandler}; #[cfg(test)] mod mock; @@ -113,7 +113,7 @@ pub mod pallet { /// The account the imbue fee goes to. type ImbueFeeAccount: Get>; /// The type responisble for handling refunds. - type RefundHandler: traits::RefundHandler, BalanceOf, CurrencyId>; + type ExternalRefundHandler: traits::ExternalRefundHandler, BalanceOf, CurrencyId>; /// The type responsible for storage deposits. type DepositHandler: DepositHandler, AccountIdOf>; /// The type that will be used to calculate the deposit of a project. @@ -149,15 +149,6 @@ pub mod pallet { pub type IndividualVoteStore = StorageMap<_, Blake2_128Concat, ProjectKey, ImmutableIndividualVotes, OptionQuery>; - /// Stores the total votes on a milestone. - #[pallet::storage] - pub type IndividualVoteStore = - StorageMap<_, Blake2_128Concat, ProjectKey, ImmutableIndividualVotes, OptionQuery>; - - #[pallet::storage] - pub type IndividualVoteStore = - StorageMap<_, Blake2_128Concat, ProjectKey, ImmutableIndividualVotes, OptionQuery>; - #[pallet::storage] #[pallet::getter(fn milestone_votes)] pub(super) type MilestoneVotes = StorageMap< @@ -443,8 +434,6 @@ pub mod pallet { let project = Project::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; ensure!(project.contributors.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute)?; ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys)?; - - } } impl IntoProposal, BalanceOf, BlockNumberFor> diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index e25945bd..c039178d 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -208,7 +208,7 @@ impl pallet_proposals::Config for Test { type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; - type RefundHandler = pallet_proposals::traits::MockRefundHandler; + type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; type ImbueFeeAccount = diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 083ff7ff..7225f066 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -1,5 +1,5 @@ use crate::{AccountIdOf, BalanceOf, Contribution, FundingPath, ProposedMilestone, Locality}; -use common_types::{CurrencyId, FundingType, TreasuryOrigin, TreasuryOriginConverter}; +use common_types::{CurrencyId, TreasuryOrigin, TreasuryOriginConverter}; use frame_support::{inherent::Vec, pallet_prelude::*, transactional, PalletId, BoundedBTreeMap}; use orml_traits::XcmTransfer; use orml_xtokens::Error; @@ -33,7 +33,7 @@ pub trait IntoProposal { ) -> BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>; } -pub trait RefundHandler { +pub trait ExternalRefundHandler { /// Send a message to some destination chain asking to do some reserve asset transfer. /// The multilocation is defined by the FundingType. /// see FundingType and TreasuryOrigin. @@ -41,7 +41,7 @@ pub trait RefundHandler { from: AccountId, amount: Balance, currency: CurrencyId, - funding_type: FundingType, + treasury_origin: TreasuryOrigin, ) -> Result<(), DispatchError>; fn get_treasury_account_id(treasury_origin: TreasuryOrigin) -> Result; @@ -51,14 +51,14 @@ pub trait RefundHandler { pub struct MockRefundHandler(T); #[cfg(feature = "std")] -impl RefundHandler, BalanceOf, CurrencyId> +impl ExternalRefundHandler, BalanceOf, CurrencyId> for MockRefundHandler { fn send_refund_message_to_treasury( - _from: AccountIdOf, - _amount: BalanceOf, + _from: AccountId, + _amount: Balance, _currency: CurrencyId, - _funding_type: FundingType, + _treasury_origin: TreasuryOrigin ) -> Result<(), DispatchError> { Ok(()) } @@ -70,7 +70,7 @@ impl RefundHandler, BalanceOf, CurrencyId> } pub struct XcmRefundHandler(T, U); -impl RefundHandler, T::Balance, CurrencyId> for XcmRefundHandler +impl ExternalRefundHandler, T::Balance, CurrencyId> for XcmRefundHandler where [u8; 32]: From<::AccountId>, T: orml_xtokens::Config, @@ -82,7 +82,7 @@ where from: T::AccountId, amount: T::Balance, currency: CurrencyId, - funding_type: FundingType, + treasury_origin: TreasuryOrigin, ) -> Result<(), DispatchError> { match funding_type { FundingType::Grant(treasury_origin) => { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 96e59e11..e0fa2a11 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -823,7 +823,7 @@ impl pallet_proposals::Config for Runtime { type MaximumContributorsPerProject = MaximumContributorsPerProject; type WeightInfo = pallet_proposals::weights::WeightInfo; type MilestoneVotingWindow = MilestoneVotingWindow; - type RefundHandler = pallet_proposals::traits::XcmRefundHandler; + type ExternalRefundHandler = pallet_proposals::traits::XcmRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; diff --git a/runtime/integration-tests/src/xcm_transfers.rs b/runtime/integration-tests/src/xcm_transfers.rs index 083abdad..73f5a458 100644 --- a/runtime/integration-tests/src/xcm_transfers.rs +++ b/runtime/integration-tests/src/xcm_transfers.rs @@ -31,14 +31,14 @@ use imbue_kusama_runtime::{ CanonicalImbuePerSecond, OrmlTokens, Runtime as R, RuntimeOrigin, XTokens, }; use orml_traits::MultiCurrency; -use pallet_proposals::traits::RefundHandler; +use pallet_proposals::traits::ExternalRefundHandler; #[test] fn transfer_treasury_to_parachain_grant_escrow_address() { let transfer_amount: Balance = ksm_amount(1); let treasury_origin = TreasuryOrigin::Kusama; let kusama_treasury_address = - ::RefundHandler::get_treasury_account_id(treasury_origin) + ::ExternalRefundHandler::get_treasury_account_id(treasury_origin) .unwrap(); Development::execute_with(|| { assert_eq!( @@ -133,7 +133,7 @@ fn transfer_ksm_to_relay_chain() { fn test_xcm_refund_handler_to_kusama() { let treasury_origin = TreasuryOrigin::Kusama; let kusama_treasury_address = - ::RefundHandler::get_treasury_account_id(treasury_origin) + ::ExternalRefundHandler::get_treasury_account_id(treasury_origin) .unwrap(); let _kusama_treasury_balance_before = Kusama::account_data_of(kusama_treasury_address.clone()).free; @@ -162,7 +162,7 @@ fn test_xcm_refund_handler_to_kusama() { let ksm_balance = OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get()); assert!(ksm_balance > 0); assert_ok!( - ::RefundHandler::send_refund_message_to_treasury( + ::ExternalRefundHandler::send_refund_message_to_treasury( ImbueKusamaReceiver::get(), ksm_balance, CurrencyId::KSM, From 7250e64a9b4563e35fe2ec4203ab7114e43c9cba Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 2 Nov 2023 15:44:06 +0000 Subject: [PATCH 146/192] fix --- pallets/proposals/src/impls/pallet_impls.rs | 5 ++--- pallets/proposals/src/lib.rs | 7 +++--- pallets/proposals/src/traits.rs | 25 +++++++++------------ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index da766a93..ac791953 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -1,5 +1,4 @@ use crate::*; -use common_types::milestone_origin::FundingType; use scale_info::prelude::format; use sp_runtime::traits::{Saturating, Zero}; use pallet_disputes::{ @@ -325,7 +324,7 @@ impl DisputeHooks for Pallet { ) -> Weight { let mut weight: Weight = ::zero(); let maybe_project = Projects::::get(dispute_key); - *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); + weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); match maybe_project { Some(project) => { @@ -342,7 +341,7 @@ impl DisputeHooks for Pallet { } } }, - DisputeResult::Failue => { + DisputeResult::Failure => { // OnFailure // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. // Emit event for failure?? check if pallet_disputes does this. diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index e5463c68..1c766de5 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -392,12 +392,13 @@ pub mod pallet { pub fn raise_dispute( origin: OriginFor, project_key: ProjectKey, - milestone_keys: BoundedVec, + milestone_keys: BoundedVec, ) -> DispatchResult { let who = ensure_signed(origin)?; - let project = Project::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; - ensure!(project.contributors.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute)?; + let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; + ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys)?; + Ok(().into()) } } impl IntoProposal, BalanceOf, BlockNumberFor> diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 7225f066..9d4a035e 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -55,8 +55,8 @@ impl ExternalRefundHandler, BalanceOf, Curre for MockRefundHandler { fn send_refund_message_to_treasury( - _from: AccountId, - _amount: Balance, + _from: AccountIdOf, + _amount: BalanceOf, _currency: CurrencyId, _treasury_origin: TreasuryOrigin ) -> Result<(), DispatchError> { @@ -84,19 +84,14 @@ where currency: CurrencyId, treasury_origin: TreasuryOrigin, ) -> Result<(), DispatchError> { - match funding_type { - FundingType::Grant(treasury_origin) => { - let beneficiary: AccountIdOf = Self::get_treasury_account_id(treasury_origin)?; - let location: MultiLocation = treasury_origin - .get_multi_location(beneficiary) - .map_err(|_| Error::::InvalidDest)?; - - // TODO: dest weight limit. or specify a fee. - let _ = U::transfer(from, currency, amount, location, WeightLimit::Unlimited)?; - Ok(()) - } - _ => Err(Error::::InvalidDest.into()), - } + let beneficiary: AccountIdOf = Self::get_treasury_account_id(treasury_origin)?; + let location: MultiLocation = treasury_origin + .get_multi_location(beneficiary) + .map_err(|_| Error::::InvalidDest)?; + + // TODO: dest weight limit. or specify a fee. + let _ = U::transfer(from, currency, amount, location, WeightLimit::Unlimited)?; + Ok(()) } fn get_treasury_account_id( treasury_origin: TreasuryOrigin, From dc23a9d88c5cf7e58b2bf74204634bd24903b10b Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 3 Nov 2023 13:12:09 +0000 Subject: [PATCH 147/192] tests --- pallets/proposals/Cargo.toml | 1 + pallets/proposals/src/impls/pallet_impls.rs | 67 ++++---- pallets/proposals/src/lib.rs | 24 ++- pallets/proposals/src/mock.rs | 25 ++- pallets/proposals/src/test_utils.rs | 14 +- pallets/proposals/src/tests/disputes.rs | 166 ++++++++++++++++++++ pallets/proposals/src/tests/mod.rs | 2 + pallets/proposals/src/tests/pallet.rs | 2 +- pallets/proposals/src/tests/refunds.rs | 0 pallets/proposals/src/todo | 9 +- 10 files changed, 261 insertions(+), 49 deletions(-) create mode 100644 pallets/proposals/src/tests/disputes.rs create mode 100644 pallets/proposals/src/tests/refunds.rs diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 9c616d22..70f31ac4 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -63,6 +63,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polka pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} common-runtime = { path = "../../runtime/common"} pallet-fellowship = { path = "../fellowship"} +pallet-disputes = { path = "../disputes"} [features] default = ['std'] diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index ac791953..87483f34 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -314,50 +314,49 @@ impl Pallet { Ok(()) } + + } impl DisputeHooks for Pallet { fn on_dispute_complete( - dispute_key: ProjectKey, + project_key: ProjectKey, specifics: Vec, dispute_result: pallet_disputes::pallet::DisputeResult, ) -> Weight { let mut weight: Weight = ::zero(); - let maybe_project = Projects::::get(dispute_key); weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - - match maybe_project { - Some(project) => { - match dispute_result { - DisputeResult::Success => { - // OnSuccess - // mark each of the milestones as ready for refund. - // This should allow the withdraw function to - // cancel the project - // Emit Event for withdrawl - for milestone_key in specifics.iter() { - if let Some(milestone) = project.milestones.get(milestone_key) { - + ProjectsInDispute::::remove(project_key); + + Projects::::mutate(project_key, |maybe_project|{ + match maybe_project { + Some(project) => { + match dispute_result { + DisputeResult::Success => { + for milestone_key in specifics.iter() { + if let Some(milestone) = project.milestones.get_mut(milestone_key) { + milestone.can_refund = true; + } } - } - }, - DisputeResult::Failure => { - // OnFailure - // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. - // Emit event for failure?? check if pallet_disputes does this. - // revert anything that has happened as a result of calling a dispute (should be nothing as the 2 are independant.) - }, - }; - - weight - }, - // Looks like the project was deleted somehow during the dispute. - // The only way this is possible is through a refund or final withdraw. - // Not a massive issue as either way the project has been finalised. - // Just ignore and return weight. - None => { - weight + }, + DisputeResult::Failure => { + + // OnFailure + // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. + // Emit event for failure?? check if pallet_disputes does this. + // revert anything that has happened as a result of calling a dispute (should be nothing as the 2 are independant.) + }, + }; + weight + }, + // Looks like the project was deleted somehow during the dispute. + // The only way this is possible is through a refund or final withdraw. + // Not a massive issue as either way the project has been finalised. + // Just ignore and return weight. + None => { + weight + } } - } + }) } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 1c766de5..94125879 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -118,6 +118,7 @@ pub mod pallet { type DepositHandler: DepositHandler, AccountIdOf>; /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; + /// The trait that handler the raising of a dispute. type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxJurySize = Self::MaxJuryMembers, MaxSpecifics = Self::MaxMilestonesPerProject>; } @@ -196,6 +197,15 @@ pub mod pallet { ValueQuery, >; + #[pallet::storage] + pub type ProjectsInDispute = StorageMap< + _, + Blake2_128Concat, + ProjectKey, + (), + ValueQuery, + >; + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { @@ -304,7 +314,11 @@ pub mod pallet { /// An internal error, a collection of votes for a milestone has been lost.s IndividualVoteNotFound, /// Only a contributor can raise a dispute. - OnlyContributorsCanRaiseDispute + OnlyContributorsCanRaiseDispute, + /// The Project is already in a dispute. + ProjectAlreadyInDispute, + /// You cannot raise a dispute on an approved milestone. + CannotRaiseDisputeOnApprovedMilestone, } #[pallet::hooks] @@ -397,7 +411,14 @@ pub mod pallet { let who = ensure_signed(origin)?; let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); + ensure!(!ProjectsInDispute::::contains_key(project_key), Error::::ProjectAlreadyInDispute); + ensure!( + !project.milestones.iter().any(|(milestone_key, milestone)|{milestone_keys.contains(milestone_key) && milestone.is_approved}), + Error::::CannotRaiseDisputeOnApprovedMilestone + ); + ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys)?; + ProjectsInDispute::::insert(project_key, ()); Ok(().into()) } } @@ -577,7 +598,6 @@ impl Default for Vote { } } -//TODO: MIGRATION FOR refund locations, jury, on_creation_funding /// The struct which contain milestones that can be submitted. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index c039178d..e4513817 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -179,7 +179,6 @@ impl pallet_timestamp::Config for Test { } parameter_types! { - pub const TwoWeekBlockUnit: u32 = 100800u32; pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into(); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); @@ -194,16 +193,14 @@ parameter_types! { pub MaxProjectsPerAccount: u16 = 50; pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); pub MaxJuryMembers: u32 = 100; - + pub TreasuryFeeAccount: AccountId = *TREASURY; } impl pallet_proposals::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletId = ProposalsPalletId; - type AuthorityOrigin = EnsureRoot; type MultiCurrency = Tokens; type WeightInfo = crate::WeightInfo; - type MaxWithdrawalExpiration = TwoWeekBlockUnit; type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; @@ -211,13 +208,14 @@ impl pallet_proposals::Config for Test { type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; - type ImbueFeeAccount = + type ImbueFeeAccount = TreasuryFeeAccount; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; type MaxJuryMembers = MaxJuryMembers; + type DisputeRaiser = MockDisputeRaiser; } parameter_types! { @@ -280,7 +278,6 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let _ = Tokens::deposit(CurrencyId::Native, &CHARLIE, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &DAVE, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &JOHN, initial_balance); - let _ = Tokens::deposit(CurrencyId::Native, &VETTER, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &TREASURY, initial_balance); }); ext @@ -311,3 +308,19 @@ impl DepositHandler, crate::AccountIdOf Ok(()) } } + +pub struct MockDisputeRaiser; +impl DisputeRaiser for MockDisputeRaiser { +type DisputeKey = ProjectKey; +type SpecificId = MilestoneKey; +type MaxJurySize = MaxJuryMembers; +type MaxSpecifics = MaxMilestonesPerProject; + fn raise_dispute( + dispute_key: Self::DisputeKey, + raised_by: AccountId, + jury: BoundedVec, + specific_ids: BoundedVec, + ) -> Result<(), DispatchError> { + Ok(()) + } +} diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index c0555384..adca97f7 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,7 +1,7 @@ use crate::Config; use crate::Pallet as Proposals; use crate::*; -use common_types::{CurrencyId, FundingType}; +use common_types::{CurrencyId}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, Vec}; use frame_support::{assert_ok, traits::Hooks, BoundedVec}; @@ -13,6 +13,7 @@ use sp_core::{Get, H256}; use sp_runtime::Saturating; use sp_runtime::{DispatchError, SaturatedConversion}; use sp_std::{collections::btree_map::BTreeMap, convert::TryInto}; +use pallet_disputes::traits::DisputeHooks; #[allow(dead_code)] pub fn run_to_block(n: T::BlockNumber) { @@ -85,7 +86,7 @@ pub fn create_and_fund_project( contributions, agreement_hash, beneficiary, - proposed_milestones.try_into().map_err(|_|Error::::TooManyMilestones)?, + proposed_milestones.try_into().map_err(|_|Error::::TooManyMilestones)?, refund_locations, BoundedVec::new(), FundingPath::TakeFromReserved, @@ -109,8 +110,8 @@ pub fn create_project_awaiting_funding( contributions, agreement_hash, beneficiary, - proposed_milestones.try_into().map_err(|_|Error::::TooManyMilestones)?, - vec![(Locality::Foreign(treasury_account), Percent::from_parts(100u8))].try_into().map_err(|_|Error::::TooManyRefundLocations)?, + proposed_milestones.try_into().map_err(|_|Error::::TooManyMilestones)?, + vec![(Locality::Foreign(treasury_account), Percent::from_parts(100u8))].try_into().map_err(|_|Error::::TooManyRefundLocations)?, BoundedVec::new(), FundingPath::WaitForFunding, )?; @@ -133,6 +134,11 @@ pub fn create_funded_user( user } +/// Manually call the hook OnDisputeCompleteWith a predefined result for testing> +pub fn complete_dispute(project_key: ProjectKey, milestone_keys: Vec, result: pallet_disputes::DisputeResult) -> crate::Weight { + Proposals::::on_dispute_complete(project_key, milestone_keys, result) +} + pub fn assert_last_event(generic_event: ::RuntimeEvent) where ::AccountId: AsRef<[u8]>, diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs new file mode 100644 index 00000000..136c5805 --- /dev/null +++ b/pallets/proposals/src/tests/disputes.rs @@ -0,0 +1,166 @@ +use frame_support::{assert_noop, assert_ok}; +use crate::{mock::*, *}; +use common_types::CurrencyId; +use test_utils::*; +use pallet_disputes::DisputeResult; + +#[test] +fn raise_dispute_not_contributor() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*JOHN), project_key, milestone_keys), Error::::OnlyContributorsCanRaiseDispute); + }) +} + +#[test] +fn raise_dispute_project_doesnt_exist() { + build_test_externality().execute_with(|| { + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*JOHN), 0, vec![0u32].try_into().unwrap()), Error::::ProjectDoesNotExist); + }) +} + +#[test] +fn raise_dispute_already_in_dispute() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*CHARLIE), project_key, milestone_keys), Error::::ProjectAlreadyInDispute); + }) +} + +#[test] +fn raise_dispute_cant_raise_on_approved_milestone() { + build_test_externality().execute_with(|| { + + }) +} + +#[test] +fn on_dispute_complete_success_removes_dispute_status() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + assert!(!ProjectsInDispute::::contains_key(project_key)); + }) +} + + +#[test] +fn on_dispute_complete_failure_removes_dispute_status() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Failure); + assert!(!ProjectsInDispute::::contains_key(project_key)); + }) +} + +#[test] +fn dispute_success_does_not_cancel_project() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + + let project = Projects::::get(project_key).unwrap(); + assert!(!project.cancelled); + }) +} + +#[test] +fn dispute_success_approves_milestone_for_refund_but_only_ones_specified() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (1u32..milestones.len() as u32).collect::>().try_into().unwrap(); + + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + + }) +} + + + + +#[test] +fn dispute_success_returns_non_zero_weight() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let weight = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + assert!(weight != ::zero()); + }) +} + +#[test] +fn raise_dispute_prevents_milestone_voting() { + build_test_externality().execute_with(|| { + + }) +} + +#[test] +fn you_can_actually_refund_after_dispute_success() { + build_test_externality().execute_with(|| { + + }) +} diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs index 84d6a8a3..42441aa8 100644 --- a/pallets/proposals/src/tests/mod.rs +++ b/pallets/proposals/src/tests/mod.rs @@ -1,3 +1,5 @@ pub mod immutable_votes; pub mod pallet; pub mod into_proposals; +pub mod disputes; +pub mod refunds; diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 30475418..4adfb9c4 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -762,7 +762,7 @@ fn withdraw_takes_imbue_fee() { create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) .unwrap(); let milestone_key = 0; - let fee_account = crate::Pallet::::ImbueFeeAccount::get(); + let fee_account: AccountId = ::ImbueFeeAccount::get(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) .unwrap(); diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs new file mode 100644 index 00000000..e69de29b diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index b51dc2f0..4617df32 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -1,7 +1,11 @@ -raise-dispute extrinsic. +raise-dispute extrinsic. - done tests for above implementation. benchmark for raise dispute extrinsic prevent voting on a submitted milestone if a project is in dispute. +make sure when raising a dispute you cannot raise it on approved milestones. + +test above ^^ + Migration for removing NoConfidenceLogic #[pallet::storage] @@ -12,10 +16,11 @@ Migration for removing NoConfidenceLogic OnDisputeCompleteHooks. tests for above implementation. +update change withdraw to uses can_withdraw benchmark for hooks to return weight. removal of old no confidence logic. get jury in each pallet (briefs, grants, crowdfunding.) - +update the function call in each pallet (jury, TreasuryOrigin, ) From c99e766f35cf71784df4ebd29eff4f9d592623cf Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 3 Nov 2023 16:58:37 +0000 Subject: [PATCH 148/192] track dispute per milestone instead of per project --- pallets/disputes/src/lib.rs | 30 +++-- pallets/proposals/src/impls/pallet_impls.rs | 5 + pallets/proposals/src/lib.rs | 14 ++- pallets/proposals/src/tests/disputes.rs | 115 +++++++++++++++++- .../integration-tests/src/xcm_transfers.rs | 12 +- 5 files changed, 152 insertions(+), 24 deletions(-) diff --git a/pallets/disputes/src/lib.rs b/pallets/disputes/src/lib.rs index 43d3a3d5..72d6f456 100644 --- a/pallets/disputes/src/lib.rs +++ b/pallets/disputes/src/lib.rs @@ -157,12 +157,12 @@ pub mod pallet { weight = weight.saturating_add(T::WeightInfo::calculate_winner()); let result = dispute.calculate_winner(); // TODO: actually benchmark. - let hook_weight = - >::on_dispute_complete( - *dispute_id, - dispute.specifiers.into_inner(), - result, - ); + let hook_weight = >::on_dispute_complete( + *dispute_id, dispute.specifiers.into_inner(), result + ); weight = weight.saturating_add(hook_weight); Self::deposit_event(Event::::DisputeCompleted { @@ -230,7 +230,11 @@ pub mod pallet { } // Dont mind if this fails as the autofinalise will skip. }); - T::DisputeHooks::on_dispute_complete(dispute_key, dispute.specifiers.into_inner(), DisputeResult::Failure); + T::DisputeHooks::on_dispute_complete( + dispute_key, + dispute.specifiers.into_inner(), + DisputeResult::Failure, + ); Self::deposit_event(Event::::DisputeCompleted { dispute_key, dispute_result: DisputeResult::Failure, @@ -258,7 +262,11 @@ pub mod pallet { } // Dont mind if this fails as the autofinalise will skip. }); - T::DisputeHooks::on_dispute_complete(dispute_key, dispute.specifiers.into_inner(), DisputeResult::Success); + T::DisputeHooks::on_dispute_complete( + dispute_key, + dispute.specifiers.into_inner(), + DisputeResult::Success, + ); Self::deposit_event(Event::::DisputeCompleted { dispute_key, dispute_result: DisputeResult::Success, @@ -416,7 +424,11 @@ pub mod pallet { }); // Dont need to return the weight here. - let _ = T::DisputeHooks::on_dispute_complete(dispute_key, dispute.specifiers.into_inner(), result); + let _ = T::DisputeHooks::on_dispute_complete( + dispute_key, + dispute.specifiers.into_inner(), + result, + ); Ok(()) } diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 87483f34..0a7c08b4 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -76,6 +76,11 @@ impl Pallet { Rounds::::contains_key((project_key, milestone_key), RoundType::VotingRound), Error::::VotingRoundNotStarted ); + ensure!( + !ProjectsInDispute::::get(project_key).contains(&milestone_key), + Error::::MilestonesAlreadyInDispute + ); + let contribution_amount = project .contributions .get(&who) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 94125879..35b403b2 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -202,7 +202,7 @@ pub mod pallet { _, Blake2_128Concat, ProjectKey, - (), + BoundedVec::MaxMilestonesPerProject>, ValueQuery, >; @@ -315,8 +315,8 @@ pub mod pallet { IndividualVoteNotFound, /// Only a contributor can raise a dispute. OnlyContributorsCanRaiseDispute, - /// The Project is already in a dispute. - ProjectAlreadyInDispute, + /// One of these milestones is already in a dispute. + MilestonesAlreadyInDispute, /// You cannot raise a dispute on an approved milestone. CannotRaiseDisputeOnApprovedMilestone, } @@ -410,15 +410,19 @@ pub mod pallet { ) -> DispatchResult { let who = ensure_signed(origin)?; let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; + ensure!(milestone_keys.iter().all(|ms_key|project.milestones.contains_key(ms_key)), Error::::MilestoneDoesNotExist); ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); - ensure!(!ProjectsInDispute::::contains_key(project_key), Error::::ProjectAlreadyInDispute); + ensure!(!ProjectsInDispute::::get(project_key).iter().any(|ms_key| milestone_keys.contains(ms_key)), Error::::MilestonesAlreadyInDispute); ensure!( !project.milestones.iter().any(|(milestone_key, milestone)|{milestone_keys.contains(milestone_key) && milestone.is_approved}), Error::::CannotRaiseDisputeOnApprovedMilestone ); ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys)?; - ProjectsInDispute::::insert(project_key, ()); + ProjectsInDispute::::mutate(project_key |keys|{ + // Test this pls + keys.try_append(milestone_keys) + }); Ok(().into()) } } diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index 136c5805..e5e57e06 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -29,7 +29,7 @@ fn raise_dispute_project_doesnt_exist() { } #[test] -fn raise_dispute_already_in_dispute() { +fn raise_dispute_milestone_already_in_dispute() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); let milestones = get_milestones(10); @@ -40,8 +40,17 @@ fn raise_dispute_already_in_dispute() { CurrencyId::Native, ).unwrap(); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*CHARLIE), project_key, milestone_keys), Error::::ProjectAlreadyInDispute); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys)); + for i in milestones.iter() { + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*CHARLIE), project_key, vec![i].try_into().unwrap()), Error::::MilestonesAlreadyInDispute); + } + }) +} + +#[test] +fn raise_dispute_invalid_milestone_key() { + build_test_externality().execute_with(|| { + }) } @@ -129,9 +138,6 @@ fn dispute_success_approves_milestone_for_refund_but_only_ones_specified() { }) } - - - #[test] fn dispute_success_returns_non_zero_weight() { build_test_externality().execute_with(|| { @@ -154,7 +160,104 @@ fn dispute_success_returns_non_zero_weight() { #[test] fn raise_dispute_prevents_milestone_voting() { build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let submitted_milestone_key = 0; + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + + assert_ok!(Proposals::submit_milestone( + RuntimeOrigin::signed(*ALICE), + project_key, + submitted_milestone_key + )); + assert_ok!(Proposals::vote_on_milestone( + RuntimeOrigin::signed(*BOB), + project_key, + submitted_milestone_key, + true + )); + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, dispute_milestone_keys.clone())); + + assert_noop!(Proposals::vote_on_milestone( + RuntimeOrigin::signed(*CHARLIE), + project_key, + submitted_milestone_key, + true + ), Error::::MilestonesAlreadyInDispute); + }) +} + + +#[test] +fn raise_dispute_allows_milestone_voting_on_non_disputed_milestones() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let submitted_milestone_keys = [0, 1]; + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + + assert_ok!(Proposals::submit_milestone( + RuntimeOrigin::signed(*ALICE), + project_key, + submitted_milestone_keys[0] + )); + + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (2u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, dispute_milestone_keys.clone())); + + assert_ok!(Proposals::submit_milestone( + RuntimeOrigin::signed(*ALICE), + project_key, + submitted_milestone_keys[1] + )); + + assert_ok!(Proposals::vote_on_milestone( + RuntimeOrigin::signed(*CHARLIE), + project_key, + submitted_milestone_keys[0], + true + )); + assert_ok!(Proposals::vote_on_milestone( + RuntimeOrigin::signed(*BOB), + project_key, + submitted_milestone_keys[1], + true + )); + }) +} + + +#[test] +fn raise_dispute_allows_submission() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let milestone_key = 0; + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, dispute_milestone_keys.clone())); + assert_ok!(Proposals::submit_milestone( + RuntimeOrigin::signed(*ALICE), + project_key, + milestone_key + )); }) } diff --git a/runtime/integration-tests/src/xcm_transfers.rs b/runtime/integration-tests/src/xcm_transfers.rs index 73f5a458..ad84ce8d 100644 --- a/runtime/integration-tests/src/xcm_transfers.rs +++ b/runtime/integration-tests/src/xcm_transfers.rs @@ -38,8 +38,10 @@ fn transfer_treasury_to_parachain_grant_escrow_address() { let transfer_amount: Balance = ksm_amount(1); let treasury_origin = TreasuryOrigin::Kusama; let kusama_treasury_address = - ::ExternalRefundHandler::get_treasury_account_id(treasury_origin) - .unwrap(); + ::ExternalRefundHandler::get_treasury_account_id( + treasury_origin, + ) + .unwrap(); Development::execute_with(|| { assert_eq!( OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get()), @@ -133,8 +135,10 @@ fn transfer_ksm_to_relay_chain() { fn test_xcm_refund_handler_to_kusama() { let treasury_origin = TreasuryOrigin::Kusama; let kusama_treasury_address = - ::ExternalRefundHandler::get_treasury_account_id(treasury_origin) - .unwrap(); + ::ExternalRefundHandler::get_treasury_account_id( + treasury_origin, + ) + .unwrap(); let _kusama_treasury_balance_before = Kusama::account_data_of(kusama_treasury_address.clone()).free; let transfer_amount: Balance = ksm_amount(10); From 7394997e4e75f0c966dd03da0f11d91c27ccfbf9 Mon Sep 17 00:00:00 2001 From: f-gate Date: Sat, 4 Nov 2023 12:39:44 +0000 Subject: [PATCH 149/192] minor fixes --- pallets/disputes/src/mock.rs | 4 +--- pallets/proposals/src/lib.rs | 6 +++--- pallets/proposals/src/tests/disputes.rs | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pallets/disputes/src/mock.rs b/pallets/disputes/src/mock.rs index c1178921..df290bfd 100644 --- a/pallets/disputes/src/mock.rs +++ b/pallets/disputes/src/mock.rs @@ -59,7 +59,6 @@ impl frame_system::Config for Test { } parameter_types! { - pub MaxReasonLength: u32 = 100; pub MaxJurySize: u32 = 3; pub MaxSpecifics: u32 = 10; pub VotingTimeLimit: BlockNumber = 10; @@ -71,7 +70,6 @@ impl pallet_disputes::Config for Test { type WeightInfo = (); type DisputeKey = u32; type SpecificId = u32; - type MaxReasonLength = MaxReasonLength; type MaxJurySize = MaxJurySize; type MaxSpecifics = MaxSpecifics; type MaxDisputesPerBlock = MaxDisputesPerBlock; @@ -131,7 +129,7 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { impl crate::traits::DisputeHooks for Test { fn on_dispute_complete( _dispute_key: u32, - _specifics: u32, + _specifics: Vec, _dispute_result: crate::pallet::DisputeResult, ) -> Weight { ::default() diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 35b403b2..35501a7e 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -418,10 +418,10 @@ pub mod pallet { Error::::CannotRaiseDisputeOnApprovedMilestone ); - ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys)?; - ProjectsInDispute::::mutate(project_key |keys|{ + ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys.clone())?; + ProjectsInDispute::::mutate(project_key, |keys|{ // Test this pls - keys.try_append(milestone_keys) + keys.try_append(&mut milestone_keys.into_inner()).expect("The length will never exceed MaxMilestonePerProject as input must be within projects.milestones and distinct; qed.") }); Ok(().into()) } diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index e5e57e06..d114afd1 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -41,8 +41,8 @@ fn raise_dispute_milestone_already_in_dispute() { ).unwrap(); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys)); - for i in milestones.iter() { - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*CHARLIE), project_key, vec![i].try_into().unwrap()), Error::::MilestonesAlreadyInDispute); + for (i, index) in milestones.iter().enumerate() { + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*CHARLIE), project_key, vec![i as u32].try_into().unwrap()), Error::::MilestonesAlreadyInDispute); } }) } From 0fd2db30129a0cc13704724bd5b5298f0d720cda Mon Sep 17 00:00:00 2001 From: f-gate Date: Sat, 4 Nov 2023 13:14:39 +0000 Subject: [PATCH 150/192] update withdrawn to use is_withdrawn --- pallets/proposals/src/impls/pallet_impls.rs | 91 ++++++++++----------- pallets/proposals/src/lib.rs | 12 +-- pallets/proposals/src/tests/disputes.rs | 47 ++++++++++- pallets/proposals/src/todo | 17 ++-- 4 files changed, 99 insertions(+), 68 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 0a7c08b4..c5370c74 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -140,49 +140,46 @@ impl Pallet { ensure!(!project.cancelled, Error::::ProjectWithdrawn); ensure!(who == project.initiator, Error::::UserIsNotInitiator); - // Collect and calculate the amount that can be withdrawn. - let mut unlocked_funds: BalanceOf = Zero::zero(); - for (_, ms) in project.milestones.iter() { - if ms.is_approved { - let per_milestone = ms.percentage_to_unlock.mul_floor(project.raised_funds); - unlocked_funds = unlocked_funds.saturating_add(per_milestone); - } - } - - let withdrawable: BalanceOf = unlocked_funds.saturating_sub(project.withdrawn_funds); - ensure!( - withdrawable != Zero::zero(), - Error::::NoAvailableFundsToWithdraw - ); - - let fee = ::ImbueFee::get().mul_floor(withdrawable); - let withdrawn = withdrawable.saturating_sub(fee); - let project_account = Self::project_account_id(project_key); - - // Take the fee and send to ImbueFeeAccount - T::MultiCurrency::transfer( - project.currency_id, - &project_account, - &::ImbueFeeAccount::get(), - fee, - )?; - - // Transfer to initiator - T::MultiCurrency::transfer( - project.currency_id, - &project_account, - &project.initiator, - withdrawn, - )?; - - // Remove the project if the funds left are 0. - Projects::::mutate_exists(project_key, |project| -> DispatchResult { - if let Some(p) = project { - p.withdrawn_funds = p.withdrawn_funds.saturating_add(withdrawable); - if p.withdrawn_funds == p.raised_funds { - ::DepositHandler::return_deposit(p.deposit_id)?; + Projects::::try_mutate_exists(project_key, |maybe_project|{ + if let Some(project) = maybe_project { + let withdrawable = project.milestones.values().map(|ms|{ + if ms.is_approved && !ms.is_withdrawn { + ms.percentage_to_unlock + ms.is_withdrawn = true; + } + }).collect::>().sum(); + + ensure!( + withdrawable != Zero::zero(), + Error::::NoAvailableFundsToWithdraw + ); + + let fee = ::ImbueFee::get().mul_floor(withdrawable); + let initiator_payment = withdrawable.saturating_sub(fee); + let project_account = Self::project_account_id(project_key); + + // Take the fee and send to ImbueFeeAccount + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &::ImbueFeeAccount::get(), + fee, + )?; + + // Transfer to initiator + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &project.initiator, + initiator_payment, + )?; + + project.withdrawn_funds = project.withdrawn_funds.saturating_add(withdrawable); + + if project.withdrawn_funds == project.raised_funds { + ::DepositHandler::return_deposit(project.deposit_id)?; CompletedProjects::::try_mutate( - &p.initiator, + &project.initiator, |completed_projects| -> DispatchResult { completed_projects .try_push(project_key) @@ -190,10 +187,9 @@ impl Pallet { Ok(()) }, )?; - *project = None; + *maybe_project = None; } } - Ok(()) })?; Self::deposit_event(Event::ProjectFundsWithdrawn( @@ -331,8 +327,8 @@ impl DisputeHooks for Pallet { ) -> Weight { let mut weight: Weight = ::zero(); weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - ProjectsInDispute::::remove(project_key); + ProjectsInDispute::::remove(project_key); Projects::::mutate(project_key, |maybe_project|{ match maybe_project { Some(project) => { @@ -345,11 +341,6 @@ impl DisputeHooks for Pallet { } }, DisputeResult::Failure => { - - // OnFailure - // should not modify the state of the project except perhaps recording the amount of disputes previosuly handled. - // Emit event for failure?? check if pallet_disputes does this. - // revert anything that has happened as a result of calling a dispute (should be nothing as the 2 are independant.) }, }; weight diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 35501a7e..2598f47a 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -412,17 +412,15 @@ pub mod pallet { let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; ensure!(milestone_keys.iter().all(|ms_key|project.milestones.contains_key(ms_key)), Error::::MilestoneDoesNotExist); ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); - ensure!(!ProjectsInDispute::::get(project_key).iter().any(|ms_key| milestone_keys.contains(ms_key)), Error::::MilestonesAlreadyInDispute); + ensure!(!ProjectsInDispute::::contains_key(&project_key), Error::::MilestonesAlreadyInDispute); ensure!( !project.milestones.iter().any(|(milestone_key, milestone)|{milestone_keys.contains(milestone_key) && milestone.is_approved}), Error::::CannotRaiseDisputeOnApprovedMilestone ); ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys.clone())?; - ProjectsInDispute::::mutate(project_key, |keys|{ - // Test this pls - keys.try_append(&mut milestone_keys.into_inner()).expect("The length will never exceed MaxMilestonePerProject as input must be within projects.milestones and distinct; qed.") - }); + ProjectsInDispute::::insert(project_key, milestone_keys); + Ok(().into()) } } @@ -574,12 +572,16 @@ pub struct ProposedMilestone { /// TODO: add ipfs hash like in the grants pallet and // TODO: MIGRATION FOR MILESTONES +//is_withdrawn +//can_refund +//is_refunded #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub struct Milestone { pub project_key: ProjectKey, pub milestone_key: MilestoneKey, pub percentage_to_unlock: Percent, pub is_approved: bool, + pub is_withdrawn: bool, pub can_refund: bool, pub is_refunded: bool, } diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index d114afd1..f0a69ef5 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -50,14 +50,53 @@ fn raise_dispute_milestone_already_in_dispute() { #[test] fn raise_dispute_invalid_milestone_key() { build_test_externality().execute_with(|| { - + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, vec![11u32].try_into().unwrap()), Error::::MilestoneDoesNotExist); + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, vec![12u32].try_into().unwrap()), Error::::MilestoneDoesNotExist); + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, vec![1u32, 11u32].try_into().unwrap()), Error::::MilestoneDoesNotExist); }) } #[test] fn raise_dispute_cant_raise_on_approved_milestone() { build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let submitted_milestone_key = 0u32; + assert_ok!(Proposals::submit_milestone( + RuntimeOrigin::signed(*ALICE), + project_key, + submitted_milestone_key + )); + assert_ok!(Proposals::vote_on_milestone( + RuntimeOrigin::signed(*BOB), + project_key, + submitted_milestone_key, + true + )); + assert_ok!(Proposals::vote_on_milestone( + RuntimeOrigin::signed(*CHARLIE), + project_key, + submitted_milestone_key, + true + )); + // Milestone should be approved. + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, vec![submitted_milestone_key].try_into().unwrap()), Error::::CannotRaiseDisputeOnApprovedMilestone); + assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, vec![submitted_milestone_key, 2u32].try_into().unwrap()), Error::::CannotRaiseDisputeOnApprovedMilestone); }) } @@ -158,7 +197,7 @@ fn dispute_success_returns_non_zero_weight() { } #[test] -fn raise_dispute_prevents_milestone_voting() { +fn raise_dispute_allows_milestone_voting() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); let milestones = get_milestones(10); @@ -184,12 +223,12 @@ fn raise_dispute_prevents_milestone_voting() { let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, dispute_milestone_keys.clone())); - assert_noop!(Proposals::vote_on_milestone( + assert_ok!(Proposals::vote_on_milestone( RuntimeOrigin::signed(*CHARLIE), project_key, submitted_milestone_key, true - ), Error::::MilestonesAlreadyInDispute); + )); }) } diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index 4617df32..fad0b8e2 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -1,25 +1,24 @@ raise-dispute extrinsic. - done -tests for above implementation. +tests for above implementation. - done?? check code cov benchmark for raise dispute extrinsic -prevent voting on a submitted milestone if a project is in dispute. -make sure when raising a dispute you cannot raise it on approved milestones. - -test above ^^ - +ALLOW VOTING ON SUBMITTED MILESTONE - done +make sure when raising a dispute you cannot raise it on approved milestones. - done Migration for removing NoConfidenceLogic #[pallet::storage] #[pallet::getter(fn no_confidence_votes)] pub(super) type NoConfidenceVotes = StorageMap<_, Identity, ProjectKey, Vote>, OptionQuery>; +Migration removing NoConfidenceRound, OnDisputeCompleteHooks. -tests for above implementation. +tests for above implementation. - done check code cov + update change withdraw to uses can_withdraw -benchmark for hooks to return weight. +benchmark for hooks to return weight. - done didnt need, we can do it directly in the method. -removal of old no confidence logic. +removal of old no confidence logic. - done get jury in each pallet (briefs, grants, crowdfunding.) update the function call in each pallet (jury, TreasuryOrigin, ) From af30ff663f0c5e6e1f56d12b6b46c56a37431808 Mon Sep 17 00:00:00 2001 From: f-gate Date: Sat, 4 Nov 2023 13:52:01 +0000 Subject: [PATCH 151/192] fix --- pallets/proposals/src/impls/pallet_impls.rs | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index c5370c74..273add80 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -140,20 +140,24 @@ impl Pallet { ensure!(!project.cancelled, Error::::ProjectWithdrawn); ensure!(who == project.initiator, Error::::UserIsNotInitiator); - Projects::::try_mutate_exists(project_key, |maybe_project|{ + let withdrawable = Projects::::try_mutate_exists(project_key, |maybe_project|{ if let Some(project) = maybe_project { - let withdrawable = project.milestones.values().map(|ms|{ + let withdrawable_percent: Percent = project.milestones.iter_mut().map(|(_key, mut ms)|{ if ms.is_approved && !ms.is_withdrawn { - ms.percentage_to_unlock ms.is_withdrawn = true; + ms.percentage_to_unlock + } else { + ::zero() } - }).collect::>().sum(); + + }).fold(::zero(), |acc, item| acc + item); ensure!( - withdrawable != Zero::zero(), + withdrawable_percent != Zero::zero(), Error::::NoAvailableFundsToWithdraw ); + let withdrawable = withdrawable_percent.mul_floor(project.raised_funds); let fee = ::ImbueFee::get().mul_floor(withdrawable); let initiator_payment = withdrawable.saturating_sub(fee); let project_account = Self::project_account_id(project_key); @@ -189,13 +193,16 @@ impl Pallet { )?; *maybe_project = None; } - } + Ok::, DispatchError>(withdrawable) + } else { + Ok::, DispatchError>( as Zero>::zero()) + } })?; Self::deposit_event(Event::ProjectFundsWithdrawn( who, project_key, - withdrawn, + withdrawable, project.currency_id, )); @@ -245,6 +252,7 @@ impl Pallet { milestone_key, percentage_to_unlock: milestone.percentage_to_unlock, is_approved: false, + is_withdrawn: false, can_refund: false, is_refunded: false, }; From 87b7d9152c7d87007ce64c9eaaa78c3b8bf716dd Mon Sep 17 00:00:00 2001 From: f-gate Date: Sat, 4 Nov 2023 14:13:27 +0000 Subject: [PATCH 152/192] fix --- pallets/proposals/src/impls/pallet_impls.rs | 10 ++++------ pallets/proposals/src/todo | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 273add80..75e0c1d1 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -333,9 +333,6 @@ impl DisputeHooks for Pallet { specifics: Vec, dispute_result: pallet_disputes::pallet::DisputeResult, ) -> Weight { - let mut weight: Weight = ::zero(); - weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); - ProjectsInDispute::::remove(project_key); Projects::::mutate(project_key, |maybe_project|{ match maybe_project { @@ -351,16 +348,17 @@ impl DisputeHooks for Pallet { DisputeResult::Failure => { }, }; - weight }, // Looks like the project was deleted somehow during the dispute. // The only way this is possible is through a refund or final withdraw. // Not a massive issue as either way the project has been finalised. // Just ignore and return weight. None => { - weight } } - }) + }); + // ProjectsInDispute::remove + // Projects::mutate + T::DbWeight::get().reads_writes(2, 2) } } diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index fad0b8e2..eef2800e 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -4,22 +4,24 @@ benchmark for raise dispute extrinsic ALLOW VOTING ON SUBMITTED MILESTONE - done make sure when raising a dispute you cannot raise it on approved milestones. - done -Migration for removing NoConfidenceLogic - #[pallet::storage] - #[pallet::getter(fn no_confidence_votes)] - pub(super) type NoConfidenceVotes = - StorageMap<_, Identity, ProjectKey, Vote>, OptionQuery>; -Migration removing NoConfidenceRound, - - OnDisputeCompleteHooks. tests for above implementation. - done check code cov -update change withdraw to uses can_withdraw +update change withdraw to uses can_withdraw - done benchmark for hooks to return weight. - done didnt need, we can do it directly in the method. +fix all tests removal of old no confidence logic. - done get jury in each pallet (briefs, grants, crowdfunding.) update the function call in each pallet (jury, TreasuryOrigin, ) +Migration for removing NoConfidenceLogic + #[pallet::storage] + #[pallet::getter(fn no_confidence_votes)] + pub(super) type NoConfidenceVotes = + StorageMap<_, Identity, ProjectKey, Vote>, OptionQuery>; +Migration removing NoConfidenceRound, + + + From 0609bfc289f05338bf4cff0c3950c0e57256bb43 Mon Sep 17 00:00:00 2001 From: f-gate Date: Sat, 4 Nov 2023 14:22:08 +0000 Subject: [PATCH 153/192] more todos! Jury selector fix --- pallets/briefs/src/lib.rs | 9 +++++++-- pallets/proposals/src/lib.rs | 25 +++++++++++++++++++++++++ pallets/proposals/src/migration.rs | 10 +++++----- pallets/proposals/src/todo | 9 +++++---- 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index 1d816ea3..61503c19 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -37,6 +37,7 @@ pub mod pallet { use sp_core::H256; use sp_runtime::traits::Zero; use sp_std::convert::{From, TryInto}; + use pallet_fellowship::traits::SelectJury; pub(crate) type AccountIdOf = ::AccountId; pub(crate) type BalanceOf = @@ -70,8 +71,8 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// The currency type. type RMultiCurrency: MultiReservableCurrency, CurrencyId = CurrencyId>; - type AuthorityOrigin: EnsureOrigin; /// The type that allows for evolution from brief to proposal. type IntoProposal: IntoProposal, BalanceOf, BlockNumberFor>; /// The maximum amount of owners to a brief. @@ -82,7 +83,11 @@ pub mod pallet { /// Storage deposits. type BriefStorageItem: Get>; type DepositHandler: DepositHandler, AccountIdOf>; - + /// The jury size of each brief as selected by JurySelector. + type StandardJurySize: Get + /// The type that selects a list of jury members. + type JurySelector: SelectJury>; + /// The weight info for the extrinsics. type WeightInfo: WeightInfoT; } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 2598f47a..f15d6a04 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -423,7 +423,32 @@ pub mod pallet { Ok(().into()) } + + /// Attempt a refund of milestones. + /// Will only refund milestones that have can_refund set to true. + #[pallet::call_index(14)] + #[pallet::weight(::zero())] + pub fn refund( + origin: OriginFor, + project_key: ProjectKey, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; + ensure!(milestone_keys.iter().all(|ms_key|project.milestones.contains_key(ms_key)), Error::::MilestoneDoesNotExist); + ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); + ensure!(!ProjectsInDispute::::contains_key(&project_key), Error::::MilestonesAlreadyInDispute); + ensure!( + !project.milestones.iter().any(|(milestone_key, milestone)|{milestone_keys.contains(milestone_key) && milestone.is_approved}), + Error::::CannotRaiseDisputeOnApprovedMilestone + ); + + ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys.clone())?; + ProjectsInDispute::::insert(project_key, milestone_keys); + + Ok(().into()) + } } + impl IntoProposal, BalanceOf, BlockNumberFor> for crate::Pallet where diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 182399bd..60121d1f 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -3,7 +3,7 @@ use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; use frame_system::pallet_prelude::BlockNumberFor; -use pallet_fellowship::traits::JurySelector; +use pallet_fellowship::traits::SelectJury; pub use pallet::*; pub type TimestampOf = ::Moment; @@ -711,9 +711,9 @@ pub mod v6 { pub mod v7 { - struct MigrateToV7(T, U); + struct MigrateToV7(T, U); - impl OnRuntimeUpgrade for MigrateToV7 { + impl OnRuntimeUpgrade for MigrateToV7 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); @@ -760,7 +760,7 @@ pub mod v7 { } } - fn migrate_new_fields(weight &mut Weight) { + fn migrate_new_fields(weight &mut Weight) { v6::Projects::::drain().for_each(|(key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -770,7 +770,7 @@ pub mod v7 { Grant(_) => crate::FundingPath::WaitForFunding, } - let jury = ::select_jury(::MaxJuryMembers::get()); + let jury = ::select_jury(::MaxJuryMembers::get()); let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match funding.funding_type { Proposal => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index eef2800e..c2ebf617 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -3,17 +3,18 @@ tests for above implementation. - done?? check code cov benchmark for raise dispute extrinsic ALLOW VOTING ON SUBMITTED MILESTONE - done make sure when raising a dispute you cannot raise it on approved milestones. - done - OnDisputeCompleteHooks. tests for above implementation. - done check code cov - update change withdraw to uses can_withdraw - done benchmark for hooks to return weight. - done didnt need, we can do it directly in the method. -fix all tests - removal of old no confidence logic. - done + +fix all tests - get jury in each pallet (briefs, grants, crowdfunding.) update the function call in each pallet (jury, TreasuryOrigin, ) +code cov check + +initiate refund extrinsic Migration for removing NoConfidenceLogic #[pallet::storage] From bf8ff366d21a63cb89f2dbbed0037c6476d225ed Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 13:11:30 +0000 Subject: [PATCH 154/192] tests, refund extrinsic --- pallets/proposals/src/impls/pallet_impls.rs | 2 + pallets/proposals/src/lib.rs | 80 +++++++++++++++++---- pallets/proposals/src/tests/disputes.rs | 6 +- pallets/proposals/src/tests/refunds.rs | 31 ++++++++ pallets/proposals/src/todo | 3 + pallets/proposals/src/traits.rs | 11 +-- 6 files changed, 108 insertions(+), 25 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 75e0c1d1..34203847 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -341,9 +341,11 @@ impl DisputeHooks for Pallet { DisputeResult::Success => { for milestone_key in specifics.iter() { if let Some(milestone) = project.milestones.get_mut(milestone_key) { + if !milestone.is_withdrawn { milestone.can_refund = true; } } + } }, DisputeResult::Failure => { }, diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index f15d6a04..3ecd8143 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -319,6 +319,8 @@ pub mod pallet { MilestonesAlreadyInDispute, /// You cannot raise a dispute on an approved milestone. CannotRaiseDisputeOnApprovedMilestone, + /// Only a contributor can initiate a refund. + OnlyContributorsCanInitiateRefund, } #[pallet::hooks] @@ -434,16 +436,47 @@ pub mod pallet { ) -> DispatchResult { let who = ensure_signed(origin)?; let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; - ensure!(milestone_keys.iter().all(|ms_key|project.milestones.contains_key(ms_key)), Error::::MilestoneDoesNotExist); - ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); - ensure!(!ProjectsInDispute::::contains_key(&project_key), Error::::MilestonesAlreadyInDispute); - ensure!( - !project.milestones.iter().any(|(milestone_key, milestone)|{milestone_keys.contains(milestone_key) && milestone.is_approved}), - Error::::CannotRaiseDisputeOnApprovedMilestone - ); + ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanInitiateRefund); + + let mut total_refunded: BalanceOf = Zero::zero(); + let project_account = Self::project_account_id(project_key); + + project.milestones.iter().map(|(ms_key, ms)|{ + if ms.can_refund && ms.transfer_status == None { + for (refund_location, percent_share) in project.refund_locations { + let amount = milestone.percentage_to_unlock.mul_floor(project.raised_funds); + match refund_location { + Locality::Local(acc) => { + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &acc, + amount, + )?; + }, + Locality::Foreign(multilocation) => { + T::ExternalRefundHandler::send_refund_message_to_treasury( + &project_account, + amount, + project.currency_id, + multilocation, + ) + } + } + total_refunded = total_refunded.saturating_add(amount); + } + } + }) - ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys.clone())?; - ProjectsInDispute::::insert(project_key, milestone_keys); + Projects::::mutate_exists(project_key, |maybe_project|{ + if let Some(project) = maybe_project { + project.refunded_funds = project.refunded_funds.saturating_add(total_refunded); + } + + if project.refunded_funds.saturating_add(project.withdrawn_funds) = project.raised_funds { + *maybe_project = None; + } + }); Ok(().into()) } @@ -597,18 +630,27 @@ pub struct ProposedMilestone { /// TODO: add ipfs hash like in the grants pallet and // TODO: MIGRATION FOR MILESTONES -//is_withdrawn //can_refund -//is_refunded #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] -pub struct Milestone { +pub struct Milestone { pub project_key: ProjectKey, pub milestone_key: MilestoneKey, pub percentage_to_unlock: Percent, pub is_approved: bool, - pub is_withdrawn: bool, pub can_refund: bool, - pub is_refunded: bool, + pub transfer_status: Option>, +} +impl Milestone { + fn new(project_key: ProjectKey, milestone_key: MilestoneKey, percentage_to_unlock: Percent) -> Self { + Self { + project_key, + milestone_key, + percentage_to_unlock, + is_approved: false, + can_refund: false, + transfer_status: None, + } + } } /// The vote struct is used to @@ -629,6 +671,7 @@ impl Default for Vote { } } +// TODO MILESTONE MIGRATIONS /// The struct which contain milestones that can be submitted. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] @@ -657,6 +700,8 @@ pub struct Project { pub jury: BoundedVec, T::MaxJuryMembers>, /// When is the project funded and how is it taken. pub on_creation_funding: FundingPath, + /// The amount of funds refunded. + pub refunded_funds: BalanceOf, } /// For deriving the location of an account. @@ -704,6 +749,13 @@ pub enum FundingPath { WaitForFunding, } +/// Defines how the funds were taken out of a specific milestone. +/// Contians the block number for possible further investigation. +pub enum TransferStatus { + Refunded{on: BlockNumber}, + Withdrawn{on: BlockNumber}, +} + /// Stores the btree for each individual vote. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index f0a69ef5..3464e5d5 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -301,8 +301,10 @@ fn raise_dispute_allows_submission() { } #[test] -fn you_can_actually_refund_after_dispute_success() { +fn refund_then_withdraw_doesnt_double_spend() { build_test_externality().execute_with(|| { - + assert!(false) }) } + + diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index e69de29b..e06d66e3 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -0,0 +1,31 @@ + +#[test] +fn you_can_actually_refund_after_dispute_success() { + build_test_externality().execute_with(|| { + + }) +} + +// The case where a project is in a dispute, and the dispute passes however, a milestone has also been approved +// before the refund has been called. +// Without the proper checks there will be a kind of double spend. +#[test] +fn refund_only_transfers_milestones_which_havent_been_withdrawn() { + build_test_externality().execute_with(|| { + + }) +} + +#[test] +fn refund_check_refund_amount() { + build_test_externality().execute_with(|| { + + }) +} + +#[test] +fn refund_takes_imbue_fee() { + build_test_externality().execute_with(|| { + + }) +} \ No newline at end of file diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index c2ebf617..a9624b44 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -15,6 +15,9 @@ update the function call in each pallet (jury, TreasuryOrigin, ) code cov check initiate refund extrinsic +tests! +add total_refunded to withdraw extrinsic +tests for these Migration for removing NoConfidenceLogic #[pallet::storage] diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 9d4a035e..b042f749 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -35,13 +35,11 @@ pub trait IntoProposal { pub trait ExternalRefundHandler { /// Send a message to some destination chain asking to do some reserve asset transfer. - /// The multilocation is defined by the FundingType. - /// see FundingType and TreasuryOrigin. fn send_refund_message_to_treasury( from: AccountId, amount: Balance, currency: CurrencyId, - treasury_origin: TreasuryOrigin, + treasury_origin: MultiLocation, ) -> Result<(), DispatchError>; fn get_treasury_account_id(treasury_origin: TreasuryOrigin) -> Result; @@ -82,13 +80,8 @@ where from: T::AccountId, amount: T::Balance, currency: CurrencyId, - treasury_origin: TreasuryOrigin, + treasury_origin: MultiLocation, ) -> Result<(), DispatchError> { - let beneficiary: AccountIdOf = Self::get_treasury_account_id(treasury_origin)?; - let location: MultiLocation = treasury_origin - .get_multi_location(beneficiary) - .map_err(|_| Error::::InvalidDest)?; - // TODO: dest weight limit. or specify a fee. let _ = U::transfer(from, currency, amount, location, WeightLimit::Unlimited)?; Ok(()) From 6aead07879ec64530d776f89e2b17fe996b71be8 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 14:01:27 +0000 Subject: [PATCH 155/192] mindbending fix --- pallets/proposals/src/impls/pallet_impls.rs | 19 +++--- pallets/proposals/src/lib.rs | 75 +++++++++++---------- pallets/proposals/src/tests/refunds.rs | 3 + pallets/proposals/src/traits.rs | 4 +- 4 files changed, 54 insertions(+), 47 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 34203847..d8e1cfc2 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -143,8 +143,8 @@ impl Pallet { let withdrawable = Projects::::try_mutate_exists(project_key, |maybe_project|{ if let Some(project) = maybe_project { let withdrawable_percent: Percent = project.milestones.iter_mut().map(|(_key, mut ms)|{ - if ms.is_approved && !ms.is_withdrawn { - ms.is_withdrawn = true; + if ms.is_approved && ms.transfer_status == None { + ms.transfer_status = Some(TransferStatus::Withdrawn{on: frame_system::Pallet::::block_number()}); ms.percentage_to_unlock } else { ::zero() @@ -246,16 +246,13 @@ impl Pallet { ) -> Result, DispatchError> { let mut milestone_key: u32 = 0; let mut milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); - for milestone in proposed_milestones { - let milestone = Milestone { + for proposed_milestone in proposed_milestones { + let milestone = Milestone::new( project_key, milestone_key, - percentage_to_unlock: milestone.percentage_to_unlock, - is_approved: false, - is_withdrawn: false, - can_refund: false, - is_refunded: false, - }; + proposed_milestone.percentage_to_unlock + ); + milestones .try_insert(milestone_key, milestone) .map_err(|_| Error::::TooManyMilestones)?; @@ -341,7 +338,7 @@ impl DisputeHooks for Pallet { DisputeResult::Success => { for milestone_key in specifics.iter() { if let Some(milestone) = project.milestones.get_mut(milestone_key) { - if !milestone.is_withdrawn { + if milestone.transfer_status == None { milestone.can_refund = true; } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 3ecd8143..35981d96 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -62,7 +62,7 @@ pub type DepositIdOf = // These are the bounded types which are suitable for handling user input due to their restriction of vector length. type BoundedBTreeMilestones = - BoundedBTreeMap::MaxMilestonesPerProject>; + BoundedBTreeMap>, ::MaxMilestonesPerProject>; pub type BoundedProposedMilestones = BoundedVec::MaxMilestonesPerProject>; pub type AgreementHash = H256; @@ -428,7 +428,7 @@ pub mod pallet { /// Attempt a refund of milestones. /// Will only refund milestones that have can_refund set to true. - #[pallet::call_index(14)] + #[pallet::call_index(15)] #[pallet::weight(::zero())] pub fn refund( origin: OriginFor, @@ -441,42 +441,46 @@ pub mod pallet { let mut total_refunded: BalanceOf = Zero::zero(); let project_account = Self::project_account_id(project_key); - project.milestones.iter().map(|(ms_key, ms)|{ - if ms.can_refund && ms.transfer_status == None { - for (refund_location, percent_share) in project.refund_locations { - let amount = milestone.percentage_to_unlock.mul_floor(project.raised_funds); - match refund_location { - Locality::Local(acc) => { - T::MultiCurrency::transfer( - project.currency_id, - &project_account, - &acc, - amount, - )?; - }, - Locality::Foreign(multilocation) => { - T::ExternalRefundHandler::send_refund_message_to_treasury( - &project_account, - amount, - project.currency_id, - multilocation, - ) + Projects::::try_mutate(project_key, |maybe_project|{ + if let Some(project) = maybe_project { + for (ms_key, mut ms) in project.milestones.iter_mut() { + if ms.can_refund && ms.transfer_status.is_none() { + for (refund_location, percent_share) in &project.refund_locations { + let amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); + match refund_location { + Locality::Local(acc) => { + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &acc, + amount, + )?; + }, + Locality::Foreign(multilocation) => { + T::ExternalRefundHandler::send_refund_message_to_treasury( + // TODO: change this to reference so that we dont have to clone.... + project_account.clone(), + amount, + project.currency_id, + *multilocation, + )?; + } + } + total_refunded = total_refunded.saturating_add(amount); } + ms.transfer_status = Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()}); } - total_refunded = total_refunded.saturating_add(amount); } + Ok::<(), DispatchError>(()) + } else { + Ok::<(), DispatchError>(()) } - }) + })?; - Projects::::mutate_exists(project_key, |maybe_project|{ - if let Some(project) = maybe_project { - project.refunded_funds = project.refunded_funds.saturating_add(total_refunded); - } - - if project.refunded_funds.saturating_add(project.withdrawn_funds) = project.raised_funds { - *maybe_project = None; - } - }); + //project.refunded_funds = project.refunded_funds.saturating_add(total_refunded); + //if project.refunded_funds.saturating_add(project.withdrawn_funds) == project.raised_funds { + // *maybe_project = None; + //} Ok(().into()) } @@ -542,7 +546,7 @@ pub mod pallet { milestones: converted_milestones, contributions, currency_id, - withdrawn_funds: 0u32.into(), + withdrawn_funds: Zero::zero(), raised_funds: sum_of_contributions, initiator: benificiary.clone(), created_on: frame_system::Pallet::::block_number(), @@ -555,6 +559,7 @@ pub mod pallet { .try_into() .map_err(|_| Error::::TooManyJuryMembers)?, on_creation_funding, + refunded_funds: Zero::zero() }; let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys); @@ -640,6 +645,7 @@ pub struct Milestone { pub can_refund: bool, pub transfer_status: Option>, } + impl Milestone { fn new(project_key: ProjectKey, milestone_key: MilestoneKey, percentage_to_unlock: Percent) -> Self { Self { @@ -751,6 +757,7 @@ pub enum FundingPath { /// Defines how the funds were taken out of a specific milestone. /// Contians the block number for possible further investigation. +#[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub enum TransferStatus { Refunded{on: BlockNumber}, Withdrawn{on: BlockNumber}, diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index e06d66e3..08e08536 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -1,3 +1,6 @@ +use frame_support::{assert_noop, assert_ok}; +use crate::{mock::*, *}; +use test_utils::*; #[test] fn you_can_actually_refund_after_dispute_success() { diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index b042f749..c7f067d1 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -56,7 +56,7 @@ impl ExternalRefundHandler, BalanceOf, Curre _from: AccountIdOf, _amount: BalanceOf, _currency: CurrencyId, - _treasury_origin: TreasuryOrigin + _multilocation: MultiLocation ) -> Result<(), DispatchError> { Ok(()) } @@ -80,7 +80,7 @@ where from: T::AccountId, amount: T::Balance, currency: CurrencyId, - treasury_origin: MultiLocation, + location: MultiLocation, ) -> Result<(), DispatchError> { // TODO: dest weight limit. or specify a fee. let _ = U::transfer(from, currency, amount, location, WeightLimit::Unlimited)?; From b3c8996a421d197b75c92d2f91a82df1aac02159 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 14:02:44 +0000 Subject: [PATCH 156/192] try_mutate_exists instead --- pallets/proposals/src/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 35981d96..d57d631c 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -441,7 +441,7 @@ pub mod pallet { let mut total_refunded: BalanceOf = Zero::zero(); let project_account = Self::project_account_id(project_key); - Projects::::try_mutate(project_key, |maybe_project|{ + Projects::::try_mutate_exists(project_key, |maybe_project|{ if let Some(project) = maybe_project { for (ms_key, mut ms) in project.milestones.iter_mut() { if ms.can_refund && ms.transfer_status.is_none() { @@ -471,17 +471,15 @@ pub mod pallet { ms.transfer_status = Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()}); } } + project.refunded_funds = project.refunded_funds.saturating_add(total_refunded); + if project.refunded_funds.saturating_add(project.withdrawn_funds) == project.raised_funds { + *maybe_project = None; + } Ok::<(), DispatchError>(()) } else { Ok::<(), DispatchError>(()) } })?; - - //project.refunded_funds = project.refunded_funds.saturating_add(total_refunded); - //if project.refunded_funds.saturating_add(project.withdrawn_funds) == project.raised_funds { - // *maybe_project = None; - //} - Ok(().into()) } } From c964241de0b0eb05ce9190cdaf3ca1eddcc0300f Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 17:02:17 +0000 Subject: [PATCH 157/192] fixing just keep fixing --- pallets/proposals/src/impls/pallet_impls.rs | 4 - pallets/proposals/src/lib.rs | 21 ++++- pallets/proposals/src/tests/disputes.rs | 6 ++ pallets/proposals/src/tests/pallet.rs | 91 +++++++++------------ pallets/proposals/src/tests/refunds.rs | 68 +++++++++++++++ 5 files changed, 131 insertions(+), 59 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index d8e1cfc2..2927c2b8 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -76,10 +76,6 @@ impl Pallet { Rounds::::contains_key((project_key, milestone_key), RoundType::VotingRound), Error::::VotingRoundNotStarted ); - ensure!( - !ProjectsInDispute::::get(project_key).contains(&milestone_key), - Error::::MilestonesAlreadyInDispute - ); let contribution_amount = project .contributions diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index d57d631c..e3441edc 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -446,27 +446,40 @@ pub mod pallet { for (ms_key, mut ms) in project.milestones.iter_mut() { if ms.can_refund && ms.transfer_status.is_none() { for (refund_location, percent_share) in &project.refund_locations { - let amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); + let milestone_amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); + let total_amount = percent_share.mul_floor(milestone_amount); + let fee = ::ImbueFee::get().mul_floor(total_amount); + let refund_amount = total_amount.saturating_sub(fee); + match refund_location { Locality::Local(acc) => { T::MultiCurrency::transfer( project.currency_id, &project_account, &acc, - amount, + refund_amount, )?; }, Locality::Foreign(multilocation) => { T::ExternalRefundHandler::send_refund_message_to_treasury( // TODO: change this to reference so that we dont have to clone.... project_account.clone(), - amount, + refund_amount, project.currency_id, *multilocation, )?; } } - total_refunded = total_refunded.saturating_add(amount); + + // Take the fee and send to ImbueFeeAccount + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &::ImbueFeeAccount::get(), + fee, + )?; + + total_refunded = total_refunded.saturating_add(total_amount); } ms.transfer_status = Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()}); } diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index 3464e5d5..8027f7fa 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -307,4 +307,10 @@ fn refund_then_withdraw_doesnt_double_spend() { }) } +#[test] +fn failed_dispute_tests() { + build_test_externality().execute_with(|| { + assert!(false) + }) +} diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 4adfb9c4..1b69f5a3 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -763,6 +763,8 @@ fn withdraw_takes_imbue_fee() { .unwrap(); let milestone_key = 0; let fee_account: AccountId = ::ImbueFeeAccount::get(); + let fee_account_balance_before = ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account); + let _ = Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) .unwrap(); @@ -778,8 +780,10 @@ fn withdraw_takes_imbue_fee() { project_key )); let expected_fee = ::ImbueFee::get().mul_floor(10_000); + let fee_account_balance_after = ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account); + assert_eq!( - ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account), + fee_account_balance_after - fee_account_balance_before, expected_fee, "fee hasnt been taken out of project as expected." ); @@ -952,60 +956,45 @@ fn withdraw_fails_before_approval() { }); } -#[test] -#[test] -fn convert_to_proposal_too_many_refund_locations() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} - -#[test] -fn convert_to_proposal_too_many_jury_members() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} - -#[test] -fn fund_project_success() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} +// #[test] +// fn fund_project_success() { +// build_test_externality().execute_with(|| { +// assert!(false); +// }); +// } -#[test] -fn fund_project_not_enough_to_reserve() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} -#[test] -fn try_convert_to_milestones_too_many_milestones() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} +// #[test] +// fn fund_project_not_enough_to_reserve() { +// build_test_externality().execute_with(|| { +// assert!(false); +// }); +// } +// #[test] +// fn try_convert_to_milestones_too_many_milestones() { +// build_test_externality().execute_with(|| { +// assert!(false); +// }); +// } -#[test] -fn try_convert_to_milestones_works() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} +// #[test] +// fn try_convert_to_milestones_works() { +// build_test_externality().execute_with(|| { +// assert!(false); +// }); +// } -#[test] -fn convert_contributions_to_refund_locations_works() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} +// #[test] +// fn convert_contributions_to_refund_locations_works() { +// build_test_externality().execute_with(|| { +// assert!(false); +// }); +// } -fn convert_contributions_to_refund_locations_uses_treasury_for_dust_clearance() { - build_test_externality().execute_with(|| { - assert!(false); - }); -} +// fn convert_contributions_to_refund_locations_uses_treasury_for_dust_clearance() { +// build_test_externality().execute_with(|| { +// assert!(false); +// }); +// } fn close_voting_round_works() { build_test_externality().execute_with(|| { diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 08e08536..87c84c3f 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -1,9 +1,49 @@ use frame_support::{assert_noop, assert_ok}; use crate::{mock::*, *}; use test_utils::*; +use pallet_disputes::DisputeResult; #[test] fn you_can_actually_refund_after_dispute_success() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + // All milestones should be good for refund + + assert_ok!(Proposals::refund(RuntimeOrigin::signed(*BOB), project_key)); + }) +} + + +#[test] +fn refund_not_contributor() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + assert_noop!(Proposals::refund(RuntimeOrigin::signed(*DAVE), project_key), Error::::OnlyContributorsCanInitiateRefund); + }) +} + +#[test] +fn refund_deletes_project_when_all_funds_are_refunded() { build_test_externality().execute_with(|| { }) @@ -29,6 +69,34 @@ fn refund_check_refund_amount() { #[test] fn refund_takes_imbue_fee() { build_test_externality().execute_with(|| { + let bob_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let fee_account_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &::ImbueFeeAccount::get()); + let per_contribution = 500000u64; + + let contributions = get_contributions::(vec![*BOB, *CHARLIE], per_contribution as u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + // All milestones should be good for refund + + assert_ok!(Proposals::refund(RuntimeOrigin::signed(*BOB), project_key)); + + let bob_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let fee_account_post_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &::ImbueFeeAccount::get()); + let per_fee = ::ImbueFee::get().mul_floor(per_contribution); + // Assert that the fee has been taken from each and transferred to ImbueFeeAccount. + assert_eq!(bob_pre_creation - bob_post_refund, per_fee, "bobs fee hasnt been taken out correctly."); + assert_eq!(charlie_pre_creation - charlie_post_refund, per_fee, "charlies fee hasnt been taken out correctly."); + assert_eq!(fee_account_post_creation - fee_account_pre_creation, per_fee * 2, "total fee hasnt added correctly."); }) } \ No newline at end of file From 4f7ff146bae331c723bfa41ce455bf205570724f Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 18:45:03 +0000 Subject: [PATCH 158/192] another one --- pallets/proposals/src/tests/refunds.rs | 39 ++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 87c84c3f..7fac8589 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -45,7 +45,21 @@ fn refund_not_contributor() { #[test] fn refund_deletes_project_when_all_funds_are_refunded() { build_test_externality().execute_with(|| { - + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + // All milestones should be good for refund + + let _ = Proposals::refund(RuntimeOrigin::signed(*BOB), project_key).unwrap(); + assert!(!Projects::::contains_key(project_key)); }) } @@ -62,7 +76,28 @@ fn refund_only_transfers_milestones_which_havent_been_withdrawn() { #[test] fn refund_check_refund_amount() { build_test_externality().execute_with(|| { - + let bob_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let per_contribution = 100000u64; + let contributions = get_contributions::(vec![*BOB, *CHARLIE], per_contribution as u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + // All milestones should be good for refund + + assert_ok!(Proposals::refund(RuntimeOrigin::signed(*BOB), project_key)); + let bob_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let per_fee = ::ImbueFee::get().mul_floor(per_contribution); + assert_eq!(bob_pre_creation - per_fee, bob_post_refund , "bobo didnt get his money back!!"); + assert_eq!(charlie_pre_creation - per_fee, charlie_post_refund , "charlie didnt get his money back!!"); }) } From 2f83a5cefed6515b6ebbc4ef357cfee691164393 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 19:25:17 +0000 Subject: [PATCH 159/192] marching --- pallets/proposals/src/tests/disputes.rs | 13 +++++ pallets/proposals/src/tests/pallet.rs | 24 +++++++++ pallets/proposals/src/tests/refunds.rs | 68 ++++++++++++++++++++++++- 3 files changed, 104 insertions(+), 1 deletion(-) diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index 8027f7fa..9043b314 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -314,3 +314,16 @@ fn failed_dispute_tests() { }) } +#[test] +fn assert_can_recall_dispute_after_success() { + build_test_externality().execute_with(|| { + }) +} + +#[test] +fn assert_can_recall_dispute_after_failure() { + build_test_externality().execute_with(|| { + }) +} + + diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index 1b69f5a3..d9ee8695 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -956,6 +956,30 @@ fn withdraw_fails_before_approval() { }); } +#[test] +fn withdraw_assert_milestone_state_change() { + build_test_externality().execute_with(|| { + let cont = get_contributions::(vec![*BOB], 100_000); + let prop_milestones = get_milestones(10); + let project_key = + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); + let milestone_key = 0; + assert_noop!( + Proposals::withdraw(RuntimeOrigin::signed(*ALICE), project_key), + Error::::NoAvailableFundsToWithdraw + ); + let _ = + Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key) + .unwrap(); + assert_noop!( + Proposals::withdraw(RuntimeOrigin::signed(*ALICE), project_key), + Error::::NoAvailableFundsToWithdraw + ); + }); +} + + // #[test] // fn fund_project_success() { // build_test_externality().execute_with(|| { diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 7fac8589..2e3192c6 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -23,6 +23,38 @@ fn you_can_actually_refund_after_dispute_success() { }) } +#[test] +fn refund_assert_milestone_state_change() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + // Only dispute some keys so that we can + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + // All milestones should be good for refund + + assert_ok!(Proposals::refund(RuntimeOrigin::signed(*BOB), project_key)); + let project_after_refund = Projects::::get(project_key).unwrap(); + assert_eq!(project_after_refund.refunded_funds, 500_000); + for i in 0u32..10 { + let milestone = project_after_refund.milestones.get(&i).unwrap(); + if i < 5 { + assert!(milestone.can_refund); + assert_eq!(milestone.transfer_status, Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()})); + } else { + assert!(!milestone.can_refund); + assert!(milestone.transfer_status.is_none()); + } + } + }) +} #[test] fn refund_not_contributor() { @@ -63,13 +95,47 @@ fn refund_deletes_project_when_all_funds_are_refunded() { }) } -// The case where a project is in a dispute, and the dispute passes however, a milestone has also been approved +// The case where a project is in a dispute, and the dispute passes however, a milestone has also been approved and withdrawn // before the refund has been called. // Without the proper checks there will be a kind of double spend. #[test] fn refund_only_transfers_milestones_which_havent_been_withdrawn() { build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB], 1_000_000u128); + let milestones = get_milestones(10); + let milestone_key = 0; + let alice_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let bob_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + let _ = Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone()); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + let _ = + Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key).unwrap(); + let _ = Proposals::vote_on_milestone( + RuntimeOrigin::signed(*BOB), + project_key, + milestone_key, + true, + ) + .unwrap(); + // Milestone is approved, withdraw. + assert_ok!(Proposals::withdraw(RuntimeOrigin::signed(*ALICE), project_key)); + let project_after_withdraw = Projects::::get(project_key).unwrap(); + let alice_after_withdraw = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + // Assert that alice has recieved the withdraw. + assert!(alice_after_withdraw > alice_before_creation); + let refund_fee = ::ImbueFee::get().mul_floor(project_after_withdraw.raised_funds - project_after_withdraw.withdrawn_funds); + // Leaves us with 9 milestones left which we will refund. + assert_ok!(Proposals::refund(RuntimeOrigin::signed(*BOB), project_key)); + let bob_after_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + assert_eq!(bob_after_refund, (bob_before_creation - project_after_withdraw.withdrawn_funds - refund_fee), "bobs shizzle aint what it should be."); }) } From f17b8f3f8a344514d261a2b9548e32574e0cde4c Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 19:31:28 +0000 Subject: [PATCH 160/192] my fingers hurt --- pallets/proposals/src/tests/disputes.rs | 36 ++++++++++++++++++++---- pallets/proposals/src/tests/refunds.rs | 37 ++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index 9043b314..f038c939 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -300,12 +300,6 @@ fn raise_dispute_allows_submission() { }) } -#[test] -fn refund_then_withdraw_doesnt_double_spend() { - build_test_externality().execute_with(|| { - assert!(false) - }) -} #[test] fn failed_dispute_tests() { @@ -317,12 +311,42 @@ fn failed_dispute_tests() { #[test] fn assert_can_recall_dispute_after_success() { build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + // Only call the dispute on part. + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); + + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (5u32..10 as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); }) } #[test] fn assert_can_recall_dispute_after_failure() { build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + // Only call the dispute on part. + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); + + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Failure); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (5u32..10 as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); }) } diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 2e3192c6..a9886c34 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -99,7 +99,7 @@ fn refund_deletes_project_when_all_funds_are_refunded() { // before the refund has been called. // Without the proper checks there will be a kind of double spend. #[test] -fn refund_only_transfers_milestones_which_havent_been_withdrawn() { +fn withdraw_then_refund_no_double_spend() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![*BOB], 1_000_000u128); let milestones = get_milestones(10); @@ -139,6 +139,41 @@ fn refund_only_transfers_milestones_which_havent_been_withdrawn() { }) } + +// The reverse case of withdraw_then_refund_no_double_spend +// essentially if a milestone is refunded one cannot withdraw an approved milestone as its already gone. +#[test] +fn refund_then_withdraw_no_double_spend() { + build_test_externality().execute_with(|| { + let contributions = get_contributions::(vec![*BOB], 1_000_000u128); + let milestones = get_milestones(10); + let milestone_key = 0; + let alice_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let bob_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); + let _ = Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone()); + let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + let _ = + Proposals::submit_milestone(RuntimeOrigin::signed(*ALICE), project_key, milestone_key).unwrap(); + + let _ = Proposals::vote_on_milestone( + RuntimeOrigin::signed(*BOB), + project_key, + milestone_key, + true, + ) + .unwrap(); + assert_ok!(Proposals::refund(RuntimeOrigin::signed(*BOB), project_key)); + assert_noop!(Proposals::withdraw(RuntimeOrigin::signed(*ALICE), project_key), Error::::NoAvailableFundsToWithdraw); + }) +} + #[test] fn refund_check_refund_amount() { build_test_externality().execute_with(|| { From 14034b1e960c341ed19079ea2c7e348d4cdb8cf1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 19:46:32 +0000 Subject: [PATCH 161/192] green stuff has appeared! --- pallets/proposals/src/impls/pallet_impls.rs | 7 ++- pallets/proposals/src/tests/disputes.rs | 41 +++++++++--------- pallets/proposals/src/tests/pallet.rs | 48 +-------------------- pallets/proposals/src/todo | 8 ++-- 4 files changed, 32 insertions(+), 72 deletions(-) diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 2927c2b8..bb16cab9 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -176,7 +176,7 @@ impl Pallet { project.withdrawn_funds = project.withdrawn_funds.saturating_add(withdrawable); - if project.withdrawn_funds == project.raised_funds { + if project.withdrawn_funds.saturating_add(project.refunded_funds) == project.raised_funds { ::DepositHandler::return_deposit(project.deposit_id)?; CompletedProjects::::try_mutate( &project.initiator, @@ -334,6 +334,8 @@ impl DisputeHooks for Pallet { DisputeResult::Success => { for milestone_key in specifics.iter() { if let Some(milestone) = project.milestones.get_mut(milestone_key) { + // Shouldnt be needed but nice to have this check. + // Will prevent someone calling both refund and withdraw on the same milestone. if milestone.transfer_status == None { milestone.can_refund = true; } @@ -341,6 +343,7 @@ impl DisputeHooks for Pallet { } }, DisputeResult::Failure => { + // I Guess do nothing.. ProjectsInDispute gets cleared regardless allowing further disputes. }, }; }, @@ -354,6 +357,6 @@ impl DisputeHooks for Pallet { }); // ProjectsInDispute::remove // Projects::mutate - T::DbWeight::get().reads_writes(2, 2) + return T::DbWeight::get().reads_writes(2, 2) } } diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index f038c939..1a211f19 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -177,25 +177,6 @@ fn dispute_success_approves_milestone_for_refund_but_only_ones_specified() { }) } -#[test] -fn dispute_success_returns_non_zero_weight() { - build_test_externality().execute_with(|| { - let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); - let milestones = get_milestones(10); - let project_key = create_and_fund_project::( - *ALICE, - contributions, - milestones.clone(), - CurrencyId::Native, - ).unwrap(); - - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, milestone_keys.clone())); - let weight = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); - assert!(weight != ::zero()); - }) -} - #[test] fn raise_dispute_allows_milestone_voting() { build_test_externality().execute_with(|| { @@ -304,7 +285,27 @@ fn raise_dispute_allows_submission() { #[test] fn failed_dispute_tests() { build_test_externality().execute_with(|| { - assert!(false) + let contributions = get_contributions::(vec![*BOB, *CHARLIE], 1_000_000u128); + let milestones = get_milestones(10); + let milestone_key = 0; + let project_key = create_and_fund_project::( + *ALICE, + contributions, + milestones.clone(), + CurrencyId::Native, + ).unwrap(); + + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(*BOB), project_key, dispute_milestone_keys.clone())); + let _ = complete_dispute::(project_key, dispute_milestone_keys.into_inner(), DisputeResult::Failure); + + // just gonna assert that the milestones arnt approved for refund. + let project_after_refund = Projects::::get(project_key).unwrap(); + for i in 0u32..10 { + let milestone = project_after_refund.milestones.get(&i).unwrap(); + assert!(!milestone.can_refund); + assert!(milestone.transfer_status.is_none()); + } }) } diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index d9ee8695..c6dd6d79 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -979,47 +979,7 @@ fn withdraw_assert_milestone_state_change() { }); } - -// #[test] -// fn fund_project_success() { -// build_test_externality().execute_with(|| { -// assert!(false); -// }); -// } - -// #[test] -// fn fund_project_not_enough_to_reserve() { -// build_test_externality().execute_with(|| { -// assert!(false); -// }); -// } -// #[test] -// fn try_convert_to_milestones_too_many_milestones() { -// build_test_externality().execute_with(|| { -// assert!(false); -// }); -// } - -// #[test] -// fn try_convert_to_milestones_works() { -// build_test_externality().execute_with(|| { -// assert!(false); -// }); -// } - -// #[test] -// fn convert_contributions_to_refund_locations_works() { -// build_test_externality().execute_with(|| { -// assert!(false); -// }); -// } - -// fn convert_contributions_to_refund_locations_uses_treasury_for_dust_clearance() { -// build_test_externality().execute_with(|| { -// assert!(false); -// }); -// } - +#[test] fn close_voting_round_works() { build_test_externality().execute_with(|| { Rounds::::insert((0, 0), RoundType::VotingRound, 100); @@ -1052,8 +1012,4 @@ fn close_voting_round_works() { .unwrap() .is_empty()); }) -} - -// todo: finalise voteof no confidence tests. -// ^^ is connected to making the pallet generic over funding type. -// Todo: assert the last event of each extrinsic/ +} \ No newline at end of file diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index a9624b44..354cf980 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -14,10 +14,10 @@ get jury in each pallet (briefs, grants, crowdfunding.) update the function call in each pallet (jury, TreasuryOrigin, ) code cov check -initiate refund extrinsic -tests! -add total_refunded to withdraw extrinsic -tests for these +initiate refund extrinsic - done +tests! - done +add total_refunded to withdraw extrinsic - done +tests for these - not done Migration for removing NoConfidenceLogic #[pallet::storage] From 49f20291cfb955f72b090e07d776b3f3c9a7ab1a Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 6 Nov 2023 22:01:40 +0000 Subject: [PATCH 162/192] grants fixes --- pallets/grants/src/lib.rs | 9 +++++++-- pallets/grants/src/mock.rs | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index 8acdb320..055a2491 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -25,7 +25,7 @@ pub use weights::*; #[frame_support::pallet] pub mod pallet { use super::*; - use common_types::{milestone_origin::FundingType, CurrencyId, TreasuryOrigin}; + use common_types::{CurrencyId, TreasuryOrigin}; use frame_support::{pallet_prelude::*, BoundedVec}; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; @@ -97,6 +97,8 @@ pub mod pallet { GrantAlreadyExists, /// There are too many milestones. TooManyMilestones, + /// This is an invalid Treasury origin. + InvalidTreasuryOrigin } #[pallet::call] @@ -140,6 +142,7 @@ pub mod pallet { }) .collect::>(); + let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions); ::IntoProposal::convert_to_proposal( currency_id, contributions, @@ -148,7 +151,9 @@ pub mod pallet { proposed_milestones .try_into() .map_err(|_| Error::::TooManyMilestones)?, - FundingType::Grant(treasury_origin), + refund_locations, + treasury_origin.get_multi_location().map_err(Error::::InvalidTreasuryOrigin)?, + pallet_proposals::FundingPath::WaitForFunding )?; GrantsSubmittedBy::::insert(&submitter, grant_id, ()); diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index 2960c1f5..e2ea1cbe 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -186,11 +186,8 @@ parameter_types! { impl pallet_proposals::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletId = ProposalsPalletId; - type AuthorityOrigin = EnsureRoot; type MultiCurrency = Tokens; type WeightInfo = pallet_proposals::WeightInfo; - // Adding 2 weeks as th expiration time - type MaxWithdrawalExpiration = TwoWeekBlockUnit; type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; From 432ab4c31025312dab48fe290dbd53d43ff654d1 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 7 Nov 2023 10:58:00 +0000 Subject: [PATCH 163/192] fixrs --- libs/common-types/src/milestone_origin.rs | 7 +++---- pallets/grants/src/lib.rs | 24 ++++++++++++----------- pallets/grants/src/mock.rs | 24 +++++++++++++++++++++-- pallets/proposals/src/lib.rs | 2 -- pallets/proposals/src/mock.rs | 2 -- pallets/proposals/src/traits.rs | 21 -------------------- 6 files changed, 38 insertions(+), 42 deletions(-) diff --git a/libs/common-types/src/milestone_origin.rs b/libs/common-types/src/milestone_origin.rs index 9be6d7c3..59a34745 100644 --- a/libs/common-types/src/milestone_origin.rs +++ b/libs/common-types/src/milestone_origin.rs @@ -1,32 +1,31 @@ use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use xcm::latest::{Junction, Junctions::*, MultiLocation}; +use frame_support::{PalletId, sp_runtime::traits::AccountIdConversion}; /// A wrapper around pub trait TreasuryOriginConverter> { fn get_multi_location( &self, - recipiant: AccountId, ) -> Result; } impl> TreasuryOriginConverter for TreasuryOrigin { fn get_multi_location( &self, - recipiant: AccountId, ) -> Result { match &self { TreasuryOrigin::Kusama => Ok(MultiLocation::new( 1, X1(Junction::AccountId32 { - id: recipiant.into(), + id: PalletId(*b"py/trsry").into_account_truncating(), network: None, }), )), TreasuryOrigin::Imbue => Ok(MultiLocation::new( 0, X1(Junction::AccountId32 { - id: recipiant.into(), + id: PalletId(*b"py/trsry").into_account_truncating(), network: None, }), )), diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index 055a2491..0f171883 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -25,11 +25,11 @@ pub use weights::*; #[frame_support::pallet] pub mod pallet { use super::*; - use common_types::{CurrencyId, TreasuryOrigin}; + use common_types::{CurrencyId, TreasuryOrigin, TreasuryOriginConverter}; use frame_support::{pallet_prelude::*, BoundedVec}; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; - use pallet_proposals::{traits::IntoProposal, Contribution, ProposedMilestone}; + use pallet_proposals::{traits::IntoProposal, Contribution, ProposedMilestone, Locality}; use sp_arithmetic::{per_things::Percent, traits::One}; use sp_core::H256; use sp_runtime::Saturating; @@ -98,7 +98,9 @@ pub mod pallet { /// There are too many milestones. TooManyMilestones, /// This is an invalid Treasury origin. - InvalidTreasuryOrigin + InvalidTreasuryOrigin, + /// Too many approvers + TooManyApprovers, } #[pallet::call] @@ -131,28 +133,28 @@ pub mod pallet { let mut contributions = BTreeMap::new(); let _ = assigned_approvers .iter() - .map(|approver_id| { + .for_each(|approver_id| { contributions.insert( approver_id.clone(), Contribution { value: amount_requested / (assigned_approvers.len() as u32).into(), timestamp: frame_system::Pallet::::block_number(), }, - ) - }) - .collect::>(); + ); + }); + + let refund_locations = vec![Locality::from_foreign(treasury_origin.get_multi_location().map_err(|_| Error::::InvalidTreasuryOrigin)?, Percent::from_parts(100u8))]; - let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions); ::IntoProposal::convert_to_proposal( currency_id, - contributions, + contributions.try_into().map_err(|_| Error::::TooManyApprovers)?, grant_id, submitter.clone(), proposed_milestones .try_into() .map_err(|_| Error::::TooManyMilestones)?, - refund_locations, - treasury_origin.get_multi_location().map_err(Error::::InvalidTreasuryOrigin)?, + refund_locations.try_into().map_err(|_| Error::::TooManyApprovers)?, + assigned_approvers.to_vec().try_into().map_err(|_| Error::::TooManyApprovers)?, pallet_proposals::FundingPath::WaitForFunding )?; diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index e2ea1cbe..942cf29e 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -180,7 +180,8 @@ parameter_types! { pub ExpiringProjectRoundsPerBlock: u32 = 100; pub ProjectStorageItem: StorageItem = StorageItem::Project; pub MaxProjectsPerAccount: u16 = 100; - pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); + pub MaxJuryMembers: u32 = 100; + pub FeeAccount: AccountId = *IMBUE_FEE_ACCOUNT; } impl pallet_proposals::Config for Test { @@ -195,11 +196,13 @@ impl pallet_proposals::Config for Test { type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; + type ImbueFeeAccount = FeeAccount; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; type DepositHandler = MockDepositHandler; type ProjectStorageItem = ProjectStorageItem; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; + type MaxJuryMembers = MaxJuryMembers; + type DisputeRaiser = MockDisputeRaiser; } parameter_types! { @@ -229,6 +232,7 @@ impl pallet_identity::Config for Test { pub static ALICE: Lazy = Lazy::new(|| Public::from_raw([125u8; 32])); pub static BOB: Lazy = Lazy::new(|| Public::from_raw([126u8; 32])); pub static CHARLIE: Lazy = Lazy::new(|| Public::from_raw([127u8; 32])); +pub static IMBUE_FEE_ACCOUNT: Lazy = Lazy::new(|| Public::from_raw([127u8; 32])); pub(crate) fn new_test_ext() -> sp_io::TestExternalities { let t = frame_system::GenesisConfig::default() @@ -245,3 +249,19 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { }); ext } + +pub struct MockDisputeRaiser; +impl DisputeRaiser for MockDisputeRaiser { +type DisputeKey = pallet_proposals::ProjectKey; +type SpecificId = pallet_proposals::MilestoneKey; +type MaxJurySize = MaxJuryMembers; +type MaxSpecifics = MaxMilestonesPerProject; + fn raise_dispute( + dispute_key: Self::DisputeKey, + raised_by: AccountId, + jury: BoundedVec, + specific_ids: BoundedVec, + ) -> Result<(), DispatchError> { + Ok(()) + } +} diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index e3441edc..c927776a 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -96,8 +96,6 @@ pub mod pallet { type MilestoneVotingWindow: Get>; /// The minimum percentage of votes, inclusive, that is required for a vote to pass. type PercentRequiredForVoteToPass: Get; - /// The minimum percentage of votes, inclusive, that is required for a vote of no confidence to pass/finalize. - type PercentRequiredForVoteNoConfidenceToPass: Get; /// Maximum number of contributors per project. type MaximumContributorsPerProject: Get; /// Maximum milestones allowed in a project. diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index e4513817..fc14aef0 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -191,7 +191,6 @@ parameter_types! { pub ExpiringProjectRoundsPerBlock: u32 = 100; pub ProjectStorageItem: StorageItems = StorageItems::Project; pub MaxProjectsPerAccount: u16 = 50; - pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); pub MaxJuryMembers: u32 = 100; pub TreasuryFeeAccount: AccountId = *TREASURY; } @@ -213,7 +212,6 @@ impl pallet_proposals::Config for Test { type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; type MaxJuryMembers = MaxJuryMembers; type DisputeRaiser = MockDisputeRaiser; } diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index c7f067d1..0a598b9d 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -41,8 +41,6 @@ pub trait ExternalRefundHandler { currency: CurrencyId, treasury_origin: MultiLocation, ) -> Result<(), DispatchError>; - fn get_treasury_account_id(treasury_origin: TreasuryOrigin) - -> Result; } #[cfg(feature = "std")] @@ -60,11 +58,6 @@ impl ExternalRefundHandler, BalanceOf, Curre ) -> Result<(), DispatchError> { Ok(()) } - fn get_treasury_account_id( - _treasury_account: TreasuryOrigin, - ) -> Result, DispatchError> { - Ok(PalletId(*b"py/trsry").into_account_truncating()) - } } pub struct XcmRefundHandler(T, U); @@ -86,18 +79,4 @@ where let _ = U::transfer(from, currency, amount, location, WeightLimit::Unlimited)?; Ok(()) } - fn get_treasury_account_id( - treasury_origin: TreasuryOrigin, - ) -> Result, DispatchError> { - match treasury_origin { - TreasuryOrigin::Kusama => { - // TODO: make this dynamic so its always correct. - Ok(PalletId(*b"py/trsry").into_account_truncating()) - } - _ => { - // At the moment just supporting kusama but allow this instead of a panic - Ok(PalletId(*b"py/trsry").into_account_truncating()) - } - } - } } From 912926b0f589dccc6579a7c99fc1b47a90d20d45 Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 7 Nov 2023 11:21:54 +0000 Subject: [PATCH 164/192] fix --- Cargo.lock | 1 + pallets/grants/Cargo.toml | 1 + pallets/grants/src/lib.rs | 9 +++++++-- pallets/grants/src/mock.rs | 2 +- pallets/proposals/src/todo | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0fcae96..2ad971b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7005,6 +7005,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-deposits", + "pallet-disputes", "pallet-identity", "pallet-proposals", "pallet-timestamp", diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index ffef7313..6770863e 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -44,6 +44,7 @@ pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = " pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } pallet-proposals = { path = "../proposals" } +pallet-disputes = { path = "../disputes"} common-types = { path = "../../libs/common-types" } common-runtime = { path = "../../runtime/common" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index 0f171883..c8f73a5a 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -104,7 +104,9 @@ pub mod pallet { } #[pallet::call] - impl Pallet { + impl Pallet + where AccountIdOf: Into<[u8; 32]> + { /// Instead of iterating, create a project from the parameters of a grant. #[pallet::call_index(5)] #[pallet::weight(T::WeightInfo::create_and_convert())] @@ -143,7 +145,9 @@ pub mod pallet { ); }); - let refund_locations = vec![Locality::from_foreign(treasury_origin.get_multi_location().map_err(|_| Error::::InvalidTreasuryOrigin)?, Percent::from_parts(100u8))]; + + let treasury_multilocation = >>::get_multi_location(&treasury_origin).map_err(|_| Error::::InvalidTreasuryOrigin)?; + let refund_locations = vec![(Locality::Foreign(treasury_multilocation), Percent::from_parts(100u8))]; ::IntoProposal::convert_to_proposal( currency_id, @@ -151,6 +155,7 @@ pub mod pallet { grant_id, submitter.clone(), proposed_milestones + .to_vec() .try_into() .map_err(|_| Error::::TooManyMilestones)?, refund_locations.try_into().map_err(|_| Error::::TooManyApprovers)?, diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index 942cf29e..c6c18081 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -251,7 +251,7 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { } pub struct MockDisputeRaiser; -impl DisputeRaiser for MockDisputeRaiser { +impl pallet_disputes::traits::DisputeRaiser for MockDisputeRaiser { type DisputeKey = pallet_proposals::ProjectKey; type SpecificId = pallet_proposals::MilestoneKey; type MaxJurySize = MaxJuryMembers; diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index 354cf980..b57b20c2 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -9,7 +9,7 @@ update change withdraw to uses can_withdraw - done benchmark for hooks to return weight. - done didnt need, we can do it directly in the method. removal of old no confidence logic. - done -fix all tests - +fix all tests - done get jury in each pallet (briefs, grants, crowdfunding.) update the function call in each pallet (jury, TreasuryOrigin, ) code cov check From 8f4cd1706e20ddb88e2136c930ea3759c4cb199a Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 8 Nov 2023 10:22:06 +0000 Subject: [PATCH 165/192] optimise refund extrinsics --- pallets/briefs/src/lib.rs | 25 ++++++++-- pallets/proposals/src/benchmarking.rs | 39 +++++++++++++-- pallets/proposals/src/lib.rs | 71 ++++++++++++++------------- 3 files changed, 92 insertions(+), 43 deletions(-) diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index 61503c19..b910521b 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -84,7 +84,7 @@ pub mod pallet { type BriefStorageItem: Get>; type DepositHandler: DepositHandler, AccountIdOf>; /// The jury size of each brief as selected by JurySelector. - type StandardJurySize: Get + type StandardJurySize: Get /// The type that selects a list of jury members. type JurySelector: SelectJury>; /// The weight info for the extrinsics. @@ -152,6 +152,8 @@ pub mod pallet { FreelancerApprovalRequired, /// Milestones total do not add up to 100%. MilestonesTotalPercentageMustEqual100, + /// too many milestones here mate fixed with https://github.com/ImbueNetwork/imbue/issues/267 + } #[pallet::call] @@ -296,13 +298,28 @@ pub mod pallet { let contributions = BriefContributions::::get(brief_id); ::DepositHandler::return_deposit(brief.deposit_id)?; + fn convert_to_proposal( + currency_id: CurrencyId, + current_contribution: BoundedBTreeMap, Self::MaximumContributorsPerProject>, + brief_hash: H256, + benificiary: AccountId, + milestones: BoundedVec, + refund_locations: BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>, + jury: BoundedVec, + on_creation_funding: FundingPath, + ) -> Result<(), DispatchError>; + + let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners))?; + ::IntoProposal::convert_to_proposal( brief.currency_id, - contributions.into_inner(), + contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?, brief_id, brief.applicant, - brief.milestones.into(), - FundingType::Brief, + brief.milestones.to_vec().try_into().map_err(|_|Error::::), + refund_locations, + ::select_jury(::StandardJurySize::get()), + FundingPath::TakeFromReserved, )?; BriefContributions::::remove(brief_id); diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 49d03480..0164156e 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -1,5 +1,4 @@ #![cfg(feature = "runtime-benchmarks")] - use super::*; use crate::test_utils::*; use crate::Pallet as Proposals; @@ -29,7 +28,7 @@ mod benchmarks { create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let contributions = get_contributions::(vec![alice], 100_000_000_000_000_000u128); let prop_milestones = get_max_milestones::(); - let project_key = create_project::( + let project_key = create_and_fund_project::( bob.clone(), contributions, prop_milestones, @@ -50,7 +49,7 @@ mod benchmarks { // TODO: should update the contributors list to have maximum available length let contributions = get_contributions::(vec![bob.clone()], 100_000_000_000_000_000u128); let prop_milestones = get_max_milestones::(); - let project_key = create_project::( + let project_key = create_and_fund_project::( alice.clone(), z contributions, prop_milestones, @@ -83,7 +82,7 @@ mod benchmarks { let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); - let project_key = create_project::( + let project_key = create_and_fund_project::( alice.clone(), contributions, prop_milestones, @@ -137,6 +136,38 @@ mod benchmarks { } } + #[benchmark] + fn withdraw() { + let alice: T::AccountId = + create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = + create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); + let contributions = get_contributions::(vec![bob.clone()], 100_000_000_000_000_000u128); + let raised_funds: BalanceOf = 100_000_000_000_000_000u128.saturated_into(); + + let milestone_count = ::MaxMilestonesPerProject::get(); + let prop_milestones = get_milestones(milestone_count as u8); + + let project_key = create_and_fund_project::( + alice.clone(), + contributions, + prop_milestones, + CurrencyId::Native, + ); + + // All the milestones are approved now + let fee: BalanceOf = ::ImbueFee::get().mul_floor(raised_funds); + let refunded: BalanceOf = raised_funds.saturating_sub(fee); + + #[extrinsic_call] + withdraw(RawOrigin::Signed(alice.clone()), project_key); + assert_last_event::( + Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native) + .into(), + ); + } + + impl_benchmark_test_suite!( Proposals, crate::mock::build_test_externality(), diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index c927776a..bcad6475 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -435,54 +435,55 @@ pub mod pallet { let who = ensure_signed(origin)?; let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanInitiateRefund); - - let mut total_refunded: BalanceOf = Zero::zero(); let project_account = Self::project_account_id(project_key); Projects::::try_mutate_exists(project_key, |maybe_project|{ if let Some(project) = maybe_project { + let mut total_to_refund_including_fee: BalanceOf = Zero::zero(); + for (ms_key, mut ms) in project.milestones.iter_mut() { if ms.can_refund && ms.transfer_status.is_none() { - for (refund_location, percent_share) in &project.refund_locations { - let milestone_amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); - let total_amount = percent_share.mul_floor(milestone_amount); - let fee = ::ImbueFee::get().mul_floor(total_amount); - let refund_amount = total_amount.saturating_sub(fee); - - match refund_location { - Locality::Local(acc) => { - T::MultiCurrency::transfer( - project.currency_id, - &project_account, - &acc, - refund_amount, - )?; - }, - Locality::Foreign(multilocation) => { - T::ExternalRefundHandler::send_refund_message_to_treasury( - // TODO: change this to reference so that we dont have to clone.... - project_account.clone(), - refund_amount, - project.currency_id, - *multilocation, - )?; - } - } - - // Take the fee and send to ImbueFeeAccount + let milestone_amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); + total_to_refund_including_fee = total_to_refund_including_fee.saturating_add(milestone_amount); + ms.transfer_status = Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()}); + } + } + + let fee = ::ImbueFee::get().mul_floor(total_to_refund_including_fee); + // Take the fee and send to ImbueFeeAccount + T::MultiCurrency::transfer( + project.currency_id, + &project_account, + &::ImbueFeeAccount::get(), + fee, + )?; + + let total_to_refund = total_to_refund_including_fee.saturating_sub(fee); + + for (refund_location, percent_share) in &project.refund_locations { + let per_refund = percent_share.mul_floor(total_to_refund); + match refund_location { + Locality::Local(acc) => { T::MultiCurrency::transfer( project.currency_id, &project_account, - &::ImbueFeeAccount::get(), - fee, + &acc, + per_refund, + )?; + }, + Locality::Foreign(multilocation) => { + T::ExternalRefundHandler::send_refund_message_to_treasury( + // TODO: change this to reference so that we dont have to clone.... + project_account.clone(), + per_refund, + project.currency_id, + *multilocation, )?; - - total_refunded = total_refunded.saturating_add(total_amount); } - ms.transfer_status = Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()}); } + } - project.refunded_funds = project.refunded_funds.saturating_add(total_refunded); + project.refunded_funds = project.refunded_funds.saturating_add(total_to_refund_including_fee); if project.refunded_funds.saturating_add(project.withdrawn_funds) == project.raised_funds { *maybe_project = None; } From b60cd35ce398600a67707f2d177e3e4f1030af8e Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 8 Nov 2023 11:06:39 +0000 Subject: [PATCH 166/192] add non zero arith check, deposit event, refund benchmark --- pallets/proposals/src/benchmarking.rs | 22 ++++++++++++++-------- pallets/proposals/src/lib.rs | 8 ++++++++ pallets/proposals/src/tests/refunds.rs | 1 + 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 0164156e..62b9a9c8 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -137,16 +137,23 @@ mod benchmarks { } #[benchmark] - fn withdraw() { + fn refund() { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = - create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); - let contributions = get_contributions::(vec![bob.clone()], 100_000_000_000_000_000u128); - let raised_funds: BalanceOf = 100_000_000_000_000_000u128.saturated_into(); + create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); + + let contributors: Vec = (0..::MaximumContributorsPerProject::get()).map(|i| { + create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128); + }).collect(); + dbg!(&contributors); + assert!(false); + + let contributions = get_contributions::(contributors, 100_000_000_000_000_000u128); let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..prop_milestones.len() as u32).collect::>().try_into().unwrap(); let project_key = create_and_fund_project::( alice.clone(), @@ -155,12 +162,11 @@ mod benchmarks { CurrencyId::Native, ); - // All the milestones are approved now - let fee: BalanceOf = ::ImbueFee::get().mul_floor(raised_funds); - let refunded: BalanceOf = raised_funds.saturating_sub(fee); + assert_ok!(crate::Pallet::::raise_dispute(RawOrigin::Signed(bob.clone()), project_key, milestone_keys)); + let _ = as DisputeHooks>::on_dispute_complete(project_key, milestone_keys.into_inner(), DisputeResult::Success); #[extrinsic_call] - withdraw(RawOrigin::Signed(alice.clone()), project_key); + refund(RawOrigin::Signed(bob.clone()), project_key); assert_last_event::( Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native) .into(), diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index bcad6475..5eeb0940 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -242,6 +242,8 @@ pub mod pallet { NoConfidenceRoundFinalised(T::AccountId, ProjectKey), /// This milestone has been rejected. MilestoneRejected(ProjectKey, MilestoneKey), + /// A project has been refunded either partially or completely. + ProjectRefunded{project_key: ProjectKey, total_amount: BalanceOf}, } // Errors inform users that something went wrong. @@ -449,6 +451,9 @@ pub mod pallet { } } + // Just so we dont multiply by zero. + ensure!(total_to_refund_including_fee != Zero::zero(), Error::::NoAvailableFundsToWithdraw); + let fee = ::ImbueFee::get().mul_floor(total_to_refund_including_fee); // Take the fee and send to ImbueFeeAccount T::MultiCurrency::transfer( @@ -487,11 +492,14 @@ pub mod pallet { if project.refunded_funds.saturating_add(project.withdrawn_funds) == project.raised_funds { *maybe_project = None; } + + Self::deposit_event(Event::::ProjectRefunded {project_key, total_amount: total_to_refund_including_fee}); Ok::<(), DispatchError>(()) } else { Ok::<(), DispatchError>(()) } })?; + Ok(().into()) } } diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index a9886c34..8cc29a61 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -3,6 +3,7 @@ use crate::{mock::*, *}; use test_utils::*; use pallet_disputes::DisputeResult; + #[test] fn you_can_actually_refund_after_dispute_success() { build_test_externality().execute_with(|| { From 0ff2be7b2fb2fa938c223269b35ac65330e17417 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 8 Nov 2023 11:14:58 +0000 Subject: [PATCH 167/192] fix --- pallets/proposals/src/benchmarking.rs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 62b9a9c8..68c85ba6 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -12,9 +12,13 @@ use sp_runtime::SaturatedConversion; use sp_runtime::Saturating; use sp_std::convert::TryInto; +use pallet_disputes::DisputeResult; +use pallet_disputes::traits::DisputeHooks; + #[benchmarks( where ::AccountId: AsRef<[u8]>, ::BlockNumber: From, + BalanceOf: From, )] mod benchmarks { @@ -33,7 +37,7 @@ mod benchmarks { contributions, prop_milestones, CurrencyId::Native, - ); + ).unwrap(); #[extrinsic_call] submit_milestone(RawOrigin::Signed(bob), project_key, 0); @@ -51,10 +55,10 @@ mod benchmarks { let prop_milestones = get_max_milestones::(); let project_key = create_and_fund_project::( alice.clone(), - z contributions, + contributions, prop_milestones, CurrencyId::Native, - ); + ).unwrap(); assert_ok!(Proposals::::submit_milestone( RawOrigin::Signed(alice).into(), @@ -87,7 +91,7 @@ mod benchmarks { contributions, prop_milestones, CurrencyId::Native, - ); + ).unwrap(); for milestone_key in 0..milestone_count { // The initiator submits a milestone @@ -144,31 +148,33 @@ mod benchmarks { create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); let contributors: Vec = (0..::MaximumContributorsPerProject::get()).map(|i| { - create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128); + create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128) }).collect(); dbg!(&contributors); assert!(false); let contributions = get_contributions::(contributors, 100_000_000_000_000_000u128); + let total_amount = 100_000_000_000_000_000u128 * ::MaximumContributorsPerProject::get() as u128; let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..prop_milestones.len() as u32).collect::>().try_into().unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..prop_milestones.len() as u32).collect::>().try_into().unwrap(); let project_key = create_and_fund_project::( alice.clone(), contributions, prop_milestones, CurrencyId::Native, - ); + ).unwrap(); + + assert_ok!(crate::Pallet::::raise_dispute(RawOrigin::Signed(bob.clone()).into(), project_key, milestone_keys.clone())); + let _ = as DisputeHooks>::on_dispute_complete(project_key, milestone_keys.into_inner(), DisputeResult::Success); - assert_ok!(crate::Pallet::::raise_dispute(RawOrigin::Signed(bob.clone()), project_key, milestone_keys)); - let _ = as DisputeHooks>::on_dispute_complete(project_key, milestone_keys.into_inner(), DisputeResult::Success); #[extrinsic_call] refund(RawOrigin::Signed(bob.clone()), project_key); assert_last_event::( - Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native) + Event::::ProjectRefunded{project_key, total_amount: total_amount.into()} .into(), ); } From bbf3d30d728e8a986b943b065a943af888b2768e Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 8 Nov 2023 11:27:39 +0000 Subject: [PATCH 168/192] raise dispute benchmark --- pallets/proposals/src/benchmarking.rs | 36 ++++++++++++++++++++++++--- pallets/proposals/src/lib.rs | 2 ++ pallets/proposals/src/weights.rs | 21 ++++++++++++++++ 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 68c85ba6..b7496012 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -18,7 +18,7 @@ use pallet_disputes::traits::DisputeHooks; #[benchmarks( where ::AccountId: AsRef<[u8]>, ::BlockNumber: From, - BalanceOf: From, + BalanceOf: From, )] mod benchmarks { @@ -141,7 +141,7 @@ mod benchmarks { } #[benchmark] - fn refund() { + fn raise_dispute() { let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = @@ -167,14 +167,42 @@ mod benchmarks { CurrencyId::Native, ).unwrap(); + #[extrinsic_call] + raise_dispute(RawOrigin::Signed(bob.clone()), project_key, milestone_keys.clone()); + } + + + #[benchmark] + fn refund() { + let alice: T::AccountId = + create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = + create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); + + let contributors: Vec = (0..::MaximumContributorsPerProject::get()).map(|i| { + create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128) + }).collect(); + + let contributions = get_contributions::(contributors, 100_000_000_000u128); + let total_amount = 100_000_000_000u128 * ::MaximumContributorsPerProject::get() as u128; + let milestone_count = ::MaxMilestonesPerProject::get(); + let prop_milestones = get_milestones(milestone_count as u8); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..prop_milestones.len() as u32).collect::>().try_into().unwrap(); + + let project_key = create_and_fund_project::( + alice.clone(), + contributions, + prop_milestones, + CurrencyId::Native, + ).unwrap(); + assert_ok!(crate::Pallet::::raise_dispute(RawOrigin::Signed(bob.clone()).into(), project_key, milestone_keys.clone())); let _ = as DisputeHooks>::on_dispute_complete(project_key, milestone_keys.into_inner(), DisputeResult::Success); - #[extrinsic_call] refund(RawOrigin::Signed(bob.clone()), project_key); assert_last_event::( - Event::::ProjectRefunded{project_key, total_amount: total_amount.into()} + Event::::ProjectRefunded{project_key, total_amount: (total_amount as u64).into()} .into(), ); } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 5eeb0940..ca8d4e9e 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -793,4 +793,6 @@ pub trait WeightInfoT { fn vote_on_milestone() -> Weight; fn withdraw() -> Weight; fn on_initialize() -> Weight; + fn raise_dispute() -> Weight; + fn refund() -> Weight; } diff --git a/pallets/proposals/src/weights.rs b/pallets/proposals/src/weights.rs index 26d6d98c..3242d9c9 100644 --- a/pallets/proposals/src/weights.rs +++ b/pallets/proposals/src/weights.rs @@ -113,4 +113,25 @@ impl crate::WeightInfoT for WeightInfo { .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) } + + fn refund() -> Weight { + // Proof Size summary in bytes: + // Measured: `97` + // Estimated: `3936` + // Minimum execution time: 6_577_000 picoseconds. + Weight::from_parts(6_907_000, 0) + .saturating_add(Weight::from_parts(0, 3936)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(4)) + } + fn raise_dispute() -> Weight { + // Proof Size summary in bytes: + // Measured: `97` + // Estimated: `3936` + // Minimum execution time: 6_577_000 picoseconds. + Weight::from_parts(6_907_000, 0) + .saturating_add(Weight::from_parts(0, 3936)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(4)) + } } From 53e398eb46411f938ffb1ebba3c4f6aa87c9cf88 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 9 Nov 2023 13:12:26 +0000 Subject: [PATCH 169/192] migration madness --- pallets/proposals/src/lib.rs | 4 +- pallets/proposals/src/migration.rs | 103 +++++++++++++++++++---------- pallets/proposals/src/todo | 6 +- pallets/proposals/src/traits.rs | 2 +- 4 files changed, 76 insertions(+), 39 deletions(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index ca8d4e9e..b875f735 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -102,8 +102,6 @@ pub mod pallet { type MaxMilestonesPerProject: Get; /// Maximum project a user can submit, make sure its pretty big. type MaxProjectsPerAccount: Get; - /// Maximum size of the accounts responsible for handling disputes. - type MaxJuryMembers: Get; /// The maximum projects to be dealt with per block. Must be small as is dealt with in the hooks. type ExpiringProjectRoundsPerBlock: Get; /// Imbue fee in percent 0-99 @@ -118,6 +116,8 @@ pub mod pallet { type ProjectStorageItem: Get>; /// The trait that handler the raising of a dispute. type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxJurySize = Self::MaxJuryMembers, MaxSpecifics = Self::MaxMilestonesPerProject>; + /// Maximum jury members, usually defined elsewhere. + type MaxJuryMembers: Get; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 60121d1f..2f2b6422 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -1,8 +1,9 @@ use crate::*; use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; - use frame_system::pallet_prelude::BlockNumberFor; + +use common_types::TreasuryOriginConverter; use pallet_fellowship::traits::SelectJury; pub use pallet::*; @@ -168,7 +169,7 @@ mod v2 { pub approved_for_funding: bool, pub funding_threshold_met: bool, pub cancelled: bool, - pub funding_type: FundingType, + pub funding_type: v5::FundingType, } #[derive(Clone, Debug, Encode, Decode, TypeInfo)] @@ -211,7 +212,7 @@ mod v2 { funding_threshold_met: project.funding_threshold_met, cancelled: project.cancelled, raised_funds: project.raised_funds, - funding_type: FundingType::Proposal, + funding_type: v5::FundingType::Proposal, }; Some(migrated_project) }); @@ -234,7 +235,7 @@ pub mod v3 { #[derive(Encode, Decode, Clone)] pub struct ProjectV3 { pub agreement_hash: H256, - pub milestones: BTreeMap, + pub milestones: BTreeMap, pub contributions: BTreeMap>, pub currency_id: common_types::CurrencyId, pub withdrawn_funds: Balance, @@ -242,7 +243,7 @@ pub mod v3 { pub initiator: AccountId, pub created_on: BlockNumber, pub cancelled: bool, - pub funding_type: FundingType, + pub funding_type: v5::FundingType, } pub fn migrate_contribution_and_project( @@ -252,7 +253,7 @@ pub mod v3 { let mut migrated_contributions = BTreeMap::new(); let mut migrated_milestones = BTreeMap::new(); - Projects::::translate(|_project_key, project: v2::ProjectV2Of| { + v6::Projects::::translate(|_project_key, project: v2::ProjectV2Of| { project.contributions.iter().for_each(|(key, cont)| { *weight += T::DbWeight::get().reads_writes(1, 1); migrated_contributions.insert( @@ -267,7 +268,7 @@ pub mod v3 { *weight += T::DbWeight::get().reads_writes(1, 1); migrated_milestones.insert( *key, - Milestone { + v6::V6Milestone { project_key: milestone.project_key, milestone_key: milestone.milestone_key, percentage_to_unlock: Percent::from_percent( @@ -277,14 +278,14 @@ pub mod v3 { }, ); }); - let bounded_milestone: Result, _> = + let bounded_milestone: Result, _> = migrated_milestones.clone().try_into(); let bounded_contributions: Result, _> = migrated_contributions.clone().try_into(); if let Ok(ms) = bounded_milestone { if let Ok(cont) = bounded_contributions { *weight += T::DbWeight::get().reads_writes(1, 1); - let migrated_project: Project = Project { + let migrated_project: v6::Project = Project { milestones: ms, contributions: cont, currency_id: project.currency_id, @@ -294,7 +295,7 @@ pub mod v3 { agreement_hash: Default::default(), cancelled: project.cancelled, raised_funds: project.raised_funds, - funding_type: FundingType::Proposal, + funding_type: v5::FundingType::Proposal, // A deposit_id of u32::MAX is ignored. deposit_id: u32::MAX.into(), }; @@ -508,7 +509,7 @@ pub mod v5 { pub enum FundingType { Proposal, Brief, - Grant(TreasuryOrigin), + Grant(common_types::TreasuryOrigin), } /// 1: Custom StorageVersion is removed, macro StorageVersion is used: https://github.com/ImbueNetwork/imbue/issues/178 @@ -569,9 +570,21 @@ pub mod v5 { pub mod v6 { use super::*; - pub struct ProjectV6 { + pub(crate) type V6BoundedBTreeMilestones = BoundedBTreeMap::MaxMilestonesPerProject>; + + #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + pub(crate) struct V6Milestone { + pub project_key: ProjectKey, + pub milestone_key: MilestoneKey, + pub percentage_to_unlock: Percent, + pub is_approved: bool, + } + + #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] + #[scale_info(skip_type_params(T))] + pub(crate) struct ProjectV6 { pub agreement_hash: H256, - pub milestones: BoundedBTreeMilestones, + pub milestones: V6BoundedBTreeMilestones, pub contributions: ContributionsFor, pub currency_id: common_types::CurrencyId, pub withdrawn_funds: BalanceOf, @@ -579,12 +592,12 @@ pub mod v6 { pub initiator: AccountIdOf, pub created_on: BlockNumberFor, pub cancelled: bool, - pub funding_type: FundingType, + pub funding_type: v5::FundingType, pub deposit_id: DepositIdOf, } #[storage_alias] - pub type Projects = StorageMap<_, Identity, ProjectKey, ProjectV6, OptionQuery>; + pub type Projects = StorageMap, Identity, ProjectKey, ProjectV6, OptionQuery>; #[storage_alias] pub(super) type MilestoneVotes = StorageDoubleMap< @@ -710,10 +723,11 @@ pub mod v6 { } pub mod v7 { + use super::*; - struct MigrateToV7(T, U); + struct MigrateToV7>>(T, U); - impl OnRuntimeUpgrade for MigrateToV7 { + impl>> OnRuntimeUpgrade for MigrateToV7 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); @@ -734,7 +748,7 @@ pub mod v7 { let onchain = as GetStorageVersion>::on_chain_storage_version(); if current == 7 && onchain == 6 { - migrate_new_fields::() + migrate_new_fields::(&mut weight); current.put::>(); log::warn!("v7 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); @@ -760,30 +774,50 @@ pub mod v7 { } } - fn migrate_new_fields(weight &mut Weight) { + fn migrate_new_fields>>(weight: &mut Weight) { v6::Projects::::drain().for_each(|(key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); let on_creation_funding = match project.funding_type { - Proposal => crate::FundingPath::TakeFromReserved, - Brief => crate::FundingPath::TakeFromReserved, - Grant(_) => crate::FundingPath::WaitForFunding, - } + v5::FundingType::Proposal => crate::FundingPath::TakeFromReserved, + v5::FundingType::Brief => crate::FundingPath::TakeFromReserved, + v5::FundingType::Grant(_) => crate::FundingPath::WaitForFunding, + }; - let jury = ::select_jury(::MaxJuryMembers::get()); + let jury = >>::select_jury(::MaxJuryMembers::get()); - let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match funding.funding_type { - Proposal => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), - Brief => crate::Pallet::::convert_contributions_to_refund_locations(project.contributions), - Grant(treasury_origin) => { - let beneficiary = PalletId(*b"py/trsry").into_account_truncating(); - Vec::from((Locality(treasury_origin.get_multi_location(beneficiary)), Percent::from_parts(100))).try_into().expect("1 is lower than bound; qed") + let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match project.funding_type { + v5::FundingType::Proposal => crate::Pallet::::convert_contributions_to_refund_locations(&project.contributions), + v5::FundingType::Brief => crate::Pallet::::convert_contributions_to_refund_locations(&project.contributions), + v5::FundingType::Grant(treasury_origin) => { + Vec::from((Locality::Foreign(treasury_origin.get_multi_location()), Percent::from_parts(100))).try_into().expect("1 is lower than bound if it isnt then the system is broken anyway; qed") }, }; + let mut new_milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); + project.milestones.iter().for_each(|ms_key, ms: v6::V6Milestone| { + + // assume that if its approved then its been withdrawn. + let mut transfer_status: Option>> = None; + if ms.is_approved { + transfer_status = Some(TransferStatus::Withdraw{on: frame_system::Pallet::::block_number()}); + } + + let new_ms = crate::Milestone { + project_key: ms.project_key, + milestone_key: ms.milestone_key, + percentage_to_unlock: ms.percentage_to_unlock, + is_approved: ms.is_approved, + can_refund: false, + transfer_status + }; + // This only fails if the bound has been reduced and the old milestones were at max which is unlikely. + new_milestones.try_push(new_ms).expect("If this fails in try_runtime we have an issue. Dont reduce bound of milestones."); + }); + let migrated_project = crate::Project { agreement_hash: project.agreement_hash, - milestones: project.milestones, + milestones: new_milestones, contributions: project.contributions, currency_id: project.currency_id, withdrawn_funds: project.withdrawn_funds, @@ -793,8 +827,9 @@ pub mod v7 { cancelled: project.cancelled, deposit_id: project.deposit_id, refund_locations, - jury.try_into().expect("MaxJuryMembers is used in bound and creation; qed"), + jury: jury.try_into().expect("MaxJuryMembers is used in bound and creation; qed"), on_creation_funding, + refunded_funds: Zero::zero(), }; *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -952,7 +987,7 @@ mod test { ); assert_eq!(H256::default(), migrated_project.agreement_hash); - assert_eq!(FundingType::Proposal, migrated_project.funding_type); + assert_eq!(v5::FundingType::Proposal, migrated_project.funding_type); }) } @@ -1017,7 +1052,7 @@ mod test { approved_for_funding: false, funding_threshold_met: false, cancelled: false, - funding_type: FundingType::Brief, + funding_type: v5::FundingType::Brief, }; v2::Projects::::insert(0, &project); v3::UserVotes::::insert((*ALICE, 10u32, 10u32, v3::RoundType::VotingRound), true); diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index b57b20c2..515f0181 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -1,6 +1,6 @@ raise-dispute extrinsic. - done tests for above implementation. - done?? check code cov -benchmark for raise dispute extrinsic +benchmark for raise dispute extrinsic -done ALLOW VOTING ON SUBMITTED MILESTONE - done make sure when raising a dispute you cannot raise it on approved milestones. - done OnDisputeCompleteHooks. @@ -14,10 +14,12 @@ get jury in each pallet (briefs, grants, crowdfunding.) update the function call in each pallet (jury, TreasuryOrigin, ) code cov check + initiate refund extrinsic - done +benchmark refund - done tests! - done add total_refunded to withdraw extrinsic - done -tests for these - not done +tests for these - done Migration for removing NoConfidenceLogic #[pallet::storage] diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 0a598b9d..1c51104e 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -12,7 +12,7 @@ use xcm::latest::{MultiLocation, WeightLimit}; pub trait IntoProposal { type MaximumContributorsPerProject: Get; type MaxMilestonesPerProject: Get; - type MaxJuryMembers: Get; + type MaxJuryMembers: Get; /// Convert the propoerties of a project into a project. /// This is the main method when wanting to use pallet_proposals and is how one configures a project. fn convert_to_proposal( From 70c8e70898bd71908cba38ef38fb88f1153fb971 Mon Sep 17 00:00:00 2001 From: f-gate Date: Sun, 12 Nov 2023 17:00:16 +0000 Subject: [PATCH 170/192] fix migration and tests --- pallets/proposals/src/lib.rs | 4 +-- pallets/proposals/src/migration.rs | 47 +++++++++++++++++++++--------- pallets/proposals/src/traits.rs | 2 +- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index b875f735..215feb52 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -38,7 +38,7 @@ pub(crate) mod tests; pub mod weights; pub use weights::*; -//pub mod migration; +pub mod migration; pub mod impls; @@ -117,7 +117,7 @@ pub mod pallet { /// The trait that handler the raising of a dispute. type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxJurySize = Self::MaxJuryMembers, MaxSpecifics = Self::MaxMilestonesPerProject>; /// Maximum jury members, usually defined elsewhere. - type MaxJuryMembers: Get; + type MaxJuryMembers: Get; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 2f2b6422..2cf4a44a 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -3,7 +3,7 @@ use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; use frame_system::pallet_prelude::BlockNumberFor; -use common_types::TreasuryOriginConverter; +use common_types::{TreasuryOriginConverter, TreasuryOrigin}; use pallet_fellowship::traits::SelectJury; pub use pallet::*; @@ -285,7 +285,7 @@ pub mod v3 { if let Ok(ms) = bounded_milestone { if let Ok(cont) = bounded_contributions { *weight += T::DbWeight::get().reads_writes(1, 1); - let migrated_project: v6::Project = Project { + let migrated_project: v6::ProjectV6 = v6::ProjectV6 { milestones: ms, contributions: cont, currency_id: project.currency_id, @@ -570,10 +570,10 @@ pub mod v5 { pub mod v6 { use super::*; - pub(crate) type V6BoundedBTreeMilestones = BoundedBTreeMap::MaxMilestonesPerProject>; + pub type V6BoundedBTreeMilestones = BoundedBTreeMap::MaxMilestonesPerProject>; #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] - pub(crate) struct V6Milestone { + pub struct V6Milestone { pub project_key: ProjectKey, pub milestone_key: MilestoneKey, pub percentage_to_unlock: Percent, @@ -582,7 +582,7 @@ pub mod v6 { #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] - pub(crate) struct ProjectV6 { + pub struct ProjectV6 { pub agreement_hash: H256, pub milestones: V6BoundedBTreeMilestones, pub contributions: ContributionsFor, @@ -727,12 +727,17 @@ pub mod v7 { struct MigrateToV7>>(T, U); - impl>> OnRuntimeUpgrade for MigrateToV7 { + impl>> OnRuntimeUpgrade for MigrateToV7 + where AccountIdOf: Into<[u8; 32]> + { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); let current = as GetStorageVersion>::current_storage_version(); let onchain = as GetStorageVersion>::on_chain_storage_version(); + + ensure!(::MaxJuryMembers::get() < u8::MAX as u32, "Max jury members must be smaller than u8"); + ensure!( current == 7 && onchain == 6, "Current version must be set to v7 and onchain to v6" @@ -774,7 +779,9 @@ pub mod v7 { } } - fn migrate_new_fields>>(weight: &mut Weight) { + fn migrate_new_fields>>(weight: &mut Weight) + where AccountIdOf: Into<[u8; 32]> + { v6::Projects::::drain().for_each(|(key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -784,23 +791,35 @@ pub mod v7 { v5::FundingType::Grant(_) => crate::FundingPath::WaitForFunding, }; - let jury = >>::select_jury(::MaxJuryMembers::get()); + let jury = >>::select_jury(::MaxJuryMembers::get().try_into().expect("checked in the pre_upgrade.")); let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match project.funding_type { v5::FundingType::Proposal => crate::Pallet::::convert_contributions_to_refund_locations(&project.contributions), v5::FundingType::Brief => crate::Pallet::::convert_contributions_to_refund_locations(&project.contributions), + v5::FundingType::Grant(treasury_origin) => { - Vec::from((Locality::Foreign(treasury_origin.get_multi_location()), Percent::from_parts(100))).try_into().expect("1 is lower than bound if it isnt then the system is broken anyway; qed") + let multilocation = match treasury_origin { + TreasuryOrigin::Kusama => { + >>::get_multi_location(&treasury_origin).expect("known good.") + }, + TreasuryOrigin::Imbue => { + >>::get_multi_location(&treasury_origin).expect("known good.") + }, + TreasuryOrigin::Karura => { + >>::get_multi_location(&TreasuryOrigin::Imbue).expect("known good.") + }, + }; + vec![(Locality::Foreign(multilocation), Percent::from_parts(100))].try_into().expect("1 is lower than bound if it isnt then the system is broken anyway; qed") }, }; let mut new_milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); - project.milestones.iter().for_each(|ms_key, ms: v6::V6Milestone| { + project.milestones.iter().for_each(|(ms_key, ms): (&MilestoneKey, &v6::V6Milestone)| { // assume that if its approved then its been withdrawn. let mut transfer_status: Option>> = None; if ms.is_approved { - transfer_status = Some(TransferStatus::Withdraw{on: frame_system::Pallet::::block_number()}); + transfer_status = Some(TransferStatus::Withdrawn{on: frame_system::Pallet::::block_number()}); } let new_ms = crate::Milestone { @@ -812,7 +831,7 @@ pub mod v7 { transfer_status }; // This only fails if the bound has been reduced and the old milestones were at max which is unlikely. - new_milestones.try_push(new_ms).expect("If this fails in try_runtime we have an issue. Dont reduce bound of milestones."); + new_milestones.try_insert(ms.milestone_key, new_ms).expect("If this fails in try_runtime we have an issue. Dont reduce bound of milestones."); }); let migrated_project = crate::Project { @@ -1078,7 +1097,7 @@ mod test { let _w = v3::migrate_all::(); - let project_apres = crate::Projects::::get(0).unwrap(); + let project_apres = v6::Projects::::get(0).unwrap(); // #1, 2, 7 & 8 assert_eq!(project.agreement_hash, project_apres.agreement_hash); assert_eq!( @@ -1138,7 +1157,7 @@ mod test { let cont = get_contributions::(vec![*BOB, *DAVE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_project::(*ALICE, cont, prop_milestones, CurrencyId::Native); + create_and_fund_project::(*ALICE, cont, prop_milestones, CurrencyId::Native).expect("project wasnt created!"); let milestone_key: MilestoneKey = 0; let expiry_block: BlockNumber = 10; let rounds_expiring: BoundedProjectKeysPerBlock = diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 1c51104e..0a598b9d 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -12,7 +12,7 @@ use xcm::latest::{MultiLocation, WeightLimit}; pub trait IntoProposal { type MaximumContributorsPerProject: Get; type MaxMilestonesPerProject: Get; - type MaxJuryMembers: Get; + type MaxJuryMembers: Get; /// Convert the propoerties of a project into a project. /// This is the main method when wanting to use pallet_proposals and is how one configures a project. fn convert_to_proposal( From c25916be5f17b32c670f91f69b3204ebb9e6ed8f Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 20 Nov 2023 10:40:20 +0000 Subject: [PATCH 171/192] jury selector move around --- Cargo.lock | 1 + pallets/briefs/Cargo.toml | 5 ++++- pallets/briefs/src/lib.rs | 26 +++++++---------------- pallets/briefs/src/mock.rs | 8 ------- pallets/crowdfunding/src/mock.rs | 4 ---- pallets/fellowship/src/impls.rs | 27 ------------------------ pallets/fellowship/src/traits.rs | 3 ++- pallets/grants/src/mock.rs | 3 --- pallets/proposals/src/lib.rs | 13 ++---------- pallets/proposals/src/mock.rs | 2 -- runtime/imbue-kusama/src/lib.rs | 36 ++++++++++++++++++++++++++------ 11 files changed, 47 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ad971b2..58793ef6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6702,6 +6702,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-deposits", + "pallet-fellowship", "pallet-identity", "pallet-proposals", "pallet-timestamp", diff --git a/pallets/briefs/Cargo.toml b/pallets/briefs/Cargo.toml index 79f6ea08..c9964cb0 100644 --- a/pallets/briefs/Cargo.toml +++ b/pallets/briefs/Cargo.toml @@ -35,6 +35,7 @@ common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } pallet-proposals = {path= "../proposals", default-features = false } pallet-deposits = {path= "../deposits", default-features = false } +pallet-fellowship = { path = "../fellowship", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } [dev-dependencies] @@ -71,6 +72,7 @@ std = [ "sp-io/std", "pallet-balances/std", "pallet-proposals/std", + "pallet-fellowship/std", "pallet-identity/std", "pallet-timestamp/std", "common-runtime/std", @@ -98,5 +100,6 @@ try-runtime = [ "orml-tokens/try-runtime", "pallet-identity/try-runtime", "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime" + "pallet-transaction-payment/try-runtime", + "pallet-fellowship/try-runtime", ] diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index b910521b..c82acfbf 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -20,11 +20,11 @@ mod benchmarking; #[cfg(any(feature = "runtime-benchmarks", test))] mod test_utils; -pub mod migrations; +//pub mod migrations; #[frame_support::pallet] pub mod pallet { - use common_types::{milestone_origin::FundingType, CurrencyId}; + use common_types::{CurrencyId}; use frame_support::{ pallet_prelude::*, sp_runtime::Saturating, traits::Get, weights::Weight, BoundedBTreeMap, }; @@ -32,7 +32,7 @@ pub mod pallet { use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_deposits::traits::DepositHandler; use pallet_proposals::traits::IntoProposal; - use pallet_proposals::{Contribution, ProposedMilestone}; + use pallet_proposals::{Contribution, ProposedMilestone, FundingPath}; use sp_arithmetic::per_things::Percent; use sp_core::H256; use sp_runtime::traits::Zero; @@ -84,7 +84,7 @@ pub mod pallet { type BriefStorageItem: Get>; type DepositHandler: DepositHandler, AccountIdOf>; /// The jury size of each brief as selected by JurySelector. - type StandardJurySize: Get + type StandardJurySize: Get; /// The type that selects a list of jury members. type JurySelector: SelectJury>; /// The weight info for the extrinsics. @@ -153,7 +153,7 @@ pub mod pallet { /// Milestones total do not add up to 100%. MilestonesTotalPercentageMustEqual100, /// too many milestones here mate fixed with https://github.com/ImbueNetwork/imbue/issues/267 - + TooManyMilestones, } #[pallet::call] @@ -298,27 +298,17 @@ pub mod pallet { let contributions = BriefContributions::::get(brief_id); ::DepositHandler::return_deposit(brief.deposit_id)?; - fn convert_to_proposal( - currency_id: CurrencyId, - current_contribution: BoundedBTreeMap, Self::MaximumContributorsPerProject>, - brief_hash: H256, - benificiary: AccountId, - milestones: BoundedVec, - refund_locations: BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>, - jury: BoundedVec, - on_creation_funding: FundingPath, - ) -> Result<(), DispatchError>; - let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners))?; + let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?)?; ::IntoProposal::convert_to_proposal( brief.currency_id, contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?, brief_id, brief.applicant, - brief.milestones.to_vec().try_into().map_err(|_|Error::::), + brief.milestones.to_vec().try_into().map_err(|_|Error::::TooManyMilestones), refund_locations, - ::select_jury(::StandardJurySize::get()), + >>::select_jury(::StandardJurySize::get()), FundingPath::TakeFromReserved, )?; diff --git a/pallets/briefs/src/mock.rs b/pallets/briefs/src/mock.rs index cfa322d5..f60c904b 100644 --- a/pallets/briefs/src/mock.rs +++ b/pallets/briefs/src/mock.rs @@ -219,7 +219,6 @@ parameter_types! { impl pallet_briefs::Config for Test { type RuntimeEvent = RuntimeEvent; type RMultiCurrency = Tokens; - type AuthorityOrigin = EnsureRoot; type IntoProposal = pallet_proposals::Pallet; type MaxBriefOwners = MaxBriefOwners; type MaxMilestonesPerBrief = MaxMilestonesPerProject; @@ -229,9 +228,7 @@ impl pallet_briefs::Config for Test { } parameter_types! { - pub const TwoWeekBlockUnit: u32 = 100800u32; pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); - pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into(); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); pub MaximumContributorsPerProject: u32 = 5000; pub RefundsPerBlock: u8 = 2; @@ -243,18 +240,14 @@ parameter_types! { pub ExpiringProjectRoundsPerBlock: u32 = 100; pub ProjectStorageItem: StorageItem = StorageItem::Project; pub MaxProjectsPerAccount: u16 = 100; - pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); } impl pallet_proposals::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletId = ProposalsPalletId; - type AuthorityOrigin = EnsureRoot; type MultiCurrency = Tokens; type WeightInfo = pallet_proposals::WeightInfo; // Adding 2 weeks as th expiration time - type MaxWithdrawalExpiration = TwoWeekBlockUnit; - type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; @@ -265,7 +258,6 @@ impl pallet_proposals::Config for Test { type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; } parameter_types! { pub const BasicDeposit: u64 = 10; diff --git a/pallets/crowdfunding/src/mock.rs b/pallets/crowdfunding/src/mock.rs index 5f4dbb44..0241835d 100644 --- a/pallets/crowdfunding/src/mock.rs +++ b/pallets/crowdfunding/src/mock.rs @@ -168,7 +168,6 @@ impl pallet_balances::Config for Test { parameter_types! { pub const TwoWeekBlockUnit: u32 = 100800u32; pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); - pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into(); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); pub MaximumContributorsPerProject: u32 = 5000; pub RefundsPerBlock: u8 = 2; @@ -180,7 +179,6 @@ parameter_types! { pub ExpiringProjectRoundsPerBlock: u32 = 100; pub ProjectStorageItem: StorageItem = StorageItem::Project; pub MaxProjectsPerAccount: u16 = 100; - pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); } impl pallet_proposals::Config for Test { @@ -190,7 +188,6 @@ impl pallet_proposals::Config for Test { type MultiCurrency = Tokens; type WeightInfo = pallet_proposals::WeightInfo; type MaxWithdrawalExpiration = TwoWeekBlockUnit; - type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; @@ -201,7 +198,6 @@ impl pallet_proposals::Config for Test { type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; } #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, MaxEncodedLen, TypeInfo, Copy)] diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index 14bcd5d6..a38cf06c 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -46,33 +46,6 @@ impl MaybeConvert<&AccountIdOf, VetterIdOf> for Pallet { } } -/// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. -/// Currently bound to u8 for size. -impl crate::traits::SelectJury> for Pallet { - fn select_jury(jury_size: u8) -> Vec> { - let mut jury_size = jury_size as usize; - let mut out: Vec> = Vec::new(); - let mut rng = rand::thread_rng(); - let length = Roles::::iter_keys().count(); - - if jury_size > length { - jury_size = length; - } - - // SAFETY: panics is jury_size > length. - let sample = rand::seq::index::sample(&mut rng, length, jury_size); - - let keys = Roles::::iter_keys().collect::>>(); - for index in sample.iter() { - // Defensive guard to avoid panic on indexing. - if index < keys.len() { - let key = &keys[index]; - out.push(key.clone()) - } - } - out - } -} impl Pallet { /// Try take the membership deposit from who diff --git a/pallets/fellowship/src/traits.rs b/pallets/fellowship/src/traits.rs index dfb9728a..de1cb52a 100644 --- a/pallets/fellowship/src/traits.rs +++ b/pallets/fellowship/src/traits.rs @@ -35,7 +35,8 @@ pub trait EnsureRole { /// Select a pseudo-random jury of a specified amount. pub trait SelectJury { - fn select_jury(size: u8) -> Vec; + type JurySize: Get; + fn select_jury() -> BoundedVec; } /// Custom definition for permissions for each role. diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index c6c18081..c6ca00ec 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -166,9 +166,7 @@ impl pallet_timestamp::Config for Test { } parameter_types! { - pub const TwoWeekBlockUnit: u32 = 100800u32; pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); - pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into(); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); pub MaximumContributorsPerProject: u32 = 5000; pub RefundsPerBlock: u8 = 2; @@ -189,7 +187,6 @@ impl pallet_proposals::Config for Test { type PalletId = ProposalsPalletId; type MultiCurrency = Tokens; type WeightInfo = pallet_proposals::WeightInfo; - type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 215feb52..2ad58c6c 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -59,6 +59,7 @@ pub type StorageItemOf = <::DepositHandler as DepositHandler, AccountIdOf>>::StorageItem; pub type DepositIdOf = <::DepositHandler as DepositHandler, AccountIdOf>>::DepositId; +pub type MaxJurySizeOf = <::JurySelector>>::JurySize; // These are the bounded types which are suitable for handling user input due to their restriction of vector length. type BoundedBTreeMilestones = @@ -90,8 +91,6 @@ pub mod pallet { type PalletId: Get; /// The currency type. type MultiCurrency: MultiReservableCurrency, CurrencyId = CurrencyId>; - /// The amount of time given, up to point of decision, when a vote of no confidence is held. - type NoConfidenceTimeLimit: Get>; /// Defines the length that a milestone can be voted on. type MilestoneVotingWindow: Get>; /// The minimum percentage of votes, inclusive, that is required for a vote to pass. @@ -115,9 +114,7 @@ pub mod pallet { /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; /// The trait that handler the raising of a dispute. - type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxJurySize = Self::MaxJuryMembers, MaxSpecifics = Self::MaxMilestonesPerProject>; - /// Maximum jury members, usually defined elsewhere. - type MaxJuryMembers: Get; + type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxSpecifics = Self::MaxMilestonesPerProject, MaxJuryMembers> = MaxJurySizeOf; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); @@ -234,12 +231,6 @@ pub mod pallet { ), /// A milestone has been approved. MilestoneApproved(T::AccountId, ProjectKey, MilestoneKey, BlockNumberFor), - /// You have created a vote of no confidence. - NoConfidenceRoundCreated(T::AccountId, ProjectKey), - /// You have voted upon a round of no confidence. - NoConfidenceRoundVotedUpon(T::AccountId, ProjectKey), - /// You have finalised a vote of no confidence. - NoConfidenceRoundFinalised(T::AccountId, ProjectKey), /// This milestone has been rejected. MilestoneRejected(ProjectKey, MilestoneKey), /// A project has been refunded either partially or completely. diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index fc14aef0..7302c96d 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -180,7 +180,6 @@ impl pallet_timestamp::Config for Test { parameter_types! { pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); - pub NoConfidenceTimeLimit: BlockNumber = 100800u32.into(); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); pub MaximumContributorsPerProject: u32 = 50; pub RefundsPerBlock: u8 = 2; @@ -200,7 +199,6 @@ impl pallet_proposals::Config for Test { type PalletId = ProposalsPalletId; type MultiCurrency = Tokens; type WeightInfo = crate::WeightInfo; - type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index e0fa2a11..6b9567c6 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -798,8 +798,6 @@ impl pallet_treasury::Config for Runtime { parameter_types! { pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); pub const MaxProjectsPerRound: u32 = 256; - pub const MaxWithdrawalExpiration: BlockNumber = 180 * DAYS; - pub const NoConfidenceTimeLimit: BlockNumber = 14 * DAYS; pub const PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); pub const MaximumContributorsPerProject: u32 = 5000; pub const IsIdentityRequired: bool = false; @@ -809,7 +807,6 @@ parameter_types! { pub const ProjectStorageItem: StorageDepositItems = StorageDepositItems::Project; pub const MaxMilestonesPerProject: u32 = 50; pub const MaxProjectsPerAccount: u16 = u16::MAX; - pub PercentRequiredForVoteNoConfidenceToPass: Percent = Percent::from_percent(75u8); } impl pallet_proposals::Config for Runtime { @@ -817,8 +814,6 @@ impl pallet_proposals::Config for Runtime { type PalletId = ProposalsPalletId; type MultiCurrency = Currencies; type AuthorityOrigin = AdminOrigin; - type MaxWithdrawalExpiration = MaxWithdrawalExpiration; - type NoConfidenceTimeLimit = NoConfidenceTimeLimit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type WeightInfo = pallet_proposals::weights::WeightInfo; @@ -830,7 +825,6 @@ impl pallet_proposals::Config for Runtime { type ProjectStorageItem = ProjectStorageItem; type DepositHandler = Deposits; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type PercentRequiredForVoteNoConfidenceToPass = PercentRequiredForVoteNoConfidenceToPass; } parameter_types! { @@ -1297,3 +1291,33 @@ cumulus_pallet_parachain_system::register_validate_block! { BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, CheckInherents = CheckInherents, } + +/// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. +/// Currently bound to u8 for size. +impl pallet_fellowship::traits::SelectJury> for Pallet { + type JurySize = MaxJurySize; + fn select_jury() -> BoundedVec, Self::JurySize> { + let mut out: Vec> = Vec::new(); + let mut rng = rand::thread_rng(); + let length = Roles::::iter_keys().count(); + let mut jury_size = Self::JurySize::get(); + + if jury_size > length { + jury_size = length; + } + + // SAFETY: panics is jury_size > length. + let sample = rand::seq::index::sample(&mut rng, length, jury_size); + + let keys = Roles::::iter_keys().collect::>>(); + for index in sample.iter() { + // Defensive guard to avoid panic on indexing. + if index < keys.len() { + let key = &keys[index]; + out.push(key.clone()) + } + } + out + } +} + From d03c0c9bf1336f0dce2d1fad72702a617de0c42e Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 20 Nov 2023 14:47:08 +0000 Subject: [PATCH 172/192] fix bloomin proposals --- pallets/briefs/src/lib.rs | 4 +- pallets/briefs/src/mock.rs | 18 ++++- pallets/crowdfunding/src/mock.rs | 15 +++- pallets/fellowship/src/tests/pallet_tests.rs | 75 ------------------- pallets/grants/src/mock.rs | 11 ++- pallets/proposals/src/lib.rs | 10 ++- pallets/proposals/src/migration.rs | 14 ++-- pallets/proposals/src/mock.rs | 27 ++++--- runtime/imbue-kusama/src/lib.rs | 8 +- runtime/imbue-kusama/src/sanity.rs | 77 ++++++++++++++++++++ 10 files changed, 152 insertions(+), 107 deletions(-) diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index c82acfbf..e59f0e29 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -83,8 +83,6 @@ pub mod pallet { /// Storage deposits. type BriefStorageItem: Get>; type DepositHandler: DepositHandler, AccountIdOf>; - /// The jury size of each brief as selected by JurySelector. - type StandardJurySize: Get; /// The type that selects a list of jury members. type JurySelector: SelectJury>; /// The weight info for the extrinsics. @@ -308,7 +306,7 @@ pub mod pallet { brief.applicant, brief.milestones.to_vec().try_into().map_err(|_|Error::::TooManyMilestones), refund_locations, - >>::select_jury(::StandardJurySize::get()), + >>::select_jury(), FundingPath::TakeFromReserved, )?; diff --git a/pallets/briefs/src/mock.rs b/pallets/briefs/src/mock.rs index f60c904b..9f6ba498 100644 --- a/pallets/briefs/src/mock.rs +++ b/pallets/briefs/src/mock.rs @@ -247,18 +247,21 @@ impl pallet_proposals::Config for Test { type PalletId = ProposalsPalletId; type MultiCurrency = Tokens; type WeightInfo = pallet_proposals::WeightInfo; - // Adding 2 weeks as th expiration time type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; + type ImbueFeeAccount = FeeAccount; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; - type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; + type ProjectStorageItem = ProjectStorageItem; type MaxProjectsPerAccount = MaxProjectsPerAccount; + type DisputeRaiser = MockDisputeRaiser; + type JurySelector = MockJurySelector; } + parameter_types! { pub const BasicDeposit: u64 = 10; pub const FieldDeposit: u64 = 10; @@ -299,7 +302,7 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { GenesisConfig::default().assimilate_storage(&mut t).unwrap(); orml_tokens::GenesisConfig:: { balances: { - vec![*ALICE, *BOB, *CHARLIE] + vec![*ALICE, *BOB, *CHARLIE, *JURY] .into_iter() .map(|id| (id, CurrencyId::Native, 1000000)) .collect::>() @@ -314,3 +317,12 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { }); ext } + +pub struct MockJurySelector(T); +impl pallet_fellowship::traits::SelectJury> for MockJurySelector { + type JurySize = MaxJurySize; + fn select_jury() -> BoundedVec, Self::JurySize> { + BoundedVec::new() + } +} + diff --git a/pallets/crowdfunding/src/mock.rs b/pallets/crowdfunding/src/mock.rs index 0241835d..cdb5e978 100644 --- a/pallets/crowdfunding/src/mock.rs +++ b/pallets/crowdfunding/src/mock.rs @@ -184,20 +184,21 @@ parameter_types! { impl pallet_proposals::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletId = ProposalsPalletId; - type AuthorityOrigin = EnsureRoot; type MultiCurrency = Tokens; type WeightInfo = pallet_proposals::WeightInfo; - type MaxWithdrawalExpiration = TwoWeekBlockUnit; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; + type ImbueFeeAccount = FeeAccount; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; - type ProjectStorageItem = ProjectStorageItem; type DepositHandler = MockDepositHandler; + type ProjectStorageItem = ProjectStorageItem; type MaxProjectsPerAccount = MaxProjectsPerAccount; + type DisputeRaiser = MockDisputeRaiser; + type JurySelector = MockJurySelector; } #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, MaxEncodedLen, TypeInfo, Copy)] @@ -246,3 +247,11 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { }); ext } + +pub struct MockJurySelector(T); +impl pallet_fellowship::traits::SelectJury> for MockJurySelector { + type JurySize = MaxJurySize; + fn select_jury() -> BoundedVec, Self::JurySize> { + BoundedVec::new() + } +} diff --git a/pallets/fellowship/src/tests/pallet_tests.rs b/pallets/fellowship/src/tests/pallet_tests.rs index 4e42c64d..6ca071b9 100644 --- a/pallets/fellowship/src/tests/pallet_tests.rs +++ b/pallets/fellowship/src/tests/pallet_tests.rs @@ -609,78 +609,3 @@ fn e2e() { }); } -#[test] -fn test_select_jury_doesnt_panic_amount_more_than_length() { - new_test_ext().execute_with(|| { - let size: u8 = 100; - for i in 0..size { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - let jury = as SelectJury>::select_jury(size + 100); - assert_eq!(jury.len(), 100, "jury size should have been truncated to size of roles or not enough roles have been selected."); - }); -} - -#[test] -fn test_select_jury_is_random() { - new_test_ext().execute_with(|| { - let size: u8 = 255; - for i in 0..size { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - let jury_1 = as SelectJury>::select_jury(1); - let jury_2 = as SelectJury>::select_jury(1); - - assert!(jury_1[0] != jury_2[0]); - - let jury_1 = as SelectJury>::select_jury(100); - let jury_2 = as SelectJury>::select_jury(100); - - assert!(jury_1 != jury_2); - }); -} - -#[test] -fn test_select_jury_stress_test() { - new_test_ext().execute_with(|| { - let size: u8 = 255; - for i in 0..size { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - for _ in 0..u8::MAX { - as SelectJury>::select_jury(255); - } - }); -} - -#[test] -fn test_select_jury_select_correct_amount_in_normal_conditions() { - new_test_ext().execute_with(|| { - for i in 0..255 { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - - let jury = as SelectJury>::select_jury(50); - assert_eq!(jury.len(), 50, "jury members should be exactly 50.") - }); -} diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index c6ca00ec..18b70970 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -198,8 +198,8 @@ impl pallet_proposals::Config for Test { type DepositHandler = MockDepositHandler; type ProjectStorageItem = ProjectStorageItem; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type MaxJuryMembers = MaxJuryMembers; type DisputeRaiser = MockDisputeRaiser; + type JurySelector = MockJurySelector; } parameter_types! { @@ -262,3 +262,12 @@ type MaxSpecifics = MaxMilestonesPerProject; Ok(()) } } + + +pub struct MockJurySelector(T); +impl pallet_fellowship::traits::SelectJury> for MockJurySelector { + type JurySize = MaxJurySize; + fn select_jury() -> BoundedVec, Self::JurySize> { + BoundedVec::new() + } +} diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 2ad58c6c..c64342e5 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -59,7 +59,7 @@ pub type StorageItemOf = <::DepositHandler as DepositHandler, AccountIdOf>>::StorageItem; pub type DepositIdOf = <::DepositHandler as DepositHandler, AccountIdOf>>::DepositId; -pub type MaxJurySizeOf = <::JurySelector>>::JurySize; +pub type MaxJuryOf = <::JurySelector as pallet_fellowship::traits::SelectJury>>::JurySize; // These are the bounded types which are suitable for handling user input due to their restriction of vector length. type BoundedBTreeMilestones = @@ -114,7 +114,9 @@ pub mod pallet { /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; /// The trait that handler the raising of a dispute. - type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxSpecifics = Self::MaxMilestonesPerProject, MaxJuryMembers> = MaxJurySizeOf; + type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxSpecifics = Self::MaxMilestonesPerProject, MaxJurySize = MaxJuryOf>; + /// The jury selector type which is defining the max jury size. + type JurySelector: pallet_fellowship::traits::SelectJury>; } const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); @@ -502,7 +504,7 @@ pub mod pallet { { type MaximumContributorsPerProject = T::MaximumContributorsPerProject; type MaxMilestonesPerProject = T::MaxMilestonesPerProject; - type MaxJuryMembers = T::MaxJuryMembers; + type MaxJuryMembers = MaxJuryOf; /// The caller is used to take the storage deposit from. /// With briefs and grants the caller is the beneficiary, so the fee will come from them. fn convert_to_proposal( @@ -712,7 +714,7 @@ pub struct Project { /// Where do the refunds end up and what percent they get. pub refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject>, /// Who should deal with disputes. - pub jury: BoundedVec, T::MaxJuryMembers>, + pub jury: BoundedVec, MaxJuryOf>, /// When is the project funded and how is it taken. pub on_creation_funding: FundingPath, /// The amount of funds refunded. diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 2cf4a44a..3420be7f 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -725,9 +725,9 @@ pub mod v6 { pub mod v7 { use super::*; - struct MigrateToV7>>(T, U); + struct MigrateToV7(T); - impl>> OnRuntimeUpgrade for MigrateToV7 + impl OnRuntimeUpgrade for MigrateToV7 where AccountIdOf: Into<[u8; 32]> { #[cfg(feature = "try-runtime")] @@ -753,7 +753,7 @@ pub mod v7 { let onchain = as GetStorageVersion>::on_chain_storage_version(); if current == 7 && onchain == 6 { - migrate_new_fields::(&mut weight); + migrate_new_fields::(&mut weight); current.put::>(); log::warn!("v7 has been successfully applied"); weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1)); @@ -779,8 +779,8 @@ pub mod v7 { } } - fn migrate_new_fields>>(weight: &mut Weight) - where AccountIdOf: Into<[u8; 32]> + fn migrate_new_fields(weight: &mut Weight) + where AccountIdOf: Into<[u8; 32]>, { v6::Projects::::drain().for_each(|(key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -791,7 +791,7 @@ pub mod v7 { v5::FundingType::Grant(_) => crate::FundingPath::WaitForFunding, }; - let jury = >>::select_jury(::MaxJuryMembers::get().try_into().expect("checked in the pre_upgrade.")); + let jury = >>::select_jury(); let refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = match project.funding_type { v5::FundingType::Proposal => crate::Pallet::::convert_contributions_to_refund_locations(&project.contributions), @@ -846,7 +846,7 @@ pub mod v7 { cancelled: project.cancelled, deposit_id: project.deposit_id, refund_locations, - jury: jury.try_into().expect("MaxJuryMembers is used in bound and creation; qed"), + jury: jury, on_creation_funding, refunded_funds: Zero::zero(), }; diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index 7302c96d..c36cb71e 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -191,27 +191,27 @@ parameter_types! { pub ProjectStorageItem: StorageItems = StorageItems::Project; pub MaxProjectsPerAccount: u16 = 50; pub MaxJuryMembers: u32 = 100; - pub TreasuryFeeAccount: AccountId = *TREASURY; + pub ImbueFeeAccount: AccountId = *TREASURY; } impl pallet_proposals::Config for Test { type RuntimeEvent = RuntimeEvent; type PalletId = ProposalsPalletId; type MultiCurrency = Tokens; - type WeightInfo = crate::WeightInfo; + type WeightInfo = pallet_proposals::WeightInfo; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type MilestoneVotingWindow = MilestoneVotingWindow; type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; - type ImbueFeeAccount = TreasuryFeeAccount; + type ImbueFeeAccount = ImbueFeeAccount; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; + type DepositHandler = MockDepositHandler; type ProjectStorageItem = ProjectStorageItem; - type DepositHandler = MockDepositHandler; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type MaxJuryMembers = MaxJuryMembers; type DisputeRaiser = MockDisputeRaiser; + type JurySelector = MockJurySelector; } parameter_types! { @@ -284,14 +284,14 @@ pub enum StorageItems { Project, } -pub struct MockDepositHandler(T); -impl DepositHandler, crate::AccountIdOf> - for MockDepositHandler +pub struct MockDepositHandler; +impl DepositHandler + for MockDepositHandler { type DepositId = u64; type StorageItem = StorageItems; fn take_deposit( - _who: crate::AccountIdOf, + _who: AccountId, _storage_item: Self::StorageItem, _currency_id: CurrencyId, ) -> Result { @@ -320,3 +320,12 @@ type MaxSpecifics = MaxMilestonesPerProject; Ok(()) } } + + +pub struct MockJurySelector; +impl pallet_fellowship::traits::SelectJury for MockJurySelector { + type JurySize = MaxJuryMembers; + fn select_jury() -> BoundedVec { + BoundedVec::new() + } +} diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 6b9567c6..18386cad 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -182,7 +182,7 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( pallet_proposals::migration::v7::MigrateToV7, - pallet_fellowship::migration::v0::MigrateInitial, + pallet_fellowship::migration::v0::MigrateInitial, ); } @@ -825,6 +825,8 @@ impl pallet_proposals::Config for Runtime { type ProjectStorageItem = ProjectStorageItem; type DepositHandler = Deposits; type MaxProjectsPerAccount = MaxProjectsPerAccount; + type JurySelector = PseudoRandomJurySelector; + } parameter_types! { @@ -1292,9 +1294,11 @@ cumulus_pallet_parachain_system::register_validate_block! { CheckInherents = CheckInherents, } + +struct PseudoRandomJurySelector(T); /// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. /// Currently bound to u8 for size. -impl pallet_fellowship::traits::SelectJury> for Pallet { +impl pallet_fellowship::traits::SelectJury> for PseudoRandomJurySelector { type JurySize = MaxJurySize; fn select_jury() -> BoundedVec, Self::JurySize> { let mut out: Vec> = Vec::new(); diff --git a/runtime/imbue-kusama/src/sanity.rs b/runtime/imbue-kusama/src/sanity.rs index 5be7b8b5..98f1ae95 100644 --- a/runtime/imbue-kusama/src/sanity.rs +++ b/runtime/imbue-kusama/src/sanity.rs @@ -70,3 +70,80 @@ fn ensure_proposals_initialize_is_less_than_10_percent_block() { "ExpiringProjectRoundsPerBlock is exceeding proof size limits." ); } + +#[test] +fn test_select_jury_is_random() { + new_test_ext().execute_with(|| { + let size: u8 = 255; + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + let jury_1 = as SelectJury>::select_jury(); + let jury_2 = as SelectJury>::select_jury(); + + assert!(jury_1[0] != jury_2[0]); + + let jury_1 = as SelectJury>::select_jury(); + let jury_2 = as SelectJury>::select_jury(); + + assert!(jury_1 != jury_2); + }); +} + +#[test] +fn test_select_jury_stress_test() { + new_test_ext().execute_with(|| { + let size: u8 = 255; + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + for _ in 0..u8::MAX { + as SelectJury>::select_jury(255); + } + }); +} + +#[test] +fn test_select_jury_select_correct_amount_in_normal_conditions() { + new_test_ext().execute_with(|| { + for i in 0..255 { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + + let jury = as SelectJury>::select_jury(50); + assert_eq!(jury.len(), <>, "jury members should be exactly 50.") + }); +} + +#[test] +fn test_select_jury_doesnt_panic_amount_more_than_length() { + new_test_ext().execute_with(|| { + let size: u8 = 100; + for i in 0..size { + assert_ok!(Fellowship::force_add_fellowship( + RuntimeOrigin::root(), + Public::from_raw([i as u8; 32]), + Role::Freelancer, + 10 + )); + } + let jury = as SelectJury>::select_jury(); + assert_eq!(jury.len(), 100, "jury size should have been truncated to size of roles or not enough roles have been selected."); + }); +} + From 41b6415ff34e15770069e79baa1cc77b737307ea Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 20 Nov 2023 15:16:16 +0000 Subject: [PATCH 173/192] fix briefs --- Cargo.lock | 1 + pallets/briefs/Cargo.toml | 1 + pallets/briefs/src/lib.rs | 6 +++--- pallets/briefs/src/mock.rs | 32 ++++++++++++++++++++++++++------ pallets/crowdfunding/src/mock.rs | 8 ++++---- pallets/grants/src/mock.rs | 8 ++++---- 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58793ef6..c2e8c28f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6702,6 +6702,7 @@ dependencies = [ "orml-traits", "pallet-balances", "pallet-deposits", + "pallet-disputes", "pallet-fellowship", "pallet-identity", "pallet-proposals", diff --git a/pallets/briefs/Cargo.toml b/pallets/briefs/Cargo.toml index c9964cb0..b21706ed 100644 --- a/pallets/briefs/Cargo.toml +++ b/pallets/briefs/Cargo.toml @@ -54,6 +54,7 @@ pallet-proposals = {path= "../proposals"} sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} pallet-deposits = {path= "../deposits"} +pallet-disputes = { path = "../disputes"} common-runtime = { path = "../../runtime/common"} [features] diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index e59f0e29..c5c8750d 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -297,16 +297,16 @@ pub mod pallet { ::DepositHandler::return_deposit(brief.deposit_id)?; - let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?)?; + let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions.clone().into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?); ::IntoProposal::convert_to_proposal( brief.currency_id, contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?, brief_id, brief.applicant, - brief.milestones.to_vec().try_into().map_err(|_|Error::::TooManyMilestones), + brief.milestones.to_vec().try_into().map_err(|_|Error::::TooManyMilestones)?, refund_locations, - >>::select_jury(), + >>::select_jury().to_vec().try_into().map_err(|_|Error::::TooManyMilestones)?, FundingPath::TakeFromReserved, )?; diff --git a/pallets/briefs/src/mock.rs b/pallets/briefs/src/mock.rs index 9f6ba498..5b63aa57 100644 --- a/pallets/briefs/src/mock.rs +++ b/pallets/briefs/src/mock.rs @@ -225,6 +225,7 @@ impl pallet_briefs::Config for Test { type BriefStorageItem = BriefStorageItem; type DepositHandler = MockDepositHandler; type WeightInfo = pallet_briefs::WeightInfo; + type JurySelector = MockJurySelector; } parameter_types! { @@ -240,6 +241,8 @@ parameter_types! { pub ExpiringProjectRoundsPerBlock: u32 = 100; pub ProjectStorageItem: StorageItem = StorageItem::Project; pub MaxProjectsPerAccount: u16 = 100; + pub ImbueFeeAccount: AccountId = *TREASURY; + pub MaxJuryMembers: u32 = 100; } impl pallet_proposals::Config for Test { @@ -253,7 +256,7 @@ impl pallet_proposals::Config for Test { type ExternalRefundHandler = pallet_proposals::traits::MockRefundHandler; type MaxMilestonesPerProject = MaxMilestonesPerProject; type ImbueFee = ImbueFee; - type ImbueFeeAccount = FeeAccount; + type ImbueFeeAccount = ImbueFeeAccount; type ExpiringProjectRoundsPerBlock = ExpiringProjectRoundsPerBlock; type DepositHandler = MockDepositHandler; type ProjectStorageItem = ProjectStorageItem; @@ -293,6 +296,7 @@ parameter_types! { pub static ALICE: Lazy = Lazy::new(|| sr25519::Public::from_raw([125u8; 32])); pub static BOB: Lazy = Lazy::new(|| sr25519::Public::from_raw([126u8; 32])); pub static CHARLIE: Lazy = Lazy::new(|| sr25519::Public::from_raw([127u8; 32])); +pub static TREASURY: Lazy = Lazy::new(|| sr25519::Public::from_raw([127u8; 32])); pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default() @@ -302,7 +306,7 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { GenesisConfig::default().assimilate_storage(&mut t).unwrap(); orml_tokens::GenesisConfig:: { balances: { - vec![*ALICE, *BOB, *CHARLIE, *JURY] + vec![*ALICE, *BOB, *CHARLIE] .into_iter() .map(|id| (id, CurrencyId::Native, 1000000)) .collect::>() @@ -318,11 +322,27 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { ext } -pub struct MockJurySelector(T); -impl pallet_fellowship::traits::SelectJury> for MockJurySelector { - type JurySize = MaxJurySize; - fn select_jury() -> BoundedVec, Self::JurySize> { +pub struct MockJurySelector; +impl pallet_fellowship::traits::SelectJury for MockJurySelector { + type JurySize = MaxJuryMembers; + fn select_jury() -> BoundedVec { BoundedVec::new() } } +pub struct MockDisputeRaiser; +impl pallet_disputes::traits::DisputeRaiser for MockDisputeRaiser { +type DisputeKey = u32; +type SpecificId = u32; +type MaxJurySize = MaxJuryMembers; +type MaxSpecifics = MaxMilestonesPerProject; + fn raise_dispute( + dispute_key: Self::DisputeKey, + raised_by: AccountId, + jury: BoundedVec, + specific_ids: BoundedVec, + ) -> Result<(), DispatchError> { + Ok(()) + } +} + diff --git a/pallets/crowdfunding/src/mock.rs b/pallets/crowdfunding/src/mock.rs index cdb5e978..73695b0f 100644 --- a/pallets/crowdfunding/src/mock.rs +++ b/pallets/crowdfunding/src/mock.rs @@ -248,10 +248,10 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { ext } -pub struct MockJurySelector(T); -impl pallet_fellowship::traits::SelectJury> for MockJurySelector { - type JurySize = MaxJurySize; - fn select_jury() -> BoundedVec, Self::JurySize> { +pub struct MockJurySelector; +impl pallet_fellowship::traits::SelectJury for MockJurySelector { + type JurySize = MaxJuryMembers; + fn select_jury() -> BoundedVec { BoundedVec::new() } } diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index 18b70970..9580c1bf 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -264,10 +264,10 @@ type MaxSpecifics = MaxMilestonesPerProject; } -pub struct MockJurySelector(T); -impl pallet_fellowship::traits::SelectJury> for MockJurySelector { - type JurySize = MaxJurySize; - fn select_jury() -> BoundedVec, Self::JurySize> { +pub struct MockJurySelector; +impl pallet_fellowship::traits::SelectJury for MockJurySelector { + type JurySize = MaxJuryMembers; + fn select_jury() -> BoundedVec { BoundedVec::new() } } From dc32bd33718d3f4592035c4cee33e256c9dff646 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 20 Nov 2023 15:17:23 +0000 Subject: [PATCH 174/192] fix grants --- Cargo.lock | 1 + pallets/grants/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index c2e8c28f..01075545 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7008,6 +7008,7 @@ dependencies = [ "pallet-balances", "pallet-deposits", "pallet-disputes", + "pallet-fellowship", "pallet-identity", "pallet-proposals", "pallet-timestamp", diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index 6770863e..38aef491 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -45,6 +45,7 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "p pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } pallet-proposals = { path = "../proposals" } pallet-disputes = { path = "../disputes"} +pallet-fellowship = { path = "../fellowship"} common-types = { path = "../../libs/common-types" } common-runtime = { path = "../../runtime/common" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} From 03361b3025f0ba8795a3481a41dd6ad443700b0a Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 20 Nov 2023 15:46:41 +0000 Subject: [PATCH 175/192] fiix runtime --- Cargo.lock | 29 ++------------- Cargo.toml | 1 - pallets/crowdfunding/Cargo.toml | 2 ++ pallets/crowdfunding/src/lib.rs | 4 +-- pallets/crowdfunding/src/mock.rs | 20 +++++++++++ pallets/disputes/src/weights.rs | 57 ++++++++++++++++++++++++++++++ pallets/fellowship/Cargo.toml | 1 - pallets/grants/src/lib.rs | 2 +- pallets/proposals/src/migration.rs | 2 +- runtime/imbue-kusama/Cargo.toml | 3 +- runtime/imbue-kusama/src/lib.rs | 17 ++++----- 11 files changed, 96 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01075545..36c0ce27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4346,6 +4346,7 @@ dependencies = [ "pallet-collective", "pallet-democracy", "pallet-deposits", + "pallet-disputes", "pallet-fellowship", "pallet-grants", "pallet-identity", @@ -4368,6 +4369,7 @@ dependencies = [ "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-runtime-common", + "rand 0.7.3", "scale-info 2.9.0", "serde", "sp-api", @@ -6792,32 +6794,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-crowdfunding" -version = "0.1.0" -dependencies = [ - "common-runtime", - "common-types", - "frame-benchmarking", - "frame-support", - "frame-system", - "orml-tokens", - "orml-traits", - "pallet-balances", - "pallet-deposits", - "pallet-identity", - "pallet-proposals", - "pallet-timestamp", - "pallet-xcm", - "parity-scale-codec 3.6.5", - "scale-info 2.9.0", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-democracy" version = "4.0.0-dev" @@ -6959,7 +6935,6 @@ dependencies = [ "orml-tokens", "orml-traits", "parity-scale-codec 3.6.5", - "rand 0.7.3", "scale-info 2.9.0", "serde", "sp-arithmetic", diff --git a/Cargo.toml b/Cargo.toml index 736b52bb..3c43ccba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ members = [ "pallets/proposals", "pallets/briefs", "pallets/grants", - "pallets/crowdfunding", "pallets/deposits", "pallets/disputes", "pallets/fellowship", diff --git a/pallets/crowdfunding/Cargo.toml b/pallets/crowdfunding/Cargo.toml index 7dcdb0ba..1c579059 100644 --- a/pallets/crowdfunding/Cargo.toml +++ b/pallets/crowdfunding/Cargo.toml @@ -45,6 +45,8 @@ pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "p pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43"} pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} pallet-deposits = {path= "../deposits"} +pallet-fellowship = {path= "../fellowship"} +pallet-disputes = {path= "../disputes"} [features] diff --git a/pallets/crowdfunding/src/lib.rs b/pallets/crowdfunding/src/lib.rs index 8dc8b6f0..000707a0 100644 --- a/pallets/crowdfunding/src/lib.rs +++ b/pallets/crowdfunding/src/lib.rs @@ -15,7 +15,7 @@ mod benchmarking; #[frame_support::pallet] pub mod pallet { use crate::weights::WeightInfo; - use common_types::{CurrencyId, FundingType}; + use common_types::{CurrencyId}; use frame_support::sp_runtime::Saturating; use frame_support::{pallet_prelude::*, transactional, BoundedBTreeMap}; use frame_system::pallet_prelude::*; @@ -40,7 +40,7 @@ pub mod pallet { pub type BoundedMilestoneKeys = BoundedVec::MaxMilestonesPerCrowdFund>; pub type BoundedMilestones = - BoundedBTreeMap::MaxMilestonesPerCrowdFund>; + BoundedBTreeMap>, ::MaxMilestonesPerCrowdFund>; pub type BoundedWhitelistSpots = BoundedBTreeMap, BalanceOf, ::MaxWhitelistPerCrowdFund>; pub type BoundedProposedMilestones = diff --git a/pallets/crowdfunding/src/mock.rs b/pallets/crowdfunding/src/mock.rs index 73695b0f..c988b3c6 100644 --- a/pallets/crowdfunding/src/mock.rs +++ b/pallets/crowdfunding/src/mock.rs @@ -179,6 +179,8 @@ parameter_types! { pub ExpiringProjectRoundsPerBlock: u32 = 100; pub ProjectStorageItem: StorageItem = StorageItem::Project; pub MaxProjectsPerAccount: u16 = 100; + pub FeeAccount: AccountId = *TREASURY; + pub MaxJuryMembers: u32 = 100; } impl pallet_proposals::Config for Test { @@ -231,6 +233,7 @@ impl DepositHandler for MockDepositHandler { pub static ALICE: Lazy = Lazy::new(|| Public::from_raw([125u8; 32])); pub static BOB: Lazy = Lazy::new(|| Public::from_raw([126u8; 32])); pub static CHARLIE: Lazy = Lazy::new(|| Public::from_raw([127u8; 32])); +pub static TREASURY: Lazy = Lazy::new(|| Public::from_raw([127u8; 32])); pub(crate) fn new_test_ext() -> sp_io::TestExternalities { let t = frame_system::GenesisConfig::default() @@ -248,6 +251,23 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { ext } +pub struct MockDisputeRaiser; +impl pallet_disputes::traits::DisputeRaiser for MockDisputeRaiser { +type DisputeKey = u32; +type SpecificId = u32; +type MaxJurySize = MaxJuryMembers; +type MaxSpecifics = MaxMilestonesPerProject; + fn raise_dispute( + dispute_key: Self::DisputeKey, + raised_by: AccountId, + jury: BoundedVec, + specific_ids: BoundedVec, + ) -> Result<(), DispatchError> { + Ok(()) + } +} + + pub struct MockJurySelector; impl pallet_fellowship::traits::SelectJury for MockJurySelector { type JurySize = MaxJuryMembers; diff --git a/pallets/disputes/src/weights.rs b/pallets/disputes/src/weights.rs index 8b137891..cdd6734c 100644 --- a/pallets/disputes/src/weights.rs +++ b/pallets/disputes/src/weights.rs @@ -1 +1,58 @@ +// JUST A MOCK TO MAKE BUILD, THESE NEED REGENERATING. +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; +use crate::WeightInfoT; + + +pub struct WeightInfo(PhantomData); +impl crate::WeightInfoT for WeightInfo { + + fn vote_on_dispute() -> Weight { + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + + } + fn extend_dispute() -> Weight { + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + + } + fn raise_dispute() -> Weight { + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + + } + fn force_succeed_dispute() -> Weight { + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + + } + fn force_fail_dispute() -> Weight { + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + + } + fn calculate_winner() -> Weight { + Weight::from_parts(382_002_000, 0) + .saturating_add(Weight::from_parts(0, 3593)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + + } +} diff --git a/pallets/fellowship/Cargo.toml b/pallets/fellowship/Cargo.toml index 9852d4fd..20623e46 100644 --- a/pallets/fellowship/Cargo.toml +++ b/pallets/fellowship/Cargo.toml @@ -26,7 +26,6 @@ common-traits = { path = "../../libs/common-traits", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false} sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } -rand = { version = "0.7.3", default-features = false, features = ["alloc"]} [dev-dependencies] diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index c8f73a5a..9490af29 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -147,7 +147,7 @@ pub mod pallet { let treasury_multilocation = >>::get_multi_location(&treasury_origin).map_err(|_| Error::::InvalidTreasuryOrigin)?; - let refund_locations = vec![(Locality::Foreign(treasury_multilocation), Percent::from_parts(100u8))]; + let refund_locations = sp_std::vec![(Locality::Foreign(treasury_multilocation), Percent::from_parts(100u8))]; ::IntoProposal::convert_to_proposal( currency_id, diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 3420be7f..2d6f2f6c 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -725,7 +725,7 @@ pub mod v6 { pub mod v7 { use super::*; - struct MigrateToV7(T); + pub struct MigrateToV7(T); impl OnRuntimeUpgrade for MigrateToV7 where AccountIdOf: Into<[u8; 32]> diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index f416259d..355624c8 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -13,7 +13,7 @@ targets = ['x86_64-unknown-linux-gnu'] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } - +rand = { version = "0.7.3", default-features = false, features = ["alloc"]} log = { version = "0.4.14", default-features = false } # Substrate Dependencies @@ -103,6 +103,7 @@ pallet-briefs = {path = '../../pallets/briefs', default-features = false } pallet-grants = {path = '../../pallets/grants', default-features = false } pallet-deposits = {path = '../../pallets/deposits', default-features = false } pallet-fellowship = {path = '../../pallets/fellowship', default-features = false } +pallet-disputes = {path = '../../pallets/disputes', default-features = false } common-traits = { path = "../../libs/common-traits", default-features = false } common-types = { path = "../../libs/common-types", default-features = false } pallet-proposals-rpc-runtime-api = {path = "../../pallets/proposals/rpc/runtime-api", default-features = false} diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 18386cad..6331c39b 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -813,7 +813,6 @@ impl pallet_proposals::Config for Runtime { type RuntimeEvent = RuntimeEvent; type PalletId = ProposalsPalletId; type MultiCurrency = Currencies; - type AuthorityOrigin = AdminOrigin; type PercentRequiredForVoteToPass = PercentRequiredForVoteToPass; type MaximumContributorsPerProject = MaximumContributorsPerProject; type WeightInfo = pallet_proposals::weights::WeightInfo; @@ -854,7 +853,6 @@ parameter_types! { impl pallet_briefs::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RMultiCurrency = Currencies; - type AuthorityOrigin = EnsureRoot; type IntoProposal = pallet_proposals::Pallet; type MaxBriefOwners = MaxBriefOwners; type MaxMilestonesPerBrief = MaxMilestonesPerProject; @@ -929,8 +927,8 @@ impl pallet_disputes::Config for Runtime { type MaxDisputesPerBlock = MaxDisputesPerBlock; type VotingTimeLimit = VotingTimeLimit; type ForceOrigin = EnsureRootOr; - type DisputeHooks = todo!(); - type WeightInfo = todo!(); + type DisputeHooks = pallet_proposals::Pallet; + type WeightInfo = pallet_disputes::weights::WeightInfo; } construct_runtime! { @@ -1295,13 +1293,16 @@ cumulus_pallet_parachain_system::register_validate_block! { } + +use pallet_fellowship::Roles; + struct PseudoRandomJurySelector(T); /// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. /// Currently bound to u8 for size. -impl pallet_fellowship::traits::SelectJury> for PseudoRandomJurySelector { +impl pallet_fellowship::traits::SelectJury for PseudoRandomJurySelector { type JurySize = MaxJurySize; - fn select_jury() -> BoundedVec, Self::JurySize> { - let mut out: Vec> = Vec::new(); + fn select_jury() -> sp_runtime::BoundedVec { + let mut out: Vec = Vec::new(); let mut rng = rand::thread_rng(); let length = Roles::::iter_keys().count(); let mut jury_size = Self::JurySize::get(); @@ -1313,7 +1314,7 @@ impl pallet_fellowship::traits::SelectJury> for Pseudo // SAFETY: panics is jury_size > length. let sample = rand::seq::index::sample(&mut rng, length, jury_size); - let keys = Roles::::iter_keys().collect::>>(); + let keys = Roles::::iter_keys().collect::>(); for index in sample.iter() { // Defensive guard to avoid panic on indexing. if index < keys.len() { From 790a7fd731b61d9338becdfa9a079c04253b086e Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 21 Nov 2023 21:22:26 +0000 Subject: [PATCH 176/192] fix integration test, rewrite get jury --- Cargo.lock | 1 - pallets/fellowship/src/impls.rs | 1 + pallets/fellowship/src/lib.rs | 4 + runtime/imbue-kusama/Cargo.toml | 1 - runtime/imbue-kusama/src/lib.rs | 55 ++++++------- runtime/imbue-kusama/src/sanity.rs | 77 ------------------- .../integration-tests/src/xcm_transfers.rs | 23 ++---- 7 files changed, 42 insertions(+), 120 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36c0ce27..0ebcdd01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4369,7 +4369,6 @@ dependencies = [ "parity-scale-codec 3.6.5", "polkadot-parachain", "polkadot-runtime-common", - "rand 0.7.3", "scale-info 2.9.0", "serde", "sp-api", diff --git a/pallets/fellowship/src/impls.rs b/pallets/fellowship/src/impls.rs index a38cf06c..05888142 100644 --- a/pallets/fellowship/src/impls.rs +++ b/pallets/fellowship/src/impls.rs @@ -82,3 +82,4 @@ impl crate::traits::FellowshipPermissions } } } + diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 07e341b6..8349fa5d 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -111,6 +111,10 @@ pub mod pallet { pub type FellowToVetter = StorageMap<_, Blake2_128Concat, AccountIdOf, VetterIdOf, OptionQuery>; + /// Jury pointer for setting the mark at which fellows have been selected for jury. + #[pallet::storage] + pub type JuryPointer = StorageValue<_, u128, ValueQuery>; + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 355624c8..5cbad5b4 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -13,7 +13,6 @@ targets = ['x86_64-unknown-linux-gnu'] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } -rand = { version = "0.7.3", default-features = false, features = ["alloc"]} log = { version = "0.4.14", default-features = false } # Substrate Dependencies diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 6331c39b..771516a2 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -824,7 +824,9 @@ impl pallet_proposals::Config for Runtime { type ProjectStorageItem = ProjectStorageItem; type DepositHandler = Deposits; type MaxProjectsPerAccount = MaxProjectsPerAccount; - type JurySelector = PseudoRandomJurySelector; + type JurySelector = PointerBasedJurySelector; + type ImbueFeeAccount = TreasuryAccount; + type DisputeRaiser = pallet_disputes::Pallet; } @@ -859,6 +861,7 @@ impl pallet_briefs::Config for Runtime { type WeightInfo = pallet_briefs::weights::WeightInfo; type BriefStorageItem = BriefStorageItem; type DepositHandler = Deposits; + type JurySelector = PointerBasedJurySelector; } parameter_types! { @@ -918,8 +921,8 @@ parameter_types! { impl pallet_disputes::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type DisputeKey = u32; - type SpecificId = u32; + type DisputeKey = pallet_proposals::ProjectKey; + type SpecificId = pallet_proposals::MilestoneKey; type MaxJurySize = MaxJurySize; // TODO: this syntax for each max milestones per brief grant and projet. // it binds automatically. @@ -989,6 +992,7 @@ construct_runtime! { ImbueGrants: pallet_grants::{Pallet, Call, Storage, Event} = 102, Deposits: pallet_deposits::{Pallet, Storage, Event} = 103, ImbueFellowship: pallet_fellowship::{Pallet, Call, Storage, Event} = 104, + ImbueDisputes: pallet_disputes::{Pallet, Call, Storage, Event} = 105, } } @@ -1027,6 +1031,7 @@ mod benches { [pallet_briefs, ImbueBriefs] [pallet_grants, ImbueGrants] [pallet_fellowship, ImbueFellowship] + [pallet_fellowship, ImbueDisputes] ); } @@ -1294,34 +1299,32 @@ cumulus_pallet_parachain_system::register_validate_block! { -use pallet_fellowship::Roles; - -struct PseudoRandomJurySelector(T); -/// Select a jury randomly, if there is not enough member is Roles then a truncated list will be provided. -/// Currently bound to u8 for size. -impl pallet_fellowship::traits::SelectJury for PseudoRandomJurySelector { +type AccountIdOf = ::AccountId; +pub struct PointerBasedJurySelector(T); +impl pallet_fellowship::traits::SelectJury> for PointerBasedJurySelector { type JurySize = MaxJurySize; - fn select_jury() -> sp_runtime::BoundedVec { - let mut out: Vec = Vec::new(); - let mut rng = rand::thread_rng(); - let length = Roles::::iter_keys().count(); - let mut jury_size = Self::JurySize::get(); - - if jury_size > length { - jury_size = length; - } - - // SAFETY: panics is jury_size > length. - let sample = rand::seq::index::sample(&mut rng, length, jury_size); - - let keys = Roles::::iter_keys().collect::>(); - for index in sample.iter() { - // Defensive guard to avoid panic on indexing. + fn select_jury() -> frame_support::BoundedVec, Self::JurySize> { + let mut out: frame_support::BoundedVec, Self::JurySize> = frame_support::BoundedVec::new(); + let mut amount = Self::JurySize::get(); + let keys = pallet_fellowship::Roles::::iter_keys().collect::>>(); + let keys_len = keys.len(); + let pointer = pallet_fellowship::JuryPointer::::get(); + let pointer_with_bound = pointer.saturating_add(amount.into()); + for i in pointer..pointer_with_bound { + let index = i as usize % keys_len; + // shouldnt be an issue due to mod. if index < keys.len() { let key = &keys[index]; - out.push(key.clone()) + // Here weve gone in a circle! break. + if out.contains(&key) { + break + } + if let Err(_) = out.try_push(key.clone()) { + break + } } } + pallet_fellowship::JuryPointer::::put(pointer_with_bound); out } } diff --git a/runtime/imbue-kusama/src/sanity.rs b/runtime/imbue-kusama/src/sanity.rs index 98f1ae95..5be7b8b5 100644 --- a/runtime/imbue-kusama/src/sanity.rs +++ b/runtime/imbue-kusama/src/sanity.rs @@ -70,80 +70,3 @@ fn ensure_proposals_initialize_is_less_than_10_percent_block() { "ExpiringProjectRoundsPerBlock is exceeding proof size limits." ); } - -#[test] -fn test_select_jury_is_random() { - new_test_ext().execute_with(|| { - let size: u8 = 255; - for i in 0..size { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - let jury_1 = as SelectJury>::select_jury(); - let jury_2 = as SelectJury>::select_jury(); - - assert!(jury_1[0] != jury_2[0]); - - let jury_1 = as SelectJury>::select_jury(); - let jury_2 = as SelectJury>::select_jury(); - - assert!(jury_1 != jury_2); - }); -} - -#[test] -fn test_select_jury_stress_test() { - new_test_ext().execute_with(|| { - let size: u8 = 255; - for i in 0..size { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - for _ in 0..u8::MAX { - as SelectJury>::select_jury(255); - } - }); -} - -#[test] -fn test_select_jury_select_correct_amount_in_normal_conditions() { - new_test_ext().execute_with(|| { - for i in 0..255 { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - - let jury = as SelectJury>::select_jury(50); - assert_eq!(jury.len(), <>, "jury members should be exactly 50.") - }); -} - -#[test] -fn test_select_jury_doesnt_panic_amount_more_than_length() { - new_test_ext().execute_with(|| { - let size: u8 = 100; - for i in 0..size { - assert_ok!(Fellowship::force_add_fellowship( - RuntimeOrigin::root(), - Public::from_raw([i as u8; 32]), - Role::Freelancer, - 10 - )); - } - let jury = as SelectJury>::select_jury(); - assert_eq!(jury.len(), 100, "jury size should have been truncated to size of roles or not enough roles have been selected."); - }); -} - diff --git a/runtime/integration-tests/src/xcm_transfers.rs b/runtime/integration-tests/src/xcm_transfers.rs index ad84ce8d..85d084af 100644 --- a/runtime/integration-tests/src/xcm_transfers.rs +++ b/runtime/integration-tests/src/xcm_transfers.rs @@ -10,9 +10,9 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -use frame_support::assert_ok; +use frame_support::{assert_ok, PalletId}; use frame_support::dispatch::RawOrigin; - +use sp_runtime::traits::AccountIdConversion; use xcm_emulator::{bx, TestExt}; use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, NetworkId}; @@ -24,9 +24,9 @@ use crate::kusama_test_net::{ Development, ImbueKusamaReceiver, ImbueKusamaSender, Kusama, KusamaReceiver, KusamaSender, Sibling, SiblingKusamaReceiver, }; -use crate::setup::{ksm_amount, mgx_amount, native_amount, PARA_ID_DEVELOPMENT, PARA_ID_SIBLING}; +use crate::setup::{ksm_amount, mgx_amount, native_amount, PARA_ID_DEVELOPMENT, PARA_ID_SIBLING, AccountId}; use common_runtime::Balance; -use common_types::{CurrencyId, FundingType, TreasuryOrigin}; +use common_types::{CurrencyId, TreasuryOrigin, TreasuryOriginConverter}; use imbue_kusama_runtime::{ CanonicalImbuePerSecond, OrmlTokens, Runtime as R, RuntimeOrigin, XTokens, }; @@ -37,11 +37,8 @@ use pallet_proposals::traits::ExternalRefundHandler; fn transfer_treasury_to_parachain_grant_escrow_address() { let transfer_amount: Balance = ksm_amount(1); let treasury_origin = TreasuryOrigin::Kusama; - let kusama_treasury_address = - ::ExternalRefundHandler::get_treasury_account_id( - treasury_origin, - ) - .unwrap(); + let kusama_treasury_address: AccountId = PalletId(*b"py/trsry").into_account_truncating(); + Development::execute_with(|| { assert_eq!( OrmlTokens::free_balance(CurrencyId::KSM, &ImbueKusamaReceiver::get()), @@ -134,11 +131,7 @@ fn transfer_ksm_to_relay_chain() { #[test] fn test_xcm_refund_handler_to_kusama() { let treasury_origin = TreasuryOrigin::Kusama; - let kusama_treasury_address = - ::ExternalRefundHandler::get_treasury_account_id( - treasury_origin, - ) - .unwrap(); + let kusama_treasury_address: AccountId = PalletId(*b"py/trsry").into_account_truncating(); let _kusama_treasury_balance_before = Kusama::account_data_of(kusama_treasury_address.clone()).free; let transfer_amount: Balance = ksm_amount(10); @@ -170,7 +163,7 @@ fn test_xcm_refund_handler_to_kusama() { ImbueKusamaReceiver::get(), ksm_balance, CurrencyId::KSM, - FundingType::Grant(TreasuryOrigin::Kusama) + >::get_multi_location(&TreasuryOrigin::Kusama).unwrap() ) ); }); From bf3be2700d4670aee8c349c1fd3905b67c6b424e Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 23 Nov 2023 11:25:14 +0000 Subject: [PATCH 177/192] generate dispute weights --- Cargo.lock | 1 - pallets/disputes/src/lib.rs | 17 --- pallets/disputes/src/weights.rs | 168 +++++++++++++++++++------- pallets/grants/Cargo.toml | 15 ++- pallets/grants/src/benchmarking.rs | 4 + pallets/proposals/src/benchmarking.rs | 3 - runtime/imbue-kusama/Cargo.toml | 4 + runtime/imbue-kusama/src/lib.rs | 2 +- 8 files changed, 139 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ebcdd01..c22b2cf9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6986,7 +6986,6 @@ dependencies = [ "pallet-identity", "pallet-proposals", "pallet-timestamp", - "pallet-xcm", "parity-scale-codec 3.6.5", "scale-info 2.9.0", "sp-arithmetic", diff --git a/pallets/disputes/src/lib.rs b/pallets/disputes/src/lib.rs index 72d6f456..4c4ba674 100644 --- a/pallets/disputes/src/lib.rs +++ b/pallets/disputes/src/lib.rs @@ -1,20 +1,3 @@ -//FELIX REVIEW: Eventually it will be nice to have a short introduction here explaining what this pallet does and the -// avaliable methods etc. - -// 1: Raise dispute using DisputeRaiser from pallet_proposals -// - It takes the raiser_id,project_id as dispute_key, list of jury(randomly selected upto 7 to 9 count), reason, fund_account -// - Exisiting implementation looks good, need to update the votes while inserting the new dispute - -// 2: Vote on dispute. -// Get the vote as single yes or no and divide based on the number of the voters -// Need to come up with a way to change the votes that might require the storing the votes of each voter - -// 3: finalise it in the on_initialize hook. -// Signal that this is ready for continuation. pallet-refund/pallet-proposals. -// Refund, Everythings ok. - -// 4: an extrinsic is called claim_back(parameter: who, where.) - #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; pub mod impls; diff --git a/pallets/disputes/src/weights.rs b/pallets/disputes/src/weights.rs index cdd6734c..61ad1958 100644 --- a/pallets/disputes/src/weights.rs +++ b/pallets/disputes/src/weights.rs @@ -1,4 +1,32 @@ -// JUST A MOCK TO MAKE BUILD, THESE NEED REGENERATING. + +//! Autogenerated weights for `pallet_disputes` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-11-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("local"), DB CACHE: 1024 + +// Executed Command: +// ./target/debug/imbue +// benchmark +// pallet +// --chain +// local +// --execution +// wasm +// --wasm-execution +// compiled +// --pallet +// pallet-disputes +// --extrinsic +// * +// --output +// weights.rs +// --steps +// 50 +// --repeat +// 20 #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -7,52 +35,98 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; -use crate::WeightInfoT; - +/// Weight functions for `pallet_disputes`. pub struct WeightInfo(PhantomData); -impl crate::WeightInfoT for WeightInfo { - - fn vote_on_dispute() -> Weight { - Weight::from_parts(382_002_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - - } - fn extend_dispute() -> Weight { - Weight::from_parts(382_002_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - - } - fn raise_dispute() -> Weight { - Weight::from_parts(382_002_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - - } - fn force_succeed_dispute() -> Weight { - Weight::from_parts(382_002_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - - } - fn force_fail_dispute() -> Weight { - Weight::from_parts(382_002_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - - } - fn calculate_winner() -> Weight { - Weight::from_parts(382_002_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - - } +impl pallet_disputes::WeightInfoT for WeightInfo { + /// Storage: ImbueDisputes Disputes (r:1 w:1) + /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) + /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) + /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + fn raise_dispute() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `10227` + // Minimum execution time: 427_950_000 picoseconds. + Weight::from_parts(487_417_000, 0) + .saturating_add(Weight::from_parts(0, 10227)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: ImbueDisputes Disputes (r:1 w:1) + /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) + /// Storage: ImbueDisputes DisputesFinaliseOn (r:2 w:2) + /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + fn extend_dispute() -> Weight { + // Proof Size summary in bytes: + // Measured: `250` + // Estimated: `10227` + // Minimum execution time: 531_852_000 picoseconds. + Weight::from_parts(536_740_000, 0) + .saturating_add(Weight::from_parts(0, 10227)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: ImbueDisputes Disputes (r:1 w:1) + /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) + /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) + /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: ImbueProposals Projects (r:1 w:1) + /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(3284392), added: 3286867, mode: MaxEncodedLen) + /// Storage: ImbueProposals ProjectsInDispute (r:0 w:1) + /// Proof: ImbueProposals ProjectsInDispute (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + fn vote_on_dispute() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3287857` + // Minimum execution time: 327_261_000 picoseconds. + Weight::from_parts(782_582_000, 0) + .saturating_add(Weight::from_parts(0, 3287857)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: ImbueDisputes Disputes (r:1 w:1) + /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) + /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) + /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: ImbueProposals Projects (r:1 w:1) + /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(3284392), added: 3286867, mode: MaxEncodedLen) + /// Storage: ImbueProposals ProjectsInDispute (r:0 w:1) + /// Proof: ImbueProposals ProjectsInDispute (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + fn force_fail_dispute() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3287857` + // Minimum execution time: 262_013_000 picoseconds. + Weight::from_parts(273_507_000, 0) + .saturating_add(Weight::from_parts(0, 3287857)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: ImbueDisputes Disputes (r:1 w:1) + /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) + /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) + /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: ImbueProposals Projects (r:1 w:1) + /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(3284392), added: 3286867, mode: MaxEncodedLen) + /// Storage: ImbueProposals ProjectsInDispute (r:0 w:1) + /// Proof: ImbueProposals ProjectsInDispute (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + fn force_succeed_dispute() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3287857` + // Minimum execution time: 248_587_000 picoseconds. + Weight::from_parts(250_775_000, 0) + .saturating_add(Weight::from_parts(0, 3287857)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + fn calculate_winner() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 11_804_000 picoseconds. + Weight::from_parts(13_239_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } } diff --git a/pallets/grants/Cargo.toml b/pallets/grants/Cargo.toml index 38aef491..933285a7 100644 --- a/pallets/grants/Cargo.toml +++ b/pallets/grants/Cargo.toml @@ -48,7 +48,6 @@ pallet-disputes = { path = "../disputes"} pallet-fellowship = { path = "../fellowship"} common-types = { path = "../../libs/common-types" } common-runtime = { path = "../../runtime/common" } -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.43"} [features] default = ["std"] @@ -63,15 +62,20 @@ std = [ "pallet-identity/std", "pallet-balances/std", "pallet-proposals/std", - "pallet-xcm/std", - "common-runtime/std" + "common-runtime/std", + "common-types/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "common-runtime/runtime-benchmarks" + "common-runtime/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-identity/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-proposals/runtime-benchmarks", + "pallet-disputes/runtime-benchmarks", + "pallet-fellowship/runtime-benchmarks", ] try-runtime = [ "frame-support/try-runtime", @@ -86,5 +90,4 @@ try-runtime = [ "pallet-identity/try-runtime", "pallet-proposals/try-runtime", "pallet-timestamp/try-runtime", - "pallet-xcm/try-runtime" ] diff --git a/pallets/grants/src/benchmarking.rs b/pallets/grants/src/benchmarking.rs index abecb0ab..13bcb078 100644 --- a/pallets/grants/src/benchmarking.rs +++ b/pallets/grants/src/benchmarking.rs @@ -17,6 +17,10 @@ use sp_std::{convert::TryInto, str, vec::Vec}; const SEED: u32 = 0; +#[benchmarks( where + [u8; 32]: From<::AccountId>, +)] + #[benchmarks] mod benchmarks { use super::*; diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index b7496012..b1e13b71 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -151,9 +151,6 @@ mod benchmarks { create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128) }).collect(); - dbg!(&contributors); - assert!(false); - let contributions = get_contributions::(contributors, 100_000_000_000_000_000u128); let total_amount = 100_000_000_000_000_000u128 * ::MaximumContributorsPerProject::get() as u128; let milestone_count = ::MaxMilestonesPerProject::get(); diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 5cbad5b4..3b5867ae 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -189,6 +189,7 @@ try-runtime = [ 'pallet-briefs/try-runtime', 'pallet-grants/try-runtime', 'pallet-deposits/try-runtime', + 'pallet-disputes/try-runtime', 'common-traits/try-runtime', 'common-types/try-runtime', 'pallet-proposals-rpc-runtime-api/try-runtime', @@ -256,6 +257,8 @@ std = [ 'pallet-proposals-rpc-runtime-api/std', 'pallet-briefs/std', 'pallet-grants/std', + 'pallet-fellowship/std', + 'pallet-disputes/std', ] runtime-benchmarks = [ @@ -275,6 +278,7 @@ runtime-benchmarks = [ 'pallet-briefs/runtime-benchmarks', 'pallet-grants/runtime-benchmarks', 'pallet-fellowship/runtime-benchmarks', + 'pallet-disputes/runtime-benchmarks', ] # A feature that should be enabled when the runtime should be build for on-chain diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 771516a2..75523629 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1031,7 +1031,7 @@ mod benches { [pallet_briefs, ImbueBriefs] [pallet_grants, ImbueGrants] [pallet_fellowship, ImbueFellowship] - [pallet_fellowship, ImbueDisputes] + [pallet_disputes, ImbueDisputes] ); } From 5343cb96240fb13aa2692774ab23ab95512cd9c5 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 09:27:52 +0000 Subject: [PATCH 178/192] fix all but deposits --- Cargo.lock | 2 -- pallets/deposits/Cargo.toml | 15 ++++++--------- pallets/disputes/src/benchmarking.rs | 5 +++-- pallets/fellowship/src/benchmarking.rs | 19 ++++++++++--------- pallets/grants/src/benchmarking.rs | 5 +---- pallets/proposals/Cargo.toml | 4 ++-- pallets/proposals/src/benchmarking.rs | 6 +++--- pallets/proposals/src/mock.rs | 16 +--------------- pallets/proposals/src/test_utils.rs | 2 +- pallets/proposals/src/todo | 4 ---- pallets/proposals/src/traits.rs | 2 -- 11 files changed, 27 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 616dc8c7..e80b16ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7201,7 +7201,6 @@ dependencies = [ "frame-system", "orml-tokens", "orml-traits", - "pallet-xcm", "parity-scale-codec", "scale-info", "sp-core", @@ -7655,7 +7654,6 @@ dependencies = [ "pallet-fellowship", "pallet-identity", "pallet-timestamp", - "pallet-transaction-payment", "pallet-xcm", "parity-scale-codec", "scale-info", diff --git a/pallets/deposits/Cargo.toml b/pallets/deposits/Cargo.toml index 53522cea..75133550 100644 --- a/pallets/deposits/Cargo.toml +++ b/pallets/deposits/Cargo.toml @@ -30,7 +30,6 @@ common-runtime = { path = "../../runtime/common", default-features = false} sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} -pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0"} orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } common-types = { path = "../../libs/common-types" } @@ -39,21 +38,20 @@ common-runtime = { path = "../../runtime/common"} [features] default = [ "std" ] std = [ - "codec/std", - "common-runtime/std", - "common-types/std", - "frame-benchmarking?/std", + "sp-std/std", + "frame-benchmarking/std", "frame-support/std", "frame-system/std", "orml-traits/std", + "common-types/std", + "common-runtime/std", + "codec/std", "scale-info/std", "sp-runtime/std", - "sp-std/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "common-runtime/runtime-benchmarks" + "common-runtime/runtime-benchmarks", ] try-runtime = [ "common-runtime/try-runtime", @@ -61,6 +59,5 @@ try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime", "orml-tokens/try-runtime", - "pallet-xcm/try-runtime", "sp-runtime/try-runtime", ] diff --git a/pallets/disputes/src/benchmarking.rs b/pallets/disputes/src/benchmarking.rs index 5de0da95..6e937e58 100644 --- a/pallets/disputes/src/benchmarking.rs +++ b/pallets/disputes/src/benchmarking.rs @@ -6,7 +6,8 @@ use crate::Pallet as PalletDisputes; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get, BoundedVec}; use frame_system::Pallet as System; -use sp_std::vec::Vec; +use sp_std::{vec::Vec, vec}; +use frame_system::pallet_prelude::BlockNumberFor; #[benchmarks(where Event::: Into<::RuntimeEvent>)] mod benchmarks { @@ -161,7 +162,7 @@ mod benchmarks { } pub fn get_jury( - accounts: Vec>, + accounts: Vec>, ) -> BoundedVec, ::MaxJurySize> { accounts.try_into().expect("too many jury members") } diff --git a/pallets/fellowship/src/benchmarking.rs b/pallets/fellowship/src/benchmarking.rs index 3e32bec2..cf4860bb 100644 --- a/pallets/fellowship/src/benchmarking.rs +++ b/pallets/fellowship/src/benchmarking.rs @@ -11,8 +11,9 @@ use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_runtime::SaturatedConversion; use sp_std::vec; +use frame_system::pallet_prelude::BlockNumberFor; -#[benchmarks( where BlockNumberFor: AsRef<[u8]>, crate::Event::: Into<::RuntimeEvent>)] +#[benchmarks( where AccountIdOf: AsRef<[u8]>, crate::Event::: Into<::RuntimeEvent>)] mod benchmarks { use super::*; #[benchmark] @@ -23,7 +24,7 @@ mod benchmarks { #[block] { - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); } } @@ -47,7 +48,7 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); #[extrinsic_call] leave_fellowship(RawOrigin::Signed(alice.clone())); @@ -60,7 +61,7 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); #[extrinsic_call] force_remove_and_slash_fellowship(RawOrigin::Root, alice.clone()); @@ -72,7 +73,7 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); #[extrinsic_call] add_candidate_to_shortlist(RawOrigin::Signed(alice), bob.clone(), Role::Vetter, 10); @@ -84,7 +85,7 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); assert_ok!(Fellowship::::add_candidate_to_shortlist( RawOrigin::Signed(alice.clone()).into(), bob.clone(), @@ -105,9 +106,9 @@ mod benchmarks { let charlie: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&bob, Role::Vetter, 10, Some(&charlie), true); + as FellowshipHandle>>::add_to_fellowship(&bob, Role::Vetter, 10, Some(&charlie), true); assert_ok!(, + AccountIdOf, >>::deposit( CurrencyId::Native, &bob, @@ -135,7 +136,7 @@ pub fn create_funded_user( ) -> T::AccountId { let user = account(seed, n, 0); assert_ok!(, + AccountIdOf, >>::deposit( CurrencyId::Native, &user, balance_factor.saturated_into() )); diff --git a/pallets/grants/src/benchmarking.rs b/pallets/grants/src/benchmarking.rs index f68a62c0..26944dfc 100644 --- a/pallets/grants/src/benchmarking.rs +++ b/pallets/grants/src/benchmarking.rs @@ -9,6 +9,7 @@ use common_types::{CurrencyId, TreasuryOrigin}; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get}; use frame_system::RawOrigin; +use frame_system::pallet_prelude::BlockNumberFor; use orml_traits::MultiCurrency; use pallet_proposals::ProposedMilestone; use sp_arithmetic::per_things::Percent; @@ -17,10 +18,6 @@ use sp_std::{convert::TryInto, str, vec, vec::Vec}; const SEED: u32 = 0; -#[benchmarks( where - [u8; 32]: From>, -)] - #[benchmarks] mod benchmarks { use super::*; diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 17de1dd0..8e3f6de6 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -39,6 +39,7 @@ xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-s orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } # Local Dependencies common-traits = { path = "../../libs/common-traits", default-features = false } @@ -54,7 +55,6 @@ sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "releas sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} -pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } @@ -86,6 +86,7 @@ std = [ "pallet-deposits/std", "pallet-identity/std", "pallet-timestamp/std", + "orml-currencies/std", "scale-info/std", "serde/std", "sp-api/std", @@ -117,7 +118,6 @@ try-runtime = [ "pallet-deposits/try-runtime", "pallet-identity/try-runtime", "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", "pallet-xcm/try-runtime", "sp-runtime/try-runtime", ] diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 9ac5f905..65ac6c7b 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -4,7 +4,7 @@ use crate::Pallet as Proposals; use common_types::CurrencyId; use frame_benchmarking::v2::*; use frame_support::assert_ok; -use frame_system::RawOrigin; +use frame_system::{RawOrigin, pallet_prelude::BlockNumberFor}; use sp_core::Get; use sp_runtime::SaturatedConversion; @@ -14,10 +14,10 @@ use sp_std::convert::TryInto; use pallet_disputes::DisputeResult; use pallet_disputes::traits::DisputeHooks; -use test_utils::{create_and_fund_project, assert_last_event, create_funded_user, get_contributions, get_max_milestones}; +use test_utils::{create_and_fund_project, assert_last_event, create_funded_user, get_contributions, get_max_milestones, get_milestones}; #[benchmarks( where - ::BlockNumber: From, + BlockNumberFor: From, BalanceOf: From, )] diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index 2ffe1535..b6375c08 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -15,7 +15,7 @@ use orml_traits::MultiCurrency; use sp_arithmetic::per_things::Percent; use sp_runtime::{ traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, - BuildStorage, + BuildStorage }; use sp_std::{ @@ -53,7 +53,6 @@ frame_support::construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, Tokens: orml_tokens::{Pallet, Storage, Event}, Currencies: orml_currencies::{Pallet, Call, Storage}, - TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, Proposals: pallet_proposals::{Pallet, Call, Storage, Event}, IdentityPallet: pallet_identity::{Pallet, Call, Storage, Event}, } @@ -84,19 +83,6 @@ impl orml_tokens::Config for Test { type ReserveIdentifier = [u8; 8]; } -parameter_types! { - pub const TransactionByteFee: u64 = 1; - pub const OperationalFeeMultiplier: u8 = 5; -} -impl pallet_transaction_payment::Config for Test { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; - type WeightToFee = IdentityFee; - type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = (); - type OperationalFeeMultiplier = OperationalFeeMultiplier; -} - parameter_types! { pub const BlockHashCount: u64 = 250; } diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index a38e0bb9..1b8c0cf0 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -130,7 +130,7 @@ pub fn create_funded_user( ) -> T::AccountId { let user = account(seed, n, 0); assert_ok!(, + AccountIdOf, >>::deposit( CurrencyId::Native, &user, balance_factor.saturated_into() )); diff --git a/pallets/proposals/src/todo b/pallets/proposals/src/todo index 515f0181..23cbd917 100644 --- a/pallets/proposals/src/todo +++ b/pallets/proposals/src/todo @@ -22,10 +22,6 @@ add total_refunded to withdraw extrinsic - done tests for these - done Migration for removing NoConfidenceLogic - #[pallet::storage] - #[pallet::getter(fn no_confidence_votes)] - pub(super) type NoConfidenceVotes = - StorageMap<_, Identity, ProjectKey, Vote>, OptionQuery>; Migration removing NoConfidenceRound, diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 5d83a9c3..ad232f39 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -44,10 +44,8 @@ pub trait ExternalRefundHandler { ) -> Result<(), DispatchError>; } -#[cfg(feature = "std")] pub struct MockRefundHandler(T); -#[cfg(feature = "std")] impl ExternalRefundHandler, BalanceOf, CurrencyId> for MockRefundHandler { From 998123f5f380e669ce4b4fbad1a211d0f8719014 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 09:50:48 +0000 Subject: [PATCH 179/192] fix xcm tranfers --- pallets/proposals/src/traits.rs | 6 +++--- runtime/imbue-kusama/src/lib.rs | 20 ------------------- runtime/integration-tests/Cargo.toml | 1 - .../integration-tests/src/xcm_transfers.rs | 2 +- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index ad232f39..8e0dc6db 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -14,7 +14,8 @@ pub trait IntoProposal { type MaximumContributorsPerProject: Get; type MaxMilestonesPerProject: Get; type MaxJuryMembers: Get; - /// Convert the propoerties of a project into a project. + + /// Convert the properties of a project into a project. /// This is the main method when wanting to use pallet_proposals and is how one configures a project. fn convert_to_proposal( currency_id: CurrencyId, @@ -27,7 +28,6 @@ pub trait IntoProposal { on_creation_funding: FundingPath, ) -> Result<(), DispatchError>; - /// Convert a btreemap of contributions to multilocations with the Here junction. /// Use when the contributors are the refund locations. fn convert_contributions_to_refund_locations( contributions: &BoundedBTreeMap, Self::MaximumContributorsPerProject>, @@ -62,7 +62,7 @@ impl ExternalRefundHandler, BalanceOf, Curre pub struct XcmRefundHandler(T, U); impl ExternalRefundHandler, T::Balance, CurrencyId> for XcmRefundHandler where - [u8; 32]: From>, + [u8; 32]: From>, T: orml_xtokens::Config, U: XcmTransfer, { diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 69fcf5dc..464061bd 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -890,26 +890,6 @@ impl pallet_fellowship::Config for Runtime { type WeightInfo = pallet_fellowship::weights::WeightInfo; } -parameter_types! { - pub MaxCandidatesPerShortlist: u32 = 50; - pub ShortlistPeriod: BlockNumber = 14 * DAYS; - pub MembershipDeposit: Balance = DOLLARS.saturating_mul(500); - pub DepositCurrencyId: CurrencyId = CurrencyId::Native; -} - -impl pallet_fellowship::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type MultiCurrency = Currencies; - type ForceAuthority = EnsureRootOr; - type MaxCandidatesPerShortlist = MaxCandidatesPerShortlist; - type ShortlistPeriod = ShortlistPeriod; - type MembershipDeposit = MembershipDeposit; - type DepositCurrencyId = DepositCurrencyId; - // Send slashes to the treasury. - type SlashAccount = TreasuryAccount; - type Permissions = pallet_fellowship::impls::VetterAndFreelancerAllPermissions; - type WeightInfo = pallet_fellowship::weights::WeightInfo; -} pub type DepositId = u64; pub struct ImbueDepositCalculator; diff --git a/runtime/integration-tests/Cargo.toml b/runtime/integration-tests/Cargo.toml index 5c45fb10..22e9671e 100644 --- a/runtime/integration-tests/Cargo.toml +++ b/runtime/integration-tests/Cargo.toml @@ -88,7 +88,6 @@ std = [ "sp-io/std", ] runtime-benchmarks = [ - "default", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", diff --git a/runtime/integration-tests/src/xcm_transfers.rs b/runtime/integration-tests/src/xcm_transfers.rs index 2343002f..7623439e 100644 --- a/runtime/integration-tests/src/xcm_transfers.rs +++ b/runtime/integration-tests/src/xcm_transfers.rs @@ -161,7 +161,7 @@ fn test_xcm_refund_handler_to_kusama() { let ksm_balance = OrmlTokens::free_balance(CurrencyId::KSM, &DevelopmentReceiver::get()); assert!(ksm_balance > 0); assert_ok!( - ::RefundHandler::send_refund_message_to_treasury( + ::ExternalRefundHandler::send_refund_message_to_treasury( DevelopmentReceiver::get(), ksm_balance, CurrencyId::KSM, From 71b03fd996af81e8b84d54fe3efd635c2ac3fb64 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 13:30:54 +0000 Subject: [PATCH 180/192] trying --- Cargo.lock | 2 -- pallets/proposals/Cargo.toml | 1 + runtime/common/Cargo.toml | 6 +----- runtime/integration-tests/Cargo.toml | 1 + 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e80b16ab..92a2e7b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1624,10 +1624,8 @@ dependencies = [ "common-traits", "common-types", "cumulus-primitives-core", - "frame-benchmarking", "frame-support", "frame-system", - "frame-system-benchmarking", "hex", "hex-literal 0.3.4", "orml-traits", diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 8e3f6de6..714f3e1c 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -101,6 +101,7 @@ runtime-benchmarks = [ "common-runtime/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", "pallet-deposits/runtime-benchmarks", ] try-runtime = [ diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 3e6baf27..9aee4526 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -26,8 +26,6 @@ sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release ## Polkadot SDK FRAME Dependencies frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } -frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } @@ -46,6 +44,7 @@ common-types = { path = "../../libs/common-types", default-features = false } [dev-dependencies] hex-literal = "0.3.1" hex = "0.4.3" +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } @@ -57,9 +56,7 @@ std = [ "common-traits/std", "common-types/std", "cumulus-primitives-core/std", - "frame-benchmarking?/std", "frame-support/std", - "frame-system-benchmarking?/std", "frame-system/std", "orml-traits/std", "pallet-authorship/std", @@ -85,7 +82,6 @@ try-runtime = [ ] runtime-benchmarks = [ 'frame-support/runtime-benchmarks', - "frame-system/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "pallet-balances/runtime-benchmarks", ] diff --git a/runtime/integration-tests/Cargo.toml b/runtime/integration-tests/Cargo.toml index 22e9671e..a02aaf77 100644 --- a/runtime/integration-tests/Cargo.toml +++ b/runtime/integration-tests/Cargo.toml @@ -102,6 +102,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "kusama-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", + "xcm-executor/runtime-benchmarks", "common-runtime/runtime-benchmarks" ] try-runtime = [ From 2b5d1ab9f3ffe807a4cb64627e7779de210e2f3f Mon Sep 17 00:00:00 2001 From: samelamin Date: Fri, 24 Nov 2023 14:58:06 +0000 Subject: [PATCH 181/192] fix grants benchmark tests --- pallets/grants/src/mock.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pallets/grants/src/mock.rs b/pallets/grants/src/mock.rs index 2fba3247..9b295952 100644 --- a/pallets/grants/src/mock.rs +++ b/pallets/grants/src/mock.rs @@ -106,7 +106,7 @@ impl orml_tokens::Config for Test { } parameter_types! { - pub MaxMilestonesPerGrant: u32 = 50; + pub MaxMilestonesPerGrant: u32 = 100; pub MaxApprovers: u32 = 100; pub GrantStorageItem: StorageItem = StorageItem::Grant; } @@ -160,11 +160,11 @@ impl pallet_timestamp::Config for Test { parameter_types! { pub const ProposalsPalletId: PalletId = PalletId(*b"imbgrant"); pub PercentRequiredForVoteToPass: Percent = Percent::from_percent(75u8); - pub MaximumContributorsPerProject: u32 = 50; + pub MaximumContributorsPerProject: u32 = 100; pub RefundsPerBlock: u8 = 2; pub IsIdentityRequired: bool = false; pub MilestoneVotingWindow: BlockNumber = 100800u64; - pub MaxMilestonesPerProject: u32 = 10; + pub MaxMilestonesPerProject: u32 = 100; pub ProjectStorageDeposit: Balance = 100; pub ImbueFee: Percent = Percent::from_percent(5u8); pub ExpiringProjectRoundsPerBlock: u32 = 10; @@ -242,10 +242,10 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { pub struct MockDisputeRaiser; impl pallet_disputes::traits::DisputeRaiser for MockDisputeRaiser { -type DisputeKey = pallet_proposals::ProjectKey; -type SpecificId = pallet_proposals::MilestoneKey; -type MaxJurySize = MaxJuryMembers; -type MaxSpecifics = MaxMilestonesPerProject; + type DisputeKey = pallet_proposals::ProjectKey; + type SpecificId = pallet_proposals::MilestoneKey; + type MaxJurySize = MaxJuryMembers; + type MaxSpecifics = MaxMilestonesPerProject; fn raise_dispute( dispute_key: Self::DisputeKey, raised_by: AccountId, @@ -256,7 +256,6 @@ type MaxSpecifics = MaxMilestonesPerProject; } } - pub struct MockJurySelector; impl pallet_fellowship::traits::SelectJury for MockJurySelector { type JurySize = MaxJuryMembers; From 133a467595b13dce58b7b6053f587067702c8927 Mon Sep 17 00:00:00 2001 From: samelamin Date: Fri, 24 Nov 2023 15:33:18 +0000 Subject: [PATCH 182/192] fix for proposal benchmark tests --- pallets/disputes/Cargo.toml | 20 ++-- pallets/fellowship/src/benchmarking.rs | 76 ++++++++++++---- pallets/proposals/src/benchmarking.rs | 121 +++++++++++++++---------- 3 files changed, 142 insertions(+), 75 deletions(-) diff --git a/pallets/disputes/Cargo.toml b/pallets/disputes/Cargo.toml index 5050561a..31cb8e55 100644 --- a/pallets/disputes/Cargo.toml +++ b/pallets/disputes/Cargo.toml @@ -41,16 +41,16 @@ sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = " [features] default = [ "std" ] std = [ - "codec/std", - "common-traits/std", - "common-types/std", - "frame-benchmarking?/std", - "frame-support/std", - "frame-system/std", - "orml-traits/std", - "scale-info/std", - "sp-runtime/std", - "sp-std/std", + "codec/std", + "common-traits/std", + "common-types/std", + "frame-benchmarking?/std", + "frame-support/std", + "frame-system/std", + "orml-traits/std", + "scale-info/std", + "sp-runtime/std", + "sp-std/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks" ] diff --git a/pallets/fellowship/src/benchmarking.rs b/pallets/fellowship/src/benchmarking.rs index cf4860bb..a3f77290 100644 --- a/pallets/fellowship/src/benchmarking.rs +++ b/pallets/fellowship/src/benchmarking.rs @@ -6,14 +6,14 @@ use crate::{traits::FellowshipHandle, Config, Role}; use common_types::CurrencyId; use frame_benchmarking::v2::*; use frame_support::assert_ok; +use frame_system::pallet_prelude::BlockNumberFor; use frame_system::Pallet as System; use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_runtime::SaturatedConversion; use sp_std::vec; -use frame_system::pallet_prelude::BlockNumberFor; -#[benchmarks( where AccountIdOf: AsRef<[u8]>, crate::Event::: Into<::RuntimeEvent>)] +#[benchmarks( where crate::Event::: Into<::RuntimeEvent>)] mod benchmarks { use super::*; #[benchmark] @@ -24,7 +24,13 @@ mod benchmarks { #[block] { - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship( + &alice, + Role::Vetter, + 10, + Some(&bob), + true, + ); } } @@ -48,7 +54,13 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship( + &alice, + Role::Vetter, + 10, + Some(&bob), + true, + ); #[extrinsic_call] leave_fellowship(RawOrigin::Signed(alice.clone())); @@ -61,7 +73,13 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship( + &alice, + Role::Vetter, + 10, + Some(&bob), + true, + ); #[extrinsic_call] force_remove_and_slash_fellowship(RawOrigin::Root, alice.clone()); @@ -73,7 +91,13 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship( + &alice, + Role::Vetter, + 10, + Some(&bob), + true, + ); #[extrinsic_call] add_candidate_to_shortlist(RawOrigin::Signed(alice), bob.clone(), Role::Vetter, 10); @@ -85,7 +109,13 @@ mod benchmarks { let alice: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); let bob: T::AccountId = create_funded_user::("bob", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&alice, Role::Vetter, 10, Some(&bob), true); + as FellowshipHandle>>::add_to_fellowship( + &alice, + Role::Vetter, + 10, + Some(&bob), + true, + ); assert_ok!(Fellowship::::add_candidate_to_shortlist( RawOrigin::Signed(alice.clone()).into(), bob.clone(), @@ -106,14 +136,20 @@ mod benchmarks { let charlie: T::AccountId = create_funded_user::("alice", 1, 1_000_000_000_000_000_000u128); - as FellowshipHandle>>::add_to_fellowship(&bob, Role::Vetter, 10, Some(&charlie), true); - assert_ok!(, - >>::deposit( - CurrencyId::Native, + as FellowshipHandle>>::add_to_fellowship( &bob, - 1_000_000_000_000_000_000u128.saturated_into() - )); + Role::Vetter, + 10, + Some(&charlie), + true, + ); + assert_ok!( + >>::deposit( + CurrencyId::Native, + &bob, + 1_000_000_000_000_000_000u128.saturated_into() + ) + ); #[extrinsic_call] pay_deposit_to_remove_pending_status(RawOrigin::Signed(bob.clone())); @@ -135,10 +171,12 @@ pub fn create_funded_user( balance_factor: u128, ) -> T::AccountId { let user = account(seed, n, 0); - assert_ok!(, - >>::deposit( - CurrencyId::Native, &user, balance_factor.saturated_into() - )); + assert_ok!( + >>::deposit( + CurrencyId::Native, + &user, + balance_factor.saturated_into() + ) + ); user } diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 65ac6c7b..96875564 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -4,17 +4,20 @@ use crate::Pallet as Proposals; use common_types::CurrencyId; use frame_benchmarking::v2::*; use frame_support::assert_ok; -use frame_system::{RawOrigin, pallet_prelude::BlockNumberFor}; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_core::Get; use sp_runtime::SaturatedConversion; use sp_runtime::Saturating; use sp_std::convert::TryInto; -use pallet_disputes::DisputeResult; use pallet_disputes::traits::DisputeHooks; +use pallet_disputes::DisputeResult; -use test_utils::{create_and_fund_project, assert_last_event, create_funded_user, get_contributions, get_max_milestones, get_milestones}; +use test_utils::{ + assert_last_event, create_and_fund_project, create_funded_user, get_contributions, + get_max_milestones, get_milestones, +}; #[benchmarks( where BlockNumberFor: From, @@ -37,7 +40,8 @@ mod benchmarks { contributions, prop_milestones, CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); #[extrinsic_call] submit_milestone(RawOrigin::Signed(bob), project_key, 0); @@ -46,19 +50,18 @@ mod benchmarks { #[benchmark] fn vote_on_milestone() { - let alice: T::AccountId = - create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = - create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); + let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000u128); + let bob: T::AccountId = create_funded_user::("contributor", 1, 1_000_000_000_000u128); // TODO: should update the contributors list to have maximum available length - let contributions = get_contributions::(vec![bob.clone()], 100_000_000_000_000_000u128); + let contributions = get_contributions::(vec![bob.clone()], 1_000_000_000_000u128); let prop_milestones = get_max_milestones::(); let project_key = create_and_fund_project::( alice.clone(), contributions, prop_milestones, CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); assert_ok!(Proposals::::submit_milestone( RawOrigin::Signed(alice).into(), @@ -70,7 +73,7 @@ mod benchmarks { vote_on_milestone(RawOrigin::Signed(bob.clone()), project_key, 0, true); let current_block = frame_system::Pallet::::block_number(); assert_last_event::( - Event::::VoteSubmitted(bob, project_key, 0, true, current_block).into(), + Event::::MilestoneApproved(bob, project_key, 0, current_block).into(), ) } @@ -91,7 +94,8 @@ mod benchmarks { contributions, prop_milestones, CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); for milestone_key in 0..milestone_count { // The initiator submits a milestone @@ -117,7 +121,7 @@ mod benchmarks { #[extrinsic_call] withdraw(RawOrigin::Signed(alice.clone()), project_key); assert_last_event::( - Event::::ProjectFundsWithdrawn(alice, project_key, withdrawn, CurrencyId::Native) + Event::::ProjectFundsWithdrawn(alice, project_key, raised_funds, CurrencyId::Native) .into(), ); } @@ -142,69 +146,94 @@ mod benchmarks { #[benchmark] fn raise_dispute() { - let alice: T::AccountId = - create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = - create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); - - let contributors: Vec = (0..::MaximumContributorsPerProject::get()).map(|i| { - create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128) - }).collect(); - - let contributions = get_contributions::(contributors, 100_000_000_000_000_000u128); - let total_amount = 100_000_000_000_000_000u128 * ::MaximumContributorsPerProject::get() as u128; + let contribution_amount = 1_000_000_000_000u128; + let alice: T::AccountId = create_funded_user::("initiator", 1, contribution_amount); + let bob: T::AccountId = create_funded_user::("contributor", 0, contribution_amount); + + let contributors: Vec = (0 + ..::MaximumContributorsPerProject::get()) + .map(|i| create_funded_user::("contributor", i, contribution_amount)) + .collect(); + + let contributions = get_contributions::(contributors, contribution_amount); + let total_amount = + contribution_amount * ::MaximumContributorsPerProject::get() as u128; let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..prop_milestones.len() as u32).collect::>().try_into().unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..prop_milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); let project_key = create_and_fund_project::( alice.clone(), contributions, prop_milestones, CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); #[extrinsic_call] - raise_dispute(RawOrigin::Signed(bob.clone()), project_key, milestone_keys.clone()); + raise_dispute( + RawOrigin::Signed(bob.clone()), + project_key, + milestone_keys.clone(), + ); } - #[benchmark] fn refund() { - let alice: T::AccountId = - create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = - create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); - - let contributors: Vec = (0..::MaximumContributorsPerProject::get()).map(|i| { - create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128) - }).collect(); - - let contributions = get_contributions::(contributors, 100_000_000_000u128); - let total_amount = 100_000_000_000u128 * ::MaximumContributorsPerProject::get() as u128; + let contribution_amount = 1_000_000_000_000u128; + let alice: T::AccountId = create_funded_user::("initiator", 1, contribution_amount); + let bob: T::AccountId = create_funded_user::("contributor", 0, contribution_amount); + + let contributors: Vec = (0 + ..::MaximumContributorsPerProject::get()) + .map(|i| create_funded_user::("contributor", i, contribution_amount)) + .collect(); + + let contributions = get_contributions::(contributors, contribution_amount); + let total_amount = + contribution_amount * ::MaximumContributorsPerProject::get() as u128; let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..prop_milestones.len() as u32).collect::>().try_into().unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..prop_milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); let project_key = create_and_fund_project::( alice.clone(), contributions, prop_milestones, CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); - assert_ok!(crate::Pallet::::raise_dispute(RawOrigin::Signed(bob.clone()).into(), project_key, milestone_keys.clone())); - let _ = as DisputeHooks>::on_dispute_complete(project_key, milestone_keys.into_inner(), DisputeResult::Success); + assert_ok!(crate::Pallet::::raise_dispute( + RawOrigin::Signed(bob.clone()).into(), + project_key, + milestone_keys.clone() + )); + let _ = as DisputeHooks>::on_dispute_complete( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); #[extrinsic_call] refund(RawOrigin::Signed(bob.clone()), project_key); assert_last_event::( - Event::::ProjectRefunded{project_key, total_amount: (total_amount as u64).into()} - .into(), + Event::::ProjectRefunded { + project_key, + total_amount: (total_amount as u64).into(), + } + .into(), ); } - impl_benchmark_test_suite!( Proposals, crate::mock::build_test_externality(), From 8b49a873eaccd514bba8b97b2ae1ca23ff136b63 Mon Sep 17 00:00:00 2001 From: samelamin Date: Fri, 24 Nov 2023 16:08:33 +0000 Subject: [PATCH 183/192] cargo fmt --- Cargo.lock | 1 + libs/common-types/src/milestone_origin.rs | 10 +- pallets/briefs/src/lib.rs | 35 +- pallets/briefs/src/mock.rs | 9 +- pallets/deposits/src/lib.rs | 4 +- pallets/disputes/src/benchmarking.rs | 4 +- pallets/disputes/src/lib.rs | 5 +- pallets/fellowship/src/lib.rs | 2 +- pallets/fellowship/src/migration.rs | 18 +- pallets/fellowship/src/tests/pallet_tests.rs | 1 - pallets/grants/src/benchmarking.rs | 2 +- pallets/grants/src/lib.rs | 50 +-- pallets/proposals/Cargo.toml | 4 +- pallets/proposals/src/impls/pallet_impls.rs | 83 ++--- pallets/proposals/src/lib.rs | 170 ++++++--- pallets/proposals/src/migration.rs | 44 ++- pallets/proposals/src/mock.rs | 16 +- pallets/proposals/src/test_utils.rs | 37 +- pallets/proposals/src/tests/disputes.rs | 327 ++++++++++++++---- pallets/proposals/src/tests/into_proposals.rs | 1 + pallets/proposals/src/tests/mod.rs | 4 +- pallets/proposals/src/tests/pallet.rs | 106 ++++-- pallets/proposals/src/tests/refunds.rs | 302 ++++++++++++---- pallets/proposals/src/traits.rs | 25 +- runtime/imbue-kusama/src/lib.rs | 17 +- .../integration-tests/src/xcm_transfers.rs | 11 +- 26 files changed, 879 insertions(+), 409 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92a2e7b8..2b315cd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7638,6 +7638,7 @@ dependencies = [ "frame-executive", "frame-support", "frame-system", + "frame-system-benchmarking", "hex", "integer-sqrt", "lite-json", diff --git a/libs/common-types/src/milestone_origin.rs b/libs/common-types/src/milestone_origin.rs index 4fbf06f5..8ffd7b09 100644 --- a/libs/common-types/src/milestone_origin.rs +++ b/libs/common-types/src/milestone_origin.rs @@ -1,19 +1,15 @@ use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::{sp_runtime::traits::AccountIdConversion, PalletId}; use scale_info::TypeInfo; use xcm::latest::{Junction, Junctions::*, MultiLocation}; -use frame_support::{PalletId, sp_runtime::traits::AccountIdConversion}; /// A wrapper around pub trait TreasuryOriginConverter { - fn get_multi_location( - &self, - ) -> Result; + fn get_multi_location(&self) -> Result; } impl TreasuryOriginConverter for TreasuryOrigin { - fn get_multi_location( - &self, - ) -> Result { + fn get_multi_location(&self) -> Result { match &self { TreasuryOrigin::Kusama => Ok(MultiLocation::new( 1, diff --git a/pallets/briefs/src/lib.rs b/pallets/briefs/src/lib.rs index c5c8750d..88588a5f 100644 --- a/pallets/briefs/src/lib.rs +++ b/pallets/briefs/src/lib.rs @@ -24,20 +24,20 @@ mod test_utils; #[frame_support::pallet] pub mod pallet { - use common_types::{CurrencyId}; + use common_types::CurrencyId; use frame_support::{ pallet_prelude::*, sp_runtime::Saturating, traits::Get, weights::Weight, BoundedBTreeMap, }; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_deposits::traits::DepositHandler; + use pallet_fellowship::traits::SelectJury; use pallet_proposals::traits::IntoProposal; - use pallet_proposals::{Contribution, ProposedMilestone, FundingPath}; + use pallet_proposals::{Contribution, FundingPath, ProposedMilestone}; use sp_arithmetic::per_things::Percent; use sp_core::H256; use sp_runtime::traits::Zero; use sp_std::convert::{From, TryInto}; - use pallet_fellowship::traits::SelectJury; pub(crate) type AccountIdOf = ::AccountId; pub(crate) type BalanceOf = @@ -85,7 +85,7 @@ pub mod pallet { type DepositHandler: DepositHandler, AccountIdOf>; /// The type that selects a list of jury members. type JurySelector: SelectJury>; - /// The weight info for the extrinsics. + /// The weight info for the extrinsics. type WeightInfo: WeightInfoT; } @@ -296,17 +296,34 @@ pub mod pallet { let contributions = BriefContributions::::get(brief_id); ::DepositHandler::return_deposit(brief.deposit_id)?; - - let refund_locations = ::IntoProposal::convert_contributions_to_refund_locations(&contributions.clone().into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?); + + let refund_locations = + ::IntoProposal::convert_contributions_to_refund_locations( + &contributions + .clone() + .into_inner() + .try_into() + .map_err(|_| Error::::TooManyBriefOwners)?, + ); ::IntoProposal::convert_to_proposal( brief.currency_id, - contributions.into_inner().try_into().map_err(|_|Error::::TooManyBriefOwners)?, + contributions + .into_inner() + .try_into() + .map_err(|_| Error::::TooManyBriefOwners)?, brief_id, brief.applicant, - brief.milestones.to_vec().try_into().map_err(|_|Error::::TooManyMilestones)?, + brief + .milestones + .to_vec() + .try_into() + .map_err(|_| Error::::TooManyMilestones)?, refund_locations, - >>::select_jury().to_vec().try_into().map_err(|_|Error::::TooManyMilestones)?, + >>::select_jury() + .to_vec() + .try_into() + .map_err(|_| Error::::TooManyMilestones)?, FundingPath::TakeFromReserved, )?; diff --git a/pallets/briefs/src/mock.rs b/pallets/briefs/src/mock.rs index 65d7ff8c..2d67a24b 100644 --- a/pallets/briefs/src/mock.rs +++ b/pallets/briefs/src/mock.rs @@ -318,10 +318,10 @@ impl pallet_fellowship::traits::SelectJury for MockJurySelector { pub struct MockDisputeRaiser; impl pallet_disputes::traits::DisputeRaiser for MockDisputeRaiser { -type DisputeKey = u32; -type SpecificId = u32; -type MaxJurySize = MaxJuryMembers; -type MaxSpecifics = MaxMilestonesPerProject; + type DisputeKey = u32; + type SpecificId = u32; + type MaxJurySize = MaxJuryMembers; + type MaxSpecifics = MaxMilestonesPerProject; fn raise_dispute( _dispute_key: Self::DisputeKey, _raised_by: AccountId, @@ -331,4 +331,3 @@ type MaxSpecifics = MaxMilestonesPerProject; Ok(()) } } - diff --git a/pallets/deposits/src/lib.rs b/pallets/deposits/src/lib.rs index 2a9a11ff..90cbc2d1 100644 --- a/pallets/deposits/src/lib.rs +++ b/pallets/deposits/src/lib.rs @@ -19,14 +19,14 @@ pub mod pallet { use codec::{FullCodec, FullEncode}; use common_types::CurrencyId; use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::BlockNumberFor; use orml_traits::{BalanceStatus, MultiCurrency, MultiReservableCurrency}; use sp_runtime::{ traits::{AtLeast32BitUnsigned, One}, Saturating, }; - use frame_system::pallet_prelude::BlockNumberFor; use sp_std::fmt::Debug; - + pub(crate) type AccountIdOf = ::AccountId; pub(crate) type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; diff --git a/pallets/disputes/src/benchmarking.rs b/pallets/disputes/src/benchmarking.rs index 6e937e58..b74ad1bf 100644 --- a/pallets/disputes/src/benchmarking.rs +++ b/pallets/disputes/src/benchmarking.rs @@ -5,9 +5,9 @@ use crate::traits::DisputeRaiser; use crate::Pallet as PalletDisputes; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get, BoundedVec}; -use frame_system::Pallet as System; -use sp_std::{vec::Vec, vec}; use frame_system::pallet_prelude::BlockNumberFor; +use frame_system::Pallet as System; +use sp_std::{vec, vec::Vec}; #[benchmarks(where Event::: Into<::RuntimeEvent>)] mod benchmarks { diff --git a/pallets/disputes/src/lib.rs b/pallets/disputes/src/lib.rs index 54edd11c..f5eb3566 100644 --- a/pallets/disputes/src/lib.rs +++ b/pallets/disputes/src/lib.rs @@ -21,11 +21,10 @@ pub mod pallet { use frame_system::pallet_prelude::*; use sp_runtime::traits::{AtLeast32BitUnsigned, Saturating, Zero}; use sp_std::fmt::Debug; - + pub type AccountIdOf = ::AccountId; - pub type BoundedVotes = - BoundedBTreeMap, bool, ::MaxJurySize>; + pub type BoundedVotes = BoundedBTreeMap, bool, ::MaxJurySize>; #[pallet::pallet] pub struct Pallet(_); diff --git a/pallets/fellowship/src/lib.rs b/pallets/fellowship/src/lib.rs index 1c8514b2..6791e02b 100644 --- a/pallets/fellowship/src/lib.rs +++ b/pallets/fellowship/src/lib.rs @@ -110,7 +110,7 @@ pub mod pallet { pub type FellowToVetter = StorageMap<_, Blake2_128Concat, AccountIdOf, VetterIdOf, OptionQuery>; - /// Jury pointer for setting the mark at which fellows have been selected for jury. + /// Jury pointer for setting the mark at which fellows have been selected for jury. #[pallet::storage] pub type JuryPointer = StorageValue<_, u128, ValueQuery>; diff --git a/pallets/fellowship/src/migration.rs b/pallets/fellowship/src/migration.rs index 088be972..c4ebcad9 100644 --- a/pallets/fellowship/src/migration.rs +++ b/pallets/fellowship/src/migration.rs @@ -1,12 +1,12 @@ use super::*; use frame_support::traits::OnRuntimeUpgrade; -use frame_support::{*, pallet_prelude::*}; +use frame_support::{pallet_prelude::*, *}; use frame_system::pallet_prelude::BlockNumberFor; use hex_literal::hex; use sp_runtime::AccountId32; -use sp_std::{vec::Vec, vec}; +use sp_std::{vec, vec::Vec}; -use crate::{traits::*}; +use crate::traits::*; pub mod v0 { use super::*; @@ -18,11 +18,7 @@ pub mod v0 { { pub fn insert_initial_fellows( weight: &mut Weight, - initial_fellows: Vec<( - AccountIdOf, - crate::Role, - crate::Rank, - )>, + initial_fellows: Vec<(AccountIdOf, crate::Role, crate::Rank)>, ) { for (acc, role, rank) in initial_fellows.into_iter() { as FellowshipHandle>>::add_to_fellowship( @@ -31,11 +27,7 @@ pub mod v0 { *weight = weight.saturating_add(T::WeightInfo::add_to_fellowship()) } } - pub fn get_initial_fellows() -> Vec<( - AccountIdOf, - crate::Role, - crate::Rank, - )> { + pub fn get_initial_fellows() -> Vec<(AccountIdOf, crate::Role, crate::Rank)> { vec![ // EARNEST //"5Da1Fna8wvgQNmCFPhcRGR9oxmhyPd7MNhPZADq2X6GiKkkr", diff --git a/pallets/fellowship/src/tests/pallet_tests.rs b/pallets/fellowship/src/tests/pallet_tests.rs index 0ccae4d9..769e576c 100644 --- a/pallets/fellowship/src/tests/pallet_tests.rs +++ b/pallets/fellowship/src/tests/pallet_tests.rs @@ -623,4 +623,3 @@ fn e2e() { assert_eq!(Roles::::get(EMPTY).unwrap(), (Role::Freelancer, 10)); }); } - diff --git a/pallets/grants/src/benchmarking.rs b/pallets/grants/src/benchmarking.rs index 26944dfc..0c8450b7 100644 --- a/pallets/grants/src/benchmarking.rs +++ b/pallets/grants/src/benchmarking.rs @@ -8,8 +8,8 @@ use crate::{BoundedApprovers, BoundedPMilestones, Config}; use common_types::{CurrencyId, TreasuryOrigin}; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get}; -use frame_system::RawOrigin; use frame_system::pallet_prelude::BlockNumberFor; +use frame_system::RawOrigin; use orml_traits::MultiCurrency; use pallet_proposals::ProposedMilestone; use sp_arithmetic::per_things::Percent; diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index 0752040e..a776fce7 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -29,7 +29,7 @@ pub mod pallet { use frame_support::{pallet_prelude::*, BoundedVec}; use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; - use pallet_proposals::{traits::IntoProposal, Contribution, ProposedMilestone, Locality}; + use pallet_proposals::{traits::IntoProposal, Contribution, Locality, ProposedMilestone}; use sp_arithmetic::{per_things::Percent, traits::One}; use sp_core::H256; use sp_runtime::Saturating; @@ -104,8 +104,7 @@ pub mod pallet { } #[pallet::call] - impl Pallet - { + impl Pallet { /// Instead of iterating, create a project from the parameters of a grant. #[pallet::call_index(5)] #[pallet::weight(T::WeightInfo::create_and_convert())] @@ -132,34 +131,43 @@ pub mod pallet { ); let mut contributions = BTreeMap::new(); - let _ = assigned_approvers - .iter() - .for_each(|approver_id| { - contributions.insert( - approver_id.clone(), - Contribution { - value: amount_requested / (assigned_approvers.len() as u32).into(), - timestamp: frame_system::Pallet::::block_number(), - }, - ); - }); - + let _ = assigned_approvers.iter().for_each(|approver_id| { + contributions.insert( + approver_id.clone(), + Contribution { + value: amount_requested / (assigned_approvers.len() as u32).into(), + timestamp: frame_system::Pallet::::block_number(), + }, + ); + }); - let treasury_multilocation = ::get_multi_location(&treasury_origin).map_err(|_| Error::::InvalidTreasuryOrigin)?; - let refund_locations = sp_std::vec![(Locality::Foreign(treasury_multilocation), Percent::from_parts(100u8))]; + let treasury_multilocation = + ::get_multi_location(&treasury_origin) + .map_err(|_| Error::::InvalidTreasuryOrigin)?; + let refund_locations = sp_std::vec![( + Locality::Foreign(treasury_multilocation), + Percent::from_parts(100u8) + )]; ::IntoProposal::convert_to_proposal( currency_id, - contributions.try_into().map_err(|_| Error::::TooManyApprovers)?, + contributions + .try_into() + .map_err(|_| Error::::TooManyApprovers)?, grant_id, submitter.clone(), proposed_milestones .to_vec() .try_into() .map_err(|_| Error::::TooManyMilestones)?, - refund_locations.try_into().map_err(|_| Error::::TooManyApprovers)?, - assigned_approvers.to_vec().try_into().map_err(|_| Error::::TooManyApprovers)?, - pallet_proposals::FundingPath::WaitForFunding + refund_locations + .try_into() + .map_err(|_| Error::::TooManyApprovers)?, + assigned_approvers + .to_vec() + .try_into() + .map_err(|_| Error::::TooManyApprovers)?, + pallet_proposals::FundingPath::WaitForFunding, )?; GrantsSubmittedBy::::insert(&submitter, grant_id, ()); diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 714f3e1c..95ca91c5 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -26,6 +26,7 @@ sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "rel sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } +frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } @@ -54,7 +55,6 @@ serde = { version = "1.0.101" } sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"} orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0" } @@ -100,6 +100,8 @@ std = [ runtime-benchmarks = [ "common-runtime/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", + 'frame-support/runtime-benchmarks', + 'frame-system-benchmarking/runtime-benchmarks', "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "pallet-deposits/runtime-benchmarks", diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 02834a13..4e6cd34f 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -1,10 +1,7 @@ use crate::*; +use pallet_disputes::{traits::DisputeHooks, DisputeResult}; use scale_info::prelude::format; use sp_runtime::traits::{Saturating, Zero}; -use pallet_disputes::{ - traits::DisputeHooks, - DisputeResult, -}; impl Pallet { /// The account ID of the fund pot. @@ -76,7 +73,7 @@ impl Pallet { Rounds::::contains_key((project_key, milestone_key), RoundType::VotingRound), Error::::VotingRoundNotStarted ); - + let contribution_amount = project .contributions .get(&who) @@ -138,17 +135,22 @@ impl Pallet { ensure!(!project.cancelled, Error::::ProjectWithdrawn); ensure!(who == project.initiator, Error::::UserIsNotInitiator); - let withdrawable = Projects::::try_mutate_exists(project_key, |maybe_project|{ + let withdrawable = Projects::::try_mutate_exists(project_key, |maybe_project| { if let Some(project) = maybe_project { - let withdrawable_percent: Percent = project.milestones.iter_mut().map(|(_key, mut ms)|{ - if ms.is_approved && ms.transfer_status == None { - ms.transfer_status = Some(TransferStatus::Withdrawn{on: frame_system::Pallet::::block_number()}); - ms.percentage_to_unlock - } else { - ::zero() - } - - }).fold(::zero(), |acc, item| acc + item); + let withdrawable_percent: Percent = project + .milestones + .iter_mut() + .map(|(_key, mut ms)| { + if ms.is_approved && ms.transfer_status == None { + ms.transfer_status = Some(TransferStatus::Withdrawn { + on: frame_system::Pallet::::block_number(), + }); + ms.percentage_to_unlock + } else { + ::zero() + } + }) + .fold(::zero(), |acc, item| acc + item); ensure!( withdrawable_percent != Zero::zero(), @@ -160,14 +162,14 @@ impl Pallet { let initiator_payment = withdrawable.saturating_sub(fee); let project_account = Self::project_account_id(project_key); - // Take the fee and send to ImbueFeeAccount + // Take the fee and send to ImbueFeeAccount T::MultiCurrency::transfer( project.currency_id, &project_account, &::ImbueFeeAccount::get(), fee, )?; - + // Transfer to initiator T::MultiCurrency::transfer( project.currency_id, @@ -177,8 +179,12 @@ impl Pallet { )?; project.withdrawn_funds = project.withdrawn_funds.saturating_add(withdrawable); - - if project.withdrawn_funds.saturating_add(project.refunded_funds) == project.raised_funds { + + if project + .withdrawn_funds + .saturating_add(project.refunded_funds) + == project.raised_funds + { ::DepositHandler::return_deposit(project.deposit_id)?; CompletedProjects::::try_mutate( &project.initiator, @@ -194,7 +200,7 @@ impl Pallet { Ok::, DispatchError>(withdrawable) } else { Ok::, DispatchError>( as Zero>::zero()) - } + } })?; Self::deposit_event(Event::ProjectFundsWithdrawn( @@ -208,7 +214,7 @@ impl Pallet { } /// Try and fund a project based on its FundingPath. - /// Will error is the + /// Will error is the /// If the funds have actually been transferred this will return and Ok(true) /// If the funds have not been transferred (i.e awaiting funding) then it will return Ok(false) pub(crate) fn fund_project<'a>( @@ -248,9 +254,9 @@ impl Pallet { let milestone = Milestone::new( project_key, milestone_key, - proposed_milestone.percentage_to_unlock + proposed_milestone.percentage_to_unlock, ); - + milestones .try_insert(milestone_key, milestone) .map_err(|_| Error::::TooManyMilestones)?; @@ -321,8 +327,6 @@ impl Pallet { Ok(()) } - - } impl DisputeHooks for Pallet { @@ -332,36 +336,35 @@ impl DisputeHooks for Pallet { dispute_result: pallet_disputes::pallet::DisputeResult, ) -> Weight { ProjectsInDispute::::remove(project_key); - Projects::::mutate(project_key, |maybe_project|{ - match maybe_project { - Some(project) => { + Projects::::mutate(project_key, |maybe_project| { + match maybe_project { + Some(project) => { match dispute_result { DisputeResult::Success => { for milestone_key in specifics.iter() { if let Some(milestone) = project.milestones.get_mut(milestone_key) { - // Shouldnt be needed but nice to have this check. - // Will prevent someone calling both refund and withdraw on the same milestone. - if milestone.transfer_status == None { - milestone.can_refund = true; + // Shouldnt be needed but nice to have this check. + // Will prevent someone calling both refund and withdraw on the same milestone. + if milestone.transfer_status == None { + milestone.can_refund = true; + } } } - } - }, + } DisputeResult::Failure => { // I Guess do nothing.. ProjectsInDispute gets cleared regardless allowing further disputes. - }, + } }; - }, - // Looks like the project was deleted somehow during the dispute. + } + // Looks like the project was deleted somehow during the dispute. // The only way this is possible is through a refund or final withdraw. // Not a massive issue as either way the project has been finalised. // Just ignore and return weight. - None => { - } + None => {} } }); // ProjectsInDispute::remove // Projects::mutate - return T::DbWeight::get().reads_writes(2, 2) + return T::DbWeight::get().reads_writes(2, 2); } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 2f3b9e48..8d0789c3 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -1,8 +1,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use codec::{Decode, Encode, EncodeLike}; use common_traits::MaybeConvert; use common_types::CurrencyId; -use codec::{Decode, Encode, EncodeLike}; use frame_support::{ pallet_prelude::*, storage::bounded_btree_map::BoundedBTreeMap, traits::EnsureOrigin, PalletId, }; @@ -10,8 +10,8 @@ use frame_system::pallet_prelude::*; use orml_traits::{MultiCurrency, MultiReservableCurrency}; pub use pallet::*; use pallet_deposits::traits::DepositHandler; -use pallet_fellowship::{traits::EnsureRole, Role}; use pallet_disputes::traits::DisputeRaiser; +use pallet_fellowship::{traits::EnsureRole, Role}; use scale_info::TypeInfo; use sp_arithmetic::per_things::Percent; use sp_core::H256; @@ -20,7 +20,10 @@ use sp_std::{collections::btree_map::*, convert::TryInto, prelude::*}; use xcm::latest::MultiLocation; pub mod traits; -use traits::{IntoProposal, ExternalRefundHandler}; +use traits::{ExternalRefundHandler, IntoProposal}; + +#[cfg(test)] +pub(crate) mod tests; #[cfg(any(feature = "runtime-benchmarks", test))] mod mock; @@ -31,9 +34,6 @@ mod benchmarking; #[cfg(any(feature = "runtime-benchmarks", test))] mod test_utils; -#[cfg(test)] -pub(crate) mod tests; - pub mod weights; pub use weights::*; @@ -58,11 +58,16 @@ pub type StorageItemOf = <::DepositHandler as DepositHandler, AccountIdOf>>::StorageItem; pub type DepositIdOf = <::DepositHandler as DepositHandler, AccountIdOf>>::DepositId; -pub type MaxJuryOf = <::JurySelector as pallet_fellowship::traits::SelectJury>>::JurySize; +pub type MaxJuryOf = <::JurySelector as pallet_fellowship::traits::SelectJury< + AccountIdOf, +>>::JurySize; // These are the bounded types which are suitable for handling user input due to their restriction of vector length. -type BoundedBTreeMilestones = - BoundedBTreeMap>, ::MaxMilestonesPerProject>; +type BoundedBTreeMilestones = BoundedBTreeMap< + MilestoneKey, + Milestone>, + ::MaxMilestonesPerProject, +>; pub type BoundedProposedMilestones = BoundedVec::MaxMilestonesPerProject>; pub type AgreementHash = H256; @@ -107,13 +112,23 @@ pub mod pallet { /// The account the imbue fee goes to. type ImbueFeeAccount: Get>; /// The type responisble for handling refunds. - type ExternalRefundHandler: traits::ExternalRefundHandler, BalanceOf, CurrencyId>; + type ExternalRefundHandler: traits::ExternalRefundHandler< + AccountIdOf, + BalanceOf, + CurrencyId, + >; /// The type responsible for storage deposits. type DepositHandler: DepositHandler, AccountIdOf>; /// The type that will be used to calculate the deposit of a project. type ProjectStorageItem: Get>; /// The trait that handler the raising of a dispute. - type DisputeRaiser: DisputeRaiser, DisputeKey = ProjectKey, SpecificId = MilestoneKey, MaxSpecifics = Self::MaxMilestonesPerProject, MaxJurySize = MaxJuryOf>; + type DisputeRaiser: DisputeRaiser< + AccountIdOf, + DisputeKey = ProjectKey, + SpecificId = MilestoneKey, + MaxSpecifics = Self::MaxMilestonesPerProject, + MaxJurySize = MaxJuryOf, + >; /// The jury selector type which is defining the max jury size. type JurySelector: pallet_fellowship::traits::SelectJury>; /// The origin responsible for setting the address responsible for minting tokens. @@ -240,7 +255,10 @@ pub mod pallet { /// This milestone has been rejected. MilestoneRejected(ProjectKey, MilestoneKey), /// A project has been refunded either partially or completely. - ProjectRefunded{project_key: ProjectKey, total_amount: BalanceOf}, + ProjectRefunded { + project_key: ProjectKey, + total_amount: BalanceOf, + }, /// Foreign Asset Signer Changed ForeignAssetSignerChanged(T::AccountId), /// Foreign Asset Signer Changed @@ -415,15 +433,33 @@ pub mod pallet { ) -> DispatchResult { let who = ensure_signed(origin)?; let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; - ensure!(milestone_keys.iter().all(|ms_key|project.milestones.contains_key(ms_key)), Error::::MilestoneDoesNotExist); - ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanRaiseDispute); - ensure!(!ProjectsInDispute::::contains_key(&project_key), Error::::MilestonesAlreadyInDispute); ensure!( - !project.milestones.iter().any(|(milestone_key, milestone)|{milestone_keys.contains(milestone_key) && milestone.is_approved}), + milestone_keys + .iter() + .all(|ms_key| project.milestones.contains_key(ms_key)), + Error::::MilestoneDoesNotExist + ); + ensure!( + project.contributions.contains_key(&who), + Error::::OnlyContributorsCanRaiseDispute + ); + ensure!( + !ProjectsInDispute::::contains_key(&project_key), + Error::::MilestonesAlreadyInDispute + ); + ensure!( + !project.milestones.iter().any(|(milestone_key, milestone)| { + milestone_keys.contains(milestone_key) && milestone.is_approved + }), Error::::CannotRaiseDisputeOnApprovedMilestone ); - ::DisputeRaiser::raise_dispute(project_key, who, project.jury, milestone_keys.clone())?; + ::DisputeRaiser::raise_dispute( + project_key, + who, + project.jury, + milestone_keys.clone(), + )?; ProjectsInDispute::::insert(project_key, milestone_keys); Ok(().into()) @@ -433,32 +469,40 @@ pub mod pallet { /// Will only refund milestones that have can_refund set to true. #[pallet::call_index(15)] #[pallet::weight(::WeightInfo::refund())] - pub fn refund( - origin: OriginFor, - project_key: ProjectKey, - ) -> DispatchResult { + pub fn refund(origin: OriginFor, project_key: ProjectKey) -> DispatchResult { let who = ensure_signed(origin)?; let project = Projects::::get(project_key).ok_or(Error::::ProjectDoesNotExist)?; - ensure!(project.contributions.contains_key(&who), Error::::OnlyContributorsCanInitiateRefund); + ensure!( + project.contributions.contains_key(&who), + Error::::OnlyContributorsCanInitiateRefund + ); let project_account = Self::project_account_id(project_key); - Projects::::try_mutate_exists(project_key, |maybe_project|{ + Projects::::try_mutate_exists(project_key, |maybe_project| { if let Some(project) = maybe_project { let mut total_to_refund_including_fee: BalanceOf = Zero::zero(); for (ms_key, mut ms) in project.milestones.iter_mut() { if ms.can_refund && ms.transfer_status.is_none() { - let milestone_amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); - total_to_refund_including_fee = total_to_refund_including_fee.saturating_add(milestone_amount); - ms.transfer_status = Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()}); + let milestone_amount = + ms.percentage_to_unlock.mul_floor(project.raised_funds); + total_to_refund_including_fee = + total_to_refund_including_fee.saturating_add(milestone_amount); + ms.transfer_status = Some(TransferStatus::Refunded { + on: frame_system::Pallet::::block_number(), + }); } } // Just so we dont multiply by zero. - ensure!(total_to_refund_including_fee != Zero::zero(), Error::::NoAvailableFundsToWithdraw); - - let fee = ::ImbueFee::get().mul_floor(total_to_refund_including_fee); - // Take the fee and send to ImbueFeeAccount + ensure!( + total_to_refund_including_fee != Zero::zero(), + Error::::NoAvailableFundsToWithdraw + ); + + let fee = + ::ImbueFee::get().mul_floor(total_to_refund_including_fee); + // Take the fee and send to ImbueFeeAccount T::MultiCurrency::transfer( project.currency_id, &project_account, @@ -467,7 +511,7 @@ pub mod pallet { )?; let total_to_refund = total_to_refund_including_fee.saturating_sub(fee); - + for (refund_location, percent_share) in &project.refund_locations { let per_refund = percent_share.mul_floor(total_to_refund); match refund_location { @@ -478,7 +522,7 @@ pub mod pallet { &acc, per_refund, )?; - }, + } Locality::Foreign(multilocation) => { T::ExternalRefundHandler::send_refund_message_to_treasury( // TODO: change this to reference so that we dont have to clone.... @@ -489,14 +533,22 @@ pub mod pallet { )?; } } - } - project.refunded_funds = project.refunded_funds.saturating_add(total_to_refund_including_fee); - if project.refunded_funds.saturating_add(project.withdrawn_funds) == project.raised_funds { + project.refunded_funds = project + .refunded_funds + .saturating_add(total_to_refund_including_fee); + if project + .refunded_funds + .saturating_add(project.withdrawn_funds) + == project.raised_funds + { *maybe_project = None; } - Self::deposit_event(Event::::ProjectRefunded {project_key, total_amount: total_to_refund_including_fee}); + Self::deposit_event(Event::::ProjectRefunded { + project_key, + total_amount: total_to_refund_including_fee, + }); Ok::<(), DispatchError>(()) } else { Ok::<(), DispatchError>(()) @@ -568,7 +620,10 @@ pub mod pallet { agreement_hash: H256, benificiary: AccountIdOf, proposed_milestones: BoundedVec, - refund_locations: BoundedVec<(Locality>, Percent), Self::MaximumContributorsPerProject>, + refund_locations: BoundedVec< + (Locality>, Percent), + Self::MaximumContributorsPerProject, + >, jury: BoundedVec, Self::MaxJuryMembers>, on_creation_funding: FundingPath, ) -> Result<(), DispatchError> { @@ -598,14 +653,14 @@ pub mod pallet { .fold(Default::default(), |acc: BalanceOf, x| { acc.saturating_add(x.value) }); - + let bounded_milestone_keys = proposed_milestones .iter() .enumerate() - .map(|(i, ms)|{i as u32}) + .map(|(i, ms)| i as u32) .collect::>() .try_into() - .map_err(|_|Error::::TooManyMilestones)?; + .map_err(|_| Error::::TooManyMilestones)?; let project: Project = Project { agreement_hash, @@ -625,7 +680,7 @@ pub mod pallet { .try_into() .map_err(|_| Error::::TooManyJuryMembers)?, on_creation_funding, - refunded_funds: Zero::zero() + refunded_funds: Zero::zero(), }; let individual_votes = ImmutableIndividualVotes::new(bounded_milestone_keys); @@ -649,7 +704,8 @@ pub mod pallet { /// Only for local contributions. fn convert_contributions_to_refund_locations( contributions: &ContributionsFor, - ) -> BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> { + ) -> BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> + { let sum_of_contributions = contributions .values() .fold(Default::default(), |acc: BalanceOf, x| { @@ -657,7 +713,10 @@ pub mod pallet { }); let mut sum_of_percents: Percent = Zero::zero(); - let mut ret: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject> = contributions + let mut ret: BoundedVec< + (Locality>, Percent), + T::MaximumContributorsPerProject, + > = contributions .iter() .map(|c| { let percent = Percent::from_rational(c.1.value, sum_of_contributions); @@ -665,16 +724,21 @@ pub mod pallet { // Since these are local we can use MultiLocation::Default; (Locality::from_local(c.0.clone()), percent) }) - .collect::>, Percent)>>().try_into().expect("Both input and output are bound by the same quantifier; qed"); + .collect::>, Percent)>>() + .try_into() + .expect("Both input and output are bound by the same quantifier; qed"); // TEST THIS if sum_of_percents != One::one() { - // We are missing a part of the fund so take the remainder and use the pallet_id as the return address. + // We are missing a part of the fund so take the remainder and use the pallet_id as the return address. //(as is used throughout the rest of the pallet for fees) let diff = ::one().saturating_sub(sum_of_percents); // TODO: IF THE CONTRIBUTION BOUND IS MAX ALREADY THEN WE CANNOT PUSH THE DUST ACCOUNT ON // FAIL SILENTLY AND CLEAN UP ON FINAL WITHDRAW INSTEAD. - let _ = ret.try_push((Locality::from_local(::ImbueFeeAccount::get()), diff)); + let _ = ret.try_push(( + Locality::from_local(::ImbueFeeAccount::get()), + diff, + )); } ret @@ -713,7 +777,11 @@ pub struct Milestone { } impl Milestone { - fn new(project_key: ProjectKey, milestone_key: MilestoneKey, percentage_to_unlock: Percent) -> Self { + fn new( + project_key: ProjectKey, + milestone_key: MilestoneKey, + percentage_to_unlock: Percent, + ) -> Self { Self { project_key, milestone_key, @@ -767,7 +835,8 @@ pub struct Project { /// The deposit_id is reponsible for returning deposits held in pallet-deposits. pub deposit_id: DepositIdOf, /// Where do the refunds end up and what percent they get. - pub refund_locations: BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject>, + pub refund_locations: + BoundedVec<(Locality>, Percent), T::MaximumContributorsPerProject>, /// Who should deal with disputes. pub jury: BoundedVec, MaxJuryOf>, /// When is the project funded and how is it taken. @@ -813,7 +882,6 @@ pub struct Whitelist { pub enum FundingPath { // TODO: Possibly wise to change this to actually define where the reserves are coming from. // This allows us to break the notion of a "contributor" finally and worry only about the "approvers". - /// Take from the reserved amounts of the contributors account. #[default] TakeFromReserved, @@ -825,8 +893,8 @@ pub enum FundingPath { /// Contians the block number for possible further investigation. #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub enum TransferStatus { - Refunded{on: BlockNumber}, - Withdrawn{on: BlockNumber}, + Refunded { on: BlockNumber }, + Withdrawn { on: BlockNumber }, } /// Stores the btree for each individual vote. diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index db366760..3b9c4356 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -3,9 +3,9 @@ use frame_support::traits::OnRuntimeUpgrade; use frame_support::*; use frame_system::pallet_prelude::BlockNumberFor; -use common_types::{TreasuryOriginConverter, TreasuryOrigin}; -use pallet_fellowship::traits::SelectJury; +use common_types::{TreasuryOrigin, TreasuryOriginConverter}; pub use pallet::*; +use pallet_fellowship::traits::SelectJury; pub type TimestampOf = ::Moment; @@ -490,7 +490,6 @@ pub mod v5 { #[storage_alias] pub type StorageVersion = StorageValue, Release, ValueQuery>; - #[derive(Default, Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] #[repr(u32)] pub enum Release { @@ -502,7 +501,6 @@ pub mod v5 { V4, } - #[derive( Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, )] @@ -570,7 +568,8 @@ pub mod v5 { pub mod v6 { use super::*; - pub type V6BoundedBTreeMilestones = BoundedBTreeMap::MaxMilestonesPerProject>; + pub type V6BoundedBTreeMilestones = + BoundedBTreeMap::MaxMilestonesPerProject>; #[derive(Encode, Decode, PartialEq, Eq, Clone, Debug, TypeInfo, MaxEncodedLen)] pub struct V6Milestone { @@ -597,7 +596,8 @@ pub mod v6 { } #[storage_alias] - pub type Projects = StorageMap, Identity, ProjectKey, ProjectV6, OptionQuery>; + pub type Projects = + StorageMap, Identity, ProjectKey, ProjectV6, OptionQuery>; #[storage_alias] pub(super) type MilestoneVotes = StorageDoubleMap< @@ -669,8 +669,6 @@ pub mod v6 { }) } - - pub struct MigrateToV6(T); impl OnRuntimeUpgrade for MigrateToV6 { #[cfg(feature = "try-runtime")] @@ -728,15 +726,19 @@ pub mod v7 { pub struct MigrateToV7(T); impl OnRuntimeUpgrade for MigrateToV7 - where AccountIdOf: Into<[u8; 32]> + where + AccountIdOf: Into<[u8; 32]>, { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { log::warn!( target: "pallet-proposals", "Running pre_upgrade()"); let current = as GetStorageVersion>::current_storage_version(); let onchain = as GetStorageVersion>::on_chain_storage_version(); - - ensure!(::MaxJuryMembers::get() < u8::MAX as u32, "Max jury members must be smaller than u8"); + + ensure!( + ::MaxJuryMembers::get() < u8::MAX as u32, + "Max jury members must be smaller than u8" + ); ensure!( current == 7 && onchain == 6, @@ -752,7 +754,6 @@ pub mod v7 { let current = as GetStorageVersion>::current_storage_version(); let onchain = as GetStorageVersion>::on_chain_storage_version(); if current == 7 && onchain == 6 { - migrate_new_fields::(&mut weight); current.put::>(); log::warn!("v7 has been successfully applied"); @@ -761,7 +762,7 @@ pub mod v7 { log::warn!("Skipping v7 due to mismatched version, this be removed from Executive"); weight = weight.saturating_add(T::DbWeight::get().reads(1)); } - + log::warn!("****** ENDING MIGRATION *****"); weight } @@ -780,7 +781,8 @@ pub mod v7 { } fn migrate_new_fields(weight: &mut Weight) - where AccountIdOf: Into<[u8; 32]>, + where + AccountIdOf: Into<[u8; 32]>, { v6::Projects::::drain().for_each(|(key, project)|{ *weight = weight.saturating_add(T::DbWeight::get().reads_writes(1, 1)); @@ -801,21 +803,17 @@ pub mod v7 { let multilocation = match treasury_origin { TreasuryOrigin::Kusama => { ::get_multi_location(&treasury_origin).expect("known good.") - }, - TreasuryOrigin::Imbue => { + },TreasuryOrigin::Imbue => { ::get_multi_location(&treasury_origin).expect("known good.") - }, - TreasuryOrigin::Karura => { + },TreasuryOrigin::Karura => { ::get_multi_location(&TreasuryOrigin::Imbue).expect("known good.") - }, - }; + }}; vec![(Locality::Foreign(multilocation), Percent::from_parts(100))].try_into().expect("1 is lower than bound if it isnt then the system is broken anyway; qed") }, }; let mut new_milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); project.milestones.iter().for_each(|(ms_key, ms): (&MilestoneKey, &v6::V6Milestone)| { - // assume that if its approved then its been withdrawn. let mut transfer_status: Option>> = None; if ms.is_approved { @@ -855,7 +853,6 @@ pub mod v7 { crate::Projects::::insert(key, migrated_project); }); } - } #[cfg(test)] @@ -1157,7 +1154,8 @@ mod test { let cont = get_contributions::(vec![BOB, DAVE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).expect("project wasnt created!"); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .expect("project wasnt created!"); let milestone_key: MilestoneKey = 0; let expiry_block: BlockNumber = 10; let rounds_expiring: BoundedProjectKeysPerBlock = diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index b6375c08..1bf86147 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -15,7 +15,7 @@ use orml_traits::MultiCurrency; use sp_arithmetic::per_things::Percent; use sp_runtime::{ traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, - BuildStorage + BuildStorage, }; use sp_std::{ @@ -219,7 +219,6 @@ parameter_types! { pub DepositCurrencyId: CurrencyId = CurrencyId::Native; } - parameter_types! { pub const UnitWeightCost: u64 = 10; pub const MaxInstructions: u32 = 100; @@ -256,9 +255,7 @@ pub enum StorageItems { } pub struct MockDepositHandler; -impl DepositHandler - for MockDepositHandler -{ +impl DepositHandler for MockDepositHandler { type DepositId = u64; type StorageItem = StorageItems; fn take_deposit( @@ -278,10 +275,10 @@ impl DepositHandler pub struct MockDisputeRaiser; impl DisputeRaiser for MockDisputeRaiser { -type DisputeKey = ProjectKey; -type SpecificId = MilestoneKey; -type MaxJurySize = MaxJuryMembers; -type MaxSpecifics = MaxMilestonesPerProject; + type DisputeKey = ProjectKey; + type SpecificId = MilestoneKey; + type MaxJurySize = MaxJuryMembers; + type MaxSpecifics = MaxMilestonesPerProject; fn raise_dispute( dispute_key: Self::DisputeKey, raised_by: AccountId, @@ -292,7 +289,6 @@ type MaxSpecifics = MaxMilestonesPerProject; } } - pub struct MockJurySelector; impl pallet_fellowship::traits::SelectJury for MockJurySelector { type JurySize = MaxJuryMembers; diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index 1b8c0cf0..5b13ff9e 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,22 +1,21 @@ +use crate::mock::*; use crate::*; -use common_types::{CurrencyId}; +use common_types::CurrencyId; use frame_support::{assert_ok, traits::Hooks, BoundedVec}; use frame_system::EventRecord; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_deposits::traits::DepositHandler; +use pallet_disputes::traits::DisputeHooks; use sp_arithmetic::per_things::Percent; use sp_core::{Get, H256}; use sp_runtime::Saturating; use sp_runtime::{DispatchError, SaturatedConversion}; use sp_std::{collections::btree_map::BTreeMap, convert::TryInto}; -use pallet_disputes::traits::DisputeHooks; -use crate::mock::*; #[cfg(feature = "runtime-benchmarks")] -use sp_std::vec::Vec; +use frame_benchmarking::account; #[cfg(feature = "runtime-benchmarks")] -use frame_benchmarking::{account}; - +use sp_std::vec::Vec; pub fn run_to_block(n: BlockNumber) { while System::block_number() < n { @@ -30,7 +29,6 @@ pub fn run_to_block(n: BlockNumber) { } } - pub fn get_contributions( accounts: Vec>, contribution: u128, @@ -69,8 +67,7 @@ pub fn create_and_fund_project( contributions: ContributionsFor, proposed_milestones: Vec, currency_id: CurrencyId, -) -> Result -{ +) -> Result { contributions.iter().for_each(|(acc, c)| { ::MultiCurrency::reserve(currency_id, acc, c.value).unwrap(); }); @@ -79,9 +76,7 @@ pub fn create_and_fund_project( AccountIdOf, BalanceOf, BlockNumberFor, - >>::convert_contributions_to_refund_locations( - &contributions.clone() - ); + >>::convert_contributions_to_refund_locations(&contributions.clone()); // Reserve the assets from the contributors used. as IntoProposal, BalanceOf, BlockNumberFor>>::convert_to_proposal( @@ -129,16 +124,22 @@ pub fn create_funded_user( balance_factor: u128, ) -> T::AccountId { let user = account(seed, n, 0); - assert_ok!(, - >>::deposit( - CurrencyId::Native, &user, balance_factor.saturated_into() - )); + assert_ok!( + >>::deposit( + CurrencyId::Native, + &user, + balance_factor.saturated_into() + ) + ); user } /// Manually call the hook OnDisputeCompleteWith a predefined result for testing> -pub fn complete_dispute(project_key: ProjectKey, milestone_keys: Vec, result: pallet_disputes::DisputeResult) -> crate::Weight { +pub fn complete_dispute( + project_key: ProjectKey, + milestone_keys: Vec, + result: pallet_disputes::DisputeResult, +) -> crate::Weight { Proposals::on_dispute_complete(project_key, milestone_keys, result) } diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index a261c7c4..19078aac 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -1,8 +1,8 @@ -use frame_support::{assert_noop, assert_ok}; use crate::{mock::*, *}; use common_types::CurrencyId; -use test_utils::*; +use frame_support::{assert_noop, assert_ok}; use pallet_disputes::DisputeResult; +use test_utils::*; #[test] fn raise_dispute_not_contributor() { @@ -14,17 +14,32 @@ fn raise_dispute_not_contributor() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(JOHN), project_key, milestone_keys), Error::::OnlyContributorsCanRaiseDispute); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + + assert_noop!( + Proposals::raise_dispute(RuntimeOrigin::signed(JOHN), project_key, milestone_keys), + Error::::OnlyContributorsCanRaiseDispute + ); }) } #[test] fn raise_dispute_project_doesnt_exist() { build_test_externality().execute_with(|| { - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(JOHN), 0, vec![0u32].try_into().unwrap()), Error::::ProjectDoesNotExist); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(JOHN), + 0, + vec![0u32].try_into().unwrap() + ), + Error::::ProjectDoesNotExist + ); }) } @@ -38,11 +53,27 @@ fn raise_dispute_milestone_already_in_dispute() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys)); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys + )); for (i, index) in milestones.iter().enumerate() { - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(CHARLIE), project_key, vec![i as u32].try_into().unwrap()), Error::::MilestonesAlreadyInDispute); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(CHARLIE), + project_key, + vec![i as u32].try_into().unwrap() + ), + Error::::MilestonesAlreadyInDispute + ); } }) } @@ -57,10 +88,32 @@ fn raise_dispute_invalid_milestone_key() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, vec![11u32].try_into().unwrap()), Error::::MilestoneDoesNotExist); - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, vec![12u32].try_into().unwrap()), Error::::MilestoneDoesNotExist); - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, vec![1u32, 11u32].try_into().unwrap()), Error::::MilestoneDoesNotExist); + ) + .unwrap(); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + vec![11u32].try_into().unwrap() + ), + Error::::MilestoneDoesNotExist + ); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + vec![12u32].try_into().unwrap() + ), + Error::::MilestoneDoesNotExist + ); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + vec![1u32, 11u32].try_into().unwrap() + ), + Error::::MilestoneDoesNotExist + ); }) } @@ -74,7 +127,8 @@ fn raise_dispute_cant_raise_on_approved_milestone() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); let submitted_milestone_key = 0u32; assert_ok!(Proposals::submit_milestone( @@ -95,8 +149,22 @@ fn raise_dispute_cant_raise_on_approved_milestone() { true )); // Milestone should be approved. - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, vec![submitted_milestone_key].try_into().unwrap()), Error::::CannotRaiseDisputeOnApprovedMilestone); - assert_noop!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, vec![submitted_milestone_key, 2u32].try_into().unwrap()), Error::::CannotRaiseDisputeOnApprovedMilestone); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + vec![submitted_milestone_key].try_into().unwrap() + ), + Error::::CannotRaiseDisputeOnApprovedMilestone + ); + assert_noop!( + Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + vec![submitted_milestone_key, 2u32].try_into().unwrap() + ), + Error::::CannotRaiseDisputeOnApprovedMilestone + ); }) } @@ -110,15 +178,27 @@ fn on_dispute_complete_success_removes_dispute_status() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); assert!(!ProjectsInDispute::::contains_key(project_key)); }) } - #[test] fn on_dispute_complete_failure_removes_dispute_status() { build_test_externality().execute_with(|| { @@ -129,10 +209,23 @@ fn on_dispute_complete_failure_removes_dispute_status() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Failure); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Failure, + ); assert!(!ProjectsInDispute::::contains_key(project_key)); }) } @@ -147,11 +240,24 @@ fn dispute_success_does_not_cancel_project() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); let project = Projects::::get(project_key).unwrap(); assert!(!project.cancelled); @@ -168,12 +274,24 @@ fn dispute_success_approves_milestone_for_refund_but_only_ones_specified() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (1u32..milestones.len() as u32).collect::>().try_into().unwrap(); - - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); - + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (1u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); }) } @@ -188,7 +306,8 @@ fn raise_dispute_allows_milestone_voting() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -201,9 +320,17 @@ fn raise_dispute_allows_milestone_voting() { submitted_milestone_key, true )); - let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, dispute_milestone_keys.clone())); - + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + dispute_milestone_keys.clone() + )); + assert_ok!(Proposals::vote_on_milestone( RuntimeOrigin::signed(CHARLIE), project_key, @@ -213,7 +340,6 @@ fn raise_dispute_allows_milestone_voting() { }) } - #[test] fn raise_dispute_allows_milestone_voting_on_non_disputed_milestones() { build_test_externality().execute_with(|| { @@ -225,7 +351,8 @@ fn raise_dispute_allows_milestone_voting_on_non_disputed_milestones() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -233,9 +360,17 @@ fn raise_dispute_allows_milestone_voting_on_non_disputed_milestones() { submitted_milestone_keys[0] )); - let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (2u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, dispute_milestone_keys.clone())); - + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (2u32..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + dispute_milestone_keys.clone() + )); + assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), project_key, @@ -257,7 +392,6 @@ fn raise_dispute_allows_milestone_voting_on_non_disputed_milestones() { }) } - #[test] fn raise_dispute_allows_submission() { build_test_externality().execute_with(|| { @@ -269,10 +403,19 @@ fn raise_dispute_allows_submission() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - - let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, dispute_milestone_keys.clone())); + ) + .unwrap(); + + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + dispute_milestone_keys.clone() + )); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), project_key, @@ -281,7 +424,6 @@ fn raise_dispute_allows_submission() { }) } - #[test] fn failed_dispute_tests() { build_test_externality().execute_with(|| { @@ -293,11 +435,24 @@ fn failed_dispute_tests() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - - let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, dispute_milestone_keys.clone())); - let _ = complete_dispute::(project_key, dispute_milestone_keys.into_inner(), DisputeResult::Failure); + ) + .unwrap(); + + let dispute_milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + dispute_milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + dispute_milestone_keys.into_inner(), + DisputeResult::Failure, + ); // just gonna assert that the milestones arnt approved for refund. let project_after_refund = Projects::::get(project_key).unwrap(); @@ -319,14 +474,29 @@ fn assert_can_recall_dispute_after_success() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); // Only call the dispute on part. - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..5 as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (5u32..10 as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (5u32..10 as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); }) } @@ -340,15 +510,28 @@ fn assert_can_recall_dispute_after_failure() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); + ) + .unwrap(); // Only call the dispute on part. - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..5 as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Failure); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (5u32..10 as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Failure, + ); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (5u32..10 as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); }) } - - diff --git a/pallets/proposals/src/tests/into_proposals.rs b/pallets/proposals/src/tests/into_proposals.rs index e69de29b..8b137891 100644 --- a/pallets/proposals/src/tests/into_proposals.rs +++ b/pallets/proposals/src/tests/into_proposals.rs @@ -0,0 +1 @@ + diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs index 42441aa8..3fc5d816 100644 --- a/pallets/proposals/src/tests/mod.rs +++ b/pallets/proposals/src/tests/mod.rs @@ -1,5 +1,5 @@ +pub mod disputes; pub mod immutable_votes; -pub mod pallet; pub mod into_proposals; -pub mod disputes; +pub mod pallet; pub mod refunds; diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index f58acdc5..c9b4fd31 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -10,7 +10,8 @@ fn submit_milestone_milestone_doesnt_exist() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, 11), Error::::MilestoneDoesNotExist @@ -34,7 +35,8 @@ fn submit_milestone_not_initiator() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::submit_milestone(RuntimeOrigin::signed(BOB), project_key, 1), Error::::UserIsNotInitiator @@ -83,7 +85,8 @@ fn submit_milestone_creates_non_bias_vote() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), project_key, @@ -103,7 +106,8 @@ fn submit_milestone_can_resubmit_during_voting_round() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -148,7 +152,8 @@ fn submit_milestone_can_submit_again_after_failed_vote() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), project_key, @@ -171,7 +176,8 @@ fn submit_milestone_cannot_submit_again_after_success_vote() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -206,7 +212,9 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_for() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + let project_key = + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -271,7 +279,9 @@ fn ensure_milestone_vote_data_is_cleaned_after_autofinalisation_against() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + let project_key = + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -335,7 +345,9 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + let project_key = + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key_0 = 0; let milestone_key_1 = 1; assert_ok!(Proposals::submit_milestone( @@ -393,7 +405,8 @@ fn vote_on_milestone_before_round_starts_fails() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_noop!( Proposals::vote_on_milestone( @@ -413,7 +426,8 @@ fn vote_on_milestone_after_round_end_fails() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let expiring_block = frame_system::Pallet::::block_number() + ::MilestoneVotingWindow::get(); @@ -441,7 +455,8 @@ fn vote_on_milestone_where_voting_round_is_active_but_not_the_correct_milestone( let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), project_key, @@ -459,7 +474,9 @@ fn if_double_submission_and_one_finalises_voting_on_the_second_can_vote() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + let project_key = + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let expiring_block = frame_system::Pallet::::block_number() + ::MilestoneVotingWindow::get(); assert_ok!(Proposals::submit_milestone( @@ -489,7 +506,8 @@ fn vote_on_milestone_not_contributor() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -514,7 +532,8 @@ fn vote_on_milestone_actually_adds_to_vote() { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -551,7 +570,8 @@ fn vote_on_milestone_autofinalises_on_all_voted_and_fail() { let cont = get_contributions::(vec![BOB, CHARLIE, DAVE], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -588,7 +608,9 @@ fn withdraw_not_initiator() { build_test_externality().execute_with(|| { let cont = get_contributions::(vec![BOB, CHARLIE], 100_000); let prop_milestones = get_milestones(10); - let project_key = create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + let project_key = + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -626,7 +648,8 @@ fn withdraw_only_transfers_approved_milestones() { let cont = get_contributions::(vec![BOB, CHARLIE], per_contribution); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let project_account = crate::Pallet::::project_account_id(project_key); let milestone_key = 0; let _ = @@ -675,7 +698,8 @@ fn withdraw_removes_project_after_all_funds_taken() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(1); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key) @@ -706,7 +730,8 @@ fn store_project_info_after_project_is_completed() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(1); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key) @@ -781,10 +806,12 @@ fn withdraw_takes_imbue_fee() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let fee_account: AccountId = ::ImbueFeeAccount::get(); - let fee_account_balance_before = ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account); + let fee_account_balance_before = + ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key) @@ -801,7 +828,8 @@ fn withdraw_takes_imbue_fee() { project_key )); let expected_fee = ::ImbueFee::get().mul_floor(10_000); - let fee_account_balance_after = ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account); + let fee_account_balance_after = + ::MultiCurrency::free_balance(CurrencyId::Native, &fee_account); assert_eq!( fee_account_balance_after - fee_account_balance_before, @@ -817,7 +845,8 @@ fn withdraw_cannot_double_withdraw() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key) @@ -846,13 +875,14 @@ fn withdraw_once_times_with_double_submissions() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, 0).unwrap(); - let _ = Proposals::vote_on_milestone(RuntimeOrigin::signed(BOB), project_key, 0, true) - .unwrap(); + let _ = + Proposals::vote_on_milestone(RuntimeOrigin::signed(BOB), project_key, 0, true).unwrap(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, 1).unwrap(); - let _ = Proposals::vote_on_milestone(RuntimeOrigin::signed(BOB), project_key, 1, true) - .unwrap(); + let _ = + Proposals::vote_on_milestone(RuntimeOrigin::signed(BOB), project_key, 1, true).unwrap(); let alice_before = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); @@ -877,7 +907,8 @@ fn withdraw_twice_with_intermitent_submission() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); // The first submission and withdraw let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, 0).unwrap(); @@ -930,10 +961,11 @@ fn withdraw_with_variable_percentage() { }, ]; let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let _ = Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, 0).unwrap(); - let _ = Proposals::vote_on_milestone(RuntimeOrigin::signed(BOB), project_key, 0, true) - .unwrap(); + let _ = + Proposals::vote_on_milestone(RuntimeOrigin::signed(BOB), project_key, 0, true).unwrap(); let alice_before = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); assert_ok!(Proposals::withdraw( @@ -956,7 +988,8 @@ fn withdraw_fails_before_approval() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_noop!( Proposals::withdraw(RuntimeOrigin::signed(ALICE), project_key), @@ -978,7 +1011,8 @@ fn withdraw_assert_milestone_state_change() { let cont = get_contributions::(vec![BOB], 100_000); let prop_milestones = get_milestones(10); let project_key = - create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native).unwrap(); + create_and_fund_project::(ALICE, cont, prop_milestones, CurrencyId::Native) + .unwrap(); let milestone_key = 0; assert_noop!( Proposals::withdraw(RuntimeOrigin::signed(ALICE), project_key), @@ -1027,4 +1061,4 @@ fn close_voting_round_works() { .unwrap() .is_empty()); }) -} \ No newline at end of file +} diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 8b19dac3..1a6e7b38 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -1,8 +1,7 @@ -use frame_support::{assert_noop, assert_ok}; use crate::{mock::*, *}; -use test_utils::*; +use frame_support::{assert_noop, assert_ok}; use pallet_disputes::DisputeResult; - +use test_utils::*; #[test] fn you_can_actually_refund_after_dispute_success() { @@ -14,12 +13,25 @@ fn you_can_actually_refund_after_dispute_success() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); // All milestones should be good for refund - + assert_ok!(Proposals::refund(RuntimeOrigin::signed(BOB), project_key)); }) } @@ -34,13 +46,23 @@ fn refund_assert_milestone_state_change() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - // Only dispute some keys so that we can - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + // Only dispute some keys so that we can + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..5 as u32).collect::>().try_into().unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); // All milestones should be good for refund - + assert_ok!(Proposals::refund(RuntimeOrigin::signed(BOB), project_key)); let project_after_refund = Projects::::get(project_key).unwrap(); assert_eq!(project_after_refund.refunded_funds, 500_000); @@ -48,7 +70,12 @@ fn refund_assert_milestone_state_change() { let milestone = project_after_refund.milestones.get(&i).unwrap(); if i < 5 { assert!(milestone.can_refund); - assert_eq!(milestone.transfer_status, Some(TransferStatus::Refunded{on: frame_system::Pallet::::block_number()})); + assert_eq!( + milestone.transfer_status, + Some(TransferStatus::Refunded { + on: frame_system::Pallet::::block_number() + }) + ); } else { assert!(!milestone.can_refund); assert!(milestone.transfer_status.is_none()); @@ -67,11 +94,27 @@ fn refund_not_contributor() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); - assert_noop!(Proposals::refund(RuntimeOrigin::signed(DAVE), project_key), Error::::OnlyContributorsCanInitiateRefund); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); + assert_noop!( + Proposals::refund(RuntimeOrigin::signed(DAVE), project_key), + Error::::OnlyContributorsCanInitiateRefund + ); }) } @@ -85,12 +128,25 @@ fn refund_deletes_project_when_all_funds_are_refunded() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); // All milestones should be good for refund - + let _ = Proposals::refund(RuntimeOrigin::signed(BOB), project_key).unwrap(); assert!(!Projects::::contains_key(project_key)); }) @@ -105,19 +161,35 @@ fn withdraw_then_refund_no_double_spend() { let contributions = get_contributions::(vec![BOB], 1_000_000u128); let milestones = get_milestones(10); let milestone_key = 0; - let alice_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); - let bob_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let alice_before_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let bob_before_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); let project_key = create_and_fund_project::( ALICE, contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - let _ = Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone()); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + let _ = Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone(), + ); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); let _ = - Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key).unwrap(); + Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key) + .unwrap(); let _ = Proposals::vote_on_milestone( RuntimeOrigin::signed(BOB), @@ -127,20 +199,30 @@ fn withdraw_then_refund_no_double_spend() { ) .unwrap(); // Milestone is approved, withdraw. - assert_ok!(Proposals::withdraw(RuntimeOrigin::signed(ALICE), project_key)); + assert_ok!(Proposals::withdraw( + RuntimeOrigin::signed(ALICE), + project_key + )); let project_after_withdraw = Projects::::get(project_key).unwrap(); - let alice_after_withdraw = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let alice_after_withdraw = + ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); // Assert that alice has recieved the withdraw. assert!(alice_after_withdraw > alice_before_creation); - let refund_fee = ::ImbueFee::get().mul_floor(project_after_withdraw.raised_funds - project_after_withdraw.withdrawn_funds); + let refund_fee = ::ImbueFee::get().mul_floor( + project_after_withdraw.raised_funds - project_after_withdraw.withdrawn_funds, + ); // Leaves us with 9 milestones left which we will refund. assert_ok!(Proposals::refund(RuntimeOrigin::signed(BOB), project_key)); - let bob_after_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); - assert_eq!(bob_after_refund, (bob_before_creation - project_after_withdraw.withdrawn_funds - refund_fee), "bobs shizzle aint what it should be."); + let bob_after_refund = + ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + assert_eq!( + bob_after_refund, + (bob_before_creation - project_after_withdraw.withdrawn_funds - refund_fee), + "bobs shizzle aint what it should be." + ); }) } - // The reverse case of withdraw_then_refund_no_double_spend // essentially if a milestone is refunded one cannot withdraw an approved milestone as its already gone. #[test] @@ -149,19 +231,32 @@ fn refund_then_withdraw_no_double_spend() { let contributions = get_contributions::(vec![BOB], 1_000_000u128); let milestones = get_milestones(10); let milestone_key = 0; - let alice_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); - let bob_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let alice_before_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); + let bob_before_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); let project_key = create_and_fund_project::( ALICE, contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5 as u32).collect::>().try_into().unwrap(); - let _ = Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone()); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = + (0u32..5 as u32).collect::>().try_into().unwrap(); + let _ = Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone(), + ); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); let _ = - Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key).unwrap(); + Proposals::submit_milestone(RuntimeOrigin::signed(ALICE), project_key, milestone_key) + .unwrap(); let _ = Proposals::vote_on_milestone( RuntimeOrigin::signed(BOB), @@ -171,15 +266,20 @@ fn refund_then_withdraw_no_double_spend() { ) .unwrap(); assert_ok!(Proposals::refund(RuntimeOrigin::signed(BOB), project_key)); - assert_noop!(Proposals::withdraw(RuntimeOrigin::signed(ALICE), project_key), Error::::NoAvailableFundsToWithdraw); + assert_noop!( + Proposals::withdraw(RuntimeOrigin::signed(ALICE), project_key), + Error::::NoAvailableFundsToWithdraw + ); }) } #[test] fn refund_check_refund_amount() { build_test_externality().execute_with(|| { - let bob_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); - let charlie_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let bob_pre_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_pre_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); let per_contribution = 100000u64; let contributions = get_contributions::(vec![BOB, CHARLIE], per_contribution as u128); let milestones = get_milestones(10); @@ -188,27 +288,55 @@ fn refund_check_refund_amount() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); // All milestones should be good for refund - + assert_ok!(Proposals::refund(RuntimeOrigin::signed(BOB), project_key)); - let bob_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); - let charlie_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let bob_post_refund = + ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_post_refund = + ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); let per_fee = ::ImbueFee::get().mul_floor(per_contribution); - assert_eq!(bob_pre_creation - per_fee, bob_post_refund , "bobo didnt get his money back!!"); - assert_eq!(charlie_pre_creation - per_fee, charlie_post_refund , "charlie didnt get his money back!!"); + assert_eq!( + bob_pre_creation - per_fee, + bob_post_refund, + "bobo didnt get his money back!!" + ); + assert_eq!( + charlie_pre_creation - per_fee, + charlie_post_refund, + "charlie didnt get his money back!!" + ); }) } #[test] fn refund_takes_imbue_fee() { build_test_externality().execute_with(|| { - let bob_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); - let charlie_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); - let fee_account_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &::ImbueFeeAccount::get()); + let bob_pre_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_pre_creation = + ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let fee_account_pre_creation = ::MultiCurrency::free_balance( + CurrencyId::Native, + &::ImbueFeeAccount::get(), + ); let per_contribution = 500000u64; let contributions = get_contributions::(vec![BOB, CHARLIE], per_contribution as u128); @@ -218,22 +346,52 @@ fn refund_takes_imbue_fee() { contributions, milestones.clone(), CurrencyId::Native, - ).unwrap(); - let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..milestones.len() as u32).collect::>().try_into().unwrap(); - assert_ok!(Proposals::raise_dispute(RuntimeOrigin::signed(BOB), project_key, milestone_keys.clone())); - let _ = complete_dispute::(project_key, milestone_keys.into_inner(), DisputeResult::Success); + ) + .unwrap(); + let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 + ..milestones.len() as u32) + .collect::>() + .try_into() + .unwrap(); + assert_ok!(Proposals::raise_dispute( + RuntimeOrigin::signed(BOB), + project_key, + milestone_keys.clone() + )); + let _ = complete_dispute::( + project_key, + milestone_keys.into_inner(), + DisputeResult::Success, + ); // All milestones should be good for refund - + assert_ok!(Proposals::refund(RuntimeOrigin::signed(BOB), project_key)); - let bob_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); - let charlie_post_refund = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); - let fee_account_post_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &::ImbueFeeAccount::get()); + let bob_post_refund = + ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); + let charlie_post_refund = + ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); + let fee_account_post_creation = ::MultiCurrency::free_balance( + CurrencyId::Native, + &::ImbueFeeAccount::get(), + ); let per_fee = ::ImbueFee::get().mul_floor(per_contribution); // Assert that the fee has been taken from each and transferred to ImbueFeeAccount. - assert_eq!(bob_pre_creation - bob_post_refund, per_fee, "bobs fee hasnt been taken out correctly."); - assert_eq!(charlie_pre_creation - charlie_post_refund, per_fee, "charlies fee hasnt been taken out correctly."); - assert_eq!(fee_account_post_creation - fee_account_pre_creation, per_fee * 2, "total fee hasnt added correctly."); + assert_eq!( + bob_pre_creation - bob_post_refund, + per_fee, + "bobs fee hasnt been taken out correctly." + ); + assert_eq!( + charlie_pre_creation - charlie_post_refund, + per_fee, + "charlies fee hasnt been taken out correctly." + ); + assert_eq!( + fee_account_post_creation - fee_account_pre_creation, + per_fee * 2, + "total fee hasnt added correctly." + ); }) -} \ No newline at end of file +} diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 8e0dc6db..9e32ebef 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -1,6 +1,6 @@ -use crate::{AccountIdOf, BalanceOf, Contribution, FundingPath, ProposedMilestone, Locality}; +use crate::{AccountIdOf, BalanceOf, Contribution, FundingPath, Locality, ProposedMilestone}; use common_types::{CurrencyId, TreasuryOrigin, TreasuryOriginConverter}; -use frame_support::{pallet_prelude::*, transactional, PalletId, BoundedBTreeMap}; +use frame_support::{pallet_prelude::*, transactional, BoundedBTreeMap, PalletId}; use frame_system::pallet_prelude::*; use orml_traits::XcmTransfer; use orml_xtokens::Error; @@ -14,23 +14,34 @@ pub trait IntoProposal { type MaximumContributorsPerProject: Get; type MaxMilestonesPerProject: Get; type MaxJuryMembers: Get; - + /// Convert the properties of a project into a project. /// This is the main method when wanting to use pallet_proposals and is how one configures a project. fn convert_to_proposal( currency_id: CurrencyId, - current_contribution: BoundedBTreeMap, Self::MaximumContributorsPerProject>, + current_contribution: BoundedBTreeMap< + AccountId, + Contribution, + Self::MaximumContributorsPerProject, + >, brief_hash: H256, benificiary: AccountId, milestones: BoundedVec, - refund_locations: BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>, + refund_locations: BoundedVec< + (Locality, Percent), + Self::MaximumContributorsPerProject, + >, jury: BoundedVec, on_creation_funding: FundingPath, ) -> Result<(), DispatchError>; /// Use when the contributors are the refund locations. fn convert_contributions_to_refund_locations( - contributions: &BoundedBTreeMap, Self::MaximumContributorsPerProject>, + contributions: &BoundedBTreeMap< + AccountId, + Contribution, + Self::MaximumContributorsPerProject, + >, ) -> BoundedVec<(Locality, Percent), Self::MaximumContributorsPerProject>; } @@ -53,7 +64,7 @@ impl ExternalRefundHandler, BalanceOf, Curre _from: AccountIdOf, _amount: BalanceOf, _currency: CurrencyId, - _multilocation: MultiLocation + _multilocation: MultiLocation, ) -> Result<(), DispatchError> { Ok(()) } diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 464061bd..3d725d6d 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -890,7 +890,6 @@ impl pallet_fellowship::Config for Runtime { type WeightInfo = pallet_fellowship::weights::WeightInfo; } - pub type DepositId = u64; pub struct ImbueDepositCalculator; impl DepositCalculator for ImbueDepositCalculator { @@ -1305,15 +1304,16 @@ cumulus_pallet_parachain_system::register_validate_block! { CheckInherents = CheckInherents, } - - type AccountIdOf = ::AccountId; pub struct PointerBasedJurySelector(T); -impl pallet_fellowship::traits::SelectJury> for PointerBasedJurySelector { +impl pallet_fellowship::traits::SelectJury> + for PointerBasedJurySelector +{ type JurySize = MaxJurySize; fn select_jury() -> frame_support::BoundedVec, Self::JurySize> { - let mut out: frame_support::BoundedVec, Self::JurySize> = frame_support::BoundedVec::new(); - let mut amount = Self::JurySize::get(); + let mut out: frame_support::BoundedVec, Self::JurySize> = + frame_support::BoundedVec::new(); + let mut amount = Self::JurySize::get(); let keys = pallet_fellowship::Roles::::iter_keys().collect::>>(); let keys_len = keys.len(); let pointer = pallet_fellowship::JuryPointer::::get(); @@ -1325,10 +1325,10 @@ impl pallet_fellowship::traits::SelectJury pallet_fellowship::traits::SelectJury::get_multi_location(&TreasuryOrigin::Kusama).unwrap() + ::get_multi_location( + &TreasuryOrigin::Kusama + ) + .unwrap() ) ); }); From 7e594c4f86e36696b0d4a78ef5b0dfd80cff19ee Mon Sep 17 00:00:00 2001 From: samelamin Date: Fri, 24 Nov 2023 19:28:33 +0000 Subject: [PATCH 184/192] fix for failing benchmark tests --- Cargo.lock | 1228 ++++++++++++------------- pallets/proposals/Cargo.toml | 6 +- pallets/proposals/src/benchmarking.rs | 12 +- pallets/proposals/src/lib.rs | 6 +- pallets/proposals/src/test_utils.rs | 27 +- pallets/proposals/src/tests/pallet.rs | 12 + runtime/imbue-kusama/Cargo.toml | 1 + 7 files changed, 627 insertions(+), 665 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b315cd3..6a331ca8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.10", "once_cell", "version_check", ] @@ -165,7 +165,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.11", + "getrandom 0.2.10", "once_cell", "version_check", "zerocopy", @@ -486,9 +486,9 @@ dependencies = [ [[package]] name = "array-bytes" -version = "6.2.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de17a919934ad8c5cc99a1a74de4e2dab95d6121a8f27f94755ff525b630382c" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" @@ -615,30 +615,17 @@ dependencies = [ "futures-core", ] -[[package]] -name = "async-channel" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37875bd9915b7d67c2f117ea2c30a0989874d0b2cb694fe25403c85763c0c9e" -dependencies = [ - "concurrent-queue", - "event-listener 3.1.0", - "event-listener-strategy", - "futures-core", - "pin-project-lite 0.2.13", -] - [[package]] name = "async-executor" -version = "1.7.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5ea910c42e5ab19012bab31f53cb4d63d54c3a27730f9a833a88efcf4bb52d" +checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" dependencies = [ - "async-lock 3.1.1", + "async-lock", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 2.0.1", + "futures-lite", "slab", ] @@ -648,10 +635,10 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" dependencies = [ - "async-lock 2.8.0", + "async-lock", "autocfg 1.1.0", "blocking", - "futures-lite 1.13.0", + "futures-lite", ] [[package]] @@ -660,11 +647,11 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock 2.8.0", + "async-lock", "autocfg 1.1.0", "cfg-if 1.0.0", "concurrent-queue", - "futures-lite 1.13.0", + "futures-lite", "log", "parking", "polling 2.8.0", @@ -676,18 +663,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" +checksum = "10da8f3146014722c89e7859e1d7bb97873125d7346d10ca642ffab794355828" dependencies = [ - "async-lock 3.1.1", + "async-lock", "cfg-if 1.0.0", "concurrent-queue", "futures-io", - "futures-lite 2.0.1", + "futures-lite", "parking", "polling 3.3.0", - "rustix 0.38.25", + "rustix 0.38.21", "slab", "tracing", "waker-fn", @@ -703,17 +690,6 @@ dependencies = [ "event-listener 2.5.3", ] -[[package]] -name = "async-lock" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655b9c7fe787d3b25cc0f804a1a8401790f0c5bc395beb5a64dc77d8de079105" -dependencies = [ - "event-listener 3.1.0", - "event-listener-strategy", - "pin-project-lite 0.2.13", -] - [[package]] name = "async-net" version = "1.8.0" @@ -722,7 +698,7 @@ checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" dependencies = [ "async-io 1.13.0", "blocking", - "futures-lite 1.13.0", + "futures-lite", ] [[package]] @@ -732,13 +708,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ "async-io 1.13.0", - "async-lock 2.8.0", + "async-lock", "async-signal", "blocking", "cfg-if 1.0.0", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.25", + "event-listener 3.0.1", + "futures-lite", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -750,7 +726,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -759,13 +735,13 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.2.0", - "async-lock 2.8.0", + "async-io 2.1.0", + "async-lock", "atomic-waker", "cfg-if 1.0.0", "futures-core", "futures-io", - "rustix 0.38.25", + "rustix 0.38.21", "signal-hook-registry", "slab", "windows-sys 0.48.0", @@ -785,7 +761,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -924,7 +900,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "hash-db 0.16.0", "log", @@ -957,7 +933,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -1110,16 +1086,16 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blocking" -version = "1.5.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" dependencies = [ - "async-channel 2.1.0", - "async-lock 3.1.1", + "async-channel", + "async-lock", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite 2.0.1", + "futures-lite", "piper", "tracing", ] @@ -1162,9 +1138,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ "memchr", "regex-automata 0.4.3", @@ -1264,9 +1240,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" dependencies = [ "serde", ] @@ -1334,7 +1310,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ - "smallvec 1.11.2", + "smallvec 1.11.1", ] [[package]] @@ -1355,6 +1331,18 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "chacha20" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures", + "zeroize", +] + [[package]] name = "chacha20" version = "0.9.1" @@ -1368,14 +1356,14 @@ dependencies = [ [[package]] name = "chacha20poly1305" -version = "0.10.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "aead 0.5.2", - "chacha20", - "cipher 0.4.4", - "poly1305", + "aead 0.4.3", + "chacha20 0.8.2", + "cipher 0.3.0", + "poly1305 0.7.2", "zeroize", ] @@ -1432,7 +1420,6 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", - "zeroize", ] [[package]] @@ -1489,9 +1476,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" dependencies = [ "clap_builder", "clap_derive 4.4.7", @@ -1499,9 +1486,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" dependencies = [ "anstream", "anstyle", @@ -1531,7 +1518,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -1636,7 +1623,7 @@ dependencies = [ "polkadot-primitives", "scale-info", "serde", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-arithmetic", "sp-consensus-aura", "sp-core", @@ -1718,7 +1705,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.10", "once_cell", "tiny-keccak", ] @@ -1819,7 +1806,7 @@ dependencies = [ "hashbrown 0.13.2", "log", "regalloc2", - "smallvec 1.11.2", + "smallvec 1.11.1", "target-lexicon", ] @@ -1855,7 +1842,7 @@ checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", - "smallvec 1.11.2", + "smallvec 1.11.1", "target-lexicon", ] @@ -1887,7 +1874,7 @@ dependencies = [ "cranelift-frontend", "itertools 0.10.5", "log", - "smallvec 1.11.2", + "smallvec 1.11.1", "wasmparser", "wasmtime-types", ] @@ -1903,9 +1890,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.4.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "4939f9ed1444bd8c896d37f3090012fa6e7834fe84ef8c9daa166109515732f9" [[package]] name = "crc32fast" @@ -1979,9 +1966,9 @@ dependencies = [ [[package]] name = "crypto-bigint" -version = "0.5.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -2041,9 +2028,9 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ - "clap 4.4.8", + "clap 4.4.7", "parity-scale-codec", "sc-chain-spec", "sc-cli", @@ -2057,7 +2044,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -2080,7 +2067,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-client-collator", @@ -2122,7 +2109,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -2151,7 +2138,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "anyhow", "async-trait", @@ -2166,7 +2153,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -2189,7 +2176,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -2212,7 +2199,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2236,7 +2223,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -2271,7 +2258,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -2289,7 +2276,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2306,7 +2293,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -2336,18 +2323,18 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2363,7 +2350,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -2384,7 +2371,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2398,7 +2385,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2415,7 +2402,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2438,7 +2425,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "futures 0.3.29", @@ -2451,7 +2438,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2469,7 +2456,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2493,7 +2480,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2511,7 +2498,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "async-trait", @@ -2546,7 +2533,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2584,7 +2571,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2646,7 +2633,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -2686,7 +2673,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -2703,7 +2690,7 @@ checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -2743,15 +2730,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2759,9 +2746,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2982,7 +2969,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -3029,7 +3016,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.39", + "syn 2.0.38", "termcolor", "toml 0.7.8", "walkdir", @@ -3106,15 +3093,15 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.9" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der 0.7.8", "digest 0.10.7", - "elliptic-curve 0.13.8", + "elliptic-curve 0.13.6", "rfc6979 0.4.0", - "signature 2.2.0", + "signature 2.1.0", "spki 0.7.2", ] @@ -3125,21 +3112,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8 0.10.2", - "signature 2.2.0", + "signature 2.1.0", ] [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ "curve25519-dalek 4.1.1", "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle", "zeroize", ] @@ -3202,12 +3188,12 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.8" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.5", + "crypto-bigint 0.5.3", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", @@ -3254,7 +3240,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -3265,7 +3251,7 @@ checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -3283,9 +3269,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ "humantime", "is-terminal", @@ -3308,9 +3294,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ "libc", "windows-sys 0.48.0", @@ -3336,25 +3322,15 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "3.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +checksum = "01cec0252c2afff729ee6f00e903d479fba81784c8e2bd77447673471fdfaea1" dependencies = [ "concurrent-queue", "parking", "pin-project-lite 0.2.13", ] -[[package]] -name = "event-listener-strategy" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" -dependencies = [ - "event-listener 3.1.0", - "pin-project-lite 0.2.13", -] - [[package]] name = "exit-future" version = "0.1.4" @@ -3408,7 +3384,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -3495,7 +3471,7 @@ dependencies = [ [[package]] name = "fflonk" version = "0.1.0" -source = "git+https://github.com/w3f/fflonk#1beb0585e1c8488956fac7f05da061f9b41e8948" +source = "git+https://github.com/w3f/fflonk#e141d4b6f42fb481aefe1b479788694945b6940d" dependencies = [ "ark-ec", "ark-ff", @@ -3507,9 +3483,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" [[package]] name = "file-per-thread-logger" @@ -3517,7 +3493,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.0", "log", ] @@ -3596,16 +3572,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -3619,7 +3595,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-support-procedural", @@ -3644,12 +3620,12 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "Inflector", "array-bytes", "chrono", - "clap 4.4.8", + "clap 4.4.7", "comfy-table", "frame-benchmarking", "frame-support", @@ -3692,18 +3668,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3720,7 +3696,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -3750,7 +3726,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-recursion", "futures 0.3.29", @@ -3772,7 +3748,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "aquamarine", "bitflags 1.3.2", @@ -3789,7 +3765,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-arithmetic", "sp-core", @@ -3812,7 +3788,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "Inflector", "cfg-expr", @@ -3824,35 +3800,35 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cfg-if 1.0.0", "frame-support", @@ -3871,7 +3847,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -3886,7 +3862,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "sp-api", @@ -3895,7 +3871,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "parity-scale-codec", @@ -3906,12 +3882,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.11.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg 1.1.0", -] +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" [[package]] name = "fs2" @@ -3929,7 +3902,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.25", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -4015,20 +3988,6 @@ dependencies = [ "waker-fn", ] -[[package]] -name = "futures-lite" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" -dependencies = [ - "fastrand 2.0.1", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.13", -] - [[package]] name = "futures-macro" version = "0.3.29" @@ -4037,7 +3996,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -4139,9 +4098,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if 1.0.0", "libc", @@ -4228,9 +4187,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.22" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -4238,7 +4197,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -4247,9 +4206,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.5.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" dependencies = [ "log", "pest", @@ -4428,9 +4387,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -4506,11 +4465,11 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.9", + "rustls 0.21.8", "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots 0.25.3", + "webpki-roots 0.25.2", ] [[package]] @@ -4555,9 +4514,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -4565,21 +4524,21 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.10.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi", ] [[package]] name = "if-watch" -version = "3.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "bbb892e5777fe09e16f3d44de7802f4daa7267ecbe8c466f19d94e25bb0c303e" dependencies = [ - "async-io 2.2.0", + "async-io 1.13.0", "core-foundation", "fnv", "futures 0.3.29", @@ -4599,7 +4558,7 @@ dependencies = [ "assert_cmd", "async-trait", "cargo-llvm-cov", - "clap 4.4.8", + "clap 4.4.7", "common-runtime", "cumulus-client-cli", "cumulus-client-collator", @@ -4954,7 +4913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.25", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -5042,7 +5001,7 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots 0.25.3", + "webpki-roots 0.25.2", ] [[package]] @@ -5053,7 +5012,7 @@ checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", - "async-lock 2.8.0", + "async-lock", "async-trait", "beef", "futures-channel", @@ -5155,13 +5114,13 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", + "ecdsa 0.16.8", + "elliptic-curve 0.13.6", "once_cell", "sha2 0.10.8", ] @@ -5178,12 +5137,12 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -5195,7 +5154,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" dependencies = [ - "smallvec 1.11.2", + "smallvec 1.11.1", ] [[package]] @@ -5219,7 +5178,7 @@ dependencies = [ "parking_lot 0.12.1", "regex", "rocksdb", - "smallvec 1.11.2", + "smallvec 1.11.1", ] [[package]] @@ -5247,9 +5206,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" @@ -5276,7 +5235,7 @@ dependencies = [ "bytes", "futures 0.3.29", "futures-timer", - "getrandom 0.2.11", + "getrandom 0.2.10", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -5347,7 +5306,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "rw-stream-sink", - "smallvec 1.11.2", + "smallvec 1.11.1", "thiserror", "unsigned-varint", "void", @@ -5363,7 +5322,7 @@ dependencies = [ "libp2p-core", "log", "parking_lot 0.12.1", - "smallvec 1.11.2", + "smallvec 1.11.1", "trust-dns-resolver", ] @@ -5384,7 +5343,7 @@ dependencies = [ "lru 0.10.1", "quick-protobuf", "quick-protobuf-codec", - "smallvec 1.11.2", + "smallvec 1.11.1", "thiserror", "void", ] @@ -5428,7 +5387,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", - "smallvec 1.11.2", + "smallvec 1.11.1", "thiserror", "uint", "unsigned-varint", @@ -5449,7 +5408,7 @@ dependencies = [ "libp2p-swarm", "log", "rand 0.8.5", - "smallvec 1.11.2", + "smallvec 1.11.1", "socket2 0.4.10", "tokio", "trust-dns-proto", @@ -5545,7 +5504,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", - "smallvec 1.11.2", + "smallvec 1.11.1", ] [[package]] @@ -5564,7 +5523,7 @@ dependencies = [ "libp2p-swarm-derive", "log", "rand 0.8.5", - "smallvec 1.11.2", + "smallvec 1.11.1", "tokio", "void", ] @@ -5692,17 +5651,6 @@ dependencies = [ "yamux", ] -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.4.1", - "libc", - "redox_syscall 0.4.1", -] - [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -5824,9 +5772,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lite-json" @@ -5943,7 +5891,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -5957,7 +5905,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -5968,7 +5916,7 @@ checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -5979,7 +5927,7 @@ checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -6047,7 +5995,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.25", + "rustix 0.38.21", ] [[package]] @@ -6159,7 +6107,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "log", @@ -6178,7 +6126,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "anyhow", "jsonrpsee", @@ -6295,7 +6243,7 @@ dependencies = [ "futures 0.3.29", "log", "pin-project", - "smallvec 1.11.2", + "smallvec 1.11.1", "unsigned-varint", ] @@ -6862,7 +6810,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6880,7 +6828,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6896,7 +6844,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -6913,7 +6861,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -6929,7 +6877,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -6943,7 +6891,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -6967,7 +6915,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "aquamarine", "docify", @@ -6989,7 +6937,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7004,7 +6952,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -7024,7 +6972,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7049,7 +6997,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7101,7 +7049,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7120,7 +7068,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7139,7 +7087,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7156,7 +7104,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7173,7 +7121,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7230,7 +7178,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7253,7 +7201,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7267,7 +7215,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7286,7 +7234,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "docify", "frame-benchmarking", @@ -7328,7 +7276,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7381,7 +7329,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7397,7 +7345,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7417,7 +7365,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7434,7 +7382,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7451,7 +7399,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "7.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7470,7 +7418,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7488,7 +7436,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7504,7 +7452,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7520,7 +7468,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -7539,7 +7487,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7559,7 +7507,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -7570,7 +7518,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -7587,7 +7535,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7611,7 +7559,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7638,7 +7586,6 @@ dependencies = [ "frame-executive", "frame-support", "frame-system", - "frame-system-benchmarking", "hex", "integer-sqrt", "lite-json", @@ -7700,7 +7647,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7715,7 +7662,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7733,7 +7680,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7748,7 +7695,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7767,7 +7714,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "docify", "frame-benchmarking", @@ -7785,7 +7732,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -7807,7 +7754,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7824,7 +7771,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7842,7 +7789,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7865,18 +7812,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "log", "sp-arithmetic", @@ -7885,7 +7832,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "sp-api", @@ -7894,7 +7841,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7911,7 +7858,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7926,7 +7873,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7945,7 +7892,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7964,7 +7911,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -7980,7 +7927,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -7996,7 +7943,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8008,7 +7955,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8025,7 +7972,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8041,7 +7988,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8056,7 +8003,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8071,7 +8018,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8092,7 +8039,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8111,7 +8058,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -8125,7 +8072,7 @@ dependencies = [ [[package]] name = "parachains-common" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -8145,7 +8092,7 @@ dependencies = [ "polkadot-runtime-constants", "rococo-runtime-constants", "scale-info", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-consensus-aura", "sp-core", "sp-io", @@ -8287,7 +8234,7 @@ dependencies = [ "cloudabi", "libc", "redox_syscall 0.1.57", - "smallvec 1.11.2", + "smallvec 1.11.1", "winapi", ] @@ -8301,7 +8248,7 @@ dependencies = [ "instant", "libc", "redox_syscall 0.2.16", - "smallvec 1.11.2", + "smallvec 1.11.1", "winapi", ] @@ -8314,7 +8261,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.4.1", - "smallvec 1.11.2", + "smallvec 1.11.1", "windows-targets 0.48.5", ] @@ -8402,9 +8349,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" @@ -8437,7 +8384,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -8478,7 +8425,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -8545,7 +8492,7 @@ checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "polkadot-approval-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "futures-timer", @@ -8563,7 +8510,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "always-assert", "futures 0.3.29", @@ -8579,7 +8526,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "derive_more", "fatality", @@ -8602,7 +8549,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "fatality", "futures 0.3.29", @@ -8623,9 +8570,9 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "1.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ - "clap 4.4.8", + "clap 4.4.7", "frame-benchmarking-cli", "futures 0.3.29", "log", @@ -8650,7 +8597,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "fatality", @@ -8672,7 +8619,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", @@ -8684,7 +8631,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "derive_more", "fatality", @@ -8709,7 +8656,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -8723,7 +8670,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "futures-timer", @@ -8744,7 +8691,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "always-assert", "async-trait", @@ -8767,7 +8714,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "parity-scale-codec", @@ -8785,7 +8732,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "derive_more", @@ -8814,7 +8761,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "futures 0.3.29", @@ -8836,7 +8783,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "fatality", @@ -8855,7 +8802,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "polkadot-node-subsystem", @@ -8870,7 +8817,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -8891,7 +8838,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "polkadot-node-metrics", @@ -8906,7 +8853,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "futures-timer", @@ -8923,7 +8870,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "fatality", "futures 0.3.29", @@ -8942,7 +8889,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -8959,7 +8906,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "fatality", @@ -8976,7 +8923,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "fatality", @@ -8993,7 +8940,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "always-assert", "futures 0.3.29", @@ -9021,7 +8968,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "polkadot-node-primitives", @@ -9037,7 +8984,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cpu-time", "futures 0.3.29", @@ -9060,7 +9007,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-prepare-worker" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "libc", @@ -9083,7 +9030,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "polkadot-node-metrics", @@ -9098,7 +9045,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "lazy_static", "log", @@ -9116,7 +9063,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bs58 0.5.0", "futures 0.3.29", @@ -9135,9 +9082,9 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-trait", "bitvec", "derive_more", @@ -9159,7 +9106,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bounded-vec", "futures 0.3.29", @@ -9181,7 +9128,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9191,7 +9138,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "derive_more", @@ -9204,7 +9151,7 @@ dependencies = [ "polkadot-statement-table", "sc-network", "sc-transaction-pool-api", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-consensus-babe", @@ -9215,7 +9162,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "derive_more", @@ -9248,7 +9195,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -9271,7 +9218,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bounded-collections", "derive_more", @@ -9288,7 +9235,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "env_logger 0.9.3", "log", @@ -9306,7 +9253,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -9332,7 +9279,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9364,7 +9311,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "frame-benchmarking", @@ -9431,7 +9378,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-arithmetic", "sp-authority-discovery", @@ -9461,7 +9408,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "frame-benchmarking", @@ -9507,12 +9454,12 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -9521,7 +9468,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bs58 0.5.0", "frame-benchmarking", @@ -9534,7 +9481,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -9580,7 +9527,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "frame-benchmarking", @@ -9699,7 +9646,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -9723,7 +9670,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -9733,7 +9680,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bitvec", "frame-election-provider-support", @@ -9767,7 +9714,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -9794,7 +9741,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-system", "futures 0.3.29", @@ -9867,11 +9814,22 @@ dependencies = [ "cfg-if 1.0.0", "concurrent-queue", "pin-project-lite 0.2.13", - "rustix 0.38.25", + "rustix 0.38.21", "tracing", "windows-sys 0.48.0", ] +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.4.1", +] + [[package]] name = "poly1305" version = "0.8.0" @@ -9982,7 +9940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -10062,7 +10020,7 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -10108,7 +10066,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -10349,7 +10307,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.10", ] [[package]] @@ -10527,12 +10485,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.11", - "libredox", + "getrandom 0.2.10", + "redox_syscall 0.2.16", "thiserror", ] @@ -10566,7 +10524,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -10578,7 +10536,7 @@ dependencies = [ "fxhash", "log", "slice-group-by", - "smallvec 1.11.2", + "smallvec 1.11.1", ] [[package]] @@ -10693,7 +10651,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ "cc", - "getrandom 0.2.11", + "getrandom 0.2.10", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -10713,7 +10671,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -10773,7 +10731,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -10801,12 +10759,12 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -10814,13 +10772,13 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.3.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" dependencies = [ "libc", "rtoolbox", - "windows-sys 0.48.0", + "winapi", ] [[package]] @@ -10851,12 +10809,12 @@ dependencies = [ [[package]] name = "rtoolbox" -version = "0.0.2" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi", ] [[package]] @@ -10988,14 +10946,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.11", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] @@ -11026,9 +10984,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", "ring 0.17.5", @@ -11050,9 +11008,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.5", ] @@ -11122,7 +11080,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "log", "sp-core", @@ -11133,7 +11091,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -11161,7 +11119,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "futures-timer", @@ -11184,7 +11142,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -11199,7 +11157,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -11218,22 +11176,22 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "chrono", - "clap 4.4.8", + "clap 4.4.7", "fdlimit", "futures 0.3.29", "libp2p-identity", @@ -11268,7 +11226,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "fnv", "futures 0.3.29", @@ -11294,7 +11252,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -11320,7 +11278,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -11345,7 +11303,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -11374,7 +11332,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "fork-tree", @@ -11410,7 +11368,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "jsonrpsee", @@ -11432,10 +11390,10 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", - "async-channel 1.9.0", + "async-channel", "async-trait", "fnv", "futures 0.3.29", @@ -11466,7 +11424,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "jsonrpsee", @@ -11485,7 +11443,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11498,7 +11456,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ahash 0.8.6", "array-bytes", @@ -11539,7 +11497,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "finality-grandpa", "futures 0.3.29", @@ -11559,7 +11517,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -11582,7 +11540,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -11604,7 +11562,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -11616,7 +11574,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "anyhow", "cfg-if 1.0.0", @@ -11633,7 +11591,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ansi_term", "futures 0.3.29", @@ -11649,7 +11607,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "parking_lot 0.12.1", @@ -11663,10 +11621,10 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", - "async-channel 1.9.0", + "async-channel", "async-trait", "asynchronous-codec", "bytes", @@ -11689,7 +11647,7 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-arithmetic", "sp-blockchain", "sp-core", @@ -11704,9 +11662,9 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ - "async-channel 1.9.0", + "async-channel", "cid", "futures 0.3.29", "libp2p-identity", @@ -11724,7 +11682,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -11741,7 +11699,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ahash 0.8.6", "futures 0.3.29", @@ -11759,10 +11717,10 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", - "async-channel 1.9.0", + "async-channel", "futures 0.3.29", "libp2p-identity", "log", @@ -11780,10 +11738,10 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", - "async-channel 1.9.0", + "async-channel", "async-trait", "fork-tree", "futures 0.3.29", @@ -11800,7 +11758,7 @@ dependencies = [ "sc-network-common", "sc-utils", "schnellru", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-arithmetic", "sp-blockchain", "sp-consensus", @@ -11814,7 +11772,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "futures 0.3.29", @@ -11832,7 +11790,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "bytes", @@ -11866,7 +11824,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -11875,7 +11833,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "jsonrpsee", @@ -11906,7 +11864,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -11925,7 +11883,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "http", "jsonrpsee", @@ -11940,7 +11898,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "futures 0.3.29", @@ -11968,7 +11926,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "directories", @@ -12032,7 +11990,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "log", "parity-scale-codec", @@ -12043,9 +12001,9 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ - "clap 4.4.8", + "clap 4.4.7", "fs4", "log", "sc-client-db", @@ -12057,7 +12015,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12076,7 +12034,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "libc", @@ -12095,7 +12053,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "chrono", "futures 0.3.29", @@ -12114,7 +12072,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ansi_term", "atty", @@ -12143,18 +12101,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -12180,7 +12138,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -12196,9 +12154,9 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ - "async-channel 1.9.0", + "async-channel", "futures 0.3.29", "futures-timer", "lazy_static", @@ -12451,22 +12409,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -12611,9 +12569,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", @@ -12656,7 +12614,7 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "enumn", "parity-scale-codec", @@ -12685,9 +12643,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smol" @@ -12695,15 +12653,15 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-executor", "async-fs", "async-io 1.13.0", - "async-lock 2.8.0", + "async-lock", "async-net", "async-process", "blocking", - "futures-lite 1.13.0", + "futures-lite", ] [[package]] @@ -12713,20 +12671,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0bb30cf57b7b5f6109ce17c3164445e2d6f270af2cb48f6e4d31c2967c9a9f5" dependencies = [ "arrayvec 0.7.4", - "async-lock 2.8.0", + "async-lock", "atomic-take", "base64 0.21.5", "bip39", "blake2-rfc", "bs58 0.5.0", - "chacha20", + "chacha20 0.9.1", "crossbeam-queue", "derive_more", "ed25519-zebra 4.0.3", "either", "event-listener 2.5.3", "fnv", - "futures-lite 1.13.0", + "futures-lite", "futures-util", "hashbrown 0.14.2", "hex", @@ -12741,7 +12699,7 @@ dependencies = [ "num-traits", "pbkdf2 0.12.2", "pin-project", - "poly1305", + "poly1305 0.8.0", "rand 0.8.5", "rand_chacha 0.3.1", "ruzstd", @@ -12752,7 +12710,7 @@ dependencies = [ "sha3", "siphasher", "slab", - "smallvec 1.11.2", + "smallvec 1.11.1", "soketto", "twox-hash", "wasmi", @@ -12766,8 +12724,8 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "256b5bad1d6b49045e95fe87492ce73d5af81545d8b4d8318a872d2007024c33" dependencies = [ - "async-channel 1.9.0", - "async-lock 2.8.0", + "async-channel", + "async-lock", "base64 0.21.5", "blake2-rfc", "derive_more", @@ -12775,7 +12733,7 @@ dependencies = [ "event-listener 2.5.3", "fnv", "futures-channel", - "futures-lite 1.13.0", + "futures-lite", "futures-util", "hashbrown 0.14.2", "hex", @@ -12804,16 +12762,16 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm 0.9.4", "blake2", "chacha20poly1305", "curve25519-dalek 4.1.1", "rand_core 0.6.4", - "ring 0.17.5", + "ring 0.16.20", "rustc_version 0.4.0", "sha2 0.10.8", "subtle", @@ -12859,7 +12817,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "hash-db 0.16.0", "log", @@ -12880,7 +12838,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "Inflector", "blake2", @@ -12888,13 +12846,13 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", @@ -12907,7 +12865,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "integer-sqrt", "num-traits", @@ -12921,7 +12879,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", @@ -12934,7 +12892,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "sp-api", "sp-inherents", @@ -12945,7 +12903,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "futures 0.3.29", "log", @@ -12963,7 +12921,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "futures 0.3.29", @@ -12978,7 +12936,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "parity-scale-codec", @@ -12995,7 +12953,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "parity-scale-codec", @@ -13014,7 +12972,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13033,7 +12991,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "finality-grandpa", "log", @@ -13051,7 +13009,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13063,7 +13021,7 @@ dependencies = [ [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "arrayvec 0.7.4", @@ -13110,7 +13068,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "blake2b_simd", "byteorder", @@ -13123,17 +13081,17 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "quote", "sp-core-hashing", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -13142,17 +13100,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "environmental", "parity-scale-codec", @@ -13163,7 +13121,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "serde_json", "sp-api", @@ -13174,7 +13132,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13188,7 +13146,7 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bytes", "ed25519-dalek", @@ -13212,7 +13170,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "lazy_static", "sp-core", @@ -13223,7 +13181,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -13235,7 +13193,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "thiserror", "zstd 0.12.4", @@ -13244,7 +13202,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -13255,7 +13213,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13273,7 +13231,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13287,7 +13245,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "sp-api", "sp-core", @@ -13297,7 +13255,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "backtrace", "lazy_static", @@ -13307,7 +13265,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "rustc-hash", "serde", @@ -13317,7 +13275,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "either", "hash256-std-hasher", @@ -13339,7 +13297,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13357,19 +13315,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", @@ -13384,7 +13342,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13398,14 +13356,14 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "hash-db 0.16.0", "log", "parity-scale-codec", "parking_lot 0.12.1", "rand 0.8.5", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-core", "sp-externalities", "sp-panic-handler", @@ -13419,7 +13377,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "aes-gcm 0.10.3", "curve25519-dalek 4.1.1", @@ -13443,12 +13401,12 @@ dependencies = [ [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13461,7 +13419,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "parity-scale-codec", @@ -13474,7 +13432,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "sp-std", @@ -13486,7 +13444,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "sp-api", "sp-runtime", @@ -13495,7 +13453,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "parity-scale-codec", @@ -13510,7 +13468,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ahash 0.8.6", "hash-db 0.16.0", @@ -13533,7 +13491,7 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13550,18 +13508,18 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -13574,12 +13532,12 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-arithmetic", "sp-core", "sp-debug-derive", @@ -13600,9 +13558,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spinners" -version = "4.1.1" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" +checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" dependencies = [ "lazy_static", "maplit", @@ -13631,9 +13589,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.44.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35935738370302d5e33963665b77541e4b990a3e919ec904c837a56cfc891de1" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -13653,7 +13611,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-kusama-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "binary-merkle-tree", "bitvec", @@ -13728,7 +13686,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-application-crypto", "sp-arithmetic", @@ -13759,7 +13717,7 @@ dependencies = [ [[package]] name = "staging-xcm" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "bounded-collections", "derivative", @@ -13776,7 +13734,7 @@ dependencies = [ [[package]] name = "staging-xcm-builder" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "frame-system", @@ -13798,7 +13756,7 @@ dependencies = [ [[package]] name = "staging-xcm-executor" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "environmental", "frame-benchmarking", @@ -13923,7 +13881,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -13961,12 +13919,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.29", @@ -13985,7 +13943,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "hyper", "log", @@ -13997,7 +13955,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", "jsonrpsee", @@ -14010,7 +13968,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14027,7 +13985,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "array-bytes", "async-trait", @@ -14053,7 +14011,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "ansi_term", "build-helper", @@ -14102,9 +14060,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -14165,15 +14123,15 @@ dependencies = [ "cfg-if 1.0.0", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.25", + "rustix 0.38.21", "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -14187,12 +14145,12 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -14224,22 +14182,22 @@ dependencies = [ [[package]] name = "thiserror-core" -version = "1.0.50" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" +checksum = "0d97345f6437bb2004cd58819d8a9ef8e36cdd7661c2abc4bbde0a7c40d9f497" dependencies = [ "thiserror-core-impl", ] [[package]] name = "thiserror-core-impl" -version = "1.0.50" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" +checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 1.0.109", ] [[package]] @@ -14250,7 +14208,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -14396,9 +14354,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", @@ -14415,13 +14373,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -14441,7 +14399,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.9", + "rustls 0.21.8", "tokio", ] @@ -14576,7 +14534,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -14602,7 +14560,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "coarsetime", "polkadot-node-jaeger", @@ -14614,13 +14572,13 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "expander 2.0.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -14659,7 +14617,7 @@ dependencies = [ "serde", "serde_json", "sharded-slab", - "smallvec 1.11.2", + "smallvec 1.11.1", "thread_local", "tracing", "tracing-core", @@ -14677,7 +14635,7 @@ dependencies = [ "hashbrown 0.13.2", "log", "rustc-hex", - "smallvec 1.11.2", + "smallvec 1.11.1", ] [[package]] @@ -14715,7 +14673,7 @@ dependencies = [ "ipnet", "lazy_static", "rand 0.8.5", - "smallvec 1.11.2", + "smallvec 1.11.1", "socket2 0.4.10", "thiserror", "tinyvec", @@ -14737,7 +14695,7 @@ dependencies = [ "lru-cache", "parking_lot 0.12.1", "resolv-conf", - "smallvec 1.11.2", + "smallvec 1.11.1", "thiserror", "tokio", "tracing", @@ -14753,10 +14711,10 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "async-trait", - "clap 4.4.8", + "clap 4.4.7", "frame-remote-externalities", "frame-try-runtime", "hex", @@ -14932,12 +14890,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 0.4.0", "percent-encoding", ] @@ -14949,11 +14907,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.6.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.10", ] [[package]] @@ -15062,7 +15020,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -15096,7 +15054,7 @@ checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -15177,7 +15135,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f341edb80021141d4ae6468cbeefc50798716a347d4085c3811900049ea8945" dependencies = [ - "smallvec 1.11.2", + "smallvec 1.11.1", "spin 0.9.8", "wasmi_arena", "wasmi_core", @@ -15457,9 +15415,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] name = "webrtc" @@ -15672,7 +15630,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "binary-merkle-tree", "bitvec", @@ -15741,7 +15699,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-api", "sp-application-crypto", "sp-authority-discovery", @@ -15771,12 +15729,12 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", - "smallvec 1.11.2", + "smallvec 1.11.1", "sp-core", "sp-runtime", "sp-weights", @@ -15791,7 +15749,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.25", + "rustix 0.38.21", ] [[package]] @@ -15994,9 +15952,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" dependencies = [ "memchr", ] @@ -16083,7 +16041,7 @@ dependencies = [ [[package]] name = "xcm-emulator" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -16115,12 +16073,12 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#f60318f68687e601c47de5ad5ca88e2c3f8139a7" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] @@ -16148,29 +16106,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "092cd76b01a033a9965b9097da258689d9e17c69ded5dcf41bca001dd20ebc6d" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "a13a20a7c6a90e2034bcc65495799da92efcec6a8dd4f3fcb6f7a48988637ead" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] @@ -16183,7 +16141,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.38", ] [[package]] diff --git a/pallets/proposals/Cargo.toml b/pallets/proposals/Cargo.toml index 95ca91c5..40f713c6 100644 --- a/pallets/proposals/Cargo.toml +++ b/pallets/proposals/Cargo.toml @@ -26,7 +26,6 @@ sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "rel sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } -frame-system-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", optional = true } frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false, optional = true } frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } @@ -37,10 +36,10 @@ cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branc cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } # Local Dependencies common-traits = { path = "../../libs/common-traits", default-features = false } @@ -100,10 +99,7 @@ std = [ runtime-benchmarks = [ "common-runtime/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", - 'frame-support/runtime-benchmarks', - 'frame-system-benchmarking/runtime-benchmarks', "pallet-xcm/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", "pallet-deposits/runtime-benchmarks", ] try-runtime = [ diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 96875564..e9f5df4b 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -19,11 +19,7 @@ use test_utils::{ get_max_milestones, get_milestones, }; -#[benchmarks( where - BlockNumberFor: From, - BalanceOf: From, -)] - +#[benchmarks] mod benchmarks { use super::*; @@ -84,7 +80,7 @@ mod benchmarks { let bob: T::AccountId = create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); let contributions = get_contributions::(vec![bob.clone()], 100_000_000_000_000_000u128); - let raised_funds: BalanceOf = 100_000_000_000_000_000u128.saturated_into(); + let raised_funds = 100_000_000_000_000_000u128.saturated_into(); let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); @@ -184,7 +180,7 @@ mod benchmarks { #[benchmark] fn refund() { - let contribution_amount = 1_000_000_000_000u128; + let contribution_amount = 1_000_000_000_000u128.saturated_into(); let alice: T::AccountId = create_funded_user::("initiator", 1, contribution_amount); let bob: T::AccountId = create_funded_user::("contributor", 0, contribution_amount); @@ -228,7 +224,7 @@ mod benchmarks { assert_last_event::( Event::::ProjectRefunded { project_key, - total_amount: (total_amount as u64).into(), + total_amount: total_amount.saturated_into(), } .into(), ); diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 8d0789c3..86346772 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -23,10 +23,10 @@ pub mod traits; use traits::{ExternalRefundHandler, IntoProposal}; #[cfg(test)] -pub(crate) mod tests; +mod tests; -#[cfg(any(feature = "runtime-benchmarks", test))] -mod mock; +#[cfg(test)] +pub mod mock; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index 5b13ff9e..6a527c4b 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,4 +1,3 @@ -use crate::mock::*; use crate::*; use common_types::CurrencyId; use frame_support::{assert_ok, traits::Hooks, BoundedVec}; @@ -17,17 +16,17 @@ use frame_benchmarking::account; #[cfg(feature = "runtime-benchmarks")] use sp_std::vec::Vec; -pub fn run_to_block(n: BlockNumber) { - while System::block_number() < n { - Tokens::on_finalize(System::block_number()); - System::on_finalize(System::block_number()); - Proposals::on_finalize(System::block_number()); - System::set_block_number(System::block_number() + 1); - Tokens::on_initialize(System::block_number()); - System::on_initialize(System::block_number()); - Proposals::on_initialize(System::block_number()); - } -} +// pub fn run_to_block(n: BlockNumber) { +// while System::block_number() < n { +// Tokens::on_finalize(System::block_number()); +// System::on_finalize(System::block_number()); +// Proposals::on_finalize(System::block_number()); +// System::set_block_number(System::block_number() + 1); +// Tokens::on_initialize(System::block_number()); +// System::on_initialize(System::block_number()); +// Proposals::on_initialize(System::block_number()); +// } +// } pub fn get_contributions( accounts: Vec>, @@ -90,7 +89,7 @@ pub fn create_and_fund_project( FundingPath::TakeFromReserved, )?; - Ok(ProjectCount::::get()) + Ok(ProjectCount::::get()) } // For testing grants and errors pre funding @@ -140,7 +139,7 @@ pub fn complete_dispute( milestone_keys: Vec, result: pallet_disputes::DisputeResult, ) -> crate::Weight { - Proposals::on_dispute_complete(project_key, milestone_keys, result) + >::on_dispute_complete(project_key, milestone_keys, result) } pub fn assert_last_event(generic_event: ::RuntimeEvent) { diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index c9b4fd31..bbb97d20 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -4,6 +4,18 @@ use crate::{mock::*, *}; use common_types::CurrencyId; use test_utils::*; +pub fn run_to_block(n: BlockNumber) { + while System::block_number() < n { + Tokens::on_finalize(System::block_number()); + System::on_finalize(System::block_number()); + Proposals::on_finalize(System::block_number()); + System::set_block_number(System::block_number() + 1); + Tokens::on_initialize(System::block_number()); + System::on_initialize(System::block_number()); + Proposals::on_initialize(System::block_number()); + } +} + #[test] fn submit_milestone_milestone_doesnt_exist() { build_test_externality().execute_with(|| { diff --git a/runtime/imbue-kusama/Cargo.toml b/runtime/imbue-kusama/Cargo.toml index 6d01f3ee..7af2a092 100644 --- a/runtime/imbue-kusama/Cargo.toml +++ b/runtime/imbue-kusama/Cargo.toml @@ -152,6 +152,7 @@ std = [ "pallet-collective/std", "pallet-democracy/std", "pallet-deposits/std", + "pallet-disputes/std", "pallet-fellowship/std", "pallet-grants/std", "pallet-identity/std", From 10c1ba0554b5fe001ce7931d8cf19dbbb1d4d98b Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 21:54:50 +0000 Subject: [PATCH 185/192] audit warnings --- pallets/deposits/src/lib.rs | 1 - pallets/disputes/src/benchmarking.rs | 2 -- pallets/fellowship/src/benchmarking.rs | 1 - pallets/fellowship/src/migration.rs | 1 - pallets/grants/src/lib.rs | 2 +- pallets/proposals/src/benchmarking.rs | 6 ------ pallets/proposals/src/impls/pallet_impls.rs | 2 +- pallets/proposals/src/lib.rs | 14 ++++++-------- pallets/proposals/src/migration.rs | 2 +- pallets/proposals/src/test_utils.rs | 3 ++- pallets/proposals/src/tests/into_proposals.rs | 1 - pallets/proposals/src/tests/mod.rs | 1 - pallets/proposals/src/traits.rs | 9 +++------ 13 files changed, 14 insertions(+), 31 deletions(-) delete mode 100644 pallets/proposals/src/tests/into_proposals.rs diff --git a/pallets/deposits/src/lib.rs b/pallets/deposits/src/lib.rs index 90cbc2d1..0ef12a8b 100644 --- a/pallets/deposits/src/lib.rs +++ b/pallets/deposits/src/lib.rs @@ -19,7 +19,6 @@ pub mod pallet { use codec::{FullCodec, FullEncode}; use common_types::CurrencyId; use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::BlockNumberFor; use orml_traits::{BalanceStatus, MultiCurrency, MultiReservableCurrency}; use sp_runtime::{ traits::{AtLeast32BitUnsigned, One}, diff --git a/pallets/disputes/src/benchmarking.rs b/pallets/disputes/src/benchmarking.rs index b74ad1bf..3da887a6 100644 --- a/pallets/disputes/src/benchmarking.rs +++ b/pallets/disputes/src/benchmarking.rs @@ -2,10 +2,8 @@ use super::*; use crate::traits::DisputeRaiser; -use crate::Pallet as PalletDisputes; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get, BoundedVec}; -use frame_system::pallet_prelude::BlockNumberFor; use frame_system::Pallet as System; use sp_std::{vec, vec::Vec}; diff --git a/pallets/fellowship/src/benchmarking.rs b/pallets/fellowship/src/benchmarking.rs index a3f77290..7d4df39d 100644 --- a/pallets/fellowship/src/benchmarking.rs +++ b/pallets/fellowship/src/benchmarking.rs @@ -6,7 +6,6 @@ use crate::{traits::FellowshipHandle, Config, Role}; use common_types::CurrencyId; use frame_benchmarking::v2::*; use frame_support::assert_ok; -use frame_system::pallet_prelude::BlockNumberFor; use frame_system::Pallet as System; use frame_system::RawOrigin; use orml_traits::MultiCurrency; diff --git a/pallets/fellowship/src/migration.rs b/pallets/fellowship/src/migration.rs index c4ebcad9..10fcc478 100644 --- a/pallets/fellowship/src/migration.rs +++ b/pallets/fellowship/src/migration.rs @@ -1,7 +1,6 @@ use super::*; use frame_support::traits::OnRuntimeUpgrade; use frame_support::{pallet_prelude::*, *}; -use frame_system::pallet_prelude::BlockNumberFor; use hex_literal::hex; use sp_runtime::AccountId32; use sp_std::{vec, vec::Vec}; diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index a776fce7..7452ab35 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -33,7 +33,7 @@ pub mod pallet { use sp_arithmetic::{per_things::Percent, traits::One}; use sp_core::H256; use sp_runtime::Saturating; - use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; + use sp_std::{collections::btree_map::BTreeMap}; pub(crate) type AccountIdOf = ::AccountId; pub(crate) type BalanceOf = diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index e9f5df4b..4b0e8caf 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -110,10 +110,6 @@ mod benchmarks { )); } - // All the milestones are approved now - let fee: BalanceOf = ::ImbueFee::get().mul_floor(raised_funds); - let withdrawn: BalanceOf = raised_funds.saturating_sub(fee); - #[extrinsic_call] withdraw(RawOrigin::Signed(alice.clone()), project_key); assert_last_event::( @@ -152,8 +148,6 @@ mod benchmarks { .collect(); let contributions = get_contributions::(contributors, contribution_amount); - let total_amount = - contribution_amount * ::MaximumContributorsPerProject::get() as u128; let milestone_count = ::MaxMilestonesPerProject::get(); let prop_milestones = get_milestones(milestone_count as u8); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32 diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index 4e6cd34f..c0fd8a60 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -140,7 +140,7 @@ impl Pallet { let withdrawable_percent: Percent = project .milestones .iter_mut() - .map(|(_key, mut ms)| { + .map(|(_key, ms)| { if ms.is_approved && ms.transfer_status == None { ms.transfer_status = Some(TransferStatus::Withdrawn { on: frame_system::Pallet::::block_number(), diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index 86346772..abf1dd88 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -1,7 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode, EncodeLike}; -use common_traits::MaybeConvert; use common_types::CurrencyId; use frame_support::{ pallet_prelude::*, storage::bounded_btree_map::BoundedBTreeMap, traits::EnsureOrigin, PalletId, @@ -11,7 +10,7 @@ use orml_traits::{MultiCurrency, MultiReservableCurrency}; pub use pallet::*; use pallet_deposits::traits::DepositHandler; use pallet_disputes::traits::DisputeRaiser; -use pallet_fellowship::{traits::EnsureRole, Role}; +use pallet_fellowship::{traits::EnsureRole}; use scale_info::TypeInfo; use sp_arithmetic::per_things::Percent; use sp_core::H256; @@ -51,8 +50,6 @@ pub type IndividualVotes = BoundedBTreeMap< >; pub type AccountIdOf = ::AccountId; -type VetterIdOf = AccountIdOf; - pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; pub type StorageItemOf = <::DepositHandler as DepositHandler, AccountIdOf>>::StorageItem; @@ -482,7 +479,7 @@ pub mod pallet { if let Some(project) = maybe_project { let mut total_to_refund_including_fee: BalanceOf = Zero::zero(); - for (ms_key, mut ms) in project.milestones.iter_mut() { + for (_ms_key, ms) in project.milestones.iter_mut() { if ms.can_refund && ms.transfer_status.is_none() { let milestone_amount = ms.percentage_to_unlock.mul_floor(project.raised_funds); @@ -638,13 +635,14 @@ pub mod pallet { let project_account_id = crate::Pallet::::project_account_id(project_key); // todo: Error handling here can be improved. - let is_funded = Self::fund_project( + let _is_funded = Self::fund_project( &on_creation_funding, &contributions, &project_account_id, currency_id, ) .map_err(|_| Error::::ProjectFundingFailed)?; + let converted_milestones = Self::try_convert_to_milestones(proposed_milestones.clone(), project_key) .map_err(|_| Error::::MilestoneConversionFailed)?; @@ -657,7 +655,7 @@ pub mod pallet { let bounded_milestone_keys = proposed_milestones .iter() .enumerate() - .map(|(i, ms)| i as u32) + .map(|(i, _ms)| i as u32) .collect::>() .try_into() .map_err(|_| Error::::TooManyMilestones)?; @@ -853,7 +851,7 @@ pub enum Locality { } impl Locality { - fn from_multilocation(m: MultiLocation) -> Self { + fn _from_multilocation(m: MultiLocation) -> Self { Self::Foreign(m) } fn from_local(l: AccountId) -> Self { diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index 3b9c4356..fa689d2f 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -813,7 +813,7 @@ pub mod v7 { }; let mut new_milestones: BoundedBTreeMilestones = BoundedBTreeMap::new(); - project.milestones.iter().for_each(|(ms_key, ms): (&MilestoneKey, &v6::V6Milestone)| { + project.milestones.iter().for_each(|(_ms_key, ms): (&MilestoneKey, &v6::V6Milestone)| { // assume that if its approved then its been withdrawn. let mut transfer_status: Option>> = None; if ms.is_approved { diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index 6a527c4b..69ec7f4f 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -93,7 +93,8 @@ pub fn create_and_fund_project( } // For testing grants and errors pre funding -pub fn create_project_awaiting_funding( +// TODO: tests for these! +pub fn _create_project_awaiting_funding( beneficiary: AccountIdOf, contributions: ContributionsFor, proposed_milestones: Vec, diff --git a/pallets/proposals/src/tests/into_proposals.rs b/pallets/proposals/src/tests/into_proposals.rs deleted file mode 100644 index 8b137891..00000000 --- a/pallets/proposals/src/tests/into_proposals.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/pallets/proposals/src/tests/mod.rs b/pallets/proposals/src/tests/mod.rs index 3fc5d816..0eeec162 100644 --- a/pallets/proposals/src/tests/mod.rs +++ b/pallets/proposals/src/tests/mod.rs @@ -1,5 +1,4 @@ pub mod disputes; pub mod immutable_votes; -pub mod into_proposals; pub mod pallet; pub mod refunds; diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index 9e32ebef..f00ea311 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -1,13 +1,10 @@ use crate::{AccountIdOf, BalanceOf, Contribution, FundingPath, Locality, ProposedMilestone}; -use common_types::{CurrencyId, TreasuryOrigin, TreasuryOriginConverter}; -use frame_support::{pallet_prelude::*, transactional, BoundedBTreeMap, PalletId}; -use frame_system::pallet_prelude::*; +use common_types::CurrencyId; +use frame_support::{pallet_prelude::*, transactional, BoundedBTreeMap}; use orml_traits::XcmTransfer; -use orml_xtokens::Error; use sp_arithmetic::{traits::AtLeast32BitUnsigned, Percent}; use sp_core::H256; -use sp_runtime::traits::AccountIdConversion; -use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; +use sp_std::{vec::Vec}; use xcm::latest::{MultiLocation, WeightLimit}; pub trait IntoProposal { From 1f55e984123f066ae801fff36d3ada2e13d020c6 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:04:53 +0000 Subject: [PATCH 186/192] minor fix --- pallets/disputes/src/benchmarking.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/disputes/src/benchmarking.rs b/pallets/disputes/src/benchmarking.rs index 3da887a6..ecd2c8ff 100644 --- a/pallets/disputes/src/benchmarking.rs +++ b/pallets/disputes/src/benchmarking.rs @@ -2,6 +2,7 @@ use super::*; use crate::traits::DisputeRaiser; +use crate::Pallet as PalletDisputes; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get, BoundedVec}; use frame_system::Pallet as System; From 41006eb1b320089be38c01014d87d2385436d96d Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:09:35 +0000 Subject: [PATCH 187/192] remove generic param for run to block felloship --- pallets/fellowship/src/tests/pallet_tests.rs | 8 ++++---- pallets/fellowship/src/tests/test_utils.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/fellowship/src/tests/pallet_tests.rs b/pallets/fellowship/src/tests/pallet_tests.rs index 769e576c..5bfc29d0 100644 --- a/pallets/fellowship/src/tests/pallet_tests.rs +++ b/pallets/fellowship/src/tests/pallet_tests.rs @@ -486,7 +486,7 @@ fn on_initialize_adds_to_fellowship_from_shortlist() { Role::Vetter, 10 )); - run_to_block::( + run_to_block( frame_system::Pallet::::block_number() + ::ShortlistPeriod::get(), ); assert_eq!(Roles::::get(CHARLIE).unwrap(), (Role::Vetter, 10)); @@ -512,7 +512,7 @@ fn on_initialize_doesnt_add_removed_shortlist_members() { RuntimeOrigin::signed(ALICE), CHARLIE, )); - run_to_block::( + run_to_block( frame_system::Pallet::::block_number() + ::ShortlistPeriod::get(), ); assert!(Roles::::get(CHARLIE).is_none()); @@ -541,7 +541,7 @@ fn on_initialize_cleans_storage_for_next_round() { .len() == 1 ); - run_to_block::( + run_to_block( frame_system::Pallet::::block_number() + ::ShortlistPeriod::get(), ); @@ -600,7 +600,7 @@ fn e2e() { )); // wait for blocks to pass - run_to_block::( + run_to_block( frame_system::Pallet::::block_number() + ::ShortlistPeriod::get(), ); diff --git a/pallets/fellowship/src/tests/test_utils.rs b/pallets/fellowship/src/tests/test_utils.rs index c78a6919..f62bbfbf 100644 --- a/pallets/fellowship/src/tests/test_utils.rs +++ b/pallets/fellowship/src/tests/test_utils.rs @@ -20,7 +20,7 @@ pub(crate) fn revoke_fellowship( >>::revoke_fellowship(who, slash_deposit) } -pub fn run_to_block(n: BlockNumber) { +pub fn run_to_block(n: BlockNumber) { while System::block_number() < n { Tokens::on_finalize(System::block_number()); Fellowship::on_finalize(System::block_number()); From 8ae4b89065959f41f8bd6670c377128404266036 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:13:57 +0000 Subject: [PATCH 188/192] clippy --- pallets/disputes/src/benchmarking.rs | 14 +++++----- pallets/fellowship/src/mock.rs | 2 +- pallets/proposals/src/benchmarking.rs | 12 ++++----- pallets/proposals/src/impls/pallet_impls.rs | 6 ++--- pallets/proposals/src/lib.rs | 12 ++++----- pallets/proposals/src/migration.rs | 2 +- pallets/proposals/src/mock.rs | 9 +++---- pallets/proposals/src/test_utils.rs | 10 +++---- pallets/proposals/src/tests/disputes.rs | 30 ++++++++++----------- pallets/proposals/src/tests/refunds.rs | 14 +++++----- pallets/proposals/src/traits.rs | 2 +- 11 files changed, 56 insertions(+), 57 deletions(-) diff --git a/pallets/disputes/src/benchmarking.rs b/pallets/disputes/src/benchmarking.rs index ecd2c8ff..7e9fa91a 100644 --- a/pallets/disputes/src/benchmarking.rs +++ b/pallets/disputes/src/benchmarking.rs @@ -2,7 +2,7 @@ use super::*; use crate::traits::DisputeRaiser; -use crate::Pallet as PalletDisputes; + use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get, BoundedVec}; use frame_system::Pallet as System; @@ -40,7 +40,7 @@ mod benchmarks { assert_ok!( as DisputeRaiser>>::raise_dispute( 10u32.into(), - alice.clone(), + alice, jury, specifics, )); @@ -59,7 +59,7 @@ mod benchmarks { assert_ok!( as DisputeRaiser>>::raise_dispute( 10u32.into(), - alice.clone(), + alice, jury, specifics, )); @@ -72,12 +72,12 @@ mod benchmarks { fn force_fail_dispute() { let alice: AccountIdOf = account("ALICE", 0, 0); let bob: AccountIdOf = account("BOB", 0, 0); - let jury = get_jury::(vec![bob.clone()]); + let jury = get_jury::(vec![bob]); let specifics = get_specifics::(vec![0u32.into(), 1u32.into()]); let dispute_key = 10u32.into(); assert_ok!( as DisputeRaiser>>::raise_dispute( dispute_key, - alice.clone(), + alice, jury, specifics, )); @@ -98,12 +98,12 @@ mod benchmarks { fn force_succeed_dispute() { let alice: AccountIdOf = account("ALICE", 0, 0); let bob: AccountIdOf = account("BOB", 0, 0); - let jury = get_jury::(vec![bob.clone()]); + let jury = get_jury::(vec![bob]); let specifics = get_specifics::(vec![0u32.into(), 1u32.into()]); let dispute_key = 10u32.into(); assert_ok!( as DisputeRaiser>>::raise_dispute( dispute_key, - alice.clone(), + alice, jury, specifics, )); diff --git a/pallets/fellowship/src/mock.rs b/pallets/fellowship/src/mock.rs index db92fbd7..ed6abeec 100644 --- a/pallets/fellowship/src/mock.rs +++ b/pallets/fellowship/src/mock.rs @@ -1,5 +1,5 @@ use crate as pallet_fellowship; -use crate::{Permission, Role}; + use common_types::CurrencyId; use frame_support::traits::{ConstU16, Nothing}; use frame_system::EnsureRoot; diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 4b0e8caf..72449e52 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -4,7 +4,7 @@ use crate::Pallet as Proposals; use common_types::CurrencyId; use frame_benchmarking::v2::*; use frame_support::assert_ok; -use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; +use frame_system::{RawOrigin}; use sp_core::Get; use sp_runtime::SaturatedConversion; @@ -157,7 +157,7 @@ mod benchmarks { .unwrap(); let project_key = create_and_fund_project::( - alice.clone(), + alice, contributions, prop_milestones, CurrencyId::Native, @@ -166,9 +166,9 @@ mod benchmarks { #[extrinsic_call] raise_dispute( - RawOrigin::Signed(bob.clone()), + RawOrigin::Signed(bob), project_key, - milestone_keys.clone(), + milestone_keys, ); } @@ -195,7 +195,7 @@ mod benchmarks { .unwrap(); let project_key = create_and_fund_project::( - alice.clone(), + alice, contributions, prop_milestones, CurrencyId::Native, @@ -214,7 +214,7 @@ mod benchmarks { ); #[extrinsic_call] - refund(RawOrigin::Signed(bob.clone()), project_key); + refund(RawOrigin::Signed(bob), project_key); assert_last_event::( Event::::ProjectRefunded { project_key, diff --git a/pallets/proposals/src/impls/pallet_impls.rs b/pallets/proposals/src/impls/pallet_impls.rs index c0fd8a60..a2f26a27 100644 --- a/pallets/proposals/src/impls/pallet_impls.rs +++ b/pallets/proposals/src/impls/pallet_impls.rs @@ -141,7 +141,7 @@ impl Pallet { .milestones .iter_mut() .map(|(_key, ms)| { - if ms.is_approved && ms.transfer_status == None { + if ms.is_approved && ms.transfer_status.is_none() { ms.transfer_status = Some(TransferStatus::Withdrawn { on: frame_system::Pallet::::block_number(), }); @@ -345,7 +345,7 @@ impl DisputeHooks for Pallet { if let Some(milestone) = project.milestones.get_mut(milestone_key) { // Shouldnt be needed but nice to have this check. // Will prevent someone calling both refund and withdraw on the same milestone. - if milestone.transfer_status == None { + if milestone.transfer_status.is_none() { milestone.can_refund = true; } } @@ -365,6 +365,6 @@ impl DisputeHooks for Pallet { }); // ProjectsInDispute::remove // Projects::mutate - return T::DbWeight::get().reads_writes(2, 2); + T::DbWeight::get().reads_writes(2, 2) } } diff --git a/pallets/proposals/src/lib.rs b/pallets/proposals/src/lib.rs index abf1dd88..55c74c99 100644 --- a/pallets/proposals/src/lib.rs +++ b/pallets/proposals/src/lib.rs @@ -10,11 +10,11 @@ use orml_traits::{MultiCurrency, MultiReservableCurrency}; pub use pallet::*; use pallet_deposits::traits::DepositHandler; use pallet_disputes::traits::DisputeRaiser; -use pallet_fellowship::{traits::EnsureRole}; + use scale_info::TypeInfo; use sp_arithmetic::per_things::Percent; use sp_core::H256; -use sp_runtime::traits::{AccountIdConversion, Convert, One, Saturating, Zero}; +use sp_runtime::traits::{AccountIdConversion, One, Saturating, Zero}; use sp_std::{collections::btree_map::*, convert::TryInto, prelude::*}; use xcm::latest::MultiLocation; @@ -441,7 +441,7 @@ pub mod pallet { Error::::OnlyContributorsCanRaiseDispute ); ensure!( - !ProjectsInDispute::::contains_key(&project_key), + !ProjectsInDispute::::contains_key(project_key), Error::::MilestonesAlreadyInDispute ); ensure!( @@ -459,7 +459,7 @@ pub mod pallet { )?; ProjectsInDispute::::insert(project_key, milestone_keys); - Ok(().into()) + Ok(()) } /// Attempt a refund of milestones. @@ -516,7 +516,7 @@ pub mod pallet { T::MultiCurrency::transfer( project.currency_id, &project_account, - &acc, + acc, per_refund, )?; } @@ -552,7 +552,7 @@ pub mod pallet { } })?; - Ok(().into()) + Ok(()) } /// Sets the given AccountId (`new`) as the new Foreign asset signer diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index fa689d2f..a4918056 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -844,7 +844,7 @@ pub mod v7 { cancelled: project.cancelled, deposit_id: project.deposit_id, refund_locations, - jury: jury, + jury, on_creation_funding, refunded_funds: Zero::zero(), }; diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index 1bf86147..628304a0 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -2,7 +2,6 @@ use crate as pallet_proposals; use frame_support::{ parameter_types, traits::{ConstU32, Nothing}, - weights::{ConstantMultiplier, IdentityFee}, PalletId, }; @@ -280,10 +279,10 @@ impl DisputeRaiser for MockDisputeRaiser { type MaxJurySize = MaxJuryMembers; type MaxSpecifics = MaxMilestonesPerProject; fn raise_dispute( - dispute_key: Self::DisputeKey, - raised_by: AccountId, - jury: BoundedVec, - specific_ids: BoundedVec, + _dispute_key: Self::DisputeKey, + _raised_by: AccountId, + _jury: BoundedVec, + _specific_ids: BoundedVec, ) -> Result<(), DispatchError> { Ok(()) } diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index 69ec7f4f..0e7fd0b0 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -1,15 +1,15 @@ use crate::*; use common_types::CurrencyId; -use frame_support::{assert_ok, traits::Hooks, BoundedVec}; +use frame_support::{assert_ok, BoundedVec}; use frame_system::EventRecord; use orml_traits::{MultiCurrency, MultiReservableCurrency}; -use pallet_deposits::traits::DepositHandler; + use pallet_disputes::traits::DisputeHooks; use sp_arithmetic::per_things::Percent; use sp_core::{Get, H256}; -use sp_runtime::Saturating; + use sp_runtime::{DispatchError, SaturatedConversion}; -use sp_std::{collections::btree_map::BTreeMap, convert::TryInto}; +use sp_std::{convert::TryInto}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::account; @@ -75,7 +75,7 @@ pub fn create_and_fund_project( AccountIdOf, BalanceOf, BlockNumberFor, - >>::convert_contributions_to_refund_locations(&contributions.clone()); + >>::convert_contributions_to_refund_locations(&contributions); // Reserve the assets from the contributors used. as IntoProposal, BalanceOf, BlockNumberFor>>::convert_to_proposal( diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index 19078aac..f9476dab 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -65,7 +65,7 @@ fn raise_dispute_milestone_already_in_dispute() { project_key, milestone_keys )); - for (i, index) in milestones.iter().enumerate() { + for (i, _index) in milestones.iter().enumerate() { assert_noop!( Proposals::raise_dispute( RuntimeOrigin::signed(CHARLIE), @@ -86,7 +86,7 @@ fn raise_dispute_invalid_milestone_key() { let project_key = create_and_fund_project::( ALICE, contributions, - milestones.clone(), + milestones, CurrencyId::Native, ) .unwrap(); @@ -125,7 +125,7 @@ fn raise_dispute_cant_raise_on_approved_milestone() { let project_key = create_and_fund_project::( ALICE, contributions, - milestones.clone(), + milestones, CurrencyId::Native, ) .unwrap(); @@ -328,7 +328,7 @@ fn raise_dispute_allows_milestone_voting() { assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, - dispute_milestone_keys.clone() + dispute_milestone_keys )); assert_ok!(Proposals::vote_on_milestone( @@ -368,7 +368,7 @@ fn raise_dispute_allows_milestone_voting_on_non_disputed_milestones() { assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, - dispute_milestone_keys.clone() + dispute_milestone_keys )); assert_ok!(Proposals::submit_milestone( @@ -414,7 +414,7 @@ fn raise_dispute_allows_submission() { assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, - dispute_milestone_keys.clone() + dispute_milestone_keys )); assert_ok!(Proposals::submit_milestone( RuntimeOrigin::signed(ALICE), @@ -429,7 +429,7 @@ fn failed_dispute_tests() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![BOB, CHARLIE], 1_000_000u128); let milestones = get_milestones(10); - let milestone_key = 0; + let _milestone_key = 0; let project_key = create_and_fund_project::( ALICE, contributions, @@ -472,13 +472,13 @@ fn assert_can_recall_dispute_after_success() { let project_key = create_and_fund_project::( ALICE, contributions, - milestones.clone(), + milestones, CurrencyId::Native, ) .unwrap(); // Only call the dispute on part. let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - (0u32..5 as u32).collect::>().try_into().unwrap(); + (0u32..5_u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), @@ -491,11 +491,11 @@ fn assert_can_recall_dispute_after_success() { DisputeResult::Success, ); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - (5u32..10 as u32).collect::>().try_into().unwrap(); + (5u32..10_u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, - milestone_keys.clone() + milestone_keys )); }) } @@ -508,13 +508,13 @@ fn assert_can_recall_dispute_after_failure() { let project_key = create_and_fund_project::( ALICE, contributions, - milestones.clone(), + milestones, CurrencyId::Native, ) .unwrap(); // Only call the dispute on part. let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - (0u32..5 as u32).collect::>().try_into().unwrap(); + (0u32..5_u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), @@ -527,11 +527,11 @@ fn assert_can_recall_dispute_after_failure() { DisputeResult::Failure, ); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - (5u32..10 as u32).collect::>().try_into().unwrap(); + (5u32..10_u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, - milestone_keys.clone() + milestone_keys )); }) } diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 1a6e7b38..16643165 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -44,13 +44,13 @@ fn refund_assert_milestone_state_change() { let project_key = create_and_fund_project::( ALICE, contributions, - milestones.clone(), + milestones, CurrencyId::Native, ) .unwrap(); // Only dispute some keys so that we can let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - (0u32..5 as u32).collect::>().try_into().unwrap(); + (0u32..5_u32).collect::>().try_into().unwrap(); assert_ok!(Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, @@ -147,7 +147,7 @@ fn refund_deletes_project_when_all_funds_are_refunded() { ); // All milestones should be good for refund - let _ = Proposals::refund(RuntimeOrigin::signed(BOB), project_key).unwrap(); + Proposals::refund(RuntimeOrigin::signed(BOB), project_key).unwrap(); assert!(!Projects::::contains_key(project_key)); }) } @@ -231,19 +231,19 @@ fn refund_then_withdraw_no_double_spend() { let contributions = get_contributions::(vec![BOB], 1_000_000u128); let milestones = get_milestones(10); let milestone_key = 0; - let alice_before_creation = + let _alice_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); - let bob_before_creation = + let _bob_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); let project_key = create_and_fund_project::( ALICE, contributions, - milestones.clone(), + milestones, CurrencyId::Native, ) .unwrap(); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = - (0u32..5 as u32).collect::>().try_into().unwrap(); + (0u32..5_u32).collect::>().try_into().unwrap(); let _ = Proposals::raise_dispute( RuntimeOrigin::signed(BOB), project_key, diff --git a/pallets/proposals/src/traits.rs b/pallets/proposals/src/traits.rs index f00ea311..1b9b2426 100644 --- a/pallets/proposals/src/traits.rs +++ b/pallets/proposals/src/traits.rs @@ -4,7 +4,7 @@ use frame_support::{pallet_prelude::*, transactional, BoundedBTreeMap}; use orml_traits::XcmTransfer; use sp_arithmetic::{traits::AtLeast32BitUnsigned, Percent}; use sp_core::H256; -use sp_std::{vec::Vec}; + use xcm::latest::{MultiLocation, WeightLimit}; pub trait IntoProposal { From fd91fe5582d4dc5de520c6b8c3462209cf06d8c7 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:22:21 +0000 Subject: [PATCH 189/192] weights --- pallets/briefs/src/weights.rs | 70 ++++++++++--------- pallets/disputes/src/weights.rs | 112 +++++++++++++++--------------- pallets/fellowship/src/weights.rs | 36 +++++----- pallets/grants/src/weights.rs | 14 ++-- runtime/imbue-kusama/src/lib.rs | 5 +- 5 files changed, 122 insertions(+), 115 deletions(-) diff --git a/pallets/briefs/src/weights.rs b/pallets/briefs/src/weights.rs index b5294f90..ddb169ec 100644 --- a/pallets/briefs/src/weights.rs +++ b/pallets/briefs/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_briefs` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-11-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Justs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("local")`, DB CACHE: 1024 // Executed Command: @@ -22,7 +22,7 @@ // --extrinsic // * // --output -// ./pallets/briefs/src/weights.rs +// weights.rs // --steps // 50 // --repeat @@ -40,51 +40,55 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl crate::WeightInfoT for WeightInfo { /// Storage: `ImbueBriefs::Briefs` (r:1 w:1) - /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(3366), added: 5841, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(1725), added: 4200, mode: `MaxEncodedLen`) /// Storage: `Deposits::TicketId` (r:1 w:1) /// Proof: `Deposits::TicketId` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ImbueBriefs::BriefContributions` (r:1 w:1) - /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(5250), added: 7725, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(2649), added: 5124, mode: `MaxEncodedLen`) /// Storage: `ImbueBriefs::CounterForBriefs` (r:1 w:1) /// Proof: `ImbueBriefs::CounterForBriefs` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `Deposits::CurrentDeposits` (r:0 w:1) /// Proof: `Deposits::CurrentDeposits` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) fn create_brief() -> Weight { // Proof Size summary in bytes: - // Measured: `434` - // Estimated: `8715` - // Minimum execution time: 678_000_000 picoseconds. - Weight::from_parts(702_000_000, 0) - .saturating_add(Weight::from_parts(0, 8715)) + // Measured: `334` + // Estimated: `6114` + // Minimum execution time: 674_565_000 picoseconds. + Weight::from_parts(699_090_000, 0) + .saturating_add(Weight::from_parts(0, 6114)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `ImbueBriefs::Briefs` (r:1 w:0) - /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(3366), added: 5841, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(1725), added: 4200, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ImbueBriefs::BriefContributions` (r:1 w:1) - /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(5250), added: 7725, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(2649), added: 5124, mode: `MaxEncodedLen`) fn contribute_to_brief() -> Weight { // Proof Size summary in bytes: - // Measured: `3860` - // Estimated: `8715` - // Minimum execution time: 373_000_000 picoseconds. - Weight::from_parts(403_000_000, 0) - .saturating_add(Weight::from_parts(0, 8715)) + // Measured: `2119` + // Estimated: `6114` + // Minimum execution time: 388_641_000 picoseconds. + Weight::from_parts(404_811_000, 0) + .saturating_add(Weight::from_parts(0, 6114)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ImbueBriefs::Briefs` (r:1 w:1) - /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(3366), added: 5841, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(1725), added: 4200, mode: `MaxEncodedLen`) /// Storage: `ImbueBriefs::BriefContributions` (r:1 w:1) - /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(5250), added: 7725, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(2649), added: 5124, mode: `MaxEncodedLen`) /// Storage: `Deposits::CurrentDeposits` (r:1 w:2) /// Proof: `Deposits::CurrentDeposits` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ImbueFellowship::Roles` (r:1 w:0) + /// Proof: `ImbueFellowship::Roles` (`max_values`: None, `max_size`: Some(51), added: 2526, mode: `MaxEncodedLen`) + /// Storage: `ImbueFellowship::JuryPointer` (r:1 w:1) + /// Proof: `ImbueFellowship::JuryPointer` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::ProjectCount` (r:1 w:1) /// Proof: `ImbueProposals::ProjectCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `Deposits::TicketId` (r:1 w:1) @@ -92,36 +96,36 @@ impl crate::WeightInfoT for WeightInfo { /// Storage: `ImbueBriefs::CounterForBriefs` (r:1 w:1) /// Proof: `ImbueBriefs::CounterForBriefs` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::Projects` (r:0 w:1) - /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(260823), added: 263298, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::IndividualVoteStore` (r:0 w:1) - /// Proof: `ImbueProposals::IndividualVoteStore` (`max_values`: None, `max_size`: Some(8250321), added: 8252796, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::IndividualVoteStore` (`max_values`: None, `max_size`: Some(16571), added: 19046, mode: `MaxEncodedLen`) fn commence_work() -> Weight { // Proof Size summary in bytes: - // Measured: `4520` + // Measured: `2607` // Estimated: `8799` - // Minimum execution time: 1_763_000_000 picoseconds. - Weight::from_parts(1_805_000_000, 0) + // Minimum execution time: 1_739_406_000 picoseconds. + Weight::from_parts(1_778_978_000, 0) .saturating_add(Weight::from_parts(0, 8799)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(12)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(13)) } /// Storage: `ImbueBriefs::Briefs` (r:1 w:1) - /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(3366), added: 5841, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::Briefs` (`max_values`: None, `max_size`: Some(1725), added: 4200, mode: `MaxEncodedLen`) /// Storage: `Deposits::CurrentDeposits` (r:1 w:1) /// Proof: `Deposits::CurrentDeposits` (`max_values`: None, `max_size`: Some(69), added: 2544, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `ImbueBriefs::BriefContributions` (r:1 w:1) - /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(5250), added: 7725, mode: `MaxEncodedLen`) + /// Proof: `ImbueBriefs::BriefContributions` (`max_values`: None, `max_size`: Some(2649), added: 5124, mode: `MaxEncodedLen`) /// Storage: `ImbueBriefs::CounterForBriefs` (r:1 w:1) /// Proof: `ImbueBriefs::CounterForBriefs` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn cancel_brief() -> Weight { // Proof Size summary in bytes: - // Measured: `4094` - // Estimated: `8715` - // Minimum execution time: 727_000_000 picoseconds. - Weight::from_parts(738_000_000, 0) - .saturating_add(Weight::from_parts(0, 8715)) + // Measured: `2353` + // Estimated: `6114` + // Minimum execution time: 721_794_000 picoseconds. + Weight::from_parts(753_268_000, 0) + .saturating_add(Weight::from_parts(0, 6114)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } diff --git a/pallets/disputes/src/weights.rs b/pallets/disputes/src/weights.rs index f357d438..dd672737 100644 --- a/pallets/disputes/src/weights.rs +++ b/pallets/disputes/src/weights.rs @@ -2,10 +2,10 @@ //! Autogenerated weights for `pallet_disputes` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-11-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("local"), DB CACHE: 1024 +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("local")`, DB CACHE: 1024 // Executed Command: // ./target/debug/imbue @@ -39,85 +39,85 @@ use core::marker::PhantomData; /// Weight functions for `pallet_disputes`. pub struct WeightInfo(PhantomData); impl crate::WeightInfoT for WeightInfo { - /// Storage: ImbueDisputes Disputes (r:1 w:1) - /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) - /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) - /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: `ImbueDisputes::Disputes` (r:1 w:1) + /// Proof: `ImbueDisputes::Disputes` (`max_values`: None, `max_size`: Some(6602), added: 9077, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::DisputesFinaliseOn` (r:1 w:1) + /// Proof: `ImbueDisputes::DisputesFinaliseOn` (`max_values`: None, `max_size`: Some(221), added: 2696, mode: `MaxEncodedLen`) fn raise_dispute() -> Weight { // Proof Size summary in bytes: // Measured: `76` - // Estimated: `10227` - // Minimum execution time: 427_950_000 picoseconds. - Weight::from_parts(487_417_000, 0) - .saturating_add(Weight::from_parts(0, 10227)) + // Estimated: `10067` + // Minimum execution time: 152_261_000 picoseconds. + Weight::from_parts(153_191_000, 0) + .saturating_add(Weight::from_parts(0, 10067)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: ImbueDisputes Disputes (r:1 w:1) - /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) - /// Storage: ImbueDisputes DisputesFinaliseOn (r:2 w:2) - /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: `ImbueDisputes::Disputes` (r:1 w:1) + /// Proof: `ImbueDisputes::Disputes` (`max_values`: None, `max_size`: Some(6602), added: 9077, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::DisputesFinaliseOn` (r:2 w:2) + /// Proof: `ImbueDisputes::DisputesFinaliseOn` (`max_values`: None, `max_size`: Some(221), added: 2696, mode: `MaxEncodedLen`) fn extend_dispute() -> Weight { // Proof Size summary in bytes: // Measured: `250` - // Estimated: `10227` - // Minimum execution time: 531_852_000 picoseconds. - Weight::from_parts(536_740_000, 0) - .saturating_add(Weight::from_parts(0, 10227)) + // Estimated: `10067` + // Minimum execution time: 244_000_000 picoseconds. + Weight::from_parts(245_568_000, 0) + .saturating_add(Weight::from_parts(0, 10067)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: ImbueDisputes Disputes (r:1 w:1) - /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) - /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) - /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) - /// Storage: ImbueProposals Projects (r:1 w:1) - /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(3284392), added: 3286867, mode: MaxEncodedLen) - /// Storage: ImbueProposals ProjectsInDispute (r:0 w:1) - /// Proof: ImbueProposals ProjectsInDispute (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: `ImbueDisputes::Disputes` (r:1 w:1) + /// Proof: `ImbueDisputes::Disputes` (`max_values`: None, `max_size`: Some(6602), added: 9077, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::DisputesFinaliseOn` (r:1 w:1) + /// Proof: `ImbueDisputes::DisputesFinaliseOn` (`max_values`: None, `max_size`: Some(221), added: 2696, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::Projects` (r:1 w:1) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::ProjectsInDispute` (r:0 w:1) + /// Proof: `ImbueProposals::ProjectsInDispute` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn vote_on_dispute() -> Weight { // Proof Size summary in bytes: // Measured: `292` - // Estimated: `3287857` - // Minimum execution time: 327_261_000 picoseconds. - Weight::from_parts(782_582_000, 0) - .saturating_add(Weight::from_parts(0, 3287857)) + // Estimated: `39815` + // Minimum execution time: 337_396_000 picoseconds. + Weight::from_parts(344_127_000, 0) + .saturating_add(Weight::from_parts(0, 39815)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: ImbueDisputes Disputes (r:1 w:1) - /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) - /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) - /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) - /// Storage: ImbueProposals Projects (r:1 w:1) - /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(3284392), added: 3286867, mode: MaxEncodedLen) - /// Storage: ImbueProposals ProjectsInDispute (r:0 w:1) - /// Proof: ImbueProposals ProjectsInDispute (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: `ImbueDisputes::Disputes` (r:1 w:1) + /// Proof: `ImbueDisputes::Disputes` (`max_values`: None, `max_size`: Some(6602), added: 9077, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::DisputesFinaliseOn` (r:1 w:1) + /// Proof: `ImbueDisputes::DisputesFinaliseOn` (`max_values`: None, `max_size`: Some(221), added: 2696, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::Projects` (r:1 w:1) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::ProjectsInDispute` (r:0 w:1) + /// Proof: `ImbueProposals::ProjectsInDispute` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn force_fail_dispute() -> Weight { // Proof Size summary in bytes: // Measured: `292` - // Estimated: `3287857` - // Minimum execution time: 262_013_000 picoseconds. - Weight::from_parts(273_507_000, 0) - .saturating_add(Weight::from_parts(0, 3287857)) + // Estimated: `39815` + // Minimum execution time: 244_177_000 picoseconds. + Weight::from_parts(250_254_000, 0) + .saturating_add(Weight::from_parts(0, 39815)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: ImbueDisputes Disputes (r:1 w:1) - /// Proof: ImbueDisputes Disputes (max_values: None, max_size: Some(6762), added: 9237, mode: MaxEncodedLen) - /// Storage: ImbueDisputes DisputesFinaliseOn (r:1 w:1) - /// Proof: ImbueDisputes DisputesFinaliseOn (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) - /// Storage: ImbueProposals Projects (r:1 w:1) - /// Proof: ImbueProposals Projects (max_values: None, max_size: Some(3284392), added: 3286867, mode: MaxEncodedLen) - /// Storage: ImbueProposals ProjectsInDispute (r:0 w:1) - /// Proof: ImbueProposals ProjectsInDispute (max_values: None, max_size: Some(221), added: 2696, mode: MaxEncodedLen) + /// Storage: `ImbueDisputes::Disputes` (r:1 w:1) + /// Proof: `ImbueDisputes::Disputes` (`max_values`: None, `max_size`: Some(6602), added: 9077, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::DisputesFinaliseOn` (r:1 w:1) + /// Proof: `ImbueDisputes::DisputesFinaliseOn` (`max_values`: None, `max_size`: Some(221), added: 2696, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::Projects` (r:1 w:1) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::ProjectsInDispute` (r:0 w:1) + /// Proof: `ImbueProposals::ProjectsInDispute` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn force_succeed_dispute() -> Weight { // Proof Size summary in bytes: // Measured: `292` - // Estimated: `3287857` - // Minimum execution time: 248_587_000 picoseconds. - Weight::from_parts(250_775_000, 0) - .saturating_add(Weight::from_parts(0, 3287857)) + // Estimated: `39815` + // Minimum execution time: 243_762_000 picoseconds. + Weight::from_parts(250_041_000, 0) + .saturating_add(Weight::from_parts(0, 39815)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -125,8 +125,8 @@ impl crate::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_804_000 picoseconds. - Weight::from_parts(13_239_000, 0) + // Minimum execution time: 12_448_000 picoseconds. + Weight::from_parts(13_334_000, 0) .saturating_add(Weight::from_parts(0, 0)) } } diff --git a/pallets/fellowship/src/weights.rs b/pallets/fellowship/src/weights.rs index 4f9c1fbe..61f40058 100644 --- a/pallets/fellowship/src/weights.rs +++ b/pallets/fellowship/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_fellowship` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-11-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Justs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("local")`, DB CACHE: 1024 // Executed Command: @@ -22,7 +22,7 @@ // --extrinsic // * // --output -// ./pallets/fellowship/src/weights.rs +// weights.rs // --steps // 50 // --repeat @@ -38,7 +38,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_fellowship`. pub struct WeightInfo(PhantomData); -impl crate::traits::WeightInfoT for WeightInfo { +impl crate::WeightInfoT for WeightInfo { /// Storage: `ImbueFellowship::Roles` (r:1 w:1) /// Proof: `ImbueFellowship::Roles` (`max_values`: None, `max_size`: Some(51), added: 2526, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) @@ -51,8 +51,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `145` // Estimated: `3593` - // Minimum execution time: 308_000_000 picoseconds. - Weight::from_parts(322_000_000, 0) + // Minimum execution time: 297_927_000 picoseconds. + Weight::from_parts(299_772_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) @@ -63,8 +63,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3516` - // Minimum execution time: 126_000_000 picoseconds. - Weight::from_parts(136_000_000, 0) + // Minimum execution time: 153_043_000 picoseconds. + Weight::from_parts(154_780_000, 0) .saturating_add(Weight::from_parts(0, 3516)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -83,8 +83,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `410` // Estimated: `3593` - // Minimum execution time: 478_000_000 picoseconds. - Weight::from_parts(488_000_000, 0) + // Minimum execution time: 463_315_000 picoseconds. + Weight::from_parts(479_038_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -103,8 +103,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `513` // Estimated: `6196` - // Minimum execution time: 947_000_000 picoseconds. - Weight::from_parts(1_025_000_000, 0) + // Minimum execution time: 894_392_000 picoseconds. + Weight::from_parts(915_373_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -121,8 +121,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `289` // Estimated: `6886` - // Minimum execution time: 253_000_000 picoseconds. - Weight::from_parts(278_000_000, 0) + // Minimum execution time: 270_206_000 picoseconds. + Weight::from_parts(278_894_000, 0) .saturating_add(Weight::from_parts(0, 6886)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) @@ -137,8 +137,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `299` // Estimated: `6886` - // Minimum execution time: 196_000_000 picoseconds. - Weight::from_parts(199_000_000, 0) + // Minimum execution time: 205_598_000 picoseconds. + Weight::from_parts(207_340_000, 0) .saturating_add(Weight::from_parts(0, 6886)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -155,8 +155,8 @@ impl crate::traits::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `259` // Estimated: `3593` - // Minimum execution time: 407_000_000 picoseconds. - Weight::from_parts(411_000_000, 0) + // Minimum execution time: 392_591_000 picoseconds. + Weight::from_parts(401_207_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/pallets/grants/src/weights.rs b/pallets/grants/src/weights.rs index 36e03508..4a84dc3b 100644 --- a/pallets/grants/src/weights.rs +++ b/pallets/grants/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for `pallet_grants` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-11-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Justs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("local")`, DB CACHE: 1024 // Executed Command: @@ -22,7 +22,7 @@ // --extrinsic // * // --output -// ./pallets/grants/src/weights.rs +// weights.rs // --steps // 50 // --repeat @@ -52,15 +52,15 @@ impl crate::WeightInfoT for WeightInfo { /// Storage: `ImbueGrants::GrantsSubmittedBy` (r:0 w:1) /// Proof: `ImbueGrants::GrantsSubmittedBy` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::Projects` (r:0 w:1) - /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(260823), added: 263298, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::IndividualVoteStore` (r:0 w:1) - /// Proof: `ImbueProposals::IndividualVoteStore` (`max_values`: None, `max_size`: Some(8250321), added: 8252796, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::IndividualVoteStore` (`max_values`: None, `max_size`: Some(16571), added: 19046, mode: `MaxEncodedLen`) fn create_and_convert() -> Weight { // Proof Size summary in bytes: // Measured: `369` // Estimated: `3593` - // Minimum execution time: 1_094_000_000 picoseconds. - Weight::from_parts(1_137_000_000, 0) + // Minimum execution time: 1_038_238_000 picoseconds. + Weight::from_parts(1_072_638_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index 3d725d6d..c377ecbf 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1313,12 +1313,14 @@ impl pallet_fellowship::traits::SelectJury frame_support::BoundedVec, Self::JurySize> { let mut out: frame_support::BoundedVec, Self::JurySize> = frame_support::BoundedVec::new(); - let mut amount = Self::JurySize::get(); + let amount = Self::JurySize::get(); let keys = pallet_fellowship::Roles::::iter_keys().collect::>>(); let keys_len = keys.len(); let pointer = pallet_fellowship::JuryPointer::::get(); let pointer_with_bound = pointer.saturating_add(amount.into()); for i in pointer..pointer_with_bound { + if keys_len > 0 { + let index = i as usize % keys_len; // shouldnt be an issue due to mod. if index < keys.len() { @@ -1331,6 +1333,7 @@ impl pallet_fellowship::traits::SelectJury::put(pointer_with_bound); out From 28d617c57ead7d2dd957d9c83544d0ba510d3ec8 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:37:07 +0000 Subject: [PATCH 190/192] proposal benchmark fixes + weights --- pallets/fellowship/src/weights.rs | 2 +- pallets/proposals/src/benchmarking.rs | 20 +++--- pallets/proposals/src/weights.rs | 91 +++++++++++++++------------ 3 files changed, 61 insertions(+), 52 deletions(-) diff --git a/pallets/fellowship/src/weights.rs b/pallets/fellowship/src/weights.rs index 61f40058..b1a781e9 100644 --- a/pallets/fellowship/src/weights.rs +++ b/pallets/fellowship/src/weights.rs @@ -38,7 +38,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_fellowship`. pub struct WeightInfo(PhantomData); -impl crate::WeightInfoT for WeightInfo { +impl crate::traits::WeightInfoT for WeightInfo { /// Storage: `ImbueFellowship::Roles` (r:1 w:1) /// Proof: `ImbueFellowship::Roles` (`max_values`: None, `max_size`: Some(51), added: 2526, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 72449e52..3e61ec5f 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -46,8 +46,8 @@ mod benchmarks { #[benchmark] fn vote_on_milestone() { - let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000u128); - let bob: T::AccountId = create_funded_user::("contributor", 1, 1_000_000_000_000u128); + let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); // TODO: should update the contributors list to have maximum available length let contributions = get_contributions::(vec![bob.clone()], 1_000_000_000_000u128); let prop_milestones = get_max_milestones::(); @@ -138,13 +138,13 @@ mod benchmarks { #[benchmark] fn raise_dispute() { - let contribution_amount = 1_000_000_000_000u128; - let alice: T::AccountId = create_funded_user::("initiator", 1, contribution_amount); - let bob: T::AccountId = create_funded_user::("contributor", 0, contribution_amount); + let contribution_amount = 10_000_000_000_000_000u128; + let alice: T::AccountId = create_funded_user::("initiator", 1, 100_000_000_000_000_000_000u128); + let bob: T::AccountId = create_funded_user::("contributor", 0, 100_000_000_000_000_000_000u128); let contributors: Vec = (0 ..::MaximumContributorsPerProject::get()) - .map(|i| create_funded_user::("contributor", i, contribution_amount)) + .map(|i| create_funded_user::("contributor", i, 100_000_000_000_000_000_000u128)) .collect(); let contributions = get_contributions::(contributors, contribution_amount); @@ -174,13 +174,13 @@ mod benchmarks { #[benchmark] fn refund() { - let contribution_amount = 1_000_000_000_000u128.saturated_into(); - let alice: T::AccountId = create_funded_user::("initiator", 1, contribution_amount); - let bob: T::AccountId = create_funded_user::("contributor", 0, contribution_amount); + let contribution_amount = 10_000_000_000_000_000u128.saturated_into(); + let alice: T::AccountId = create_funded_user::("initiator", 1, 100_000_000_000_000_000_000u128); + let bob: T::AccountId = create_funded_user::("contributor", 0, 100_000_000_000_000_000_000u128); let contributors: Vec = (0 ..::MaximumContributorsPerProject::get()) - .map(|i| create_funded_user::("contributor", i, contribution_amount)) + .map(|i| create_funded_user::("contributor", i, 100_000_000_000_000_000_000u128)) .collect(); let contributions = get_contributions::(contributors, contribution_amount); diff --git a/pallets/proposals/src/weights.rs b/pallets/proposals/src/weights.rs index fa64d2bc..db9727fe 100644 --- a/pallets/proposals/src/weights.rs +++ b/pallets/proposals/src/weights.rs @@ -2,13 +2,13 @@ //! Autogenerated weights for `pallet_proposals` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-07, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-11-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Justs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `user`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("local")`, DB CACHE: 1024 // Executed Command: -// ./target/release/imbue +// ./target/debug/imbue // benchmark // pallet // --chain @@ -22,13 +22,11 @@ // --extrinsic // * // --output -// ./pallets/proposals/src/weights.rs +// weights.rs // --steps // 50 // --repeat // 20 -// --heap-pages -// 4096 #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -42,7 +40,7 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl crate::WeightInfoT for WeightInfo { /// Storage: `ImbueProposals::Projects` (r:1 w:0) - /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(2862), added: 5337, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::RoundsExpiring` (r:1 w:1) /// Proof: `ImbueProposals::RoundsExpiring` (`max_values`: None, `max_size`: Some(111), added: 2586, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::IndividualVoteStore` (r:1 w:1) @@ -53,16 +51,16 @@ impl crate::WeightInfoT for WeightInfo { /// Proof: `ImbueProposals::Rounds` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) fn submit_milestone() -> Weight { // Proof Size summary in bytes: - // Measured: `496` - // Estimated: `20036` - // Minimum execution time: 30_000_000 picoseconds. - Weight::from_parts(31_000_000, 0) - .saturating_add(Weight::from_parts(0, 20036)) + // Measured: `568` + // Estimated: `39815` + // Minimum execution time: 345_914_000 picoseconds. + Weight::from_parts(354_103_000, 0) + .saturating_add(Weight::from_parts(0, 39815)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `ImbueProposals::Projects` (r:1 w:1) - /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(2862), added: 5337, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::Rounds` (r:1 w:1) /// Proof: `ImbueProposals::Rounds` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) /// Storage: `ImbueProposals::IndividualVoteStore` (r:1 w:1) @@ -73,16 +71,16 @@ impl crate::WeightInfoT for WeightInfo { /// Proof: `ImbueProposals::RoundsExpiring` (`max_values`: None, `max_size`: Some(111), added: 2586, mode: `MaxEncodedLen`) fn vote_on_milestone() -> Weight { // Proof Size summary in bytes: - // Measured: `639` - // Estimated: `20036` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(46_000_000, 0) - .saturating_add(Weight::from_parts(0, 20036)) + // Measured: `711` + // Estimated: `39815` + // Minimum execution time: 460_847_000 picoseconds. + Weight::from_parts(472_559_000, 0) + .saturating_add(Weight::from_parts(0, 39815)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: `ImbueProposals::Projects` (r:1 w:1) - /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(2862), added: 5337, mode: `MaxEncodedLen`) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:3 w:3) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// Storage: `Deposits::CurrentDeposits` (r:1 w:1) @@ -91,10 +89,10 @@ impl crate::WeightInfoT for WeightInfo { /// Proof: `ImbueProposals::CompletedProjects` (`max_values`: None, `max_size`: Some(262184), added: 264659, mode: `MaxEncodedLen`) fn withdraw() -> Weight { // Proof Size summary in bytes: - // Measured: `997` + // Measured: `1120` // Estimated: `265649` - // Minimum execution time: 130_000_000 picoseconds. - Weight::from_parts(144_000_000, 0) + // Minimum execution time: 1_638_213_000 picoseconds. + Weight::from_parts(1_677_055_000, 0) .saturating_add(Weight::from_parts(0, 265649)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -111,31 +109,42 @@ impl crate::WeightInfoT for WeightInfo { // Proof Size summary in bytes: // Measured: `97` // Estimated: `20036` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 147_964_000 picoseconds. + Weight::from_parts(151_147_000, 0) .saturating_add(Weight::from_parts(0, 20036)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } - - fn refund() -> Weight { + /// Storage: `ImbueProposals::Projects` (r:1 w:0) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) + /// Storage: `ImbueProposals::ProjectsInDispute` (r:1 w:1) + /// Proof: `ImbueProposals::ProjectsInDispute` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::Disputes` (r:1 w:1) + /// Proof: `ImbueDisputes::Disputes` (`max_values`: None, `max_size`: Some(6602), added: 9077, mode: `MaxEncodedLen`) + /// Storage: `ImbueDisputes::DisputesFinaliseOn` (r:1 w:1) + /// Proof: `ImbueDisputes::DisputesFinaliseOn` (`max_values`: None, `max_size`: Some(221), added: 2696, mode: `MaxEncodedLen`) + fn raise_dispute() -> Weight { // Proof Size summary in bytes: - // Measured: `97` - // Estimated: `3936` - // Minimum execution time: 6_577_000 picoseconds. - Weight::from_parts(6_907_000, 0) - .saturating_add(Weight::from_parts(0, 3936)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `4797` + // Estimated: `39815` + // Minimum execution time: 346_461_000 picoseconds. + Weight::from_parts(356_015_000, 0) + .saturating_add(Weight::from_parts(0, 39815)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - fn raise_dispute() -> Weight { + /// Storage: `ImbueProposals::Projects` (r:1 w:1) + /// Proof: `ImbueProposals::Projects` (`max_values`: None, `max_size`: Some(36350), added: 38825, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:52 w:52) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn refund() -> Weight { // Proof Size summary in bytes: - // Measured: `97` - // Estimated: `3936` - // Minimum execution time: 6_577_000 picoseconds. - Weight::from_parts(6_907_000, 0) - .saturating_add(Weight::from_parts(0, 3936)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `11381` + // Estimated: `136346` + // Minimum execution time: 23_947_016_000 picoseconds. + Weight::from_parts(24_080_686_000, 0) + .saturating_add(Weight::from_parts(0, 136346)) + .saturating_add(T::DbWeight::get().reads(53)) + .saturating_add(T::DbWeight::get().writes(53)) } } From 8bf222a7357108bfa98c8c538cf1785a3103a8a2 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:49:35 +0000 Subject: [PATCH 191/192] change balance type proposals mock to u128 to prevent overflow --- pallets/disputes/src/benchmarking.rs | 16 ++++++++-------- pallets/proposals/src/benchmarking.rs | 16 ++++++++-------- pallets/proposals/src/migration.rs | 8 ++++---- pallets/proposals/src/mock.rs | 14 +++++++------- pallets/proposals/src/tests/pallet.rs | 18 +++++++++--------- pallets/proposals/src/tests/refunds.rs | 4 ++-- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/pallets/disputes/src/benchmarking.rs b/pallets/disputes/src/benchmarking.rs index 7e9fa91a..b8f9f6ce 100644 --- a/pallets/disputes/src/benchmarking.rs +++ b/pallets/disputes/src/benchmarking.rs @@ -2,7 +2,7 @@ use super::*; use crate::traits::DisputeRaiser; - +use crate::Pallet as DisputesPallet; use frame_benchmarking::v2::*; use frame_support::{assert_ok, traits::Get, BoundedVec}; use frame_system::Pallet as System; @@ -40,7 +40,7 @@ mod benchmarks { assert_ok!( as DisputeRaiser>>::raise_dispute( 10u32.into(), - alice, + alice.clone(), jury, specifics, )); @@ -59,7 +59,7 @@ mod benchmarks { assert_ok!( as DisputeRaiser>>::raise_dispute( 10u32.into(), - alice, + alice.clone(), jury, specifics, )); @@ -72,12 +72,12 @@ mod benchmarks { fn force_fail_dispute() { let alice: AccountIdOf = account("ALICE", 0, 0); let bob: AccountIdOf = account("BOB", 0, 0); - let jury = get_jury::(vec![bob]); + let jury = get_jury::(vec![bob.clone()]); let specifics = get_specifics::(vec![0u32.into(), 1u32.into()]); let dispute_key = 10u32.into(); assert_ok!( as DisputeRaiser>>::raise_dispute( dispute_key, - alice, + alice.clone(), jury, specifics, )); @@ -98,12 +98,12 @@ mod benchmarks { fn force_succeed_dispute() { let alice: AccountIdOf = account("ALICE", 0, 0); let bob: AccountIdOf = account("BOB", 0, 0); - let jury = get_jury::(vec![bob]); + let jury = get_jury::(vec![bob.clone()]); let specifics = get_specifics::(vec![0u32.into(), 1u32.into()]); let dispute_key = 10u32.into(); assert_ok!( as DisputeRaiser>>::raise_dispute( dispute_key, - alice, + alice.clone(), jury, specifics, )); @@ -154,7 +154,7 @@ mod benchmarks { } impl_benchmark_test_suite!( - PalletDisputes, + DisputesPallet, crate::mock::new_test_ext(), crate::mock::Test ); diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 3e61ec5f..7433ec82 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -138,13 +138,13 @@ mod benchmarks { #[benchmark] fn raise_dispute() { - let contribution_amount = 10_000_000_000_000_000u128; - let alice: T::AccountId = create_funded_user::("initiator", 1, 100_000_000_000_000_000_000u128); - let bob: T::AccountId = create_funded_user::("contributor", 0, 100_000_000_000_000_000_000u128); + let contribution_amount = 1_000_000_000_000u128; + let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); let contributors: Vec = (0 ..::MaximumContributorsPerProject::get()) - .map(|i| create_funded_user::("contributor", i, 100_000_000_000_000_000_000u128)) + .map(|i| create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128)) .collect(); let contributions = get_contributions::(contributors, contribution_amount); @@ -174,13 +174,13 @@ mod benchmarks { #[benchmark] fn refund() { - let contribution_amount = 10_000_000_000_000_000u128.saturated_into(); - let alice: T::AccountId = create_funded_user::("initiator", 1, 100_000_000_000_000_000_000u128); - let bob: T::AccountId = create_funded_user::("contributor", 0, 100_000_000_000_000_000_000u128); + let contribution_amount = 1_000_000_000_000u128.saturated_into(); + let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); let contributors: Vec = (0 ..::MaximumContributorsPerProject::get()) - .map(|i| create_funded_user::("contributor", i, 100_000_000_000_000_000_000u128)) + .map(|i| create_funded_user::("contributor", i, 1_000_000_000_000_000_000u128)) .collect(); let contributions = get_contributions::(contributors, contribution_amount); diff --git a/pallets/proposals/src/migration.rs b/pallets/proposals/src/migration.rs index a4918056..1e04bb71 100644 --- a/pallets/proposals/src/migration.rs +++ b/pallets/proposals/src/migration.rs @@ -865,7 +865,7 @@ mod test { #[test] fn migrate_v0_to_v1() { - let contribution_value = 1_000_000_u64; + let contribution_value = 1_000_000_u128; build_test_externality().execute_with(|| { let project_key = 1; @@ -951,7 +951,7 @@ mod test { fn migrate_v1_to_v2() { build_test_externality().execute_with(|| { let project_key = 1; - let contribution_value = 1_000_000_u64; + let contribution_value = 1_000_000_u128; let mut contributions: BTreeMap< AccountIdOf, Contribution, TimestampOf>, @@ -1077,8 +1077,8 @@ mod test { true, ); let v = Vote { - yay: 100_000u64, - nay: 50_000u64, + yay: 100_000u128, + nay: 50_000u128, is_approved: false, }; v3::OldMilestoneVotes::::insert((10, 10), v); diff --git a/pallets/proposals/src/mock.rs b/pallets/proposals/src/mock.rs index 628304a0..db32a2ab 100644 --- a/pallets/proposals/src/mock.rs +++ b/pallets/proposals/src/mock.rs @@ -26,7 +26,7 @@ type Block = frame_system::mocking::MockBlock; pub type BlockNumber = u64; pub type Amount = i128; -pub type Balance = u64; +pub type Balance = u128; pub type Moment = u64; pub type AccountId = u128; @@ -119,14 +119,14 @@ parameter_types! { } parameter_types! { - pub const ExistentialDeposit: u64 = 5; + pub const ExistentialDeposit: Balance = 5; pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Test { type RuntimeEvent = RuntimeEvent; type AccountStore = System; - type Balance = u64; + type Balance = Balance; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type MaxLocks = (); @@ -187,9 +187,9 @@ impl pallet_proposals::Config for Test { } parameter_types! { - pub const BasicDeposit: u64 = 10; - pub const FieldDeposit: u64 = 10; - pub const SubAccountDeposit: u64 = 10; + pub const BasicDeposit: Balance = 10; + pub const FieldDeposit: Balance = 10; + pub const SubAccountDeposit: Balance = 10; pub const MaxSubAccounts: u32 = 2; pub const MaxAdditionalFields: u32 = 2; pub const MaxRegistrars: u32 = 20; @@ -236,7 +236,7 @@ pub(crate) fn build_test_externality() -> sp_io::TestExternalities { let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| { - let initial_balance = 100_000_000u64; + let initial_balance = 100_000_000_000u128; System::set_block_number(1); let _ = Tokens::deposit(CurrencyId::Native, &ALICE, initial_balance); let _ = Tokens::deposit(CurrencyId::Native, &BOB, initial_balance); diff --git a/pallets/proposals/src/tests/pallet.rs b/pallets/proposals/src/tests/pallet.rs index bbb97d20..ce730cec 100644 --- a/pallets/proposals/src/tests/pallet.rs +++ b/pallets/proposals/src/tests/pallet.rs @@ -390,14 +390,14 @@ fn users_can_submit_multiple_milestones_and_vote_independantly() { .get(&milestone_key_0) .expect("vote 0 should exist"); - assert!(vote_0.yay == 100_000u64); - assert!(vote_0.nay == 0u64); + assert!(vote_0.yay == 100_000u128); + assert!(vote_0.nay == 0u128); let vote_1 = total_votes .get(&milestone_key_1) .expect("vote 1 should exist"); - assert!(vote_1.yay == 100_000u64); - assert!(vote_1.nay == 0u64); + assert!(vote_1.yay == 100_000u128); + assert!(vote_1.nay == 0u128); }); } @@ -560,8 +560,8 @@ fn vote_on_milestone_actually_adds_to_vote() { )); let total_votes = MilestoneVotes::::get(project_key); let vote = total_votes.get(&milestone_key).expect("vote should exist"); - assert!(vote.yay == 100_000u64); - assert!(vote.nay == 0u64); + assert!(vote.yay == 100_000u128); + assert!(vote.nay == 0u128); assert_ok!(Proposals::vote_on_milestone( RuntimeOrigin::signed(CHARLIE), project_key, @@ -571,8 +571,8 @@ fn vote_on_milestone_actually_adds_to_vote() { let total_votes = MilestoneVotes::::get(project_key); let vote = total_votes.get(&milestone_key).expect("vote should exist"); - assert!(vote.yay == 100_000u64); - assert!(vote.nay == 100_000u64); + assert!(vote.yay == 100_000u128); + assert!(vote.nay == 100_000u128); }); } @@ -691,7 +691,7 @@ fn withdraw_only_transfers_approved_milestones() { let expected_fee = ::ImbueFee::get().mul_floor(per_contribution * 2 / 10); // total_contribution / number of milestones - fee let alice_expected_balance = - alice_before + ((per_contribution * 2 / 10) as u64) - expected_fee as u64; + alice_before + ((per_contribution * 2 / 10) as u128) - expected_fee as u128; assert_eq!( alice_after, alice_expected_balance, "Alice account is not the expected balance" diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index 16643165..af501afb 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -280,7 +280,7 @@ fn refund_check_refund_amount() { ::MultiCurrency::free_balance(CurrencyId::Native, &BOB); let charlie_pre_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &CHARLIE); - let per_contribution = 100000u64; + let per_contribution = 100000u128; let contributions = get_contributions::(vec![BOB, CHARLIE], per_contribution as u128); let milestones = get_milestones(10); let project_key = create_and_fund_project::( @@ -337,7 +337,7 @@ fn refund_takes_imbue_fee() { CurrencyId::Native, &::ImbueFeeAccount::get(), ); - let per_contribution = 500000u64; + let per_contribution = 500000u128; let contributions = get_contributions::(vec![BOB, CHARLIE], per_contribution as u128); let milestones = get_milestones(10); From 97daea9291f07a9f6b6f7c7b8e464a58bc2ee29d Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 24 Nov 2023 22:50:55 +0000 Subject: [PATCH 192/192] fmt --- pallets/grants/src/lib.rs | 2 +- pallets/proposals/src/benchmarking.rs | 46 +++++++++++-------------- pallets/proposals/src/test_utils.rs | 2 +- pallets/proposals/src/tests/disputes.rs | 40 +++++++-------------- pallets/proposals/src/tests/refunds.rs | 20 ++++------- runtime/imbue-kusama/src/lib.rs | 23 ++++++------- 6 files changed, 51 insertions(+), 82 deletions(-) diff --git a/pallets/grants/src/lib.rs b/pallets/grants/src/lib.rs index 7452ab35..27f5cf3c 100644 --- a/pallets/grants/src/lib.rs +++ b/pallets/grants/src/lib.rs @@ -33,7 +33,7 @@ pub mod pallet { use sp_arithmetic::{per_things::Percent, traits::One}; use sp_core::H256; use sp_runtime::Saturating; - use sp_std::{collections::btree_map::BTreeMap}; + use sp_std::collections::btree_map::BTreeMap; pub(crate) type AccountIdOf = ::AccountId; pub(crate) type BalanceOf = diff --git a/pallets/proposals/src/benchmarking.rs b/pallets/proposals/src/benchmarking.rs index 7433ec82..b3deb780 100644 --- a/pallets/proposals/src/benchmarking.rs +++ b/pallets/proposals/src/benchmarking.rs @@ -4,7 +4,7 @@ use crate::Pallet as Proposals; use common_types::CurrencyId; use frame_benchmarking::v2::*; use frame_support::assert_ok; -use frame_system::{RawOrigin}; +use frame_system::RawOrigin; use sp_core::Get; use sp_runtime::SaturatedConversion; @@ -46,8 +46,10 @@ mod benchmarks { #[benchmark] fn vote_on_milestone() { - let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); + let alice: T::AccountId = + create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = + create_funded_user::("contributor", 1, 1_000_000_000_000_000_000u128); // TODO: should update the contributors list to have maximum available length let contributions = get_contributions::(vec![bob.clone()], 1_000_000_000_000u128); let prop_milestones = get_max_milestones::(); @@ -139,8 +141,10 @@ mod benchmarks { #[benchmark] fn raise_dispute() { let contribution_amount = 1_000_000_000_000u128; - let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); + let alice: T::AccountId = + create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = + create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); let contributors: Vec = (0 ..::MaximumContributorsPerProject::get()) @@ -156,27 +160,21 @@ mod benchmarks { .try_into() .unwrap(); - let project_key = create_and_fund_project::( - alice, - contributions, - prop_milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(alice, contributions, prop_milestones, CurrencyId::Native) + .unwrap(); #[extrinsic_call] - raise_dispute( - RawOrigin::Signed(bob), - project_key, - milestone_keys, - ); + raise_dispute(RawOrigin::Signed(bob), project_key, milestone_keys); } #[benchmark] fn refund() { let contribution_amount = 1_000_000_000_000u128.saturated_into(); - let alice: T::AccountId = create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); - let bob: T::AccountId = create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); + let alice: T::AccountId = + create_funded_user::("initiator", 1, 1_000_000_000_000_000_000u128); + let bob: T::AccountId = + create_funded_user::("contributor", 0, 1_000_000_000_000_000_000u128); let contributors: Vec = (0 ..::MaximumContributorsPerProject::get()) @@ -194,13 +192,9 @@ mod benchmarks { .try_into() .unwrap(); - let project_key = create_and_fund_project::( - alice, - contributions, - prop_milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(alice, contributions, prop_milestones, CurrencyId::Native) + .unwrap(); assert_ok!(crate::Pallet::::raise_dispute( RawOrigin::Signed(bob.clone()).into(), diff --git a/pallets/proposals/src/test_utils.rs b/pallets/proposals/src/test_utils.rs index 0e7fd0b0..4362be81 100644 --- a/pallets/proposals/src/test_utils.rs +++ b/pallets/proposals/src/test_utils.rs @@ -9,7 +9,7 @@ use sp_arithmetic::per_things::Percent; use sp_core::{Get, H256}; use sp_runtime::{DispatchError, SaturatedConversion}; -use sp_std::{convert::TryInto}; +use sp_std::convert::TryInto; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::account; diff --git a/pallets/proposals/src/tests/disputes.rs b/pallets/proposals/src/tests/disputes.rs index f9476dab..3106528e 100644 --- a/pallets/proposals/src/tests/disputes.rs +++ b/pallets/proposals/src/tests/disputes.rs @@ -83,13 +83,9 @@ fn raise_dispute_invalid_milestone_key() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![BOB, CHARLIE], 1_000_000u128); let milestones = get_milestones(10); - let project_key = create_and_fund_project::( - ALICE, - contributions, - milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(ALICE, contributions, milestones, CurrencyId::Native) + .unwrap(); assert_noop!( Proposals::raise_dispute( RuntimeOrigin::signed(BOB), @@ -122,13 +118,9 @@ fn raise_dispute_cant_raise_on_approved_milestone() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![BOB, CHARLIE], 1_000_000u128); let milestones = get_milestones(10); - let project_key = create_and_fund_project::( - ALICE, - contributions, - milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(ALICE, contributions, milestones, CurrencyId::Native) + .unwrap(); let submitted_milestone_key = 0u32; assert_ok!(Proposals::submit_milestone( @@ -469,13 +461,9 @@ fn assert_can_recall_dispute_after_success() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![BOB, CHARLIE], 1_000_000u128); let milestones = get_milestones(10); - let project_key = create_and_fund_project::( - ALICE, - contributions, - milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(ALICE, contributions, milestones, CurrencyId::Native) + .unwrap(); // Only call the dispute on part. let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5_u32).collect::>().try_into().unwrap(); @@ -505,13 +493,9 @@ fn assert_can_recall_dispute_after_failure() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![BOB, CHARLIE], 1_000_000u128); let milestones = get_milestones(10); - let project_key = create_and_fund_project::( - ALICE, - contributions, - milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(ALICE, contributions, milestones, CurrencyId::Native) + .unwrap(); // Only call the dispute on part. let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5_u32).collect::>().try_into().unwrap(); diff --git a/pallets/proposals/src/tests/refunds.rs b/pallets/proposals/src/tests/refunds.rs index af501afb..3b739f25 100644 --- a/pallets/proposals/src/tests/refunds.rs +++ b/pallets/proposals/src/tests/refunds.rs @@ -41,13 +41,9 @@ fn refund_assert_milestone_state_change() { build_test_externality().execute_with(|| { let contributions = get_contributions::(vec![BOB], 1_000_000u128); let milestones = get_milestones(10); - let project_key = create_and_fund_project::( - ALICE, - contributions, - milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(ALICE, contributions, milestones, CurrencyId::Native) + .unwrap(); // Only dispute some keys so that we can let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5_u32).collect::>().try_into().unwrap(); @@ -235,13 +231,9 @@ fn refund_then_withdraw_no_double_spend() { ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); let _bob_before_creation = ::MultiCurrency::free_balance(CurrencyId::Native, &ALICE); - let project_key = create_and_fund_project::( - ALICE, - contributions, - milestones, - CurrencyId::Native, - ) - .unwrap(); + let project_key = + create_and_fund_project::(ALICE, contributions, milestones, CurrencyId::Native) + .unwrap(); let milestone_keys: BoundedVec::MaxMilestonesPerProject> = (0u32..5_u32).collect::>().try_into().unwrap(); let _ = Proposals::raise_dispute( diff --git a/runtime/imbue-kusama/src/lib.rs b/runtime/imbue-kusama/src/lib.rs index c377ecbf..8e364359 100644 --- a/runtime/imbue-kusama/src/lib.rs +++ b/runtime/imbue-kusama/src/lib.rs @@ -1320,20 +1320,19 @@ impl pallet_fellowship::traits::SelectJury 0 { - - let index = i as usize % keys_len; - // shouldnt be an issue due to mod. - if index < keys.len() { - let key = &keys[index]; - // Here weve gone in a circle! break. - if out.contains(&key) { - break; - } - if let Err(_) = out.try_push(key.clone()) { - break; + let index = i as usize % keys_len; + // shouldnt be an issue due to mod. + if index < keys.len() { + let key = &keys[index]; + // Here weve gone in a circle! break. + if out.contains(&key) { + break; + } + if let Err(_) = out.try_push(key.clone()) { + break; + } } } - } } pallet_fellowship::JuryPointer::::put(pointer_with_bound); out