From e991d9edbc76db6f2ecc2780a7caf4a4702cff6a Mon Sep 17 00:00:00 2001 From: Chralt Date: Tue, 10 Jan 2023 17:05:04 +0100 Subject: [PATCH 01/53] Allow MDMs to control future resolutions (#862) * use future resolution inside pm-pallet * wip * wip * prepare storage migration * add UpdateMarketIdsPerDisputeBlock migration * wip * avoid in place migration * default to oracle report for authorized * wip * wip * change test * fix benchmark * add resolve_failed_mdm benchmarks * correct benchmarks * fix nightly clippy * fix after merge * fix admin for Authorized * fix global disputes * add migration tests * delete 0.3.7 storage migration * cargo fmt * modify storage versions to test try-runtime * edit doc comment * simplify doc comment * update benchmark authorize outcome * avoid indentation * rename AuthorityReportPeriod to ReportPeriod * use ensure * check benchmark * remove where clauses * Apply suggestions from code review Co-authored-by: Malte Kliemann * add empty commit * use Weight instead of u64 * resolve doc comment * rename MarketCommonsAuthorized to MarketCommons * fmt * allow only one dispute for authorized * clippy * fix benchmarks after one dispute limit authorized * fix clippy * add try-runtime tests * correct benchmarks * down tracing-core to get try-runtime logs * rename failed to expired * rename resolution to resolve_at * fix small nitpicks * edit doc comment * use reporting period from last dispute * modify doc string * document private authorozed api * fix after merge * print market id for try-runtime tests * bump migration versions * avoid storage_iter * add warning * set block number non-zero in migration test * move storage migration * recalc migration markets counter * abstract remove auto resolve * fmt * remove TODO * add expired report period check * rename to has_failed * satisfy clippy * check dispute resolution blocks * use mock storage with unsafe * use MarketIdsPerDisputeBlock inside mock * prepare authority account id * correct benchmarks * add mock storage * correct start_global_disputes benchmark * improve migration * remove fallible authority feature * remove fallible authority feature * avoid option storage query, handle 432 market * Update zrml/authorized/src/mock_storage.rs Co-authored-by: Malte Kliemann * fix resolve_failed_mdm bug * Update zrml/prediction-markets/src/tests.rs Co-authored-by: Malte Kliemann * fixes after merge * avoid refreshing correction period * add description for the changes made * remove resolve_failed_mdm * use ord_parameter_types macro * check auto resolve in case of existing report * handle market 432 * correct pm disputes authorized benchmarks * fix clippy * update pm weights * remove unused error * test only one dispute error * remove unused error * remove unused event * cargo fmt Co-authored-by: Malte Kliemann --- docs/changelog_for_devs.md | 6 + primitives/src/constants/mock.rs | 1 + primitives/src/market.rs | 6 + primitives/src/traits.rs | 2 +- primitives/src/traits/dispute_api.rs | 81 +++++- runtime/battery-station/src/parameters.rs | 1 + runtime/common/src/lib.rs | 16 +- runtime/zeitgeist/src/parameters.rs | 1 + zrml/authorized/src/benchmarks.rs | 70 +++++- zrml/authorized/src/lib.rs | 125 ++++++++-- zrml/authorized/src/migrations.rs | 56 +++++ zrml/authorized/src/mock.rs | 84 ++++++- zrml/authorized/src/mock_storage.rs | 52 ++++ zrml/authorized/src/tests.rs | 87 ++++++- zrml/authorized/src/weights.rs | 27 +- zrml/court/src/lib.rs | 48 +++- zrml/court/src/mock.rs | 54 +++- zrml/prediction-markets/src/benchmarks.rs | 148 +++++------ zrml/prediction-markets/src/lib.rs | 176 +++++++------ zrml/prediction-markets/src/migrations.rs | 289 +++++++++++++++++++++- zrml/prediction-markets/src/mock.rs | 26 +- zrml/prediction-markets/src/tests.rs | 286 ++++++--------------- zrml/prediction-markets/src/weights.rs | 268 ++++++++++---------- zrml/simple-disputes/src/lib.rs | 92 ++++++- zrml/simple-disputes/src/mock.rs | 53 +++- 25 files changed, 1454 insertions(+), 601 deletions(-) create mode 100644 zrml/authorized/src/mock_storage.rs diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index 9f113d413..fde20e06c 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -5,6 +5,12 @@ which has three fields: `who` (the account that reserved the bond), `value` (the amount reserved), `is_settled` (a flag which determines if the bond was already unreserved and/or (partially) slashed). +- The market dispute mechanisms are now able to control their resolution. The + `CorrectionPeriod` parameter determines how long the authorized pallet can + call `authorize_market_outcome` again after the first call to it (fat-finger + protection). The authority report now includes its resolution block number. + This is the time of the first call to `authorize_market_outcome` plus the + `CorrectionPeriod`. # v0.3.7 diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 5ceec13d6..515924b50 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -11,6 +11,7 @@ use orml_traits::parameter_type_with_key; // Authorized parameter_types! { pub const AuthorizedPalletId: PalletId = PalletId(*b"zge/atzd"); + pub const CorrectionPeriod: BlockNumber = 4; } // Court diff --git a/primitives/src/market.rs b/primitives/src/market.rs index a2ccf417a..9584fd274 100644 --- a/primitives/src/market.rs +++ b/primitives/src/market.rs @@ -264,6 +264,12 @@ pub struct Report { pub outcome: OutcomeReport, } +#[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] +pub struct AuthorityReport { + pub resolve_at: BlockNumber, + pub outcome: OutcomeReport, +} + /// Contains a market id and the market period. /// /// * `BN`: Block Number diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index ee21643ac..1fc14cba1 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -21,7 +21,7 @@ mod market_id; mod swaps; mod zeitgeist_multi_reservable_currency; -pub use dispute_api::DisputeApi; +pub use dispute_api::{DisputeApi, DisputeResolutionApi}; pub use market_commons_pallet_api::MarketCommonsPalletApi; pub use market_id::MarketId; pub use swaps::Swaps; diff --git a/primitives/src/traits/dispute_api.rs b/primitives/src/traits/dispute_api.rs index 41733edd8..17d062692 100644 --- a/primitives/src/traits/dispute_api.rs +++ b/primitives/src/traits/dispute_api.rs @@ -16,7 +16,7 @@ // along with Zeitgeist. If not, see . use crate::{market::MarketDispute, outcome_report::OutcomeReport, types::Market}; -use frame_support::dispatch::DispatchResult; +use frame_support::{dispatch::DispatchResult, pallet_prelude::Weight, BoundedVec}; use sp_runtime::DispatchError; // Abstraction of the market type, which is not a part of `DisputeApi` because Rust doesn't support @@ -60,4 +60,83 @@ pub trait DisputeApi { market_id: &Self::MarketId, market: &MarketOfDisputeApi, ) -> Result, DispatchError>; + + /// Query the future resolution block of a disputed market. + /// **May** assume that `market.dispute_mechanism` refers to the calling dispute API. + /// + /// # Returns + /// + /// Returns the future resolution block if available, otherwise `None`. + fn get_auto_resolve( + disputes: &[MarketDispute], + market_id: &Self::MarketId, + market: &MarketOfDisputeApi, + ) -> Result, DispatchError>; + + /// Returns `true` if the market dispute mechanism + /// was unable to come to a conclusion. + /// **May** assume that `market.dispute_mechanism` refers to the calling dispute API. + fn has_failed( + disputes: &[MarketDispute], + market_id: &Self::MarketId, + market: &MarketOfDisputeApi, + ) -> Result; +} + +type MarketOfDisputeResolutionApi = Market< + ::AccountId, + ::Balance, + ::BlockNumber, + ::Moment, +>; + +pub trait DisputeResolutionApi { + type AccountId; + type Balance; + type BlockNumber; + type MarketId; + type MaxDisputes; + type Moment; + + /// Resolve a market. + /// + /// **Should** only be called if the market dispute + /// mechanism is ready for the resolution ([`DisputeApi::on_resolution`]). + /// + /// # Returns + /// + /// Returns the consumed weight. + fn resolve( + market_id: &Self::MarketId, + market: &MarketOfDisputeResolutionApi, + ) -> Result; + + /// Add a future block resolution of a disputed market. + /// + /// # Returns + /// + /// Returns the number of elements in the storage structure. + fn add_auto_resolve( + market_id: &Self::MarketId, + resolve_at: Self::BlockNumber, + ) -> Result; + + /// Check if a future block resolution of a disputed market exists. + /// + /// # Returns + /// + /// Returns `true` if the future block resolution exists, otherwise `false`. + fn auto_resolve_exists(market_id: &Self::MarketId, resolve_at: Self::BlockNumber) -> bool; + + /// Remove a future block resolution of a disputed market. + /// + /// # Returns + /// + /// Returns the number of elements in the storage structure. + fn remove_auto_resolve(market_id: &Self::MarketId, resolve_at: Self::BlockNumber) -> u32; + + /// Get the disputes of a market. + fn get_disputes( + market_id: &Self::MarketId, + ) -> BoundedVec, Self::MaxDisputes>; } diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 68bf1c76d..ed4fd4d2d 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -51,6 +51,7 @@ pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; parameter_types! { // Authorized pub const AuthorizedPalletId: PalletId = AUTHORIZED_PALLET_ID; + pub const CorrectionPeriod: BlockNumber = BLOCKS_PER_DAY; // Authority pub const MaxAuthorities: u32 = 32; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 09466e035..70389df19 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -58,7 +58,10 @@ macro_rules! decl_common_types { frame_system::ChainContext, Runtime, AllPalletsWithSystem, - zrml_prediction_markets::migrations::RecordBonds, + ( + zrml_prediction_markets::migrations::RecordBonds, + zrml_prediction_markets::migrations::AddFieldToAuthorityReport, + ), >; #[cfg(not(feature = "parachain"))] @@ -68,7 +71,10 @@ macro_rules! decl_common_types { frame_system::ChainContext, Runtime, AllPalletsWithSystem, - zrml_prediction_markets::migrations::RecordBonds, + ( + zrml_prediction_markets::migrations::RecordBonds, + zrml_prediction_markets::migrations::AddFieldToAuthorityReport, + ), >; pub type Header = generic::Header; @@ -912,15 +918,18 @@ macro_rules! impl_config_traits { impl parachain_info::Config for Runtime {} impl zrml_authorized::Config for Runtime { + type AuthorizedDisputeResolutionOrigin = EnsureRootOrHalfAdvisoryCommittee; + type CorrectionPeriod = CorrectionPeriod; + type DisputeResolution = zrml_prediction_markets::Pallet; type Event = Event; type MarketCommons = MarketCommons; - type AuthorizedDisputeResolutionOrigin = EnsureRootOrHalfAdvisoryCommittee; type PalletId = AuthorizedPalletId; type WeightInfo = zrml_authorized::weights::WeightInfo; } impl zrml_court::Config for Runtime { type CourtCaseDuration = CourtCaseDuration; + type DisputeResolution = zrml_prediction_markets::Pallet; type Event = Event; type MarketCommons = MarketCommons; type PalletId = CourtPalletId; @@ -1033,6 +1042,7 @@ macro_rules! impl_config_traits { } impl zrml_simple_disputes::Config for Runtime { + type DisputeResolution = zrml_prediction_markets::Pallet; type Event = Event; type MarketCommons = MarketCommons; type PalletId = SimpleDisputesPalletId; diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 062f42f7e..060e26a5b 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -51,6 +51,7 @@ pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; parameter_types! { // Authorized pub const AuthorizedPalletId: PalletId = AUTHORIZED_PALLET_ID; + pub const CorrectionPeriod: BlockNumber = BLOCKS_PER_DAY; // Authority pub const MaxAuthorities: u32 = 32; diff --git a/zrml/authorized/src/benchmarks.rs b/zrml/authorized/src/benchmarks.rs index e19beaf35..b2f590903 100644 --- a/zrml/authorized/src/benchmarks.rs +++ b/zrml/authorized/src/benchmarks.rs @@ -23,19 +23,77 @@ #[cfg(test)] use crate::Pallet as Authorized; -use crate::{market_mock, Call, Config, Pallet}; +use crate::{market_mock, AuthorizedOutcomeReports, Call, Config, Pallet}; use frame_benchmarking::benchmarks; -use frame_support::{dispatch::UnfilteredDispatchable, traits::EnsureOrigin}; -use zeitgeist_primitives::types::OutcomeReport; +use frame_support::{ + dispatch::UnfilteredDispatchable, + traits::{EnsureOrigin, Get}, +}; +use sp_runtime::traits::Saturating; +use zeitgeist_primitives::{ + traits::DisputeResolutionApi, + types::{AuthorityReport, OutcomeReport}, +}; use zrml_market_commons::MarketCommonsPalletApi; benchmarks! { - authorize_market_outcome { + authorize_market_outcome_first_report { + let m in 1..63; + + let origin = T::AuthorizedDisputeResolutionOrigin::successful_origin(); + let market_id = 0u32.into(); + let market = market_mock::(); + T::MarketCommons::push_market(market).unwrap(); + + frame_system::Pallet::::set_block_number(42u32.into()); + let now = frame_system::Pallet::::block_number(); + let correction_period_ends_at = now.saturating_add(T::CorrectionPeriod::get()); + for _ in 1..=m { + let id = T::MarketCommons::push_market(market_mock::()).unwrap(); + T::DisputeResolution::add_auto_resolve(&id, correction_period_ends_at).unwrap(); + } + + let call = Call::::authorize_market_outcome { + market_id, + outcome: OutcomeReport::Scalar(1), + }; + }: { + call.dispatch_bypass_filter(origin)? + } verify { + let report = AuthorityReport { + resolve_at: correction_period_ends_at, + outcome: OutcomeReport::Scalar(1) + }; + assert_eq!(AuthorizedOutcomeReports::::get(market_id).unwrap(), report); + } + + authorize_market_outcome_existing_report { let origin = T::AuthorizedDisputeResolutionOrigin::successful_origin(); + let market_id = 0u32.into(); let market = market_mock::(); T::MarketCommons::push_market(market).unwrap(); - let call = Call::::authorize_market_outcome { market_id: 0_u32.into(), outcome: OutcomeReport::Scalar(1) }; - }: { call.dispatch_bypass_filter(origin)? } + + frame_system::Pallet::::set_block_number(42u32.into()); + + let now = frame_system::Pallet::::block_number(); + let resolve_at = now.saturating_add(T::CorrectionPeriod::get()); + + let report = AuthorityReport { resolve_at, outcome: OutcomeReport::Scalar(0) }; + AuthorizedOutcomeReports::::insert(market_id, report); + + let now = frame_system::Pallet::::block_number(); + frame_system::Pallet::::set_block_number(now + 42u32.into()); + + let call = Call::::authorize_market_outcome { + market_id, + outcome: OutcomeReport::Scalar(1), + }; + }: { + call.dispatch_bypass_filter(origin)? + } verify { + let report = AuthorityReport { resolve_at, outcome: OutcomeReport::Scalar(1) }; + assert_eq!(AuthorizedOutcomeReports::::get(market_id).unwrap(), report); + } impl_benchmark_test_suite!( Authorized, diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index 23bd36d92..d33cc2789 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -24,6 +24,7 @@ mod authorized_pallet_api; mod benchmarks; pub mod migrations; mod mock; +mod mock_storage; mod tests; pub mod weights; @@ -35,22 +36,25 @@ mod pallet { use crate::{weights::WeightInfoZeitgeist, AuthorizedPalletApi}; use core::marker::PhantomData; use frame_support::{ - dispatch::DispatchResult, + dispatch::{DispatchResult, DispatchResultWithPostInfo}, ensure, - pallet_prelude::{EnsureOrigin, OptionQuery, StorageMap}, + pallet_prelude::{ConstU32, EnsureOrigin, OptionQuery, StorageMap}, traits::{Currency, Get, Hooks, IsType, StorageVersion}, PalletId, Twox64Concat, }; use frame_system::pallet_prelude::OriginFor; - use sp_runtime::DispatchError; + use sp_runtime::{traits::Saturating, DispatchError}; use zeitgeist_primitives::{ - traits::DisputeApi, - types::{Market, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport}, + traits::{DisputeApi, DisputeResolutionApi}, + types::{ + AuthorityReport, Market, MarketDispute, MarketDisputeMechanism, MarketStatus, + OutcomeReport, + }, }; use zrml_market_commons::MarketCommonsPalletApi; /// The current storage version. - const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); pub(crate) type BalanceOf = as Currency<::AccountId>>::Balance; @@ -59,7 +63,9 @@ mod pallet { pub(crate) type MarketIdOf = <::MarketCommons as MarketCommonsPalletApi>::MarketId; pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; - type MarketOf = Market< + + pub type CacheSize = ConstU32<64>; + pub(crate) type MarketOf = Market< ::AccountId, BalanceOf, ::BlockNumber, @@ -70,22 +76,43 @@ mod pallet { impl Pallet { /// Overwrites already provided outcomes for the same market and account. #[frame_support::transactional] - #[pallet::weight(T::WeightInfo::authorize_market_outcome())] + #[pallet::weight( + T::WeightInfo::authorize_market_outcome_first_report(CacheSize::get()).max( + T::WeightInfo::authorize_market_outcome_existing_report(), + ) + )] pub fn authorize_market_outcome( origin: OriginFor, market_id: MarketIdOf, outcome: OutcomeReport, - ) -> DispatchResult { + ) -> DispatchResultWithPostInfo { T::AuthorizedDisputeResolutionOrigin::ensure_origin(origin)?; let market = T::MarketCommons::market(&market_id)?; ensure!(market.status == MarketStatus::Disputed, Error::::MarketIsNotDisputed); ensure!(market.matches_outcome_report(&outcome), Error::::OutcomeMismatch); - match market.dispute_mechanism { - MarketDisputeMechanism::Authorized => { - AuthorizedOutcomeReports::::insert(market_id, outcome); - Ok(()) + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Authorized, + Error::::MarketDoesNotHaveDisputeMechanismAuthorized + ); + + let now = frame_system::Pallet::::block_number(); + + let report_opt = AuthorizedOutcomeReports::::get(market_id); + let (report, ids_len) = match &report_opt { + Some(report) => (AuthorityReport { resolve_at: report.resolve_at, outcome }, 0u32), + None => { + let resolve_at = now.saturating_add(T::CorrectionPeriod::get()); + let ids_len = T::DisputeResolution::add_auto_resolve(&market_id, resolve_at)?; + (AuthorityReport { resolve_at, outcome }, ids_len) } - _ => Err(Error::::MarketDoesNotHaveDisputeMechanismAuthorized.into()), + }; + + AuthorizedOutcomeReports::::insert(market_id, report); + + if report_opt.is_none() { + Ok(Some(T::WeightInfo::authorize_market_outcome_first_report(ids_len)).into()) + } else { + Ok(Some(T::WeightInfo::authorize_market_outcome_existing_report()).into()) } } } @@ -95,7 +122,18 @@ mod pallet { /// Event type Event: From> + IsType<::Event>; - /// Market commons + /// The period, in which the authority can correct the outcome of a market. + /// This value must not be zero. + #[pallet::constant] + type CorrectionPeriod: Get; + + type DisputeResolution: DisputeResolutionApi< + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; + type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, BlockNumber = Self::BlockNumber, @@ -118,6 +156,8 @@ mod pallet { MarketDoesNotHaveDisputeMechanismAuthorized, /// An account attempts to submit a report to an undisputed market. MarketIsNotDisputed, + /// Only one dispute is allowed. + OnlyOneDisputeAllowed, /// The report does not match the market's type. OutcomeMismatch, } @@ -134,7 +174,15 @@ mod pallet { #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(PhantomData); - impl Pallet where T: Config {} + impl Pallet + where + T: Config, + { + /// Return the resolution block number for the given market. + fn get_auto_resolve(market_id: &MarketIdOf) -> Option { + AuthorizedOutcomeReports::::get(market_id).map(|report| report.resolve_at) + } + } impl DisputeApi for Pallet where @@ -148,19 +196,54 @@ mod pallet { type Origin = T::Origin; fn on_dispute( - _: &[MarketDispute], + disputes: &[MarketDispute], _: &Self::MarketId, - _: &MarketOf, + market: &MarketOf, ) -> DispatchResult { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Authorized, + Error::::MarketDoesNotHaveDisputeMechanismAuthorized + ); + ensure!(disputes.is_empty(), Error::::OnlyOneDisputeAllowed); Ok(()) } fn on_resolution( _: &[MarketDispute], market_id: &Self::MarketId, - _: &MarketOf, + market: &MarketOf, ) -> Result, DispatchError> { - Ok(AuthorizedOutcomeReports::::take(market_id)) + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Authorized, + Error::::MarketDoesNotHaveDisputeMechanismAuthorized + ); + let report = AuthorizedOutcomeReports::::take(market_id); + Ok(report.map(|r| r.outcome)) + } + + fn get_auto_resolve( + _: &[MarketDispute], + market_id: &Self::MarketId, + market: &MarketOf, + ) -> Result, DispatchError> { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Authorized, + Error::::MarketDoesNotHaveDisputeMechanismAuthorized + ); + Ok(Self::get_auto_resolve(market_id)) + } + + fn has_failed( + _: &[MarketDispute], + _: &Self::MarketId, + market: &MarketOf, + ) -> Result { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Authorized, + Error::::MarketDoesNotHaveDisputeMechanismAuthorized + ); + + Ok(false) } } @@ -170,7 +253,7 @@ mod pallet { #[pallet::storage] #[pallet::getter(fn outcomes)] pub type AuthorizedOutcomeReports = - StorageMap<_, Twox64Concat, MarketIdOf, OutcomeReport, OptionQuery>; + StorageMap<_, Twox64Concat, MarketIdOf, AuthorityReport, OptionQuery>; } #[cfg(any(feature = "runtime-benchmarks", test))] diff --git a/zrml/authorized/src/migrations.rs b/zrml/authorized/src/migrations.rs index 16887b73b..55d6e03fb 100644 --- a/zrml/authorized/src/migrations.rs +++ b/zrml/authorized/src/migrations.rs @@ -14,3 +14,59 @@ // // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . + +// We use these utilities to prevent having to make the swaps pallet a dependency of +// prediciton-markets. The calls are based on the implementation of `StorageVersion`, found here: +// https://github.com/paritytech/substrate/blob/bc7a1e6c19aec92bfa247d8ca68ec63e07061032/frame/support/src/traits/metadata.rs#L168-L230 +// and previous migrations. +mod utility { + use crate::{BalanceOf, Config, MarketIdOf}; + use alloc::vec::Vec; + use frame_support::{ + migration::{get_storage_value, put_storage_value}, + storage::{storage_prefix, unhashed}, + traits::StorageVersion, + Blake2_128Concat, StorageHasher, + }; + use parity_scale_codec::Encode; + use zeitgeist_primitives::types::{Pool, PoolId}; + + #[allow(unused)] + const SWAPS: &[u8] = b"Swaps"; + #[allow(unused)] + const POOLS: &[u8] = b"Pools"; + #[allow(unused)] + fn storage_prefix_of_swaps_pallet() -> [u8; 32] { + storage_prefix(b"Swaps", b":__STORAGE_VERSION__:") + } + #[allow(unused)] + pub fn key_to_hash(key: K) -> Vec + where + H: StorageHasher, + K: Encode, + { + key.using_encoded(H::hash).as_ref().to_vec() + } + #[allow(unused)] + pub fn get_on_chain_storage_version_of_swaps_pallet() -> StorageVersion { + let key = storage_prefix_of_swaps_pallet(); + unhashed::get_or_default(&key) + } + #[allow(unused)] + pub fn put_storage_version_of_swaps_pallet(value: u16) { + let key = storage_prefix_of_swaps_pallet(); + unhashed::put(&key, &StorageVersion::new(value)); + } + #[allow(unused)] + pub fn get_pool(pool_id: PoolId) -> Option, MarketIdOf>> { + let hash = key_to_hash::(pool_id); + let pool_maybe = + get_storage_value::, MarketIdOf>>>(SWAPS, POOLS, &hash); + pool_maybe.unwrap_or(None) + } + #[allow(unused)] + pub fn set_pool(pool_id: PoolId, pool: Pool, MarketIdOf>) { + let hash = key_to_hash::(pool_id); + put_storage_value(SWAPS, POOLS, &hash, Some(pool)); + } +} diff --git a/zrml/authorized/src/mock.rs b/zrml/authorized/src/mock.rs index 7dece7580..056e59f1e 100644 --- a/zrml/authorized/src/mock.rs +++ b/zrml/authorized/src/mock.rs @@ -17,8 +17,16 @@ #![cfg(test)] -use crate::{self as zrml_authorized}; -use frame_support::{construct_runtime, ord_parameter_types, traits::Everything}; +extern crate alloc; + +use crate::{self as zrml_authorized, mock_storage::pallet as mock_storage}; +use alloc::{vec, vec::Vec}; +use frame_support::{ + construct_runtime, ord_parameter_types, + pallet_prelude::{DispatchError, Weight}, + traits::Everything, + BoundedVec, +}; use frame_system::EnsureSignedBy; use sp_runtime::{ testing::Header, @@ -26,11 +34,13 @@ use sp_runtime::{ }; use zeitgeist_primitives::{ constants::mock::{ - AuthorizedPalletId, BlockHashCount, MaxReserves, MinimumPeriod, PmPalletId, BASE, + AuthorizedPalletId, BlockHashCount, CorrectionPeriod, MaxReserves, MinimumPeriod, + PmPalletId, BASE, }, + traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, + AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, + MarketId, Moment, OutcomeReport, UncheckedExtrinsicTest, }, }; @@ -50,15 +60,75 @@ construct_runtime!( MarketCommons: zrml_market_commons::{Pallet, Storage}, System: frame_system::{Call, Config, Event, Pallet, Storage}, Timestamp: pallet_timestamp::{Pallet}, + // Just a mock storage for testing. + MockStorage: mock_storage::{Storage}, } ); ord_parameter_types! { pub const AuthorizedDisputeResolutionUser: AccountIdTest = ALICE; + pub const MaxDisputes: u32 = 64; +} + +// MockResolution implements DisputeResolutionApi with no-ops. +pub struct MockResolution; + +impl DisputeResolutionApi for MockResolution { + type AccountId = AccountIdTest; + type Balance = Balance; + type BlockNumber = BlockNumber; + type MarketId = MarketId; + type MaxDisputes = MaxDisputes; + type Moment = Moment; + + fn resolve( + _market_id: &Self::MarketId, + _market: &Market, + ) -> Result { + Ok(0) + } + + fn add_auto_resolve( + market_id: &Self::MarketId, + resolve_at: Self::BlockNumber, + ) -> Result { + let ids_len = >::try_mutate( + resolve_at, + |ids| -> Result { + ids.try_push(*market_id).map_err(|_| DispatchError::Other("Storage Overflow"))?; + Ok(ids.len() as u32) + }, + )?; + Ok(ids_len) + } + + fn auto_resolve_exists(market_id: &Self::MarketId, resolve_at: Self::BlockNumber) -> bool { + >::get(resolve_at).contains(market_id) + } + + fn remove_auto_resolve(market_id: &Self::MarketId, resolve_at: Self::BlockNumber) -> u32 { + >::mutate(resolve_at, |ids| -> u32 { + ids.retain(|id| id != market_id); + ids.len() as u32 + }) + } + + fn get_disputes( + _market_id: &Self::MarketId, + ) -> BoundedVec, Self::MaxDisputes> { + BoundedVec::try_from(vec![MarketDispute { + at: 42u64, + by: BOB, + outcome: OutcomeReport::Scalar(42), + }]) + .unwrap() + } } impl crate::Config for Runtime { type Event = (); + type CorrectionPeriod = CorrectionPeriod; + type DisputeResolution = MockResolution; type MarketCommons = MarketCommons; type PalletId = AuthorizedPalletId; type AuthorizedDisputeResolutionOrigin = @@ -66,6 +136,10 @@ impl crate::Config for Runtime { type WeightInfo = crate::weights::WeightInfo; } +impl mock_storage::Config for Runtime { + type MarketCommons = MarketCommons; +} + impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; diff --git a/zrml/authorized/src/mock_storage.rs b/zrml/authorized/src/mock_storage.rs new file mode 100644 index 000000000..c7908fa55 --- /dev/null +++ b/zrml/authorized/src/mock_storage.rs @@ -0,0 +1,52 @@ +// Copyright 2022 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, 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. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +#![cfg(test)] +#![allow(dead_code)] + +#[frame_support::pallet] +pub(crate) mod pallet { + use core::marker::PhantomData; + use frame_support::pallet_prelude::*; + use zrml_market_commons::MarketCommonsPalletApi; + + pub(crate) type MarketIdOf = + <::MarketCommons as MarketCommonsPalletApi>::MarketId; + + pub type CacheSize = ConstU32<64>; + + #[pallet::config] + pub trait Config: frame_system::Config { + type MarketCommons: MarketCommonsPalletApi< + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + >; + } + + #[pallet::pallet] + pub struct Pallet(PhantomData); + + /// Only used for testing the dispute resolution API to prediction-markets + #[pallet::storage] + pub(crate) type MarketIdsPerDisputeBlock = StorageMap< + _, + Twox64Concat, + T::BlockNumber, + BoundedVec, CacheSize>, + ValueQuery, + >; +} diff --git a/zrml/authorized/src/tests.rs b/zrml/authorized/src/tests.rs index c74af01d8..7cd33883c 100644 --- a/zrml/authorized/src/tests.rs +++ b/zrml/authorized/src/tests.rs @@ -20,12 +20,13 @@ use crate::{ market_mock, mock::{Authorized, AuthorizedDisputeResolutionUser, ExtBuilder, Origin, Runtime, BOB}, + mock_storage::pallet as mock_storage, AuthorizedOutcomeReports, Error, }; use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; use zeitgeist_primitives::{ traits::DisputeApi, - types::{MarketDisputeMechanism, MarketStatus, OutcomeReport}, + types::{AuthorityReport, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport}, }; use zrml_market_commons::Markets; @@ -38,7 +39,46 @@ fn authorize_market_outcome_inserts_a_new_outcome() { 0, OutcomeReport::Scalar(1) )); - assert_eq!(AuthorizedOutcomeReports::::get(0).unwrap(), OutcomeReport::Scalar(1)); + let now = frame_system::Pallet::::block_number(); + let resolve_at = now + ::CorrectionPeriod::get(); + assert_eq!( + AuthorizedOutcomeReports::::get(0).unwrap(), + AuthorityReport { outcome: OutcomeReport::Scalar(1), resolve_at } + ); + }); +} + +#[test] +fn authorize_market_outcome_does_not_reset_dispute_resolution() { + ExtBuilder::default().build().execute_with(|| { + Markets::::insert(0, market_mock::()); + + assert_ok!(Authorized::authorize_market_outcome( + Origin::signed(AuthorizedDisputeResolutionUser::get()), + 0, + OutcomeReport::Scalar(1), + )); + let now = frame_system::Pallet::::block_number(); + let resolve_at_0 = now + ::CorrectionPeriod::get(); + assert_eq!( + AuthorizedOutcomeReports::::get(0).unwrap(), + AuthorityReport { outcome: OutcomeReport::Scalar(1), resolve_at: resolve_at_0 } + ); + + assert_eq!(mock_storage::MarketIdsPerDisputeBlock::::get(resolve_at_0), vec![0]); + + assert_ok!(Authorized::authorize_market_outcome( + Origin::signed(AuthorizedDisputeResolutionUser::get()), + 0, + OutcomeReport::Scalar(2) + )); + + assert_eq!( + AuthorizedOutcomeReports::::get(0).unwrap(), + AuthorityReport { outcome: OutcomeReport::Scalar(2), resolve_at: resolve_at_0 } + ); + + assert_eq!(mock_storage::MarketIdsPerDisputeBlock::::get(resolve_at_0), vec![0]); }); } @@ -116,6 +156,18 @@ fn authorize_market_outcome_fails_on_unauthorized_account() { }); } +#[test] +fn on_dispute_fails_if_disputes_is_not_empty() { + ExtBuilder::default().build().execute_with(|| { + let dispute = + MarketDispute { by: crate::mock::ALICE, at: 0, outcome: OutcomeReport::Scalar(1) }; + assert_noop!( + Authorized::on_dispute(&[dispute], &0, &market_mock::()), + Error::::OnlyOneDisputeAllowed + ); + }); +} + #[test] fn on_resolution_fails_if_no_report_was_submitted() { ExtBuilder::default().build().execute_with(|| { @@ -177,13 +229,40 @@ fn authorized_market_outcome_can_handle_multiple_markets() { 1, OutcomeReport::Scalar(456) )); + let now = frame_system::Pallet::::block_number(); + let resolve_at = now + ::CorrectionPeriod::get(); assert_eq!( AuthorizedOutcomeReports::::get(0).unwrap(), - OutcomeReport::Scalar(123) + AuthorityReport { outcome: OutcomeReport::Scalar(123), resolve_at } ); assert_eq!( AuthorizedOutcomeReports::::get(1).unwrap(), - OutcomeReport::Scalar(456) + AuthorityReport { outcome: OutcomeReport::Scalar(456), resolve_at } ); }); } + +#[test] +fn get_auto_resolve_works() { + ExtBuilder::default().build().execute_with(|| { + frame_system::Pallet::::set_block_number(42); + let market = market_mock::(); + Markets::::insert(0, &market); + assert_ok!(Authorized::authorize_market_outcome( + Origin::signed(AuthorizedDisputeResolutionUser::get()), + 0, + OutcomeReport::Scalar(1) + )); + let now = frame_system::Pallet::::block_number(); + let resolve_at = now + ::CorrectionPeriod::get(); + assert_eq!(Authorized::get_auto_resolve(&[], &0, &market).unwrap(), Some(resolve_at),); + }); +} + +#[test] +fn get_auto_resolve_returns_none_without_market_storage() { + ExtBuilder::default().build().execute_with(|| { + let market = market_mock::(); + assert_eq!(Authorized::get_auto_resolve(&[], &0, &market).unwrap(), None,); + }); +} diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index fb76eadbb..b2cb712bd 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for zrml_authorized //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-06, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/zeitgeist +// ./target/release/zeitgeist // benchmark // pallet // --chain=dev @@ -33,8 +33,8 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --template=./misc/weight_template.hbs // --output=./zrml/authorized/src/weights.rs +// --template=./misc/weight_template.hbs #![allow(unused_parens)] #![allow(unused_imports)] @@ -45,17 +45,28 @@ use frame_support::{traits::Get, weights::Weight}; /// Trait containing the required functions for weight retrival within /// zrml_authorized (automatically generated) pub trait WeightInfoZeitgeist { - fn authorize_market_outcome() -> Weight; + fn authorize_market_outcome_first_report(m: u32) -> Weight; + fn authorize_market_outcome_existing_report() -> Weight; } /// Weight functions for zrml_authorized (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:1 w:0) - // Storage: Authorized AuthorizedOutcomeReports (r:0 w:1) - fn authorize_market_outcome() -> Weight { - (16_170_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) + // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) + fn authorize_market_outcome_first_report(m: u32) -> Weight { + (31_031_000 as Weight) + // Standard Error: 0 + .saturating_add((85_000 as Weight).saturating_mul(m as Weight)) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: MarketCommons Markets (r:1 w:0) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) + fn authorize_market_outcome_existing_report() -> Weight { + (24_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } } diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index ce0d064c4..c1d08183b 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -50,6 +50,7 @@ mod pallet { use core::marker::PhantomData; use frame_support::{ dispatch::DispatchResult, + ensure, pallet_prelude::{CountedStorageMap, StorageDoubleMap, StorageValue, ValueQuery}, traits::{ BalanceStatus, Currency, Get, Hooks, IsType, NamedReservableCurrency, Randomness, @@ -64,7 +65,7 @@ mod pallet { ArithmeticError, DispatchError, SaturatedConversion, }; use zeitgeist_primitives::{ - traits::DisputeApi, + traits::{DisputeApi, DisputeResolutionApi}, types::{Market, MarketDispute, MarketDisputeMechanism, OutcomeReport}, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -150,6 +151,13 @@ mod pallet { #[pallet::constant] type CourtCaseDuration: Get; + type DisputeResolution: DisputeResolutionApi< + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; + /// Event type Event: From> + IsType<::Event>; @@ -506,9 +514,10 @@ mod pallet { market_id: &Self::MarketId, market: &MarketOf, ) -> DispatchResult { - if market.dispute_mechanism != MarketDisputeMechanism::Court { - return Err(Error::::MarketDoesNotHaveCourtMechanism.into()); - } + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Court, + Error::::MarketDoesNotHaveCourtMechanism + ); let jurors: Vec<_> = Jurors::::iter().collect(); let necessary_jurors_num = Self::necessary_jurors_num(disputes); let mut rng = Self::rng(); @@ -530,9 +539,10 @@ mod pallet { market_id: &Self::MarketId, market: &MarketOf, ) -> Result, DispatchError> { - if market.dispute_mechanism != MarketDisputeMechanism::Court { - return Err(Error::::MarketDoesNotHaveCourtMechanism.into()); - } + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Court, + Error::::MarketDoesNotHaveCourtMechanism + ); let votes: Vec<_> = Votes::::iter_prefix(market_id).collect(); let requested_jurors: Vec<_> = RequestedJurors::::iter_prefix(market_id) .map(|(juror_id, max_allowed_block)| { @@ -552,6 +562,30 @@ mod pallet { let _ = RequestedJurors::::clear_prefix(market_id, u32::max_value(), None); Ok(Some(first)) } + + fn get_auto_resolve( + _: &[MarketDispute], + _: &Self::MarketId, + market: &MarketOf, + ) -> Result, DispatchError> { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Court, + Error::::MarketDoesNotHaveCourtMechanism + ); + Ok(None) + } + + fn has_failed( + _: &[MarketDispute], + _: &Self::MarketId, + market: &MarketOf, + ) -> Result { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::Court, + Error::::MarketDoesNotHaveCourtMechanism + ); + Ok(false) + } } impl CourtPalletApi for Pallet where T: Config {} diff --git a/zrml/court/src/mock.rs b/zrml/court/src/mock.rs index 6d14af846..11cfe03ee 100644 --- a/zrml/court/src/mock.rs +++ b/zrml/court/src/mock.rs @@ -18,7 +18,13 @@ #![cfg(test)] use crate::{self as zrml_court}; -use frame_support::{construct_runtime, parameter_types, traits::Everything, PalletId}; +use frame_support::{ + construct_runtime, + pallet_prelude::{DispatchError, Weight}, + parameter_types, + traits::Everything, + BoundedVec, PalletId, +}; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, @@ -28,9 +34,10 @@ use zeitgeist_primitives::{ BlockHashCount, CourtCaseDuration, CourtPalletId, MaxReserves, MinimumPeriod, PmPalletId, StakeWeight, BASE, }, + traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, + AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, + MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -59,8 +66,49 @@ construct_runtime!( } ); +// NoopResolution implements DisputeResolutionApi with no-ops. +pub struct NoopResolution; + +impl DisputeResolutionApi for NoopResolution { + type AccountId = AccountIdTest; + type Balance = Balance; + type BlockNumber = BlockNumber; + type MarketId = MarketId; + type MaxDisputes = u32; + type Moment = Moment; + + fn resolve( + _market_id: &Self::MarketId, + _market: &Market, + ) -> Result { + Ok(0) + } + + fn add_auto_resolve( + _market_id: &Self::MarketId, + _resolve_at: Self::BlockNumber, + ) -> Result { + Ok(0u32) + } + + fn auto_resolve_exists(_market_id: &Self::MarketId, _resolve_at: Self::BlockNumber) -> bool { + false + } + + fn remove_auto_resolve(_market_id: &Self::MarketId, _resolve_at: Self::BlockNumber) -> u32 { + 0u32 + } + + fn get_disputes( + _market_id: &Self::MarketId, + ) -> BoundedVec, Self::MaxDisputes> { + Default::default() + } +} + impl crate::Config for Runtime { type CourtCaseDuration = CourtCaseDuration; + type DisputeResolution = NoopResolution; type Event = (); type MarketCommons = MarketCommons; type PalletId = CourtPalletId; diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index 1a383d395..efac65a47 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -77,12 +77,13 @@ fn create_market_common_parameters( } // Create a market based on common parameters -fn create_market_common( +fn create_market_common( permission: MarketCreation, options: MarketType, scoring_rule: ScoringRule, period: Option>>, ) -> Result<(T::AccountId, MarketIdOf), &'static str> { + pallet_timestamp::Pallet::::set_timestamp(0u32.into()); let range_start: MomentOf = 100_000u64.saturated_into(); let range_end: MomentOf = 1_000_000u64.saturated_into(); let period = period.unwrap_or(MarketPeriod::Timestamp(range_start..range_end)); @@ -147,7 +148,7 @@ fn setup_redeem_shares_common( } else if let MarketType::Scalar(range) = market_type { outcome = OutcomeReport::Scalar(*range.end()); } else { - panic!("setup_redeem_shares_common: Unsupported market type: {:?}", market_type); + panic!("setup_redeem_shares_common: Unsupported market type: {market_type:?}"); } Pallet::::do_buy_complete_set( @@ -450,7 +451,6 @@ benchmarks! { admin_move_market_to_resolved_scalar_disputed { let r in 0..63; - let d in 1..T::MaxDisputes::get(); let (_, market_id) = create_close_and_report_market::( MarketCreation::Permissionless, @@ -464,23 +464,16 @@ benchmarks! { })?; let market = >::market(&market_id)?; - if let MarketType::Scalar(range) = market.market_type { - assert!((d as u128) < *range.end()); - } else { - panic!("Must create scalar market"); - } - for i in 0..d { - let outcome = OutcomeReport::Scalar((i % 2).into()); - let disputor = account("disputor", i + 1, 0); - let dispute_bond = crate::pallet::default_dispute_bond::(i as usize); - T::AssetManager::deposit( - Asset::Ztg, - &disputor, - dispute_bond, - )?; - Pallet::::dispute(RawOrigin::Signed(disputor).into(), market_id, outcome)?; - } + let outcome = OutcomeReport::Scalar(0); + let disputor = account("disputor", 1, 0); + let dispute_bond = crate::pallet::default_dispute_bond::(0_usize); + T::AssetManager::deposit( + Asset::Ztg, + &disputor, + dispute_bond, + )?; + Pallet::::dispute(RawOrigin::Signed(disputor).into(), market_id, outcome)?; let disputes = Disputes::::get(market_id); // Authorize the outcome with the highest number of correct reporters to maximize the // number of transfers required (0 has (d+1)//2 reports, 1 has d//2 reports). @@ -513,7 +506,6 @@ benchmarks! { admin_move_market_to_resolved_categorical_disputed { let r in 0..63; - let d in 1..T::MaxDisputes::get(); let categories = T::MaxCategories::get(); let (caller, market_id) = @@ -527,17 +519,16 @@ benchmarks! { Ok(()) })?; - for i in 0..d { - let outcome = OutcomeReport::Categorical((i % 2).saturated_into::()); - let disputor = account("disputor", i + 1, 0); - let dispute_bond = crate::pallet::default_dispute_bond::(i as usize); - T::AssetManager::deposit( - Asset::Ztg, - &disputor, - dispute_bond, - )?; - Pallet::::dispute(RawOrigin::Signed(disputor).into(), market_id, outcome)?; - } + let outcome = OutcomeReport::Categorical(0u16); + let disputor = account("disputor", 1, 0); + let dispute_bond = crate::pallet::default_dispute_bond::(0_usize); + T::AssetManager::deposit( + Asset::Ztg, + &disputor, + dispute_bond, + )?; + Pallet::::dispute(RawOrigin::Signed(disputor).into(), market_id, outcome)?; + let disputes = Disputes::::get(market_id); // Authorize the outcome with the highest number of correct reporters to maximize the // number of transfers required (0 has (d+1)//2 reports, 1 has d//2 reports). @@ -785,6 +776,7 @@ benchmarks! { start_global_dispute { let m in 1..CacheSize::get(); + let n in 1..CacheSize::get(); // no benchmarking component for max disputes here, // because MaxDisputes is enforced for the extrinsic @@ -794,11 +786,16 @@ benchmarks! { OutcomeReport::Scalar(u128::MAX), )?; + >::mutate_market(&market_id, |market| { + market.dispute_mechanism = MarketDisputeMechanism::SimpleDisputes; + Ok(()) + })?; + // first element is the market id from above - let mut market_ids = BoundedVec::try_from(vec![market_id]).unwrap(); + let mut market_ids_1: BoundedVec, CacheSize> = Default::default(); assert_eq!(market_id, 0u128.saturated_into()); for i in 1..m { - market_ids.try_push(i.saturated_into()).unwrap(); + market_ids_1.try_push(i.saturated_into()).unwrap(); } let max_dispute_len = T::MaxDisputes::get(); @@ -815,11 +812,28 @@ benchmarks! { .dispatch_bypass_filter(RawOrigin::Signed(disputor.clone()).into())?; } + let market = >::market(&market_id.saturated_into()).unwrap(); + let disputes = Disputes::::get(market_id); + let last_dispute = disputes.last().unwrap(); + let dispute_duration_ends_at_block = last_dispute.at + market.deadlines.dispute_duration; + let mut market_ids_2: BoundedVec, CacheSize> = BoundedVec::try_from( + vec![market_id], + ).unwrap(); + for i in 1..n { + market_ids_2.try_push(i.saturated_into()).unwrap(); + } + MarketIdsPerDisputeBlock::::insert(dispute_duration_ends_at_block, market_ids_2); + let current_block: T::BlockNumber = (max_dispute_len + 1).saturated_into(); >::set_block_number(current_block); - // the complexity depends on MarketIdsPerDisputeBlock at the current block - // this is because a variable number of market ids need to be decoded from the storage - MarketIdsPerDisputeBlock::::insert(current_block, market_ids); + + #[cfg(feature = "with-global-disputes")] + { + let global_dispute_end = current_block + T::GlobalDisputePeriod::get(); + // the complexity depends on MarketIdsPerDisputeBlock at the current block + // this is because a variable number of market ids need to be decoded from the storage + MarketIdsPerDisputeBlock::::insert(global_dispute_end, market_ids_1); + } let call = Call::::start_global_dispute { market_id }; }: { @@ -830,9 +844,6 @@ benchmarks! { } dispute_authorized { - let d in 0..(T::MaxDisputes::get() - 1); - let b in 0..63; - let report_outcome = OutcomeReport::Scalar(u128::MAX); let (caller, market_id) = create_close_and_report_market::( MarketCreation::Permissionless, @@ -846,28 +857,9 @@ benchmarks! { })?; let market = >::market(&market_id)?; - if let MarketType::Scalar(range) = market.market_type { - assert!((d as u128) < *range.end()); - } else { - panic!("Must create scalar market"); - } - for i in 0..d { - let outcome = OutcomeReport::Scalar(i.into()); - let disputor = account("disputor", i, 0); - T::AssetManager::deposit(Asset::Ztg, &disputor, (u128::MAX).saturated_into())?; - Pallet::::dispute(RawOrigin::Signed(disputor).into(), market_id, outcome)?; - } - let now = frame_system::Pallet::::block_number(); - let resolves_at = now.saturating_add(market.deadlines.dispute_duration); - for i in 0..b { - MarketIdsPerDisputeBlock::::try_mutate( - resolves_at, - |ids| ids.try_push(i.into()), - ).unwrap(); - } - - let dispute_outcome = OutcomeReport::Scalar((d + 1).into()); + // only one dispute allowed for authorized mdm + let dispute_outcome = OutcomeReport::Scalar(1u128); let call = Call::::dispute { market_id, outcome: dispute_outcome }; }: { call.dispatch_bypass_filter(RawOrigin::Signed(caller).into())?; @@ -902,9 +894,6 @@ benchmarks! { } internal_resolve_categorical_disputed { - // d = num. disputes - let d in 1..T::MaxDisputes::get(); - let categories = T::MaxCategories::get(); let (caller, market_id) = setup_reported_categorical_market_with_pool::( @@ -916,14 +905,11 @@ benchmarks! { Ok(()) })?; - for i in 0..d { - let origin = caller.clone(); - Pallet::::dispute( - RawOrigin::Signed(origin).into(), - market_id, - OutcomeReport::Categorical((i % 2).saturated_into::()), - )?; - } + Pallet::::dispute( + RawOrigin::Signed(caller).into(), + market_id, + OutcomeReport::Categorical(0), + )?; // Authorize the outcome with the highest number of correct reporters to maximize the // number of transfers required (0 has (d+1)//2 reports, 1 has d//2 reports). AuthorizedPallet::::authorize_market_outcome( @@ -954,8 +940,6 @@ benchmarks! { } internal_resolve_scalar_disputed { - let d in 1..T::MaxDisputes::get(); - let (caller, market_id) = create_close_and_report_market::( MarketCreation::Permissionless, MarketType::Scalar(0u128..=u128::MAX), @@ -966,19 +950,11 @@ benchmarks! { Ok(()) })?; let market = >::market(&market_id)?; - if let MarketType::Scalar(range) = market.market_type { - assert!((d as u128) < *range.end()); - } else { - panic!("Must create scalar market"); - } - for i in 0..d { - let origin = caller.clone(); - Pallet::::dispute( - RawOrigin::Signed(origin).into(), - market_id, - OutcomeReport::Scalar((i % 2).into()) - )?; - } + Pallet::::dispute( + RawOrigin::Signed(caller).into(), + market_id, + OutcomeReport::Scalar(1) + )?; // Authorize the outcome with the highest number of correct reporters to maximize the // number of transfers required (0 has (d+1)//2 reports, 1 has d//2 reports). AuthorizedPallet::::authorize_market_outcome( diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 045ec7e0c..9695db7c9 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -56,7 +56,7 @@ mod pallet { }; use zeitgeist_primitives::{ constants::MILLISECS_PER_BLOCK, - traits::{DisputeApi, Swaps, ZeitgeistAssetManager}, + traits::{DisputeApi, DisputeResolutionApi, Swaps, ZeitgeistAssetManager}, types::{ Asset, Bond, Deadlines, Market, MarketBonds, MarketCreation, MarketDispute, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, MultiHash, @@ -70,7 +70,7 @@ mod pallet { use zrml_market_commons::MarketCommonsPalletApi; /// The current storage version. - const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(7); pub(crate) type BalanceOf = <::AssetManager as MultiCurrency< ::AccountId, @@ -346,15 +346,9 @@ mod pallet { .max( T::WeightInfo::admin_move_market_to_resolved_categorical_reported(CacheSize::get()) ).max( - T::WeightInfo::admin_move_market_to_resolved_scalar_disputed( - CacheSize::get(), - T::MaxDisputes::get() - ) + T::WeightInfo::admin_move_market_to_resolved_scalar_disputed(CacheSize::get()) ).max( - T::WeightInfo::admin_move_market_to_resolved_categorical_disputed( - CacheSize::get(), - T::MaxDisputes::get() - ) + T::WeightInfo::admin_move_market_to_resolved_categorical_disputed(CacheSize::get()) ), Pays::No, ))] @@ -370,7 +364,7 @@ mod pallet { market.status == MarketStatus::Reported || market.status == MarketStatus::Disputed, Error::::InvalidMarketStatus, ); - let (ids_len, disputes_len) = Self::clear_auto_resolve(&market_id)?; + let (ids_len, _) = Self::clear_auto_resolve(&market_id)?; let market = >::market(&market_id)?; let _ = Self::on_resolution(&market_id, &market)?; let weight = match market.market_type { @@ -379,10 +373,7 @@ mod pallet { T::WeightInfo::admin_move_market_to_resolved_scalar_reported(ids_len) } MarketStatus::Disputed => { - T::WeightInfo::admin_move_market_to_resolved_scalar_disputed( - ids_len, - disputes_len, - ) + T::WeightInfo::admin_move_market_to_resolved_scalar_disputed(ids_len) } _ => return Err(Error::::InvalidMarketStatus.into()), }, @@ -391,10 +382,7 @@ mod pallet { T::WeightInfo::admin_move_market_to_resolved_categorical_reported(ids_len) } MarketStatus::Disputed => { - T::WeightInfo::admin_move_market_to_resolved_categorical_disputed( - ids_len, - disputes_len, - ) + T::WeightInfo::admin_move_market_to_resolved_categorical_disputed(ids_len) } _ => return Err(Error::::InvalidMarketStatus.into()), }, @@ -526,10 +514,7 @@ mod pallet { /// # Weight /// /// Complexity: `O(n)`, where `n` is the number of outstanding disputes. - #[pallet::weight(T::WeightInfo::dispute_authorized( - T::MaxDisputes::get(), - CacheSize::get() - ))] + #[pallet::weight(T::WeightInfo::dispute_authorized())] #[transactional] pub fn dispute( origin: OriginFor, @@ -552,6 +537,7 @@ mod pallet { &who, default_dispute_bond::(disputes.len()), )?; + // TODO(#782): use multiple benchmarks paths for different dispute mechanisms match market.dispute_mechanism { MarketDisputeMechanism::Authorized => { T::Authorized::on_dispute(&disputes, &market_id, &market)? @@ -563,26 +549,18 @@ mod pallet { T::SimpleDisputes::on_dispute(&disputes, &market_id, &market)? } } - Self::remove_last_dispute_from_market_ids_per_dispute_block(&disputes, &market_id)?; + Self::set_market_as_disputed(&market, &market_id)?; let market_dispute = MarketDispute { at: curr_block_num, by: who, outcome }; >::try_mutate(market_id, |disputes| { disputes.try_push(market_dispute.clone()).map_err(|_| >::StorageOverflow) })?; - // each dispute resets dispute_duration - let dispute_duration_ends_at_block = - curr_block_num.saturating_add(market.deadlines.dispute_duration); - >::try_mutate(dispute_duration_ends_at_block, |ids| { - ids.try_push(market_id).map_err(|_| >::StorageOverflow) - })?; - Self::deposit_event(Event::MarketDisputed( market_id, MarketStatus::Disputed, market_dispute, )); - // TODO(#782): add court benchmark - Ok((Some(T::WeightInfo::dispute_authorized(num_disputes, CacheSize::get()))).into()) + Ok((Some(T::WeightInfo::dispute_authorized())).into()) } /// Create a permissionless market, buy complete sets and deploy a pool with specified @@ -1318,7 +1296,7 @@ mod pallet { /// The outcomes of the disputes and the report outcome /// are added to the global dispute voting outcomes. /// The bond of each dispute is the initial vote amount. - #[pallet::weight(T::WeightInfo::start_global_dispute(CacheSize::get()))] + #[pallet::weight(T::WeightInfo::start_global_dispute(CacheSize::get(), CacheSize::get()))] #[transactional] pub fn start_global_dispute( origin: OriginFor, @@ -1350,10 +1328,10 @@ mod pallet { ); // add report outcome to voting choices - if let Some(report) = market.report { + if let Some(report) = &market.report { T::GlobalDisputes::push_voting_outcome( &market_id, - report.outcome, + report.outcome.clone(), &report.by, >::zero(), )?; @@ -1369,9 +1347,12 @@ mod pallet { )?; } + // TODO(#372): Allow court with global disputes. // ensure, that global disputes controls the resolution now // it does not end after the dispute period now, but after the global dispute end - Self::remove_last_dispute_from_market_ids_per_dispute_block(&disputes, &market_id)?; + + // ignore first of tuple because we always have max disputes + let (_, ids_len_2) = Self::clear_auto_resolve(&market_id)?; let now = >::block_number(); let global_dispute_end = now.saturating_add(T::GlobalDisputePeriod::get()); @@ -1385,7 +1366,7 @@ mod pallet { Self::deposit_event(Event::GlobalDisputeStarted(market_id)); - Ok(Some(T::WeightInfo::start_global_dispute(market_ids_len)).into()) + Ok(Some(T::WeightInfo::start_global_dispute(market_ids_len, ids_len_2)).into()) } #[cfg(not(feature = "with-global-disputes"))] @@ -2054,17 +2035,24 @@ mod pallet { } MarketStatus::Disputed => { let disputes = Disputes::::get(market_id); - let last_dispute = disputes.last().ok_or(Error::::MarketIsNotDisputed)?; - let dispute_duration_ends_at_block = - last_dispute.at.saturating_add(market.deadlines.dispute_duration); - MarketIdsPerDisputeBlock::::mutate( - dispute_duration_ends_at_block, - |ids| -> (u32, u32) { - let ids_len = ids.len() as u32; - remove_item::, _>(ids, market_id); - (ids_len, disputes.len() as u32) - }, - ) + // TODO(#782): use multiple benchmarks paths for different dispute mechanisms + let auto_resolve_block_opt = match market.dispute_mechanism { + MarketDisputeMechanism::Authorized => { + T::Authorized::get_auto_resolve(&disputes, market_id, &market)? + } + MarketDisputeMechanism::Court => { + T::Court::get_auto_resolve(&disputes, market_id, &market)? + } + MarketDisputeMechanism::SimpleDisputes => { + T::SimpleDisputes::get_auto_resolve(&disputes, market_id, &market)? + } + }; + if let Some(auto_resolve_block) = auto_resolve_block_opt { + let ids_len = remove_auto_resolve::(market_id, auto_resolve_block); + (ids_len, disputes.len() as u32) + } else { + (0u32, disputes.len() as u32) + } } _ => (0u32, 0u32), }; @@ -2135,17 +2123,17 @@ mod pallet { time.saturated_into::().saturating_div(MILLISECS_PER_BLOCK.into()) } - fn calculate_internal_resolve_weight(market: &MarketOf, total_disputes: u32) -> Weight { + fn calculate_internal_resolve_weight(market: &MarketOf) -> Weight { if let MarketType::Categorical(_) = market.market_type { if let MarketStatus::Reported = market.status { T::WeightInfo::internal_resolve_categorical_reported() } else { - T::WeightInfo::internal_resolve_categorical_disputed(total_disputes) + T::WeightInfo::internal_resolve_categorical_disputed() } } else if let MarketStatus::Reported = market.status { T::WeightInfo::internal_resolve_scalar_reported() } else { - T::WeightInfo::internal_resolve_scalar_disputed(total_disputes) + T::WeightInfo::internal_resolve_scalar_disputed() } } @@ -2366,6 +2354,8 @@ mod pallet { resolved_outcome_option = Some(o); } + // TODO(#782): use multiple benchmarks paths for different dispute mechanisms + // Try to get the outcome of the MDM. If the MDM failed to resolve, default to // the oracle's report. if resolved_outcome_option.is_none() { @@ -2438,13 +2428,12 @@ mod pallet { pub fn on_resolution( market_id: &MarketIdOf, market: &MarketOf, - ) -> Result { + ) -> Result { if market.creation == MarketCreation::Permissionless { Self::unreserve_creation_bond(market_id)?; } let mut total_weight = 0; - let disputes = Disputes::::get(market_id); let resolved_outcome = match market.status { MarketStatus::Reported => Self::resolve_reported_market(market_id, market)?, @@ -2470,10 +2459,7 @@ mod pallet { MarketStatus::Resolved, resolved_outcome, )); - Ok(total_weight.saturating_add(Self::calculate_internal_resolve_weight( - market, - disputes.len().saturated_into(), - ))) + Ok(total_weight.saturating_add(Self::calculate_internal_resolve_weight(market))) } pub(crate) fn process_subsidy_collecting_markets( @@ -2636,21 +2622,6 @@ mod pallet { weight_basis.saturating_add(total_weight) } - fn remove_last_dispute_from_market_ids_per_dispute_block( - disputes: &[MarketDispute], - market_id: &MarketIdOf, - ) -> DispatchResult { - if let Some(last_dispute) = disputes.last() { - let market = >::market(market_id)?; - let dispute_duration_ends_at_block = - last_dispute.at.saturating_add(market.deadlines.dispute_duration); - MarketIdsPerDisputeBlock::::mutate(dispute_duration_ends_at_block, |ids| { - remove_item::, _>(ids, market_id); - }); - } - Ok(()) - } - /// The reserve ID of the prediction-markets pallet. #[inline] pub fn reserve_id() -> [u8; 8] { @@ -2884,4 +2855,63 @@ mod pallet { items.swap_remove(pos); } } + + fn remove_auto_resolve( + market_id: &MarketIdOf, + resolve_at: T::BlockNumber, + ) -> u32 { + MarketIdsPerDisputeBlock::::mutate(resolve_at, |ids| -> u32 { + let ids_len = ids.len() as u32; + remove_item::, _>(ids, market_id); + ids_len + }) + } + + impl DisputeResolutionApi for Pallet + where + T: Config, + { + type AccountId = T::AccountId; + type Balance = BalanceOf; + type BlockNumber = T::BlockNumber; + type MarketId = MarketIdOf; + type MaxDisputes = T::MaxDisputes; + type Moment = MomentOf; + + fn resolve( + market_id: &Self::MarketId, + market: &Market, + ) -> Result { + Self::on_resolution(market_id, market) + } + + fn add_auto_resolve( + market_id: &Self::MarketId, + resolve_at: Self::BlockNumber, + ) -> Result { + let ids_len = >::try_mutate( + resolve_at, + |ids| -> Result { + ids.try_push(*market_id).map_err(|_| >::StorageOverflow)?; + Ok(ids.len() as u32) + }, + )?; + Ok(ids_len) + } + + fn auto_resolve_exists(market_id: &Self::MarketId, resolve_at: Self::BlockNumber) -> bool { + >::get(resolve_at).contains(market_id) + } + + fn remove_auto_resolve(market_id: &Self::MarketId, resolve_at: Self::BlockNumber) -> u32 { + remove_auto_resolve::(market_id, resolve_at) + } + + fn get_disputes( + market_id: &Self::MarketId, + ) -> BoundedVec, Self::MaxDisputes> + { + Disputes::::get(market_id) + } + } } diff --git a/zrml/prediction-markets/src/migrations.rs b/zrml/prediction-markets/src/migrations.rs index 08b190343..618ebcf94 100644 --- a/zrml/prediction-markets/src/migrations.rs +++ b/zrml/prediction-markets/src/migrations.rs @@ -19,10 +19,8 @@ use crate::MarketIdOf; use crate::{Config, MarketOf, MomentOf}; #[cfg(feature = "try-runtime")] -use alloc::collections::BTreeMap; -#[cfg(feature = "try-runtime")] use alloc::format; -use alloc::vec::Vec; +use alloc::{collections::BTreeMap, vec::Vec}; #[cfg(feature = "try-runtime")] use frame_support::traits::OnRuntimeUpgradeHelpersExt; use frame_support::{ @@ -39,9 +37,7 @@ use zeitgeist_primitives::types::{ Bond, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, }; -#[cfg(feature = "try-runtime")] -use zrml_market_commons::MarketCommonsPalletApi; -use zrml_market_commons::Pallet as MarketCommonsPallet; +use zrml_market_commons::{MarketCommonsPalletApi, Pallet as MarketCommonsPallet}; const MARKET_COMMONS: &[u8] = b"MarketCommons"; const MARKETS: &[u8] = b"Markets"; @@ -146,7 +142,7 @@ impl OnRuntimeUpgrade for RecordBonds Result<(), &'static str> { - use frame_support::{migration::storage_key_iter, pallet_prelude::Blake2_128Concat}; + use frame_support::pallet_prelude::Blake2_128Concat; let old_markets = storage_key_iter::, OldMarketOf, Blake2_128Concat>( MARKET_COMMONS, @@ -424,10 +420,289 @@ mod tests { } } +#[cfg(feature = "try-runtime")] +use alloc::string::ToString; +use frame_support::{migration::storage_key_iter, Twox64Concat}; +use frame_system::pallet_prelude::BlockNumberFor; +use sp_runtime::traits::Saturating; +use zeitgeist_primitives::types::AuthorityReport; +use zrml_authorized::Pallet as AuthorizedPallet; + +const AUTHORIZED: &[u8] = b"Authorized"; +const AUTHORIZED_OUTCOME_REPORTS: &[u8] = b"AuthorizedOutcomeReports"; + +const AUTHORIZED_REQUIRED_STORAGE_VERSION: u16 = 2; +const AUTHORIZED_NEXT_STORAGE_VERSION: u16 = 3; + +pub struct AddFieldToAuthorityReport(PhantomData); + +// Add resolve_at block number value field to `AuthorizedOutcomeReports` map. +impl OnRuntimeUpgrade + for AddFieldToAuthorityReport +{ + fn on_runtime_upgrade() -> Weight + where + T: Config, + { + let mut total_weight = T::DbWeight::get().reads(1); + let authorized_version = StorageVersion::get::>(); + if authorized_version != AUTHORIZED_REQUIRED_STORAGE_VERSION { + log::info!( + "AddFieldToAuthorityReport: authorized version is {:?}, require {:?};", + authorized_version, + AUTHORIZED_REQUIRED_STORAGE_VERSION, + ); + return total_weight; + } + log::info!("AddFieldToAuthorityReport: Starting..."); + + let mut authorized_resolutions = + BTreeMap::<::MarketId, BlockNumberFor>::new(); + for (resolve_at, bounded_vec) in crate::MarketIdsPerDisputeBlock::::iter() { + total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); + + for id in bounded_vec.into_inner().iter() { + if let Ok(market) = >::market(id) { + if market.dispute_mechanism == MarketDisputeMechanism::Authorized { + authorized_resolutions.insert(*id, resolve_at); + } + } else { + log::warn!("AddFieldToAuthorityReport: Could not find market with id {:?}", id); + } + } + } + + let mut new_storage_map: Vec<( + ::MarketId, + AuthorityReport>, + )> = Vec::new(); + + let now = frame_system::Pallet::::block_number(); + total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); + + for (market_id, old_value) in storage_key_iter::< + ::MarketId, + OutcomeReport, + Twox64Concat, + >(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS) + { + total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); + + let resolve_at: Option> = + authorized_resolutions.get(&market_id).cloned(); + + match resolve_at { + Some(block) if now <= block => { + new_storage_map.push(( + market_id, + AuthorityReport { resolve_at: block, outcome: old_value }, + )); + } + _ => { + log::warn!( + "AddFieldToAuthorityReport: Market was not found in \ + MarketIdsPerDisputeBlock; market id: {:?}", + market_id + ); + // example case market id 432 + // https://github.com/zeitgeistpm/zeitgeist/pull/701 market id 432 is invalid, because of zero-division error in the past + // we have to handle manually here, because MarketIdsPerDisputeBlock does not contain 432 + let mut resolve_at = now.saturating_add(T::CorrectionPeriod::get()); + total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); + + let mut bounded_vec = >::get(resolve_at); + while bounded_vec.is_full() { + // roll the dice until we find a block that is not full + total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); + resolve_at = resolve_at.saturating_add(1u32.into()); + bounded_vec = >::get(resolve_at); + } + // is not full, so we can push + bounded_vec.force_push(market_id); + >::insert(resolve_at, bounded_vec); + total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); + + new_storage_map + .push((market_id, AuthorityReport { resolve_at, outcome: old_value })); + } + } + } + + for (market_id, new_value) in new_storage_map { + let hash = utility::key_to_hash::< + Twox64Concat, + ::MarketId, + >(market_id); + put_storage_value::>( + AUTHORIZED, + AUTHORIZED_OUTCOME_REPORTS, + &hash, + new_value, + ); + total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); + } + + StorageVersion::new(AUTHORIZED_NEXT_STORAGE_VERSION).put::>(); + total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); + log::info!("AddFieldToAuthorityReport: Done!"); + total_weight + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result<(), &'static str> { + let mut counter = 0_u32; + for (key, value) in storage_iter::(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS) { + Self::set_temp_storage(value, &format!("{:?}", key.as_slice())); + + counter = counter.saturating_add(1_u32); + } + let counter_key = "counter_key".to_string(); + Self::set_temp_storage(counter, &counter_key); + Ok(()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade() -> Result<(), &'static str> { + let mut markets_count = 0_u32; + let old_counter_key = "counter_key".to_string(); + for (key, new_value) in + storage_iter::>(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS) + { + let key_str = format!("{:?}", key.as_slice()); + + let AuthorityReport { resolve_at: _, outcome } = new_value; + let old_value: OutcomeReport = Self::get_temp_storage(&key_str) + .unwrap_or_else(|| panic!("old value not found for market id {:?}", key_str)); + + assert_eq!(old_value, outcome); + + markets_count += 1_u32; + } + let old_markets_count: u32 = + Self::get_temp_storage(&old_counter_key).expect("old counter key storage not found"); + assert_eq!(markets_count, old_markets_count); + Ok(()) + } +} + +#[cfg(test)] +mod tests_authorized { + use super::*; + use crate::{ + mock::{ExtBuilder, MarketCommons, Runtime, ALICE, BOB}, + CacheSize, MarketIdOf, + }; + use frame_support::{BoundedVec, Twox64Concat}; + use zeitgeist_primitives::types::{MarketId, OutcomeReport}; + use zrml_market_commons::MarketCommonsPalletApi; + + #[test] + fn on_runtime_upgrade_increments_the_storage_versions() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + AddFieldToAuthorityReport::::on_runtime_upgrade(); + let authorized_version = StorageVersion::get::>(); + assert_eq!(authorized_version, AUTHORIZED_NEXT_STORAGE_VERSION); + }); + } + + #[test] + fn on_runtime_sets_new_struct_with_resolve_at() { + ExtBuilder::default().build().execute_with(|| { + set_up_chain(); + + >::set_block_number(10_000); + + let hash = crate::migrations::utility::key_to_hash::(0); + let outcome = OutcomeReport::Categorical(42u16); + put_storage_value::( + AUTHORIZED, + AUTHORIZED_OUTCOME_REPORTS, + &hash, + outcome.clone(), + ); + + let resolve_at = 42_000; + + let sample_market = get_sample_market(); + let market_id: MarketId = MarketCommons::push_market(sample_market).unwrap(); + let bounded_vec = + BoundedVec::, CacheSize>::try_from(vec![market_id]) + .expect("BoundedVec should be created"); + crate::MarketIdsPerDisputeBlock::::insert(resolve_at, bounded_vec); + + AddFieldToAuthorityReport::::on_runtime_upgrade(); + + let expected = AuthorityReport { resolve_at, outcome }; + + let actual = frame_support::migration::get_storage_value::< + AuthorityReport<::BlockNumber>, + >(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS, &hash) + .unwrap(); + assert_eq!(expected, actual); + }); + } + + #[test] + fn on_runtime_is_noop_if_versions_are_not_correct() { + ExtBuilder::default().build().execute_with(|| { + // storage migration already executed (storage version is incremented already) + StorageVersion::new(AUTHORIZED_NEXT_STORAGE_VERSION).put::>(); + + let hash = crate::migrations::utility::key_to_hash::(0); + let outcome = OutcomeReport::Categorical(42u16); + + let report = AuthorityReport { resolve_at: 42, outcome }; + put_storage_value::::BlockNumber>>( + AUTHORIZED, + AUTHORIZED_OUTCOME_REPORTS, + &hash, + report.clone(), + ); + + AddFieldToAuthorityReport::::on_runtime_upgrade(); + + let actual = frame_support::migration::get_storage_value::< + AuthorityReport<::BlockNumber>, + >(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS, &hash) + .unwrap(); + assert_eq!(report, actual); + }); + } + + fn set_up_chain() { + StorageVersion::new(AUTHORIZED_REQUIRED_STORAGE_VERSION).put::>(); + } + + fn get_sample_market() -> zeitgeist_primitives::types::Market { + zeitgeist_primitives::types::Market { + creation: zeitgeist_primitives::types::MarketCreation::Permissionless, + creator_fee: 0, + creator: ALICE, + market_type: zeitgeist_primitives::types::MarketType::Scalar(0..=100), + dispute_mechanism: zeitgeist_primitives::types::MarketDisputeMechanism::Authorized, + metadata: Default::default(), + oracle: BOB, + period: zeitgeist_primitives::types::MarketPeriod::Block(Default::default()), + deadlines: zeitgeist_primitives::types::Deadlines { + grace_period: 1_u32.into(), + oracle_duration: 1_u32.into(), + dispute_duration: 1_u32.into(), + }, + report: None, + resolved_outcome: None, + scoring_rule: zeitgeist_primitives::types::ScoringRule::CPMM, + status: zeitgeist_primitives::types::MarketStatus::Disputed, + bonds: Default::default(), + } + } +} + // We use these utilities to prevent having to make the swaps pallet a dependency of // prediciton-markets. The calls are based on the implementation of `StorageVersion`, found here: // https://github.com/paritytech/substrate/blob/bc7a1e6c19aec92bfa247d8ca68ec63e07061032/frame/support/src/traits/metadata.rs#L168-L230 // and previous migrations. + mod utility { use crate::{BalanceOf, Config, MarketIdOf}; use alloc::vec::Vec; diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index 709f75167..f44b7b8ba 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -35,15 +35,15 @@ use sp_runtime::{ use substrate_fixed::{types::extra::U33, FixedI128, FixedU128}; use zeitgeist_primitives::{ constants::mock::{ - AuthorizedPalletId, BalanceFractionalDecimals, BlockHashCount, CourtCaseDuration, - CourtPalletId, DisputeFactor, ExistentialDeposit, ExistentialDeposits, ExitFee, - GetNativeCurrencyId, LiquidityMiningPalletId, MaxApprovals, MaxAssets, MaxCategories, - MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGracePeriod, MaxInRatio, - MaxMarketPeriod, MaxOracleDuration, MaxOutRatio, MaxRejectReasonLen, MaxReserves, - MaxSubsidyPeriod, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinCategories, - MinDisputeDuration, MinLiquidity, MinOracleDuration, MinSubsidy, MinSubsidyPeriod, - MinWeight, MinimumPeriod, PmPalletId, SimpleDisputesPalletId, StakeWeight, SwapsPalletId, - TreasuryPalletId, BASE, CENT, MILLISECS_PER_BLOCK, + AuthorizedPalletId, BalanceFractionalDecimals, BlockHashCount, CorrectionPeriod, + CourtCaseDuration, CourtPalletId, DisputeFactor, ExistentialDeposit, ExistentialDeposits, + ExitFee, GetNativeCurrencyId, LiquidityMiningPalletId, MaxApprovals, MaxAssets, + MaxCategories, MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGracePeriod, + MaxInRatio, MaxMarketPeriod, MaxOracleDuration, MaxOutRatio, MaxRejectReasonLen, + MaxReserves, MaxSubsidyPeriod, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, + MinCategories, MinDisputeDuration, MinLiquidity, MinOracleDuration, MinSubsidy, + MinSubsidyPeriod, MinWeight, MinimumPeriod, PmPalletId, SimpleDisputesPalletId, + StakeWeight, SwapsPalletId, TreasuryPalletId, BASE, CENT, MILLISECS_PER_BLOCK, }, types::{ AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, @@ -252,16 +252,19 @@ ord_parameter_types! { } impl zrml_authorized::Config for Runtime { - type Event = Event; - type MarketCommons = MarketCommons; type AuthorizedDisputeResolutionOrigin = EnsureSignedBy; + type CorrectionPeriod = CorrectionPeriod; + type Event = Event; + type DisputeResolution = prediction_markets::Pallet; + type MarketCommons = MarketCommons; type PalletId = AuthorizedPalletId; type WeightInfo = zrml_authorized::weights::WeightInfo; } impl zrml_court::Config for Runtime { type CourtCaseDuration = CourtCaseDuration; + type DisputeResolution = prediction_markets::Pallet; type Event = Event; type MarketCommons = MarketCommons; type PalletId = CourtPalletId; @@ -303,6 +306,7 @@ impl zrml_rikiddo::Config for Runtime { impl zrml_simple_disputes::Config for Runtime { type Event = Event; + type DisputeResolution = prediction_markets::Pallet; type MarketCommons = MarketCommons; type PalletId = SimpleDisputesPalletId; } diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 7848524dc..8e9cb2bae 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -41,6 +41,7 @@ use zeitgeist_primitives::{ MultiHash, OutcomeReport, PoolStatus, ScalarPosition, ScoringRule, }, }; +use zrml_authorized::Error as AuthorizedError; use zrml_market_commons::MarketCommonsPalletApi; use zrml_swaps::Pools; @@ -2014,6 +2015,49 @@ fn it_allows_to_dispute_the_outcome_of_a_market() { }); } +#[test] +fn dispute_fails_authority_reported_already() { + ExtBuilder::default().build().execute_with(|| { + let end = 2; + assert_ok!(PredictionMarkets::create_market( + Origin::signed(ALICE), + BOB, + MarketPeriod::Block(0..end), + get_deadlines(), + gen_metadata(2), + MarketCreation::Permissionless, + MarketType::Categorical(::MinCategories::get()), + MarketDisputeMechanism::Authorized, + ScoringRule::CPMM, + )); + + // Run to the end of the trading phase. + let market = MarketCommons::market(&0).unwrap(); + let grace_period = end + market.deadlines.grace_period; + run_to_block(grace_period + 1); + + assert_ok!(PredictionMarkets::report( + Origin::signed(BOB), + 0, + OutcomeReport::Categorical(1) + )); + + let dispute_at = grace_period + 2; + run_to_block(dispute_at); + + assert_ok!(PredictionMarkets::dispute( + Origin::signed(CHARLIE), + 0, + OutcomeReport::Categorical(0) + )); + + assert_noop!( + PredictionMarkets::dispute(Origin::signed(CHARLIE), 0, OutcomeReport::Categorical(1)), + AuthorizedError::::OnlyOneDisputeAllowed + ); + }); +} + #[test] fn it_allows_anyone_to_report_an_unreported_market() { ExtBuilder::default().build().execute_with(|| { @@ -2244,87 +2288,6 @@ fn dispute_fails_unless_reported_or_disputed_market(status: MarketStatus) { }); } -#[test] -fn it_resolves_a_disputed_market_to_default_if_dispute_mechanism_failed() { - ExtBuilder::default().build().execute_with(|| { - let end = 2; - assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), - BOB, - MarketPeriod::Block(0..2), - get_deadlines(), - gen_metadata(2), - MarketCreation::Permissionless, - MarketType::Categorical(::MinCategories::get()), - MarketDisputeMechanism::Authorized, - ScoringRule::CPMM, - )); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); - - let market = MarketCommons::market(&0).unwrap(); - let grace_period = market.deadlines.grace_period; - run_to_block(end + grace_period + 1); - assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), - 0, - OutcomeReport::Categorical(0) - )); - let dispute_at_0 = end + grace_period + 2; - run_to_block(dispute_at_0); - assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), - 0, - OutcomeReport::Categorical(1) - )); - let dispute_at_1 = dispute_at_0 + 1; - run_to_block(dispute_at_1); - assert_ok!(PredictionMarkets::dispute( - Origin::signed(DAVE), - 0, - OutcomeReport::Categorical(0) - )); - let dispute_at_2 = dispute_at_1 + 1; - run_to_block(dispute_at_2); - assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), - 0, - OutcomeReport::Categorical(1) - )); - - let charlie_reserved = Balances::reserved_balance(&CHARLIE); - let eve_reserved = Balances::reserved_balance(&EVE); - let disputes = crate::Disputes::::get(0); - assert_eq!(disputes.len(), 3); - - run_blocks(market.deadlines.dispute_duration); - let market_after = MarketCommons::market(&0).unwrap(); - assert_eq!(market_after.status, MarketStatus::Resolved); - let disputes = crate::Disputes::::get(0); - assert_eq!(disputes.len(), 0); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); - - // make sure rewards are right - // - // slashed amounts - // --------------------------- - // - Charlie's reserve: DisputeBond::get() - // - Eve's reserve: DisputeBond::get() + 2 * DisputeFactor::get() - // - // All goes to Dave (because Bob is - strictly speaking - not a disputor). - assert_eq!(Balances::free_balance(&CHARLIE), 1_000 * BASE - charlie_reserved); - assert_eq!(Balances::free_balance(&EVE), 1_000 * BASE - eve_reserved); - let total_slashed = charlie_reserved + eve_reserved; - assert_eq!(Balances::free_balance(&DAVE), 1_000 * BASE + total_slashed); - - // The oracle report was accepted, so Alice is not slashed. - assert_eq!(Balances::free_balance(&ALICE), 1_000 * BASE); - assert_eq!(Balances::free_balance(&BOB), 1_000 * BASE); - - assert!(market_after.bonds.creation.unwrap().is_settled); - assert!(market_after.bonds.oracle.unwrap().is_settled); - }); -} - #[test] fn start_global_dispute_works() { ExtBuilder::default().build().execute_with(|| { @@ -2454,16 +2417,15 @@ fn start_global_dispute_fails_on_wrong_mdm() { let dispute_at_0 = end + grace_period + 2; run_to_block(dispute_at_0); - for i in 1..=::MaxDisputes::get() { - assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), - market_id, - OutcomeReport::Categorical(i.saturated_into()) - )); - run_blocks(1); - let market = MarketCommons::market(&market_id).unwrap(); - assert_eq!(market.status, MarketStatus::Disputed); - } + // only one dispute allowed for authorized mdm + assert_ok!(PredictionMarkets::dispute( + Origin::signed(CHARLIE), + market_id, + OutcomeReport::Categorical(1u32.saturated_into()) + )); + run_blocks(1); + let market = MarketCommons::market(&market_id).unwrap(); + assert_eq!(market.status, MarketStatus::Disputed); #[cfg(feature = "with-global-disputes")] assert_noop!( @@ -3035,14 +2997,21 @@ fn authorized_correctly_resolves_disputed_market() { 0, OutcomeReport::Categorical(0) )); - let dispute_at_0 = grace_period + 1 + 1; - run_to_block(dispute_at_0); + + let charlie_balance = Balances::free_balance(&CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT); + + let dispute_at = grace_period + 1 + 1; + run_to_block(dispute_at); assert_ok!(PredictionMarkets::dispute( Origin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); + let charlie_balance = Balances::free_balance(&CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + // Fred authorizses an outcome, but fat-fingers it on the first try. assert_ok!(Authorized::authorize_market_outcome( Origin::signed(AuthorizedDisputeResolutionUser::get()), @@ -3055,21 +3024,6 @@ fn authorized_correctly_resolves_disputed_market() { OutcomeReport::Categorical(1) )); - let dispute_at_1 = dispute_at_0 + 1; - run_to_block(dispute_at_1); - assert_ok!(PredictionMarkets::dispute( - Origin::signed(DAVE), - 0, - OutcomeReport::Categorical(0) - )); - let dispute_at_2 = dispute_at_1 + 1; - run_to_block(dispute_at_2); - assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), - 0, - OutcomeReport::Categorical(1) - )); - let market = MarketCommons::market(&0).unwrap(); assert_eq!(market.status, MarketStatus::Disputed); @@ -3077,33 +3031,30 @@ fn authorized_correctly_resolves_disputed_market() { let charlie_reserved = Balances::reserved_balance(&CHARLIE); assert_eq!(charlie_reserved, DisputeBond::get()); - let dave_reserved = Balances::reserved_balance(&DAVE); - assert_eq!(dave_reserved, DisputeBond::get() + DisputeFactor::get()); - - let eve_reserved = Balances::reserved_balance(&EVE); - assert_eq!(eve_reserved, DisputeBond::get() + 2 * DisputeFactor::get()); - // check disputes length let disputes = crate::Disputes::::get(0); - assert_eq!(disputes.len(), 3); + assert_eq!(disputes.len(), 1); - // make sure the old mappings of market id per dispute block are erased let market_ids_1 = MarketIdsPerDisputeBlock::::get( - dispute_at_0 + market.deadlines.dispute_duration, + dispute_at + ::CorrectionPeriod::get(), ); - assert_eq!(market_ids_1.len(), 0); + assert_eq!(market_ids_1.len(), 1); - let market_ids_2 = MarketIdsPerDisputeBlock::::get( - dispute_at_1 + market.deadlines.dispute_duration, - ); - assert_eq!(market_ids_2.len(), 0); + let charlie_balance = Balances::free_balance(&CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); - let market_ids_3 = MarketIdsPerDisputeBlock::::get( - dispute_at_2 + market.deadlines.dispute_duration, - ); - assert_eq!(market_ids_3.len(), 1); + run_blocks(::CorrectionPeriod::get() - 1); - run_blocks(market.deadlines.dispute_duration); + let market_after = MarketCommons::market(&0).unwrap(); + assert_eq!(market_after.status, MarketStatus::Disputed); + + let charlie_balance = Balances::free_balance(&CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + + run_blocks(1); + + let charlie_balance = Balances::free_balance(&CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT + OracleBond::get()); let market_after = MarketCommons::market(&0).unwrap(); assert_eq!(market_after.status, MarketStatus::Resolved); @@ -3112,26 +3063,10 @@ fn authorized_correctly_resolves_disputed_market() { assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); - // Make sure rewards are right: - // - // Slashed amounts: - // - Dave's reserve: DisputeBond::get() + DisputeFactor::get() - // - Alice's oracle bond: OracleBond::get() - // Total: OracleBond::get() + DisputeBond::get() + DisputeFactor::get() - // - // Charlie and Eve each receive half of the total slashed amount as bounty. - let dave_reserved = DisputeBond::get() + DisputeFactor::get(); - let total_slashed = OracleBond::get() + dave_reserved; - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE + total_slashed / 2); + assert_eq!(charlie_balance, 1_000 * BASE + OracleBond::get()); let charlie_reserved_2 = Balances::reserved_balance(&CHARLIE); assert_eq!(charlie_reserved_2, 0); - let eve_balance = Balances::free_balance(&EVE); - assert_eq!(eve_balance, 1_000 * BASE + total_slashed / 2); - - let dave_balance = Balances::free_balance(&DAVE); - assert_eq!(dave_balance, 1_000 * BASE - dave_reserved); let alice_balance = Balances::free_balance(&ALICE); assert_eq!(alice_balance, 1_000 * BASE - OracleBond::get()); @@ -3146,69 +3081,6 @@ fn authorized_correctly_resolves_disputed_market() { }); } -#[test] -fn on_resolution_defaults_to_oracle_report_in_case_of_unresolved_dispute() { - ExtBuilder::default().build().execute_with(|| { - assert!(Balances::free_balance(Treasury::account_id()).is_zero()); - let end = 2; - let market_id = 0; - assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), - BOB, - MarketPeriod::Block(0..end), - get_deadlines(), - gen_metadata(2), - MarketCreation::Permissionless, - MarketType::Categorical(::MinCategories::get()), - MarketDisputeMechanism::Authorized, - ScoringRule::CPMM, - )); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), market_id, CENT)); - - let market = MarketCommons::market(&0).unwrap(); - let grace_period = end + market.deadlines.grace_period; - run_to_block(grace_period + 1); - assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), - market_id, - OutcomeReport::Categorical(1) - )); - assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), - market_id, - OutcomeReport::Categorical(0) - )); - let market = MarketCommons::market(&market_id).unwrap(); - assert_eq!(market.status, MarketStatus::Disputed); - - let charlie_reserved = Balances::reserved_balance(&CHARLIE); - assert_eq!(charlie_reserved, DisputeBond::get()); - - run_blocks(market.deadlines.dispute_duration); - let market_after = MarketCommons::market(&market_id).unwrap(); - assert_eq!(market_after.status, MarketStatus::Resolved); - let disputes = crate::Disputes::::get(0); - assert_eq!(disputes.len(), 0); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), market_id)); - - // Make sure rewards are right: - // - // - Bob reported "correctly" and in time, so Alice and Bob don't get slashed - // - Charlie started a dispute which was abandoned, hence he's slashed and his rewards are - // moved to the treasury - let alice_balance = Balances::free_balance(&ALICE); - assert_eq!(alice_balance, 1_000 * BASE); - let bob_balance = Balances::free_balance(&BOB); - assert_eq!(bob_balance, 1_000 * BASE); - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE - charlie_reserved); - assert_eq!(Balances::free_balance(Treasury::account_id()), charlie_reserved); - - assert!(market_after.bonds.creation.unwrap().is_settled); - assert!(market_after.bonds.oracle.unwrap().is_settled); - }); -} - #[test] fn approve_market_correctly_unreserves_advisory_bond() { ExtBuilder::default().build().execute_with(|| { diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index 22884a3f0..496d959a4 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for zrml_prediction_markets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-09, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/zeitgeist +// ./target/release/zeitgeist // benchmark // pallet // --chain=dev @@ -33,8 +33,8 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --template=./misc/weight_template.hbs // --output=./zrml/prediction-markets/src/weights.rs +// --template=./misc/weight_template.hbs #![allow(unused_parens)] #![allow(unused_imports)] @@ -50,8 +50,8 @@ pub trait WeightInfoZeitgeist { fn admin_move_market_to_closed(o: u32, c: u32) -> Weight; fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight; fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight; - fn admin_move_market_to_resolved_scalar_disputed(r: u32, d: u32) -> Weight; - fn admin_move_market_to_resolved_categorical_disputed(r: u32, d: u32) -> Weight; + fn admin_move_market_to_resolved_scalar_disputed(r: u32) -> Weight; + fn admin_move_market_to_resolved_categorical_disputed(r: u32) -> Weight; fn approve_market() -> Weight; fn request_edit(r: u32) -> Weight; fn buy_complete_set(a: u32) -> Weight; @@ -59,13 +59,13 @@ pub trait WeightInfoZeitgeist { fn edit_market(m: u32) -> Weight; fn deploy_swap_pool_for_market_future_pool(a: u32, o: u32) -> Weight; fn deploy_swap_pool_for_market_open_pool(a: u32) -> Weight; - fn start_global_dispute(m: u32) -> Weight; - fn dispute_authorized(d: u32, b: u32) -> Weight; + fn start_global_dispute(m: u32, n: u32) -> Weight; + fn dispute_authorized() -> Weight; fn handle_expired_advised_market() -> Weight; fn internal_resolve_categorical_reported() -> Weight; - fn internal_resolve_categorical_disputed(d: u32) -> Weight; + fn internal_resolve_categorical_disputed() -> Weight; fn internal_resolve_scalar_reported() -> Weight; - fn internal_resolve_scalar_disputed(d: u32) -> Weight; + fn internal_resolve_scalar_disputed() -> Weight; fn on_initialize_resolve_overhead() -> Weight; fn process_subsidy_collecting_markets_raw(a: u32) -> Weight; fn redeem_shares_categorical() -> Weight; @@ -91,12 +91,14 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - fn admin_destroy_disputed_market(a: u32, d: u32, _o: u32, _c: u32, _r: u32) -> Weight { - (176_251_000 as Weight) - // Standard Error: 14_000 - .saturating_add((37_179_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 218_000 - .saturating_add((6_261_000 as Weight).saturating_mul(d as Weight)) + fn admin_destroy_disputed_market(a: u32, d: u32, o: u32, _c: u32, _r: u32) -> Weight { + (131_391_000 as Weight) + // Standard Error: 3_000 + .saturating_add((22_410_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 56_000 + .saturating_add((1_219_000 as Weight).saturating_mul(d as Weight)) + // Standard Error: 3_000 + .saturating_add((66_000 as Weight).saturating_mul(o as Weight)) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().writes(8 as Weight)) @@ -111,12 +113,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) - fn admin_destroy_reported_market(a: u32, _o: u32, c: u32, _r: u32) -> Weight { - (198_500_000 as Weight) - // Standard Error: 16_000 - .saturating_add((37_042_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 15_000 - .saturating_add((218_000 as Weight).saturating_mul(c as Weight)) + fn admin_destroy_reported_market(a: u32, _o: u32, _c: u32, _r: u32) -> Weight { + (148_923_000 as Weight) + // Standard Error: 4_000 + .saturating_add((22_300_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().writes(8 as Weight)) @@ -126,10 +126,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_closed(_o: u32, c: u32) -> Weight { - (62_877_000 as Weight) + fn admin_move_market_to_closed(o: u32, c: u32) -> Weight { + (38_298_000 as Weight) + // Standard Error: 0 + .saturating_add((21_000 as Weight).saturating_mul(o as Weight)) // Standard Error: 0 - .saturating_add((71_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((7_000 as Weight).saturating_mul(c as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -139,9 +141,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight { - (100_354_000 as Weight) + (72_815_000 as Weight) // Standard Error: 0 - .saturating_add((80_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((58_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -152,65 +154,55 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight { - (201_548_000 as Weight) - // Standard Error: 3_000 - .saturating_add((100_000 as Weight).saturating_mul(r as Weight)) + (101_641_000 as Weight) + // Standard Error: 1_000 + .saturating_add((57_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - // Storage: Balances Reserves (r:7 w:7) + // Storage: Balances Reserves (r:2 w:2) // Storage: GlobalDisputes Winners (r:1 w:0) - // Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) - // Storage: System Account (r:7 w:7) + // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_resolved_scalar_disputed(r: u32, d: u32) -> Weight { - (132_066_000 as Weight) + fn admin_move_market_to_resolved_scalar_disputed(r: u32) -> Weight { + (119_331_000 as Weight) // Standard Error: 1_000 - .saturating_add((120_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 21_000 - .saturating_add((30_950_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(d as Weight))) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(d as Weight))) + .saturating_add((23_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) + .saturating_add(T::DbWeight::get().writes(7 as Weight)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - // Storage: Balances Reserves (r:7 w:7) + // Storage: Balances Reserves (r:2 w:2) // Storage: GlobalDisputes Winners (r:1 w:0) - // Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) - // Storage: System Account (r:6 w:6) + // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) - fn admin_move_market_to_resolved_categorical_disputed(r: u32, d: u32) -> Weight { - (227_185_000 as Weight) - // Standard Error: 6_000 - .saturating_add((69_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 90_000 - .saturating_add((33_824_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(d as Weight))) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(d as Weight))) + fn admin_move_market_to_resolved_categorical_disputed(r: u32) -> Weight { + (148_478_000 as Weight) + // Standard Error: 1_000 + .saturating_add((35_000 as Weight).saturating_mul(r as Weight)) + .saturating_add(T::DbWeight::get().reads(10 as Weight)) + .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:0) // Storage: Balances Reserves (r:1 w:1) fn approve_market() -> Weight { - (62_900_000 as Weight) + (46_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) - fn request_edit(r: u32) -> Weight { - (37_307_000 as Weight) - // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(r as Weight)) + fn request_edit(_r: u32) -> Weight { + (24_170_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -219,9 +211,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn buy_complete_set(a: u32) -> Weight { - (63_624_000 as Weight) - // Standard Error: 12_000 - .saturating_add((26_565_000 as Weight).saturating_mul(a as Weight)) + (52_875_000 as Weight) + // Standard Error: 4_000 + .saturating_add((17_255_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -233,9 +225,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons Markets (r:0 w:1) fn create_market(m: u32) -> Weight { - (75_202_000 as Weight) - // Standard Error: 3_000 - .saturating_add((53_000 as Weight).saturating_mul(m as Weight)) + (46_289_000 as Weight) + // Standard Error: 0 + .saturating_add((24_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } @@ -244,9 +236,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn edit_market(m: u32) -> Weight { - (64_080_000 as Weight) + (40_535_000 as Weight) // Standard Error: 0 - .saturating_add((117_000 as Weight).saturating_mul(m as Weight)) + .saturating_add((30_000 as Weight).saturating_mul(m as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -260,11 +252,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_future_pool(a: u32, o: u32) -> Weight { - (108_283_000 as Weight) - // Standard Error: 14_000 - .saturating_add((42_613_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 13_000 - .saturating_add((322_000 as Weight).saturating_mul(o as Weight)) + (91_979_000 as Weight) + // Standard Error: 6_000 + .saturating_add((26_628_000 as Weight).saturating_mul(a as Weight)) + // Standard Error: 6_000 + .saturating_add((2_000 as Weight).saturating_mul(o as Weight)) .saturating_add(T::DbWeight::get().reads(8 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().writes(7 as Weight)) @@ -279,9 +271,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_open_pool(a: u32) -> Weight { - (136_673_000 as Weight) - // Standard Error: 16_000 - .saturating_add((42_795_000 as Weight).saturating_mul(a as Weight)) + (94_216_000 as Weight) + // Standard Error: 4_000 + .saturating_add((26_749_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(7 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().writes(6 as Weight)) @@ -292,79 +284,73 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:7 w:7) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) - fn start_global_dispute(_m: u32) -> Weight { - (143_932_000 as Weight) + fn start_global_dispute(m: u32, n: u32) -> Weight { + (94_106_000 as Weight) + // Standard Error: 0 + .saturating_add((15_000 as Weight).saturating_mul(m as Weight)) + // Standard Error: 0 + .saturating_add((20_000 as Weight).saturating_mul(n as Weight)) .saturating_add(T::DbWeight::get().reads(12 as Weight)) .saturating_add(T::DbWeight::get().writes(10 as Weight)) } // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) - // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - fn dispute_authorized(d: u32, b: u32) -> Weight { - (79_841_000 as Weight) - // Standard Error: 17_000 - .saturating_add((1_894_000 as Weight).saturating_mul(d as Weight)) - // Standard Error: 1_000 - .saturating_add((82_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + fn dispute_authorized() -> Weight { + (46_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) } - // Storage: Balances Reserves (r:1 w:1) // Storage: MarketCommons Markets (r:1 w:1) + // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn handle_expired_advised_market() -> Weight { - (61_850_000 as Weight) + (49_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } + // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) - // Storage: MarketCommons Markets (r:1 w:1) fn internal_resolve_categorical_reported() -> Weight { - (172_370_000 as Weight) + (85_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight)) } + // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) + // Storage: GlobalDisputes Winners (r:1 w:0) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) - // Storage: MarketCommons Markets (r:1 w:1) - // Storage: GlobalDisputes Winners (r:1 w:0) - // Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) - // Storage: System Account (r:1 w:1) - fn internal_resolve_categorical_disputed(d: u32) -> Weight { - (183_852_000 as Weight) - // Standard Error: 82_000 - .saturating_add((24_286_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + fn internal_resolve_categorical_disputed() -> Weight { + (118_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } + // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - // Storage: MarketCommons Markets (r:1 w:1) fn internal_resolve_scalar_reported() -> Weight { - (73_231_000 as Weight) + (56_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } + // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) - // Storage: MarketCommons MarketPool (r:1 w:0) - // Storage: MarketCommons Markets (r:1 w:1) // Storage: GlobalDisputes Winners (r:1 w:0) - // Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: System Account (r:1 w:1) - fn internal_resolve_scalar_disputed(d: u32) -> Weight { - (90_052_000 as Weight) - // Standard Error: 74_000 - .saturating_add((21_265_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + // Storage: MarketCommons MarketPool (r:1 w:0) + fn internal_resolve_scalar_disputed() -> Weight { + (100_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) @@ -376,15 +362,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn on_initialize_resolve_overhead() -> Weight { - (45_170_000 as Weight) + (30_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(9 as Weight)) .saturating_add(T::DbWeight::get().writes(8 as Weight)) } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_raw(a: u32) -> Weight { - (5_577_000 as Weight) - // Standard Error: 8_000 - .saturating_add((507_000 as Weight).saturating_mul(a as Weight)) + (3_580_000 as Weight) + // Standard Error: 1_000 + .saturating_add((172_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } @@ -393,7 +379,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn redeem_shares_categorical() -> Weight { - (130_241_000 as Weight) + (73_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight)) } @@ -402,7 +388,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn redeem_shares_scalar() -> Weight { - (144_640_000 as Weight) + (95_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -412,23 +398,21 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn reject_market(c: u32, o: u32, r: u32) -> Weight { - (89_918_000 as Weight) + (78_886_000 as Weight) // Standard Error: 0 - .saturating_add((76_000 as Weight).saturating_mul(c as Weight)) + .saturating_add((16_000 as Weight).saturating_mul(c as Weight)) // Standard Error: 0 - .saturating_add((81_000 as Weight).saturating_mul(o as Weight)) + .saturating_add((21_000 as Weight).saturating_mul(o as Weight)) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(r as Weight)) + .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) .saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - fn report(m: u32) -> Weight { - (50_223_000 as Weight) - // Standard Error: 0 - .saturating_add((16_000 as Weight).saturating_mul(m as Weight)) + fn report(_m: u32) -> Weight { + (31_024_000 as Weight) .saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight)) } @@ -437,9 +421,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn sell_complete_set(a: u32) -> Weight { - (48_611_000 as Weight) - // Standard Error: 12_000 - .saturating_add((33_331_000 as Weight).saturating_mul(a as Weight)) + (40_368_000 as Weight) + // Standard Error: 4_000 + .saturating_add((21_523_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) .saturating_add(T::DbWeight::get().writes(1 as Weight)) @@ -452,9 +436,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn start_subsidy(a: u32) -> Weight { - (57_592_000 as Weight) - // Standard Error: 2_000 - .saturating_add((53_000 as Weight).saturating_mul(a as Weight)) + (33_451_000 as Weight) + // Standard Error: 0 + .saturating_add((52_000 as Weight).saturating_mul(a as Weight)) .saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5 as Weight)) } @@ -462,11 +446,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) fn market_status_manager(b: u32, f: u32) -> Weight { - (27_651_000 as Weight) - // Standard Error: 3_000 - .saturating_add((6_365_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 3_000 - .saturating_add((6_378_000 as Weight).saturating_mul(f as Weight)) + (15_414_000 as Weight) + // Standard Error: 2_000 + .saturating_add((4_284_000 as Weight).saturating_mul(b as Weight)) + // Standard Error: 2_000 + .saturating_add((4_380_000 as Weight).saturating_mul(f as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(f as Weight))) @@ -476,11 +460,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn market_resolution_manager(r: u32, d: u32) -> Weight { - (29_736_000 as Weight) - // Standard Error: 3_000 - .saturating_add((6_353_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 3_000 - .saturating_add((6_344_000 as Weight).saturating_mul(d as Weight)) + (17_183_000 as Weight) + // Standard Error: 2_000 + .saturating_add((4_209_000 as Weight).saturating_mul(r as Weight)) + // Standard Error: 2_000 + .saturating_add((4_285_000 as Weight).saturating_mul(d as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(d as Weight))) @@ -488,7 +472,7 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_dummy() -> Weight { - (5_470_000 as Weight) + (3_000_000 as Weight) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1 as Weight)) } diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index 2609fe844..193a3f716 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -33,12 +33,13 @@ mod pallet { use core::marker::PhantomData; use frame_support::{ dispatch::DispatchResult, + ensure, traits::{Currency, Get, Hooks, IsType}, PalletId, }; - use sp_runtime::DispatchError; + use sp_runtime::{traits::Saturating, DispatchError}; use zeitgeist_primitives::{ - traits::DisputeApi, + traits::{DisputeApi, DisputeResolutionApi}, types::{Market, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport}, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -65,6 +66,13 @@ mod pallet { /// Event type Event: From> + IsType<::Event>; + type DisputeResolution: DisputeResolutionApi< + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; + /// The identifier of individual markets. type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, @@ -93,6 +101,33 @@ mod pallet { #[pallet::hooks] impl Hooks for Pallet {} + impl Pallet + where + T: Config, + { + fn get_auto_resolve( + disputes: &[MarketDispute], + market: &MarketOf, + ) -> Option { + disputes.last().map(|last_dispute| { + last_dispute.at.saturating_add(market.deadlines.dispute_duration) + }) + } + + fn remove_auto_resolve( + disputes: &[MarketDispute], + market_id: &MarketIdOf, + market: &MarketOf, + ) { + if let Some(dispute_duration_ends_at_block) = Self::get_auto_resolve(disputes, market) { + T::DisputeResolution::remove_auto_resolve( + market_id, + dispute_duration_ends_at_block, + ); + } + } + } + impl DisputeApi for Pallet where T: Config, @@ -105,13 +140,20 @@ mod pallet { type Origin = T::Origin; fn on_dispute( - _: &[MarketDispute], - _: &Self::MarketId, + disputes: &[MarketDispute], + market_id: &Self::MarketId, market: &MarketOf, ) -> DispatchResult { - if market.dispute_mechanism != MarketDisputeMechanism::SimpleDisputes { - return Err(Error::::MarketDoesNotHaveSimpleDisputesMechanism.into()); - } + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::SimpleDisputes, + Error::::MarketDoesNotHaveSimpleDisputesMechanism + ); + Self::remove_auto_resolve(disputes, market_id, market); + let curr_block_num = >::block_number(); + // each dispute resets dispute_duration + let dispute_duration_ends_at_block = + curr_block_num.saturating_add(market.deadlines.dispute_duration); + T::DisputeResolution::add_auto_resolve(market_id, dispute_duration_ends_at_block)?; Ok(()) } @@ -120,12 +162,11 @@ mod pallet { _: &Self::MarketId, market: &MarketOf, ) -> Result, DispatchError> { - if market.dispute_mechanism != MarketDisputeMechanism::SimpleDisputes { - return Err(Error::::MarketDoesNotHaveSimpleDisputesMechanism.into()); - } - if market.status != MarketStatus::Disputed { - return Err(Error::::InvalidMarketStatus.into()); - } + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::SimpleDisputes, + Error::::MarketDoesNotHaveSimpleDisputesMechanism + ); + ensure!(market.status == MarketStatus::Disputed, Error::::InvalidMarketStatus); if let Some(last_dispute) = disputes.last() { Ok(Some(last_dispute.outcome.clone())) @@ -133,6 +174,31 @@ mod pallet { Err(Error::::InvalidMarketStatus.into()) } } + + fn get_auto_resolve( + disputes: &[MarketDispute], + _: &Self::MarketId, + market: &MarketOf, + ) -> Result, DispatchError> { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::SimpleDisputes, + Error::::MarketDoesNotHaveSimpleDisputesMechanism + ); + Ok(Self::get_auto_resolve(disputes, market)) + } + + fn has_failed( + _: &[MarketDispute], + _: &Self::MarketId, + market: &MarketOf, + ) -> Result { + ensure!( + market.dispute_mechanism == MarketDisputeMechanism::SimpleDisputes, + Error::::MarketDoesNotHaveSimpleDisputesMechanism + ); + // TODO when does simple disputes fail? + Ok(false) + } } impl SimpleDisputesPalletApi for Pallet where T: Config {} diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index bc03f9baa..5e6afbcd6 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -18,7 +18,12 @@ #![cfg(test)] use crate::{self as zrml_simple_disputes}; -use frame_support::{construct_runtime, traits::Everything}; +use frame_support::{ + construct_runtime, + pallet_prelude::{DispatchError, Weight}, + traits::Everything, + BoundedVec, +}; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, @@ -27,9 +32,10 @@ use zeitgeist_primitives::{ constants::mock::{ BlockHashCount, MaxReserves, MinimumPeriod, PmPalletId, SimpleDisputesPalletId, }, + traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, + AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, + MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -48,8 +54,49 @@ construct_runtime!( } ); +// NoopResolution implements DisputeResolutionApi with no-ops. +pub struct NoopResolution; + +impl DisputeResolutionApi for NoopResolution { + type AccountId = AccountIdTest; + type Balance = Balance; + type BlockNumber = BlockNumber; + type MarketId = MarketId; + type MaxDisputes = u32; + type Moment = Moment; + + fn resolve( + _market_id: &Self::MarketId, + _market: &Market, + ) -> Result { + Ok(0) + } + + fn add_auto_resolve( + _market_id: &Self::MarketId, + _resolve_at: Self::BlockNumber, + ) -> Result { + Ok(0u32) + } + + fn auto_resolve_exists(_market_id: &Self::MarketId, _resolve_at: Self::BlockNumber) -> bool { + false + } + + fn remove_auto_resolve(_market_id: &Self::MarketId, _resolve_at: Self::BlockNumber) -> u32 { + 0u32 + } + + fn get_disputes( + _market_id: &Self::MarketId, + ) -> BoundedVec, Self::MaxDisputes> { + Default::default() + } +} + impl crate::Config for Runtime { type Event = (); + type DisputeResolution = NoopResolution; type MarketCommons = MarketCommons; type PalletId = SimpleDisputesPalletId; } From 7e6754fa0a3091ad21c095257664a408b75d6318 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Thu, 12 Jan 2023 13:28:27 +0100 Subject: [PATCH 02/53] Unreserve dispute bonds when destroying a market (#877) * Add missing license files * Fix license file * Test that dispute bonds are correctly released upon destruction * Implement proper release of disputes upon destruction * Add test that `Disputes` is cleared --- zrml/prediction-markets/src/lib.rs | 12 +++++ zrml/prediction-markets/src/tests.rs | 65 +++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 9695db7c9..a6caa4b0c 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -261,6 +261,18 @@ mod pallet { let open_ids_len = Self::clear_auto_open(&market_id)?; let close_ids_len = Self::clear_auto_close(&market_id)?; let (ids_len, disputes_len) = Self::clear_auto_resolve(&market_id)?; + // `Disputes` is emtpy unless the market is disputed, so this is just a defensive + // check. + if market.status == MarketStatus::Disputed { + for (index, dispute) in Disputes::::take(market_id).iter().enumerate() { + T::AssetManager::unreserve_named( + &Self::reserve_id(), + Asset::Ztg, + &dispute.by, + default_dispute_bond::(index), + ); + } + } >::remove_market(&market_id)?; Disputes::::remove(market_id); diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 8e9cb2bae..d41136a57 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -19,8 +19,9 @@ #![allow(clippy::reversed_empty_ranges)] use crate::{ - mock::*, Config, Error, Event, LastTimeFrame, MarketIdsForEdit, MarketIdsPerCloseBlock, - MarketIdsPerDisputeBlock, MarketIdsPerOpenBlock, MarketIdsPerReportBlock, + default_dispute_bond, mock::*, Config, Disputes, Error, Event, LastTimeFrame, MarketIdsForEdit, + MarketIdsPerCloseBlock, MarketIdsPerDisputeBlock, MarketIdsPerOpenBlock, + MarketIdsPerReportBlock, }; use core::ops::{Range, RangeInclusive}; use frame_support::{ @@ -428,6 +429,66 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { }); } +#[test] +fn admin_destroy_market_correctly_unreserves_dispute_bonds() { + ExtBuilder::default().build().execute_with(|| { + let end = 2; + simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + let market_id = 0; + let market = MarketCommons::market(&market_id).unwrap(); + let grace_period = end + market.deadlines.grace_period; + assert_ne!(grace_period, 0); + run_to_block(grace_period + 1); + assert_ok!(PredictionMarkets::report( + Origin::signed(BOB), + 0, + OutcomeReport::Categorical(1) + )); + run_to_block(grace_period + 2); + assert_ok!(PredictionMarkets::dispute( + Origin::signed(CHARLIE), + 0, + OutcomeReport::Categorical(0) + )); + assert_ok!(PredictionMarkets::dispute( + Origin::signed(DAVE), + 0, + OutcomeReport::Categorical(1) + )); + let set_up_account = |account| { + assert_ok!(AssetManager::deposit(Asset::Ztg, account, SENTINEL_AMOUNT)); + assert_ok!(Balances::reserve_named( + &PredictionMarkets::reserve_id(), + account, + SENTINEL_AMOUNT, + )); + }; + set_up_account(&CHARLIE); + set_up_account(&DAVE); + + let balance_free_before_charlie = Balances::free_balance(&CHARLIE); + let balance_free_before_dave = Balances::free_balance(&DAVE); + assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), market_id)); + assert_eq!( + Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &CHARLIE), + SENTINEL_AMOUNT, + ); + assert_eq!( + Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &DAVE), + SENTINEL_AMOUNT, + ); + assert_eq!( + Balances::free_balance(CHARLIE), + balance_free_before_charlie + default_dispute_bond::(0) + ); + assert_eq!( + Balances::free_balance(DAVE), + balance_free_before_dave + default_dispute_bond::(1), + ); + assert!(Disputes::::get(market_id).is_empty()); + }); +} + #[test] fn admin_destroy_market_correctly_slashes_permissionless_market_resolved() { ExtBuilder::default().build().execute_with(|| { From 1296efd01430502f0f10427a0d6d5aa85c26f072 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 16 Jan 2023 16:55:54 +0100 Subject: [PATCH 03/53] Update crate and runtime version (#932) --- Cargo.lock | 38 +++++++++---------- node/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- runtime/battery-station/Cargo.toml | 2 +- runtime/battery-station/src/lib.rs | 4 +- runtime/common/Cargo.toml | 2 +- runtime/zeitgeist/Cargo.toml | 2 +- runtime/zeitgeist/src/lib.rs | 4 +- zrml/authorized/Cargo.toml | 2 +- zrml/court/Cargo.toml | 2 +- zrml/global-disputes/Cargo.toml | 2 +- zrml/liquidity-mining/Cargo.toml | 2 +- zrml/market-commons/Cargo.toml | 2 +- zrml/orderbook-v1/Cargo.toml | 2 +- zrml/prediction-markets/Cargo.toml | 2 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/rikiddo/Cargo.toml | 2 +- zrml/simple-disputes/Cargo.toml | 2 +- zrml/styx/Cargo.toml | 2 +- zrml/swaps/Cargo.toml | 2 +- zrml/swaps/rpc/Cargo.toml | 2 +- zrml/swaps/runtime-api/Cargo.toml | 2 +- 22 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f9d02c5c5..d2cf33b91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -418,7 +418,7 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "battery-station-runtime" -version = "0.3.7" +version = "0.3.8" dependencies = [ "cfg-if 1.0.0", "common-runtime", @@ -1081,7 +1081,7 @@ dependencies = [ [[package]] name = "common-runtime" -version = "0.3.7" +version = "0.3.8" dependencies = [ "cfg-if 1.0.0", "cumulus-pallet-xcmp-queue", @@ -12561,7 +12561,7 @@ dependencies = [ [[package]] name = "zeitgeist-node" -version = "0.3.7" +version = "0.3.8" dependencies = [ "battery-station-runtime", "cfg-if 1.0.0", @@ -12646,7 +12646,7 @@ dependencies = [ [[package]] name = "zeitgeist-primitives" -version = "0.3.7" +version = "0.3.8" dependencies = [ "arbitrary", "frame-support", @@ -12664,7 +12664,7 @@ dependencies = [ [[package]] name = "zeitgeist-runtime" -version = "0.3.7" +version = "0.3.8" dependencies = [ "cfg-if 1.0.0", "common-runtime", @@ -12781,7 +12781,7 @@ dependencies = [ [[package]] name = "zrml-authorized" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -12798,7 +12798,7 @@ dependencies = [ [[package]] name = "zrml-court" -version = "0.3.7" +version = "0.3.8" dependencies = [ "arrayvec 0.7.2", "frame-benchmarking", @@ -12818,7 +12818,7 @@ dependencies = [ [[package]] name = "zrml-global-disputes" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -12838,7 +12838,7 @@ dependencies = [ [[package]] name = "zrml-liquidity-mining" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -12856,7 +12856,7 @@ dependencies = [ [[package]] name = "zrml-market-commons" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-support", "frame-system", @@ -12872,7 +12872,7 @@ dependencies = [ [[package]] name = "zrml-orderbook-v1" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -12901,7 +12901,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -12949,7 +12949,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets-runtime-api" -version = "0.3.7" +version = "0.3.8" dependencies = [ "parity-scale-codec", "sp-api", @@ -12958,7 +12958,7 @@ dependencies = [ [[package]] name = "zrml-rikiddo" -version = "0.3.7" +version = "0.3.8" dependencies = [ "arbitrary", "cfg-if 1.0.0", @@ -12991,7 +12991,7 @@ dependencies = [ [[package]] name = "zrml-simple-disputes" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -13008,7 +13008,7 @@ dependencies = [ [[package]] name = "zrml-styx" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -13024,7 +13024,7 @@ dependencies = [ [[package]] name = "zrml-swaps" -version = "0.3.7" +version = "0.3.8" dependencies = [ "frame-benchmarking", "frame-support", @@ -13066,7 +13066,7 @@ dependencies = [ [[package]] name = "zrml-swaps-rpc" -version = "0.3.7" +version = "0.3.8" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13079,7 +13079,7 @@ dependencies = [ [[package]] name = "zrml-swaps-runtime-api" -version = "0.3.7" +version = "0.3.8" dependencies = [ "parity-scale-codec", "sp-api", diff --git a/node/Cargo.toml b/node/Cargo.toml index a89fc7bbf..bf6975d6c 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -176,7 +176,7 @@ description = "An evolving blockchain for prediction markets and futarchy." edition = "2021" homepage = "https://zeitgeist.pm" name = "zeitgeist-node" -version = "0.3.7" +version = "0.3.8" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 4fc57091d..dc3ad0432 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -34,4 +34,4 @@ with-global-disputes = [] authors = ["Zeitgeist PM "] edition = "2021" name = "zeitgeist-primitives" -version = "0.3.7" +version = "0.3.8" diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 6df889e83..747f785eb 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -387,7 +387,7 @@ with-global-disputes = [ authors = ["Zeitgeist PM "] edition = "2021" name = "battery-station-runtime" -version = "0.3.7" +version = "0.3.8" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index b24f04a30..001a3f1ee 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -90,10 +90,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 41, + spec_version: 42, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 18, + transaction_version: 19, state_version: 1, }; diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index d83c20cb1..d72cdb3c4 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -73,7 +73,7 @@ with-global-disputes = [] authors = ["Zeitgeist PM "] edition = "2021" name = "common-runtime" -version = "0.3.7" +version = "0.3.8" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index d4662ef96..13be3c9cc 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -378,7 +378,7 @@ with-global-disputes = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zeitgeist-runtime" -version = "0.3.7" +version = "0.3.8" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index d7dabfa85..745f6948e 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -89,10 +89,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 41, + spec_version: 42, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 18, + transaction_version: 19, state_version: 1, }; diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index cee23ae85..45d81459e 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -38,4 +38,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-authorized" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index 50eb1e5c9..de86174b4 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -41,4 +41,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-court" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/global-disputes/Cargo.toml b/zrml/global-disputes/Cargo.toml index 2496e8509..a099ee134 100644 --- a/zrml/global-disputes/Cargo.toml +++ b/zrml/global-disputes/Cargo.toml @@ -45,4 +45,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-global-disputes" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index b96c9a1a2..7204827f4 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -40,4 +40,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-liquidity-mining" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index c2d9abb39..17392e1b2 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -31,4 +31,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-market-commons" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/orderbook-v1/Cargo.toml b/zrml/orderbook-v1/Cargo.toml index b323ade71..07e59e8c1 100644 --- a/zrml/orderbook-v1/Cargo.toml +++ b/zrml/orderbook-v1/Cargo.toml @@ -47,4 +47,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-orderbook-v1" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index 0720f9b84..3b7a59e91 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -86,4 +86,4 @@ with-global-disputes = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-prediction-markets" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index faba7beae..6174301a7 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -15,4 +15,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-prediction-markets-runtime-api" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index e47e223d0..3accf67b9 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -42,4 +42,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-rikiddo" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index ee00bd310..2d158eef3 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -38,4 +38,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-simple-disputes" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/styx/Cargo.toml b/zrml/styx/Cargo.toml index 1575a9989..0b3c2831f 100644 --- a/zrml/styx/Cargo.toml +++ b/zrml/styx/Cargo.toml @@ -36,4 +36,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-styx" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index 0cf02c871..f1c9bc216 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -65,4 +65,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-swaps" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index aad792e06..b9a9fe29d 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -11,4 +11,4 @@ zrml-swaps-runtime-api = { default-features = false, features = ["std"], path = authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-swaps-rpc" -version = "0.3.7" +version = "0.3.8" diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index ac224fc28..9220c4535 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -17,4 +17,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-swaps-runtime-api" -version = "0.3.7" +version = "0.3.8" From 912cc00155111b270e95099aa6cbec7bae7002ea Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 16 Jan 2023 16:59:52 +0100 Subject: [PATCH 04/53] Add maximum lifetime for markets (#908) * wip * Add maximum lifetime checks * Remove `MaxMarketPeriod` * Fix formatting * Order parameters lexicographically * Add missing documentation * Add missing docstrings * Add missing test * Join `MaxMarketLifetime*` config parameters --- primitives/src/constants.rs | 2 + primitives/src/constants/mock.rs | 20 ++-- runtime/battery-station/src/parameters.rs | 39 ++++---- runtime/common/src/lib.rs | 2 +- runtime/zeitgeist/src/parameters.rs | 39 ++++---- zrml/prediction-markets/src/lib.rs | 33 +++--- zrml/prediction-markets/src/mock.rs | 4 +- zrml/prediction-markets/src/tests.rs | 116 ++++++++++++++++++++-- 8 files changed, 181 insertions(+), 74 deletions(-) diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index 5675bbc16..1e707fa6f 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -77,6 +77,8 @@ pub const GLOBAL_DISPUTES_LOCK_ID: [u8; 8] = *b"zge/gdlk"; pub const LM_PALLET_ID: PalletId = PalletId(*b"zge/lymg"); // Prediction Markets +/// The maximum allowed market life time, measured in blocks. +pub const MAX_MARKET_LIFETIME: BlockNumber = 365 * BLOCKS_PER_DAY; /// Max. categories in a prediction market. pub const MAX_CATEGORIES: u16 = 64; /// The dispute_duration is time where users can dispute the outcome. diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 515924b50..1436e58a4 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -44,23 +44,23 @@ parameter_types! { pub const DisputeFactor: Balance = 2 * BASE; pub const GlobalDisputePeriod: BlockNumber = 7 * BLOCKS_PER_DAY; pub const MaxCategories: u16 = 10; + pub const MaxDisputeDuration: BlockNumber = 50; pub const MaxDisputes: u16 = 6; + pub const MaxEditReasonLen: u32 = 1024; + pub const MaxGracePeriod: BlockNumber = 20; + pub const MaxMarketLifetime: BlockNumber = 1_000_000; + pub const MaxOracleDuration: BlockNumber = 30; + pub const MaxRejectReasonLen: u32 = 1024; + // 2_678_400_000 = 31 days. + pub const MaxSubsidyPeriod: Moment = 2_678_400_000; pub const MinCategories: u16 = 2; + pub const MinDisputeDuration: BlockNumber = 2; + pub const MinOracleDuration: BlockNumber = 2; // 60_000 = 1 minute. Should be raised to something more reasonable in the future. pub const MinSubsidyPeriod: Moment = 60_000; - // 2_678_400_000 = 31 days. - pub const MaxSubsidyPeriod: Moment = 2_678_400_000; - pub const MaxMarketPeriod: Moment = u64::MAX / 2; pub const OracleBond: Balance = 50 * CENT; pub const PmPalletId: PalletId = PalletId(*b"zge/pred"); pub const ValidityBond: Balance = 50 * CENT; - pub const MinDisputeDuration: BlockNumber = 2; - pub const MinOracleDuration: BlockNumber = 2; - pub const MaxDisputeDuration: BlockNumber = 50; - pub const MaxGracePeriod: BlockNumber = 20; - pub const MaxOracleDuration: BlockNumber = 30; - pub const MaxEditReasonLen: u32 = 1024; - pub const MaxRejectReasonLen: u32 = 1024; } // Simple disputes parameters diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index ed4fd4d2d..2fa08b893 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -147,6 +147,7 @@ parameter_types! { /// (Slashable) Bond that is provided for creating an advised market that needs approval. /// Slashed in case the market is rejected. pub const AdvisoryBond: Balance = 25 * CENT; + /// The percentage of the advisory bond that gets slashed when a market is rejected. pub const AdvisoryBondSlashPercentage: Percent = Percent::from_percent(0); /// (Slashable) Bond that is provided for disputing the outcome. /// Slashed in case the final outcome does not match the dispute for which the `DisputeBond` @@ -156,31 +157,35 @@ parameter_types! { pub const DisputeFactor: Balance = 2 * BASE; /// Maximum Categories a prediciton market can have (excluding base asset). pub const MaxCategories: u16 = MAX_CATEGORIES; + /// Maximum block period for a dispute. + pub const MaxDisputeDuration: BlockNumber = MAX_DISPUTE_DURATION; /// Maximum number of disputes. pub const MaxDisputes: u16 = 6; - /// Minimum number of categories. The trivial minimum is 2, which represents a binary market. - pub const MinCategories: u16 = 2; - // 60_000 = 1 minute. Should be raised to something more reasonable in the future. - /// Minimum number of milliseconds a Rikiddo market must be in subsidy gathering phase. - pub const MinSubsidyPeriod: Moment = 60_000; + /// Maximum string length for edit reason. + pub const MaxEditReasonLen: u32 = 1024; + /// Maximum block period for a grace_period. + /// The grace_period is a delay between the point where the market closes and the point where the oracle may report. + pub const MaxGracePeriod: BlockNumber = MAX_GRACE_PERIOD; + /// The maximum allowed duration of a market from creation to market close in blocks. + pub const MaxMarketLifetime: BlockNumber = MAX_MARKET_LIFETIME; + /// Maximum block period for a oracle_duration. + /// The oracle_duration is a duration where the oracle has to submit its report. + pub const MaxOracleDuration: BlockNumber = MAX_ORACLE_DURATION; + /// Maximum string length allowed for reject reason. + pub const MaxRejectReasonLen: u32 = 1024; // 2_678_400_000 = 31 days. /// Maximum number of milliseconds a Rikiddo market can be in subsidy gathering phase. pub const MaxSubsidyPeriod: Moment = 2_678_400_000; + /// Minimum number of categories. The trivial minimum is 2, which represents a binary market. + pub const MinCategories: u16 = 2; /// The dispute_duration is time where users can dispute the outcome. /// Minimum block period for a dispute. pub const MinDisputeDuration: BlockNumber = MIN_DISPUTE_DURATION; - /// Maximum block period for a dispute. - pub const MaxDisputeDuration: BlockNumber = MAX_DISPUTE_DURATION; - /// Maximum block period for a grace_period. - /// The grace_period is a delay between the point where the market closes and the point where the oracle may report. - pub const MaxGracePeriod: BlockNumber = MAX_GRACE_PERIOD; /// Minimum block period for a oracle_duration. pub const MinOracleDuration: BlockNumber = MIN_ORACLE_DURATION; - /// Maximum block period for a oracle_duration. - /// The oracle_duration is a duration where the oracle has to submit its report. - pub const MaxOracleDuration: BlockNumber = MAX_ORACLE_DURATION; - /// The maximum market period. - pub const MaxMarketPeriod: Moment = u64::MAX / 2; + // 60_000 = 1 minute. Should be raised to something more reasonable in the future. + /// Minimum number of milliseconds a Rikiddo market must be in subsidy gathering phase. + pub const MinSubsidyPeriod: Moment = 60_000; /// (Slashable) The orcale bond. Slashed in case the final outcome does not match the /// outcome the oracle reported. pub const OracleBond: Balance = 50 * CENT; @@ -189,10 +194,6 @@ parameter_types! { /// (Slashable) A bond for creation markets that do not require approval. Slashed in case /// the market is forcefully destroyed. pub const ValidityBond: Balance = 50 * CENT; - /// Maximum string length for edit reason. - pub const MaxEditReasonLen: u32 = 1024; - /// Maximum string length allowed for reject reason. - pub const MaxRejectReasonLen: u32 = 1024; // Preimage pub const PreimageMaxSize: u32 = 4096 * 1024; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 70389df19..3076dced3 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -999,13 +999,13 @@ macro_rules! impl_config_traits { // type LiquidityMining = LiquidityMining; type MaxCategories = MaxCategories; type MaxDisputes = MaxDisputes; + type MaxMarketLifetime = MaxMarketLifetime; type MinDisputeDuration = MinDisputeDuration; type MaxDisputeDuration = MaxDisputeDuration; type MaxGracePeriod = MaxGracePeriod; type MaxOracleDuration = MaxOracleDuration; type MinOracleDuration = MinOracleDuration; type MaxSubsidyPeriod = MaxSubsidyPeriod; - type MaxMarketPeriod = MaxMarketPeriod; type MinCategories = MinCategories; type MinSubsidyPeriod = MinSubsidyPeriod; type MaxEditReasonLen = MaxEditReasonLen; diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 060e26a5b..b4408f876 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -147,6 +147,7 @@ parameter_types! { /// (Slashable) Bond that is provided for creating an advised market that needs approval. /// Slashed in case the market is rejected. pub const AdvisoryBond: Balance = 200 * BASE; + /// The percentage of the advisory bond that gets slashed when a market is rejected. pub const AdvisoryBondSlashPercentage: Percent = Percent::from_percent(0); /// (Slashable) Bond that is provided for disputing the outcome. /// Slashed in case the final outcome does not match the dispute for which the `DisputeBond` @@ -156,31 +157,35 @@ parameter_types! { pub const DisputeFactor: Balance = 2 * BASE; /// Maximum Categories a prediciton market can have (excluding base asset). pub const MaxCategories: u16 = MAX_CATEGORIES; + /// Maximum block period for a dispute. + pub const MaxDisputeDuration: BlockNumber = MAX_DISPUTE_DURATION; /// Maximum number of disputes. pub const MaxDisputes: u16 = 1; - /// Minimum number of categories. The trivial minimum is 2, which represents a binary market. - pub const MinCategories: u16 = 2; - // 60_000 = 1 minute. Should be raised to something more reasonable in the future. - /// Minimum number of milliseconds a Rikiddo market must be in subsidy gathering phase. - pub const MinSubsidyPeriod: Moment = 60_000; + /// Maximum string length for edit reason. + pub const MaxEditReasonLen: u32 = 1024; + /// Maximum block period for a grace_period. + /// The grace_period is a delay between the point where the market closes and the point where the oracle may report. + pub const MaxGracePeriod: BlockNumber = MAX_GRACE_PERIOD; + /// The maximum allowed duration of a market from creation to market close in blocks. + pub const MaxMarketLifetime: BlockNumber = MAX_MARKET_LIFETIME; + /// Maximum block period for an oracle_duration. + /// The oracle_duration is a duration where the oracle has to submit its report. + pub const MaxOracleDuration: BlockNumber = MAX_ORACLE_DURATION; + /// Maximum string length allowed for reject reason. + pub const MaxRejectReasonLen: u32 = 1024; // 2_678_400_000 = 31 days. /// Maximum number of milliseconds a Rikiddo market can be in subsidy gathering phase. pub const MaxSubsidyPeriod: Moment = 2_678_400_000; + /// Minimum number of categories. The trivial minimum is 2, which represents a binary market. + pub const MinCategories: u16 = 2; /// The dispute_duration is time where users can dispute the outcome. /// Minimum block period for a dispute. pub const MinDisputeDuration: BlockNumber = MIN_DISPUTE_DURATION; - /// Maximum block period for a dispute. - pub const MaxDisputeDuration: BlockNumber = MAX_DISPUTE_DURATION; - /// Maximum block period for a grace_period. - /// The grace_period is a delay between the point where the market closes and the point where the oracle may report. - pub const MaxGracePeriod: BlockNumber = MAX_GRACE_PERIOD; /// Minimum block period for an oracle_duration. pub const MinOracleDuration: BlockNumber = MIN_ORACLE_DURATION; - /// Maximum block period for an oracle_duration. - /// The oracle_duration is a duration where the oracle has to submit its report. - pub const MaxOracleDuration: BlockNumber = MAX_ORACLE_DURATION; - /// The maximum market period. - pub const MaxMarketPeriod: Moment = u64::MAX / 2; + // 60_000 = 1 minute. Should be raised to something more reasonable in the future. + /// Minimum number of milliseconds a Rikiddo market must be in subsidy gathering phase. + pub const MinSubsidyPeriod: Moment = 60_000; /// (Slashable) The orcale bond. Slashed in case the final outcome does not match the /// outcome the oracle reported. pub const OracleBond: Balance = 200 * BASE; @@ -189,10 +194,6 @@ parameter_types! { /// (Slashable) A bond for creation markets that do not require approval. Slashed in case /// the market is forcefully destroyed. pub const ValidityBond: Balance = 1_000 * BASE; - /// Maximum string length for edit reason. - pub const MaxEditReasonLen: u32 = 1024; - /// Maximum string length allowed for reject reason. - pub const MaxRejectReasonLen: u32 = 1024; // Preimage pub const PreimageMaxSize: u32 = 4096 * 1024; diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index a6caa4b0c..e988338c9 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -1514,8 +1514,8 @@ mod pallet { #[pallet::constant] type MaxRejectReasonLen: Get; - /// The maximum allowed timepoint for the market period (timestamp or blocknumber). - type MaxMarketPeriod: Get; + /// The maximum allowed duration of a market from creation to market close in blocks. + type MaxMarketLifetime: Get; /// The maximum number of bytes allowed as edit reason. #[pallet::constant] @@ -1589,6 +1589,8 @@ mod pallet { NotEnoughBalance, /// Market is already reported on. MarketAlreadyReported, + /// The market duration is longer than allowed. + MarketDurationTooLong, /// Market edit request is already in progress. MarketEditRequestAlreadyInProgress, /// Market is not requested for edit. @@ -2182,28 +2184,29 @@ mod pallet { // frame in the future. match period { MarketPeriod::Block(ref range) => { - ensure!( - >::block_number() < range.end, - Error::::InvalidMarketPeriod - ); + let now = >::block_number(); + ensure!(now < range.end, Error::::InvalidMarketPeriod); ensure!(range.start < range.end, Error::::InvalidMarketPeriod); + let lifetime = range.end.saturating_sub(now); // Never saturates! ensure!( - range.end <= T::MaxMarketPeriod::get().saturated_into(), - Error::::InvalidMarketPeriod + lifetime <= T::MaxMarketLifetime::get(), + Error::::MarketDurationTooLong, ); } MarketPeriod::Timestamp(ref range) => { // Ensure that the market lasts at least one time frame into the future. - let now_frame = Self::calculate_time_frame_of_moment( - >::now(), - ); + let now = >::now(); + let now_frame = Self::calculate_time_frame_of_moment(now); let end_frame = Self::calculate_time_frame_of_moment(range.end); ensure!(now_frame < end_frame, Error::::InvalidMarketPeriod); ensure!(range.start < range.end, Error::::InvalidMarketPeriod); - ensure!( - range.end <= T::MaxMarketPeriod::get().saturated_into::>(), - Error::::InvalidMarketPeriod - ); + // Verify that the number of frames that the market is open doesn't exceed the + // maximum allowed lifetime in blocks. + let lifetime = end_frame.saturating_sub(now_frame); // Never saturates! + // If this conversion saturates, we're dealing with a market with excessive + // lifetime: + let lifetime_max: TimeFrame = T::MaxMarketLifetime::get().saturated_into(); + ensure!(lifetime <= lifetime_max, Error::::MarketDurationTooLong); } }; Ok(()) diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index f44b7b8ba..c9668cce8 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -39,7 +39,7 @@ use zeitgeist_primitives::{ CourtCaseDuration, CourtPalletId, DisputeFactor, ExistentialDeposit, ExistentialDeposits, ExitFee, GetNativeCurrencyId, LiquidityMiningPalletId, MaxApprovals, MaxAssets, MaxCategories, MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGracePeriod, - MaxInRatio, MaxMarketPeriod, MaxOracleDuration, MaxOutRatio, MaxRejectReasonLen, + MaxInRatio, MaxMarketLifetime, MaxOracleDuration, MaxOutRatio, MaxRejectReasonLen, MaxReserves, MaxSubsidyPeriod, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinCategories, MinDisputeDuration, MinLiquidity, MinOracleDuration, MinSubsidy, MinSubsidyPeriod, MinWeight, MinimumPeriod, PmPalletId, SimpleDisputesPalletId, @@ -158,7 +158,7 @@ impl crate::Config for Runtime { type MaxGracePeriod = MaxGracePeriod; type MaxOracleDuration = MaxOracleDuration; type MaxSubsidyPeriod = MaxSubsidyPeriod; - type MaxMarketPeriod = MaxMarketPeriod; + type MaxMarketLifetime = MaxMarketLifetime; type MinCategories = MinCategories; type MinSubsidyPeriod = MinSubsidyPeriod; type MaxEditReasonLen = MaxEditReasonLen; diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index d41136a57..7e44f60d4 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -1633,16 +1633,8 @@ fn create_categorical_market_fails_if_market_begin_is_equal_to_end() { #[test_case(MarketPeriod::Block(2..1); "block start greater than end")] #[test_case(MarketPeriod::Block(3..3); "block start equal to end")] -#[test_case( - MarketPeriod::Block(0..::MaxMarketPeriod::get() + 1); - "block end greater than max market period" -)] #[test_case(MarketPeriod::Timestamp(2..1); "timestamp start greater than end")] #[test_case(MarketPeriod::Timestamp(3..3); "timestamp start equal to end")] -#[test_case( - MarketPeriod::Timestamp(0..::MaxMarketPeriod::get() + 1); - "timestamp end greater than max market period" -)] #[test_case( MarketPeriod::Timestamp(0..(MILLISECS_PER_BLOCK - 1).into()); "range shorter than block time" @@ -3945,6 +3937,114 @@ fn report_fails_if_reporter_is_not_the_oracle() { }); } +#[test] +fn create_market_succeeds_if_market_duration_is_maximal_in_blocks() { + ExtBuilder::default().build().execute_with(|| { + let now = 1; + frame_system::Pallet::::set_block_number(now); + let start = 5; + let end = now + ::MaxMarketLifetime::get(); + assert!( + end > start, + "Test failed due to misconfiguration: `MaxMarketLifetime` is too small" + ); + assert_ok!(PredictionMarkets::create_market( + Origin::signed(ALICE), + BOB, + MarketPeriod::Block(start..end), + get_deadlines(), + gen_metadata(0), + MarketCreation::Permissionless, + MarketType::Categorical(3), + MarketDisputeMechanism::Authorized, + ScoringRule::CPMM, + )); + }); +} + +#[test] +fn create_market_suceeds_if_market_duration_is_maximal_in_moments() { + ExtBuilder::default().build().execute_with(|| { + let now = 12_001u64; + Timestamp::set_timestamp(now); + let start = 5 * MILLISECS_PER_BLOCK as u64; + let end = + now + ::MaxMarketLifetime::get() * (MILLISECS_PER_BLOCK as u64); + assert!( + end > start, + "Test failed due to misconfiguration: `MaxMarketLifetime` is too small" + ); + assert_ok!(PredictionMarkets::create_market( + Origin::signed(ALICE), + BOB, + MarketPeriod::Timestamp(start..end), + get_deadlines(), + gen_metadata(0), + MarketCreation::Permissionless, + MarketType::Categorical(3), + MarketDisputeMechanism::Authorized, + ScoringRule::CPMM, + )); + }); +} + +#[test] +fn create_market_fails_if_market_duration_is_too_long_in_blocks() { + ExtBuilder::default().build().execute_with(|| { + let now = 1; + frame_system::Pallet::::set_block_number(now); + let start = 5; + let end = now + ::MaxMarketLifetime::get() + 1; + assert!( + end > start, + "Test failed due to misconfiguration: `MaxMarketLifetime` is too small" + ); + assert_noop!( + PredictionMarkets::create_market( + Origin::signed(ALICE), + BOB, + MarketPeriod::Block(start..end), + get_deadlines(), + gen_metadata(0), + MarketCreation::Permissionless, + MarketType::Categorical(3), + MarketDisputeMechanism::Authorized, + ScoringRule::CPMM, + ), + crate::Error::::MarketDurationTooLong, + ); + }); +} + +#[test] +fn create_market_fails_if_market_duration_is_too_long_in_moments() { + ExtBuilder::default().build().execute_with(|| { + let now = 12_001u64; + Timestamp::set_timestamp(now); + let start = 5 * MILLISECS_PER_BLOCK as u64; + let end = now + + (::MaxMarketLifetime::get() + 1) * (MILLISECS_PER_BLOCK as u64); + assert!( + end > start, + "Test failed due to misconfiguration: `MaxMarketLifetime` is too small" + ); + assert_noop!( + PredictionMarkets::create_market( + Origin::signed(ALICE), + BOB, + MarketPeriod::Timestamp(start..end), + get_deadlines(), + gen_metadata(0), + MarketCreation::Permissionless, + MarketType::Categorical(3), + MarketDisputeMechanism::Authorized, + ScoringRule::CPMM, + ), + crate::Error::::MarketDurationTooLong, + ); + }); +} + #[test_case( MarketCreation::Advised, ScoringRule::CPMM, From 5a7feaf7c83c10d2fe63288413e3c336aadda68c Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:19:10 +0100 Subject: [PATCH 05/53] Fix: typos (#941) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6e54a9c1e..02e898b39 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ prediction markets. The platform's native currency, the ZTG, is used to sway the direction of the network, and as a means of last-call dispute resolution. Additionally, Zeitgeist is a protocol for efficient trading of prediction market shares and will one day become the backbone of the decentralized finance -ecosystem by allowing for traders to create complex financial contracts on +ecosystem by allowing traders to create complex financial contracts on virtually _anything_. ## Modules @@ -46,7 +46,7 @@ virtually _anything_. constants. - [rikiddo](./zrml/rikiddo) - The module contains a completely modular implementation of our novel market scoring rule [Rikiddo][rikiddo]. It also - offer a pallet, that other pallets can use to utilize the Rikiddo market + offers a pallet, that other pallets can use to utilize the Rikiddo market scoring rule. Rikiddo can be used by the automated market maker to determine swap prices. @@ -62,7 +62,7 @@ project and type: cargo build --release ``` -To build the parachain version, execute the following conmmand: +To build the parachain version, execute the following command: ``` cargo build --features parachain --release From b77b5acd11c8d23f2ab950b04afb6504377cafb7 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Thu, 19 Jan 2023 16:27:46 +0530 Subject: [PATCH 06/53] Add base_asset to Market structure and make prediction_markets pallet use it instead of Asset::Ztg (#894) * Add base_asset to Market structure and make prediction_markets pallet use it instead of Asset::Ztg * Add AssetRegistry check for foreign asset valid for market creation or not * Fix runtime build issues * Warp AssetRegistry related things under parachain feature * Enable AssetRegistry with parachain feature * Fix build failure * Add migration for markets to have base_asset. Fix fuzz test. Update changelog_for_devs.md * better log message in migration * Minor changes as per review comments * In Market type add Asset as template parameter instead of MarketId * Fix build failures and clippy issues * Changes are per review comments * Make clippy happy * Changes are pre review comments * Fmt * Fix as per review comments * Make clippy happy * Remove UpdateBaseAsset migration from market-commons as it is merged in prediction-markets pallet * Replace `Asset::Ztg` with `base_asset` where appropriate * Minor fix * Address review comments * Update tests as per review comments * Fix prediction market tests * Changes as per review comments * Fix more tests * Fix issues after merge with main * Changes as per reviews * Fix tests after merge with main * Fix parachain build for prediction-markets * Fix parachain testing Co-authored-by: Malte Kliemann --- .github/workflows/rust.yml | 2 +- Cargo.lock | 173 ++- docs/changelog_for_devs.md | 3 + primitives/src/market.rs | 16 +- primitives/src/traits/dispute_api.rs | 13 +- .../src/traits/market_commons_pallet_api.rs | 3 +- primitives/src/types.rs | 48 +- runtime/battery-station/Cargo.toml | 1 + .../src/integration_tests/xcm/setup.rs | 7 +- .../integration_tests/xcm/tests/transfers.rs | 11 +- runtime/battery-station/src/lib.rs | 2 +- .../src/xcm_config/asset_registry.rs | 47 +- .../battery-station/src/xcm_config/fees.rs | 5 +- runtime/common/src/lib.rs | 6 +- runtime/zeitgeist/Cargo.toml | 1 + .../src/integration_tests/xcm/setup.rs | 7 +- .../integration_tests/xcm/tests/transfers.rs | 11 +- runtime/zeitgeist/src/lib.rs | 2 +- .../src/xcm_config/asset_registry.rs | 47 +- runtime/zeitgeist/src/xcm_config/fees.rs | 5 +- scripts/tests/aux-functions.sh | 3 +- scripts/tests/misc.sh | 22 +- zrml/authorized/src/lib.rs | 10 +- zrml/authorized/src/mock.rs | 10 +- zrml/court/src/lib.rs | 3 +- zrml/court/src/mock.rs | 10 +- zrml/court/src/tests.rs | 5 +- zrml/liquidity-mining/src/tests.rs | 3 +- zrml/market-commons/src/lib.rs | 4 +- zrml/market-commons/src/migrations.rs | 58 + zrml/market-commons/src/tests.rs | 11 +- zrml/prediction-markets/Cargo.toml | 10 + .../fuzz/pm_full_workflow.rs | 3 +- zrml/prediction-markets/src/benchmarks.rs | 4 + zrml/prediction-markets/src/lib.rs | 83 +- zrml/prediction-markets/src/migrations.rs | 41 +- zrml/prediction-markets/src/mock.rs | 58 +- .../src/orml_asset_registry.rs | 257 ++++ zrml/prediction-markets/src/tests.rs | 1258 ++++++++++++++--- zrml/simple-disputes/src/lib.rs | 5 +- zrml/simple-disputes/src/mock.rs | 10 +- zrml/simple-disputes/src/tests.rs | 5 +- zrml/swaps/src/benchmarks.rs | 2 + zrml/swaps/src/tests.rs | 5 +- 44 files changed, 1819 insertions(+), 471 deletions(-) create mode 100644 zrml/prediction-markets/src/orml_asset_registry.rs diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 20dc806f4..e109cd60a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -94,7 +94,7 @@ jobs: uses: Swatinem/rust-cache@v1 - name: Tests - run: ./scripts/tests/misc.sh + run: ./scripts/tests/misc.sh -Cinstrument-coverage - name: Upload to codecov.io uses: codecov/codecov-action@v3 diff --git a/Cargo.lock b/Cargo.lock index d2cf33b91..562b5fdc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -181,11 +181,11 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" dependencies = [ - "concurrent-queue 1.2.4", + "concurrent-queue", "event-listener", "futures-core", ] @@ -198,7 +198,7 @@ checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" dependencies = [ "async-lock", "async-task", - "concurrent-queue 2.0.0", + "concurrent-queue", "fastrand", "futures-lite", "slab", @@ -221,13 +221,13 @@ dependencies = [ [[package]] name = "async-io" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" dependencies = [ "async-lock", "autocfg", - "concurrent-queue 1.2.4", + "concurrent-queue", "futures-lite", "libc", "log", @@ -236,7 +236,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -251,20 +251,20 @@ dependencies = [ [[package]] name = "async-process" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" +checksum = "6381ead98388605d0d9ff86371043b5aa922a3905824244de40dc263a14fcba4" dependencies = [ "async-io", + "async-lock", "autocfg", "blocking", "cfg-if 1.0.0", "event-listener", "futures-lite", "libc", - "once_cell", "signal-hook", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -318,9 +318,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" dependencies = [ "proc-macro2", "quote", @@ -387,7 +387,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.5.4", "object 0.29.0", "rustc-demangle", ] @@ -694,9 +694,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895adc16c8b3273fbbc32685a7d55227705eda08c01e77704020f3491924b44b" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec 0.7.2", @@ -747,16 +747,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" +checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" dependencies = [ "async-channel", + "async-lock", "async-task", "atomic-waker", "fastrand", "futures-lite", - "once_cell", ] [[package]] @@ -833,12 +833,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - [[package]] name = "camino" version = "1.1.1" @@ -1112,15 +1106,6 @@ dependencies = [ "pallet-vesting", ] -[[package]] -name = "concurrent-queue" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" -dependencies = [ - "cache-padded", -] - [[package]] name = "concurrent-queue" version = "2.0.0" @@ -1891,9 +1876,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453" +checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" dependencies = [ "cc", "cxxbridge-flags", @@ -1903,9 +1888,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0" +checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" dependencies = [ "cc", "codespan-reporting", @@ -1918,15 +1903,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71" +checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" [[package]] name = "cxxbridge-macro" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" +checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" dependencies = [ "proc-macro2", "quote", @@ -2239,9 +2224,9 @@ dependencies = [ [[package]] name = "environmental" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "errno" @@ -2427,13 +2412,13 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -2976,9 +2961,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +checksum = "98c4a8d6391675c6b2ee1a6c8d06e8e2d03605c44cec1270675985a4c2a5500b" dependencies = [ "futures-channel", "futures-core", @@ -3766,9 +3751,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libfuzzer-sys" @@ -4138,9 +4123,9 @@ dependencies = [ [[package]] name = "libp2p-pnet" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5a702574223aa55d8878bdc8bf55c84a6086f87ddaddc28ce730b4caa81538" +checksum = "de160c5631696cea22be326c19bd9d306e254c4964945263aea10f25f6e0864e" dependencies = [ "futures 0.3.25", "log", @@ -4654,6 +4639,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.8.5" @@ -4930,9 +4924,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -4983,9 +4977,9 @@ dependencies = [ [[package]] name = "num-format" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b862ff8df690cf089058c98b183676a7ed0f974cc08b426800093227cbff3b" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ "arrayvec 0.7.2", "itoa", @@ -6369,7 +6363,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.4", + "parking_lot_core 0.9.5", ] [[package]] @@ -6388,9 +6382,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if 1.0.0", "libc", @@ -6437,9 +6431,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.4.1" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a528564cc62c19a7acac4d81e01f39e53e25e17b934878f4c6d25cc2836e62f8" +checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0" dependencies = [ "thiserror", "ucd-trie", @@ -6447,9 +6441,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.4.1" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fd9bc6500181952d34bd0b2b0163a54d794227b498be0b7afa7698d0a7b18f" +checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344" dependencies = [ "pest", "pest_generator", @@ -6457,9 +6451,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.4.1" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2610d5ac5156217b4ff8e46ddcef7cdf44b273da2ac5bca2ecbfa86a330e7c4" +checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c" dependencies = [ "pest", "pest_meta", @@ -6470,9 +6464,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.4.1" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824749bf7e21dd66b36fbe26b3f45c713879cccd4a009a917ab8e045ca8246fe" +checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20" dependencies = [ "once_cell", "pest", @@ -7766,16 +7760,16 @@ dependencies = [ [[package]] name = "polling" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" +checksum = "166ca89eb77fd403230b9c156612965a81e094ec6ec3aa13663d4c8b113fa748" dependencies = [ "autocfg", "cfg-if 1.0.0", "libc", "log", "wepoll-ffi", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -9808,18 +9802,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.147" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ "proc-macro2", "quote", @@ -11058,9 +11052,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" dependencies = [ "proc-macro2", "quote", @@ -11245,9 +11239,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -11310,9 +11304,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", @@ -11620,9 +11614,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uint" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", @@ -12769,9 +12763,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", @@ -12907,6 +12901,7 @@ dependencies = [ "frame-support", "frame-system", "more-asserts", + "orml-asset-registry", "orml-currencies", "orml-tokens", "orml-traits", @@ -12916,12 +12911,14 @@ dependencies = [ "pallet-treasury", "parity-scale-codec", "scale-info", + "serde", "sp-api", "sp-arithmetic", "sp-io", "sp-runtime", "substrate-fixed", "test-case", + "xcm", "zeitgeist-primitives", "zrml-authorized", "zrml-court", @@ -13108,9 +13105,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.4+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" dependencies = [ "cc", "libc", diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index fde20e06c..fcad5fd20 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -11,6 +11,9 @@ protection). The authority report now includes its resolution block number. This is the time of the first call to `authorize_market_outcome` plus the `CorrectionPeriod`. +- Create prediction markets with Ztg or registered foreign asset which has + `allow_as_base_asset` set to `true` in `AssetRegistry` metadata. Extrinsics related + to prediction market creation/editing now have `base_asset` parameter. # v0.3.7 diff --git a/primitives/src/market.rs b/primitives/src/market.rs index 9584fd274..2591ef2ee 100644 --- a/primitives/src/market.rs +++ b/primitives/src/market.rs @@ -28,8 +28,11 @@ use sp_runtime::RuntimeDebug; /// * `BA`: Balance type for bonds /// * `BN`: Block number /// * `M`: Moment (time moment) +/// * `A`: Asset #[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Market { +pub struct Market { + /// Base asset of the market. + pub base_asset: A, /// Creator of this market. pub creator: AI, /// Creation type. @@ -103,7 +106,7 @@ impl Default for MarketBonds { } } -impl Market { +impl Market { // Returns the number of outcomes for a market. pub fn outcomes(&self) -> u16 { match self.market_type { @@ -129,15 +132,17 @@ impl Market { } } -impl MaxEncodedLen for Market +impl MaxEncodedLen for Market where AI: MaxEncodedLen, BA: MaxEncodedLen, BN: MaxEncodedLen, M: MaxEncodedLen, + A: MaxEncodedLen, { fn max_encoded_len() -> usize { AI::max_encoded_len() + .saturating_add(A::max_encoded_len()) .saturating_add(MarketCreation::max_encoded_len()) .saturating_add(u8::max_encoded_len()) .saturating_add(AI::max_encoded_len()) @@ -285,9 +290,9 @@ pub struct SubsidyUntil { #[cfg(test)] mod tests { - use crate::market::*; + use crate::{market::*, types::Asset}; use test_case::test_case; - type Market = crate::market::Market; + type Market = crate::market::Market>; #[test_case( MarketType::Categorical(6), @@ -343,6 +348,7 @@ mod tests { expected: bool, ) { let market = Market { + base_asset: Asset::Ztg, creator: 1, creation: MarketCreation::Permissionless, creator_fee: 2, diff --git a/primitives/src/traits/dispute_api.rs b/primitives/src/traits/dispute_api.rs index 17d062692..584a3193e 100644 --- a/primitives/src/traits/dispute_api.rs +++ b/primitives/src/traits/dispute_api.rs @@ -15,8 +15,13 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{market::MarketDispute, outcome_report::OutcomeReport, types::Market}; +use crate::{ + market::MarketDispute, + outcome_report::OutcomeReport, + types::{Asset, Market}, +}; use frame_support::{dispatch::DispatchResult, pallet_prelude::Weight, BoundedVec}; +use parity_scale_codec::MaxEncodedLen; use sp_runtime::DispatchError; // Abstraction of the market type, which is not a part of `DisputeApi` because Rust doesn't support @@ -26,13 +31,14 @@ type MarketOfDisputeApi = Market< ::Balance, ::BlockNumber, ::Moment, + Asset<::MarketId>, >; pub trait DisputeApi { type AccountId; type Balance; type BlockNumber; - type MarketId; + type MarketId: MaxEncodedLen; type Moment; type Origin; @@ -88,13 +94,14 @@ type MarketOfDisputeResolutionApi = Market< ::Balance, ::BlockNumber, ::Moment, + Asset<::MarketId>, >; pub trait DisputeResolutionApi { type AccountId; type Balance; type BlockNumber; - type MarketId; + type MarketId: MaxEncodedLen; type MaxDisputes; type Moment; diff --git a/primitives/src/traits/market_commons_pallet_api.rs b/primitives/src/traits/market_commons_pallet_api.rs index d0e463a4d..d246e9f0c 100644 --- a/primitives/src/traits/market_commons_pallet_api.rs +++ b/primitives/src/traits/market_commons_pallet_api.rs @@ -16,7 +16,7 @@ // along with Zeitgeist. If not, see . #![allow(clippy::type_complexity)] -use crate::types::{Market, PoolId}; +use crate::types::{Asset, Market, PoolId}; use frame_support::{ dispatch::{DispatchError, DispatchResult}, pallet_prelude::{MaybeSerializeDeserialize, Member}, @@ -36,6 +36,7 @@ type MarketOf = Market< >>::Balance, ::BlockNumber, ::Moment, + Asset<::MarketId>, >; /// Abstraction over storage operations for markets diff --git a/primitives/src/types.rs b/primitives/src/types.rs index 2d0a331d2..b8cb3b891 100644 --- a/primitives/src/types.rs +++ b/primitives/src/types.rs @@ -22,7 +22,7 @@ pub use crate::{ #[cfg(feature = "arbitrary")] use arbitrary::{Arbitrary, Result, Unstructured}; use frame_support::dispatch::Weight; -use parity_scale_codec::{Decode, Encode}; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{ generic, @@ -121,3 +121,49 @@ pub struct ResultWithWeightInfo { pub result: R, pub weight: Weight, } + +#[derive( + Clone, + Copy, + Debug, + Decode, + Default, + Encode, + Eq, + MaxEncodedLen, + Ord, + PartialEq, + PartialOrd, + TypeInfo, +)] +/// Custom XC asset metadata +pub struct CustomMetadata { + /// XCM-related metadata. + pub xcm: XcmMetadata, + + /// Whether an asset can be used as base_asset in pools. + pub allow_as_base_asset: bool, +} + +#[derive( + Clone, + Copy, + Debug, + Decode, + Default, + Encode, + Eq, + MaxEncodedLen, + Ord, + PartialEq, + PartialOrd, + TypeInfo, +)] +pub struct XcmMetadata { + /// The factor used to determine the fee. + /// It is multiplied by the fee that would have been paid in native currency, so it represents + /// the ratio `native_price / other_asset_price`. It is a fixed point decimal number containing + /// as many fractional decimals as the asset it is used for contains. + /// Should be updated regularly. + pub fee_factor: Option, +} diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 747f785eb..9a9f690cf 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -121,6 +121,7 @@ xcm-emulator = { rev = "ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe", git = "https: [features] default = ["std"] parachain = [ + "zrml-prediction-markets/parachain", # Cumulus "cumulus-pallet-dmp-queue", diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index 510c5b58d..dfda13cf8 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -17,10 +17,7 @@ // along with Zeitgeist. If not, see . use crate::{ - xcm_config::{ - asset_registry::CustomMetadata, - config::{battery_station, general_key}, - }, + xcm_config::config::{battery_station, general_key}, AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Origin, Runtime, System, }; use frame_support::{assert_ok, traits::GenesisBuild}; @@ -29,7 +26,7 @@ use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, }; -use zeitgeist_primitives::types::Asset; +use zeitgeist_primitives::types::{Asset, CustomMetadata}; pub(super) struct ExtBuilder { balances: Vec<(AccountId, CurrencyId, Balance)>, diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index ffa956c08..793d345f7 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -25,11 +25,7 @@ use crate::{ }, test_net::{KusamaNet, Sibling, TestNet, Zeitgeist}, }, - xcm_config::{ - asset_registry::{CustomMetadata, XcmMetadata}, - config::battery_station, - fees::default_per_second, - }, + xcm_config::{config::battery_station, fees::default_per_second}, AssetRegistry, Balance, Balances, CurrencyId, Origin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; @@ -38,7 +34,10 @@ use frame_support::assert_ok; use orml_traits::MultiCurrency; use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, NetworkId}; use xcm_emulator::TestExt; -use zeitgeist_primitives::constants::BalanceFractionalDecimals; +use zeitgeist_primitives::{ + constants::BalanceFractionalDecimals, + types::{CustomMetadata, XcmMetadata}, +}; #[test] fn transfer_ztg_to_sibling() { diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 001a3f1ee..bac3d5b61 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -57,7 +57,7 @@ use { frame_system::EnsureSigned, xcm_builder::{EnsureXcmOrigin, FixedWeightBounds, LocationInverter}, xcm_config::{ - asset_registry::{CustomAssetProcessor, CustomMetadata}, + asset_registry::CustomAssetProcessor, config::{LocalOriginToLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, XcmRouter}, }, }; diff --git a/runtime/battery-station/src/xcm_config/asset_registry.rs b/runtime/battery-station/src/xcm_config/asset_registry.rs index ba7807a8c..07d62519c 100644 --- a/runtime/battery-station/src/xcm_config/asset_registry.rs +++ b/runtime/battery-station/src/xcm_config/asset_registry.rs @@ -20,6 +20,7 @@ use orml_traits::asset_registry::{AssetMetadata, AssetProcessor}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::DispatchError; +use zeitgeist_primitives::types::CustomMetadata; #[derive( Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, @@ -46,49 +47,3 @@ impl AssetProcessor> for Cust Ok(()) } } - -#[derive( - Clone, - Copy, - Default, - PartialOrd, - Ord, - PartialEq, - Eq, - Debug, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, -)] -/// Custom XC asset metadata -pub struct CustomMetadata { - /// XCM-related metadata. - pub xcm: XcmMetadata, - - /// Whether an asset can be used in pools. - pub allow_in_pool: bool, -} - -#[derive( - Clone, - Copy, - Default, - PartialOrd, - Ord, - PartialEq, - Eq, - Debug, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, -)] -pub struct XcmMetadata { - /// The factor used to determine the fee. - /// It is multiplied by the fee that would have been paid in native currency, so it represents - /// the ratio `native_price / other_asset_price`. It is a fixed point decimal number containing - /// as many fractional decimals as the asset it is used for contains. - /// Should be updated regularly. - pub fee_factor: Option, -} diff --git a/runtime/battery-station/src/xcm_config/fees.rs b/runtime/battery-station/src/xcm_config/fees.rs index b70484d97..dbedf3d93 100644 --- a/runtime/battery-station/src/xcm_config/fees.rs +++ b/runtime/battery-station/src/xcm_config/fees.rs @@ -1,3 +1,4 @@ +// Copyright 2021 Centrifuge Foundation (centrifuge.io). // Copyright 2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -15,11 +16,11 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{xcm_config::asset_registry::CustomMetadata, Balance, CurrencyId}; +use crate::{Balance, CurrencyId}; use core::marker::PhantomData; use frame_support::weights::constants::{ExtrinsicBaseWeight, WEIGHT_PER_SECOND}; use xcm::latest::MultiLocation; -use zeitgeist_primitives::constants::BalanceFractionalDecimals; +use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::CustomMetadata}; use zrml_swaps::check_arithm_rslt::CheckArithmRslt; /// The fee cost per second for transferring the native token in cents. diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 3076dced3..e7e27882f 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -59,7 +59,7 @@ macro_rules! decl_common_types { Runtime, AllPalletsWithSystem, ( - zrml_prediction_markets::migrations::RecordBonds, + zrml_prediction_markets::migrations::UpdateMarketsForBaseAssetAndRecordBonds, zrml_prediction_markets::migrations::AddFieldToAuthorityReport, ), >; @@ -72,7 +72,7 @@ macro_rules! decl_common_types { Runtime, AllPalletsWithSystem, ( - zrml_prediction_markets::migrations::RecordBonds, + zrml_prediction_markets::migrations::UpdateMarketsForBaseAssetAndRecordBonds, zrml_prediction_markets::migrations::AddFieldToAuthorityReport, ), >; @@ -1019,6 +1019,8 @@ macro_rules! impl_config_traits { >; type ResolveOrigin = EnsureRoot; type AssetManager = AssetManager; + #[cfg(feature = "parachain")] + type AssetRegistry = AssetRegistry; type SimpleDisputes = SimpleDisputes; type Slash = Treasury; type Swaps = Swaps; diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index 13be3c9cc..d1d3f8fb5 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -119,6 +119,7 @@ xcm-emulator = { rev = "ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe", git = "https: [features] default = ["std"] parachain = [ + "zrml-prediction-markets/parachain", # Cumulus "cumulus-pallet-dmp-queue", diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index e3da82f91..6ce5521fa 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -17,10 +17,7 @@ // along with Zeitgeist. If not, see . use crate::{ - xcm_config::{ - asset_registry::CustomMetadata, - config::{general_key, zeitgeist}, - }, + xcm_config::config::{general_key, zeitgeist}, AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Origin, Runtime, System, }; use frame_support::{assert_ok, traits::GenesisBuild}; @@ -29,7 +26,7 @@ use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, }; -use zeitgeist_primitives::types::Asset; +use zeitgeist_primitives::types::{Asset, CustomMetadata}; pub(super) struct ExtBuilder { balances: Vec<(AccountId, CurrencyId, Balance)>, diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index 25543b4e1..9b7f19032 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -25,11 +25,7 @@ use crate::{ }, test_net::{KusamaNet, Sibling, TestNet, Zeitgeist}, }, - xcm_config::{ - asset_registry::{CustomMetadata, XcmMetadata}, - config::zeitgeist, - fees::default_per_second, - }, + xcm_config::{config::zeitgeist, fees::default_per_second}, AssetRegistry, Balance, Balances, CurrencyId, Origin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; @@ -38,7 +34,10 @@ use frame_support::assert_ok; use orml_traits::MultiCurrency; use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, NetworkId}; use xcm_emulator::TestExt; -use zeitgeist_primitives::constants::BalanceFractionalDecimals; +use zeitgeist_primitives::{ + constants::BalanceFractionalDecimals, + types::{CustomMetadata, XcmMetadata}, +}; #[test] fn transfer_ztg_to_sibling() { diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 745f6948e..3fde212b7 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -57,7 +57,7 @@ use { frame_system::EnsureSigned, xcm_builder::{EnsureXcmOrigin, FixedWeightBounds, LocationInverter}, xcm_config::{ - asset_registry::{CustomAssetProcessor, CustomMetadata}, + asset_registry::CustomAssetProcessor, config::{LocalOriginToLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, XcmRouter}, }, }; diff --git a/runtime/zeitgeist/src/xcm_config/asset_registry.rs b/runtime/zeitgeist/src/xcm_config/asset_registry.rs index ba7807a8c..07d62519c 100644 --- a/runtime/zeitgeist/src/xcm_config/asset_registry.rs +++ b/runtime/zeitgeist/src/xcm_config/asset_registry.rs @@ -20,6 +20,7 @@ use orml_traits::asset_registry::{AssetMetadata, AssetProcessor}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::DispatchError; +use zeitgeist_primitives::types::CustomMetadata; #[derive( Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen, @@ -46,49 +47,3 @@ impl AssetProcessor> for Cust Ok(()) } } - -#[derive( - Clone, - Copy, - Default, - PartialOrd, - Ord, - PartialEq, - Eq, - Debug, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, -)] -/// Custom XC asset metadata -pub struct CustomMetadata { - /// XCM-related metadata. - pub xcm: XcmMetadata, - - /// Whether an asset can be used in pools. - pub allow_in_pool: bool, -} - -#[derive( - Clone, - Copy, - Default, - PartialOrd, - Ord, - PartialEq, - Eq, - Debug, - Encode, - Decode, - TypeInfo, - MaxEncodedLen, -)] -pub struct XcmMetadata { - /// The factor used to determine the fee. - /// It is multiplied by the fee that would have been paid in native currency, so it represents - /// the ratio `native_price / other_asset_price`. It is a fixed point decimal number containing - /// as many fractional decimals as the asset it is used for contains. - /// Should be updated regularly. - pub fee_factor: Option, -} diff --git a/runtime/zeitgeist/src/xcm_config/fees.rs b/runtime/zeitgeist/src/xcm_config/fees.rs index b70484d97..dbedf3d93 100644 --- a/runtime/zeitgeist/src/xcm_config/fees.rs +++ b/runtime/zeitgeist/src/xcm_config/fees.rs @@ -1,3 +1,4 @@ +// Copyright 2021 Centrifuge Foundation (centrifuge.io). // Copyright 2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -15,11 +16,11 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{xcm_config::asset_registry::CustomMetadata, Balance, CurrencyId}; +use crate::{Balance, CurrencyId}; use core::marker::PhantomData; use frame_support::weights::constants::{ExtrinsicBaseWeight, WEIGHT_PER_SECOND}; use xcm::latest::MultiLocation; -use zeitgeist_primitives::constants::BalanceFractionalDecimals; +use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::CustomMetadata}; use zrml_swaps::check_arithm_rslt::CheckArithmRslt; /// The fee cost per second for transferring the native token in cents. diff --git a/scripts/tests/aux-functions.sh b/scripts/tests/aux-functions.sh index 5847fdd9f..95e628bba 100755 --- a/scripts/tests/aux-functions.sh +++ b/scripts/tests/aux-functions.sh @@ -13,8 +13,9 @@ check_package_with_feature() { test_package_with_feature() { local package=$1 local features=$2 + local rustflags=${3:-} /bin/echo -e "\e[0;33m***** Testing '$package' with features '$features' *****\e[0m\n" # default rustc profile dev (debug) is used to stop for debug_assertions - CARGO_INCREMENTAL=0 RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="cargo-test-%p-%m.profraw" cargo test --features $features --manifest-path $package/Cargo.toml --no-default-features + CARGO_INCREMENTAL=0 RUSTFLAGS="$rustflags" LLVM_PROFILE_FILE="cargo-test-%p-%m.profraw" cargo test --features $features --manifest-path $package/Cargo.toml --no-default-features } diff --git a/scripts/tests/misc.sh b/scripts/tests/misc.sh index 359581713..9431faf60 100755 --- a/scripts/tests/misc.sh +++ b/scripts/tests/misc.sh @@ -6,25 +6,35 @@ set -euxo pipefail . "$(dirname "$0")/aux-functions.sh" --source-only -test_package_with_feature primitives default -test_package_with_feature primitives std +if [ -z "${1:-}" ] +then + rustflags="" +else + rustflags=$1 +fi + +test_package_with_feature primitives default $rustflags +test_package_with_feature primitives std $rustflags no_runtime_benchmarks=('court' 'market-commons' 'rikiddo') cargo test --package zeitgeist-runtime --lib -- --nocapture # TODO(#848): Delete when feature "with-global-dispute" is removed -cargo test -p zrml-prediction-markets --features with-global-disputes +cargo test -p zrml-prediction-markets --features with-global-disputes,parachain + for package in zrml/* do - test_package_with_feature "$package" std + test_package_with_feature "$package" std "$rustflags" echo "TEST $package std" if [[ " ${no_runtime_benchmarks[*]} " != *" ${package##*/} "* ]]; then - test_package_with_feature "$package" std,runtime-benchmarks + test_package_with_feature "$package" std,runtime-benchmarks "$rustflags" echo "TEST $package std,runtime-benchmarks" fi done -grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --llvm --ignore '../*' --ignore "/*" -o $RUNNER_TEMP/zeitgeist-test-coverage.lcov +if [[ ! -z "$rustflags" ]]; then + grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --llvm --ignore '../*' --ignore "/*" -o $RUNNER_TEMP/zeitgeist-test-coverage.lcov +fi diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index d33cc2789..bcb064678 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -47,7 +47,7 @@ mod pallet { use zeitgeist_primitives::{ traits::{DisputeApi, DisputeResolutionApi}, types::{ - AuthorityReport, Market, MarketDispute, MarketDisputeMechanism, MarketStatus, + Asset, AuthorityReport, Market, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport, }, }; @@ -63,13 +63,13 @@ mod pallet { pub(crate) type MarketIdOf = <::MarketCommons as MarketCommonsPalletApi>::MarketId; pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; - pub type CacheSize = ConstU32<64>; pub(crate) type MarketOf = Market< ::AccountId, BalanceOf, ::BlockNumber, MomentOf, + Asset>, >; #[pallet::call] @@ -257,16 +257,16 @@ mod pallet { } #[cfg(any(feature = "runtime-benchmarks", test))] -pub(crate) fn market_mock() --> zeitgeist_primitives::types::Market, T::BlockNumber, MomentOf> +pub(crate) fn market_mock() -> MarketOf where T: crate::Config, { use frame_support::traits::Get; use sp_runtime::traits::AccountIdConversion; - use zeitgeist_primitives::types::{MarketBonds, ScoringRule}; + use zeitgeist_primitives::types::{Asset, MarketBonds, ScoringRule}; zeitgeist_primitives::types::Market { + base_asset: Asset::Ztg, creation: zeitgeist_primitives::types::MarketCreation::Permissionless, creator_fee: 0, creator: T::PalletId::get().into_account_truncating(), diff --git a/zrml/authorized/src/mock.rs b/zrml/authorized/src/mock.rs index 056e59f1e..9b57f0425 100644 --- a/zrml/authorized/src/mock.rs +++ b/zrml/authorized/src/mock.rs @@ -39,7 +39,7 @@ use zeitgeist_primitives::{ }, traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, + AccountIdTest, Asset, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, MarketId, Moment, OutcomeReport, UncheckedExtrinsicTest, }, }; @@ -83,7 +83,13 @@ impl DisputeResolutionApi for MockResolution { fn resolve( _market_id: &Self::MarketId, - _market: &Market, + _market: &Market< + Self::AccountId, + Self::Balance, + Self::BlockNumber, + Self::Moment, + Asset, + >, ) -> Result { Ok(0) } diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index c1d08183b..09671e0b1 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -66,7 +66,7 @@ mod pallet { }; use zeitgeist_primitives::{ traits::{DisputeApi, DisputeResolutionApi}, - types::{Market, MarketDispute, MarketDisputeMechanism, OutcomeReport}, + types::{Asset, Market, MarketDispute, MarketDisputeMechanism, OutcomeReport}, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -94,6 +94,7 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, + Asset>, >; #[pallet::call] diff --git a/zrml/court/src/mock.rs b/zrml/court/src/mock.rs index 11cfe03ee..42622b9a0 100644 --- a/zrml/court/src/mock.rs +++ b/zrml/court/src/mock.rs @@ -36,7 +36,7 @@ use zeitgeist_primitives::{ }, traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, + AccountIdTest, Asset, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -79,7 +79,13 @@ impl DisputeResolutionApi for NoopResolution { fn resolve( _market_id: &Self::MarketId, - _market: &Market, + _market: &Market< + Self::AccountId, + Self::Balance, + Self::BlockNumber, + Self::Moment, + Asset, + >, ) -> Result { Ok(0) } diff --git a/zrml/court/src/tests.rs b/zrml/court/src/tests.rs index c2ecc4b32..79df3d108 100644 --- a/zrml/court/src/tests.rs +++ b/zrml/court/src/tests.rs @@ -32,12 +32,13 @@ use zeitgeist_primitives::{ constants::BASE, traits::DisputeApi, types::{ - Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, - MarketStatus, MarketType, OutcomeReport, ScoringRule, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, + MarketPeriod, MarketStatus, MarketType, OutcomeReport, ScoringRule, }, }; const DEFAULT_MARKET: MarketOf = Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: 0, diff --git a/zrml/liquidity-mining/src/tests.rs b/zrml/liquidity-mining/src/tests.rs index 323172b8d..8486df344 100644 --- a/zrml/liquidity-mining/src/tests.rs +++ b/zrml/liquidity-mining/src/tests.rs @@ -31,7 +31,7 @@ use frame_support::{ }; use frame_system::RawOrigin; use zeitgeist_primitives::types::{ - Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, ScoringRule, }; use zrml_market_commons::Markets; @@ -202,6 +202,7 @@ fn create_default_market(market_id: u128, period: Range) { Markets::::insert( market_id, Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: 0, diff --git a/zrml/market-commons/src/lib.rs b/zrml/market-commons/src/lib.rs index 622032d0b..29851b11a 100644 --- a/zrml/market-commons/src/lib.rs +++ b/zrml/market-commons/src/lib.rs @@ -47,7 +47,7 @@ mod pallet { }, ArithmeticError, DispatchError, SaturatedConversion, }; - use zeitgeist_primitives::types::{Market, PoolId}; + use zeitgeist_primitives::types::{Asset, Market, PoolId}; /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(5); @@ -59,7 +59,9 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, + Asset>, >; + pub type MarketIdOf = ::MarketId; pub type MomentOf = <::Timestamp as frame_support::traits::Time>::Moment; #[pallet::call] diff --git a/zrml/market-commons/src/migrations.rs b/zrml/market-commons/src/migrations.rs index 16887b73b..69edb3f6a 100644 --- a/zrml/market-commons/src/migrations.rs +++ b/zrml/market-commons/src/migrations.rs @@ -14,3 +14,61 @@ // // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . + +// We use these utilities to prevent having to make the swaps pallet a dependency of +// prediciton-markets. The calls are based on the implementation of `StorageVersion`, found here: +// https://github.com/paritytech/substrate/blob/bc7a1e6c19aec92bfa247d8ca68ec63e07061032/frame/support/src/traits/metadata.rs#L168-L230 +// and previous migrations. +mod utility { + use alloc::vec::Vec; + use frame_support::{ + storage::{storage_prefix, unhashed}, + traits::StorageVersion, + StorageHasher, + }; + use parity_scale_codec::Encode; + + #[allow(unused)] + pub fn storage_prefix_of_market_common_pallet() -> [u8; 32] { + storage_prefix(b"MarketCommons", b":__STORAGE_VERSION__:") + } + + #[allow(unused)] + pub fn get_on_chain_storage_version_of_market_commons_pallet() -> StorageVersion { + let key = storage_prefix_of_market_common_pallet(); + unhashed::get_or_default(&key) + } + + #[allow(unused)] + pub fn put_storage_version_of_market_commons_pallet(value: u16) { + let key = storage_prefix_of_market_common_pallet(); + unhashed::put(&key, &StorageVersion::new(value)); + } + + #[allow(unused)] + const SWAPS: &[u8] = b"Swaps"; + #[allow(unused)] + const POOLS: &[u8] = b"Pools"; + #[allow(unused)] + fn storage_prefix_of_swaps_pallet() -> [u8; 32] { + storage_prefix(b"Swaps", b":__STORAGE_VERSION__:") + } + #[allow(unused)] + pub fn key_to_hash(key: K) -> Vec + where + H: StorageHasher, + K: Encode, + { + key.using_encoded(H::hash).as_ref().to_vec() + } + #[allow(unused)] + pub fn get_on_chain_storage_version_of_swaps_pallet() -> StorageVersion { + let key = storage_prefix_of_swaps_pallet(); + unhashed::get_or_default(&key) + } + #[allow(unused)] + pub fn put_storage_version_of_swaps_pallet(value: u16) { + let key = storage_prefix_of_swaps_pallet(); + unhashed::put(&key, &StorageVersion::new(value)); + } +} diff --git a/zrml/market-commons/src/tests.rs b/zrml/market-commons/src/tests.rs index f54664819..40a8cef8d 100644 --- a/zrml/market-commons/src/tests.rs +++ b/zrml/market-commons/src/tests.rs @@ -26,12 +26,14 @@ use sp_runtime::DispatchError; use zeitgeist_primitives::{ traits::MarketCommonsPalletApi, types::{ - AccountIdTest, Balance, BlockNumber, Deadlines, Market, MarketBonds, MarketCreation, - MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, Moment, ScoringRule, + AccountIdTest, Asset, Balance, BlockNumber, Deadlines, Market, MarketBonds, MarketCreation, + MarketDisputeMechanism, MarketId, MarketPeriod, MarketStatus, MarketType, Moment, + ScoringRule, }, }; -const MARKET_DUMMY: Market = Market { +const MARKET_DUMMY: Market> = Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: 0, @@ -335,7 +337,8 @@ fn market_counter_interacts_correctly_with_push_market_and_remove_market() { fn market_mock( id: AccountIdTest, -) -> zeitgeist_primitives::types::Market { +) -> zeitgeist_primitives::types::Market> +{ let mut market = MARKET_DUMMY; market.oracle = id; market diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index 3b7a59e91..397359a17 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -5,6 +5,7 @@ frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "h orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +serde = { version = "1.0.137", default-features = false, optional = true } sp-arithmetic = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } @@ -17,6 +18,7 @@ zrml-simple-disputes = { default-features = false, path = "../simple-disputes" } # Mock +orml-asset-registry = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, optional = true } orml-currencies = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } orml-tokens = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } @@ -26,6 +28,7 @@ pallet-treasury = { branch = "polkadot-v0.9.26", git = "https://github.com/parit sp-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } substrate-fixed = { optional = true, git = "https://github.com/encointer/substrate-fixed" } +xcm = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true, default-features = false } zrml-prediction-markets-runtime-api = { features = ["std"], optional = true, path = "./runtime-api" } zrml-rikiddo = { optional = true, path = "../rikiddo" } zrml-swaps = { optional = true, path = "../swaps" } @@ -44,6 +47,7 @@ mock = [ "pallet-randomness-collective-flip", "pallet-timestamp/std", "pallet-treasury", + "serde", "sp-api", "sp-io", "substrate-fixed", @@ -51,7 +55,10 @@ mock = [ "zrml-prediction-markets-runtime-api", "zrml-rikiddo", "zrml-swaps", + "xcm", + "orml-asset-registry", ] +parachain = [] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", @@ -64,7 +71,9 @@ std = [ "frame-support/std", "frame-system/std", "orml-traits/std", + "orml-asset-registry?/std", "parity-scale-codec/std", + "serde?/std", "sp-arithmetic/std", "sp-runtime/std", "zeitgeist-primitives/std", @@ -74,6 +83,7 @@ std = [ "zrml-market-commons/std", "zrml-simple-disputes/std", "zrml-global-disputes?/std", + "xcm?/std", ] try-runtime = [ "frame-support/try-runtime", diff --git a/zrml/prediction-markets/fuzz/pm_full_workflow.rs b/zrml/prediction-markets/fuzz/pm_full_workflow.rs index e6025f9f5..0ca237096 100644 --- a/zrml/prediction-markets/fuzz/pm_full_workflow.rs +++ b/zrml/prediction-markets/fuzz/pm_full_workflow.rs @@ -22,7 +22,7 @@ use core::ops::{Range, RangeInclusive}; use frame_support::traits::Hooks; use libfuzzer_sys::fuzz_target; use zeitgeist_primitives::types::{ - Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketType, MultiHash, + Asset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketType, MultiHash, OutcomeReport, ScoringRule, }; use zrml_prediction_markets::mock::{ExtBuilder, Origin, PredictionMarkets, System}; @@ -40,6 +40,7 @@ fuzz_target!(|data: Data| { }; let _ = PredictionMarkets::create_market( Origin::signed(data.create_scalar_market_origin.into()), + Asset::Ztg, data.create_scalar_market_oracle.into(), MarketPeriod::Block(data.create_scalar_market_period), deadlines, diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index efac65a47..f6e0cebe4 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -90,6 +90,7 @@ fn create_market_common( let (caller, oracle, deadlines, metadata, creation) = create_market_common_parameters::(permission)?; Call::::create_market { + base_asset: Asset::Ztg, oracle, period, deadlines, @@ -616,6 +617,7 @@ benchmarks! { } }: _( RawOrigin::Signed(caller), + Asset::Ztg, oracle, period, deadlines, @@ -638,6 +640,7 @@ benchmarks! { let (caller, oracle, deadlines, metadata, creation) = create_market_common_parameters::(MarketCreation::Advised)?; Call::::create_market { + base_asset: Asset::Ztg, oracle: oracle.clone(), period: period.clone(), deadlines, @@ -668,6 +671,7 @@ benchmarks! { }; }: _( RawOrigin::Signed(caller), + Asset::Ztg, market_id, oracle, period, diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index e988338c9..77512db98 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -24,6 +24,7 @@ extern crate alloc; mod benchmarks; pub mod migrations; pub mod mock; +pub mod orml_asset_registry; mod tests; pub mod weights; @@ -48,6 +49,10 @@ mod pallet { Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; + + #[cfg(feature = "parachain")] + use {orml_traits::asset_registry::Inspect, zeitgeist_primitives::types::CustomMetadata}; + use orml_traits::{MultiCurrency, NamedMultiReservableCurrency}; use sp_arithmetic::per_things::{Perbill, Percent}; use sp_runtime::{ @@ -87,6 +92,7 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, + Asset>, >; pub type CacheSize = ConstU32<64>; pub type EditReason = BoundedVec::MaxEditReasonLen>; @@ -246,9 +252,9 @@ mod pallet { // NOTE: Currently we don't clean up outcome assets. // TODO(#792): Remove outcome assets for accounts! Delete "resolved" assets of `orml_tokens` with storage migration. T::AssetManager::slash( - Asset::Ztg, + market.base_asset, &market_account, - T::AssetManager::free_balance(Asset::Ztg, &market_account), + T::AssetManager::free_balance(market.base_asset, &market_account), ); let mut category_count = 0u32; if let Ok(pool_id) = >::market_pool(&market_id) { @@ -615,6 +621,7 @@ mod pallet { #[transactional] pub fn create_cpmm_market_and_deploy_assets( origin: OriginFor, + base_asset: Asset>, oracle: T::AccountId, period: MarketPeriod>, deadlines: Deadlines, @@ -629,6 +636,7 @@ mod pallet { let create_market_weight = Self::create_market( origin.clone(), + base_asset, oracle, period, deadlines, @@ -666,6 +674,7 @@ mod pallet { #[transactional] pub fn create_market( origin: OriginFor, + base_asset: Asset>, oracle: T::AccountId, period: MarketPeriod>, deadlines: Deadlines, @@ -690,6 +699,7 @@ mod pallet { }; let market = Self::construct_market( + base_asset, sender.clone(), 0_u8, oracle, @@ -750,6 +760,7 @@ mod pallet { #[transactional] pub fn edit_market( origin: OriginFor, + base_asset: Asset>, market_id: MarketIdOf, oracle: T::AccountId, period: MarketPeriod>, @@ -771,6 +782,7 @@ mod pallet { Self::clear_auto_close(&market_id)?; let edited_market = Self::construct_market( + base_asset, old_market.creator, old_market.creator_fee, oracle, @@ -900,8 +912,7 @@ mod pallet { // this could stall the chain, because a malicious user puts a large vector in ensure!(weights.len() == assets.len(), Error::::WeightsLenMustEqualAssetsLen); - let base_asset = Asset::Ztg; - assets.push(base_asset); + assets.push(market.base_asset); let base_asset_weight = weights.iter().fold(0u128, |acc, val| acc.saturating_add(*val)); weights.push(base_asset_weight); @@ -909,7 +920,7 @@ mod pallet { let pool_id = T::Swaps::create_pool( sender, assets, - base_asset, + market.base_asset, market_id, ScoringRule::CPMM, Some(swap_fee), @@ -1009,7 +1020,7 @@ mod pallet { // Ensure the market account has enough to pay out - if this is // ever not true then we have an accounting problem. ensure!( - T::AssetManager::free_balance(Asset::Ztg, &market_account) + T::AssetManager::free_balance(market.base_asset, &market_account) >= winning_balance, Error::::InsufficientFundsInMarketAccount, ); @@ -1063,7 +1074,7 @@ mod pallet { // Ensure the market account has enough to pay out - if this is // ever not true then we have an accounting problem. ensure!( - T::AssetManager::free_balance(Asset::Ztg, &market_account) + T::AssetManager::free_balance(market.base_asset, &market_account) >= long_payout.saturating_add(short_payout), Error::::InsufficientFundsInMarketAccount, ); @@ -1080,10 +1091,16 @@ mod pallet { T::AssetManager::slash(currency_id, &sender, balance); // Pay out the winner. - let remaining_bal = T::AssetManager::free_balance(Asset::Ztg, &market_account); + let remaining_bal = + T::AssetManager::free_balance(market.base_asset, &market_account); let actual_payout = payout.min(remaining_bal); - T::AssetManager::transfer(Asset::Ztg, &market_account, &sender, actual_payout)?; + T::AssetManager::transfer( + market.base_asset, + &market_account, + &sender, + actual_payout, + )?; // The if-check prevents scalar markets to emit events even if sender only owns one // of the outcome tokens. if balance != >::zero() { @@ -1269,7 +1286,7 @@ mod pallet { let market_account = >::market_account(market_id); ensure!( - T::AssetManager::free_balance(Asset::Ztg, &market_account) >= amount, + T::AssetManager::free_balance(market.base_asset, &market_account) >= amount, "Market account does not have sufficient reserves.", ); @@ -1290,7 +1307,7 @@ mod pallet { T::AssetManager::slash(*asset, &sender, amount); } - T::AssetManager::transfer(Asset::Ztg, &market_account, &sender, amount)?; + T::AssetManager::transfer(market.base_asset, &market_account, &sender, amount)?; Self::deposit_event(Event::SoldCompleteSet(market_id, amount, sender)); let assets_len: u32 = assets.len().saturated_into(); @@ -1408,6 +1425,13 @@ mod pallet { ReserveIdentifier = [u8; 8], >; + #[cfg(feature = "parachain")] + type AssetRegistry: Inspect< + AssetId = Asset>, + Balance = BalanceOf, + CustomMetadata = CustomMetadata, + >; + /// See [`zrml_authorized::AuthorizedPalletApi`]. type Authorized: zrml_authorized::AuthorizedPalletApi< AccountId = Self::AccountId, @@ -1661,6 +1685,10 @@ mod pallet { WeightsLenMustEqualAssetsLen, /// The start of the global dispute for this market happened already. GlobalDisputeAlreadyStarted, + /// Provided base_asset is not allowed to be used as base_asset. + InvalidBaseAsset, + /// A foreign asset in not registered in AssetRegistry. + UnregisteredForeignAsset, } #[pallet::event] @@ -2080,17 +2108,16 @@ mod pallet { amount: BalanceOf, ) -> DispatchResultWithPostInfo { ensure!(amount != BalanceOf::::zero(), Error::::ZeroAmount); + let market = >::market(&market_id)?; ensure!( - T::AssetManager::free_balance(Asset::Ztg, &who) >= amount, + T::AssetManager::free_balance(market.base_asset, &who) >= amount, Error::::NotEnoughBalance ); - - let market = >::market(&market_id)?; ensure!(market.scoring_rule == ScoringRule::CPMM, Error::::InvalidScoringRule); Self::ensure_market_is_active(&market)?; let market_account = >::market_account(market_id); - T::AssetManager::transfer(Asset::Ztg, &who, &market_account, amount)?; + T::AssetManager::transfer(market.base_asset, &who, &market_account, amount)?; let assets = Self::outcome_assets(market_id, &market); for asset in assets.iter() { @@ -2766,14 +2793,13 @@ mod pallet { ); let mut assets = Self::outcome_assets(market_id, market); - let base_asset = Asset::Ztg; - assets.push(base_asset); + assets.push(market.base_asset); let total_assets = assets.len(); let pool_id = T::Swaps::create_pool( market.creator.clone(), assets, - base_asset, + market.base_asset, market_id, market.scoring_rule, None, @@ -2806,6 +2832,7 @@ mod pallet { } fn construct_market( + base_asset: Asset>, creator: T::AccountId, creator_fee: u8, oracle: T::AccountId, @@ -2820,6 +2847,20 @@ mod pallet { resolved_outcome: Option, bonds: MarketBonds>, ) -> Result, DispatchError> { + let valid_base_asset = match base_asset { + Asset::Ztg => true, + #[cfg(feature = "parachain")] + Asset::ForeignAsset(fa) => { + if let Some(metadata) = T::AssetRegistry::metadata(&Asset::ForeignAsset(fa)) { + metadata.additional.allow_as_base_asset + } else { + return Err(Error::::UnregisteredForeignAsset.into()); + } + } + _ => false, + }; + + ensure!(valid_base_asset, Error::::InvalidBaseAsset); let MultiHash::Sha3_384(multihash) = metadata; ensure!(multihash[0] == 0x15 && multihash[1] == 0x30, >::InvalidMultihash); Self::ensure_market_period_is_valid(&period)?; @@ -2837,6 +2878,7 @@ mod pallet { MarketCreation::Advised => MarketStatus::Proposed, }; Ok(Market { + base_asset, creation, creator_fee, creator, @@ -2893,10 +2935,7 @@ mod pallet { type MaxDisputes = T::MaxDisputes; type Moment = MomentOf; - fn resolve( - market_id: &Self::MarketId, - market: &Market, - ) -> Result { + fn resolve(market_id: &Self::MarketId, market: &MarketOf) -> Result { Self::on_resolution(market_id, market) } diff --git a/zrml/prediction-markets/src/migrations.rs b/zrml/prediction-markets/src/migrations.rs index 618ebcf94..387d6236f 100644 --- a/zrml/prediction-markets/src/migrations.rs +++ b/zrml/prediction-markets/src/migrations.rs @@ -34,8 +34,8 @@ use frame_support::{ use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use zeitgeist_primitives::types::{ - Bond, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, - MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, + Asset, Bond, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, + MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, }; use zrml_market_commons::{MarketCommonsPalletApi, Pallet as MarketCommonsPallet}; @@ -67,21 +67,24 @@ type OldMarketOf = OldMarket< MomentOf, >; -pub struct RecordBonds(PhantomData); +pub struct UpdateMarketsForBaseAssetAndRecordBonds(PhantomData); -impl OnRuntimeUpgrade for RecordBonds { +impl OnRuntimeUpgrade + for UpdateMarketsForBaseAssetAndRecordBonds +{ fn on_runtime_upgrade() -> Weight { let mut total_weight = T::DbWeight::get().reads(1); let market_commons_version = StorageVersion::get::>(); if market_commons_version != MARKET_COMMONS_REQUIRED_STORAGE_VERSION { log::info!( - "RecordBonds: market-commons version is {:?}, but {:?} is required", + "UpdateMarketsForBaseAssetAndRecordBonds: market-commons version is {:?}, but \ + {:?} is required", market_commons_version, MARKET_COMMONS_REQUIRED_STORAGE_VERSION, ); return total_weight; } - log::info!("RecordBonds: Starting..."); + log::info!("UpdateMarketsForBaseAssetAndRecordBonds: Starting..."); let new_markets = storage_iter::>(MARKET_COMMONS, MARKETS) .map(|(key, old_market)| { @@ -110,6 +113,7 @@ impl OnRuntimeUpgrade for RecordBonds OnRuntimeUpgrade for RecordBonds>(); total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - log::info!("RecordBonds: Done!"); + log::info!("UpdateMarketsForBaseAssetAndRecordBonds: Done!"); total_weight } @@ -163,6 +167,13 @@ impl OnRuntimeUpgrade for RecordBonds::on_runtime_upgrade(); + UpdateMarketsForBaseAssetAndRecordBonds::::on_runtime_upgrade(); assert_eq!( StorageVersion::get::>(), MARKET_COMMONS_NEXT_STORAGE_VERSION @@ -221,7 +232,7 @@ mod tests { MARKETS, new_markets.clone(), ); - RecordBonds::::on_runtime_upgrade(); + UpdateMarketsForBaseAssetAndRecordBonds::::on_runtime_upgrade(); for (market_id, expected) in new_markets.iter().enumerate() { let actual = >::market(&(market_id as u128)).unwrap(); @@ -242,12 +253,16 @@ mod tests { MARKETS, old_markets, ); - RecordBonds::::on_runtime_upgrade(); + UpdateMarketsForBaseAssetAndRecordBonds::::on_runtime_upgrade(); for (market_id, expected) in new_markets.iter().enumerate() { let actual = >::market(&(market_id as u128)).unwrap(); assert_eq!(actual, *expected); } + assert_eq!( + StorageVersion::get::>(), + MARKET_COMMONS_NEXT_STORAGE_VERSION + ); }); } @@ -259,6 +274,7 @@ mod tests { fn construct_test_vector() -> Vec<(OldMarketOf, MarketOf)> { let creator = 999; let construct_markets = |creation: MarketCreation, status, bonds| { + let base_asset = Asset::Ztg; let creator_fee = 1; let oracle = 2; let metadata = vec![3, 4, 5]; @@ -286,6 +302,7 @@ mod tests { deadlines, }; let new_market = Market { + base_asset, creator, creation, creator_fee, @@ -674,8 +691,10 @@ mod tests_authorized { StorageVersion::new(AUTHORIZED_REQUIRED_STORAGE_VERSION).put::>(); } - fn get_sample_market() -> zeitgeist_primitives::types::Market { + fn get_sample_market() -> zeitgeist_primitives::types::Market> + { zeitgeist_primitives::types::Market { + base_asset: Asset::Ztg, creation: zeitgeist_primitives::types::MarketCreation::Permissionless, creator_fee: 0, creator: ALICE, diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index c9668cce8..7c77a017a 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -27,6 +27,8 @@ use frame_support::{ traits::{Everything, NeverEnsureOrigin, OnFinalize, OnInitialize}, }; use frame_system::EnsureSignedBy; +#[cfg(feature = "parachain")] +use orml_asset_registry::AssetMetadata; use sp_arithmetic::per_things::Percent; use sp_runtime::{ testing::Header, @@ -138,6 +140,8 @@ impl crate::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; + #[cfg(feature = "parachain")] + type AssetRegistry = MockRegistry; type Authorized = Authorized; type CloseOrigin = EnsureSignedBy; type Court = Court; @@ -226,6 +230,14 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); } +#[cfg(feature = "parachain")] +crate::orml_asset_registry::impl_mock_registry! { + MockRegistry, + CurrencyId, + Balance, + zeitgeist_primitives::types::CustomMetadata +} + impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; @@ -396,7 +408,51 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.balances } .assimilate_storage(&mut t) .unwrap(); - + #[cfg(feature = "parachain")] + use frame_support::traits::GenesisBuild; + #[cfg(feature = "parachain")] + orml_tokens::GenesisConfig:: { + balances: (0..69) + .into_iter() + .map(|idx| (idx, CurrencyId::ForeignAsset(100), INITIAL_BALANCE)) + .collect(), + } + .assimilate_storage(&mut t) + .unwrap(); + #[cfg(feature = "parachain")] + let custom_metadata = zeitgeist_primitives::types::CustomMetadata { + allow_as_base_asset: true, + ..Default::default() + }; + #[cfg(feature = "parachain")] + orml_asset_registry_mock::GenesisConfig { + metadata: vec![ + ( + CurrencyId::ForeignAsset(100), + AssetMetadata { + decimals: 18, + name: "ACALA USD".as_bytes().to_vec(), + symbol: "AUSD".as_bytes().to_vec(), + existential_deposit: 0, + location: None, + additional: custom_metadata, + }, + ), + ( + CurrencyId::ForeignAsset(420), + AssetMetadata { + decimals: 18, + name: "FANCY_TOKEN".as_bytes().to_vec(), + symbol: "FTK".as_bytes().to_vec(), + existential_deposit: 0, + location: None, + additional: zeitgeist_primitives::types::CustomMetadata::default(), + }, + ), + ], + } + .assimilate_storage(&mut t) + .unwrap(); t.into() } } diff --git a/zrml/prediction-markets/src/orml_asset_registry.rs b/zrml/prediction-markets/src/orml_asset_registry.rs new file mode 100644 index 000000000..6b277518e --- /dev/null +++ b/zrml/prediction-markets/src/orml_asset_registry.rs @@ -0,0 +1,257 @@ +// Copyright 2022 Forecasting Technologies Ltd. +// Copyright 2021 Centrifuge Foundation (centrifuge.io). +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, 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. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +#![cfg(all(feature = "mock", feature = "parachain"))] + +#[macro_export] +macro_rules! impl_mock_registry { + ($name:ident, $asset_id:ty, $balance:ty, $custom_metadata:ty) => { + pub use orml_asset_registry_mock::$name; + + mod orml_asset_registry_mock { + use frame_support::{ + dispatch::{DispatchError, DispatchResult}, + traits::GenesisBuild, + }; + use orml_traits::asset_registry::{AssetMetadata, Inspect, Mutate}; + use xcm::{latest::prelude::MultiLocation, VersionedMultiLocation}; + + use super::*; + + pub struct $name; + + impl Inspect for $name { + type AssetId = $asset_id; + type Balance = $balance; + type CustomMetadata = $custom_metadata; + + fn asset_id(location: &MultiLocation) -> Option { + __private::STATE.with(|s| s.borrow().get_asset_from_location(location)) + } + + fn metadata( + asset_id: &Self::AssetId, + ) -> Option> { + __private::STATE.with(|s| s.borrow().get_meta(asset_id)) + } + + fn metadata_by_location( + location: &MultiLocation, + ) -> Option> { + __private::STATE.with(|s| s.borrow().get_meta_from_location(location)) + } + + fn location( + asset_id: &Self::AssetId, + ) -> Result, DispatchError> { + let maybe_location = + __private::STATE.with(|s| s.borrow().get_location(asset_id)); + + Ok(maybe_location) + } + } + + impl Mutate for $name { + fn register_asset( + asset_id: Option, + metadata: AssetMetadata, + ) -> DispatchResult { + if let Some(asset_id) = asset_id { + __private::STATE.with(|s| s.borrow_mut().insert_meta(&asset_id, metadata)) + } else { + Err(DispatchError::Other("Mock can only register metadata with asset_id")) + } + } + + fn update_asset( + asset_id: Self::AssetId, + decimals: Option, + name: Option>, + symbol: Option>, + existential_deposit: Option, + location: Option>, + additional: Option, + ) -> DispatchResult { + __private::STATE.with(|s| { + s.borrow_mut().update_asset( + asset_id, + decimals, + name, + symbol, + existential_deposit, + location, + additional, + ) + }) + } + } + + #[derive(Default)] + pub struct GenesisConfig { + pub metadata: Vec<($asset_id, AssetMetadata<$balance, $custom_metadata>)>, + } + + use serde::{ + de::{Deserialize, Deserializer}, + ser::{Serialize, SerializeStruct, Serializer}, + }; + + impl GenesisBuild<()> for GenesisConfig { + fn build(&self) { + for (asset, metadata) in &self.metadata { + __private::STATE + .with(|s| s.borrow_mut().insert_meta(asset, metadata.clone())) + .expect("Genesis must not fail") + } + } + } + + // NOTE: We need this dummy impl as `AssetMetadata` does NOT derive + // serialize in std + impl Serialize for GenesisConfig { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let state = serializer.serialize_struct("GenesisConfig", 1)?; + state.end() + } + } + + // NOTE: We need this dummy impl as `AssetMetadata` does NOT derive + // deserialize in std + impl<'de> Deserialize<'de> for GenesisConfig { + fn deserialize(_deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Ok(GenesisConfig::default()) + } + } + + mod __private { + use std::{cell::RefCell, vec::Vec}; + + use super::*; + + // TODO(#936): This will not be required post polkadot v0.9.29 upgrade. + pub struct RegistryState { + pub location_to_asset: Vec<(MultiLocation, $asset_id)>, + pub metadata: Vec<($asset_id, AssetMetadata<$balance, $custom_metadata>)>, + } + + impl RegistryState { + pub fn get_meta( + &self, + asset_id: &$asset_id, + ) -> Option> { + for (curr_id, meta) in &self.metadata { + if curr_id == asset_id { + return Some(meta.clone()); + } + } + + None + } + + pub fn insert_meta( + &mut self, + asset_id: &$asset_id, + meta: AssetMetadata<$balance, $custom_metadata>, + ) -> DispatchResult { + for (curr_id, curr_meta) in &mut self.metadata { + if curr_id == asset_id { + *curr_meta = meta; + return Ok(()); + } + } + + self.metadata.push((asset_id.clone(), meta)); + Ok(()) + } + + pub fn get_location(&self, asset_id: &$asset_id) -> Option { + for (curr_id, meta) in &self.metadata { + if curr_id == asset_id { + return meta + .location + .as_ref() + .map(|versioned| versioned.clone().try_into().ok()) + .flatten(); + } + } + + None + } + + pub fn get_asset_from_location( + &self, + location: &MultiLocation, + ) -> Option<$asset_id> { + for (curr_location, asset_id) in &self.location_to_asset { + if curr_location == location { + return Some(asset_id.clone()); + } + } + + None + } + + pub fn get_meta_from_location( + &self, + location: &MultiLocation, + ) -> Option> { + let asset_id = self.get_asset_from_location(location)?; + self.get_meta(&asset_id) + } + + pub fn update_asset( + &mut self, + asset_id: $asset_id, + _decimals: Option, + _name: Option>, + _symbol: Option>, + _existential_deposit: Option<$balance>, + _location: Option>, + _additional: Option<$custom_metadata>, + ) -> DispatchResult { + if let Some(_meta) = self.get_meta(&asset_id) { + Ok(()) + } else { + Err(DispatchError::Other("Asset not registered")) + } + } + } + + impl RegistryState { + fn new() -> Self { + Self { location_to_asset: Vec::new(), metadata: Vec::new() } + } + } + + thread_local! { + pub static STATE: RefCell< + RegistryState, + > = RefCell::new(RegistryState::new()); + } + } + } + }; +} + +pub use impl_mock_registry; diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 7e44f60d4..fe5d8da83 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -31,15 +31,15 @@ use frame_support::{ }; use test_case::test_case; -use orml_traits::MultiCurrency; +use orml_traits::{MultiCurrency, MultiReservableCurrency}; use sp_runtime::traits::{AccountIdConversion, SaturatedConversion, Zero}; use zeitgeist_primitives::{ constants::mock::{DisputeFactor, BASE, CENT, MILLISECS_PER_BLOCK}, traits::Swaps as SwapsPalletApi, types::{ AccountIdTest, Asset, Balance, BlockNumber, Bond, Deadlines, Market, MarketBonds, - MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, Moment, - MultiHash, OutcomeReport, PoolStatus, ScalarPosition, ScoringRule, + MarketCreation, MarketDisputeMechanism, MarketId, MarketPeriod, MarketStatus, MarketType, + Moment, MultiHash, OutcomeReport, PoolStatus, ScalarPosition, ScoringRule, }, }; use zrml_authorized::Error as AuthorizedError; @@ -64,12 +64,14 @@ fn gen_metadata(byte: u8) -> MultiHash { } fn simple_create_categorical_market( + base_asset: Asset, creation: MarketCreation, period: Range, scoring_rule: ScoringRule, ) { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(period), get_deadlines(), @@ -82,12 +84,14 @@ fn simple_create_categorical_market( } fn simple_create_scalar_market( + base_asset: Asset, creation: MarketCreation, period: Range, scoring_rule: ScoringRule, ) { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(period), get_deadlines(), @@ -103,7 +107,12 @@ fn simple_create_scalar_market( fn admin_move_market_to_closed_successfully_closes_market() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - simple_create_categorical_market(MarketCreation::Permissionless, 0..2, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..2, + ScoringRule::CPMM, + ); let market_id = 0; assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id)); let market = MarketCommons::market(&market_id).unwrap(); @@ -131,7 +140,12 @@ fn admin_move_market_to_closed_fails_if_market_does_not_exist() { #[test_case(MarketStatus::InsufficientSubsidy; "insufficient subsidy")] fn admin_move_market_to_closed_fails_if_market_is_not_active(market_status: MarketStatus) { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); let market_id = 0; assert_ok!(MarketCommons::mutate_market(&market_id, |market| { market.status = market_status; @@ -139,7 +153,7 @@ fn admin_move_market_to_closed_fails_if_market_is_not_active(market_status: Mark })); assert_noop!( PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id), - crate::Error::::MarketIsNotActive, + Error::::MarketIsNotActive, ); }); } @@ -150,6 +164,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(22..66), get_deadlines(), @@ -162,6 +177,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(33..66), get_deadlines(), @@ -174,6 +190,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(22..33), get_deadlines(), @@ -203,6 +220,7 @@ fn create_scalar_market_fails_on_invalid_range(range: RangeInclusive) { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(123..456), get_deadlines(), @@ -212,7 +230,7 @@ fn create_scalar_market_fails_on_invalid_range(range: RangeInclusive) { MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, ), - crate::Error::::InvalidOutcomeRange + Error::::InvalidOutcomeRange ); }); } @@ -228,6 +246,7 @@ fn create_market_fails_on_min_dispute_period() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(123..456), deadlines, @@ -237,7 +256,7 @@ fn create_market_fails_on_min_dispute_period() { MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, ), - crate::Error::::DisputeDurationSmallerThanMinDisputeDuration + Error::::DisputeDurationSmallerThanMinDisputeDuration ); }); } @@ -253,6 +272,7 @@ fn create_market_fails_on_min_oracle_duration() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(123..456), deadlines, @@ -262,7 +282,7 @@ fn create_market_fails_on_min_oracle_duration() { MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, ), - crate::Error::::OracleDurationSmallerThanMinOracleDuration + Error::::OracleDurationSmallerThanMinOracleDuration ); }); } @@ -278,6 +298,7 @@ fn create_market_fails_on_max_dispute_period() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(123..456), deadlines, @@ -287,7 +308,7 @@ fn create_market_fails_on_max_dispute_period() { MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, ), - crate::Error::::DisputeDurationGreaterThanMaxDisputeDuration + Error::::DisputeDurationGreaterThanMaxDisputeDuration ); }); } @@ -303,6 +324,7 @@ fn create_market_fails_on_max_grace_period() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(123..456), deadlines, @@ -312,7 +334,7 @@ fn create_market_fails_on_max_grace_period() { MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, ), - crate::Error::::GracePeriodGreaterThanMaxGracePeriod + Error::::GracePeriodGreaterThanMaxGracePeriod ); }); } @@ -328,6 +350,7 @@ fn create_market_fails_on_max_oracle_duration() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(123..456), deadlines, @@ -337,15 +360,82 @@ fn create_market_fails_on_max_oracle_duration() { MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, ), - crate::Error::::OracleDurationGreaterThanMaxOracleDuration + Error::::OracleDurationGreaterThanMaxOracleDuration ); }); } +#[cfg(feature = "parachain")] #[test] -fn admin_destroy_market_correctly_slashes_permissionless_market_active() { +fn create_market_with_foreign_assets() { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..2, ScoringRule::CPMM); + let deadlines = Deadlines { + grace_period: ::MaxGracePeriod::get(), + oracle_duration: ::MaxOracleDuration::get(), + dispute_duration: ::MaxDisputeDuration::get(), + }; + + // As per Mock asset_registry genesis ForeignAsset(420) has allow_as_base_asset set to false. + + assert_noop!( + PredictionMarkets::create_market( + Origin::signed(ALICE), + Asset::ForeignAsset(420), + BOB, + MarketPeriod::Block(123..456), + deadlines, + gen_metadata(2), + MarketCreation::Permissionless, + MarketType::Categorical(2), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM, + ), + Error::::InvalidBaseAsset, + ); + // As per Mock asset_registry genesis ForeignAsset(50) is not registered in asset_registry. + assert_noop!( + PredictionMarkets::create_market( + Origin::signed(ALICE), + Asset::ForeignAsset(50), + BOB, + MarketPeriod::Block(123..456), + deadlines, + gen_metadata(2), + MarketCreation::Permissionless, + MarketType::Categorical(2), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM, + ), + Error::::UnregisteredForeignAsset, + ); + // As per Mock asset_registry genesis ForeignAsset(100) has allow_as_base_asset set to true. + assert_ok!(PredictionMarkets::create_market( + Origin::signed(ALICE), + Asset::ForeignAsset(100), + BOB, + MarketPeriod::Block(123..456), + deadlines, + gen_metadata(2), + MarketCreation::Permissionless, + MarketType::Categorical(2), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM, + )); + let market = MarketCommons::market(&0).unwrap(); + assert_eq!(market.base_asset, Asset::ForeignAsset(100)); + }); +} + +#[test] +fn admin_destroy_market_correctly_slashes_permissionless_market_active() { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..2, + ScoringRule::CPMM, + ); assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named( &PredictionMarkets::reserve_id(), @@ -360,14 +450,27 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_active() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_permissionless_market_reported() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2_u64; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); run_to_block(end + market.deadlines.grace_period); assert_ok!(PredictionMarkets::report( @@ -389,14 +492,27 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_reported() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; assert_ne!(grace_period, 0); @@ -426,6 +542,13 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -433,7 +556,12 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { fn admin_destroy_market_correctly_unreserves_dispute_bonds() { ExtBuilder::default().build().execute_with(|| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market_id = 0; let market = MarketCommons::market(&market_id).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -491,9 +619,15 @@ fn admin_destroy_market_correctly_unreserves_dispute_bonds() { #[test] fn admin_destroy_market_correctly_slashes_permissionless_market_resolved() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -518,13 +652,26 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_resolved() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_advised_market_proposed() { - ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named( &PredictionMarkets::reserve_id(), @@ -539,13 +686,26 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_advised_market_proposed_with_edit_request() { - ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named( &PredictionMarkets::reserve_id(), @@ -568,13 +728,26 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed_with_edit_requ let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); assert!(!MarketIdsForEdit::::contains_key(0)); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_advised_market_active() { - ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named( @@ -590,14 +763,27 @@ fn admin_destroy_market_correctly_slashes_advised_market_active() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_advised_market_reported() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Advised, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -621,14 +807,27 @@ fn admin_destroy_market_correctly_slashes_advised_market_reported() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_advised_market_disputed() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Advised, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -657,14 +856,27 @@ fn admin_destroy_market_correctly_slashes_advised_market_disputed() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_destroy_market_correctly_slashes_advised_market_resolved() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Advised, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -690,22 +902,34 @@ fn admin_destroy_market_correctly_slashes_advised_market_resolved() { ); let balance_free_after_alice = Balances::free_balance(&ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } - #[test] fn admin_destroy_market_correctly_cleans_up_accounts() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { + let alice_ztg_before_market_creation = AssetManager::free_balance(Asset::Ztg, &ALICE); + let alice_base_asset_before_market_creation = + AssetManager::free_balance(base_asset, &ALICE); + let swap_fee = ::MaxSwapFee::get(); + let min_liquidity = ::MinLiquidity::get(); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + base_asset, ALICE, MarketPeriod::Block(0..42), get_deadlines(), gen_metadata(50), MarketType::Categorical(3), MarketDisputeMechanism::SimpleDisputes, - ::MaxSwapFee::get(), - ::MinLiquidity::get(), + swap_fee, + min_liquidity, vec![::MinWeight::get(); 3], )); // Buy some outcome tokens for Alice so that we can check that they get destroyed. @@ -714,17 +938,45 @@ fn admin_destroy_market_correctly_cleans_up_accounts() { let pool_id = 0; let pool_account = Swaps::pool_account_id(&pool_id); let market_account = MarketCommons::market_account(market_id); - let alice_ztg_before = AssetManager::free_balance(Asset::Ztg, &ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 0), &pool_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 1), &pool_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 2), &pool_account), 0); - assert_eq!(AssetManager::free_balance(Asset::Ztg, &pool_account), 0); + assert_eq!(AssetManager::free_balance(base_asset, &pool_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 0), &market_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 1), &market_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 2), &market_account), 0); - assert_eq!(AssetManager::free_balance(Asset::Ztg, &market_account), 0); - assert_eq!(AssetManager::free_balance(Asset::Ztg, &ALICE), alice_ztg_before); + assert_eq!(AssetManager::free_balance(base_asset, &market_account), 0); + // premissionless market so using ValidityBond + let creation_bond = ::ValidityBond::get(); + let oracle_bond = ::OracleBond::get(); + // substract min_liquidity twice, one for buy_complete_set() in + // create_cpmm_market_and_deploy_assets() and one in swaps::create_pool() + // then again substract BASE as buy_complete_set() above + let expected_base_asset_value = + alice_base_asset_before_market_creation - min_liquidity - min_liquidity - BASE; + if base_asset == Asset::Ztg { + let alice_base_asset_balance = AssetManager::free_balance(base_asset, &ALICE); + assert_eq!( + alice_base_asset_balance, + expected_base_asset_value - creation_bond - oracle_bond + ); + } else { + let alice_base_asset_balance = AssetManager::free_balance(base_asset, &ALICE); + assert_eq!(alice_base_asset_balance, expected_base_asset_value); + let alice_ztg_balance = AssetManager::free_balance(Asset::Ztg, &ALICE); + assert_eq!( + alice_ztg_balance, + alice_ztg_before_market_creation - creation_bond - oracle_bond + ); + } + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -734,6 +986,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(22..66), get_deadlines(), @@ -746,6 +999,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(33..66), get_deadlines(), @@ -758,6 +1012,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(22..33), get_deadlines(), @@ -782,9 +1037,15 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { #[test] fn admin_move_market_to_resolved_resolves_reported_market() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 33; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market_id = 0; // Give ALICE `SENTINEL_AMOUNT` free and reserved ZTG; we record the free balance to check @@ -834,6 +1095,13 @@ fn admin_move_market_to_resolved_resolves_reported_market() { + ::OracleBond::get() + ::ValidityBond::get() ); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -845,7 +1113,12 @@ fn admin_move_market_to_resovled_fails_if_market_is_not_reported_or_disputed( market_status: MarketStatus, ) { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..33, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..33, + ScoringRule::CPMM, + ); let market_id = 0; assert_ok!(MarketCommons::mutate_market(&market_id, |market| { market.status = market_status; @@ -853,7 +1126,7 @@ fn admin_move_market_to_resovled_fails_if_market_is_not_reported_or_disputed( })); assert_noop!( PredictionMarkets::admin_move_market_to_resolved(Origin::signed(SUDO), market_id,), - crate::Error::::InvalidMarketStatus, + Error::::InvalidMarketStatus, ); }); } @@ -861,14 +1134,24 @@ fn admin_move_market_to_resovled_fails_if_market_is_not_reported_or_disputed( #[test] fn it_creates_binary_markets() { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..2, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..2, + ScoringRule::CPMM, + ); // check the correct amount was reserved let alice_reserved = Balances::reserved_balance(&ALICE); assert_eq!(alice_reserved, ValidityBond::get() + OracleBond::get()); // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..2, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..2, + ScoringRule::CPMM, + ); let new_alice_reserved = Balances::reserved_balance(&ALICE); assert_eq!(new_alice_reserved, AdvisoryBond::get() + OracleBond::get() + alice_reserved); @@ -883,7 +1166,12 @@ fn it_creates_binary_markets() { fn create_categorical_market_deposits_the_correct_event() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - simple_create_categorical_market(MarketCreation::Permissionless, 1..2, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 1..2, + ScoringRule::CPMM, + ); let market_id = 0; let market = MarketCommons::market(&market_id).unwrap(); let market_account = MarketCommons::market_account(market_id); @@ -895,7 +1183,12 @@ fn create_categorical_market_deposits_the_correct_event() { fn create_scalar_market_deposits_the_correct_event() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - simple_create_scalar_market(MarketCreation::Permissionless, 1..2, ScoringRule::CPMM); + simple_create_scalar_market( + Asset::Ztg, + MarketCreation::Permissionless, + 1..2, + ScoringRule::CPMM, + ); let market_id = 0; let market = MarketCommons::market(&market_id).unwrap(); let market_account = MarketCommons::market_account(market_id); @@ -909,6 +1202,7 @@ fn it_does_not_create_market_with_too_few_categories() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..100), get_deadlines(), @@ -929,6 +1223,7 @@ fn it_does_not_create_market_with_too_many_categories() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..100), get_deadlines(), @@ -947,7 +1242,12 @@ fn it_does_not_create_market_with_too_many_categories() { fn it_allows_sudo_to_destroy_markets() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // destroy the market assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); @@ -963,7 +1263,12 @@ fn it_allows_sudo_to_destroy_markets() { fn it_allows_advisory_origin_to_approve_markets() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -988,7 +1293,12 @@ fn it_allows_request_edit_origin_to_request_edits_for_markets() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 2..4, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 2..4, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1020,7 +1330,12 @@ fn request_edit_fails_on_bad_origin() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 2..4, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 2..4, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1039,7 +1354,12 @@ fn request_edit_fails_on_bad_origin() { fn edit_request_fails_if_edit_reason_is_too_long() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1058,7 +1378,12 @@ fn edit_request_fails_if_edit_reason_is_too_long() { fn market_with_edit_request_cannot_be_approved() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1081,7 +1406,12 @@ fn it_allows_the_advisory_origin_to_reject_markets() { ExtBuilder::default().build().execute_with(|| { run_to_block(2); // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 4..6, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 4..6, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1109,7 +1439,12 @@ fn it_allows_the_advisory_origin_to_reject_markets() { fn reject_errors_if_reject_reason_is_too_long() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1128,7 +1463,12 @@ fn reject_errors_if_reject_reason_is_too_long() { fn it_allows_the_advisory_origin_to_reject_markets_with_edit_request() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -1151,8 +1491,14 @@ fn it_allows_the_advisory_origin_to_reject_markets_with_edit_request() { #[test] fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { - ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // Give ALICE `SENTINEL_AMOUNT` free and reserved ZTG; we record the free balance to check // that the AdvisoryBond gets slashed but the OracleBond gets unreserved. @@ -1197,6 +1543,13 @@ fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { // AdvisoryBond is transferred to the treasury let balance_treasury_after = Balances::free_balance(Treasury::account_id()); assert_eq!(balance_treasury_after, slash_amount_advisory_bond); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -1205,9 +1558,24 @@ fn reject_market_clears_auto_close_blocks() { // We don't have to check that reject market clears the cache for opening pools, since Cpmm pools // can not be deployed on pending advised pools. ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Advised, 33..66, ScoringRule::CPMM); - simple_create_categorical_market(MarketCreation::Advised, 22..66, ScoringRule::CPMM); - simple_create_categorical_market(MarketCreation::Advised, 22..33, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 33..66, + ScoringRule::CPMM, + ); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 22..66, + ScoringRule::CPMM, + ); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 22..33, + ScoringRule::CPMM, + ); let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; assert_ok!(PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason)); @@ -1220,7 +1588,8 @@ fn reject_market_clears_auto_close_blocks() { #[test] fn on_market_close_auto_rejects_expired_advised_market() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { // Give ALICE `SENTINEL_AMOUNT` free and reserved ZTG; we record the free balance to check // that the AdvisoryBond and the OracleBond gets unreserved, when the advised market expires. assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); @@ -1234,7 +1603,12 @@ fn on_market_close_auto_rejects_expired_advised_market() { Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE); let end = 33; - simple_create_categorical_market(MarketCreation::Advised, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..end, + ScoringRule::CPMM, + ); let market_id = 0; run_to_block(end); @@ -1249,12 +1623,19 @@ fn on_market_close_auto_rejects_expired_advised_market() { zrml_market_commons::Error::::MarketDoesNotExist, ); System::assert_has_event(Event::MarketExpired(market_id).into()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { // Give ALICE `SENTINEL_AMOUNT` free and reserved ZTG; we record the free balance to check // that the AdvisoryBond and the OracleBond gets unreserved, when the advised market expires. assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); @@ -1268,7 +1649,12 @@ fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE); let end = 33; - simple_create_categorical_market(MarketCreation::Advised, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Advised, + 0..end, + ScoringRule::CPMM, + ); run_to_block(2); let market_id = 0; let market = MarketCommons::market(&market_id); @@ -1292,6 +1678,13 @@ fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { zrml_market_commons::Error::::MarketDoesNotExist, ); System::assert_has_event(Event::MarketExpired(market_id).into()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -1303,6 +1696,7 @@ fn on_market_open_successfully_auto_opens_market_pool_with_blocks() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(start..end), get_deadlines(), @@ -1333,6 +1727,7 @@ fn on_market_close_successfully_auto_closes_market_with_blocks() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(0..end), get_deadlines(), @@ -1370,6 +1765,7 @@ fn on_market_open_successfully_auto_opens_market_with_timestamps() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(start..end), get_deadlines(), @@ -1403,6 +1799,7 @@ fn on_market_close_successfully_auto_closes_market_with_timestamps() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), get_deadlines(), @@ -1448,6 +1845,7 @@ fn on_market_open_successfully_auto_opens_multiple_markets_after_stall() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(start..end), get_deadlines(), @@ -1460,6 +1858,7 @@ fn on_market_open_successfully_auto_opens_multiple_markets_after_stall() { )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(start..end), get_deadlines(), @@ -1491,6 +1890,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), get_deadlines(), @@ -1503,6 +1903,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), get_deadlines(), @@ -1541,6 +1942,7 @@ fn on_initialize_skips_the_genesis_block() { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), get_deadlines(), @@ -1571,10 +1973,15 @@ fn on_initialize_skips_the_genesis_block() { #[test] fn it_allows_to_buy_a_complete_set() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { frame_system::Pallet::::set_block_number(1); // Creates a permissionless market. - simple_create_categorical_market(MarketCreation::Permissionless, 0..2, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..2, + ScoringRule::CPMM, + ); // Allows someone to generate a complete set assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT)); @@ -1588,14 +1995,20 @@ fn it_allows_to_buy_a_complete_set() { assert_eq!(bal, CENT); } - // also check native balance - let bal = Balances::free_balance(&BOB); + let market_account = MarketCommons::market_account(0); + let bal = AssetManager::free_balance(base_asset, &BOB); assert_eq!(bal, 1_000 * BASE - CENT); - let market_account = MarketCommons::market_account(0); - let market_bal = Balances::free_balance(market_account); + let market_bal = AssetManager::free_balance(base_asset, &market_account); assert_eq!(market_bal, CENT); System::assert_last_event(Event::BoughtCompleteSet(0, CENT, BOB).into()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -1603,7 +2016,12 @@ fn it_allows_to_buy_a_complete_set() { fn it_does_not_allow_to_buy_a_complete_set_on_pending_advised_market() { ExtBuilder::default().build().execute_with(|| { // Creates a permissionless market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); assert_noop!( PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT), Error::::MarketIsNotActive, @@ -1617,6 +2035,7 @@ fn create_categorical_market_fails_if_market_begin_is_equal_to_end() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(3..3), get_deadlines(), @@ -1626,7 +2045,7 @@ fn create_categorical_market_fails_if_market_begin_is_equal_to_end() { MarketDisputeMechanism::Authorized, ScoringRule::CPMM, ), - crate::Error::::InvalidMarketPeriod, + Error::::InvalidMarketPeriod, ); }); } @@ -1646,6 +2065,7 @@ fn create_categorical_market_fails_if_market_period_is_invalid( assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, period, get_deadlines(), @@ -1655,7 +2075,7 @@ fn create_categorical_market_fails_if_market_period_is_invalid( MarketDisputeMechanism::Authorized, ScoringRule::CPMM, ), - crate::Error::::InvalidMarketPeriod, + Error::::InvalidMarketPeriod, ); }); } @@ -1668,6 +2088,7 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..end_block), get_deadlines(), @@ -1677,13 +2098,14 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { MarketDisputeMechanism::Authorized, ScoringRule::CPMM, ), - crate::Error::::InvalidMarketPeriod, + Error::::InvalidMarketPeriod, ); let end_time = MILLISECS_PER_BLOCK as u64 / 2; assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..end_time), get_deadlines(), @@ -1693,7 +2115,7 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { MarketDisputeMechanism::Authorized, ScoringRule::CPMM, ), - crate::Error::::InvalidMarketPeriod, + Error::::InvalidMarketPeriod, ); }); } @@ -1701,7 +2123,12 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { #[test] fn it_does_not_allow_zero_amounts_in_buy_complete_set() { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_noop!( PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 0), Error::::ZeroAmount @@ -1711,20 +2138,36 @@ fn it_does_not_allow_zero_amounts_in_buy_complete_set() { #[test] fn it_does_not_allow_buying_complete_sets_with_insufficient_balance() { - ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_noop!( PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 10000 * BASE), Error::::NotEnoughBalance ); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } - #[test] fn it_allows_to_deploy_a_pool() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { // Creates a permissionless market. - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 100 * BASE)); @@ -1741,13 +2184,25 @@ fn it_allows_to_deploy_a_pool() { ::MinLiquidity::get(), vec![::MinWeight::get(); 2], )); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn deploy_swap_pool_for_market_fails_if_market_has_a_pool() { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 200 * BASE)); assert_ok!(PredictionMarkets::deploy_swap_pool_for_market( Origin::signed(BOB), @@ -1773,7 +2228,12 @@ fn deploy_swap_pool_for_market_fails_if_market_has_a_pool() { fn it_does_not_allow_to_deploy_a_pool_on_pending_advised_market() { ExtBuilder::default().build().execute_with(|| { // Creates a permissionless market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); assert_noop!( PredictionMarkets::deploy_swap_pool_for_market( @@ -1790,10 +2250,15 @@ fn it_does_not_allow_to_deploy_a_pool_on_pending_advised_market() { #[test] fn it_allows_to_sell_a_complete_set() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { frame_system::Pallet::::set_block_number(1); // Creates a permissionless market. - simple_create_categorical_market(MarketCreation::Permissionless, 0..2, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..2, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT)); @@ -1813,13 +2278,25 @@ fn it_allows_to_sell_a_complete_set() { assert_eq!(bal, 1_000 * BASE); System::assert_last_event(Event::SoldCompleteSet(0, CENT, BOB).into()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn it_does_not_allow_zero_amounts_in_sell_complete_set() { ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_noop!( PredictionMarkets::sell_complete_set(Origin::signed(BOB), 0, 0), Error::::ZeroAmount @@ -1829,14 +2306,26 @@ fn it_does_not_allow_zero_amounts_in_sell_complete_set() { #[test] fn it_does_not_allow_to_sell_complete_sets_with_insufficient_balance() { - ExtBuilder::default().build().execute_with(|| { - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + let test = |base_asset: Asset| { + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 2 * CENT)); assert_eq!(AssetManager::slash(Asset::CategoricalOutcome(0, 1), &BOB, CENT), 0); assert_noop!( PredictionMarkets::sell_complete_set(Origin::signed(BOB), 0, 2 * CENT), Error::::InsufficientShareBalance ); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -1844,7 +2333,12 @@ fn it_does_not_allow_to_sell_complete_sets_with_insufficient_balance() { fn it_allows_to_report_the_outcome_of_a_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -1885,7 +2379,12 @@ fn it_allows_to_report_the_outcome_of_a_market() { fn report_fails_before_grace_period_is_over() { ExtBuilder::default().build().execute_with(|| { let end = 100; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); run_to_block(end); @@ -1904,7 +2403,12 @@ fn report_fails_before_grace_period_is_over() { fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duration_blocks() { ExtBuilder::default().build().execute_with(|| { let end = 100; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -1938,6 +2442,7 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -1975,7 +2480,12 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio fn report_fails_on_mismatched_outcome_for_categorical_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -1993,7 +2503,12 @@ fn report_fails_on_mismatched_outcome_for_categorical_market() { fn report_fails_on_out_of_range_outcome_for_categorical_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -2011,7 +2526,12 @@ fn report_fails_on_out_of_range_outcome_for_categorical_market() { fn report_fails_on_mismatched_outcome_for_scalar_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; - simple_create_scalar_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_scalar_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -2029,7 +2549,12 @@ fn report_fails_on_mismatched_outcome_for_scalar_market() { fn it_allows_to_dispute_the_outcome_of_a_market() { ExtBuilder::default().build().execute_with(|| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); // Run to the end of the trading phase. let market = MarketCommons::market(&0).unwrap(); @@ -2074,6 +2599,7 @@ fn dispute_fails_authority_reported_already() { let end = 2; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -2115,7 +2641,12 @@ fn dispute_fails_authority_reported_already() { fn it_allows_anyone_to_report_an_unreported_market() { ExtBuilder::default().build().execute_with(|| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); let market = MarketCommons::market(&0).unwrap(); // Just skip to waaaay overdue. @@ -2147,7 +2678,12 @@ fn it_allows_anyone_to_report_an_unreported_market() { fn it_correctly_resolves_a_market_that_was_reported_on() { ExtBuilder::default().build().execute_with(|| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); @@ -2199,9 +2735,14 @@ fn it_correctly_resolves_a_market_that_was_reported_on() { #[test] fn it_resolves_a_disputed_market() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); @@ -2315,6 +2856,13 @@ fn it_resolves_a_disputed_market() { assert!(market_after.bonds.creation.unwrap().is_settled); assert!(market_after.bonds.oracle.unwrap().is_settled); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -2327,7 +2875,12 @@ fn it_resolves_a_disputed_market() { fn dispute_fails_unless_reported_or_disputed_market(status: MarketStatus) { ExtBuilder::default().build().execute_with(|| { // Creates a permissionless market. - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(MarketCommons::mutate_market(&0, |market_inner| { market_inner.status = status; @@ -2347,6 +2900,7 @@ fn start_global_dispute_works() { let end = 2; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..2), get_deadlines(), @@ -2448,6 +3002,7 @@ fn start_global_dispute_fails_on_wrong_mdm() { let end = 2; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..2), get_deadlines(), @@ -2509,9 +3064,14 @@ fn start_global_dispute_works_without_feature() { #[test] fn it_allows_to_redeem_shares() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { let end = 2; - simple_create_categorical_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_categorical_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); @@ -2533,28 +3093,34 @@ fn it_allows_to_redeem_shares() { System::assert_last_event( Event::TokensRedeemed(0, Asset::CategoricalOutcome(0, 1), CENT, CENT, CHARLIE).into(), ); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn create_market_and_deploy_assets_results_in_expected_balances_and_pool_params() { - let oracle = ALICE; - let period = MarketPeriod::Block(0..42); - let metadata = gen_metadata(42); - let category_count = 4; - let market_type = MarketType::Categorical(category_count); - let swap_fee = ::MaxSwapFee::get(); - let amount = 123 * BASE; - let pool_id = 0; - let weight = ::MinWeight::get(); - let weights = vec![weight; category_count.into()]; - let base_asset_weight = (category_count as u128) * weight; - let total_weight = 2 * base_asset_weight; - - // Execute the combined convenience function - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { + let oracle = ALICE; + let period = MarketPeriod::Block(0..42); + let metadata = gen_metadata(42); + let category_count = 4; + let market_type = MarketType::Categorical(category_count); + let swap_fee = ::MaxSwapFee::get(); + let amount = 123 * BASE; + let pool_id = 0; + let weight = ::MinWeight::get(); + let weights = vec![weight; category_count.into()]; + let base_asset_weight = (category_count as u128) * weight; + let total_weight = 2 * base_asset_weight; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + base_asset, oracle, period, get_deadlines(), @@ -2577,7 +3143,7 @@ fn create_market_and_deploy_assets_results_in_expected_balances_and_pool_params( assert_eq!(Tokens::free_balance(Asset::CategoricalOutcome(0, 1), &pool_account), amount); assert_eq!(Tokens::free_balance(Asset::CategoricalOutcome(0, 2), &pool_account), amount); assert_eq!(Tokens::free_balance(Asset::CategoricalOutcome(0, 3), &pool_account), amount); - assert_eq!(System::account(&pool_account).data.free, amount); + assert_eq!(AssetManager::free_balance(base_asset, &pool_account), amount); let pool = Pools::::get(0).unwrap(); let assets_expected = vec![ @@ -2585,10 +3151,10 @@ fn create_market_and_deploy_assets_results_in_expected_balances_and_pool_params( Asset::CategoricalOutcome(market_id, 1), Asset::CategoricalOutcome(market_id, 2), Asset::CategoricalOutcome(market_id, 3), - Asset::Ztg, + base_asset, ]; assert_eq!(pool.assets, assets_expected); - assert_eq!(pool.base_asset, Asset::Ztg); + assert_eq!(pool.base_asset, base_asset); assert_eq!(pool.market_id, market_id); assert_eq!(pool.scoring_rule, ScoringRule::CPMM); assert_eq!(pool.swap_fee, Some(swap_fee)); @@ -2600,19 +3166,28 @@ fn create_market_and_deploy_assets_results_in_expected_balances_and_pool_params( assert_eq!(pool_weights[&Asset::CategoricalOutcome(market_id, 1)], weight); assert_eq!(pool_weights[&Asset::CategoricalOutcome(market_id, 2)], weight); assert_eq!(pool_weights[&Asset::CategoricalOutcome(market_id, 3)], weight); - assert_eq!(pool_weights[&Asset::Ztg], base_asset_weight); + assert_eq!(pool_weights[&base_asset], base_asset_weight); + }; + + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn process_subsidy_activates_market_with_sufficient_subsidy() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { let min_sub_period = ::MinSubsidyPeriod::get() / (MILLISECS_PER_BLOCK as u64); let max_sub_period = ::MaxSubsidyPeriod::get() / (MILLISECS_PER_BLOCK as u64); simple_create_categorical_market( + base_asset, MarketCreation::Permissionless, min_sub_period..max_sub_period, ScoringRule::RikiddoSigmoidFeeMarketEma, @@ -2623,18 +3198,26 @@ fn process_subsidy_activates_market_with_sufficient_subsidy() { let subsidy_queue = crate::MarketsCollectingSubsidy::::get(); assert_eq!(subsidy_queue.len(), 0); assert_eq!(MarketCommons::market(&0).unwrap().status, MarketStatus::Active); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn process_subsidy_blocks_market_with_insufficient_subsidy() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { let min_sub_period = ::MinSubsidyPeriod::get() / (MILLISECS_PER_BLOCK as u64); let max_sub_period = ::MaxSubsidyPeriod::get() / (MILLISECS_PER_BLOCK as u64); simple_create_categorical_market( + base_asset, MarketCreation::Permissionless, min_sub_period..max_sub_period, ScoringRule::RikiddoSigmoidFeeMarketEma, @@ -2648,20 +3231,28 @@ fn process_subsidy_blocks_market_with_insufficient_subsidy() { assert_eq!(MarketCommons::market(&0).unwrap().status, MarketStatus::InsufficientSubsidy); // Check that the balances are correctly unreserved. - assert_eq!(Balances::reserved_balance(&ALICE), 0); - assert_eq!(Balances::reserved_balance(&BOB), 0); + assert_eq!(AssetManager::reserved_balance(base_asset, &ALICE), 0); + assert_eq!(AssetManager::reserved_balance(base_asset, &BOB), 0); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn process_subsidy_keeps_market_in_subsidy_queue_until_end_of_subsidy_phase() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { let min_sub_period = ::MinSubsidyPeriod::get() / (MILLISECS_PER_BLOCK as u64); let max_sub_period = ::MaxSubsidyPeriod::get() / (MILLISECS_PER_BLOCK as u64); simple_create_categorical_market( + base_asset, MarketCreation::Permissionless, min_sub_period + 42..max_sub_period, ScoringRule::RikiddoSigmoidFeeMarketEma, @@ -2673,14 +3264,22 @@ fn process_subsidy_keeps_market_in_subsidy_queue_until_end_of_subsidy_phase() { assert!(subsidy_queue.len() == 1); assert!(subsidy_queue[0].market_id == 0); assert!(MarketCommons::market(&0).unwrap().status == MarketStatus::CollectingSubsidy); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn start_subsidy_creates_pool_and_starts_subsidy() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { // Create advised categorical market using Rikiddo. simple_create_categorical_market( + base_asset, MarketCreation::Advised, 1337..1338, ScoringRule::RikiddoSigmoidFeeMarketEma, @@ -2691,7 +3290,7 @@ fn start_subsidy_creates_pool_and_starts_subsidy() { // Ensure and set correct market status. assert_err!( PredictionMarkets::start_subsidy(&market, market_id), - crate::Error::::MarketIsNotCollectingSubsidy + Error::::MarketIsNotCollectingSubsidy ); assert_ok!(MarketCommons::mutate_market(&market_id, |market_inner| { market_inner.status = MarketStatus::CollectingSubsidy; @@ -2711,6 +3310,13 @@ fn start_subsidy_creates_pool_and_starts_subsidy() { } assert!(inserted); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -2718,7 +3324,12 @@ fn start_subsidy_creates_pool_and_starts_subsidy() { fn only_creator_can_edit_market() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -2735,6 +3346,7 @@ fn only_creator_can_edit_market() { assert_noop!( PredictionMarkets::edit_market( Origin::signed(BOB), + Asset::Ztg, 0, CHARLIE, MarketPeriod::Block(0..1), @@ -2754,7 +3366,12 @@ fn edit_cycle_for_proposed_markets() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. run_to_block(1); - simple_create_categorical_market(MarketCreation::Advised, 2..4, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 2..4, + ScoringRule::CPMM, + ); // make sure it's in status proposed let market = MarketCommons::market(&0); @@ -2771,6 +3388,7 @@ fn edit_cycle_for_proposed_markets() { // After this edit its changed to ALICE assert_ok!(PredictionMarkets::edit_market( Origin::signed(ALICE), + Asset::Ztg, 0, CHARLIE, MarketPeriod::Block(2..4), @@ -2789,12 +3407,87 @@ fn edit_cycle_for_proposed_markets() { }); } +#[cfg(feature = "parachain")] +#[test] +fn edit_market_with_foreign_asset() { + ExtBuilder::default().build().execute_with(|| { + // Creates an advised market. + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); + + // make sure it's in status proposed + let market = MarketCommons::market(&0); + assert_eq!(market.unwrap().status, MarketStatus::Proposed); + + let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; + + // Now it should work from SUDO + assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + + assert!(MarketIdsForEdit::::contains_key(0)); + + // ALICE is market creator through simple_create_categorical_market + // As per Mock asset_registry genesis ForeignAsset(50) is not registered in asset_registry. + assert_noop!( + PredictionMarkets::edit_market( + Origin::signed(ALICE), + Asset::ForeignAsset(50), + 0, + CHARLIE, + MarketPeriod::Block(0..1), + get_deadlines(), + gen_metadata(2), + MarketType::Categorical(::MinCategories::get()), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM + ), + Error::::UnregisteredForeignAsset + ); + // As per Mock asset_registry genesis ForeignAsset(420) has allow_as_base_asset set to false. + assert_noop!( + PredictionMarkets::edit_market( + Origin::signed(ALICE), + Asset::ForeignAsset(420), + 0, + CHARLIE, + MarketPeriod::Block(0..1), + get_deadlines(), + gen_metadata(2), + MarketType::Categorical(::MinCategories::get()), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM + ), + Error::::InvalidBaseAsset, + ); + // As per Mock asset_registry genesis ForeignAsset(100) has allow_as_base_asset set to true. + assert_ok!(PredictionMarkets::edit_market( + Origin::signed(ALICE), + Asset::ForeignAsset(100), + 0, + CHARLIE, + MarketPeriod::Block(0..1), + get_deadlines(), + gen_metadata(2), + MarketType::Categorical(::MinCategories::get()), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM + )); + let market = MarketCommons::market(&0).unwrap(); + assert_eq!(market.base_asset, Asset::ForeignAsset(100)); + }); +} + #[test] fn the_entire_market_lifecycle_works_with_timestamps() { ExtBuilder::default().build().execute_with(|| { // Creates a permissionless market. assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -2830,9 +3523,10 @@ fn the_entire_market_lifecycle_works_with_timestamps() { #[test] fn full_scalar_market_lifecycle() { - ExtBuilder::default().build().execute_with(|| { + let test = |base_asset: Asset| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -2902,10 +3596,10 @@ fn full_scalar_market_lifecycle() { } // check payouts is right for each CHARLIE and EVE - let ztg_bal_charlie = Balances::free_balance(&CHARLIE); - let ztg_bal_eve = Balances::free_balance(&EVE); - assert_eq!(ztg_bal_charlie, 98750 * CENT); // 75 (LONG) + 12.5 (SHORT) + 900 (balance) - assert_eq!(ztg_bal_eve, 1000 * BASE); + let base_asset_bal_charlie = AssetManager::free_balance(base_asset, &CHARLIE); + let base_asset_bal_eve = AssetManager::free_balance(base_asset, &EVE); + assert_eq!(base_asset_bal_charlie, 98750 * CENT); // 75 (LONG) + 12.5 (SHORT) + 900 (balance) + assert_eq!(base_asset_bal_eve, 1000 * BASE); System::assert_has_event( Event::TokensRedeemed( 0, @@ -2928,8 +3622,8 @@ fn full_scalar_market_lifecycle() { ); assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(EVE), 0)); - let ztg_bal_eve_after = Balances::free_balance(&EVE); - assert_eq!(ztg_bal_eve_after, 101250 * CENT); // 12.5 (SHORT) + 1000 (balance) + let base_asset_bal_eve_after = AssetManager::free_balance(base_asset, &EVE); + assert_eq!(base_asset_bal_eve_after, 101250 * CENT); // 12.5 (SHORT) + 1000 (balance) System::assert_last_event( Event::TokensRedeemed( 0, @@ -2940,32 +3634,58 @@ fn full_scalar_market_lifecycle() { ) .into(), ); - }) + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); + }); } #[test] fn scalar_market_correctly_resolves_on_out_of_range_outcomes_below_threshold() { + let test = |base_asset: Asset| { + scalar_market_correctly_resolves_common(base_asset, 50); + assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 900 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1100 * BASE); + }; ExtBuilder::default().build().execute_with(|| { - scalar_market_correctly_resolves_common(50); - assert_eq!(Balances::free_balance(&CHARLIE), 900 * BASE); - assert_eq!(Balances::free_balance(&EVE), 1100 * BASE); - }) + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); + }); } #[test] fn scalar_market_correctly_resolves_on_out_of_range_outcomes_above_threshold() { + let test = |base_asset: Asset| { + scalar_market_correctly_resolves_common(base_asset, 250); + assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 1000 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1000 * BASE); + }; ExtBuilder::default().build().execute_with(|| { - scalar_market_correctly_resolves_common(250); - assert_eq!(Balances::free_balance(&CHARLIE), 1000 * BASE); - assert_eq!(Balances::free_balance(&EVE), 1000 * BASE); - }) + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); + }); } #[test] fn reject_market_fails_on_permissionless_market() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Permissionless, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Permissionless, + 0..1, + ScoringRule::CPMM, + ); let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; assert_noop!( @@ -2979,7 +3699,12 @@ fn reject_market_fails_on_permissionless_market() { fn reject_market_fails_on_approved_market() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. - simple_create_categorical_market(MarketCreation::Advised, 0..1, ScoringRule::CPMM); + simple_create_categorical_market( + Asset::Ztg, + MarketCreation::Advised, + 0..1, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; @@ -2996,6 +3721,7 @@ fn market_resolve_does_not_hold_liquidity_withdraw() { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3027,10 +3753,12 @@ fn market_resolve_does_not_hold_liquidity_withdraw() { #[test] fn authorized_correctly_resolves_disputed_market() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 2; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3051,7 +3779,7 @@ fn authorized_correctly_resolves_disputed_market() { OutcomeReport::Categorical(0) )); - let charlie_balance = Balances::free_balance(&CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - CENT); let dispute_at = grace_period + 1 + 1; @@ -3062,8 +3790,15 @@ fn authorized_correctly_resolves_disputed_market() { OutcomeReport::Categorical(1) )); - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + if base_asset == Asset::Ztg { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + } else { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - DisputeBond::get()); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT); + } // Fred authorizses an outcome, but fat-fingers it on the first try. assert_ok!(Authorized::authorize_market_outcome( @@ -3093,21 +3828,42 @@ fn authorized_correctly_resolves_disputed_market() { ); assert_eq!(market_ids_1.len(), 1); - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + if base_asset == Asset::Ztg { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + } else { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - DisputeBond::get()); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT); + } run_blocks(::CorrectionPeriod::get() - 1); let market_after = MarketCommons::market(&0).unwrap(); assert_eq!(market_after.status, MarketStatus::Disputed); - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + if base_asset == Asset::Ztg { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT - DisputeBond::get()); + } else { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - DisputeBond::get()); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT); + } run_blocks(1); - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE - CENT + OracleBond::get()); + if base_asset == Asset::Ztg { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT + OracleBond::get()); + } else { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE + OracleBond::get()); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE - CENT); + } let market_after = MarketCommons::market(&0).unwrap(); assert_eq!(market_after.status, MarketStatus::Resolved); @@ -3116,29 +3872,45 @@ fn authorized_correctly_resolves_disputed_market() { assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); - let charlie_balance = Balances::free_balance(&CHARLIE); - assert_eq!(charlie_balance, 1_000 * BASE + OracleBond::get()); - let charlie_reserved_2 = Balances::reserved_balance(&CHARLIE); + if base_asset == Asset::Ztg { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE + OracleBond::get()); + } else { + let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE + OracleBond::get()); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); + assert_eq!(charlie_balance, 1_000 * BASE); + } + let charlie_reserved_2 = AssetManager::reserved_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_reserved_2, 0); - let alice_balance = Balances::free_balance(&ALICE); + let alice_balance = AssetManager::free_balance(Asset::Ztg, &ALICE); assert_eq!(alice_balance, 1_000 * BASE - OracleBond::get()); // bob kinda gets away scot-free since Alice is held responsible // for her designated reporter - let bob_balance = Balances::free_balance(&BOB); + let bob_balance = AssetManager::free_balance(Asset::Ztg, &BOB); assert_eq!(bob_balance, 1_000 * BASE); assert!(market_after.bonds.creation.unwrap().is_settled); assert!(market_after.bonds.oracle.unwrap().is_settled); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn approve_market_correctly_unreserves_advisory_bond() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..100), get_deadlines(), @@ -3165,6 +3937,13 @@ fn approve_market_correctly_unreserves_advisory_bond() { assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + AdvisoryBond::get()); let market = MarketCommons::market(&market_id).unwrap(); assert!(market.bonds.creation.unwrap().is_settled); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3178,6 +3957,7 @@ fn deploy_swap_pool_correctly_sets_weight_of_base_asset() { ]; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), + Asset::Ztg, ALICE, MarketPeriod::Block(0..42), get_deadlines(), @@ -3203,6 +3983,7 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_short() { let category_count = 5; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..100), get_deadlines(), @@ -3239,6 +4020,7 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_long() { let category_count = 5; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(0..100), get_deadlines(), @@ -3272,10 +4054,12 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_long() { #[test] fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_on_oracle_report() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3310,16 +4094,25 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get() + OracleBond::get() ); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_on_outsider_report() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..100), get_deadlines(), @@ -3353,16 +4146,25 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // Check that validity bond didn't get slashed, but oracle bond did assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_market_on_oracle_report() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3394,16 +4196,25 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // Check that nothing got slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + OracleBond::get()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } #[test] fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_market_on_outsider_report() { - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3435,6 +4246,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma // Check that oracle bond got slashed assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3442,10 +4260,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_with_correct_disputed_outcome_with_oracle_report() { // Oracle reports in time but incorrect report, so OracleBond gets slashed on resolution - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3483,6 +4303,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3490,10 +4317,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_market_with_correct_disputed_outcome_with_oracle_report() { // Oracle reports in time but incorrect report, so OracleBond gets slashed on resolution - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3529,6 +4358,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3536,10 +4372,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_with_wrong_disputed_outcome_with_oracle_report() { // Oracle reports in time and correct report, so OracleBond does not get slashed on resolution - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3586,6 +4424,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get() + OracleBond::get() ); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3593,10 +4438,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_market_with_wrong_disputed_outcome_with_oracle_report() { // Oracle reports in time and correct report, so OracleBond does not get slashed on resolution - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3638,6 +4485,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // ValidityBond bond is returned but OracleBond is not slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + OracleBond::get()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3645,10 +4499,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_with_disputed_outcome_with_outsider_report() { // Oracle does not report in time, so OracleBond gets slashed on resolution - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3694,6 +4550,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3701,10 +4564,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_market_with_disputed_outcome_with_outsider_report() { // Oracle does not report in time, so OracleBond gets slashed on resolution - ExtBuilder::default().build().execute_with(|| { + // NOTE: Bonds are always in ZTG + let test = |base_asset: Asset| { let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + base_asset, BOB, MarketPeriod::Block(0..end), get_deadlines(), @@ -3748,6 +4613,13 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); }); } @@ -3756,6 +4628,7 @@ fn report_fails_on_market_state_proposed() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -3777,6 +4650,7 @@ fn report_fails_on_market_state_closed_for_advised_market() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -3798,6 +4672,7 @@ fn report_fails_on_market_state_collecting_subsidy() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(100_000_000..200_000_000), get_deadlines(), @@ -3819,6 +4694,7 @@ fn report_fails_on_market_state_insufficient_subsidy() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(100_000_000..200_000_000), get_deadlines(), @@ -3844,6 +4720,7 @@ fn report_fails_on_market_state_active() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -3865,6 +4742,7 @@ fn report_fails_on_market_state_suspended() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -3890,6 +4768,7 @@ fn report_fails_on_market_state_resolved() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -3915,6 +4794,7 @@ fn report_fails_if_reporter_is_not_the_oracle() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), get_deadlines(), @@ -3950,6 +4830,7 @@ fn create_market_succeeds_if_market_duration_is_maximal_in_blocks() { ); assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(start..end), get_deadlines(), @@ -3976,6 +4857,7 @@ fn create_market_suceeds_if_market_duration_is_maximal_in_moments() { ); assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(start..end), get_deadlines(), @@ -4002,6 +4884,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_blocks() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Block(start..end), get_deadlines(), @@ -4031,6 +4914,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_moments() { assert_noop!( PredictionMarkets::create_market( Origin::signed(ALICE), + Asset::Ztg, BOB, MarketPeriod::Timestamp(start..end), get_deadlines(), @@ -4084,6 +4968,7 @@ fn create_market_sets_the_correct_market_parameters_and_reserves_the_correct_amo let dispute_mechanism = MarketDisputeMechanism::Authorized; assert_ok!(PredictionMarkets::create_market( Origin::signed(creator), + Asset::Ztg, oracle, period.clone(), deadlines, @@ -4112,7 +4997,7 @@ fn create_market_sets_the_correct_market_parameters_and_reserves_the_correct_amo } fn deploy_swap_pool( - market: Market, + market: Market>, market_id: u128, ) -> DispatchResultWithPostInfo { assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(FRED), 0, 100 * BASE)); @@ -4132,9 +5017,14 @@ fn deploy_swap_pool( } // Common code of `scalar_market_correctly_resolves_*` -fn scalar_market_correctly_resolves_common(reported_value: u128) { +fn scalar_market_correctly_resolves_common(base_asset: Asset, reported_value: u128) { let end = 100; - simple_create_scalar_market(MarketCreation::Permissionless, 0..end, ScoringRule::CPMM); + simple_create_scalar_market( + base_asset, + MarketCreation::Permissionless, + 0..end, + ScoringRule::CPMM, + ); assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, 100 * BASE)); assert_ok!(Tokens::transfer( Origin::signed(CHARLIE), @@ -4165,14 +5055,14 @@ fn scalar_market_correctly_resolves_common(reported_value: u128) { // Check balances before redeeming (just to make sure that our tests are based on correct // assumptions)! - assert_eq!(Balances::free_balance(&CHARLIE), 900 * BASE); - assert_eq!(Balances::free_balance(&EVE), 1000 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 900 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1000 * BASE); assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(EVE), 0)); let assets = PredictionMarkets::outcome_assets(0, &MarketCommons::market(&0).unwrap()); for asset in assets.iter() { - assert_eq!(Tokens::free_balance(*asset, &CHARLIE), 0); - assert_eq!(Tokens::free_balance(*asset, &EVE), 0); + assert_eq!(AssetManager::free_balance(*asset, &CHARLIE), 0); + assert_eq!(AssetManager::free_balance(*asset, &EVE), 0); } } diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index 193a3f716..f0e7a5f5c 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -40,7 +40,9 @@ mod pallet { use sp_runtime::{traits::Saturating, DispatchError}; use zeitgeist_primitives::{ traits::{DisputeApi, DisputeResolutionApi}, - types::{Market, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport}, + types::{ + Asset, Market, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport, + }, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -56,6 +58,7 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, + Asset>, >; #[pallet::call] diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index 5e6afbcd6..00ec22b94 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -34,7 +34,7 @@ use zeitgeist_primitives::{ }, traits::DisputeResolutionApi, types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, + AccountIdTest, Asset, Balance, BlockNumber, BlockTest, Hash, Index, Market, MarketDispute, MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -67,7 +67,13 @@ impl DisputeResolutionApi for NoopResolution { fn resolve( _market_id: &Self::MarketId, - _market: &Market, + _market: &Market< + Self::AccountId, + Self::Balance, + Self::BlockNumber, + Self::Moment, + Asset, + >, ) -> Result { Ok(0) } diff --git a/zrml/simple-disputes/src/tests.rs b/zrml/simple-disputes/src/tests.rs index 251377533..85a01b8b1 100644 --- a/zrml/simple-disputes/src/tests.rs +++ b/zrml/simple-disputes/src/tests.rs @@ -25,12 +25,13 @@ use frame_support::assert_noop; use zeitgeist_primitives::{ traits::DisputeApi, types::{ - Deadlines, Market, MarketBonds, MarketCreation, MarketDispute, MarketDisputeMechanism, - MarketPeriod, MarketStatus, MarketType, OutcomeReport, ScoringRule, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDispute, + MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, ScoringRule, }, }; const DEFAULT_MARKET: MarketOf = Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: 0, diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index 0c4e6ec68..f955c8a64 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -174,6 +174,7 @@ benchmarks! { let caller: T::AccountId = whitelisted_caller(); let market_id = T::MarketCommons::push_market( Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: caller.clone(), @@ -214,6 +215,7 @@ benchmarks! { let caller: T::AccountId = whitelisted_caller(); let market_id = T::MarketCommons::push_market( Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: caller.clone(), diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index fcf16e09b..dc7ba46e1 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -3461,8 +3461,11 @@ fn subsidize_and_start_rikiddo_pool( assert!(Swaps::end_subsidy_phase(pool_id).unwrap().result); } -fn mock_market(categories: u16) -> Market { +fn mock_market( + categories: u16, +) -> Market> { Market { + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: 0, creator: ALICE, From 3e07be62131d7fcbca0bdb2fccc8749a67aa3cc9 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Fri, 20 Jan 2023 18:52:08 +0530 Subject: [PATCH 07/53] Upgrade 0929 (#887) * Upgrade Cargo.toml for pallets for polkadot-v0.9.26 * update runtime and node to version 0.9.26 * Fixes required for 0.9.26 * Use bounded_vec! * Make node compile * Update cargo lock * Pin tracing-core version * Align node folder to parachain-template * Upgrade polkadot version in global-dispute. * Use substrate, polkadot etc from Purestake * Upgrade to moonbeam-polkadot-v0.9.29 * Replace execute_block_no_check() to try_execute_block() * Format the code * Include frame/support in try-runtime feature * Add pallet-proxy to try-runtime feature in runtime * Use substrate,polkadot,cumulus,nimbus etc from zeitgeist github as it contains fix for try-runtime * Make try-runtime feature work * Remove println from global dispute benchmarks * Unpin tracing from version 0.1.26 * Fix clippy and quick_check benchmarks, also update weight_template * Fix weights after benchamarks * Fix try-runtime features of zrml pallets * Fix issue with setting timestamp * Fix issues with testing * Fix benchmarks * Fix test with runtime-benchmarks,with-global-disputes * Minor format change in prediction_markets/src/benchmarks.rs * Don't require Aura for PM tests * Allow arbitrary timestamp delta in benchmark environment Co-authored-by: Harald Heckmann --- Cargo.lock | 1611 +++++++++-------- Cargo.toml | 27 - misc/frame_weight_template.hbs | 12 +- misc/orml_weight_template.hbs | 12 +- misc/weight_template.hbs | 12 +- node/Cargo.toml | 143 +- .../{command_helper.rs => benchmarking.rs} | 88 +- node/src/chain_spec/additional_chain_spec.rs | 6 +- node/src/chain_spec/battery_station.rs | 13 +- node/src/chain_spec/dev.rs | 15 +- node/src/chain_spec/mod.rs | 3 + node/src/chain_spec/zeitgeist.rs | 13 +- node/src/cli/cli_parachain.rs | 13 +- node/src/command.rs | 88 +- node/src/main.rs | 2 +- node/src/service.rs | 2 - node/src/service/service_parachain.rs | 7 +- primitives/Cargo.toml | 16 +- .../zeitgeist_multi_reservable_currency.rs | 3 +- runtime/battery-station/Cargo.toml | 162 +- .../src/integration_tests/xcm/test_net.rs | 2 +- runtime/battery-station/src/lib.rs | 3 +- .../battery-station/src/parachain_params.rs | 8 +- runtime/battery-station/src/parameters.rs | 24 +- .../battery-station/src/xcm_config/config.rs | 1 + .../battery-station/src/xcm_config/fees.rs | 4 +- runtime/common/Cargo.toml | 52 +- runtime/common/src/lib.rs | 84 +- .../src/weights/cumulus_pallet_xcmp_queue.rs | 14 +- runtime/common/src/weights/frame_system.rs | 42 +- runtime/common/src/weights/orml_currencies.rs | 37 +- runtime/common/src/weights/orml_tokens.rs | 37 +- .../src/weights/pallet_author_inherent.rs | 15 +- .../src/weights/pallet_author_mapping.rs | 32 +- .../src/weights/pallet_author_slot_filter.rs | 4 +- runtime/common/src/weights/pallet_balances.rs | 50 +- runtime/common/src/weights/pallet_bounties.rs | 76 +- .../common/src/weights/pallet_collective.rs | 130 +- .../common/src/weights/pallet_democracy.rs | 228 ++- runtime/common/src/weights/pallet_grandpa.rs | 8 +- runtime/common/src/weights/pallet_identity.rs | 204 ++- .../common/src/weights/pallet_membership.rs | 66 +- runtime/common/src/weights/pallet_multisig.rs | 108 +- .../src/weights/pallet_parachain_staking.rs | 267 +-- runtime/common/src/weights/pallet_preimage.rs | 80 +- runtime/common/src/weights/pallet_proxy.rs | 116 +- .../common/src/weights/pallet_scheduler.rs | 174 +- .../common/src/weights/pallet_timestamp.rs | 11 +- runtime/common/src/weights/pallet_treasury.rs | 46 +- runtime/common/src/weights/pallet_utility.rs | 24 +- runtime/common/src/weights/pallet_vesting.rs | 120 +- runtime/zeitgeist/Cargo.toml | 159 +- .../src/integration_tests/xcm/test_net.rs | 2 +- runtime/zeitgeist/src/lib.rs | 3 +- runtime/zeitgeist/src/parachain_params.rs | 8 +- runtime/zeitgeist/src/parameters.rs | 24 +- runtime/zeitgeist/src/xcm_config/config.rs | 1 + runtime/zeitgeist/src/xcm_config/fees.rs | 4 +- scripts/benchmarks/configuration.sh | 2 +- scripts/benchmarks/quick_check.sh | 6 +- zrml/authorized/Cargo.toml | 14 +- zrml/authorized/src/mock.rs | 2 +- zrml/authorized/src/weights.rs | 15 +- zrml/court/Cargo.toml | 16 +- zrml/court/src/mock.rs | 2 +- zrml/court/src/weights.rs | 20 +- zrml/global-disputes/Cargo.toml | 16 +- zrml/global-disputes/src/weights.rs | 90 +- zrml/liquidity-mining/Cargo.toml | 16 +- zrml/liquidity-mining/src/weights.rs | 4 +- zrml/market-commons/Cargo.toml | 14 +- zrml/orderbook-v1/Cargo.toml | 16 +- zrml/orderbook-v1/fuzz/Cargo.toml | 2 +- zrml/orderbook-v1/src/weights.rs | 37 +- zrml/prediction-markets/Cargo.toml | 38 +- zrml/prediction-markets/fuzz/Cargo.toml | 2 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/prediction-markets/src/lib.rs | 22 +- zrml/prediction-markets/src/weights.rs | 340 ++-- zrml/rikiddo/Cargo.toml | 14 +- zrml/rikiddo/fuzz/Cargo.toml | 4 +- zrml/simple-disputes/Cargo.toml | 14 +- zrml/simple-disputes/src/mock.rs | 2 +- zrml/styx/Cargo.toml | 14 +- zrml/styx/src/weights.rs | 10 +- zrml/swaps/Cargo.toml | 22 +- zrml/swaps/fuzz/Cargo.toml | 6 +- zrml/swaps/rpc/Cargo.toml | 8 +- zrml/swaps/runtime-api/Cargo.toml | 4 +- zrml/swaps/src/benchmarks.rs | 2 +- zrml/swaps/src/lib.rs | 26 +- zrml/swaps/src/tests.rs | 10 +- zrml/swaps/src/weights.rs | 286 +-- 93 files changed, 2997 insertions(+), 2617 deletions(-) rename node/src/{command_helper.rs => benchmarking.rs} (73%) diff --git a/Cargo.lock b/Cargo.lock index 562b5fdc3..dfd95203a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,16 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ - "gimli", + "gimli 0.26.2", +] + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.0", ] [[package]] @@ -108,9 +117,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "approx" @@ -123,9 +132,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.2.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d47fbf90d5149a107494b15a7dc8d69b351be2db3bb9691740e88ec17fd880" +checksum = "b0224938f92e7aef515fac2ff2d18bd1115c1394ddf4a092e0c87e8be9499ee5" dependencies = [ "derive_arbitrary", ] @@ -236,7 +245,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -264,7 +273,7 @@ dependencies = [ "futures-lite", "libc", "signal-hook", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -318,9 +327,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.59" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" +checksum = "689894c2db1ea643a50834b999abf1c110887402542955ff5451dab8f861f9ed" dependencies = [ "proc-macro2", "quote", @@ -342,9 +351,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" [[package]] name = "atty" @@ -352,7 +361,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -379,16 +388,16 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ - "addr2line", + "addr2line 0.19.0", "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.5.4", - "object 0.29.0", + "miniz_oxide", + "object 0.30.2", "rustc-demangle", ] @@ -416,6 +425,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "battery-station-runtime" version = "0.3.8" @@ -525,8 +540,9 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ + "async-trait", "beefy-primitives", "fnv", "futures 0.3.25", @@ -537,6 +553,7 @@ dependencies = [ "parking_lot 0.12.1", "sc-chain-spec", "sc-client-api", + "sc-consensus", "sc-finality-grandpa", "sc-keystore", "sc-network", @@ -559,7 +576,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -579,7 +596,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "beefy-primitives", "sp-api", @@ -588,7 +605,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -653,9 +670,9 @@ dependencies = [ [[package]] name = "blake2" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ "digest 0.10.6", ] @@ -776,11 +793,12 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.17" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" dependencies = [ "memchr", + "serde", ] [[package]] @@ -794,9 +812,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byte-slice-cast" @@ -835,9 +853,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +checksum = "c77df041dc383319cc661b428b6961a005db4d6808d5e12536931b1ca9556055" dependencies = [ "serde", ] @@ -859,16 +877,16 @@ checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", - "semver 1.0.14", + "semver 1.0.16", "serde", "serde_json", ] [[package]] name = "cc" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" dependencies = [ "jobserver", ] @@ -882,6 +900,15 @@ dependencies = [ "nom", ] +[[package]] +name = "cfg-expr" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -1015,7 +1042,7 @@ version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro-error", "proc-macro2", "quote", @@ -1064,12 +1091,12 @@ dependencies = [ [[package]] name = "comfy-table" -version = "5.0.1" +version = "6.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b103d85ca6e209388771bfb7aa6b68a7aeec4afbf6f0a0264bfbf50360e5212e" +checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" dependencies = [ - "strum 0.23.0", - "strum_macros 0.23.1", + "strum", + "strum_macros", "unicode-width", ] @@ -1108,9 +1135,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ "crossbeam-utils", ] @@ -1202,7 +1229,7 @@ dependencies = [ "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli", + "gimli 0.26.2", "log", "regalloc2", "smallvec", @@ -1365,7 +1392,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.6", - "typenum 1.15.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1421,7 +1448,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "clap", "parity-scale-codec", @@ -1436,7 +1463,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1460,7 +1487,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1481,7 +1508,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1505,7 +1532,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1530,7 +1557,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", @@ -1554,7 +1581,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1582,7 +1609,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1600,8 +1627,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ + "bytes", "cumulus-pallet-parachain-system-proc-macro", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", @@ -1630,7 +1658,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1641,7 +1669,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1658,7 +1686,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -1677,7 +1705,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "frame-support", "parity-scale-codec", @@ -1693,7 +1721,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1716,7 +1744,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "futures 0.3.25", @@ -1729,10 +1757,11 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "frame-support", + "log", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain", @@ -1741,19 +1770,20 @@ dependencies = [ "sp-std", "sp-trie", "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.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures 0.3.25", "futures-timer", - "parking_lot 0.12.1", "polkadot-cli", "polkadot-client", "polkadot-service", @@ -1776,7 +1806,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1799,7 +1829,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "async-trait", "backoff", @@ -1818,6 +1848,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-storage", + "tokio", "tracing", "url", ] @@ -1825,7 +1856,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -1863,22 +1894,23 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-pre.1" +version = "4.0.0-pre.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf" +checksum = "67bc65846be335cb20f4e52d49a437b773a2c1fdb42b19fc84e79e6f6771536f" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.6.4", + "cfg-if 1.0.0", + "fiat-crypto", + "packed_simd_2", + "platforms 3.0.2", "subtle", "zeroize", ] [[package]] name = "cxx" -version = "1.0.83" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +checksum = "b61a7545f753a88bcbe0a70de1fcc0221e10bfc752f576754fa91e663db1622e" dependencies = [ "cc", "cxxbridge-flags", @@ -1888,9 +1920,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.83" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +checksum = "f464457d494b5ed6905c63b0c4704842aba319084a0a3561cdc1359536b53200" dependencies = [ "cc", "codespan-reporting", @@ -1903,15 +1935,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.83" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" +checksum = "43c7119ce3a3701ed81aca8410b9acf6fc399d2629d057b87e2efa4e63a3aaea" [[package]] name = "cxxbridge-macro" -version = "1.0.83" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +checksum = "65e07508b90551e610910fa648a1878991d367064997a596135b86df30daf07e" dependencies = [ "proc-macro2", "quote", @@ -1920,9 +1952,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "data-encoding-macro" @@ -1966,9 +1998,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.2.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903dff04948f22033ca30232ab8eca2c3fc4c913a8b6a34ee5199699814817f" +checksum = "cf460bbff5f571bfc762da5102729f59f338be7db17a21fade44c5c4f5005350" dependencies = [ "proc-macro2", "quote", @@ -2076,9 +2108,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a6eee2d5d0d113f015688310da018bd1d864d86bd567c8fca9c266889e1bfa" +checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313" [[package]] name = "dyn-clonable" @@ -2103,9 +2135,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" +checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" [[package]] name = "ecdsa" @@ -2121,9 +2153,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] @@ -2142,6 +2174,20 @@ dependencies = [ "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.8.0" @@ -2172,7 +2218,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "syn", @@ -2200,9 +2246,9 @@ dependencies = [ [[package]] name = "enumn" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038b1afa59052df211f9efd58f8b1d84c242935ede1c3dbaed26b018a9e06ae2" +checksum = "e88bcb3a067a6555d577aba299e75eff9942da276e6506fc6274327daa026132" dependencies = [ "proc-macro2", "quote", @@ -2222,6 +2268,19 @@ dependencies = [ "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" @@ -2354,33 +2413,39 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a214f5bb88731d436478f3ae1f8a277b62124089ba9fb67f4f93fb100ef73c90" + [[package]] name = "file-per-thread-logger" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f" +checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger", + "env_logger 0.10.0", "log", ] [[package]] name = "filetime" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "finality-grandpa" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" +checksum = "e24e6c429951433ccb7c87fd528c60084834dcd14763182c1f83291bcde24c34" dependencies = [ "either", "futures 0.3.25", @@ -2418,7 +2483,7 @@ checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] @@ -2430,7 +2495,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", ] @@ -2447,7 +2512,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -2459,6 +2524,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", + "sp-core", "sp-io", "sp-runtime", "sp-runtime-interface", @@ -2469,7 +2535,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "Inflector", "chrono", @@ -2520,7 +2586,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2531,7 +2597,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2547,10 +2613,11 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", + "frame-try-runtime", "parity-scale-codec", "scale-info", "sp-core", @@ -2575,7 +2642,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "bitflags", "frame-metadata", @@ -2589,6 +2656,7 @@ dependencies = [ "scale-info", "serde", "smallvec", + "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", @@ -2605,10 +2673,12 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "Inflector", + "cfg-expr", "frame-support-procedural-tools", + "itertools", "proc-macro2", "quote", "syn", @@ -2617,7 +2687,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2629,7 +2699,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro2", "quote", @@ -2639,7 +2709,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "log", @@ -2656,7 +2726,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -2671,7 +2741,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "sp-api", @@ -2680,9 +2750,10 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", + "parity-scale-codec", "sp-api", "sp-runtime", "sp-std", @@ -2872,7 +2943,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.15.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2881,7 +2952,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ - "typenum 1.15.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check", ] @@ -2940,17 +3011,23 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" + [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ "aho-corasick", "bstr", @@ -3003,9 +3080,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.5" +version = "4.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd" +checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" dependencies = [ "log", "pest", @@ -3048,15 +3125,6 @@ dependencies = [ "ahash", ] -[[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.0" @@ -3072,6 +3140,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -3198,9 +3275,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", @@ -3369,6 +3446,16 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" +[[package]] +name = "io-lifetimes" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "ip_network" version = "0.4.1" @@ -3389,9 +3476,21 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" + +[[package]] +name = "is-terminal" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes 1.0.4", + "rustix 0.36.7", + "windows-sys", +] [[package]] name = "itertools" @@ -3404,9 +3503,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" @@ -3428,9 +3527,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e017217fcd18da0a25296d3693153dd19c8a6aadab330b3595285d075385d1" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-server", @@ -3443,9 +3542,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce395539a14d3ad4ec1256fde105abd36a2da25d578a291cabe98f45adfdb111" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" dependencies = [ "futures-util", "http", @@ -3464,9 +3563,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16efcd4477de857d4a2195a45769b2fe9ebb54f3ef5a4221d3b014a4fe33ec0b" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" dependencies = [ "anyhow", "arrayvec 0.7.2", @@ -3477,6 +3576,7 @@ dependencies = [ "futures-timer", "futures-util", "globset", + "http", "hyper", "jsonrpsee-types", "lazy_static", @@ -3489,14 +3589,15 @@ dependencies = [ "thiserror", "tokio", "tracing", + "tracing-futures", "unicase", ] [[package]] name = "jsonrpsee-http-server" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdd69efeb3ce2cba767f126872f4eeb4624038a29098e75d77608b2b4345ad03" +checksum = "03802f0373a38c2420c70b5144742d800b509e2937edc4afb116434f07120117" dependencies = [ "futures-channel", "futures-util", @@ -3507,13 +3608,14 @@ dependencies = [ "serde_json", "tokio", "tracing", + "tracing-futures", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874cf3f6a027cebf36cae767feca9aa2e8a8f799880e49eb5540819fcbd8eada" +checksum = "bd67957d4280217247588ac86614ead007b301ca2fa9f19c19f880a536f029e3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3523,9 +3625,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcf76cd316f5d3ad48138085af1f45e2c58c98e02f0779783dbb034d43f7c86" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" dependencies = [ "anyhow", "beef", @@ -3537,10 +3639,11 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee043cb5dd0d51d3eb93432e998d5bae797691a7b10ec4a325e036bcdb48c48a" +checksum = "6ee5feddd5188e62ac08fcf0e56478138e581509d4730f3f7be9b57dd402a4ff" dependencies = [ + "http", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -3548,12 +3651,13 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-server" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2e4d266774a671f8def3794255b28eddd09b18d76e0b913fa439f34588c0a" +checksum = "d488ba74fb369e5ab68926feb75a483458b88e768d44319f37e4ecad283c7325" dependencies = [ "futures-channel", "futures-util", + "http", "jsonrpsee-core", "jsonrpsee-types", "serde_json", @@ -3562,6 +3666,7 @@ dependencies = [ "tokio-stream", "tokio-util", "tracing", + "tracing-futures", ] [[package]] @@ -3587,8 +3692,8 @@ dependencies = [ [[package]] name = "kusama-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-primitives", "bitvec", @@ -3624,6 +3729,7 @@ dependencies = [ "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -3679,8 +3785,8 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "polkadot-primitives", @@ -3751,9 +3857,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.138" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libfuzzer-sys" @@ -3786,6 +3892,12 @@ 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.6" @@ -3941,7 +4053,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" dependencies = [ "asynchronous-codec", - "base64", + "base64 0.13.1", "byteorder", "bytes", "fnv", @@ -4329,7 +4441,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", - "base64", + "base64 0.13.1", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", @@ -4338,7 +4450,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.9.9", - "typenum 1.15.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4383,9 +4495,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] @@ -4427,6 +4539,12 @@ version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -4630,15 +4748,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.6.2" @@ -4657,13 +4766,13 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "moonbeam-vrf" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.26#5d24d606a8a2cfeb75a3ab95b77087ebe6522cb0" +source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" dependencies = [ "nimbus-primitives", "parity-scale-codec", @@ -4778,7 +4887,7 @@ dependencies = [ "rand 0.8.5", "rand_distr", "simba", - "typenum 1.15.0", + "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4876,7 +4985,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.26#34792127cfe1a3a446b097b52fcd41830cdd24c5" +source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -4907,7 +5016,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.26#34792127cfe1a3a446b097b52fcd41830cdd24c5" +source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" dependencies = [ "async-trait", "frame-benchmarking", @@ -4947,9 +5056,9 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -4968,9 +5077,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" dependencies = [ "num-traits", ] @@ -5025,16 +5134,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", + "libm 0.2.6", ] [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] @@ -5052,18 +5161,18 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "opaque-debug" @@ -5086,7 +5195,7 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-trait", "dyn-clonable", @@ -5102,7 +5211,7 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" version = "0.0.1" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "expander 0.0.6", "itertools", @@ -5125,7 +5234,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "frame-system", @@ -5144,7 +5253,7 @@ dependencies = [ [[package]] name = "orml-benchmarking" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5164,7 +5273,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "frame-system", @@ -5181,7 +5290,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "frame-system", @@ -5196,7 +5305,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5214,7 +5323,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "frame-system", @@ -5229,7 +5338,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "parity-scale-codec", @@ -5243,7 +5352,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "frame-support", "orml-traits", @@ -5257,7 +5366,7 @@ dependencies = [ [[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.26#33dbc5e35305d0cf5937c896dae8655ca7da95d8" +source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -5290,10 +5399,20 @@ dependencies = [ "stable_deref_trait", ] +[[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", +] + [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5309,7 +5428,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.26#34792127cfe1a3a446b097b52fcd41830cdd24c5" +source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" dependencies = [ "frame-benchmarking", "frame-support", @@ -5329,7 +5448,7 @@ dependencies = [ [[package]] name = "pallet-author-mapping" version = "2.0.5" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.26#5d24d606a8a2cfeb75a3ab95b77087ebe6522cb0" +source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" dependencies = [ "frame-benchmarking", "frame-support", @@ -5347,7 +5466,7 @@ dependencies = [ [[package]] name = "pallet-author-slot-filter" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.26#34792127cfe1a3a446b097b52fcd41830cdd24c5" +source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" dependencies = [ "frame-benchmarking", "frame-support", @@ -5365,7 +5484,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5381,7 +5500,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5396,7 +5515,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5420,7 +5539,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5440,7 +5559,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5455,7 +5574,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "beefy-primitives", "frame-support", @@ -5471,7 +5590,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -5494,7 +5613,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5512,7 +5631,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5531,7 +5650,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5548,7 +5667,7 @@ dependencies = [ [[package]] name = "pallet-crowdloan-rewards" version = "0.6.0" -source = "git+https://github.com/zeitgeistpm/crowdloan-rewards?branch=polkadot-v0.9.26#1dab0b1971f80c707e3fa4ae59d597d099f23980" +source = "git+https://github.com/zeitgeistpm/crowdloan-rewards?branch=moonbeam-polkadot-v0.9.29#d2c6eb95def2208af2497bbe7e0459b74586762d" dependencies = [ "ed25519-dalek", "frame-benchmarking", @@ -5570,7 +5689,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5586,7 +5705,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5603,13 +5722,13 @@ dependencies = [ "sp-runtime", "sp-std", "static_assertions", - "strum 0.23.0", + "strum", ] [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5622,7 +5741,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5640,7 +5759,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5655,7 +5774,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5678,7 +5797,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5694,7 +5813,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5714,7 +5833,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5731,7 +5850,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5748,7 +5867,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5766,7 +5885,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5781,7 +5900,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5796,7 +5915,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5813,7 +5932,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5829,10 +5948,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-nomination-pools-runtime-api" +version = "1.0.0-dev" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-std", +] + [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5849,7 +5978,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5872,7 +6001,7 @@ dependencies = [ [[package]] name = "pallet-parachain-staking" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.26#5d24d606a8a2cfeb75a3ab95b77087ebe6522cb0" +source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" dependencies = [ "frame-benchmarking", "frame-support", @@ -5890,7 +6019,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5906,7 +6035,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5921,7 +6050,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5935,7 +6064,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5950,7 +6079,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -5966,7 +6095,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -5987,7 +6116,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6003,7 +6132,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -6017,7 +6146,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6040,7 +6169,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6051,7 +6180,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "sp-arithmetic", @@ -6060,7 +6189,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -6074,7 +6203,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6092,7 +6221,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6111,7 +6240,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-support", "frame-system", @@ -6127,7 +6256,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6142,7 +6271,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6153,7 +6282,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6170,7 +6299,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6186,7 +6315,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6200,8 +6329,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "frame-system", @@ -6218,8 +6347,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6236,7 +6365,7 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.26#be9e23c377555cabb867326ace51e0ab72bee1b9" +source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -6267,13 +6396,14 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.2.1" +version = "3.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" +checksum = "e7ab01d0f889e957861bc65888d5ccbe82c158d0270136ba46820d43837cdf72" dependencies = [ "arrayvec 0.7.2", "bitvec", "byte-slice-cast", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -6281,9 +6411,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.3" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6353,7 +6483,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.5", + "parking_lot_core 0.8.6", ] [[package]] @@ -6363,14 +6493,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.5", + "parking_lot_core 0.9.6", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if 1.0.0", "instant", @@ -6382,22 +6512,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "paste" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" [[package]] name = "pbkdf2" @@ -6431,9 +6561,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.5.1" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0" +checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" dependencies = [ "thiserror", "ucd-trie", @@ -6441,9 +6571,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.1" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344" +checksum = "241cda393b0cdd65e62e07e12454f1f25d57017dcc514b1514cd3c4645e3a0a6" dependencies = [ "pest", "pest_generator", @@ -6451,9 +6581,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.1" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c" +checksum = "46b53634d8c8196302953c74d5352f33d0c512a9499bd2ce468fc9f4128fa27c" dependencies = [ "pest", "pest_meta", @@ -6464,13 +6594,13 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.5.1" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20" +checksum = "0ef4f1332a8d4678b41966bb4cc1d0676880e84183a1ecc3f4b69f03e99c7a51" dependencies = [ "once_cell", "pest", - "sha1", + "sha2 0.10.6", ] [[package]] @@ -6533,10 +6663,16 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + [[package]] name = "polkadot-approval-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -6550,8 +6686,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -6564,8 +6700,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "derive_more", "fatality", @@ -6587,8 +6723,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "fatality", "futures 0.3.25", @@ -6608,8 +6744,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "clap", "frame-benchmarking-cli", @@ -6625,6 +6761,7 @@ dependencies = [ "sc-sysinfo", "sc-tracing", "sp-core", + "sp-keyring", "sp-trie", "substrate-build-script-utils", "thiserror", @@ -6633,8 +6770,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -6673,8 +6810,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "always-assert", "fatality", @@ -6694,8 +6831,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -6707,8 +6844,8 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "derive_more", "fatality", @@ -6730,8 +6867,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -6744,8 +6881,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "futures-timer", @@ -6764,12 +6901,13 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "always-assert", "async-trait", "bytes", + "fatality", "futures 0.3.25", "parity-scale-codec", "parking_lot 0.12.1", @@ -6779,14 +6917,16 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-network", + "sc-network-common", "sp-consensus", + "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-collation-generation" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "parity-scale-codec", @@ -6803,8 +6943,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bitvec", "derive_more", @@ -6832,8 +6972,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bitvec", "futures 0.3.25", @@ -6852,8 +6992,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bitvec", "fatality", @@ -6871,8 +7011,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -6886,8 +7026,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-trait", "futures 0.3.25", @@ -6904,8 +7044,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -6919,8 +7059,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "futures-timer", @@ -6936,8 +7076,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "fatality", "futures 0.3.25", @@ -6955,8 +7095,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-trait", "futures 0.3.25", @@ -6972,8 +7112,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bitvec", "fatality", @@ -6990,8 +7130,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "always-assert", "assert_matches", @@ -7022,8 +7162,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "polkadot-node-primitives", @@ -7038,25 +7178,24 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "futures 0.3.25", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", + "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-api", - "sp-authority-discovery", "sp-consensus-babe", "tracing-gum", ] [[package]] name = "polkadot-node-jaeger" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-std", "lazy_static", @@ -7073,8 +7212,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bs58", "futures 0.3.25", @@ -7092,13 +7231,14 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-trait", "derive_more", "fatality", "futures 0.3.25", + "hex", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -7106,15 +7246,15 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", - "strum 0.24.1", + "strum", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-primitives" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bounded-vec", "futures 0.3.25", @@ -7135,8 +7275,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7145,9 +7285,10 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ + "async-trait", "derive_more", "futures 0.3.25", "orchestra", @@ -7158,14 +7299,17 @@ dependencies = [ "polkadot-statement-table", "sc-network", "smallvec", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-trait", "derive_more", @@ -7197,9 +7341,10 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ + "async-trait", "futures 0.3.25", "futures-timer", "lru 0.7.8", @@ -7219,8 +7364,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "derive_more", "frame-support", @@ -7236,10 +7381,10 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ - "env_logger", + "env_logger 0.9.3", "kusama-runtime", "log", "polkadot-erasure-coding", @@ -7251,8 +7396,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bitvec", "frame-system", @@ -7281,8 +7426,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7313,8 +7458,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-primitives", "bitvec", @@ -7346,6 +7491,9 @@ dependencies = [ "pallet-indices", "pallet-membership", "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -7398,8 +7546,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-primitives", "bitvec", @@ -7445,8 +7593,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "polkadot-primitives", @@ -7457,8 +7605,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bs58", "parity-scale-codec", @@ -7469,8 +7617,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "bitflags", "bitvec", @@ -7512,12 +7660,13 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "async-trait", "beefy-gadget", "beefy-primitives", + "frame-support", "frame-system-rpc-runtime-api", "futures 0.3.25", "hex-literal", @@ -7575,11 +7724,11 @@ dependencies = [ "sc-consensus", "sc-consensus-babe", "sc-consensus-slots", - "sc-consensus-uncles", "sc-executor", "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-offchain", "sc-service", "sc-sync-state-rpc", @@ -7615,8 +7764,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -7636,8 +7785,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -7646,8 +7795,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-primitives", "bitvec", @@ -7707,8 +7856,8 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-benchmarking", "frame-system", @@ -7737,6 +7886,7 @@ dependencies = [ "sc-executor", "sc-finality-grandpa", "sc-network", + "sc-network-common", "sc-service", "sc-tracing", "sc-transaction-pool", @@ -7760,16 +7910,16 @@ dependencies = [ [[package]] name = "polling" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166ca89eb77fd403230b9c156612965a81e094ec6ec3aa13663d4c8b113fa748" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" dependencies = [ "autocfg", "cfg-if 1.0.0", "libc", "log", "wepoll-ffi", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -7817,7 +7967,7 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "coarsetime", "crossbeam-queue", @@ -7866,9 +8016,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" dependencies = [ "unicode-ident", ] @@ -7929,7 +8079,7 @@ dependencies = [ "bytes", "cfg-if 1.0.0", "cmake", - "heck 0.4.0", + "heck", "itertools", "lazy_static", "log", @@ -8006,9 +8156,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -8127,11 +8277,10 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ - "crossbeam-deque", "either", "rayon-core", ] @@ -8183,18 +8332,18 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b15debb4f9d60d767cd8ca9ef7abb2452922f3214671ff052defc7f3502c44" +checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfa8511e9e94fd3de6585a3d3cd00e01ed556dc9814829280af0e8dc72a8f36" +checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" dependencies = [ "proc-macro2", "quote", @@ -8215,9 +8364,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -8254,9 +8403,9 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ - "env_logger", + "env_logger 0.9.3", "jsonrpsee", "log", "parity-scale-codec", @@ -8287,12 +8436,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "rfc6979" version = "0.1.0" @@ -8331,8 +8474,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -8400,8 +8543,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "polkadot-primitives", @@ -8412,11 +8555,12 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" dependencies = [ "libc", + "rtoolbox", "winapi", ] @@ -8435,6 +8579,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "rtoolbox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -8468,7 +8622,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.14", + "semver 1.0.16", ] [[package]] @@ -8496,14 +8650,28 @@ dependencies = [ "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 1.0.4", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys", ] [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -8525,18 +8693,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64", + "base64 0.21.0", ] [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "rw-stream-sink" @@ -8551,9 +8719,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "safe-mix" @@ -8585,7 +8753,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "sp-core", @@ -8596,7 +8764,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -8609,7 +8777,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "sc-client-api", - "sc-network", + "sc-network-common", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -8623,7 +8791,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "futures-timer", @@ -8646,7 +8814,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8662,13 +8830,13 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "impl-trait-for-tuples", "memmap2", "parity-scale-codec", "sc-chain-spec-derive", - "sc-network", + "sc-network-common", "sc-telemetry", "serde", "serde_json", @@ -8679,7 +8847,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8690,7 +8858,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "chrono", "clap", @@ -8729,7 +8897,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "fnv", "futures 0.3.25", @@ -8757,7 +8925,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "hash-db", "kvdb", @@ -8782,7 +8950,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -8806,7 +8974,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -8835,7 +9003,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "fork-tree", @@ -8848,7 +9016,6 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "rand 0.7.3", - "retain_mut", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -8878,7 +9045,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -8900,7 +9067,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8913,7 +9080,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "assert_matches", "async-trait", @@ -8947,7 +9114,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -8969,21 +9136,10 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sc-consensus-uncles" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" -dependencies = [ - "sc-client-api", - "sp-authorship", - "sp-runtime", - "thiserror", -] - [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9010,14 +9166,13 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "environmental", "parity-scale-codec", "sc-allocator", "sp-maybe-compressed-blob", "sp-sandbox", - "sp-serializer", "sp-wasm-interface", "thiserror", "wasm-instrument", @@ -9027,7 +9182,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "parity-scale-codec", @@ -9042,7 +9197,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9050,6 +9205,7 @@ dependencies = [ "once_cell", "parity-scale-codec", "parity-wasm 0.42.2", + "rustix 0.33.7", "rustix 0.35.13", "sc-allocator", "sc-executor-common", @@ -9062,7 +9218,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "ahash", "async-trait", @@ -9082,6 +9238,7 @@ dependencies = [ "sc-consensus", "sc-keystore", "sc-network", + "sc-network-common", "sc-network-gossip", "sc-telemetry", "sc-utils", @@ -9102,7 +9259,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "finality-grandpa", "futures 0.3.25", @@ -9123,7 +9280,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "ansi_term", "futures 0.3.25", @@ -9131,7 +9288,7 @@ dependencies = [ "log", "parity-util-mem", "sc-client-api", - "sc-network", + "sc-network-common", "sc-transaction-pool-api", "sp-blockchain", "sp-runtime", @@ -9140,7 +9297,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "hex", @@ -9155,7 +9312,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "asynchronous-codec", @@ -9184,8 +9341,6 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-network-common", - "sc-network-light", - "sc-network-sync", "sc-peerset", "sc-utils", "serde", @@ -9195,7 +9350,6 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -9207,20 +9361,30 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ + "async-trait", + "bitflags", + "bytes", "futures 0.3.25", "libp2p", "parity-scale-codec", "prost-build", + "sc-consensus", "sc-peerset", + "serde", "smallvec", + "sp-blockchain", + "sp-consensus", + "sp-finality-grandpa", + "sp-runtime", + "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "ahash", "futures 0.3.25", @@ -9228,7 +9392,8 @@ dependencies = [ "libp2p", "log", "lru 0.7.8", - "sc-network", + "sc-network-common", + "sc-peerset", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -9237,9 +9402,10 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", + "hex", "libp2p", "log", "parity-scale-codec", @@ -9257,12 +9423,11 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ - "bitflags", - "either", "fork-tree", "futures 0.3.25", + "hex", "libp2p", "log", "lru 0.7.8", @@ -9286,7 +9451,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "bytes", "fnv", @@ -9295,13 +9460,15 @@ dependencies = [ "hex", "hyper", "hyper-rustls", + "libp2p", "num_cpus", "once_cell", "parity-scale-codec", "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", - "sc-network", + "sc-network-common", + "sc-peerset", "sc-utils", "sp-api", "sp-core", @@ -9314,7 +9481,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "libp2p", @@ -9327,7 +9494,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9336,7 +9503,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "hash-db", @@ -9366,7 +9533,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -9389,7 +9556,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -9402,7 +9569,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "directories", @@ -9427,6 +9594,8 @@ dependencies = [ "sc-keystore", "sc-network", "sc-network-common", + "sc-network-light", + "sc-network-sync", "sc-offchain", "sc-rpc", "sc-rpc-server", @@ -9467,7 +9636,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "parity-scale-codec", @@ -9481,7 +9650,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9500,7 +9669,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "libc", @@ -9519,7 +9688,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "chrono", "futures 0.3.25", @@ -9537,7 +9706,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "ansi_term", "atty", @@ -9568,7 +9737,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9579,7 +9748,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "futures-timer", @@ -9588,7 +9757,6 @@ dependencies = [ "parity-scale-codec", "parity-util-mem", "parking_lot 0.12.1", - "retain_mut", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -9606,7 +9774,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "log", @@ -9619,7 +9787,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "futures-timer", @@ -9631,9 +9799,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d8a765117b237ef233705cc2cc4c6a27fccd46eea6ef0c8c6dae5f3ef407f8" +checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -9645,9 +9813,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdcd47b380d8c4541044e341dcd9475f55ba37ddc50c908d945fc036a8642496" +checksum = "303959cf613a6f6efd19ed4b4ad5bf79966a13352716299ad532cfb115f4205c" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9657,12 +9825,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys", ] [[package]] @@ -9691,9 +9858,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "sct" @@ -9719,18 +9886,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.21.3" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.4.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" dependencies = [ "cc", ] @@ -9746,9 +9913,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "645926f31b250a2dca3c232496c2d898d91036e45ca0e97e0e2390c54e11be36" dependencies = [ "bitflags", "core-foundation", @@ -9759,9 +9926,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -9787,9 +9954,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" dependencies = [ "serde", ] @@ -9802,18 +9969,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.149" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.149" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -9822,9 +9989,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", @@ -9843,7 +10010,7 @@ dependencies = [ [[package]] name = "session-keys-primitives" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.26#5d24d606a8a2cfeb75a3ab95b77087ebe6522cb0" +source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" dependencies = [ "async-trait", "frame-support", @@ -9874,17 +10041,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.6", -] - [[package]] name = "sha2" version = "0.8.2" @@ -10004,8 +10160,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "enumn", "parity-scale-codec", @@ -10044,7 +10200,7 @@ dependencies = [ "aes-gcm", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-pre.1", + "curve25519-dalek 4.0.0-pre.5", "rand_core 0.6.4", "ring", "rustc_version 0.4.0", @@ -10068,7 +10224,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "flate2", "futures 0.3.25", @@ -10081,7 +10237,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "hash-db", "log", @@ -10091,6 +10247,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-std", + "sp-trie", "sp-version", "thiserror", ] @@ -10098,7 +10255,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "blake2", "proc-macro-crate", @@ -10110,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10123,7 +10280,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "integer-sqrt", "num-traits", @@ -10138,7 +10295,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10151,7 +10308,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "parity-scale-codec", @@ -10163,7 +10320,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "sp-api", @@ -10175,7 +10332,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures 0.3.25", "log", @@ -10193,7 +10350,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -10212,7 +10369,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "parity-scale-codec", @@ -10230,7 +10387,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "merlin", @@ -10253,7 +10410,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10267,7 +10424,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10280,14 +10437,14 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "base58", "bitflags", "blake2-rfc", "byteorder", "dyn-clonable", - "ed25519-dalek", + "ed25519-zebra", "futures 0.3.25", "hash-db", "hash256-std-hasher", @@ -10326,7 +10483,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "blake2", "byteorder", @@ -10340,7 +10497,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro2", "quote", @@ -10351,7 +10508,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10360,7 +10517,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "proc-macro2", "quote", @@ -10370,7 +10527,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "environmental", "parity-scale-codec", @@ -10381,7 +10538,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "finality-grandpa", "log", @@ -10399,7 +10556,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10413,8 +10570,10 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ + "bytes", + "ed25519-dalek", "futures 0.3.25", "hash-db", "libsecp256k1", @@ -10438,18 +10597,18 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "lazy_static", "sp-core", "sp-runtime", - "strum 0.23.0", + "strum", ] [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -10466,7 +10625,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "thiserror", "zstd", @@ -10475,7 +10634,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "parity-scale-codec", @@ -10490,7 +10649,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10504,7 +10663,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "sp-api", "sp-core", @@ -10514,7 +10673,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "backtrace", "lazy_static", @@ -10524,7 +10683,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "rustc-hash", "serde", @@ -10534,7 +10693,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "either", "hash256-std-hasher", @@ -10556,8 +10715,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ + "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", @@ -10573,7 +10733,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "Inflector", "proc-macro-crate", @@ -10585,7 +10745,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "parity-scale-codec", @@ -10596,19 +10756,10 @@ dependencies = [ "wasmi", ] -[[package]] -name = "sp-serializer" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10622,7 +10773,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "scale-info", @@ -10633,7 +10784,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "hash-db", "log", @@ -10655,12 +10806,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10673,7 +10824,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "log", "sp-core", @@ -10686,7 +10837,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures-timer", @@ -10702,7 +10853,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "sp-std", @@ -10714,7 +10865,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "sp-api", "sp-runtime", @@ -10723,7 +10874,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "log", @@ -10739,15 +10890,22 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ + "ahash", "hash-db", + "hashbrown 0.12.3", + "lazy_static", + "lru 0.7.8", "memory-db", + "nohash-hasher", "parity-scale-codec", + "parking_lot 0.12.1", "scale-info", "sp-core", "sp-std", "thiserror", + "tracing", "trie-db", "trie-root", ] @@ -10755,7 +10913,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10772,7 +10930,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10783,7 +10941,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "impl-trait-for-tuples", "log", @@ -10801,9 +10959,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.35.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0813c10b9dbdc842c2305f949f724c64866e4ef4d09c9151e96f6a2106773c" +checksum = "d44528162f980c0e03c71e005d334332c8da0aec9f2b0b4bdc557ed4a9f24776" dependencies = [ "Inflector", "num-format", @@ -10870,35 +11028,13 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strum" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" -dependencies = [ - "strum_macros 0.23.1", -] - [[package]] name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros 0.24.3", -] - -[[package]] -name = "strum_macros" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "rustversion", - "syn", + "strum_macros", ] [[package]] @@ -10907,7 +11043,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -10930,9 +11066,9 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ - "platforms", + "platforms 2.0.0", ] [[package]] @@ -10943,13 +11079,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0", + "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=v1.16.0)", ] [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.25", @@ -10970,7 +11106,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "futures-util", "hyper", @@ -10983,7 +11119,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "jsonrpsee", "log", @@ -11004,7 +11140,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "async-trait", "futures 0.3.25", @@ -11030,14 +11166,14 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "filetime", "sp-maybe-compressed-blob", - "strum 0.23.0", + "strum", "tempfile", "toml", "walkdir", @@ -11052,9 +11188,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -11122,9 +11258,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -11153,8 +11289,8 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "polkadot-primitives", @@ -11171,18 +11307,18 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -11284,9 +11420,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" dependencies = [ "autocfg", "bytes", @@ -11299,7 +11435,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys", ] [[package]] @@ -11352,9 +11488,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] @@ -11367,9 +11503,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.34" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "pin-project-lite 0.2.9", @@ -11390,11 +11526,11 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.26" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ - "lazy_static", + "once_cell", "valuable", ] @@ -11410,8 +11546,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -11421,8 +11557,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -11437,10 +11573,8 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ - "ahash", "lazy_static", "log", - "lru 0.7.8", "tracing-core", ] @@ -11479,9 +11613,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" +checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", "hashbrown 0.12.3", @@ -11544,16 +11678,17 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.26#1cca061ede75a4c693a3b71bd1b61d7275fe29e4" +source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" dependencies = [ "clap", + "frame-try-runtime", "jsonrpsee", "log", "parity-scale-codec", @@ -11575,9 +11710,9 @@ dependencies = [ [[package]] name = "tt-call" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" [[package]] name = "twox-hash" @@ -11593,9 +11728,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "typenum" @@ -11635,15 +11770,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "0046be40136ef78dc325e0edefccf84ccddacd0afcc1ca54103fa3c61bbdab1d" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" @@ -11654,12 +11789,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" - [[package]] name = "unicode-width" version = "0.1.10" @@ -11899,7 +12028,7 @@ checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" dependencies = [ "downcast-rs", "libc", - "libm", + "libm 0.2.6", "memory_units", "num-rational 0.2.4", "num-traits", @@ -11963,7 +12092,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" dependencies = [ "anyhow", - "base64", + "base64 0.13.1", "bincode", "directories-next", "file-per-thread-logger", @@ -11988,7 +12117,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli", + "gimli 0.26.2", "log", "more-asserts", "object 0.28.4", @@ -12006,7 +12135,7 @@ checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" dependencies = [ "anyhow", "cranelift-entity", - "gimli", + "gimli 0.26.2", "indexmap", "log", "more-asserts", @@ -12024,12 +12153,12 @@ version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" dependencies = [ - "addr2line", + "addr2line 0.17.0", "anyhow", "bincode", "cfg-if 1.0.0", "cpp_demangle", - "gimli", + "gimli 0.26.2", "log", "object 0.28.4", "region", @@ -12115,9 +12244,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] @@ -12133,8 +12262,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "beefy-primitives", "bitvec", @@ -12166,6 +12295,7 @@ dependencies = [ "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-preimage", @@ -12221,8 +12351,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "polkadot-primitives", @@ -12233,9 +12363,9 @@ dependencies = [ [[package]] name = "which" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", "libc", @@ -12292,19 +12422,6 @@ dependencies = [ "windows_x86_64_msvc 0.34.0", ] -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.42.0" @@ -12312,19 +12429,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc 0.42.1", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_msvc" @@ -12334,15 +12451,9 @@ checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" @@ -12352,15 +12463,9 @@ checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" -version = "0.36.1" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" @@ -12370,15 +12475,9 @@ checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" @@ -12388,21 +12487,15 @@ checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" @@ -12412,15 +12505,9 @@ checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winreg" @@ -12453,8 +12540,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -12467,8 +12554,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-support", "frame-system", @@ -12488,7 +12575,7 @@ dependencies = [ [[package]] name = "xcm-emulator" version = "0.1.0" -source = "git+https://github.com/shaunxw/xcm-simulator?rev=ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe#ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe" +source = "git+https://github.com/zeitgeistpm/xcm-simulator?branch=moonbeam-polkadot-v0.9.29#4d235aab4d2ab8527aceb8b5849ca4eb18a08a08" dependencies = [ "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12504,6 +12591,7 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-parachains", "quote", + "sp-arithmetic", "sp-io", "sp-std", "xcm", @@ -12512,8 +12600,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.26" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "frame-benchmarking", "frame-support", @@ -12530,8 +12618,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.26#d8785970175dce344f2a6ad1cd88297529a6dd59" +version = "0.9.29" +source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" dependencies = [ "Inflector", "proc-macro2", @@ -12600,6 +12688,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-rpc", "sc-rpc-api", "sc-service", @@ -12630,7 +12719,6 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", - "tracing-core", "try-runtime-cli", "zeitgeist-primitives", "zeitgeist-runtime", @@ -13105,10 +13193,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.4+zstd.1.5.2" +version = "2.0.5+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" +checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" dependencies = [ "cc", "libc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index d23a28b70..d38578d8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,33 +46,6 @@ members = [ "zrml/styx", ] resolver = "2" - -[patch."https://github.com/purestake/crowdloan-rewards"] -# This patch does ensure that crowdloan-rewards only uses partiytech dependencies. -# If it is not used, the Zeitgeist runtimes will contain duplicate crates from -# different repositories which results in bigger WASM-blobs, binary and the inability -# to compile with the "runtime-benchmarks" feature. -pallet-crowdloan-rewards = { git = "https://github.com/zeitgeistpm/crowdloan-rewards", branch = "polkadot-v0.9.26" } - -[patch."https://github.com/purestake/moonbeam"] -# Use dependencies from Paritytech -moonbeam-vrf = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.26" } -# Fix author-mapping migration -pallet-author-mapping = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.26" } -# Use dependencies from Paritytech -pallet-parachain-staking = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.26" } -session-keys-primitives = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.26" } - -[patch."https://github.com/purestake/nimbus"] -# Use dependencies from Paritytech -nimbus-consensus = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.26" } -# Use dependencies from Paritytech -nimbus-primitives = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.26" } -# Use dependencies from Paritytech -pallet-author-inherent = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.26" } -# Use dependencies from Paritytech -pallet-author-slot-filter = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.26" } - # The list of dependencies below (which can be both direct and indirect dependencies) are crates # that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of # their debug info might be missing) or to require to be frequently recompiled. We compile these diff --git a/misc/frame_weight_template.hbs b/misc/frame_weight_template.hbs index 7c49be588..8efbe31a4 100644 --- a/misc/frame_weight_template.hbs +++ b/misc/frame_weight_template.hbs @@ -44,22 +44,22 @@ impl {{pallet}}::weights::WeightInfo for WeightInfo {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - ({{underscore benchmark.base_weight}} as Weight) + Weight::from_ref_time({{underscore benchmark.base_weight}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)) + .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) {{/each}} } {{/each}} diff --git a/misc/orml_weight_template.hbs b/misc/orml_weight_template.hbs index f77d35c8e..e1e941790 100644 --- a/misc/orml_weight_template.hbs +++ b/misc/orml_weight_template.hbs @@ -45,22 +45,22 @@ impl {{pallet}}::WeightInfo for WeightInfo { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - ({{underscore benchmark.base_weight}} as Weight) + Weight::from_ref_time({{underscore benchmark.base_weight}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)) + .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) {{/each}} } {{/each}} diff --git a/misc/weight_template.hbs b/misc/weight_template.hbs index 49d63138d..f62c142d8 100644 --- a/misc/weight_template.hbs +++ b/misc/weight_template.hbs @@ -57,22 +57,22 @@ impl WeightInfoZeitgeist for WeightInfo { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - ({{underscore benchmark.base_weight}} as Weight) + Weight::from_ref_time({{underscore benchmark.base_weight}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)) + .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) {{/each}} } {{/each}} diff --git a/node/Cargo.toml b/node/Cargo.toml index bf6975d6c..a66b5e24b 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -3,103 +3,102 @@ name = "zeitgeist" path = "./src/main.rs" [build-dependencies] -substrate-build-script-utils = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +substrate-build-script-utils = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } [dependencies] -pallet-transaction-payment = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment-rpc = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-basic-authorship = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-cli = { branch = "polkadot-v0.9.26", features = ["wasmtime"], git = "https://github.com/paritytech/substrate" } -sc-client-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-consensus = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-executor = { branch = "polkadot-v0.9.26", features = ["wasmtime"], git = "https://github.com/paritytech/substrate" } -sc-keystore = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-rpc = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-rpc-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-service = { branch = "polkadot-v0.9.26", features = ["wasmtime"], git = "https://github.com/paritytech/substrate" } -sc-sysinfo = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-telemetry = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-transaction-pool = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-transaction-pool-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-block-builder = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-blockchain = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-consensus = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-core = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-inherents = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-keyring = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-offchain = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-session = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-storage = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-transaction-pool = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-trie = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -substrate-frame-rpc-system = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment-rpc = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-basic-authorship = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-cli = { branch = "moonbeam-polkadot-v0.9.29", features = ["wasmtime"], git = "https://github.com/zeitgeistpm/substrate" } +sc-client-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-consensus = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-executor = { branch = "moonbeam-polkadot-v0.9.29", features = ["wasmtime"], git = "https://github.com/zeitgeistpm/substrate" } +sc-keystore = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-rpc = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-rpc-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-service = { branch = "moonbeam-polkadot-v0.9.29", features = ["wasmtime"], git = "https://github.com/zeitgeistpm/substrate" } +sc-sysinfo = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-telemetry = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-transaction-pool-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-block-builder = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-blockchain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-consensus = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-core = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-inherents = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-keyring = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-offchain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-session = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-storage = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-trie = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +substrate-frame-rpc-system = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } # Try-Runtime -try-runtime-cli = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } +try-runtime-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } # Benchmark -frame-benchmarking = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -frame-benchmarking-cli = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +frame-benchmarking-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } # Cumulus -cumulus-client-cli = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-client-collator = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-client-consensus-common = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-client-consensus-relay-chain = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-client-network = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-client-service = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-core = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-parachain-inherent = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-relay-chain-inprocess-interface = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-relay-chain-interface = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-relay-chain-rpc-interface = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-client-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-client-collator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-client-consensus-common = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-client-consensus-relay-chain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-client-network = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-client-service = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-core = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-parachain-inherent = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-relay-chain-inprocess-interface = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-relay-chain-interface = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-relay-chain-rpc-interface = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } # Parachain -moonbeam-vrf = { tag = "v0.26.1", git = "https://github.com/purestake/moonbeam", optional = true } -nimbus-consensus = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-parachain-staking = { tag = "v0.26.1", git = "https://github.com/purestake/moonbeam", optional = true } +moonbeam-vrf = { tag = "v0.27.2-a", git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +nimbus-consensus = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-parachain-staking = { tag = "v0.27.2-a", git = "https://github.com/zeitgeistpm/moonbeam", optional = true } parity-scale-codec = { optional = true, version = "3.0.0" } -sc-chain-spec = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sc-network = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sc-tracing = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -serde = { features = ["derive"], optional = true, version = "1.0.137" } -session-keys-primitives = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -sp-keystore = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -substrate-prometheus-endpoint = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } +sc-chain-spec = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sc-network = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sc-network-common = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sc-tracing = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +serde = { features = ["derive"], optional = true, version = "1.0.144" } +session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +sp-keystore = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +substrate-prometheus-endpoint = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } # Polkadot -polkadot-cli = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-parachain = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-primitives = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-service = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-test-service = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-parachain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-service = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-test-service = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } # Standalone -sc-consensus-aura = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sc-finality-grandpa = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-consensus-aura = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-finality-grandpa = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +sc-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } # Utility cfg-if = { version = "1.0.0" } -clap = { version = "3.2.6", features = ["derive"] } +clap = { version = "3.2.20", features = ["derive"] } hex-literal = { version = "0.3.4" } -jsonrpsee = { version = "0.14.0", features = ["server"] } +jsonrpsee = { version = "0.15.1", features = ["server"] } log = { optional = true, version = "0.4.17" } -# TODO(#865): Remove in future Polkadot release -tracing-core = "=0.1.26" # Zeitgeist @@ -108,7 +107,6 @@ zeitgeist-primitives = { path = "../primitives" } zeitgeist-runtime = { path = "../runtime/zeitgeist", optional = true } zrml-liquidity-mining = { path = "../zrml/liquidity-mining" } zrml-swaps-rpc = { path = "../zrml/swaps/rpc" } - [features] default = ["with-battery-station-runtime", "with-zeitgeist-runtime"] parachain = [ @@ -142,6 +140,7 @@ parachain = [ "session-keys-primitives", "sc-chain-spec", "sc-network", + "sc-network-common", "sc-tracing", "serde", "sp-keystore", diff --git a/node/src/command_helper.rs b/node/src/benchmarking.rs similarity index 73% rename from node/src/command_helper.rs rename to node/src/benchmarking.rs index 0253d06dd..9845c461b 100644 --- a/node/src/command_helper.rs +++ b/node/src/benchmarking.rs @@ -25,18 +25,18 @@ use sp_inherents::{InherentData, InherentDataProvider}; use sp_keyring::Sr25519Keyring; use sp_runtime::{OpaqueExtrinsic, SaturatedConversion}; use std::{sync::Arc, time::Duration}; -use zeitgeist_primitives::types::Signature; +use zeitgeist_primitives::types::{AccountId, Balance, Signature}; /// Generates extrinsics for the `benchmark overhead` command. /// /// Note: Should only be used for benchmarking. -pub struct BenchmarkExtrinsicBuilder { +pub struct RemarksExtrinsicBuilder { client: Arc>, is_zeitgeist: bool, } impl - BenchmarkExtrinsicBuilder + RemarksExtrinsicBuilder { /// Creates a new [`Self`] from the given client. pub fn new(client: Arc>, is_zeitgeist: bool) -> Self { @@ -45,9 +45,17 @@ impl } impl - frame_benchmarking_cli::ExtrinsicBuilder for BenchmarkExtrinsicBuilder + frame_benchmarking_cli::ExtrinsicBuilder for RemarksExtrinsicBuilder { - fn remark(&self, nonce: u32) -> std::result::Result { + fn pallet(&self) -> &str { + "system" + } + + fn extrinsic(&self) -> &str { + "remark" + } + + fn build(&self, nonce: u32) -> std::result::Result { let acc = Sr25519Keyring::Bob.pair(); #[cfg(feature = "with-zeitgeist-runtime")] @@ -75,6 +83,76 @@ impl } } +/// Generates `Balances::TransferKeepAlive` extrinsics for the benchmarks. +/// +/// Note: Should only be used for benchmarking. +pub struct TransferKeepAliveBuilder { + client: Arc>, + dest: AccountId, + value: Balance, + is_zeitgeist: bool, +} + +impl + TransferKeepAliveBuilder +{ + /// Creates a new [`Self`] from the given client. + pub fn new( + client: Arc>, + dest: AccountId, + value: Balance, + is_zeitgeist: bool, + ) -> Self { + Self { client, dest, value, is_zeitgeist } + } +} + +impl + frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder +{ + fn pallet(&self) -> &str { + "balances" + } + + fn extrinsic(&self) -> &str { + "transfer_keep_alive" + } + + fn build(&self, nonce: u32) -> std::result::Result { + let acc = Sr25519Keyring::Bob.pair(); + #[cfg(feature = "with-zeitgeist-runtime")] + if self.is_zeitgeist { + return Ok(create_benchmark_extrinsic_zeitgeist( + self.client.as_ref(), + acc, + zeitgeist_runtime::BalancesCall::transfer_keep_alive { + dest: self.dest.clone().into(), + value: self.value, + } + .into(), + nonce, + ) + .into()); + } + #[cfg(feature = "with-battery-station-runtime")] + if !self.is_zeitgeist { + return Ok(create_benchmark_extrinsic_battery_station( + self.client.as_ref(), + acc, + battery_station_runtime::BalancesCall::transfer_keep_alive { + dest: self.dest.clone().into(), + value: self.value, + } + .into(), + nonce, + ) + .into()); + } + + Err(crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE) + } +} + /// Creates a transaction using the given `call`. /// /// Note: Should only be used for benchmarking. diff --git a/node/src/chain_spec/additional_chain_spec.rs b/node/src/chain_spec/additional_chain_spec.rs index 0498ef136..de4c9e73b 100644 --- a/node/src/chain_spec/additional_chain_spec.rs +++ b/node/src/chain_spec/additional_chain_spec.rs @@ -20,15 +20,19 @@ use { cumulus_primitives_core::ParaId, nimbus_primitives::NimbusId, pallet_parachain_staking::InflationInfo, + sp_runtime::{Perbill, Percent}, zeitgeist_primitives::types::{AccountId, Balance}, }; #[cfg(feature = "parachain")] pub struct AdditionalChainSpec { + pub blocks_per_round: u32, pub candidates: Vec<(AccountId, NimbusId, Balance)>, + pub collator_commission: Perbill, pub crowdloan_fund_pot: Balance, pub inflation_info: InflationInfo, - pub nominations: Vec<(AccountId, AccountId, Balance)>, + pub nominations: Vec<(AccountId, AccountId, Balance, Percent)>, + pub parachain_bond_reserve_percent: Percent, pub parachain_id: ParaId, } diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index 7c8835db4..4a56c2df9 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -34,7 +34,11 @@ use zeitgeist_primitives::{ #[cfg(feature = "parachain")] use { super::{Extensions, DEFAULT_COLLATOR_INFLATION_INFO}, - battery_station_runtime::{CollatorDeposit, EligibilityValue, PolkadotXcmConfig}, + crate::BATTERY_STATION_PARACHAIN_ID, + battery_station_runtime::{ + CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, + DefaultParachainBondReservePercent, EligibilityValue, PolkadotXcmConfig, + }, }; cfg_if::cfg_if! { @@ -56,15 +60,18 @@ fn additional_chain_spec_staging_battery_station( parachain_id: cumulus_primitives_core::ParaId, ) -> AdditionalChainSpec { AdditionalChainSpec { + blocks_per_round: DefaultBlocksPerRound::get(), candidates: vec![( hex!["302f6d7467ae2d7e3b9b962bfc3b9d929da9fae5f1e8c977a031ddf721b0790d"].into(), hex!["e6ea0b63b2b5b7247a1e8280350a14c5f9e7745dec2fe3428b68aa4167d48e66"] .unchecked_into(), DEFAULT_STAKING_AMOUNT_BATTERY_STATION, )], + collator_commission: DefaultCollatorCommission::get(), crowdloan_fund_pot: DEFAULT_INITIAL_CROWDLOAN_FUNDS_BATTERY_STATION, inflation_info: DEFAULT_COLLATOR_INFLATION_INFO, nominations: vec![], + parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), parachain_id, } } @@ -131,7 +138,7 @@ pub fn battery_station_staging_config() -> Result Result Result { generic_genesis( #[cfg(feature = "parachain")] AdditionalChainSpec { + blocks_per_round: DefaultBlocksPerRound::get(), candidates: vec![( get_account_id_from_seed::("Alice"), get_from_seed::("Alice"), super::battery_station::DEFAULT_STAKING_AMOUNT_BATTERY_STATION, )], + collator_commission: DefaultCollatorCommission::get(), crowdloan_fund_pot: zeitgeist_primitives::constants::BASE.saturating_mul(100), inflation_info: crate::chain_spec::DEFAULT_COLLATOR_INFLATION_INFO, nominations: vec![], - parachain_id: 2050_u32.into(), + parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), + parachain_id: crate::BATTERY_STATION_PARACHAIN_ID.into(), }, #[cfg(not(feature = "parachain"))] AdditionalChainSpec { @@ -105,7 +111,10 @@ pub fn dev_config() -> Result { None, Some(token_properties("DEV", battery_station_runtime::SS58Prefix::get())), #[cfg(feature = "parachain")] - crate::chain_spec::Extensions { relay_chain: "rococo-dev".into(), parachain_id: 2050_u32 }, + crate::chain_spec::Extensions { + relay_chain: "rococo-dev".into(), + parachain_id: crate::BATTERY_STATION_PARACHAIN_ID, + }, #[cfg(not(feature = "parachain"))] Default::default(), )) diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index fa2ebaa97..58340be30 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -150,14 +150,17 @@ macro_rules! generate_generic_genesis_function { parachain_info: $runtime::ParachainInfoConfig { parachain_id: acs.parachain_id }, #[cfg(feature = "parachain")] parachain_staking: $runtime::ParachainStakingConfig { + blocks_per_round: acs.blocks_per_round, candidates: acs .candidates .iter() .cloned() .map(|(account, _, bond)| (account, bond)) .collect(), + collator_commission: acs.collator_commission, inflation_config: acs.inflation_info, delegations: acs.nominations, + parachain_bond_reserve_percent: acs.parachain_bond_reserve_percent, }, #[cfg(feature = "parachain")] parachain_system: Default::default(), diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index dfdc7b20d..b5990c7bd 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -29,7 +29,11 @@ use zeitgeist_primitives::constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PT #[cfg(feature = "parachain")] use { super::{Extensions, DEFAULT_COLLATOR_INFLATION_INFO}, - zeitgeist_runtime::{CollatorDeposit, EligibilityValue, MinCollatorStk, PolkadotXcmConfig}, + crate::KUSAMA_PARACHAIN_ID, + zeitgeist_runtime::{ + CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, + DefaultParachainBondReservePercent, EligibilityValue, MinCollatorStk, PolkadotXcmConfig, + }, }; cfg_if::cfg_if! { @@ -72,6 +76,7 @@ fn additional_chain_spec_staging_zeitgeist( parachain_id: cumulus_primitives_core::ParaId, ) -> AdditionalChainSpec { AdditionalChainSpec { + blocks_per_round: DefaultBlocksPerRound::get(), candidates: vec![ ( hex!["524e9aac979cbb9ecdb7acd1635755c3b15696321a3345ca77f0ab0ae23f675a"].into(), @@ -92,9 +97,11 @@ fn additional_chain_spec_staging_zeitgeist( DEFAULT_STAKING_AMOUNT_ZEITGEIST, ), ], + collator_commission: DefaultCollatorCommission::get(), crowdloan_fund_pot: DEFAULT_INITIAL_CROWDLOAN_FUNDS_ZEITGEIST, inflation_info: DEFAULT_COLLATOR_INFLATION_INFO, nominations: vec![], + parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), parachain_id, } } @@ -131,7 +138,7 @@ pub fn zeitgeist_staging_config() -> Result { generic_genesis( additional_chain_spec_staging_zeitgeist( #[cfg(feature = "parachain")] - crate::KUSAMA_PARACHAIN_ID.into(), + KUSAMA_PARACHAIN_ID.into(), ), endowed_accounts_staging_zeitgeist(), wasm, @@ -145,7 +152,7 @@ pub fn zeitgeist_staging_config() -> Result { #[cfg(feature = "parachain")] crate::chain_spec::Extensions { relay_chain: "kusama".into(), - parachain_id: crate::KUSAMA_PARACHAIN_ID, + parachain_id: KUSAMA_PARACHAIN_ID, }, #[cfg(not(feature = "parachain"))] Default::default(), diff --git a/node/src/cli/cli_parachain.rs b/node/src/cli/cli_parachain.rs index 0e544b9eb..b810a471a 100644 --- a/node/src/cli/cli_parachain.rs +++ b/node/src/cli/cli_parachain.rs @@ -60,7 +60,7 @@ impl sc_cli::CliConfiguration for RelayChainCli { } fn base_path(&self) -> sc_cli::Result> { - Ok(self.shared_params().base_path().or_else(|| self.base_path.clone().map(Into::into))) + Ok(self.shared_params().base_path()?.or_else(|| self.base_path.clone().map(Into::into))) } fn chain_id(&self, is_dev: bool) -> sc_cli::Result { @@ -150,12 +150,11 @@ impl sc_cli::CliConfiguration for RelayChainCli { self.base.base.shared_params() } - fn state_cache_child_ratio(&self) -> sc_cli::Result> { - self.base.base.state_cache_child_ratio() - } - - fn transaction_pool(&self) -> sc_cli::Result { - self.base.base.transaction_pool() + fn transaction_pool( + &self, + is_dev: bool, + ) -> sc_cli::Result { + self.base.base.transaction_pool(is_dev) } } diff --git a/node/src/command.rs b/node/src/command.rs index 5c4936a92..57a609a9e 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -16,20 +16,25 @@ // along with Zeitgeist. If not, see . use super::{ + benchmarking::{inherent_benchmark_data, RemarksExtrinsicBuilder, TransferKeepAliveBuilder}, cli::{Cli, Subcommand}, - command_helper::{inherent_benchmark_data, BenchmarkExtrinsicBuilder}, service::{new_chain_ops, new_full, IdentifyVariant}, }; -use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; +use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE}; use sc_cli::SubstrateCli; -use std::sync::Arc; +use sp_keyring::Sr25519Keyring; #[cfg(feature = "with-battery-station-runtime")] use { super::service::BatteryStationExecutor, - battery_station_runtime::RuntimeApi as BatteryStationRuntimeApi, + battery_station_runtime::{ + ExistentialDeposit as BatteryStationED, RuntimeApi as BatteryStationRuntimeApi, + }, }; #[cfg(feature = "with-zeitgeist-runtime")] -use {super::service::ZeitgeistExecutor, zeitgeist_runtime::RuntimeApi as ZeitgeistRuntimeApi}; +use { + super::service::ZeitgeistExecutor, + zeitgeist_runtime::{ExistentialDeposit as ZeitgeistED, RuntimeApi as ZeitgeistRuntimeApi}, +}; #[cfg(feature = "parachain")] use { sc_client_api::client::BlockBackend, @@ -151,12 +156,13 @@ pub fn run() -> sc_cli::Result<()> { >(&config)?; let ext_builder = - BenchmarkExtrinsicBuilder::new(params.client.clone(), true); + RemarksExtrinsicBuilder::new(params.client.clone(), true); cmd.run( config, params.client, inherent_benchmark_data()?, - Arc::new(ext_builder), + Vec::new(), + &ext_builder, ) }), #[cfg(feature = "with-battery-station-runtime")] @@ -167,12 +173,72 @@ pub fn run() -> sc_cli::Result<()> { >(&config)?; let ext_builder = - BenchmarkExtrinsicBuilder::new(params.client.clone(), false); + RemarksExtrinsicBuilder::new(params.client.clone(), false); cmd.run( config, params.client, inherent_benchmark_data()?, - Arc::new(ext_builder), + Vec::new(), + &ext_builder, + ) + }), + #[cfg(not(feature = "with-battery-station-runtime"))] + _ => panic!("{}", crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE), + } + } + + BenchmarkCmd::Extrinsic(cmd) => { + if cfg!(feature = "parachain") { + return Err("Extrinsic is only supported in standalone chain".into()); + } + match chain_spec { + #[cfg(feature = "with-zeitgeist-runtime")] + spec if spec.is_zeitgeist() => runner.sync_run(|config| { + let params = crate::service::new_partial::< + zeitgeist_runtime::RuntimeApi, + ZeitgeistExecutor, + >(&config)?; + // Register the *Remark* and *TKA* builders. + let ext_factory = ExtrinsicFactory(vec![ + Box::new(RemarksExtrinsicBuilder::new(params.client.clone(), true)), + Box::new(TransferKeepAliveBuilder::new( + params.client.clone(), + Sr25519Keyring::Alice.to_account_id(), + ZeitgeistED::get(), + true, + )), + ]); + cmd.run( + params.client, + inherent_benchmark_data()?, + Vec::new(), + &ext_factory, + ) + }), + #[cfg(feature = "with-battery-station-runtime")] + _ => runner.sync_run(|config| { + let params = crate::service::new_partial::< + battery_station_runtime::RuntimeApi, + BatteryStationExecutor, + >(&config)?; + // Register the *Remark* and *TKA* builders. + let ext_factory = ExtrinsicFactory(vec![ + Box::new(RemarksExtrinsicBuilder::new( + params.client.clone(), + false, + )), + Box::new(TransferKeepAliveBuilder::new( + params.client.clone(), + Sr25519Keyring::Alice.to_account_id(), + BatteryStationED::get(), + false, + )), + ]); + cmd.run( + params.client, + inherent_benchmark_data()?, + Vec::new(), + &ext_factory, ) }), #[cfg(not(feature = "with-battery-station-runtime"))] @@ -484,10 +550,6 @@ fn none_command(cli: &Cli) -> sc_cli::Result<()> { fn none_command(cli: &Cli) -> sc_cli::Result<()> { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - if let sc_cli::Role::Light = config.role { - return Err("Light client not supported!".into()); - } - match &config.chain_spec { #[cfg(feature = "with-zeitgeist-runtime")] spec if spec.is_zeitgeist() => new_full::( diff --git a/node/src/main.rs b/node/src/main.rs index 202e66293..45eb875a9 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -17,10 +17,10 @@ #![warn(unused_extern_crates)] +mod benchmarking; mod chain_spec; mod cli; mod command; -mod command_helper; mod rpc; #[macro_use] mod service; diff --git a/node/src/service.rs b/node/src/service.rs index f61e46e3e..aa89dfb2e 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -132,7 +132,6 @@ cfg_if::cfg_if! { /// Additional APIs for parachain runtimes pub trait AdditionalRuntimeApiCollection: sp_api::ApiExt - + nimbus_primitives::AuthorFilterAPI + nimbus_primitives::NimbusApi + cumulus_primitives_core::CollectCollationInfo + session_keys_primitives::VrfApi @@ -144,7 +143,6 @@ cfg_if::cfg_if! { impl AdditionalRuntimeApiCollection for Api where Api: sp_api::ApiExt - + nimbus_primitives::AuthorFilterAPI + nimbus_primitives::NimbusApi + cumulus_primitives_core::CollectCollationInfo + session_keys_primitives::VrfApi, diff --git a/node/src/service/service_parachain.rs b/node/src/service/service_parachain.rs index 5bf6cbbe3..56f44a993 100644 --- a/node/src/service/service_parachain.rs +++ b/node/src/service/service_parachain.rs @@ -32,7 +32,8 @@ use nimbus_consensus::{BuildNimbusConsensusParams, NimbusConsensus}; use nimbus_primitives::NimbusId; use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; use sc_network::NetworkService; -use sc_service::{Configuration, PartialComponents, Role, TFullBackend, TFullClient, TaskManager}; +use sc_network_common::service::NetworkBlock; +use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sp_api::ConstructRuntimeApi; use sp_keystore::SyncCryptoStorePtr; @@ -261,10 +262,6 @@ where bool, ) -> Result>, sc_service::Error>, { - if matches!(parachain_config.role, Role::Light) { - return Err("Light client not supported!".into()); - } - let parachain_config = prepare_node_config(parachain_config); let params = new_partial::(¶chain_config)?; diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index dc3ad0432..38ffb0fac 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,15 +1,15 @@ [dependencies] arbitrary = { default-features = false, optional = true, version = "1.0" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-currencies = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-tokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { default-features = false, features = ["derive"], optional = true, version = "1.0.137" } -sp-core = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +serde = { default-features = false, features = ["derive"], optional = true, version = "1.0.144" } +sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } [dev-dependencies] test-case = "2.0.2" diff --git a/primitives/src/traits/zeitgeist_multi_reservable_currency.rs b/primitives/src/traits/zeitgeist_multi_reservable_currency.rs index 71697493d..73f5bad68 100644 --- a/primitives/src/traits/zeitgeist_multi_reservable_currency.rs +++ b/primitives/src/traits/zeitgeist_multi_reservable_currency.rs @@ -17,10 +17,9 @@ #![allow(clippy::type_complexity)] use alloc::vec::Vec; -use frame_support::traits::Get; use orml_tokens::{AccountData, Accounts, TotalIssuance}; use orml_traits::currency::NamedMultiReservableCurrency; -use sp_runtime::DispatchError; +use sp_runtime::{traits::Get, DispatchError}; /// Custom `NamedMultiReservableCurrency` trait. pub trait ZeitgeistAssetManager: NamedMultiReservableCurrency { diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 9a9f690cf..9c3153d0e 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -1,84 +1,87 @@ [build-dependencies] -substrate-wasm-builder = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +substrate-wasm-builder = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } [dependencies] -frame-executive = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system-rpc-runtime-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-currencies = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-tokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -pallet-balances = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-bounties = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-collective = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-democracy = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-identity = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-membership = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-multisig = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-preimage = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-proxy = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-randomness-collective-flip = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-scheduler = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-sudo = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-treasury = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-utility = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-vesting = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-executive = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-bounties = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-collective = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-democracy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-identity = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-membership = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-multisig = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-preimage = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-proxy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-scheduler = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-sudo = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-vesting = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-block-builder = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-core = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-inherents = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-offchain = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-session = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-transaction-pool = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-version = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-block-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-inherents = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-offchain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-session = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-version = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" } # Try-Runtime -frame-try-runtime = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-try-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } # Benchmark -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } -frame-system-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } +frame-system-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } # Cumulus -cumulus-pallet-dmp-queue = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-pallet-parachain-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-pallet-xcm = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-pallet-xcmp-queue = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-core = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-timestamp = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-utility = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -parachain-info = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-dmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-parachain-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-xcmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +parachain-info = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } # Parachain -nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-author-mapping = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/crowdloan-rewards", optional = true } -pallet-parachain-staking = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -polkadot-parachain = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -session-keys-primitives = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } +nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/crowdloan-rewards", optional = true } +pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } + +# Polkadot + +polkadot-parachain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } # Standalone -pallet-aura = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-grandpa = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-consensus-aura = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-finality-grandpa = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } # Utility cfg-if = { version = "1.0.0" } @@ -86,17 +89,17 @@ hex-literal = { default-features = false, optional = true, version = "0.3.4" } log = { version = "0.4.17", default-features = false, optional = true } # XCM -kusama-runtime = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -orml-asset-registry = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-unknown-tokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-xcm-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-xtokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -pallet-xcm = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-primitives = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-runtime-parachains = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -xcm = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -xcm-builder = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -xcm-executor = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +kusama-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-unknown-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-xcm-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-xtokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-runtime-parachains = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +xcm-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +xcm-executor = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } # Zeitgeist @@ -115,8 +118,8 @@ zrml-swaps = { default-features = false, path = "../../zrml/swaps" } zrml-swaps-runtime-api = { default-features = false, path = "../../zrml/swaps/runtime-api" } [dev-dependencies] -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -xcm-emulator = { rev = "ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe", git = "https://github.com/shaunxw/xcm-simulator" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +xcm-emulator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/xcm-simulator" } [features] default = ["std"] @@ -330,6 +333,7 @@ try-runtime = [ # System runtime pallets "frame-system/try-runtime", + "frame-support/try-runtime", "pallet-timestamp/try-runtime", "pallet-randomness-collective-flip/try-runtime", "pallet-scheduler/try-runtime", @@ -373,10 +377,24 @@ try-runtime = [ # Parachain "pallet-author-mapping?/try-runtime", + "pallet-author-inherent?/try-runtime", "pallet-author-slot-filter?/try-runtime", "pallet-parachain-staking?/try-runtime", # Required by pallet-parachain-staking@v0.26.1 "parity-scale-codec/full", + "pallet-proxy/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-aura/try-runtime", + "pallet-sudo/try-runtime", + "pallet-xcm?/try-runtime", + "pallet-crowdloan-rewards?/try-runtime", + + # Cumulus + "cumulus-pallet-parachain-system?/try-runtime", + "cumulus-pallet-xcm?/try-runtime", + "cumulus-pallet-dmp-queue?/try-runtime", + "cumulus-pallet-xcmp-queue?/try-runtime", + "parachain-info?/try-runtime", ] with-global-disputes = [ "zrml-global-disputes", diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index 8d6d8351d..de2b6acac 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -123,7 +123,7 @@ fn default_parachains_host_configuration() -> HostConfiguration { max_upward_queue_count: 8, max_upward_queue_size: 1024 * 1024, max_downward_message_size: 1024, - ump_service_total_weight: Weight::from(4 * 1_000_000_000u32), + ump_service_total_weight: Weight::from_ref_time(4_u64 * 1_000_000_000_u64), max_upward_message_size: 50 * 1024, max_upward_message_num_per_candidate: 5, hrmp_sender_deposit: 0, diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index bac3d5b61..f117fc81b 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -33,6 +33,7 @@ pub use frame_system::{ }; #[cfg(feature = "parachain")] pub use pallet_author_slot_filter::EligibilityValue; +pub use pallet_balances::Call as BalancesCall; #[cfg(feature = "parachain")] pub use crate::parachain_params::*; @@ -74,7 +75,7 @@ use sp_runtime::{ }; #[cfg(feature = "parachain")] -use nimbus_primitives::{CanAuthor, NimbusId}; +use nimbus_primitives::CanAuthor; use sp_version::RuntimeVersion; #[cfg(feature = "parachain")] diff --git a/runtime/battery-station/src/parachain_params.rs b/runtime/battery-station/src/parachain_params.rs index 1d5092151..6f9546de1 100644 --- a/runtime/battery-station/src/parachain_params.rs +++ b/runtime/battery-station/src/parachain_params.rs @@ -49,10 +49,10 @@ parameter_types! { pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Any; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UnitWeightCost: Weight = 200_000_000; + pub UnitWeightCost: u64 = 200_000_000; // Staking /// Rounds before the candidate bond increase/decrease can be executed @@ -90,7 +90,7 @@ parameter_types! { // XCM /// Base weight for XCM execution - pub const BaseXcmWeight: Weight = 200_000_000; + pub const BaseXcmWeight: u64 = 200_000_000; /// The maximum number of distinct assets allowed to be transferred in a /// single helper extrinsic. pub const MaxAssetsForTransfer: usize = 2; diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 2fa08b893..2e8547296 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -34,7 +34,8 @@ use frame_system::limits::{BlockLength, BlockWeights}; use orml_traits::parameter_type_with_key; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_runtime::{ - traits::AccountIdConversion, FixedPointNumber, Perbill, Percent, Permill, Perquintill, + traits::{AccountIdConversion, Bounded}, + FixedPointNumber, Perbill, Percent, Permill, Perquintill, }; use sp_version::RuntimeVersion; use zeitgeist_primitives::{constants::*, types::*}; @@ -43,7 +44,8 @@ use zeitgeist_primitives::{constants::*, types::*}; use frame_support::traits::LockIdentifier; pub(crate) const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = + Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 2); pub(crate) const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub(crate) const FEES_AND_TIPS_TREASURY_PERCENTAGE: u32 = 100; pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; @@ -273,9 +275,6 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); - // Timestamp - pub const MinimumPeriod: u64 = MILLISECS_PER_BLOCK as u64 / 2; - // Transaction payment /// A fee mulitplier for Operational extrinsics to compute “virtual tip” /// to boost their priority. @@ -292,6 +291,8 @@ parameter_types! { /// Minimum amount of the multiplier. The test `multiplier_can_grow_from_zero` ensures /// that this value is not too low. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000u128); + /// Maximum amount of the multiplier. + pub MaximumMultiplier: Multiplier = Bounded::max_value(); // Treasury /// Percentage of spare funds (if any) that are burnt per spend period. @@ -312,6 +313,10 @@ parameter_types! { /// Treasury account. pub ZeitgeistTreasuryAccount: AccountId = TreasuryPalletId::get().into_account_truncating(); + // Timestamp + /// MinimumPeriod for Timestamp + pub const MinimumPeriodValue: u64 = MILLISECS_PER_BLOCK as u64 / 2; + // Bounties /// The amount held on deposit for placing a bounty proposal. pub const BountyDepositBase: Balance = 100 * BASE; @@ -378,5 +383,10 @@ parameter_type_with_key! { // Parameterized slow adjusting fee updated based on // https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism -pub type SlowAdjustingFeeUpdate = - TargetedFeeAdjustment; +pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< + R, + TargetBlockFullness, + AdjustmentVariable, + MinimumMultiplier, + MaximumMultiplier, +>; diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index 4e09b741c..238537fe9 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -71,6 +71,7 @@ impl Config for XcmConfig { type Barrier = Barrier; /// The outer call dispatch type. type Call = Call; + type CallDispatcher = Call; /// Combinations of (Location, Asset) pairs which are trusted as reserves. // Trust the parent chain, sibling parachains and children chains of this chain. type IsReserve = MultiNativeAsset; diff --git a/runtime/battery-station/src/xcm_config/fees.rs b/runtime/battery-station/src/xcm_config/fees.rs index dbedf3d93..bc188eafc 100644 --- a/runtime/battery-station/src/xcm_config/fees.rs +++ b/runtime/battery-station/src/xcm_config/fees.rs @@ -29,8 +29,8 @@ pub fn native_per_second() -> Balance { } pub fn default_per_second(decimals: u32) -> Balance { - let base_weight = Balance::from(ExtrinsicBaseWeight::get()); - let default_per_second = (WEIGHT_PER_SECOND as u128) / base_weight; + let base_weight = ExtrinsicBaseWeight::get().ref_time() as u128; + let default_per_second = (WEIGHT_PER_SECOND.ref_time() as u128) / base_weight; default_per_second * base_fee(decimals) } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index d72cdb3c4..fae491e83 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,31 +1,31 @@ [dependencies] # Pallets -cumulus-pallet-xcmp-queue = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-currencies = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-tokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-author-mapping = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-balances = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-bounties = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-collective = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-democracy = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-identity = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-membership = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-multisig = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-parachain-staking = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -pallet-preimage = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-proxy = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-randomness-collective-flip = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-scheduler = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-treasury = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-utility = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-vesting = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +cumulus-pallet-xcmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-bounties = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-collective = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-democracy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-identity = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-membership = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-multisig = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +pallet-preimage = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-proxy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-scheduler = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-vesting = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } # Utility cfg-if = { version = "1.0.0" } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index e7e27882f..8d53dde59 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -45,7 +45,7 @@ pub mod weights; macro_rules! decl_common_types { {} => { use sp_runtime::generic; - use frame_support::traits::{Currency, Imbalance, OnUnbalanced, NeverEnsureOrigin}; + use frame_support::traits::{Currency, Imbalance, OnUnbalanced, NeverEnsureOrigin, TryStateSelect}; pub type Block = generic::Block; @@ -59,6 +59,7 @@ macro_rules! decl_common_types { Runtime, AllPalletsWithSystem, ( + pallet_parachain_staking::migrations::MigrateAtStakeAutoCompound, zrml_prediction_markets::migrations::UpdateMarketsForBaseAssetAndRecordBonds, zrml_prediction_markets::migrations::AddFieldToAuthorityReport, ), @@ -516,9 +517,6 @@ macro_rules! impl_config_traits { type BlockAuthor = AuthorInherent; type CandidateBondLessDelay = CandidateBondLessDelay; type Currency = Balances; - type DefaultBlocksPerRound = DefaultBlocksPerRound; - type DefaultCollatorCommission = DefaultCollatorCommission; - type DefaultParachainBondReservePercent = DefaultParachainBondReservePercent; type DelegationBondLessDelay = DelegationBondLessDelay; type Event = Event; type LeaveCandidatesDelay = LeaveCandidatesDelay; @@ -625,7 +623,7 @@ macro_rules! impl_config_traits { type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; - type WeightInfo = pallet_balances::weights::SubstrateWeight; // weights::pallet_balances::WeightInfo; + type WeightInfo = weights::pallet_balances::WeightInfo; } impl pallet_collective::Config for Runtime { @@ -841,6 +839,38 @@ macro_rules! impl_config_traits { type NoPreimagePostponement = NoPreimagePostponement; } + // Timestamp + /// Custom getter for minimum timestamp delta. + /// This ensures that consensus systems like Aura don't break assertions + /// in a benchmark environment + pub struct MinimumPeriod; + impl MinimumPeriod { + /// Returns the value of this parameter type. + pub fn get() -> u64 { + #[cfg(feature = "runtime-benchmarks")] + { + use frame_benchmarking::benchmarking::get_whitelist; + // Should that condition be true, we can assume that we are in a benchmark environment. + if !get_whitelist().is_empty() { + return u64::MAX; + } + } + + MinimumPeriodValue::get() + } + } + impl> frame_support::traits::Get for MinimumPeriod { + fn get() -> I { + I::from(Self::get()) + } + } + impl frame_support::traits::TypedGet for MinimumPeriod { + type Type = u64; + fn get() -> u64 { + Self::get() + } + } + impl pallet_timestamp::Config for Runtime { type MinimumPeriod = MinimumPeriod; type Moment = u64; @@ -907,7 +937,7 @@ macro_rules! impl_config_traits { type Currency = Balances; type BlockNumberToBalance = sp_runtime::traits::ConvertInto; type MinVestedTransfer = MinVestedTransfer; - type WeightInfo = pallet_vesting::weights::SubstrateWeight; // weights::pallet_vesting::WeightInfo; + type WeightInfo = weights::pallet_vesting::WeightInfo; // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the // highest number of schedules that encodes less than 2^10. @@ -1115,14 +1145,6 @@ macro_rules! create_runtime_api { } } - #[cfg(feature = "parachain")] - // Required to satisify trait bounds at the client implementation. - impl nimbus_primitives::AuthorFilterAPI for Runtime { - fn can_author(_: NimbusId, _: u32, _: &::Header) -> bool { - panic!("AuthorFilterAPI is no longer supported. Please update your client.") - } - } - #[cfg(feature = "parachain")] impl nimbus_primitives::NimbusApi for Runtime { fn can_author( @@ -1209,6 +1231,7 @@ macro_rules! create_runtime_api { list_benchmark!(list, extra, zrml_court, Court); #[cfg(feature = "with-global-disputes")] list_benchmark!(list, extra, zrml_global_disputes, GlobalDisputes); + #[cfg(not(feature = "parachain"))] list_benchmark!(list, extra, zrml_prediction_markets, PredictionMarkets); list_benchmark!(list, extra, zrml_liquidity_mining, LiquidityMining); list_benchmark!(list, extra, zrml_styx, Styx); @@ -1287,6 +1310,7 @@ macro_rules! create_runtime_api { add_benchmark!(params, batches, zrml_court, Court); #[cfg(feature = "with-global-disputes")] add_benchmark!(params, batches, zrml_global_disputes, GlobalDisputes); + #[cfg(not(feature = "parachain"))] add_benchmark!(params, batches, zrml_prediction_markets, PredictionMarkets); add_benchmark!(params, batches, zrml_liquidity_mining, LiquidityMining); add_benchmark!(params, batches, zrml_styx, Styx); @@ -1335,6 +1359,23 @@ macro_rules! create_runtime_api { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info( + call: Call, + len: u32, + ) -> pallet_transaction_payment::RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details( + call: Call, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + #[cfg(feature = "parachain")] impl session_keys_primitives::VrfApi for Runtime { fn get_last_vrf_output() -> Option<::Hash> { @@ -1489,8 +1530,17 @@ macro_rules! create_runtime_api { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> frame_support::weights::Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, try_state: frame_try_runtime::TryStateSelect) -> frame_support::weights::Weight { + log::info!( + "try-runtime: executing block #{} {:?} / root checks: {:?} / try-state-select: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + try_state, + ); + // 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, try_state).expect("execute-block failed") } } @@ -1810,7 +1860,7 @@ macro_rules! create_common_tests { pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength::max(2 * 1024); pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(1024); + frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); } impl frame_system::Config for Runtime { diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index 1ac2e70c4..5af541910 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,14 +50,14 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::weights::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - (12_060_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(4_785_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - (11_590_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(4_691_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index 718ed212f..d8558bb8c 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -48,42 +48,40 @@ use frame_support::{ /// Weight functions for frame_system (automatically generated) pub struct WeightInfo(PhantomData); impl frame_system::weights::WeightInfo for WeightInfo { - fn remark(b: u32) -> Weight { - (0 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) + fn remark(_b: u32) -> Weight { + Weight::from_ref_time(6_388_000) } fn remark_with_event(b: u32) -> Weight { - (0 as Weight) + Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - (11_750_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(5_605_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Skipped Metadata (r:0 w:0) fn set_storage(i: u32) -> Weight { - (0 as Weight) - // Standard Error: 9_000 - .saturating_add((1_266_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + Weight::from_ref_time(417_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(411_000).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_storage(i: u32) -> Weight { - (0 as Weight) - // Standard Error: 3_000 - .saturating_add((1_021_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + Weight::from_ref_time(0) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(369_000).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_prefix(p: u32) -> Weight { - (0 as Weight) - // Standard Error: 11_000 - .saturating_add((2_239_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + Weight::from_ref_time(3_542_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(792_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } } diff --git a/runtime/common/src/weights/orml_currencies.rs b/runtime/common/src/weights/orml_currencies.rs index 92116c82d..dfcaa524a 100644 --- a/runtime/common/src/weights/orml_currencies.rs +++ b/runtime/common/src/weights/orml_currencies.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for orml_currencies //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -45,42 +45,37 @@ use frame_support::{traits::Get, weights::Weight}; /// Weight functions for orml_currencies (automatically generated) pub struct WeightInfo(PhantomData); impl orml_currencies::WeightInfo for WeightInfo { - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_non_native_currency() -> Weight { - (67_910_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(28_582_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: System Account (r:1 w:1) fn transfer_native_currency() -> Weight { - (65_590_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(26_474_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn update_balance_non_native_currency() -> Weight { - (54_870_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(21_690_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: System Account (r:1 w:1) fn update_balance_native_currency_creating() -> Weight { - (52_580_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(21_531_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: System Account (r:1 w:1) fn update_balance_native_currency_killing() -> Weight { - (51_960_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(19_409_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/orml_tokens.rs b/runtime/common/src/weights/orml_tokens.rs index 42a7200ad..81b1bcb2c 100644 --- a/runtime/common/src/weights/orml_tokens.rs +++ b/runtime/common/src/weights/orml_tokens.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -45,45 +45,40 @@ use frame_support::{traits::Get, weights::Weight}; /// Weight functions for orml_tokens (automatically generated) pub struct WeightInfo(PhantomData); impl orml_tokens::WeightInfo for WeightInfo { - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (67_361_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(28_003_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (79_580_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(30_502_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (68_240_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(25_994_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:2 w:1) fn force_transfer() -> Weight { - (74_910_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(29_043_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - // Storage: unknown [0x3a7472616e73616374696f6e5f6c6576656c3a] (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn set_balance() -> Weight { - (58_480_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(21_069_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/runtime/common/src/weights/pallet_author_inherent.rs b/runtime/common/src/weights/pallet_author_inherent.rs index 47b4209c1..d42c1cd4b 100644 --- a/runtime/common/src/weights/pallet_author_inherent.rs +++ b/runtime/common/src/weights/pallet_author_inherent.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_author_inherent //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-29, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-05, STEPS: `10`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -26,8 +26,8 @@ // benchmark // pallet // --chain=dev -// --steps=50 -// --repeat=20 +// --steps=10 +// --repeat=10 // --pallet=pallet_author_inherent // --extrinsic=* // --execution=wasm @@ -45,7 +45,7 @@ use frame_support::{ weights::{constants::RocksDbWeight, Weight}, }; -/// Weight functions for pallet_author_mapping (automatically generated) +/// Weight functions for pallet_author_inherent (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_author_inherent::weights::WeightInfo for WeightInfo { // Storage: ParachainSystem ValidationData (r:1 w:0) @@ -54,10 +54,9 @@ impl pallet_author_inherent::weights::WeightInfo for We // Storage: ParachainStaking SelectedCandidates (r:1 w:0) // Storage: AuthorFilter EligibleCount (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) - #[rustfmt::skip] fn kick_off_authorship_validation() -> Weight { - (20_862_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(28_113_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_author_mapping.rs b/runtime/common/src/weights/pallet_author_mapping.rs index 03196fb0f..b3a3f76ec 100644 --- a/runtime/common/src/weights/pallet_author_mapping.rs +++ b/runtime/common/src/weights/pallet_author_mapping.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_author_mapping //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,38 +52,38 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn add_association() -> Weight { - (51_350_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(22_310_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn update_association() -> Weight { - (43_640_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(18_658_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping MappingWithDeposit (r:1 w:1) // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn clear_association() -> Weight { - (53_600_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(25_042_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping NimbusLookup (r:1 w:1) // Storage: AuthorMapping MappingWithDeposit (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_keys() -> Weight { - (59_700_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(27_303_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping NimbusLookup (r:1 w:1) // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) fn set_keys() -> Weight { - (49_860_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(21_261_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/runtime/common/src/weights/pallet_author_slot_filter.rs b/runtime/common/src/weights/pallet_author_slot_filter.rs index 1c4af1ee3..43c1640b8 100644 --- a/runtime/common/src/weights/pallet_author_slot_filter.rs +++ b/runtime/common/src/weights/pallet_author_slot_filter.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_author_slot_filter //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,6 +50,6 @@ pub struct WeightInfo(PhantomData); impl pallet_author_slot_filter::weights::WeightInfo for WeightInfo { // Storage: AuthorFilter EligibleCount (r:0 w:1) fn set_eligible() -> Weight { - (25_110_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_138_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 2db9ec484..206995a80 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -18,16 +18,16 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-05, STEPS: `2`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/zeitgeist +// ./target/release/zeitgeist // benchmark // pallet // --chain=dev -// --steps=50 -// --repeat=20 +// --steps=2 +// --repeat=2 // --pallet=pallet_balances // --extrinsic=* // --execution=wasm @@ -50,44 +50,44 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::weights::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - (73_560_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(64_342_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - (56_010_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(48_802_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - (37_611_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(35_618_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - (42_260_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(38_954_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - (74_041_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(61_868_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - (66_100_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(55_986_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - (34_060_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(31_510_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_bounties.rs b/runtime/common/src/weights/pallet_bounties.rs index 8e0ba74b8..a8395f4f9 100644 --- a/runtime/common/src/weights/pallet_bounties.rs +++ b/runtime/common/src/weights/pallet_bounties.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,83 +51,81 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: Bounties BountyCount (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) // Storage: Bounties Bounties (r:0 w:1) - fn propose_bounty(d: u32) -> Weight { - (47_153_000 as Weight) - // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + fn propose_bounty(_d: u32) -> Weight { + Weight::from_ref_time(21_955_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) fn approve_bounty() -> Weight { - (20_440_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(8_866_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn propose_curator() -> Weight { - (15_870_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_785_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - (55_740_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(25_616_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - (47_910_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_880_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn award_bounty() -> Weight { - (37_650_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_661_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn claim_bounty() -> Weight { - (128_800_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(49_229_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_proposed() -> Weight { - (59_260_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(25_929_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_active() -> Weight { - (84_461_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(38_633_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) fn extend_bounty_expiry() -> Weight { - (32_200_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_045_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties BountyApprovals (r:1 w:1) // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn spend_funds(b: u32) -> Weight { - (0 as Weight) - // Standard Error: 142_000 - .saturating_add((58_120_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight))) + Weight::from_ref_time(21_790_000) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(18_031_000).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) } } diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index 65ed5f343..02fb2345c 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,32 +53,34 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Voting (r:255 w:255) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn set_members(m: u32, _n: u32, p: u32) -> Weight { - (0 as Weight) - // Standard Error: 83_000 - .saturating_add((56_925_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 38_000 - .saturating_add((30_621_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(p as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + Weight::from_ref_time(0) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(14_762_000).saturating_mul(m.into())) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(7_686_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } // Storage: AdvisoryCommittee Members (r:1 w:0) fn execute(b: u32, m: u32) -> Weight { - (36_706_000 as Weight) + Weight::from_ref_time(13_563_000) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 1_000 - .saturating_add((41_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(12_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee ProposalOf (r:1 w:0) - fn propose_execute(_b: u32, m: u32) -> Weight { - (48_486_000 as Weight) - // Standard Error: 5_000 - .saturating_add((97_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) + fn propose_execute(b: u32, m: u32) -> Weight { + Weight::from_ref_time(14_504_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000).saturating_mul(b.into())) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(18_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) @@ -86,50 +88,50 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalCount (r:1 w:1) // Storage: AdvisoryCommittee Voting (r:0 w:1) fn propose_proposed(b: u32, m: u32, p: u32) -> Weight { - (53_939_000 as Weight) + Weight::from_ref_time(21_145_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(4_000).saturating_mul(b.into())) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(47_000).saturating_mul(m.into())) // Standard Error: 1_000 - .saturating_add((10_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 14_000 - .saturating_add((163_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 6_000 - .saturating_add((382_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(93_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee Voting (r:1 w:1) fn vote(m: u32) -> Weight { - (90_862_000 as Weight) - // Standard Error: 12_000 - .saturating_add((277_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(32_864_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(50_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: AdvisoryCommittee Voting (r:1 w:1) // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_early_disapproved(_m: u32, p: u32) -> Weight { - (98_487_000 as Weight) - // Standard Error: 5_000 - .saturating_add((273_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(36_748_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(74_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommittee Voting (r:1 w:1) // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_early_approved(b: u32, m: u32, p: u32) -> Weight { - (73_947_000 as Weight) + Weight::from_ref_time(29_133_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(54_000).saturating_mul(m.into())) // Standard Error: 1_000 - .saturating_add((13_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 13_000 - .saturating_add((239_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 5_000 - .saturating_add((340_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(99_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommittee Voting (r:1 w:1) // Storage: AdvisoryCommittee Members (r:1 w:0) @@ -137,11 +139,11 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_disapproved(_m: u32, p: u32) -> Weight { - (100_924_000 as Weight) - // Standard Error: 5_000 - .saturating_add((268_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(35_689_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(81_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommittee Voting (r:1 w:1) // Storage: AdvisoryCommittee Members (r:1 w:0) @@ -149,24 +151,24 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_approved(b: u32, m: u32, p: u32) -> Weight { - (101_633_000 as Weight) + Weight::from_ref_time(30_778_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(4_000).saturating_mul(b.into())) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(50_000).saturating_mul(m.into())) // Standard Error: 1_000 - .saturating_add((5_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 12_000 - .saturating_add((137_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 5_000 - .saturating_add((315_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(98_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee Voting (r:0 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn disapprove_proposal(p: u32) -> Weight { - (45_138_000 as Weight) - // Standard Error: 8_000 - .saturating_add((361_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(20_708_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(86_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index 774083caa..5b63a09b6 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,44 +53,44 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - (99_190_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(40_195_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy DepositOf (r:1 w:1) fn second(s: u32) -> Weight { - (50_566_000 as Weight) - // Standard Error: 7_000 - .saturating_add((445_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_123_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(106_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_new(r: u32) -> Weight { - (72_516_000 as Weight) - // Standard Error: 12_000 - .saturating_add((405_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(32_847_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(139_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_existing(r: u32) -> Weight { - (69_938_000 as Weight) - // Standard Error: 18_000 - .saturating_add((449_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(31_794_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(161_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - (34_740_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_836_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) @@ -99,79 +99,79 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:2 w:2) fn blacklist(p: u32) -> Weight { - (102_527_000 as Weight) - // Standard Error: 17_000 - .saturating_add((650_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(43_484_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(210_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(7)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) fn external_propose(v: u32) -> Weight { - (22_773_000 as Weight) - // Standard Error: 1_000 - .saturating_add((47_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(10_959_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(12_000).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - (7_420_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(3_128_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - (7_880_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(3_086_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - (35_750_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(15_486_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) fn veto_external(v: u32) -> Weight { - (42_116_000 as Weight) - // Standard Error: 4_000 - .saturating_add((46_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(16_743_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(34_000).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:2 w:2) fn cancel_proposal(p: u32) -> Weight { - (79_688_000 as Weight) - // Standard Error: 12_000 - .saturating_add((679_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(38_156_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(159_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - (24_280_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_907_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_queued(r: u32) -> Weight { - (39_489_000 as Weight) - // Standard Error: 18_000 - .saturating_add((1_227_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(19_173_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(331_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base(r: u32) -> Weight { - (9_262_000 as Weight) - // Standard Error: 23_000 - .saturating_add((6_409_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_098_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(1_561_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) @@ -180,101 +180,99 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy PublicProps (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base_with_launch_period(r: u32) -> Weight { - (12_094_000 as Weight) - // Standard Error: 17_000 - .saturating_add((6_467_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_662_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(1_583_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy VotingOf (r:3 w:3) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn delegate(r: u32) -> Weight { - (63_558_000 as Weight) - // Standard Error: 53_000 - .saturating_add((9_035_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) + Weight::from_ref_time(32_862_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(2_398_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) } // Storage: Democracy VotingOf (r:2 w:2) // Storage: Democracy ReferendumInfoOf (r:1 w:1) fn undelegate(r: u32) -> Weight { - (33_478_000 as Weight) - // Standard Error: 42_000 - .saturating_add((8_797_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight))) + Weight::from_ref_time(20_469_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(2_361_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - (9_400_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(3_880_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy Preimages (r:1 w:1) fn note_preimage(b: u32) -> Weight { - (53_547_000 as Weight) + Weight::from_ref_time(21_894_000) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy Preimages (r:1 w:1) fn note_imminent_preimage(b: u32) -> Weight { - (35_292_000 as Weight) + Weight::from_ref_time(16_638_000) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:0) - fn reap_preimage(b: u32) -> Weight { - (53_182_000 as Weight) - // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + // Storage: System Account (r:1 w:1) + fn reap_preimage(_b: u32) -> Weight { + Weight::from_ref_time(28_888_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_remove(r: u32) -> Weight { - (45_241_000 as Weight) - // Standard Error: 7_000 - .saturating_add((213_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(24_713_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(81_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_set(r: u32) -> Weight { - (44_693_000 as Weight) - // Standard Error: 7_000 - .saturating_add((361_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(23_404_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(133_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_vote(r: u32) -> Weight { - (27_874_000 as Weight) - // Standard Error: 6_000 - .saturating_add((371_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_571_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(142_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_other_vote(r: u32) -> Weight { - (29_844_000 as Weight) - // Standard Error: 6_000 - .saturating_add((340_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_683_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(143_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_grandpa.rs b/runtime/common/src/weights/pallet_grandpa.rs index 52c00e8d1..24be43b6a 100644 --- a/runtime/common/src/weights/pallet_grandpa.rs +++ b/runtime/common/src/weights/pallet_grandpa.rs @@ -49,20 +49,20 @@ impl pallet_grandpa::weights::WeightInfo for WeightInfo fn check_equivocation_proof(x: u32, ) -> Weight { - (206_093_000 as Weight) + Weight::from_ref_time(206_093_000) // Standard Error: 82_000 - .saturating_add((33_636_000 as Weight).saturating_mul(x as Weight)) + .saturating_add(Weight::from_ref_time(33_636_000).saturating_mul(x as u64)) } // Storage: Grandpa Stalled (r:0 w:1) fn note_stalled() -> Weight { - (6_440_000 as Weight) + Weight::from_ref_time(6_440_000) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index 633f7700a..e7d61f6ea 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,162 +50,168 @@ pub struct WeightInfo(PhantomData); impl pallet_identity::weights::WeightInfo for WeightInfo { // Storage: Identity Registrars (r:1 w:1) fn add_registrar(r: u32) -> Weight { - (27_815_000 as Weight) - // Standard Error: 44_000 - .saturating_add((436_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_196_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(376_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) - fn set_identity(_r: u32, x: u32) -> Weight { - (57_184_000 as Weight) - // Standard Error: 10_000 - .saturating_add((740_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + fn set_identity(r: u32, x: u32) -> Weight { + Weight::from_ref_time(23_488_000) + // Standard Error: 15_000 + .saturating_add(Weight::from_ref_time(384_000).saturating_mul(r.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(200_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:1 w:1) fn set_subs_new(s: u32) -> Weight { - (74_862_000 as Weight) - // Standard Error: 54_000 - .saturating_add((5_540_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(22_648_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(1_755_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:1) fn set_subs_old(p: u32) -> Weight { - (51_247_000 as Weight) - // Standard Error: 35_000 - .saturating_add((2_194_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + Weight::from_ref_time(22_847_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(781_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity IdentityOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:64) fn clear_identity(r: u32, s: u32, x: u32) -> Weight { - (48_392_000 as Weight) - // Standard Error: 563_000 - .saturating_add((1_925_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 32_000 - .saturating_add((2_195_000 as Weight).saturating_mul(s as Weight)) - // Standard Error: 32_000 - .saturating_add((365_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(26_919_000) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(141_000).saturating_mul(r.into())) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(808_000).saturating_mul(s.into())) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(79_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn request_judgement(r: u32, x: u32) -> Weight { - (40_879_000 as Weight) - // Standard Error: 99_000 - .saturating_add((2_118_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 6_000 - .saturating_add((924_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_741_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(381_000).saturating_mul(r.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(206_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) - fn cancel_request(_r: u32, x: u32) -> Weight { - (73_831_000 as Weight) - // Standard Error: 24_000 - .saturating_add((583_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + fn cancel_request(r: u32, x: u32) -> Weight { + Weight::from_ref_time(23_484_000) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(251_000).saturating_mul(r.into())) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(202_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_fee(r: u32) -> Weight { - (13_827_000 as Weight) - // Standard Error: 31_000 - .saturating_add((315_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_477_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(262_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_account_id(r: u32) -> Weight { - (13_142_000 as Weight) - // Standard Error: 31_000 - .saturating_add((703_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_698_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(242_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_fields(r: u32) -> Weight { - (15_301_000 as Weight) - // Standard Error: 17_000 - .saturating_add((435_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_546_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(244_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn provide_judgement(r: u32, x: u32) -> Weight { - (48_594_000 as Weight) - // Standard Error: 112_000 - .saturating_add((16_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 6_000 - .saturating_add((678_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_426_000) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(300_000).saturating_mul(r.into())) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(340_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity IdentityOf (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Identity SuperOf (r:0 w:64) - fn kill_identity(r: u32, s: u32, _x: u32) -> Weight { - (102_128_000 as Weight) - // Standard Error: 661_000 - .saturating_add((193_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 38_000 - .saturating_add((1_874_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + fn kill_identity(r: u32, s: u32, x: u32) -> Weight { + Weight::from_ref_time(31_309_000) + // Standard Error: 21_000 + .saturating_add(Weight::from_ref_time(306_000).saturating_mul(r.into())) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(823_000).saturating_mul(s.into())) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(108_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn add_sub(s: u32) -> Weight { - (66_983_000 as Weight) - // Standard Error: 8_000 - .saturating_add((172_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(27_995_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(111_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) fn rename_sub(s: u32) -> Weight { - (24_681_000 as Weight) - // Standard Error: 10_000 - .saturating_add((104_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(11_323_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(73_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn remove_sub(s: u32) -> Weight { - (63_074_000 as Weight) - // Standard Error: 8_000 - .saturating_add((274_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(28_284_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(127_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn quit_sub(s: u32) -> Weight { - (46_651_000 as Weight) - // Standard Error: 17_000 - .saturating_add((252_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_753_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(107_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index 8c41f7c7d..d5af66791 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,21 +53,23 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn add_member(m: u32) -> Weight { - (29_252_000 as Weight) - // Standard Error: 2_000 - .saturating_add((129_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(15_484_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(31_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommitteeMembership Members (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:0) // Storage: AdvisoryCommitteeMembership Prime (r:1 w:0) // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) - fn remove_member(_m: u32) -> Weight { - (42_627_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + fn remove_member(m: u32) -> Weight { + Weight::from_ref_time(17_584_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(28_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommitteeMembership Members (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:0) @@ -75,11 +77,11 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn swap_member(m: u32) -> Weight { - (31_151_000 as Weight) - // Standard Error: 1_000 - .saturating_add((199_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(17_575_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(32_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommitteeMembership Members (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:0) @@ -87,11 +89,11 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn reset_member(m: u32) -> Weight { - (33_891_000 as Weight) - // Standard Error: 8_000 - .saturating_add((351_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(17_200_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(103_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AdvisoryCommitteeMembership Members (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:0) @@ -99,28 +101,28 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn change_key(m: u32) -> Weight { - (40_274_000 as Weight) - // Standard Error: 2_000 - .saturating_add((36_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(17_951_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(34_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: AdvisoryCommitteeMembership Members (r:1 w:0) // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn set_prime(m: u32) -> Weight { - (8_503_000 as Weight) + Weight::from_ref_time(6_406_000) // Standard Error: 0 - .saturating_add((67_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(11_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn clear_prime(m: u32) -> Weight { - (3_299_000 as Weight) + Weight::from_ref_time(3_667_000) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index 956a787df..7ada45474 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -48,102 +48,100 @@ use frame_support::{ /// Weight functions for pallet_multisig (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_multisig::weights::WeightInfo for WeightInfo { - fn as_multi_threshold_1(z: u32) -> Weight { - (38_915_000 as Weight) - // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) + fn as_multi_threshold_1(_z: u32) -> Weight { + Weight::from_ref_time(14_433_000) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create(s: u32, z: u32) -> Weight { - (85_862_000 as Weight) - // Standard Error: 15_000 - .saturating_add((208_000 as Weight).saturating_mul(s as Weight)) + Weight::from_ref_time(26_712_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(82_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add((1_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create_store(s: u32, z: u32) -> Weight { - (73_237_000 as Weight) - // Standard Error: 9_000 - .saturating_add((243_000 as Weight).saturating_mul(s as Weight)) + Weight::from_ref_time(28_175_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(78_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MultiSig Multisigs (r:1 w:1) fn as_multi_approve(s: u32, z: u32) -> Weight { - (52_952_000 as Weight) - // Standard Error: 8_000 - .saturating_add((163_000 as Weight).saturating_mul(s as Weight)) + Weight::from_ref_time(20_530_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(70_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) fn as_multi_approve_store(s: u32, z: u32) -> Weight { - (68_506_000 as Weight) - // Standard Error: 10_000 - .saturating_add((213_000 as Weight).saturating_mul(s as Weight)) + Weight::from_ref_time(29_734_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(73_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn as_multi_complete(s: u32, z: u32) -> Weight { - (81_537_000 as Weight) - // Standard Error: 13_000 - .saturating_add((460_000 as Weight).saturating_mul(s as Weight)) + Weight::from_ref_time(35_958_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(108_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add((5_000 as Weight).saturating_mul(z as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn approve_as_multi_create(s: u32) -> Weight { - (68_980_000 as Weight) - // Standard Error: 10_000 - .saturating_add((211_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(23_697_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(98_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:0) fn approve_as_multi_approve(s: u32) -> Weight { - (39_761_000 as Weight) - // Standard Error: 9_000 - .saturating_add((296_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(16_611_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(100_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn approve_as_multi_complete(s: u32) -> Weight { - (121_916_000 as Weight) - // Standard Error: 15_000 - .saturating_add((496_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(40_814_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(136_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) fn cancel_as_multi(s: u32) -> Weight { - (93_947_000 as Weight) - // Standard Error: 20_000 - .saturating_add((293_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(35_582_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(92_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index 12b75e0ae..1d2055a00 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_parachain_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,49 +50,49 @@ pub struct WeightInfo(PhantomData); impl pallet_parachain_staking::weights::WeightInfo for WeightInfo { // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_staking_expectations() -> Weight { - (30_011_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_772_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking InflationConfig (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_inflation() -> Weight { - (86_350_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(35_128_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_account() -> Weight { - (29_470_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_556_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_reserve_percent() -> Weight { - (31_920_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(11_823_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking TotalSelected (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_total_selected() -> Weight { - (32_160_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(13_791_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking CollatorCommission (r:1 w:1) fn set_collator_commission() -> Weight { - (31_010_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(11_749_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking Round (r:1 w:1) // Storage: ParachainStaking TotalSelected (r:1 w:0) // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_blocks_per_round() -> Weight { - (109_270_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(36_619_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking DelegatorState (r:1 w:0) @@ -103,21 +103,21 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TopDelegations (r:0 w:1) // Storage: ParachainStaking BottomDelegations (r:0 w:1) fn join_candidates(x: u32) -> Weight { - (176_454_000 as Weight) - // Standard Error: 4_000 - .saturating_add((181_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(31_483_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(198_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(7)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn schedule_leave_candidates(x: u32) -> Weight { - (142_707_000 as Weight) - // Standard Error: 5_000 - .saturating_add((164_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(26_529_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(175_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) @@ -126,39 +126,40 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:2 w:2) // Storage: System Account (r:2 w:2) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) + // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) // Storage: ParachainStaking BottomDelegations (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_leave_candidates(x: u32) -> Weight { - (0 as Weight) - // Standard Error: 231_000 - .saturating_add((64_246_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(x as Weight))) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(x as Weight))) + Weight::from_ref_time(0) + // Standard Error: 54_000 + .saturating_add(Weight::from_ref_time(17_144_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn cancel_leave_candidates(x: u32) -> Weight { - (140_788_000 as Weight) - // Standard Error: 4_000 - .saturating_add((168_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(24_767_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(187_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_offline() -> Weight { - (42_920_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(19_040_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_online() -> Weight { - (41_760_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_273_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: System Account (r:1 w:1) @@ -166,16 +167,16 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn candidate_bond_more() -> Weight { - (70_700_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(34_300_000) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_candidate_bond_less() -> Weight { - (40_220_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_608_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) @@ -184,15 +185,15 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: System Account (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn execute_candidate_bond_less() -> Weight { - (72_820_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(39_891_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) fn cancel_candidate_bond_less() -> Weight { - (28_360_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_010_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Storage: ParachainStaking DelegatorState (r:1 w:1) @@ -202,21 +203,21 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn delegate(x: u32, y: u32) -> Weight { - (275_442_000 as Weight) - // Standard Error: 33_000 - .saturating_add((59_000 as Weight).saturating_mul(x as Weight)) - // Standard Error: 11_000 - .saturating_add((281_000 as Weight).saturating_mul(y as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(79_992_000) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(123_000).saturating_mul(x.into())) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(132_000).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(7)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn schedule_leave_delegators() -> Weight { - (50_240_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_235_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) @@ -225,31 +226,32 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TopDelegations (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) + // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:0) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn execute_leave_delegators(x: u32) -> Weight { - (0 as Weight) - // Standard Error: 147_000 - .saturating_add((50_946_000 as Weight).saturating_mul(x as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(x as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(x as Weight))) + Weight::from_ref_time(21_429_000) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(13_765_000).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_leave_delegators() -> Weight { - (51_670_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_711_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_revoke_delegation() -> Weight { - (57_460_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(21_082_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) // Storage: ParachainStaking DelegatorState (r:1 w:1) @@ -260,31 +262,32 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn delegator_bond_more() -> Weight { - (99_120_000 as Weight) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(45_308_000) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_delegator_bond_less() -> Weight { - (59_450_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_867_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) + // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:0) // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking TopDelegations (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_revoke_delegation() -> Weight { - (120_970_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(61_324_000) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) @@ -296,23 +299,23 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_delegator_bond_less() -> Weight { - (110_711_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(52_704_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(8)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_revoke_delegation() -> Weight { - (43_980_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_414_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_delegator_bond_less() -> Weight { - (52_200_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(25_884_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking Round (r:1 w:1) // Storage: ParachainStaking Points (r:1 w:0) @@ -326,18 +329,19 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidateInfo (r:9 w:0) // Storage: ParachainStaking DelegationScheduledRequests (r:9 w:0) // Storage: ParachainStaking TopDelegations (r:9 w:0) + // Storage: ParachainStaking AutoCompoundingDelegations (r:9 w:0) // Storage: ParachainStaking Total (r:1 w:0) // Storage: ParachainStaking AwardedPts (r:2 w:1) // Storage: ParachainStaking AtStake (r:1 w:10) // Storage: ParachainStaking SelectedCandidates (r:0 w:1) // Storage: ParachainStaking DelayedPayouts (r:0 w:1) fn round_transition_on_initialize(x: u32, y: u32) -> Weight { - (0 as Weight) - // Standard Error: 1_511_000 - .saturating_add((90_015_000 as Weight).saturating_mul(x as Weight)) - // Standard Error: 5_000 - .saturating_add((550_000 as Weight).saturating_mul(y as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(x as Weight))) + Weight::from_ref_time(0) + // Standard Error: 644_000 + .saturating_add(Weight::from_ref_time(23_725_000).saturating_mul(x.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(158_000).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) } // Storage: ParachainStaking DelayedPayouts (r:1 w:0) // Storage: ParachainStaking Points (r:1 w:0) @@ -345,16 +349,45 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking AtStake (r:1 w:1) // Storage: System Account (r:1 w:1) fn pay_one_collator_reward(y: u32) -> Weight { - (8_729_000 as Weight) - // Standard Error: 53_000 - .saturating_add((24_974_000 as Weight).saturating_mul(y as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(y as Weight))) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(y as Weight))) + Weight::from_ref_time(42_666_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(7_581_000).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(y.into()))) } // Storage: ParachainStaking Round (r:1 w:0) fn base_on_initialize() -> Weight { - (7_010_000 as Weight).saturating_add(T::DbWeight::get().reads(1 as Weight)) + Weight::from_ref_time(5_230_000).saturating_add(T::DbWeight::get().reads(1)) + } + // Storage: ParachainStaking DelegatorState (r:1 w:0) + // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) + fn set_auto_compound(x: u32, y: u32) -> Weight { + Weight::from_ref_time(41_348_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(123_000).saturating_mul(x.into())) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(129_000).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: System Account (r:1 w:1) + // Storage: ParachainStaking DelegatorState (r:1 w:1) + // Storage: ParachainStaking CandidateInfo (r:1 w:1) + // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) + // Storage: ParachainStaking TopDelegations (r:1 w:1) + // Storage: ParachainStaking CandidatePool (r:1 w:1) + // Storage: Balances Locks (r:1 w:1) + // Storage: ParachainStaking Total (r:1 w:1) + // Storage: ParachainStaking BottomDelegations (r:1 w:1) + fn delegate_with_auto_compound(x: u32, y: u32, _z: u32) -> Weight { + Weight::from_ref_time(98_391_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(40_000).saturating_mul(x.into())) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(39_000).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) } } diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index 5f5bbd4c2..2c9a555ce 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,86 +51,86 @@ impl pallet_preimage::weights::WeightInfo for WeightInf // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn note_preimage(s: u32) -> Weight { - (0 as Weight) + Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add((3_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:0) fn note_requested_preimage(s: u32) -> Weight { - (0 as Weight) + Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:0) fn note_no_deposit_preimage(s: u32) -> Weight { - (0 as Weight) + Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add((4_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - (90_241_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(23_817_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - (68_510_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(14_632_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - (95_300_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(22_851_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - (72_430_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(13_733_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - (47_350_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(13_220_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - (22_100_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_833_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - (66_950_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(15_046_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - (43_790_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(15_443_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - (22_570_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(7_028_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index 3fa33fea5..55168c709 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,92 +50,92 @@ pub struct WeightInfo(PhantomData); impl pallet_proxy::weights::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32) -> Weight { - (31_661_000 as Weight) - // Standard Error: 10_000 - .saturating_add((224_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) + Weight::from_ref_time(14_551_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(15_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32) -> Weight { - (68_434_000 as Weight) - // Standard Error: 39_000 - .saturating_add((265_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 41_000 - .saturating_add((14_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(27_375_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(64_000).saturating_mul(a.into())) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(68_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn remove_announcement(a: u32, p: u32) -> Weight { - (40_722_000 as Weight) - // Standard Error: 9_000 - .saturating_add((434_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 9_000 - .saturating_add((72_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + fn remove_announcement(a: u32, _p: u32) -> Weight { + Weight::from_ref_time(20_140_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(88_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn reject_announcement(a: u32, p: u32) -> Weight { - (44_132_000 as Weight) - // Standard Error: 33_000 - .saturating_add((394_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 34_000 - .saturating_add((62_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + fn reject_announcement(a: u32, _p: u32) -> Weight { + Weight::from_ref_time(20_526_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(70_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn announce(a: u32, _p: u32) -> Weight { - (63_543_000 as Weight) - // Standard Error: 40_000 - .saturating_add((356_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + fn announce(a: u32, p: u32) -> Weight { + Weight::from_ref_time(24_821_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(95_000).saturating_mul(a.into())) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(57_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32) -> Weight { - (51_619_000 as Weight) - // Standard Error: 15_000 - .saturating_add((233_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_093_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(70_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32) -> Weight { - (52_529_000 as Weight) - // Standard Error: 9_000 - .saturating_add((212_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(20_379_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(64_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32) -> Weight { - (44_494_000 as Weight) - // Standard Error: 4_000 - .saturating_add((154_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(17_624_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(35_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - fn anonymous(_p: u32) -> Weight { - (60_255_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + fn anonymous(p: u32) -> Weight { + Weight::from_ref_time(22_081_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(11_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_anonymous(p: u32) -> Weight { - (44_307_000 as Weight) - // Standard Error: 69_000 - .saturating_add((257_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(18_300_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(41_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index ab4c7bf06..1c4861a84 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,143 +53,145 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32) -> Weight { - (15_878_000 as Weight) - // Standard Error: 544_000 - .saturating_add((41_862_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(21_157_000) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(12_140_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32) -> Weight { - (10_252_000 as Weight) - // Standard Error: 440_000 - .saturating_add((32_954_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(19_942_000) + // Standard Error: 17_000 + .saturating_add(Weight::from_ref_time(9_690_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_periodic_resolved(s: u32) -> Weight { - (7_473_000 as Weight) - // Standard Error: 161_000 - .saturating_add((35_361_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(20_565_000) + // Standard Error: 21_000 + .saturating_add(Weight::from_ref_time(10_251_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_resolved(s: u32) -> Weight { - (0 as Weight) - // Standard Error: 156_000 - .saturating_add((29_887_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(18_489_000) + // Standard Error: 22_000 + .saturating_add(Weight::from_ref_time(8_916_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Preimage PreimageFor (r:1 w:0) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32) -> Weight { - (26_628_000 as Weight) - // Standard Error: 60_000 - .saturating_add((11_243_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(7_774_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(3_371_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Preimage PreimageFor (r:1 w:0) fn on_initialize_aborted(s: u32) -> Weight { - (29_715_000 as Weight) - // Standard Error: 81_000 - .saturating_add((6_070_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(6_944_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(1_744_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named(s: u32) -> Weight { - (20_565_000 as Weight) - // Standard Error: 40_000 - .saturating_add((20_118_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(18_393_000) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(5_858_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:2 w:2) fn on_initialize_periodic(s: u32) -> Weight { - (51_399_000 as Weight) - // Standard Error: 127_000 - .saturating_add((14_763_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(12_837_000) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(4_375_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32) -> Weight { - (33_895_000 as Weight) - // Standard Error: 57_000 - .saturating_add((11_791_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight))) + Weight::from_ref_time(12_809_000) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(3_790_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:1 w:1) fn on_initialize(s: u32) -> Weight { - (41_957_000 as Weight) - // Standard Error: 109_000 - .saturating_add((9_825_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(10_524_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(3_133_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) fn schedule(s: u32) -> Weight { - (36_388_000 as Weight) - // Standard Error: 6_000 - .saturating_add((148_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(13_078_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(91_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn cancel(s: u32) -> Weight { - (37_514_000 as Weight) - // Standard Error: 7_000 - .saturating_add((1_101_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(13_377_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(392_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - fn schedule_named(_s: u32) -> Weight { - (48_375_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + fn schedule_named(s: u32) -> Weight { + Weight::from_ref_time(15_612_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(143_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32) -> Weight { - (38_182_000 as Weight) - // Standard Error: 11_000 - .saturating_add((1_045_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(15_559_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(434_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index a94214901..badebae73 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,13 +49,12 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_timestamp::weights::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) - // Storage: Aura CurrentSlot (r:1 w:0) fn set() -> Weight { - (19_010_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_328_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } fn on_finalize() -> Weight { - (5_500_000 as Weight) + Weight::from_ref_time(3_459_000) } } diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index 3e646321b..dcdf176e0 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_treasury //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,47 +49,47 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_treasury::weights::WeightInfo for WeightInfo { fn spend() -> Weight { - (290_000 as Weight) + Weight::from_ref_time(97_000) } // Storage: Treasury ProposalCount (r:1 w:1) // Storage: Treasury Proposals (r:0 w:1) fn propose_spend() -> Weight { - (46_190_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(20_639_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Treasury Proposals (r:1 w:1) fn reject_proposal() -> Weight { - (58_530_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_734_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Proposals (r:1 w:0) // Storage: Treasury Approvals (r:1 w:1) fn approve_proposal(p: u32) -> Weight { - (22_156_000 as Weight) - // Standard Error: 7_000 - .saturating_add((300_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(10_189_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(108_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Approvals (r:1 w:1) fn remove_approval() -> Weight { - (13_870_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(6_149_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) // Storage: Treasury Approvals (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) // Storage: Treasury Proposals (r:2 w:2) fn on_initialize_proposals(p: u32) -> Weight { - (106_923_000 as Weight) - // Standard Error: 370_000 - .saturating_add((56_357_000 as Weight).saturating_mul(p as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(p as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(p as Weight))) + Weight::from_ref_time(39_798_000) + // Standard Error: 30_000 + .saturating_add(Weight::from_ref_time(17_861_000).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) } } diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index dc64b168a..07713136c 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,24 +49,24 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_utility::weights::WeightInfo for WeightInfo { fn batch(c: u32) -> Weight { - (40_987_000 as Weight) - // Standard Error: 18_000 - .saturating_add((5_614_000 as Weight).saturating_mul(c as Weight)) + Weight::from_ref_time(31_929_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(2_285_000).saturating_mul(c.into())) } fn as_derivative() -> Weight { - (8_160_000 as Weight) + Weight::from_ref_time(3_956_000) } fn batch_all(c: u32) -> Weight { - (89_220_000 as Weight) - // Standard Error: 52_000 - .saturating_add((5_803_000 as Weight).saturating_mul(c as Weight)) + Weight::from_ref_time(35_456_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_327_000).saturating_mul(c.into())) } fn dispatch_as() -> Weight { - (24_700_000 as Weight) + Weight::from_ref_time(9_192_000) } fn force_batch(c: u32) -> Weight { - (69_293_000 as Weight) - // Standard Error: 46_000 - .saturating_add((5_611_000 as Weight).saturating_mul(c as Weight)) + Weight::from_ref_time(32_930_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(2_283_000).saturating_mul(c.into())) } } diff --git a/runtime/common/src/weights/pallet_vesting.rs b/runtime/common/src/weights/pallet_vesting.rs index df746fda3..c0d0f370e 100644 --- a/runtime/common/src/weights/pallet_vesting.rs +++ b/runtime/common/src/weights/pallet_vesting.rs @@ -18,16 +18,16 @@ //! Autogenerated weights for pallet_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-05, STEPS: `2`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/production/zeitgeist +// ./target/release/zeitgeist // benchmark // pallet // --chain=dev -// --steps=50 -// --repeat=20 +// --steps=2 +// --repeat=2 // --pallet=pallet_vesting // --extrinsic=* // --execution=wasm @@ -51,89 +51,89 @@ impl pallet_vesting::weights::WeightInfo for WeightInfo // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_locked(l: u32, s: u32) -> Weight { - (64_180_000 as Weight) - // Standard Error: 22_000 - .saturating_add((68_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 46_000 - .saturating_add((202_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(51_010_000) + // Standard Error: 92_000 + .saturating_add(Weight::from_ref_time(81_000).saturating_mul(l.into())) + // Standard Error: 167_000 + .saturating_add(Weight::from_ref_time(98_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_unlocked(l: u32, s: u32) -> Weight { - (61_117_000 as Weight) - // Standard Error: 21_000 - .saturating_add((77_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 43_000 - .saturating_add((274_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(53_538_000) + // Standard Error: 92_000 + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(l.into())) + // Standard Error: 167_000 + .saturating_add(Weight::from_ref_time(90_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn vest_other_locked(l: u32, _s: u32) -> Weight { - (71_338_000 as Weight) - // Standard Error: 21_000 - .saturating_add((99_000 as Weight).saturating_mul(l as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + fn vest_other_locked(l: u32, s: u32) -> Weight { + Weight::from_ref_time(48_450_000) + // Standard Error: 90_000 + .saturating_add(Weight::from_ref_time(111_000).saturating_mul(l.into())) + // Standard Error: 164_000 + .saturating_add(Weight::from_ref_time(198_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn vest_other_unlocked(_l: u32, s: u32) -> Weight { - (62_952_000 as Weight) - // Standard Error: 65_000 - .saturating_add((500_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + fn vest_other_unlocked(l: u32, s: u32) -> Weight { + Weight::from_ref_time(53_097_000) + // Standard Error: 85_000 + .saturating_add(Weight::from_ref_time(31_000).saturating_mul(l.into())) + // Standard Error: 154_000 + .saturating_add(Weight::from_ref_time(39_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vested_transfer(l: u32, s: u32) -> Weight { - (79_913_000 as Weight) - // Standard Error: 24_000 - .saturating_add((206_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 49_000 - .saturating_add((535_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + fn vested_transfer(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(81_504_000) + // Standard Error: 115_000 + .saturating_add(Weight::from_ref_time(65_000).saturating_mul(l.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:1 w:1) - fn force_vested_transfer(l: u32, s: u32) -> Weight { - (78_857_000 as Weight) - // Standard Error: 67_000 - .saturating_add((223_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 137_000 - .saturating_add((808_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + fn force_vested_transfer(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(81_219_000) + // Standard Error: 106_000 + .saturating_add(Weight::from_ref_time(47_000).saturating_mul(l.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight { - (59_290_000 as Weight) - // Standard Error: 25_000 - .saturating_add((249_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 54_000 - .saturating_add((207_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(53_564_000) + // Standard Error: 72_000 + .saturating_add(Weight::from_ref_time(88_000).saturating_mul(l.into())) + // Standard Error: 137_000 + .saturating_add(Weight::from_ref_time(64_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn unlocking_merge_schedules(l: u32, s: u32) -> Weight { - (50_783_000 as Weight) - // Standard Error: 20_000 - .saturating_add((247_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 43_000 - .saturating_add((584_000 as Weight).saturating_mul(s as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(53_580_000) + // Standard Error: 91_000 + .saturating_add(Weight::from_ref_time(50_000).saturating_mul(l.into())) + // Standard Error: 171_000 + .saturating_add(Weight::from_ref_time(69_000).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index d1d3f8fb5..08e48ffea 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -1,82 +1,85 @@ [build-dependencies] -substrate-wasm-builder = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +substrate-wasm-builder = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } [dependencies] -frame-executive = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system-rpc-runtime-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-currencies = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-tokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } -pallet-balances = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-bounties = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-collective = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-democracy = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-identity = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-membership = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-multisig = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-preimage = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-proxy = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-randomness-collective-flip = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-scheduler = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-treasury = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-utility = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-vesting = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-executive = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-bounties = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-collective = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-democracy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-identity = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-membership = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-multisig = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-preimage = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-proxy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-scheduler = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-vesting = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-block-builder = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-core = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-inherents = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-offchain = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-session = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-transaction-pool = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-version = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-block-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-inherents = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-offchain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-session = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-version = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" } # Try-Runtime -frame-try-runtime = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-try-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } # Benchmark -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } -frame-system-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } +frame-system-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } # Cumulus -cumulus-pallet-dmp-queue = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-pallet-parachain-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-pallet-xcm = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-pallet-xcmp-queue = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-core = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-timestamp = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -cumulus-primitives-utility = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } -parachain-info = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-dmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-parachain-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-xcmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-primitives-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +parachain-info = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } # Parachain -nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-author-mapping = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/nimbus", optional = true } -pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.26", default-features = false, git = "https://github.com/purestake/crowdloan-rewards", optional = true } -pallet-parachain-staking = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } -polkadot-parachain = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -session-keys-primitives = { tag = "v0.26.1", default-features = false, git = "https://github.com/purestake/moonbeam", optional = true } +nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } +pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/crowdloan-rewards", optional = true } +pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } + +# Polkadot + +polkadot-parachain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } # Standalone -pallet-aura = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -pallet-grandpa = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-consensus-aura = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-finality-grandpa = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } # Utility cfg-if = { version = "1.0.0" } @@ -84,17 +87,17 @@ hex-literal = { default-features = false, optional = true, version = "0.3.4" } log = { version = "0.4.17", default-features = false, optional = true } # XCM -kusama-runtime = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -orml-asset-registry = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-unknown-tokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-xcm-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-xtokens = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -pallet-xcm = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-primitives = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -polkadot-runtime-parachains = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -xcm = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -xcm-builder = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } -xcm-executor = { branch = "release-v0.9.26", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +kusama-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-unknown-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-xcm-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-xtokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-runtime-parachains = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +xcm-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +xcm-executor = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } # Zeitgeist @@ -113,8 +116,8 @@ zrml-swaps = { default-features = false, path = "../../zrml/swaps" } zrml-swaps-runtime-api = { default-features = false, path = "../../zrml/swaps/runtime-api" } [dev-dependencies] -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -xcm-emulator = { rev = "ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe", git = "https://github.com/shaunxw/xcm-simulator" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +xcm-emulator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/xcm-simulator" } [features] default = ["std"] @@ -320,6 +323,7 @@ try-runtime = [ # For every pallet in the runtime include try-runtime # System runtime pallets + "frame-support/try-runtime", "frame-system/try-runtime", "pallet-timestamp/try-runtime", "pallet-randomness-collective-flip/try-runtime", @@ -364,10 +368,23 @@ try-runtime = [ # Parachain "pallet-author-mapping?/try-runtime", + "pallet-author-inherent?/try-runtime", "pallet-author-slot-filter?/try-runtime", "pallet-parachain-staking?/try-runtime", # Required by pallet-parachain-staking@v0.26.1 "parity-scale-codec/full", + "pallet-proxy/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-aura/try-runtime", + "pallet-xcm/try-runtime", + "pallet-crowdloan-rewards/try-runtime", + # Cumulus + + "cumulus-pallet-dmp-queue?/try-runtime", + "cumulus-pallet-parachain-system?/try-runtime", + "cumulus-pallet-xcm?/try-runtime", + "cumulus-pallet-xcmp-queue?/try-runtime", + "parachain-info?/try-runtime", ] with-global-disputes = [ "zrml-global-disputes", diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index ead4ca132..db07a0ca5 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -123,7 +123,7 @@ fn default_parachains_host_configuration() -> HostConfiguration { max_upward_queue_count: 8, max_upward_queue_size: 1024 * 1024, max_downward_message_size: 1024, - ump_service_total_weight: Weight::from(4 * 1_000_000_000u32), + ump_service_total_weight: Weight::from_ref_time(4_u64 * 1_000_000_000_u64), max_upward_message_size: 50 * 1024, max_upward_message_num_per_candidate: 5, hrmp_sender_deposit: 0, diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 3fde212b7..def87361b 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -33,6 +33,7 @@ pub use frame_system::{ }; #[cfg(feature = "parachain")] pub use pallet_author_slot_filter::EligibilityValue; +pub use pallet_balances::Call as BalancesCall; #[cfg(feature = "parachain")] pub use crate::parachain_params::*; @@ -74,7 +75,7 @@ use sp_runtime::{ }; #[cfg(feature = "parachain")] -use nimbus_primitives::{CanAuthor, NimbusId}; +use nimbus_primitives::CanAuthor; use sp_version::RuntimeVersion; #[cfg(test)] diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index 3e80d851c..aff4b9e42 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -49,10 +49,10 @@ parameter_types! { pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Kusama; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UnitWeightCost: Weight = 200_000_000; + pub UnitWeightCost: u64 = 200_000_000; // Staking /// Rounds before the candidate bond increase/decrease can be executed @@ -90,7 +90,7 @@ parameter_types! { // XCM /// Base weight for XCM execution - pub const BaseXcmWeight: Weight = 200_000_000; + pub const BaseXcmWeight: u64 = 200_000_000; /// The maximum number of distinct assets allowed to be transferred in a /// single helper extrinsic. pub const MaxAssetsForTransfer: usize = 2; diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index b4408f876..636105ecc 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -34,7 +34,8 @@ use frame_system::limits::{BlockLength, BlockWeights}; use orml_traits::parameter_type_with_key; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_runtime::{ - traits::AccountIdConversion, FixedPointNumber, Perbill, Percent, Permill, Perquintill, + traits::{AccountIdConversion, Bounded}, + FixedPointNumber, Perbill, Percent, Permill, Perquintill, }; use sp_version::RuntimeVersion; use zeitgeist_primitives::{constants::*, types::*}; @@ -43,7 +44,8 @@ use zeitgeist_primitives::{constants::*, types::*}; use frame_support::traits::LockIdentifier; pub(crate) const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; +pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = + Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 2); pub(crate) const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub(crate) const FEES_AND_TIPS_TREASURY_PERCENTAGE: u32 = 100; pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; @@ -273,9 +275,6 @@ parameter_types! { .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .build_or_panic(); - // Timestamp - pub const MinimumPeriod: u64 = MILLISECS_PER_BLOCK as u64 / 2; - // Transaction payment /// A fee mulitplier for Operational extrinsics to compute “virtual tip” /// to boost their priority. @@ -292,6 +291,12 @@ parameter_types! { /// Minimum amount of the multiplier. The test `multiplier_can_grow_from_zero` ensures /// that this value is not too low. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000u128); + /// Maximum amount of the multiplier. + pub MaximumMultiplier: Multiplier = Bounded::max_value(); + + // Timestamp + /// MinimumPeriod for Timestamp + pub const MinimumPeriodValue: u64 = MILLISECS_PER_BLOCK as u64 / 2; // Treasury /// Percentage of spare funds (if any) that are burnt per spend period. @@ -378,5 +383,10 @@ parameter_type_with_key! { // Parameterized slow adjusting fee updated based on // https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism -pub type SlowAdjustingFeeUpdate = - TargetedFeeAdjustment; +pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< + R, + TargetBlockFullness, + AdjustmentVariable, + MinimumMultiplier, + MaximumMultiplier, +>; diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index 8520f5a86..0b1b83b6c 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -71,6 +71,7 @@ impl Config for XcmConfig { type Barrier = Barrier; /// The outer call dispatch type. type Call = Call; + type CallDispatcher = Call; /// Combinations of (Location, Asset) pairs which are trusted as reserves. // Trust the parent chain, sibling parachains and children chains of this chain. type IsReserve = MultiNativeAsset; diff --git a/runtime/zeitgeist/src/xcm_config/fees.rs b/runtime/zeitgeist/src/xcm_config/fees.rs index dbedf3d93..bc188eafc 100644 --- a/runtime/zeitgeist/src/xcm_config/fees.rs +++ b/runtime/zeitgeist/src/xcm_config/fees.rs @@ -29,8 +29,8 @@ pub fn native_per_second() -> Balance { } pub fn default_per_second(decimals: u32) -> Balance { - let base_weight = Balance::from(ExtrinsicBaseWeight::get()); - let default_per_second = (WEIGHT_PER_SECOND as u128) / base_weight; + let base_weight = ExtrinsicBaseWeight::get().ref_time() as u128; + let default_per_second = (WEIGHT_PER_SECOND.ref_time() as u128) / base_weight; default_per_second * base_fee(decimals) } diff --git a/scripts/benchmarks/configuration.sh b/scripts/benchmarks/configuration.sh index 937f20edd..03a203dac 100644 --- a/scripts/benchmarks/configuration.sh +++ b/scripts/benchmarks/configuration.sh @@ -15,7 +15,7 @@ export FRAME_WEIGHT_TEMPLATE="./misc/frame_weight_template.hbs" # pallet_crowdloan_rewards benchmark lead to an error within the verify function (deprecated) export FRAME_PALLETS_PARACHAIN=( cumulus_pallet_xcmp_queue \ - # pallet_author_inherent \ + pallet_author_inherent \ pallet_author_slot_filter \ pallet_author_mapping \ pallet_parachain_staking \ diff --git a/scripts/benchmarks/quick_check.sh b/scripts/benchmarks/quick_check.sh index 6794b3895..a5487dcc0 100755 --- a/scripts/benchmarks/quick_check.sh +++ b/scripts/benchmarks/quick_check.sh @@ -12,13 +12,13 @@ if [ ! -d "./scripts/benchmarks" ]; then exit 1 fi; -export FRAME_PALLETS_STEPS=1 +export FRAME_PALLETS_STEPS=2 export FRAME_PALLETS_RUNS=0 -export ORML_PALLETS_STEPS=1 +export ORML_PALLETS_STEPS=2 export ORML_PALLETS_RUNS=0 -export ZEITGEIST_PALLETS_STEPS=1 +export ZEITGEIST_PALLETS_STEPS=2 export ZEITGEIST_PALLETS_RUNS=0 export PROFILE=release diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index 45d81459e..7f2098d5f 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -1,17 +1,17 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/authorized/src/mock.rs b/zrml/authorized/src/mock.rs index 9b57f0425..49517fc84 100644 --- a/zrml/authorized/src/mock.rs +++ b/zrml/authorized/src/mock.rs @@ -91,7 +91,7 @@ impl DisputeResolutionApi for MockResolution { Asset, >, ) -> Result { - Ok(0) + Ok(Weight::zero()) } fn add_auto_resolve( diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index b2cb712bd..9569f19f7 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -56,17 +56,18 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn authorize_market_outcome_first_report(m: u32) -> Weight { - (31_031_000 as Weight) + Weight::from_ref_time(31_031_000) // Standard Error: 0 - .saturating_add((85_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(85_000)) + .saturating_mul(m.into()) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) fn authorize_market_outcome_existing_report() -> Weight { - (24_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(24_000_000) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index de86174b4..096c6da68 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -1,20 +1,20 @@ [dependencies] arrayvec = { default-features = false, version = "0.7" } -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } rand = { default-features = false, features = ["alloc", "std_rng"], version = "0.8" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-randomness-collective-flip = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/court/src/mock.rs b/zrml/court/src/mock.rs index 42622b9a0..fd33e1859 100644 --- a/zrml/court/src/mock.rs +++ b/zrml/court/src/mock.rs @@ -87,7 +87,7 @@ impl DisputeResolutionApi for NoopResolution { Asset, >, ) -> Result { - Ok(0) + Ok(Weight::zero()) } fn add_auto_resolve( diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index 0989647b2..b2d139d26 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_court //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -59,23 +59,23 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court RequestedJurors (r:1 w:0) // Storage: Court Votes (r:1 w:0) fn exit_court() -> Weight { - (78_840_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(32_139_000) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Court Jurors (r:1 w:1) // Storage: Court CounterForJurors (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) fn join_court() -> Weight { - (56_951_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(22_962_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Court Jurors (r:1 w:0) // Storage: Court Votes (r:0 w:1) fn vote() -> Weight { - (18_980_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(9_773_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/global-disputes/Cargo.toml b/zrml/global-disputes/Cargo.toml index a099ee134..dde21457d 100644 --- a/zrml/global-disputes/Cargo.toml +++ b/zrml/global-disputes/Cargo.toml @@ -1,11 +1,11 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-std = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-std = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } @@ -14,9 +14,9 @@ num-traits = { version = "0.2.15", default-features = false, optional = true } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } test-case = "2.0.2" diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index a549c252f..d87225ebd 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_global_disputes //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -61,81 +61,81 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_on_outcome(o: u32, v: u32) -> Weight { - (77_234_000 as Weight) - // Standard Error: 4_000 - .saturating_add((122_000 as Weight).saturating_mul(o as Weight)) + fn vote_on_outcome(_o: u32, v: u32) -> Weight { + Weight::from_ref_time(32_621_000) // Standard Error: 0 - .saturating_add((108_000 as Weight).saturating_mul(v as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(37_000).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_set(l: u32, o: u32) -> Weight { - (21_110_000 as Weight) - // Standard Error: 3_000 - .saturating_add((6_327_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 20_000 - .saturating_add((1_976_000 as Weight).saturating_mul(o as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(l as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(17_375_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_536_000).saturating_mul(l.into())) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(432_000).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight { - (18_940_000 as Weight) + Weight::from_ref_time(16_626_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_481_000).saturating_mul(l.into())) // Standard Error: 3_000 - .saturating_add((6_247_000 as Weight).saturating_mul(l as Weight)) - // Standard Error: 19_000 - .saturating_add((1_822_000 as Weight).saturating_mul(o as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(l as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(Weight::from_ref_time(326_000).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: System Account (r:1 w:1) - fn add_vote_outcome(_w: u32) -> Weight { - (91_053_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + fn add_vote_outcome(w: u32) -> Weight { + Weight::from_ref_time(34_491_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(10_000).saturating_mul(w.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: GlobalDisputes Outcomes (r:1 w:0) // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:2 w:2) fn reward_outcome_owner_with_funds(o: u32) -> Weight { - (51_857_000 as Weight) - // Standard Error: 27_000 - .saturating_add((33_805_000 as Weight).saturating_mul(o as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(o as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(o as Weight))) + Weight::from_ref_time(24_336_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(11_655_000).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(o.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(o.into()))) } // Storage: GlobalDisputes Outcomes (r:1 w:0) // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:1 w:0) fn reward_outcome_owner_no_funds(o: u32) -> Weight { - (39_929_000 as Weight) - // Standard Error: 3_000 - .saturating_add((13_000 as Weight).saturating_mul(o as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) + Weight::from_ref_time(16_681_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(15_000).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(3)) } // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:3 w:2) fn purge_outcomes(k: u32, _o: u32) -> Weight { - (0 as Weight) - // Standard Error: 11_000 - .saturating_add((23_452_000 as Weight).saturating_mul(k as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(k as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(k as Weight))) + Weight::from_ref_time(72_588_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(6_944_000).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) } } diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index 7204827f4..7559a5db9 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -1,18 +1,18 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { default-features = false, optional = true, version = "1.0.137" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +serde = { default-features = false, optional = true, version = "1.0.144" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/liquidity-mining/src/weights.rs b/zrml/liquidity-mining/src/weights.rs index 0ada8b83d..16fb23a2d 100644 --- a/zrml/liquidity-mining/src/weights.rs +++ b/zrml/liquidity-mining/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_liquidity_mining //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,6 +53,6 @@ pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { // Storage: LiquidityMining PerBlockIncentive (r:0 w:1) fn set_per_block_distribution() -> Weight { - (6_620_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(2_673_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index 17392e1b2..ad44a7d7e 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -1,16 +1,16 @@ [dependencies] -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-arithmetic = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-arithmetic = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/orderbook-v1/Cargo.toml b/zrml/orderbook-v1/Cargo.toml index 07e59e8c1..f05ad24a4 100644 --- a/zrml/orderbook-v1/Cargo.toml +++ b/zrml/orderbook-v1/Cargo.toml @@ -1,18 +1,18 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } # Mock -orml-tokens = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } [dev-dependencies] zrml-orderbook-v1 = { features = ["mock"], path = "." } diff --git a/zrml/orderbook-v1/fuzz/Cargo.toml b/zrml/orderbook-v1/fuzz/Cargo.toml index 1472e91d7..b2c36842f 100644 --- a/zrml/orderbook-v1/fuzz/Cargo.toml +++ b/zrml/orderbook-v1/fuzz/Cargo.toml @@ -6,7 +6,7 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } libfuzzer-sys = "0.4" zeitgeist-primitives = { path = "../../../primitives" } zrml-orderbook-v1 = { features = ["mock"], path = ".." } diff --git a/zrml/orderbook-v1/src/weights.rs b/zrml/orderbook-v1/src/weights.rs index f572f3fb1..a02f0b030 100644 --- a/zrml/orderbook-v1/src/weights.rs +++ b/zrml/orderbook-v1/src/weights.rs @@ -45,6 +45,7 @@ #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] use core::marker::PhantomData; use frame_support::{traits::Get, weights::Weight}; @@ -64,33 +65,33 @@ pub trait WeightInfoZeitgeist { pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { fn cancel_order_ask() -> Weight { - (53_301_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(53_301_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } fn cancel_order_bid() -> Weight { - (49_023_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(49_023_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } fn fill_order_ask() -> Weight { - (119_376_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(119_376_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } fn fill_order_bid() -> Weight { - (119_917_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(119_917_000) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } fn make_order_ask() -> Weight { - (80_092_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(80_092_000) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) } fn make_order_bid() -> Weight { - (62_027_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(62_027_000) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } } diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index 397359a17..f12cf796f 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -1,13 +1,13 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.137", default-features = false, optional = true } -sp-arithmetic = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +serde = { version = "1.0.144", default-features = false, optional = true } +sp-arithmetic = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-authorized = { default-features = false, path = "../authorized" } zrml-court = { default-features = false, path = "../court" } @@ -16,19 +16,20 @@ zrml-liquidity-mining = { default-features = false, path = "../liquidity-mining" zrml-market-commons = { default-features = false, path = "../market-commons" } zrml-simple-disputes = { default-features = false, path = "../simple-disputes" } + # Mock -orml-asset-registry = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", default-features = false, optional = true } -orml-currencies = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-tokens = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -pallet-randomness-collective-flip = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -pallet-timestamp = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } -pallet-treasury = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sp-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } +orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } +pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } substrate-fixed = { optional = true, git = "https://github.com/encointer/substrate-fixed" } -xcm = { branch = "release-v0.9.26", git = "https://github.com/paritytech/polkadot", optional = true, default-features = false } +xcm = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true, default-features = false } zrml-prediction-markets-runtime-api = { features = ["std"], optional = true, path = "./runtime-api" } zrml-rikiddo = { optional = true, path = "../rikiddo" } zrml-swaps = { optional = true, path = "../swaps" } @@ -70,9 +71,10 @@ std = [ "frame-benchmarking?/std", "frame-support/std", "frame-system/std", - "orml-traits/std", "orml-asset-registry?/std", + "orml-traits/std", "parity-scale-codec/std", + 'scale-info/std', "serde?/std", "sp-arithmetic/std", "sp-runtime/std", diff --git a/zrml/prediction-markets/fuzz/Cargo.toml b/zrml/prediction-markets/fuzz/Cargo.toml index 53c2e7c64..f0813cf25 100644 --- a/zrml/prediction-markets/fuzz/Cargo.toml +++ b/zrml/prediction-markets/fuzz/Cargo.toml @@ -6,7 +6,7 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } libfuzzer-sys = "0.4" zeitgeist-primitives = { features = ["arbitrary", "mock"], default-features = false, path = "../../../primitives" } zrml-prediction-markets = { features = ["mock"], path = ".." } diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index 6174301a7..194f41697 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -1,6 +1,6 @@ [dependencies] parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } -sp-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } [features] diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 77512db98..356bd0b05 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -310,7 +310,7 @@ mod pallet { ) .into()) } else { - Ok((None, Pays::No).into()) + Ok((Option::::None, Pays::No).into()) } } @@ -427,7 +427,7 @@ mod pallet { ) -> DispatchResultWithPostInfo { // TODO(#787): Handle Rikiddo benchmarks! T::ApproveOrigin::ensure_origin(origin)?; - let mut extra_weight = 0; + let mut extra_weight = Weight::zero(); let mut status = MarketStatus::Active; >::mutate_market(&market_id, |m| { @@ -724,7 +724,7 @@ mod pallet { let market_id = >::push_market(market.clone())?; let market_account = >::market_account(market_id); - let mut extra_weight = 0; + let mut extra_weight = Weight::zero(); if market.status == MarketStatus::CollectingSubsidy { extra_weight = Self::start_subsidy(&market, market_id)?; @@ -1121,7 +1121,8 @@ mod pallet { return Ok(Some(T::WeightInfo::redeem_shares_scalar()).into()); } - Ok(None.into()) + let default_weight: Option = None; + Ok((default_weight, Pays::No).into()) } /// Rejects a market that is waiting for approval from the advisory committee. @@ -1747,7 +1748,7 @@ mod pallet { impl Hooks for Pallet { // TODO(#792): Remove outcome assets for accounts! Delete "resolved" assets of `orml_tokens` with storage migration. fn on_initialize(now: T::BlockNumber) -> Weight { - let mut total_weight: Weight = 0u64; + let mut total_weight: Weight = Weight::zero(); // TODO(#808): Use weight when Rikiddo is ready let _ = Self::process_subsidy_collecting_markets( @@ -2475,7 +2476,7 @@ mod pallet { Self::unreserve_creation_bond(market_id)?; } - let mut total_weight = 0; + let mut total_weight: Weight = Weight::zero(); let resolved_outcome = match market.status { MarketStatus::Reported => Self::resolve_reported_market(market_id, market)?, @@ -2508,7 +2509,7 @@ mod pallet { current_block: T::BlockNumber, current_time: MomentOf, ) -> Weight { - let mut total_weight = 0; + let mut total_weight: Weight = Weight::zero(); let dbweight = T::DbWeight::get(); let one_read = T::DbWeight::get().reads(1); let one_write = T::DbWeight::get().writes(1); @@ -2648,7 +2649,7 @@ mod pallet { true }; - let mut weight_basis = 0; + let mut weight_basis = Weight::zero(); >::mutate( |e: &mut BoundedVec< SubsidyUntil, MarketIdOf>, @@ -2935,7 +2936,10 @@ mod pallet { type MaxDisputes = T::MaxDisputes; type Moment = MomentOf; - fn resolve(market_id: &Self::MarketId, market: &MarketOf) -> Result { + fn resolve( + market_id: &Self::MarketId, + market: &MarketOf, + ) -> Result { Self::on_resolution(market_id, market) } diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index 496d959a4..385b5f0ff 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -91,18 +91,20 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - fn admin_destroy_disputed_market(a: u32, d: u32, o: u32, _c: u32, _r: u32) -> Weight { - (131_391_000 as Weight) - // Standard Error: 3_000 - .saturating_add((22_410_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 56_000 - .saturating_add((1_219_000 as Weight).saturating_mul(d as Weight)) - // Standard Error: 3_000 - .saturating_add((66_000 as Weight).saturating_mul(o as Weight)) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + fn admin_destroy_disputed_market(a: u32, d: u32, o: u32, _c: u32, r: u32) -> Weight { + Weight::from_ref_time(86_175_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(10_879_000).saturating_mul(a.into())) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(861_000).saturating_mul(d.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(6_000).saturating_mul(o.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(54_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(8)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) @@ -113,27 +115,33 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) - fn admin_destroy_reported_market(a: u32, _o: u32, _c: u32, _r: u32) -> Weight { - (148_923_000 as Weight) - // Standard Error: 4_000 - .saturating_add((22_300_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + fn admin_destroy_reported_market(a: u32, o: u32, c: u32, r: u32) -> Weight { + Weight::from_ref_time(87_265_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(10_869_000).saturating_mul(a.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(12_000).saturating_mul(o.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(21_000).saturating_mul(c.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(17_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(8)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn admin_move_market_to_closed(o: u32, c: u32) -> Weight { - (38_298_000 as Weight) + Weight::from_ref_time(23_683_000) // Standard Error: 0 - .saturating_add((21_000 as Weight).saturating_mul(o as Weight)) + .saturating_add(Weight::from_ref_time(14_000).saturating_mul(o.into())) // Standard Error: 0 - .saturating_add((7_000 as Weight).saturating_mul(c as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(20_000).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) @@ -141,11 +149,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight { - (72_815_000 as Weight) + Weight::from_ref_time(40_650_000) // Standard Error: 0 - .saturating_add((58_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(15_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) @@ -154,11 +162,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight { - (101_641_000 as Weight) - // Standard Error: 1_000 - .saturating_add((57_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(76_526_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(28_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) @@ -169,11 +177,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn admin_move_market_to_resolved_scalar_disputed(r: u32) -> Weight { - (119_331_000 as Weight) - // Standard Error: 1_000 - .saturating_add((23_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) + Weight::from_ref_time(56_260_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(22_000).saturating_mul(r.into())) + // Standard Error: 6_000 + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) @@ -185,39 +194,41 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_move_market_to_resolved_categorical_disputed(r: u32) -> Weight { - (148_478_000 as Weight) - // Standard Error: 1_000 - .saturating_add((35_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(10 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(93_329_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(7_000).saturating_mul(r.into())) + // Standard Error: 8_000 + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:0) // Storage: Balances Reserves (r:1 w:1) fn approve_market() -> Weight { - (46_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(26_968_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) fn request_edit(_r: u32) -> Weight { - (24_170_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(15_701_000) + // Standard Error: 0 + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: System Account (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn buy_complete_set(a: u32) -> Weight { - (52_875_000 as Weight) - // Standard Error: 4_000 - .saturating_add((17_255_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(34_178_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(8_264_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Timestamp Now (r:1 w:0) // Storage: Balances Reserves (r:1 w:1) @@ -225,22 +236,22 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons Markets (r:0 w:1) fn create_market(m: u32) -> Weight { - (46_289_000 as Weight) + Weight::from_ref_time(30_604_000) // Standard Error: 0 - .saturating_add((24_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + .saturating_add(Weight::from_ref_time(17_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn edit_market(m: u32) -> Weight { - (40_535_000 as Weight) + Weight::from_ref_time(26_200_000) // Standard Error: 0 - .saturating_add((30_000 as Weight).saturating_mul(m as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + .saturating_add(Weight::from_ref_time(27_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Swaps NextPoolId (r:1 w:1) @@ -252,15 +263,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_future_pool(a: u32, o: u32) -> Weight { - (91_979_000 as Weight) - // Standard Error: 6_000 - .saturating_add((26_628_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 6_000 - .saturating_add((2_000 as Weight).saturating_mul(o as Weight)) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(7 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(61_235_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(13_099_000).saturating_mul(a.into())) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(36_000).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Swaps NextPoolId (r:1 w:1) @@ -271,43 +282,40 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_open_pool(a: u32) -> Weight { - (94_216_000 as Weight) - // Standard Error: 4_000 - .saturating_add((26_749_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(60_792_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(13_322_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: PredictionMarkets Disputes (r:1 w:0) // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:7 w:7) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) - fn start_global_dispute(m: u32, n: u32) -> Weight { - (94_106_000 as Weight) - // Standard Error: 0 - .saturating_add((15_000 as Weight).saturating_mul(m as Weight)) - // Standard Error: 0 - .saturating_add((20_000 as Weight).saturating_mul(n as Weight)) - .saturating_add(T::DbWeight::get().reads(12 as Weight)) - .saturating_add(T::DbWeight::get().writes(10 as Weight)) + fn start_global_dispute(_m: u32, _n: u32) -> Weight { + Weight::from_ref_time(55_642_000) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) } // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) + // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn dispute_authorized() -> Weight { - (46_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(34_018_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn handle_expired_advised_market() -> Weight { - (49_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(25_833_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) @@ -315,9 +323,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn internal_resolve_categorical_reported() -> Weight { - (85_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) + Weight::from_ref_time(66_879_000) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) @@ -326,19 +334,24 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) + // Storage: MarketCommons Markets (r:1 w:1) + // Storage: GlobalDisputes Winners (r:1 w:0) + // Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) + // Storage: System Account (r:1 w:1) fn internal_resolve_categorical_disputed() -> Weight { - (118_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(72_294_000) + // Standard Error: 27_000 + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn internal_resolve_scalar_reported() -> Weight { - (56_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(30_320_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) @@ -346,11 +359,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: System Account (r:1 w:1) - // Storage: MarketCommons MarketPool (r:1 w:0) fn internal_resolve_scalar_disputed() -> Weight { - (100_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(7 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(36_011_000) + // Standard Error: 27_000 + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) @@ -362,35 +375,35 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn on_initialize_resolve_overhead() -> Weight { - (30_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(8 as Weight)) + Weight::from_ref_time(13_886_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(8)) } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_raw(a: u32) -> Weight { - (3_580_000 as Weight) - // Standard Error: 1_000 - .saturating_add((172_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(3_180_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(95_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Tokens Accounts (r:1 w:1) // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn redeem_shares_categorical() -> Weight { - (73_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(54_667_000) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn redeem_shares_scalar() -> Weight { - (95_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(57_736_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) @@ -398,36 +411,37 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn reject_market(c: u32, o: u32, r: u32) -> Weight { - (78_886_000 as Weight) + Weight::from_ref_time(38_253_000) // Standard Error: 0 - .saturating_add((16_000 as Weight).saturating_mul(c as Weight)) + .saturating_add(Weight::from_ref_time(18_000).saturating_mul(c.into())) // Standard Error: 0 - .saturating_add((21_000 as Weight).saturating_mul(o as Weight)) + .saturating_add(Weight::from_ref_time(13_000).saturating_mul(o.into())) // Standard Error: 0 - .saturating_add((2_000 as Weight).saturating_mul(r as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) fn report(_m: u32) -> Weight { - (31_024_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(22_398_000) + // Standard Error: 0 + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: System Account (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn sell_complete_set(a: u32) -> Weight { - (40_368_000 as Weight) - // Standard Error: 4_000 - .saturating_add((21_523_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(35_149_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(10_429_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Swaps NextPoolId (r:1 w:1) // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) @@ -436,44 +450,44 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn start_subsidy(a: u32) -> Weight { - (33_451_000 as Weight) + Weight::from_ref_time(22_465_000) // Standard Error: 0 - .saturating_add((52_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + .saturating_add(Weight::from_ref_time(42_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: PredictionMarkets MarketIdsPerOpenBlock (r:1 w:1) // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) fn market_status_manager(b: u32, f: u32) -> Weight { - (15_414_000 as Weight) - // Standard Error: 2_000 - .saturating_add((4_284_000 as Weight).saturating_mul(b as Weight)) - // Standard Error: 2_000 - .saturating_add((4_380_000 as Weight).saturating_mul(f as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(f as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(25_231_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_413_000).saturating_mul(b.into())) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_399_000).saturating_mul(f.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn market_resolution_manager(r: u32, d: u32) -> Weight { - (17_183_000 as Weight) - // Standard Error: 2_000 - .saturating_add((4_209_000 as Weight).saturating_mul(r as Weight)) - // Standard Error: 2_000 - .saturating_add((4_285_000 as Weight).saturating_mul(d as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(r as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(d as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) + Weight::from_ref_time(24_246_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_414_000).saturating_mul(r.into())) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_445_000).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_dummy() -> Weight { - (3_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(3_049_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index 3accf67b9..3946c36d8 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -1,16 +1,16 @@ [dependencies] arbitrary = { version = "1.0.1", features = ["derive"], optional = true } cfg-if = { version = "1.0.0", default-features = false } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } hashbrown = { default-features = true, version = "0.11" } -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-core = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } diff --git a/zrml/rikiddo/fuzz/Cargo.toml b/zrml/rikiddo/fuzz/Cargo.toml index 7abae1f10..a01f8a121 100644 --- a/zrml/rikiddo/fuzz/Cargo.toml +++ b/zrml/rikiddo/fuzz/Cargo.toml @@ -72,8 +72,8 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } libfuzzer-sys = "0.4" substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" } zrml-rikiddo = { features = ["arbitrary", "mock"], path = ".." } diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index 2d158eef3..d6b6ede2b 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -1,17 +1,17 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index 00ec22b94..a127cf5a8 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -75,7 +75,7 @@ impl DisputeResolutionApi for NoopResolution { Asset, >, ) -> Result { - Ok(0) + Ok(Weight::zero()) } fn add_auto_resolve( diff --git a/zrml/styx/Cargo.toml b/zrml/styx/Cargo.toml index 0b3c2831f..ee233d4ff 100644 --- a/zrml/styx/Cargo.toml +++ b/zrml/styx/Cargo.toml @@ -1,16 +1,16 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } [dev-dependencies] -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate" } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/styx/src/weights.rs b/zrml/styx/src/weights.rs index 8112bbfa2..851a186ab 100644 --- a/zrml/styx/src/weights.rs +++ b/zrml/styx/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_styx //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -55,12 +55,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Styx Crossings (r:1 w:1) // Storage: Styx BurnAmount (r:1 w:0) fn cross() -> Weight { - (54_390_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(22_513_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Styx BurnAmount (r:0 w:1) fn set_burn_amount() -> Weight { - (22_050_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(8_613_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index f1c9bc216..051aca111 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -1,11 +1,11 @@ [dependencies] -frame-benchmarking = { branch = "polkadot-v0.9.26", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -frame-system = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-liquidity-mining = { default-features = false, path = "../liquidity-mining" } @@ -14,12 +14,12 @@ zrml-rikiddo = { default-features = false, path = "../rikiddo" } # Mock -orml-currencies = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -orml-tokens = { branch = "polkadot-v0.9.26", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } -pallet-balances = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -pallet-timestamp = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sp-api = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } -sp-io = { branch = "polkadot-v0.9.26", git = "https://github.com/paritytech/substrate", optional = true } +orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } +pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } zrml-swaps-runtime-api = { optional = true, path = "./runtime-api" } [dev-dependencies] diff --git a/zrml/swaps/fuzz/Cargo.toml b/zrml/swaps/fuzz/Cargo.toml index 0351975f0..430efcd92 100644 --- a/zrml/swaps/fuzz/Cargo.toml +++ b/zrml/swaps/fuzz/Cargo.toml @@ -54,11 +54,11 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-support = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } libfuzzer-sys = "0.4" -orml-traits = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } rand = "0.8.4" -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { features = ["mock"], path = "../../../primitives" } zrml-swaps = { features = ["mock"], path = ".." } diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index b9a9fe29d..640a11a10 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -1,9 +1,9 @@ [dependencies] -jsonrpsee = { version = "0.14.0", features = ["server", "macros"] } +jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } parity-scale-codec = { default-features = false, version = "3.0.0" } -sp-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-blockchain = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-blockchain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } zrml-swaps-runtime-api = { default-features = false, features = ["std"], path = "../runtime-api" } diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index 9220c4535..78023b6cf 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -1,7 +1,7 @@ [dependencies] parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } -sp-api = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } -sp-runtime = { branch = "polkadot-v0.9.26", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } [features] diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index f955c8a64..7698325d5 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -319,7 +319,7 @@ benchmarks! { let pool_id: PoolId = i.into(); PoolsCachedForArbitrage::::insert(pool_id, ()); } - let noop = |_: PoolId| -> Result { Ok(0) }; + let noop = |_: PoolId| -> Result { Ok(Weight::zero()) }; }: { Pallet::::apply_to_cached_pools(a, noop, Weight::MAX) } diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index 9164b2abd..2b14990c7 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -112,7 +112,7 @@ mod pallet { pub(crate) const ARBITRAGE_MAX_ITERATIONS: usize = 30; const ARBITRAGE_THRESHOLD: u128 = CENT; const MIN_BALANCE: u128 = CENT; - const ON_IDLE_MIN_WEIGHT: Weight = 1_000_000; + const ON_IDLE_MIN_WEIGHT: Weight = Weight::from_ref_time(1_000_000); #[pallet::call] impl Pallet { @@ -1098,7 +1098,7 @@ mod pallet { impl Hooks for Pallet { fn on_idle(_: T::BlockNumber, remaining_weight: Weight) -> Weight { if remaining_weight < ON_IDLE_MIN_WEIGHT { - return 0; + return Weight::zero(); } Self::execute_arbitrage_all(remaining_weight / 2) } @@ -1114,7 +1114,7 @@ mod pallet { ) -> Weight { // CPMM handling of market profit not supported if pool.scoring_rule == ScoringRule::CPMM { - return 1_000_000; + return Weight::from_ref_time(1_000_000); } // Total pool shares @@ -1249,19 +1249,19 @@ mod pallet { // The division can fail if the benchmark of `apply_to_cached_pools` is not linear in // the number of pools. This shouldn't ever happen, but if it does, we ensure that // `pool_count` is zero (this isn't really a runtime error). - let pool_count: u32 = weight - .saturating_sub(overhead) - .checked_div(extra_weight_per_pool) + let pool_count = weight + .ref_time() + .saturating_sub(overhead.ref_time()) + .checked_div(extra_weight_per_pool.ref_time()) .unwrap_or_else(|| { log::warn!("Unexpected zero division when calculating arbitrage weight"); - Weight::zero() - }) - .saturated_into(); // Saturates only if we have u32::MAX trades per block. - if pool_count == 0 { + 0_u64 + }); + if pool_count == 0_u64 { return weight; } Self::apply_to_cached_pools( - pool_count, + pool_count.saturated_into(), |pool_id| Self::execute_arbitrage(pool_id, ARBITRAGE_MAX_ITERATIONS), extra_weight_per_pool, ) @@ -1616,7 +1616,7 @@ mod pallet { outcome_report: &OutcomeReport, winner_payout_account: &T::AccountId, ) -> Result { - let mut extra_weight = 0; + let mut extra_weight = Weight::zero(); let mut total_assets = 0; Self::mutate_pool(pool_id, |pool| { @@ -2211,7 +2211,7 @@ mod pallet { outcome_report: &OutcomeReport, winner_payout_account: &T::AccountId, ) -> Result { - let mut weight = 0; + let mut weight = Weight::zero(); Self::mutate_pool(pool_id, |pool| { ensure!(pool.pool_status == PoolStatus::Closed, Error::::InvalidStateTransition); pool.pool_status = PoolStatus::Clean; diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index dc7ba46e1..f6976cd3b 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -3121,7 +3121,7 @@ fn on_idle_skips_arbitrage_if_price_does_not_exceed_threshold() { let pool_id = 0; // Force the pool into the cache. crate::PoolsCachedForArbitrage::::insert(pool_id, ()); - Swaps::on_idle(System::block_number(), Weight::max_value()); + Swaps::on_idle(System::block_number(), Weight::MAX); System::assert_has_event(Event::ArbitrageSkipped(pool_id).into()); }); } @@ -3156,7 +3156,7 @@ fn on_idle_arbitrages_pools_with_mint_sell() { // Force arbitrage hook. crate::PoolsCachedForArbitrage::::insert(pool_id, ()); - Swaps::on_idle(System::block_number(), Weight::max_value()); + Swaps::on_idle(System::block_number(), Weight::MAX); let arbitrage_amount = 49_537_658_690; assert_eq!( @@ -3216,7 +3216,7 @@ fn on_idle_arbitrages_pools_with_buy_burn() { // Force arbitrage hook. crate::PoolsCachedForArbitrage::::insert(pool_id, ()); - Swaps::on_idle(System::block_number(), Weight::max_value()); + Swaps::on_idle(System::block_number(), Weight::MAX); assert_eq!( Currencies::free_balance(base_asset, &pool_account_id), @@ -3241,8 +3241,8 @@ fn apply_to_cached_pools_only_drains_requested_pools() { let number_of_pools_to_retain: u32 = 3; Swaps::apply_to_cached_pools( pool_count.saturated_into::() - number_of_pools_to_retain, - |_| Ok(0), - Weight::max_value(), + |_| Ok(Weight::zero()), + Weight::MAX, ); assert_eq!( PoolsCachedForArbitrage::::iter().count(), diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index e12685039..df697b258 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_swaps //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-25, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -80,70 +80,70 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_categorical(a: u32) -> Weight { - (57_698_000 as Weight) - // Standard Error: 2_000 - .saturating_add((1_027_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(25_333_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(294_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_scalar() -> Weight { - (52_361_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(22_333_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: Swaps PoolsCachedForArbitrage (r:7 w:6) - // Storage: Swaps Pools (r:6 w:0) - // Storage: Tokens Accounts (r:396 w:396) - // Storage: System Account (r:6 w:0) + // Storage: Swaps PoolsCachedForArbitrage (r:8 w:7) + // Storage: Swaps Pools (r:7 w:0) + // Storage: Tokens Accounts (r:462 w:462) + // Storage: System Account (r:7 w:0) // Storage: Tokens TotalIssuance (r:64 w:64) fn apply_to_cached_pools_execute_arbitrage(a: u32) -> Weight { - (0 as Weight) - // Standard Error: 905_000 - .saturating_add((3_336_767_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(44 as Weight)) - .saturating_add(T::DbWeight::get().reads((69 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(44 as Weight)) - .saturating_add(T::DbWeight::get().writes((67 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(0) + // Standard Error: 105_000 + .saturating_add(Weight::from_ref_time(933_426_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(43)) + .saturating_add(T::DbWeight::get().reads((70_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(42)) + .saturating_add(T::DbWeight::get().writes((67_u64).saturating_mul(a.into()))) } - // Storage: Swaps PoolsCachedForArbitrage (r:7 w:6) + // Storage: Swaps PoolsCachedForArbitrage (r:8 w:7) fn apply_to_cached_pools_noop(a: u32) -> Weight { - (0 as Weight) - // Standard Error: 7_000 - .saturating_add((10_520_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(0) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(3_438_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:1) // Storage: Swaps SubsidyProviders (r:1 w:0) // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn destroy_pool_in_subsidy_phase(a: u32) -> Weight { - (44_428_000 as Weight) - // Standard Error: 17_000 - .saturating_add((25_843_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(20_186_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(9_439_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Tokens TotalIssuance (r:2 w:1) // Storage: Tokens Accounts (r:46 w:22) // Storage: System Account (r:2 w:1) fn distribute_pool_share_rewards(a: u32, b: u32) -> Weight { - (29_974_000 as Weight) - // Standard Error: 77_000 - .saturating_add((43_084_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 77_000 - .saturating_add((50_328_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads(8 as Weight)) - .saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(b as Weight))) + Weight::from_ref_time(25_316_000) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(10_887_000).saturating_mul(a.into())) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(16_348_000).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(b.into()))) } // Storage: Swaps Pools (r:1 w:1) // Storage: Swaps SubsidyProviders (r:11 w:10) @@ -152,70 +152,70 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:0) fn end_subsidy_phase(a: u32, b: u32) -> Weight { - (0 as Weight) - // Standard Error: 194_000 - .saturating_add((36_944_000 as Weight).saturating_mul(a as Weight)) - // Standard Error: 1_231_000 - .saturating_add((175_983_000 as Weight).saturating_mul(b as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().reads((9 as Weight).saturating_mul(b as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes((9 as Weight).saturating_mul(b as Weight))) + Weight::from_ref_time(0) + // Standard Error: 68_000 + .saturating_add(Weight::from_ref_time(10_591_000).saturating_mul(a.into())) + // Standard Error: 418_000 + .saturating_add(Weight::from_ref_time(50_291_000).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().reads((9_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes((9_u64).saturating_mul(b.into()))) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:3 w:3) // Storage: System Account (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_buy_burn(a: u32) -> Weight { - (0 as Weight) - // Standard Error: 18_000 - .saturating_add((52_561_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(31_946_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(15_353_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:3 w:3) // Storage: System Account (r:2 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_mint_sell(a: u32) -> Weight { - (19_956_000 as Weight) - // Standard Error: 16_000 - .saturating_add((48_596_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(35_968_000) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(14_347_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:2 w:0) fn execute_arbitrage_skipped(a: u32) -> Weight { - (16_944_000 as Weight) - // Standard Error: 3_000 - .saturating_add((9_053_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(14_082_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_260_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:5 w:5) // Storage: System Account (r:1 w:0) fn pool_exit(a: u32) -> Weight { - (47_671_000 as Weight) - // Standard Error: 17_000 - .saturating_add((39_937_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(36_569_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(11_401_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:1) // Storage: Swaps SubsidyProviders (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn pool_exit_subsidy() -> Weight { - (86_760_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(37_487_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:3 w:3) @@ -223,9 +223,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_asset_amount() -> Weight { - (184_191_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(69_403_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) @@ -233,64 +233,64 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_pool_amount() -> Weight { - (184_751_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(69_695_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:5 w:5) fn pool_join(a: u32) -> Weight { - (42_632_000 as Weight) - // Standard Error: 14_000 - .saturating_add((36_906_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(32_481_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(10_527_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) // Storage: Swaps SubsidyProviders (r:1 w:1) fn pool_join_subsidy() -> Weight { - (88_700_000 as Weight) - .saturating_add(T::DbWeight::get().reads(3 as Weight)) - .saturating_add(T::DbWeight::get().writes(3 as Weight)) + Weight::from_ref_time(37_677_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_asset_amount() -> Weight { - (165_460_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(62_027_000) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_pool_amount() -> Weight { - (162_000_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(62_390_000) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn clean_up_pool_categorical_without_reward_distribution(a: u32) -> Weight { - (11_083_000 as Weight) - // Standard Error: 1_000 - .saturating_add((581_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(5_716_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(182_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:4 w:4) // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_in_cpmm() -> Weight { - (223_361_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(81_560_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:3 w:3) @@ -299,21 +299,21 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_in_rikiddo(a: u32) -> Weight { - (140_111_000 as Weight) - // Standard Error: 10_000 - .saturating_add((25_517_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(68_347_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(7_471_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:4 w:4) // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_out_cpmm() -> Weight { - (217_140_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(81_909_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:4 w:3) @@ -321,39 +321,39 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_out_rikiddo(a: u32) -> Weight { - (73_337_000 as Weight) - // Standard Error: 10_000 - .saturating_add((45_756_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(5 as Weight)) + Weight::from_ref_time(51_173_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(13_039_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn open_pool(a: u32) -> Weight { - (26_996_000 as Weight) - // Standard Error: 1_000 - .saturating_add((880_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(12_594_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(261_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:1) fn close_pool(a: u32) -> Weight { - (25_651_000 as Weight) - // Standard Error: 1_000 - .saturating_add((650_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) + Weight::from_ref_time(11_446_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(210_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn destroy_pool(a: u32) -> Weight { - (0 as Weight) - // Standard Error: 14_000 - .saturating_add((33_316_000 as Weight).saturating_mul(a as Weight)) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(a as Weight))) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(a as Weight))) + Weight::from_ref_time(15_607_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(10_020_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } } From 1247ddd361392d14243a8e2d4ef3428e83adc836 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 20 Jan 2023 16:10:06 +0100 Subject: [PATCH 08/53] Respect all asset's existential deposit (#930) * Respect all asset's existential deposit * Use 1 instead of 0 when no ED is desired * Set ED of all asset to the ED of ZTG * Add dust removal whitelist tests * Order runtime tests and always use real Runtime * Use more concise code Co-authored-by: Malte Kliemann Co-authored-by: Malte Kliemann --- Cargo.lock | 2 + runtime/battery-station/Cargo.toml | 1 + runtime/battery-station/src/parameters.rs | 26 ++++- runtime/common/src/lib.rs | 123 +++++++++------------- runtime/zeitgeist/Cargo.toml | 1 + runtime/zeitgeist/src/parameters.rs | 26 ++++- 6 files changed, 100 insertions(+), 79 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dfd95203a..e0e78e4f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -510,6 +510,7 @@ dependencies = [ "sp-version", "substrate-fixed", "substrate-wasm-builder", + "test-case", "xcm", "xcm-builder", "xcm-emulator", @@ -12822,6 +12823,7 @@ dependencies = [ "sp-version", "substrate-fixed", "substrate-wasm-builder", + "test-case", "xcm", "xcm-builder", "xcm-emulator", diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 9c3153d0e..37b68619a 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -119,6 +119,7 @@ zrml-swaps-runtime-api = { default-features = false, path = "../../zrml/swaps/ru [dev-dependencies] sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +test-case = "2.0.2" xcm-emulator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/xcm-simulator" } [features] diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 2e8547296..ed2ba1aa5 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -372,11 +372,33 @@ parameter_types! { } parameter_type_with_key! { - // Well, not every asset is a currency ¯\_(ツ)_/¯ + // Existential deposits used by orml-tokens. + // Only native ZTG and foreign assets should have an existential deposit. + // Winning outcome tokens are redeemed completely by the user, losing outcome tokens + // are cleaned up automatically. In case of scalar outcomes, the market account can have dust. + // Unless LPs use `pool_exit_with_exact_asset_amount`, there can be some dust pool shares remaining. + // Explicit match arms are used to ensure new asset types are respected. pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { + Asset::CategoricalOutcome(_,_) => ExistentialDeposit::get(), + Asset::CombinatorialOutcome => ExistentialDeposit::get(), + Asset::PoolShare(_) => ExistentialDeposit::get(), + Asset::ScalarOutcome(_,_) => ExistentialDeposit::get(), + #[cfg(feature = "parachain")] + Asset::ForeignAsset(id) => { + let maybe_metadata = < + orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect + >::metadata(&Asset::ForeignAsset(*id)); + + if let Some(metadata) = maybe_metadata { + return metadata.existential_deposit; + } + + 1 + } + #[cfg(not(feature = "parachain"))] + Asset::ForeignAsset(_) => ExistentialDeposit::get(), Asset::Ztg => ExistentialDeposit::get(), - _ => 0 } }; } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 8d53dde59..15e4efdb1 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -1828,67 +1828,11 @@ macro_rules! create_common_tests { {} => { #[cfg(test)] mod common_tests { - mod fee_multiplier { - use crate::parameters::{MinimumMultiplier, SlowAdjustingFeeUpdate, TargetBlockFullness}; - use frame_support::{ - parameter_types, - weights::{DispatchClass, Weight}, - }; + mod fees { + use crate::*; + use frame_support::weights::{DispatchClass, Weight}; use sp_core::H256; - use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, Convert, IdentityLookup}, - Perbill, - }; - - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; - type Block = frame_system::mocking::MockBlock; - - frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event} - } - ); - - parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const AvailableBlockRatio: Perbill = Perbill::one(); - pub BlockLength: frame_system::limits::BlockLength = - frame_system::limits::BlockLength::max(2 * 1024); - pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1024)); - } - - impl frame_system::Config for Runtime { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = BlockWeights; - type BlockLength = (); - type DbWeight = (); - type Origin = Origin; - type Index = u64; - type BlockNumber = u64; - type Call = Call; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = (); - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; - } + use sp_runtime::traits::Convert; fn run_with_system_weight(w: Weight, mut assertions: F) where @@ -1903,10 +1847,28 @@ macro_rules! create_common_tests { } #[test] - fn multiplier_can_grow_from_zero() { + fn treasury_receives_correct_amount_of_fees_and_tips() { + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + t.execute_with(|| { + let fee_balance = 3 * ExistentialDeposit::get(); + let fee_imbalance = Balances::issue(fee_balance); + let tip_balance = 7 * ExistentialDeposit::get(); + let tip_imbalance = Balances::issue(tip_balance); + assert_eq!(Balances::free_balance(Treasury::account_id()), 0); + DealWithFees::on_unbalanceds(vec![fee_imbalance, tip_imbalance].into_iter()); + assert_eq!( + Balances::free_balance(Treasury::account_id()), + fee_balance + tip_balance, + ); + }); + } + + #[test] + fn fee_multiplier_can_grow_from_zero() { let minimum_multiplier = MinimumMultiplier::get(); let target = TargetBlockFullness::get() - * BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap(); + * RuntimeBlockWeights::get().get(DispatchClass::Normal).max_total.unwrap(); // if the min is too small, then this will not change, and we are doomed forever. // the weight is 1/100th bigger than target. run_with_system_weight(target * 101 / 100, || { @@ -1916,28 +1878,39 @@ macro_rules! create_common_tests { } } - mod deal_with_fees { + mod dust_removal { use crate::*; + use frame_support::PalletId; + use test_case::test_case; + + #[test_case(AuthorizedPalletId::get(); "authorized")] + #[test_case(CourtPalletId::get(); "court")] + #[test_case(LiquidityMiningPalletId::get(); "liquidity_mining")] + #[test_case(PmPalletId::get(); "prediction_markets")] + #[test_case(SimpleDisputesPalletId::get(); "simple_disputes")] + #[test_case(SwapsPalletId::get(); "swaps")] + #[test_case(TreasuryPalletId::get(); "treasury")] + fn whitelisted_pallet_accounts_dont_get_reaped(pallet_id: PalletId) { + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + t.execute_with(|| { + let pallet_main_account: AccountId = pallet_id.into_account_truncating(); + let pallet_sub_account: AccountId = pallet_id.into_sub_account_truncating(42); + assert!(DustRemovalWhitelist::contains(&pallet_main_account)); + assert!(DustRemovalWhitelist::contains(&pallet_sub_account)); + }); + } #[test] - fn treasury_receives_correct_amount_of_fees_and_tips() { + fn non_whitelisted_accounts_get_reaped() { let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default().build_storage::().unwrap().into(); t.execute_with(|| { - let fee_balance = 3 * ExistentialDeposit::get(); - let fee_imbalance = Balances::issue(fee_balance); - let tip_balance = 7 * ExistentialDeposit::get(); - let tip_imbalance = Balances::issue(tip_balance); - assert_eq!(Balances::free_balance(Treasury::account_id()), 0); - DealWithFees::on_unbalanceds(vec![fee_imbalance, tip_imbalance].into_iter()); - assert_eq!( - Balances::free_balance(Treasury::account_id()), - fee_balance + tip_balance, - ); + let not_whitelisted = AccountId::from([0u8; 32]); + assert!(!DustRemovalWhitelist::contains(¬_whitelisted)) }); } } } - } } diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index 08e48ffea..5ae8d91e0 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -117,6 +117,7 @@ zrml-swaps-runtime-api = { default-features = false, path = "../../zrml/swaps/ru [dev-dependencies] sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +test-case = "2.0.2" xcm-emulator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/xcm-simulator" } [features] diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 636105ecc..32745542d 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -372,11 +372,33 @@ parameter_types! { } parameter_type_with_key! { - // Well, not every asset is a currency ¯\_(ツ)_/¯ + // Existential deposits used by orml-tokens. + // Only native ZTG and foreign assets should have an existential deposit. + // Winning outcome tokens are redeemed completely by the user, losing outcome tokens + // are cleaned up automatically. In case of scalar outcomes, the market account can have dust. + // Unless LPs use `pool_exit_with_exact_asset_amount`, there can be some dust pool shares remaining. + // Explicit match arms are used to ensure new asset types are respected. pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { + Asset::CategoricalOutcome(_,_) => ExistentialDeposit::get(), + Asset::CombinatorialOutcome => ExistentialDeposit::get(), + Asset::PoolShare(_) => ExistentialDeposit::get(), + Asset::ScalarOutcome(_,_) => ExistentialDeposit::get(), + #[cfg(feature = "parachain")] + Asset::ForeignAsset(id) => { + let maybe_metadata = < + orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect + >::metadata(&Asset::ForeignAsset(*id)); + + if let Some(metadata) = maybe_metadata { + return metadata.existential_deposit; + } + + 1 + } + #[cfg(not(feature = "parachain"))] + Asset::ForeignAsset(_) => ExistentialDeposit::get(), Asset::Ztg => ExistentialDeposit::get(), - _ => 0 } }; } From 257ad652b225c4566bfe722a36dfaf0ceb98b2de Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 23 Jan 2023 12:22:51 +0100 Subject: [PATCH 09/53] Update weights (#953) --- .../src/weights/cumulus_pallet_xcmp_queue.rs | 6 +- runtime/common/src/weights/frame_system.rs | 28 +- runtime/common/src/weights/orml_currencies.rs | 12 +- runtime/common/src/weights/orml_tokens.rs | 12 +- .../src/weights/pallet_author_inherent.rs | 10 +- .../src/weights/pallet_author_mapping.rs | 12 +- .../src/weights/pallet_author_slot_filter.rs | 4 +- runtime/common/src/weights/pallet_balances.rs | 22 +- runtime/common/src/weights/pallet_bounties.rs | 32 +-- .../common/src/weights/pallet_collective.rs | 90 ++++--- .../common/src/weights/pallet_democracy.rs | 126 ++++----- runtime/common/src/weights/pallet_identity.rs | 130 +++++---- .../common/src/weights/pallet_membership.rs | 45 ++-- runtime/common/src/weights/pallet_multisig.rs | 70 ++--- .../src/weights/pallet_parachain_staking.rs | 120 ++++----- runtime/common/src/weights/pallet_preimage.rs | 26 +- runtime/common/src/weights/pallet_proxy.rs | 74 +++--- .../common/src/weights/pallet_scheduler.rs | 86 +++--- .../common/src/weights/pallet_timestamp.rs | 9 +- runtime/common/src/weights/pallet_treasury.rs | 22 +- runtime/common/src/weights/pallet_utility.rs | 24 +- runtime/common/src/weights/pallet_vesting.rs | 84 +++--- zrml/authorized/src/weights.rs | 23 +- zrml/court/src/weights.rs | 8 +- zrml/global-disputes/src/weights.rs | 61 +++-- zrml/liquidity-mining/src/weights.rs | 4 +- zrml/prediction-markets/src/weights.rs | 250 +++++++++--------- zrml/styx/src/weights.rs | 6 +- zrml/swaps/src/weights.rs | 141 +++++----- 29 files changed, 757 insertions(+), 780 deletions(-) diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index 5af541910..e0a20dbcd 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,13 +50,13 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::weights::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - Weight::from_ref_time(4_785_000) + Weight::from_ref_time(13_891_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - Weight::from_ref_time(4_691_000) + Weight::from_ref_time(13_630_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index d8558bb8c..0fce968ea 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -48,40 +48,42 @@ use frame_support::{ /// Weight functions for frame_system (automatically generated) pub struct WeightInfo(PhantomData); impl frame_system::weights::WeightInfo for WeightInfo { - fn remark(_b: u32) -> Weight { - Weight::from_ref_time(6_388_000) + fn remark(b: u32) -> Weight { + Weight::from_ref_time(0) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) } fn remark_with_event(b: u32) -> Weight { Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + .saturating_add(Weight::from_ref_time(2_000).saturating_mul(b.into())) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - Weight::from_ref_time(5_605_000) + Weight::from_ref_time(15_370_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Skipped Metadata (r:0 w:0) fn set_storage(i: u32) -> Weight { - Weight::from_ref_time(417_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(411_000).saturating_mul(i.into())) + Weight::from_ref_time(8_585_000) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(1_059_000).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_storage(i: u32) -> Weight { Weight::from_ref_time(0) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(369_000).saturating_mul(i.into())) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(1_075_000).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_prefix(p: u32) -> Weight { - Weight::from_ref_time(3_542_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(792_000).saturating_mul(p.into())) + Weight::from_ref_time(4_159_000) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(2_234_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } } diff --git a/runtime/common/src/weights/orml_currencies.rs b/runtime/common/src/weights/orml_currencies.rs index dfcaa524a..c628d5402 100644 --- a/runtime/common/src/weights/orml_currencies.rs +++ b/runtime/common/src/weights/orml_currencies.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for orml_currencies //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -48,13 +48,13 @@ impl orml_currencies::WeightInfo for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_non_native_currency() -> Weight { - Weight::from_ref_time(28_582_000) + Weight::from_ref_time(76_920_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn transfer_native_currency() -> Weight { - Weight::from_ref_time(26_474_000) + Weight::from_ref_time(56_290_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -62,19 +62,19 @@ impl orml_currencies::WeightInfo for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn update_balance_non_native_currency() -> Weight { - Weight::from_ref_time(21_690_000) + Weight::from_ref_time(53_350_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn update_balance_native_currency_creating() -> Weight { - Weight::from_ref_time(21_531_000) + Weight::from_ref_time(52_710_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn update_balance_native_currency_killing() -> Weight { - Weight::from_ref_time(19_409_000) + Weight::from_ref_time(48_730_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/orml_tokens.rs b/runtime/common/src/weights/orml_tokens.rs index 81b1bcb2c..dc982cd42 100644 --- a/runtime/common/src/weights/orml_tokens.rs +++ b/runtime/common/src/weights/orml_tokens.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -48,28 +48,28 @@ impl orml_tokens::WeightInfo for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(28_003_000) + Weight::from_ref_time(76_440_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(30_502_000) + Weight::from_ref_time(78_740_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(25_994_000) + Weight::from_ref_time(61_710_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:2 w:1) fn force_transfer() -> Weight { - Weight::from_ref_time(29_043_000) + Weight::from_ref_time(68_460_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -77,7 +77,7 @@ impl orml_tokens::WeightInfo for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn set_balance() -> Weight { - Weight::from_ref_time(21_069_000) + Weight::from_ref_time(51_830_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_inherent.rs b/runtime/common/src/weights/pallet_author_inherent.rs index d42c1cd4b..e1689a0a6 100644 --- a/runtime/common/src/weights/pallet_author_inherent.rs +++ b/runtime/common/src/weights/pallet_author_inherent.rs @@ -18,16 +18,16 @@ //! Autogenerated weights for pallet_author_inherent //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-05, STEPS: `10`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/release/zeitgeist +// ./target/production/zeitgeist // benchmark // pallet // --chain=dev -// --steps=10 -// --repeat=10 +// --steps=50 +// --repeat=20 // --pallet=pallet_author_inherent // --extrinsic=* // --execution=wasm @@ -55,7 +55,7 @@ impl pallet_author_inherent::weights::WeightInfo for We // Storage: AuthorFilter EligibleCount (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn kick_off_authorship_validation() -> Weight { - Weight::from_ref_time(28_113_000) + Weight::from_ref_time(47_670_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_author_mapping.rs b/runtime/common/src/weights/pallet_author_mapping.rs index b3a3f76ec..9dc310e71 100644 --- a/runtime/common/src/weights/pallet_author_mapping.rs +++ b/runtime/common/src/weights/pallet_author_mapping.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_author_mapping //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,14 +52,14 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn add_association() -> Weight { - Weight::from_ref_time(22_310_000) + Weight::from_ref_time(59_320_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn update_association() -> Weight { - Weight::from_ref_time(18_658_000) + Weight::from_ref_time(42_141_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -67,7 +67,7 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn clear_association() -> Weight { - Weight::from_ref_time(25_042_000) + Weight::from_ref_time(54_180_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -75,14 +75,14 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: AuthorMapping MappingWithDeposit (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_keys() -> Weight { - Weight::from_ref_time(27_303_000) + Weight::from_ref_time(66_530_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping NimbusLookup (r:1 w:1) // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) fn set_keys() -> Weight { - Weight::from_ref_time(21_261_000) + Weight::from_ref_time(52_730_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_slot_filter.rs b/runtime/common/src/weights/pallet_author_slot_filter.rs index 43c1640b8..9ee05ed69 100644 --- a/runtime/common/src/weights/pallet_author_slot_filter.rs +++ b/runtime/common/src/weights/pallet_author_slot_filter.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_author_slot_filter //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,6 +50,6 @@ pub struct WeightInfo(PhantomData); impl pallet_author_slot_filter::weights::WeightInfo for WeightInfo { // Storage: AuthorFilter EligibleCount (r:0 w:1) fn set_eligible() -> Weight { - Weight::from_ref_time(9_138_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(24_640_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 206995a80..0ed3df5a3 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -18,16 +18,16 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-05, STEPS: `2`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/release/zeitgeist +// ./target/production/zeitgeist // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=pallet_balances // --extrinsic=* // --execution=wasm @@ -50,43 +50,43 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::weights::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(64_342_000) + Weight::from_ref_time(75_550_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(48_802_000) + Weight::from_ref_time(61_350_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - Weight::from_ref_time(35_618_000) + Weight::from_ref_time(44_461_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - Weight::from_ref_time(38_954_000) + Weight::from_ref_time(47_560_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - Weight::from_ref_time(61_868_000) + Weight::from_ref_time(74_281_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(55_986_000) + Weight::from_ref_time(65_200_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - Weight::from_ref_time(31_510_000) + Weight::from_ref_time(37_050_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_bounties.rs b/runtime/common/src/weights/pallet_bounties.rs index a8395f4f9..6d3e90d50 100644 --- a/runtime/common/src/weights/pallet_bounties.rs +++ b/runtime/common/src/weights/pallet_bounties.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,41 +51,43 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: Bounties BountyCount (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) // Storage: Bounties Bounties (r:0 w:1) - fn propose_bounty(_d: u32) -> Weight { - Weight::from_ref_time(21_955_000) + fn propose_bounty(d: u32) -> Weight { + Weight::from_ref_time(54_421_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) fn approve_bounty() -> Weight { - Weight::from_ref_time(8_866_000) + Weight::from_ref_time(28_180_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn propose_curator() -> Weight { - Weight::from_ref_time(8_785_000) + Weight::from_ref_time(23_090_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - Weight::from_ref_time(25_616_000) + Weight::from_ref_time(61_871_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - Weight::from_ref_time(20_880_000) + Weight::from_ref_time(51_330_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn award_bounty() -> Weight { - Weight::from_ref_time(16_661_000) + Weight::from_ref_time(47_600_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -93,14 +95,14 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn claim_bounty() -> Weight { - Weight::from_ref_time(49_229_000) + Weight::from_ref_time(116_790_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_proposed() -> Weight { - Weight::from_ref_time(25_929_000) + Weight::from_ref_time(63_830_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -108,13 +110,13 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_active() -> Weight { - Weight::from_ref_time(38_633_000) + Weight::from_ref_time(90_651_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) fn extend_bounty_expiry() -> Weight { - Weight::from_ref_time(16_045_000) + Weight::from_ref_time(40_350_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -122,9 +124,9 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn spend_funds(b: u32) -> Weight { - Weight::from_ref_time(21_790_000) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(18_031_000).saturating_mul(b.into())) + Weight::from_ref_time(24_132_000) + // Standard Error: 235_000 + .saturating_add(Weight::from_ref_time(46_899_000).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) } diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index 02fb2345c..b4818d13b 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,12 +52,14 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:0) // Storage: AdvisoryCommittee Voting (r:255 w:255) // Storage: AdvisoryCommittee Prime (r:0 w:1) - fn set_members(m: u32, _n: u32, p: u32) -> Weight { + fn set_members(m: u32, n: u32, p: u32) -> Weight { Weight::from_ref_time(0) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(14_762_000).saturating_mul(m.into())) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(7_686_000).saturating_mul(p.into())) + // Standard Error: 195_000 + .saturating_add(Weight::from_ref_time(41_182_000).saturating_mul(m.into())) + // Standard Error: 195_000 + .saturating_add(Weight::from_ref_time(210_000).saturating_mul(n.into())) + // Standard Error: 76_000 + .saturating_add(Weight::from_ref_time(21_533_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -65,21 +67,21 @@ impl pallet_collective::weights::WeightInfo for WeightI } // Storage: AdvisoryCommittee Members (r:1 w:0) fn execute(b: u32, m: u32) -> Weight { - Weight::from_ref_time(13_563_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + Weight::from_ref_time(38_237_000) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(12_000).saturating_mul(m.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(40_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee ProposalOf (r:1 w:0) fn propose_execute(b: u32, m: u32) -> Weight { - Weight::from_ref_time(14_504_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000).saturating_mul(b.into())) + Weight::from_ref_time(44_582_000) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(18_000).saturating_mul(m.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(14_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) } // Storage: AdvisoryCommittee Members (r:1 w:0) @@ -88,22 +90,22 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalCount (r:1 w:1) // Storage: AdvisoryCommittee Voting (r:0 w:1) fn propose_proposed(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(21_145_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(4_000).saturating_mul(b.into())) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(47_000).saturating_mul(m.into())) + Weight::from_ref_time(37_436_000) // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(93_000).saturating_mul(p.into())) + .saturating_add(Weight::from_ref_time(20_000).saturating_mul(b.into())) + // Standard Error: 11_000 + .saturating_add(Weight::from_ref_time(39_000).saturating_mul(m.into())) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(279_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee Voting (r:1 w:1) fn vote(m: u32) -> Weight { - Weight::from_ref_time(32_864_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(50_000).saturating_mul(m.into())) + Weight::from_ref_time(75_377_000) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(454_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -112,9 +114,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_early_disapproved(_m: u32, p: u32) -> Weight { - Weight::from_ref_time(36_748_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(74_000).saturating_mul(p.into())) + Weight::from_ref_time(125_780_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(208_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -123,13 +125,13 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_early_approved(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(29_133_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(54_000).saturating_mul(m.into())) + Weight::from_ref_time(50_328_000) // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(99_000).saturating_mul(p.into())) + .saturating_add(Weight::from_ref_time(14_000).saturating_mul(b.into())) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(134_000).saturating_mul(m.into())) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(320_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -139,9 +141,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_disapproved(_m: u32, p: u32) -> Weight { - Weight::from_ref_time(35_689_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(81_000).saturating_mul(p.into())) + Weight::from_ref_time(77_551_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(224_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -151,13 +153,13 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_approved(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(30_778_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(4_000).saturating_mul(b.into())) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(50_000).saturating_mul(m.into())) + Weight::from_ref_time(23_404_000) // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(98_000).saturating_mul(p.into())) + .saturating_add(Weight::from_ref_time(30_000).saturating_mul(b.into())) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(288_000).saturating_mul(m.into())) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(360_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -165,9 +167,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Voting (r:0 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn disapprove_proposal(p: u32) -> Weight { - Weight::from_ref_time(20_708_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(86_000).saturating_mul(p.into())) + Weight::from_ref_time(48_539_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(202_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index 5b63a09b6..cf952bf8f 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,15 +53,15 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(40_195_000) + Weight::from_ref_time(85_600_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy DepositOf (r:1 w:1) fn second(s: u32) -> Weight { - Weight::from_ref_time(24_123_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(106_000).saturating_mul(s.into())) + Weight::from_ref_time(60_373_000) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(160_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,9 +69,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_new(r: u32) -> Weight { - Weight::from_ref_time(32_847_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(139_000).saturating_mul(r.into())) + Weight::from_ref_time(82_360_000) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(175_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -79,16 +79,16 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_existing(r: u32) -> Weight { - Weight::from_ref_time(31_794_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(161_000).saturating_mul(r.into())) + Weight::from_ref_time(78_219_000) + // Standard Error: 11_000 + .saturating_add(Weight::from_ref_time(234_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(13_836_000) + Weight::from_ref_time(40_670_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -99,43 +99,43 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:2 w:2) fn blacklist(p: u32) -> Weight { - Weight::from_ref_time(43_484_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(210_000).saturating_mul(p.into())) + Weight::from_ref_time(105_157_000) + // Standard Error: 22_000 + .saturating_add(Weight::from_ref_time(412_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) fn external_propose(v: u32) -> Weight { - Weight::from_ref_time(10_959_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(12_000).saturating_mul(v.into())) + Weight::from_ref_time(31_020_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(16_000).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(3_128_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(10_040_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(3_086_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(9_880_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(15_486_000) + Weight::from_ref_time(40_500_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) fn veto_external(v: u32) -> Weight { - Weight::from_ref_time(16_743_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(34_000).saturating_mul(v.into())) + Weight::from_ref_time(44_735_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(37_000).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -143,22 +143,22 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:2 w:2) fn cancel_proposal(p: u32) -> Weight { - Weight::from_ref_time(38_156_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(159_000).saturating_mul(p.into())) + Weight::from_ref_time(86_644_000) + // Standard Error: 12_000 + .saturating_add(Weight::from_ref_time(307_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(9_907_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(43_850_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_queued(r: u32) -> Weight { - Weight::from_ref_time(19_173_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(331_000).saturating_mul(r.into())) + Weight::from_ref_time(49_773_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(801_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -166,9 +166,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy ReferendumCount (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base(r: u32) -> Weight { - Weight::from_ref_time(9_098_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(1_561_000).saturating_mul(r.into())) + Weight::from_ref_time(29_677_000) + // Standard Error: 32_000 + .saturating_add(Weight::from_ref_time(3_533_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -180,9 +180,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy PublicProps (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:1 w:0) fn on_initialize_base_with_launch_period(r: u32) -> Weight { - Weight::from_ref_time(9_662_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_583_000).saturating_mul(r.into())) + Weight::from_ref_time(31_642_000) + // Standard Error: 31_000 + .saturating_add(Weight::from_ref_time(3_606_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -191,9 +191,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn delegate(r: u32) -> Weight { - Weight::from_ref_time(32_862_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(2_398_000).saturating_mul(r.into())) + Weight::from_ref_time(92_827_000) + // Standard Error: 52_000 + .saturating_add(Weight::from_ref_time(5_479_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -202,9 +202,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy VotingOf (r:2 w:2) // Storage: Democracy ReferendumInfoOf (r:1 w:1) fn undelegate(r: u32) -> Weight { - Weight::from_ref_time(20_469_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(2_361_000).saturating_mul(r.into())) + Weight::from_ref_time(51_753_000) + // Standard Error: 59_000 + .saturating_add(Weight::from_ref_time(5_388_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -212,28 +212,30 @@ impl pallet_democracy::weights::WeightInfo for WeightIn } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(3_880_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(10_700_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy Preimages (r:1 w:1) fn note_preimage(b: u32) -> Weight { - Weight::from_ref_time(21_894_000) + Weight::from_ref_time(54_036_000) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy Preimages (r:1 w:1) fn note_imminent_preimage(b: u32) -> Weight { - Weight::from_ref_time(16_638_000) + Weight::from_ref_time(42_055_000) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy Preimages (r:1 w:1) // Storage: System Account (r:1 w:1) - fn reap_preimage(_b: u32) -> Weight { - Weight::from_ref_time(28_888_000) + fn reap_preimage(b: u32) -> Weight { + Weight::from_ref_time(71_620_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -241,9 +243,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_remove(r: u32) -> Weight { - Weight::from_ref_time(24_713_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(81_000).saturating_mul(r.into())) + Weight::from_ref_time(57_238_000) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(146_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -251,27 +253,27 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_set(r: u32) -> Weight { - Weight::from_ref_time(23_404_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(133_000).saturating_mul(r.into())) + Weight::from_ref_time(55_627_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(214_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_vote(r: u32) -> Weight { - Weight::from_ref_time(13_571_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(142_000).saturating_mul(r.into())) + Weight::from_ref_time(35_445_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(251_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_other_vote(r: u32) -> Weight { - Weight::from_ref_time(13_683_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(143_000).saturating_mul(r.into())) + Weight::from_ref_time(36_669_000) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(221_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index e7d61f6ea..75988386b 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,19 +50,19 @@ pub struct WeightInfo(PhantomData); impl pallet_identity::weights::WeightInfo for WeightInfo { // Storage: Identity Registrars (r:1 w:1) fn add_registrar(r: u32) -> Weight { - Weight::from_ref_time(12_196_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(376_000).saturating_mul(r.into())) + Weight::from_ref_time(32_453_000) + // Standard Error: 71_000 + .saturating_add(Weight::from_ref_time(830_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) fn set_identity(r: u32, x: u32) -> Weight { - Weight::from_ref_time(23_488_000) - // Standard Error: 15_000 - .saturating_add(Weight::from_ref_time(384_000).saturating_mul(r.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(200_000).saturating_mul(x.into())) + Weight::from_ref_time(57_592_000) + // Standard Error: 79_000 + .saturating_add(Weight::from_ref_time(453_000).saturating_mul(r.into())) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(614_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -70,9 +70,9 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:1 w:1) fn set_subs_new(s: u32) -> Weight { - Weight::from_ref_time(22_648_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_755_000).saturating_mul(s.into())) + Weight::from_ref_time(57_926_000) + // Standard Error: 76_000 + .saturating_add(Weight::from_ref_time(4_193_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -82,9 +82,9 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:1) fn set_subs_old(p: u32) -> Weight { - Weight::from_ref_time(22_847_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(781_000).saturating_mul(p.into())) + Weight::from_ref_time(50_949_000) + // Standard Error: 12_000 + .saturating_add(Weight::from_ref_time(1_846_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) @@ -93,70 +93,64 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity IdentityOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:64) fn clear_identity(r: u32, s: u32, x: u32) -> Weight { - Weight::from_ref_time(26_919_000) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(141_000).saturating_mul(r.into())) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(808_000).saturating_mul(s.into())) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(79_000).saturating_mul(x.into())) + Weight::from_ref_time(61_225_000) + // Standard Error: 216_000 + .saturating_add(Weight::from_ref_time(442_000).saturating_mul(r.into())) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(1_828_000).saturating_mul(s.into())) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(236_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) - fn request_judgement(r: u32, x: u32) -> Weight { - Weight::from_ref_time(24_741_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(381_000).saturating_mul(r.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(206_000).saturating_mul(x.into())) + fn request_judgement(_r: u32, x: u32) -> Weight { + Weight::from_ref_time(68_611_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(616_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) - fn cancel_request(r: u32, x: u32) -> Weight { - Weight::from_ref_time(23_484_000) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(251_000).saturating_mul(r.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(202_000).saturating_mul(x.into())) + fn cancel_request(_r: u32, x: u32) -> Weight { + Weight::from_ref_time(75_094_000) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(550_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_fee(r: u32) -> Weight { - Weight::from_ref_time(6_477_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(262_000).saturating_mul(r.into())) + Weight::from_ref_time(18_492_000) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(339_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_account_id(r: u32) -> Weight { - Weight::from_ref_time(6_698_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(242_000).saturating_mul(r.into())) + Weight::from_ref_time(17_817_000) + // Standard Error: 52_000 + .saturating_add(Weight::from_ref_time(709_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) - fn set_fields(r: u32) -> Weight { - Weight::from_ref_time(6_546_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(244_000).saturating_mul(r.into())) + fn set_fields(_r: u32) -> Weight { + Weight::from_ref_time(20_985_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn provide_judgement(r: u32, x: u32) -> Weight { - Weight::from_ref_time(18_426_000) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(300_000).saturating_mul(r.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(340_000).saturating_mul(x.into())) + Weight::from_ref_time(44_404_000) + // Standard Error: 84_000 + .saturating_add(Weight::from_ref_time(865_000).saturating_mul(r.into())) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(993_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -164,14 +158,12 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity IdentityOf (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Identity SuperOf (r:0 w:64) - fn kill_identity(r: u32, s: u32, x: u32) -> Weight { - Weight::from_ref_time(31_309_000) - // Standard Error: 21_000 - .saturating_add(Weight::from_ref_time(306_000).saturating_mul(r.into())) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(823_000).saturating_mul(s.into())) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(108_000).saturating_mul(x.into())) + fn kill_identity(_r: u32, s: u32, x: u32) -> Weight { + Weight::from_ref_time(109_373_000) + // Standard Error: 31_000 + .saturating_add(Weight::from_ref_time(1_657_000).saturating_mul(s.into())) + // Standard Error: 31_000 + .saturating_add(Weight::from_ref_time(75_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -180,18 +172,18 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn add_sub(s: u32) -> Weight { - Weight::from_ref_time(27_995_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(111_000).saturating_mul(s.into())) + Weight::from_ref_time(75_288_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(50_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) fn rename_sub(s: u32) -> Weight { - Weight::from_ref_time(11_323_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(73_000).saturating_mul(s.into())) + Weight::from_ref_time(29_243_000) + // Standard Error: 11_000 + .saturating_add(Weight::from_ref_time(188_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -199,18 +191,18 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn remove_sub(s: u32) -> Weight { - Weight::from_ref_time(28_284_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(127_000).saturating_mul(s.into())) + Weight::from_ref_time(71_661_000) + // Standard Error: 15_000 + .saturating_add(Weight::from_ref_time(227_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn quit_sub(s: u32) -> Weight { - Weight::from_ref_time(20_753_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(107_000).saturating_mul(s.into())) + Weight::from_ref_time(57_480_000) + // Standard Error: 17_000 + .saturating_add(Weight::from_ref_time(184_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index d5af66791..3f0f627bd 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,9 +53,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn add_member(m: u32) -> Weight { - Weight::from_ref_time(15_484_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(31_000).saturating_mul(m.into())) + Weight::from_ref_time(44_484_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(37_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -65,9 +65,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn remove_member(m: u32) -> Weight { - Weight::from_ref_time(17_584_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(28_000).saturating_mul(m.into())) + Weight::from_ref_time(47_524_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(77_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -77,9 +77,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn swap_member(m: u32) -> Weight { - Weight::from_ref_time(17_575_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(32_000).saturating_mul(m.into())) + Weight::from_ref_time(46_637_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(128_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -89,9 +89,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn reset_member(m: u32) -> Weight { - Weight::from_ref_time(17_200_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(103_000).saturating_mul(m.into())) + Weight::from_ref_time(46_814_000) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(267_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -101,9 +101,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn change_key(m: u32) -> Weight { - Weight::from_ref_time(17_951_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(34_000).saturating_mul(m.into())) + Weight::from_ref_time(48_470_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(89_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -111,18 +111,15 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn set_prime(m: u32) -> Weight { - Weight::from_ref_time(6_406_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(11_000).saturating_mul(m.into())) + Weight::from_ref_time(18_199_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(72_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) - fn clear_prime(m: u32) -> Weight { - Weight::from_ref_time(3_667_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().writes(2)) + fn clear_prime(_m: u32) -> Weight { + Weight::from_ref_time(11_622_000).saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index 7ada45474..d2dce8294 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -48,15 +48,15 @@ use frame_support::{ /// Weight functions for pallet_multisig (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_multisig::weights::WeightInfo for WeightInfo { - fn as_multi_threshold_1(_z: u32) -> Weight { - Weight::from_ref_time(14_433_000) + fn as_multi_threshold_1(z: u32) -> Weight { + Weight::from_ref_time(40_350_000) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) - fn as_multi_create(s: u32, z: u32) -> Weight { - Weight::from_ref_time(26_712_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(82_000).saturating_mul(s.into())) + fn as_multi_create(_s: u32, z: u32) -> Weight { + Weight::from_ref_time(98_340_000) // Standard Error: 0 .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) @@ -66,32 +66,32 @@ impl pallet_multisig::weights::WeightInfo for WeightInf // Storage: MultiSig Calls (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create_store(s: u32, z: u32) -> Weight { - Weight::from_ref_time(28_175_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(78_000).saturating_mul(s.into())) + Weight::from_ref_time(89_465_000) + // Standard Error: 19_000 + .saturating_add(Weight::from_ref_time(14_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(Weight::from_ref_time(2_000).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MultiSig Multisigs (r:1 w:1) fn as_multi_approve(s: u32, z: u32) -> Weight { - Weight::from_ref_time(20_530_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(70_000).saturating_mul(s.into())) + Weight::from_ref_time(48_826_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(139_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(Weight::from_ref_time(2_000).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) fn as_multi_approve_store(s: u32, z: u32) -> Weight { - Weight::from_ref_time(29_734_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(73_000).saturating_mul(s.into())) + Weight::from_ref_time(73_692_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(110_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -99,29 +99,29 @@ impl pallet_multisig::weights::WeightInfo for WeightInf // Storage: MultiSig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn as_multi_complete(s: u32, z: u32) -> Weight { - Weight::from_ref_time(35_958_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(108_000).saturating_mul(s.into())) + Weight::from_ref_time(91_645_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(105_000).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn approve_as_multi_create(s: u32) -> Weight { - Weight::from_ref_time(23_697_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(98_000).saturating_mul(s.into())) + Weight::from_ref_time(59_874_000) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(182_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:0) fn approve_as_multi_approve(s: u32) -> Weight { - Weight::from_ref_time(16_611_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(100_000).saturating_mul(s.into())) + Weight::from_ref_time(43_800_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(173_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -129,18 +129,18 @@ impl pallet_multisig::weights::WeightInfo for WeightInf // Storage: MultiSig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn approve_as_multi_complete(s: u32) -> Weight { - Weight::from_ref_time(40_814_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(136_000).saturating_mul(s.into())) + Weight::from_ref_time(103_694_000) + // Standard Error: 17_000 + .saturating_add(Weight::from_ref_time(194_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: MultiSig Calls (r:1 w:1) fn cancel_as_multi(s: u32) -> Weight { - Weight::from_ref_time(35_582_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(92_000).saturating_mul(s.into())) + Weight::from_ref_time(89_339_000) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(197_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index 1d2055a00..9df5b793e 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_parachain_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,39 +50,39 @@ pub struct WeightInfo(PhantomData); impl pallet_parachain_staking::weights::WeightInfo for WeightInfo { // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_staking_expectations() -> Weight { - Weight::from_ref_time(12_772_000) + Weight::from_ref_time(36_750_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking InflationConfig (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_inflation() -> Weight { - Weight::from_ref_time(35_128_000) + Weight::from_ref_time(94_430_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_account() -> Weight { - Weight::from_ref_time(12_556_000) + Weight::from_ref_time(33_460_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_reserve_percent() -> Weight { - Weight::from_ref_time(11_823_000) + Weight::from_ref_time(32_350_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking TotalSelected (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_total_selected() -> Weight { - Weight::from_ref_time(13_791_000) + Weight::from_ref_time(36_990_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking CollatorCommission (r:1 w:1) fn set_collator_commission() -> Weight { - Weight::from_ref_time(11_749_000) + Weight::from_ref_time(31_200_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -90,7 +90,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TotalSelected (r:1 w:0) // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_blocks_per_round() -> Weight { - Weight::from_ref_time(36_619_000) + Weight::from_ref_time(99_720_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -103,9 +103,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TopDelegations (r:0 w:1) // Storage: ParachainStaking BottomDelegations (r:0 w:1) fn join_candidates(x: u32) -> Weight { - Weight::from_ref_time(31_483_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(198_000).saturating_mul(x.into())) + Weight::from_ref_time(105_148_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(369_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -113,9 +113,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn schedule_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(26_529_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(175_000).saturating_mul(x.into())) + Weight::from_ref_time(118_551_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(313_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -131,8 +131,8 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Total (r:1 w:1) fn execute_leave_candidates(x: u32) -> Weight { Weight::from_ref_time(0) - // Standard Error: 54_000 - .saturating_add(Weight::from_ref_time(17_144_000).saturating_mul(x.into())) + // Standard Error: 226_000 + .saturating_add(Weight::from_ref_time(44_890_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -141,23 +141,23 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn cancel_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(24_767_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(187_000).saturating_mul(x.into())) + Weight::from_ref_time(115_324_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(358_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_offline() -> Weight { - Weight::from_ref_time(19_040_000) + Weight::from_ref_time(52_570_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_online() -> Weight { - Weight::from_ref_time(20_273_000) + Weight::from_ref_time(51_920_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -167,14 +167,14 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn candidate_bond_more() -> Weight { - Weight::from_ref_time(34_300_000) + Weight::from_ref_time(97_240_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_candidate_bond_less() -> Weight { - Weight::from_ref_time(18_608_000) + Weight::from_ref_time(47_370_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -185,13 +185,13 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: System Account (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn execute_candidate_bond_less() -> Weight { - Weight::from_ref_time(39_891_000) + Weight::from_ref_time(94_561_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) fn cancel_candidate_bond_less() -> Weight { - Weight::from_ref_time(17_010_000) + Weight::from_ref_time(50_120_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -203,11 +203,11 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn delegate(x: u32, y: u32) -> Weight { - Weight::from_ref_time(79_992_000) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(123_000).saturating_mul(x.into())) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(132_000).saturating_mul(y.into())) + Weight::from_ref_time(221_620_000) + // Standard Error: 48_000 + .saturating_add(Weight::from_ref_time(372_000).saturating_mul(x.into())) + // Standard Error: 15_000 + .saturating_add(Weight::from_ref_time(527_000).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -215,7 +215,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn schedule_leave_delegators() -> Weight { - Weight::from_ref_time(20_235_000) + Weight::from_ref_time(63_370_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -230,9 +230,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn execute_leave_delegators(x: u32) -> Weight { - Weight::from_ref_time(21_429_000) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(13_765_000).saturating_mul(x.into())) + Weight::from_ref_time(27_207_000) + // Standard Error: 226_000 + .saturating_add(Weight::from_ref_time(34_240_000).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -241,7 +241,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_leave_delegators() -> Weight { - Weight::from_ref_time(20_711_000) + Weight::from_ref_time(52_221_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -249,7 +249,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_revoke_delegation() -> Weight { - Weight::from_ref_time(21_082_000) + Weight::from_ref_time(51_631_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -262,7 +262,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn delegator_bond_more() -> Weight { - Weight::from_ref_time(45_308_000) + Weight::from_ref_time(109_970_000) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -270,7 +270,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_delegator_bond_less() -> Weight { - Weight::from_ref_time(20_867_000) + Weight::from_ref_time(51_671_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -285,7 +285,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_revoke_delegation() -> Weight { - Weight::from_ref_time(61_324_000) + Weight::from_ref_time(138_000_000) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(8)) } @@ -299,21 +299,21 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_delegator_bond_less() -> Weight { - Weight::from_ref_time(52_704_000) + Weight::from_ref_time(121_801_000) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_revoke_delegation() -> Weight { - Weight::from_ref_time(20_414_000) + Weight::from_ref_time(49_720_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_delegator_bond_less() -> Weight { - Weight::from_ref_time(25_884_000) + Weight::from_ref_time(61_280_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -337,10 +337,10 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelayedPayouts (r:0 w:1) fn round_transition_on_initialize(x: u32, y: u32) -> Weight { Weight::from_ref_time(0) - // Standard Error: 644_000 - .saturating_add(Weight::from_ref_time(23_725_000).saturating_mul(x.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(158_000).saturating_mul(y.into())) + // Standard Error: 1_640_000 + .saturating_add(Weight::from_ref_time(58_147_000).saturating_mul(x.into())) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(398_000).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) } // Storage: ParachainStaking DelayedPayouts (r:1 w:0) @@ -349,9 +349,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking AtStake (r:1 w:1) // Storage: System Account (r:1 w:1) fn pay_one_collator_reward(y: u32) -> Weight { - Weight::from_ref_time(42_666_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(7_581_000).saturating_mul(y.into())) + Weight::from_ref_time(74_512_000) + // Standard Error: 78_000 + .saturating_add(Weight::from_ref_time(18_939_000).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -359,16 +359,16 @@ impl pallet_parachain_staking::weights::WeightInfo for } // Storage: ParachainStaking Round (r:1 w:0) fn base_on_initialize() -> Weight { - Weight::from_ref_time(5_230_000).saturating_add(T::DbWeight::get().reads(1)) + Weight::from_ref_time(15_540_000).saturating_add(T::DbWeight::get().reads(1)) } // Storage: ParachainStaking DelegatorState (r:1 w:0) // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) fn set_auto_compound(x: u32, y: u32) -> Weight { - Weight::from_ref_time(41_348_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(123_000).saturating_mul(x.into())) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(129_000).saturating_mul(y.into())) + Weight::from_ref_time(172_244_000) + // Standard Error: 11_000 + .saturating_add(Weight::from_ref_time(387_000).saturating_mul(x.into())) + // Standard Error: 35_000 + .saturating_add(Weight::from_ref_time(30_000).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -382,11 +382,11 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Total (r:1 w:1) // Storage: ParachainStaking BottomDelegations (r:1 w:1) fn delegate_with_auto_compound(x: u32, y: u32, _z: u32) -> Weight { - Weight::from_ref_time(98_391_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(40_000).saturating_mul(x.into())) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(39_000).saturating_mul(y.into())) + Weight::from_ref_time(290_047_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(115_000).saturating_mul(x.into())) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(184_000).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(8)) } diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index 2c9a555ce..0536b916e 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,7 +53,7 @@ impl pallet_preimage::weights::WeightInfo for WeightInf fn note_preimage(s: u32) -> Weight { Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(s.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -62,7 +62,7 @@ impl pallet_preimage::weights::WeightInfo for WeightInf fn note_requested_preimage(s: u32) -> Weight { Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(s.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -71,65 +71,65 @@ impl pallet_preimage::weights::WeightInfo for WeightInf fn note_no_deposit_preimage(s: u32) -> Weight { Weight::from_ref_time(0) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(s.into())) + .saturating_add(Weight::from_ref_time(3_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(23_817_000) + Weight::from_ref_time(97_561_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(14_632_000) + Weight::from_ref_time(68_920_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(22_851_000) + Weight::from_ref_time(93_040_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(13_733_000) + Weight::from_ref_time(72_890_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(13_220_000) + Weight::from_ref_time(47_821_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(6_833_000) + Weight::from_ref_time(18_310_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(15_046_000) + Weight::from_ref_time(74_260_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(15_443_000) + Weight::from_ref_time(38_170_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(7_028_000) + Weight::from_ref_time(20_180_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index 55168c709..216678e76 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,38 +50,40 @@ pub struct WeightInfo(PhantomData); impl pallet_proxy::weights::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32) -> Weight { - Weight::from_ref_time(14_551_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(15_000).saturating_mul(p.into())) + Weight::from_ref_time(39_097_000) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(94_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32) -> Weight { - Weight::from_ref_time(27_375_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(64_000).saturating_mul(a.into())) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(68_000).saturating_mul(p.into())) + Weight::from_ref_time(71_706_000) + // Standard Error: 26_000 + .saturating_add(Weight::from_ref_time(185_000).saturating_mul(a.into())) + // Standard Error: 27_000 + .saturating_add(Weight::from_ref_time(78_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn remove_announcement(a: u32, _p: u32) -> Weight { - Weight::from_ref_time(20_140_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(88_000).saturating_mul(a.into())) + fn remove_announcement(a: u32, p: u32) -> Weight { + Weight::from_ref_time(48_284_000) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(166_000).saturating_mul(a.into())) + // Standard Error: 18_000 + .saturating_add(Weight::from_ref_time(69_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_announcement(a: u32, _p: u32) -> Weight { - Weight::from_ref_time(20_526_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(70_000).saturating_mul(a.into())) + Weight::from_ref_time(52_265_000) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(84_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -89,52 +91,52 @@ impl pallet_proxy::weights::WeightInfo for WeightInfo Weight { - Weight::from_ref_time(24_821_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(95_000).saturating_mul(a.into())) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(57_000).saturating_mul(p.into())) + Weight::from_ref_time(64_000_000) + // Standard Error: 26_000 + .saturating_add(Weight::from_ref_time(117_000).saturating_mul(a.into())) + // Standard Error: 26_000 + .saturating_add(Weight::from_ref_time(91_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32) -> Weight { - Weight::from_ref_time(20_093_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(70_000).saturating_mul(p.into())) + Weight::from_ref_time(48_885_000) + // Standard Error: 76_000 + .saturating_add(Weight::from_ref_time(439_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32) -> Weight { - Weight::from_ref_time(20_379_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(64_000).saturating_mul(p.into())) + Weight::from_ref_time(52_080_000) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(146_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32) -> Weight { - Weight::from_ref_time(17_624_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(35_000).saturating_mul(p.into())) + Weight::from_ref_time(46_847_000) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(19_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) fn anonymous(p: u32) -> Weight { - Weight::from_ref_time(22_081_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(11_000).saturating_mul(p.into())) + Weight::from_ref_time(55_708_000) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(50_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_anonymous(p: u32) -> Weight { - Weight::from_ref_time(18_300_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(41_000).saturating_mul(p.into())) + Weight::from_ref_time(46_563_000) + // Standard Error: 30_000 + .saturating_add(Weight::from_ref_time(250_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index 1c4861a84..d94e83b60 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,9 +53,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named_resolved(s: u32) -> Weight { - Weight::from_ref_time(21_157_000) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(12_140_000).saturating_mul(s.into())) + Weight::from_ref_time(77_951_000) + // Standard Error: 354_000 + .saturating_add(Weight::from_ref_time(33_430_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,9 +66,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Preimage StatusFor (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_resolved(s: u32) -> Weight { - Weight::from_ref_time(19_942_000) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(9_690_000).saturating_mul(s.into())) + Weight::from_ref_time(30_364_000) + // Standard Error: 290_000 + .saturating_add(Weight::from_ref_time(28_276_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,9 +78,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_periodic_resolved(s: u32) -> Weight { - Weight::from_ref_time(20_565_000) - // Standard Error: 21_000 - .saturating_add(Weight::from_ref_time(10_251_000).saturating_mul(s.into())) + Weight::from_ref_time(15_153_000) + // Standard Error: 630_000 + .saturating_add(Weight::from_ref_time(30_716_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,9 +90,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn on_initialize_resolved(s: u32) -> Weight { - Weight::from_ref_time(18_489_000) - // Standard Error: 22_000 - .saturating_add(Weight::from_ref_time(8_916_000).saturating_mul(s.into())) + Weight::from_ref_time(29_624_000) + // Standard Error: 210_000 + .saturating_add(Weight::from_ref_time(26_634_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,9 +102,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Preimage PreimageFor (r:1 w:0) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named_aborted(s: u32) -> Weight { - Weight::from_ref_time(7_774_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(3_371_000).saturating_mul(s.into())) + Weight::from_ref_time(18_753_000) + // Standard Error: 74_000 + .saturating_add(Weight::from_ref_time(10_211_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -113,9 +113,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Scheduler Agenda (r:2 w:2) // Storage: Preimage PreimageFor (r:1 w:0) fn on_initialize_aborted(s: u32) -> Weight { - Weight::from_ref_time(6_944_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_744_000).saturating_mul(s.into())) + Weight::from_ref_time(12_642_000) + // Standard Error: 91_000 + .saturating_add(Weight::from_ref_time(5_181_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -123,9 +123,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_periodic_named(s: u32) -> Weight { - Weight::from_ref_time(18_393_000) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(5_858_000).saturating_mul(s.into())) + Weight::from_ref_time(57_881_000) + // Standard Error: 117_000 + .saturating_add(Weight::from_ref_time(16_508_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -133,9 +133,9 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn } // Storage: Scheduler Agenda (r:2 w:2) fn on_initialize_periodic(s: u32) -> Weight { - Weight::from_ref_time(12_837_000) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(4_375_000).saturating_mul(s.into())) + Weight::from_ref_time(32_402_000) + // Standard Error: 103_000 + .saturating_add(Weight::from_ref_time(13_081_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -144,53 +144,53 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn on_initialize_named(s: u32) -> Weight { - Weight::from_ref_time(12_809_000) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(3_790_000).saturating_mul(s.into())) + Weight::from_ref_time(39_741_000) + // Standard Error: 73_000 + .saturating_add(Weight::from_ref_time(11_308_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:1 w:1) fn on_initialize(s: u32) -> Weight { - Weight::from_ref_time(10_524_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(3_133_000).saturating_mul(s.into())) + Weight::from_ref_time(34_782_000) + // Standard Error: 61_000 + .saturating_add(Weight::from_ref_time(9_525_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) fn schedule(s: u32) -> Weight { - Weight::from_ref_time(13_078_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(91_000).saturating_mul(s.into())) + Weight::from_ref_time(42_112_000) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(179_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn cancel(s: u32) -> Weight { - Weight::from_ref_time(13_377_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(392_000).saturating_mul(s.into())) + Weight::from_ref_time(40_100_000) + // Standard Error: 21_000 + .saturating_add(Weight::from_ref_time(996_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32) -> Weight { - Weight::from_ref_time(15_612_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(143_000).saturating_mul(s.into())) + Weight::from_ref_time(44_125_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(242_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32) -> Weight { - Weight::from_ref_time(15_559_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(434_000).saturating_mul(s.into())) + Weight::from_ref_time(42_315_000) + // Standard Error: 44_000 + .saturating_add(Weight::from_ref_time(1_239_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index badebae73..083969d6d 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,12 +49,13 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_timestamp::weights::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) + // Storage: Aura CurrentSlot (r:1 w:0) fn set() -> Weight { - Weight::from_ref_time(5_328_000) - .saturating_add(T::DbWeight::get().reads(1)) + Weight::from_ref_time(27_600_000) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn on_finalize() -> Weight { - Weight::from_ref_time(3_459_000) + Weight::from_ref_time(10_360_000) } } diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index dcdf176e0..66d407d9e 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_treasury //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,33 +49,33 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_treasury::weights::WeightInfo for WeightInfo { fn spend() -> Weight { - Weight::from_ref_time(97_000) + Weight::from_ref_time(280_000) } // Storage: Treasury ProposalCount (r:1 w:1) // Storage: Treasury Proposals (r:0 w:1) fn propose_spend() -> Weight { - Weight::from_ref_time(20_639_000) + Weight::from_ref_time(60_380_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Treasury Proposals (r:1 w:1) fn reject_proposal() -> Weight { - Weight::from_ref_time(24_734_000) + Weight::from_ref_time(72_761_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Proposals (r:1 w:0) // Storage: Treasury Approvals (r:1 w:1) fn approve_proposal(p: u32) -> Weight { - Weight::from_ref_time(10_189_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(108_000).saturating_mul(p.into())) + Weight::from_ref_time(27_423_000) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(174_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Approvals (r:1 w:1) fn remove_approval() -> Weight { - Weight::from_ref_time(6_149_000) + Weight::from_ref_time(19_090_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -84,9 +84,9 @@ impl pallet_treasury::weights::WeightInfo for WeightInf // Storage: Bounties BountyApprovals (r:1 w:1) // Storage: Treasury Proposals (r:2 w:2) fn on_initialize_proposals(p: u32) -> Weight { - Weight::from_ref_time(39_798_000) - // Standard Error: 30_000 - .saturating_add(Weight::from_ref_time(17_861_000).saturating_mul(p.into())) + Weight::from_ref_time(43_929_000) + // Standard Error: 358_000 + .saturating_add(Weight::from_ref_time(45_522_000).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index 07713136c..059ae9918 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,24 +49,24 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_utility::weights::WeightInfo for WeightInfo { fn batch(c: u32) -> Weight { - Weight::from_ref_time(31_929_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(2_285_000).saturating_mul(c.into())) + Weight::from_ref_time(73_233_000) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(6_159_000).saturating_mul(c.into())) } fn as_derivative() -> Weight { - Weight::from_ref_time(3_956_000) + Weight::from_ref_time(10_870_000) } fn batch_all(c: u32) -> Weight { - Weight::from_ref_time(35_456_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_327_000).saturating_mul(c.into())) + Weight::from_ref_time(44_965_000) + // Standard Error: 48_000 + .saturating_add(Weight::from_ref_time(6_460_000).saturating_mul(c.into())) } fn dispatch_as() -> Weight { - Weight::from_ref_time(9_192_000) + Weight::from_ref_time(23_170_000) } fn force_batch(c: u32) -> Weight { - Weight::from_ref_time(32_930_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(2_283_000).saturating_mul(c.into())) + Weight::from_ref_time(35_547_000) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(6_274_000).saturating_mul(c.into())) } } diff --git a/runtime/common/src/weights/pallet_vesting.rs b/runtime/common/src/weights/pallet_vesting.rs index c0d0f370e..af99820ef 100644 --- a/runtime/common/src/weights/pallet_vesting.rs +++ b/runtime/common/src/weights/pallet_vesting.rs @@ -18,16 +18,16 @@ //! Autogenerated weights for pallet_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-05, STEPS: `2`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/release/zeitgeist +// ./target/production/zeitgeist // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=pallet_vesting // --extrinsic=* // --execution=wasm @@ -50,89 +50,81 @@ pub struct WeightInfo(PhantomData); impl pallet_vesting::weights::WeightInfo for WeightInfo { // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vest_locked(l: u32, s: u32) -> Weight { - Weight::from_ref_time(51_010_000) - // Standard Error: 92_000 - .saturating_add(Weight::from_ref_time(81_000).saturating_mul(l.into())) - // Standard Error: 167_000 - .saturating_add(Weight::from_ref_time(98_000).saturating_mul(s.into())) + fn vest_locked(_l: u32, _s: u32) -> Weight { + Weight::from_ref_time(74_193_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_unlocked(l: u32, s: u32) -> Weight { - Weight::from_ref_time(53_538_000) - // Standard Error: 92_000 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(l.into())) - // Standard Error: 167_000 - .saturating_add(Weight::from_ref_time(90_000).saturating_mul(s.into())) + Weight::from_ref_time(59_403_000) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(142_000).saturating_mul(l.into())) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(76_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn vest_other_locked(l: u32, s: u32) -> Weight { - Weight::from_ref_time(48_450_000) - // Standard Error: 90_000 - .saturating_add(Weight::from_ref_time(111_000).saturating_mul(l.into())) - // Standard Error: 164_000 - .saturating_add(Weight::from_ref_time(198_000).saturating_mul(s.into())) + fn vest_other_locked(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(69_282_000) + // Standard Error: 17_000 + .saturating_add(Weight::from_ref_time(33_000).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn vest_other_unlocked(l: u32, s: u32) -> Weight { - Weight::from_ref_time(53_097_000) - // Standard Error: 85_000 - .saturating_add(Weight::from_ref_time(31_000).saturating_mul(l.into())) - // Standard Error: 154_000 - .saturating_add(Weight::from_ref_time(39_000).saturating_mul(s.into())) + fn vest_other_unlocked(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(64_138_000) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(101_000).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vested_transfer(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(81_504_000) - // Standard Error: 115_000 - .saturating_add(Weight::from_ref_time(65_000).saturating_mul(l.into())) + fn vested_transfer(l: u32, s: u32) -> Weight { + Weight::from_ref_time(89_063_000) + // Standard Error: 24_000 + .saturating_add(Weight::from_ref_time(74_000).saturating_mul(l.into())) + // Standard Error: 43_000 + .saturating_add(Weight::from_ref_time(240_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:1 w:1) - fn force_vested_transfer(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(81_219_000) - // Standard Error: 106_000 - .saturating_add(Weight::from_ref_time(47_000).saturating_mul(l.into())) + fn force_vested_transfer(_l: u32, s: u32) -> Weight { + Weight::from_ref_time(95_489_000) + // Standard Error: 61_000 + .saturating_add(Weight::from_ref_time(44_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight { - Weight::from_ref_time(53_564_000) - // Standard Error: 72_000 - .saturating_add(Weight::from_ref_time(88_000).saturating_mul(l.into())) - // Standard Error: 137_000 - .saturating_add(Weight::from_ref_time(64_000).saturating_mul(s.into())) + fn not_unlocking_merge_schedules(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(67_438_000) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(158_000).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn unlocking_merge_schedules(l: u32, s: u32) -> Weight { - Weight::from_ref_time(53_580_000) - // Standard Error: 91_000 - .saturating_add(Weight::from_ref_time(50_000).saturating_mul(l.into())) - // Standard Error: 171_000 - .saturating_add(Weight::from_ref_time(69_000).saturating_mul(s.into())) + Weight::from_ref_time(67_798_000) + // Standard Error: 22_000 + .saturating_add(Weight::from_ref_time(48_000).saturating_mul(l.into())) + // Standard Error: 41_000 + .saturating_add(Weight::from_ref_time(115_000).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index 9569f19f7..2aaa24742 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for zrml_authorized //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-06, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/release/zeitgeist +// ./target/production/zeitgeist // benchmark // pallet // --chain=dev @@ -33,8 +33,8 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./zrml/authorized/src/weights.rs // --template=./misc/weight_template.hbs +// --output=./zrml/authorized/src/weights.rs #![allow(unused_parens)] #![allow(unused_imports)] @@ -56,18 +56,17 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn authorize_market_outcome_first_report(m: u32) -> Weight { - Weight::from_ref_time(31_031_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(85_000)) - .saturating_mul(m.into()) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + Weight::from_ref_time(38_444_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(173_000).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) fn authorize_market_outcome_existing_report() -> Weight { - Weight::from_ref_time(24_000_000) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + Weight::from_ref_time(30_850_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index b2d139d26..48d68f719 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_court //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -59,7 +59,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court RequestedJurors (r:1 w:0) // Storage: Court Votes (r:1 w:0) fn exit_court() -> Weight { - Weight::from_ref_time(32_139_000) + Weight::from_ref_time(76_500_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -67,14 +67,14 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court CounterForJurors (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) fn join_court() -> Weight { - Weight::from_ref_time(22_962_000) + Weight::from_ref_time(54_370_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Court Jurors (r:1 w:0) // Storage: Court Votes (r:0 w:1) fn vote() -> Weight { - Weight::from_ref_time(9_773_000) + Weight::from_ref_time(25_540_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index d87225ebd..5e8a03f6d 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_global_disputes //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -61,10 +61,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_on_outcome(_o: u32, v: u32) -> Weight { - Weight::from_ref_time(32_621_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(37_000).saturating_mul(v.into())) + fn vote_on_outcome(o: u32, v: u32) -> Weight { + Weight::from_ref_time(78_818_000) + // Standard Error: 21_000 + .saturating_add(Weight::from_ref_time(23_000).saturating_mul(o.into())) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(90_000).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -73,11 +75,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_set(l: u32, o: u32) -> Weight { - Weight::from_ref_time(17_375_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_536_000).saturating_mul(l.into())) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(432_000).saturating_mul(o.into())) + Weight::from_ref_time(43_696_000) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(3_636_000).saturating_mul(l.into())) + // Standard Error: 61_000 + .saturating_add(Weight::from_ref_time(1_467_000).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -87,11 +89,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight { - Weight::from_ref_time(16_626_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_481_000).saturating_mul(l.into())) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(326_000).saturating_mul(o.into())) + Weight::from_ref_time(40_327_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(3_508_000).saturating_mul(l.into())) + // Standard Error: 55_000 + .saturating_add(Weight::from_ref_time(1_279_000).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -99,10 +101,8 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: System Account (r:1 w:1) - fn add_vote_outcome(w: u32) -> Weight { - Weight::from_ref_time(34_491_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(10_000).saturating_mul(w.into())) + fn add_vote_outcome(_w: u32) -> Weight { + Weight::from_ref_time(87_507_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -110,9 +110,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:2 w:2) fn reward_outcome_owner_with_funds(o: u32) -> Weight { - Weight::from_ref_time(24_336_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(11_655_000).saturating_mul(o.into())) + Weight::from_ref_time(54_189_000) + // Standard Error: 75_000 + .saturating_add(Weight::from_ref_time(29_563_000).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,18 +121,17 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:0) // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:1 w:0) - fn reward_outcome_owner_no_funds(o: u32) -> Weight { - Weight::from_ref_time(16_681_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(15_000).saturating_mul(o.into())) - .saturating_add(T::DbWeight::get().reads(3)) + fn reward_outcome_owner_no_funds(_o: u32) -> Weight { + Weight::from_ref_time(46_706_000).saturating_add(T::DbWeight::get().reads(3)) } // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:3 w:2) - fn purge_outcomes(k: u32, _o: u32) -> Weight { - Weight::from_ref_time(72_588_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(6_944_000).saturating_mul(k.into())) + fn purge_outcomes(k: u32, o: u32) -> Weight { + Weight::from_ref_time(0) + // Standard Error: 22_000 + .saturating_add(Weight::from_ref_time(18_932_000).saturating_mul(k.into())) + // Standard Error: 606_000 + .saturating_add(Weight::from_ref_time(10_914_000).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/zrml/liquidity-mining/src/weights.rs b/zrml/liquidity-mining/src/weights.rs index 16fb23a2d..42b49e781 100644 --- a/zrml/liquidity-mining/src/weights.rs +++ b/zrml/liquidity-mining/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_liquidity_mining //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,6 +53,6 @@ pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { // Storage: LiquidityMining PerBlockIncentive (r:0 w:1) fn set_per_block_distribution() -> Weight { - Weight::from_ref_time(2_673_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(8_150_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index 385b5f0ff..bc8659033 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -18,11 +18,11 @@ //! Autogenerated weights for zrml_prediction_markets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-09, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: -// ./target/release/zeitgeist +// ./target/production/zeitgeist // benchmark // pallet // --chain=dev @@ -33,8 +33,8 @@ // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./zrml/prediction-markets/src/weights.rs // --template=./misc/weight_template.hbs +// --output=./zrml/prediction-markets/src/weights.rs #![allow(unused_parens)] #![allow(unused_imports)] @@ -83,28 +83,30 @@ pub trait WeightInfoZeitgeist { pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:1 w:1) - // Storage: Balances Reserves (r:1 w:1) - // Storage: System Account (r:2 w:2) + // Storage: Balances Reserves (r:7 w:7) + // Storage: System Account (r:8 w:8) // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - fn admin_destroy_disputed_market(a: u32, d: u32, o: u32, _c: u32, r: u32) -> Weight { - Weight::from_ref_time(86_175_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(10_879_000).saturating_mul(a.into())) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(861_000).saturating_mul(d.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(6_000).saturating_mul(o.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(54_000).saturating_mul(r.into())) + fn admin_destroy_disputed_market(a: u32, d: u32, _o: u32, c: u32, r: u32) -> Weight { + Weight::from_ref_time(36_524_000) + // Standard Error: 41_000 + .saturating_add(Weight::from_ref_time(28_980_000).saturating_mul(a.into())) + // Standard Error: 473_000 + .saturating_add(Weight::from_ref_time(40_066_000).saturating_mul(d.into())) + // Standard Error: 41_000 + .saturating_add(Weight::from_ref_time(425_000).saturating_mul(c.into())) + // Standard Error: 41_000 + .saturating_add(Weight::from_ref_time(438_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(8)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(d.into()))) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) @@ -115,16 +117,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) - fn admin_destroy_reported_market(a: u32, o: u32, c: u32, r: u32) -> Weight { - Weight::from_ref_time(87_265_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(10_869_000).saturating_mul(a.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(12_000).saturating_mul(o.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(21_000).saturating_mul(c.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(17_000).saturating_mul(r.into())) + fn admin_destroy_reported_market(a: u32, _o: u32, c: u32, _r: u32) -> Weight { + Weight::from_ref_time(302_448_000) + // Standard Error: 39_000 + .saturating_add(Weight::from_ref_time(27_690_000).saturating_mul(a.into())) + // Standard Error: 39_000 + .saturating_add(Weight::from_ref_time(809_000).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(8)) @@ -134,38 +132,34 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_closed(o: u32, c: u32) -> Weight { - Weight::from_ref_time(23_683_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(14_000).saturating_mul(o.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(20_000).saturating_mul(c.into())) + fn admin_move_market_to_closed(_o: u32, c: u32) -> Weight { + Weight::from_ref_time(62_951_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(69_000).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) - // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight { - Weight::from_ref_time(40_650_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(15_000).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(5)) + // Storage: PredictionMarkets Disputes (r:0 w:1) + fn admin_move_market_to_resolved_scalar_reported(_r: u32) -> Weight { + Weight::from_ref_time(107_834_000) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) - // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) + // Storage: PredictionMarkets Disputes (r:0 w:1) fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight { - Weight::from_ref_time(76_526_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(28_000).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(171_263_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(12_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) @@ -176,13 +170,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_resolved_scalar_disputed(r: u32) -> Weight { - Weight::from_ref_time(56_260_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(22_000).saturating_mul(r.into())) - // Standard Error: 6_000 - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(5)) + fn admin_move_market_to_resolved_scalar_disputed(_r: u32) -> Weight { + Weight::from_ref_time(174_434_000) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(7)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets Disputes (r:1 w:1) @@ -194,26 +185,26 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_move_market_to_resolved_categorical_disputed(r: u32) -> Weight { - Weight::from_ref_time(93_329_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(7_000).saturating_mul(r.into())) - // Standard Error: 8_000 - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(6)) + Weight::from_ref_time(226_823_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(85_000).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:0) // Storage: Balances Reserves (r:1 w:1) fn approve_market() -> Weight { - Weight::from_ref_time(26_968_000) + Weight::from_ref_time(71_421_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) - fn request_edit(_r: u32) -> Weight { - Weight::from_ref_time(15_701_000) + fn request_edit(r: u32) -> Weight { + Weight::from_ref_time(40_894_000) // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -222,9 +213,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn buy_complete_set(a: u32) -> Weight { - Weight::from_ref_time(34_178_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(8_264_000).saturating_mul(a.into())) + Weight::from_ref_time(79_725_000) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(19_896_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -236,9 +227,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons Markets (r:0 w:1) fn create_market(m: u32) -> Weight { - Weight::from_ref_time(30_604_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(17_000).saturating_mul(m.into())) + Weight::from_ref_time(80_436_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(9_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -247,9 +238,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn edit_market(m: u32) -> Weight { - Weight::from_ref_time(26_200_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(27_000).saturating_mul(m.into())) + Weight::from_ref_time(68_686_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(150_000).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -263,11 +254,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_future_pool(a: u32, o: u32) -> Weight { - Weight::from_ref_time(61_235_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(13_099_000).saturating_mul(a.into())) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(36_000).saturating_mul(o.into())) + Weight::from_ref_time(170_533_000) + // Standard Error: 45_000 + .saturating_add(Weight::from_ref_time(32_842_000).saturating_mul(a.into())) + // Standard Error: 45_000 + .saturating_add(Weight::from_ref_time(145_000).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(7)) @@ -282,9 +273,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_open_pool(a: u32) -> Weight { - Weight::from_ref_time(60_792_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(13_322_000).saturating_mul(a.into())) + Weight::from_ref_time(100_840_000) + // Standard Error: 52_000 + .saturating_add(Weight::from_ref_time(35_669_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -295,36 +286,39 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:7 w:7) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) - fn start_global_dispute(_m: u32, _n: u32) -> Weight { - Weight::from_ref_time(55_642_000) + fn start_global_dispute(m: u32, n: u32) -> Weight { + Weight::from_ref_time(128_368_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(8_000).saturating_mul(m.into())) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(96_000).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(10)) } // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) - // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn dispute_authorized() -> Weight { - Weight::from_ref_time(34_018_000) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) + Weight::from_ref_time(73_020_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn handle_expired_advised_market() -> Weight { - Weight::from_ref_time(25_833_000) + Weight::from_ref_time(82_180_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) - // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) + // Storage: PredictionMarkets Disputes (r:0 w:1) fn internal_resolve_categorical_reported() -> Weight { - Weight::from_ref_time(66_879_000) - .saturating_add(T::DbWeight::get().reads(5)) + Weight::from_ref_time(145_420_000) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: MarketCommons Markets (r:1 w:1) @@ -334,23 +328,18 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) - // Storage: MarketCommons Markets (r:1 w:1) - // Storage: GlobalDisputes Winners (r:1 w:0) - // Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) - // Storage: System Account (r:1 w:1) fn internal_resolve_categorical_disputed() -> Weight { - Weight::from_ref_time(72_294_000) - // Standard Error: 27_000 - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + Weight::from_ref_time(191_701_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) - // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) + // Storage: PredictionMarkets Disputes (r:0 w:1) fn internal_resolve_scalar_reported() -> Weight { - Weight::from_ref_time(30_320_000) - .saturating_add(T::DbWeight::get().reads(4)) + Weight::from_ref_time(88_350_000) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) @@ -359,11 +348,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: System Account (r:1 w:1) + // Storage: MarketCommons MarketPool (r:1 w:0) fn internal_resolve_scalar_disputed() -> Weight { - Weight::from_ref_time(36_011_000) - // Standard Error: 27_000 - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) + Weight::from_ref_time(133_121_000) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) @@ -375,15 +364,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn on_initialize_resolve_overhead() -> Weight { - Weight::from_ref_time(13_886_000) + Weight::from_ref_time(38_470_000) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_raw(a: u32) -> Weight { - Weight::from_ref_time(3_180_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(95_000).saturating_mul(a.into())) + Weight::from_ref_time(8_741_000) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(268_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -392,7 +381,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn redeem_shares_categorical() -> Weight { - Weight::from_ref_time(54_667_000) + Weight::from_ref_time(118_191_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -401,7 +390,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn redeem_shares_scalar() -> Weight { - Weight::from_ref_time(57_736_000) + Weight::from_ref_time(149_560_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -410,14 +399,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) - fn reject_market(c: u32, o: u32, r: u32) -> Weight { - Weight::from_ref_time(38_253_000) + fn reject_market(c: u32, _o: u32, r: u32) -> Weight { + Weight::from_ref_time(126_400_000) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(1_000).saturating_mul(c.into())) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(18_000).saturating_mul(c.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(13_000).saturating_mul(o.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(r.into())) + .saturating_add(Weight::from_ref_time(2_000).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -425,8 +412,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) fn report(_m: u32) -> Weight { - Weight::from_ref_time(22_398_000) - // Standard Error: 0 + Weight::from_ref_time(58_983_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -435,9 +421,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn sell_complete_set(a: u32) -> Weight { - Weight::from_ref_time(35_149_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(10_429_000).saturating_mul(a.into())) + Weight::from_ref_time(54_681_000) + // Standard Error: 40_000 + .saturating_add(Weight::from_ref_time(27_784_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -450,9 +436,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn start_subsidy(a: u32) -> Weight { - Weight::from_ref_time(22_465_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(42_000).saturating_mul(a.into())) + Weight::from_ref_time(56_316_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(110_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -460,11 +446,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) fn market_status_manager(b: u32, f: u32) -> Weight { - Weight::from_ref_time(25_231_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_413_000).saturating_mul(b.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_399_000).saturating_mul(f.into())) + Weight::from_ref_time(59_397_000) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(3_327_000).saturating_mul(b.into())) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(3_297_000).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) @@ -474,11 +460,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn market_resolution_manager(r: u32, d: u32) -> Weight { - Weight::from_ref_time(24_246_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_414_000).saturating_mul(r.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_445_000).saturating_mul(d.into())) + Weight::from_ref_time(62_079_000) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(3_374_000).saturating_mul(r.into())) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(3_206_000).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) @@ -486,7 +472,7 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_dummy() -> Weight { - Weight::from_ref_time(3_049_000) + Weight::from_ref_time(7_620_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/styx/src/weights.rs b/zrml/styx/src/weights.rs index 851a186ab..ec465bab8 100644 --- a/zrml/styx/src/weights.rs +++ b/zrml/styx/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_styx //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -55,12 +55,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Styx Crossings (r:1 w:1) // Storage: Styx BurnAmount (r:1 w:0) fn cross() -> Weight { - Weight::from_ref_time(22_513_000) + Weight::from_ref_time(54_610_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Styx BurnAmount (r:0 w:1) fn set_burn_amount() -> Weight { - Weight::from_ref_time(8_613_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(22_410_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index df697b258..db45bbe7f 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for zrml_swaps //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-12-23, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -80,9 +80,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_categorical(a: u32) -> Weight { - Weight::from_ref_time(25_333_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(294_000).saturating_mul(a.into())) + Weight::from_ref_time(58_086_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(583_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -90,7 +90,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_scalar() -> Weight { - Weight::from_ref_time(22_333_000) + Weight::from_ref_time(58_390_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -101,8 +101,8 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:64 w:64) fn apply_to_cached_pools_execute_arbitrage(a: u32) -> Weight { Weight::from_ref_time(0) - // Standard Error: 105_000 - .saturating_add(Weight::from_ref_time(933_426_000).saturating_mul(a.into())) + // Standard Error: 803_000 + .saturating_add(Weight::from_ref_time(2_356_167_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(43)) .saturating_add(T::DbWeight::get().reads((70_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(42)) @@ -110,9 +110,9 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: Swaps PoolsCachedForArbitrage (r:8 w:7) fn apply_to_cached_pools_noop(a: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(3_438_000).saturating_mul(a.into())) + Weight::from_ref_time(6_148_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(8_898_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) @@ -122,28 +122,28 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn destroy_pool_in_subsidy_phase(a: u32) -> Weight { - Weight::from_ref_time(20_186_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(9_439_000).saturating_mul(a.into())) + Weight::from_ref_time(47_422_000) + // Standard Error: 40_000 + .saturating_add(Weight::from_ref_time(21_468_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Tokens TotalIssuance (r:2 w:1) - // Storage: Tokens Accounts (r:46 w:22) - // Storage: System Account (r:2 w:1) + // Storage: Tokens Accounts (r:46 w:21) + // Storage: System Account (r:11 w:10) fn distribute_pool_share_rewards(a: u32, b: u32) -> Weight { - Weight::from_ref_time(25_316_000) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(10_887_000).saturating_mul(a.into())) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(16_348_000).saturating_mul(b.into())) + Weight::from_ref_time(55_071_000) + // Standard Error: 180_000 + .saturating_add(Weight::from_ref_time(28_979_000).saturating_mul(a.into())) + // Standard Error: 180_000 + .saturating_add(Weight::from_ref_time(40_233_000).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) } // Storage: Swaps Pools (r:1 w:1) // Storage: Swaps SubsidyProviders (r:11 w:10) @@ -153,10 +153,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:0) fn end_subsidy_phase(a: u32, b: u32) -> Weight { Weight::from_ref_time(0) - // Standard Error: 68_000 - .saturating_add(Weight::from_ref_time(10_591_000).saturating_mul(a.into())) - // Standard Error: 418_000 - .saturating_add(Weight::from_ref_time(50_291_000).saturating_mul(b.into())) + // Standard Error: 168_000 + .saturating_add(Weight::from_ref_time(26_503_000).saturating_mul(a.into())) + // Standard Error: 1_034_000 + .saturating_add(Weight::from_ref_time(126_477_000).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().reads((9_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) @@ -167,9 +167,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_buy_burn(a: u32) -> Weight { - Weight::from_ref_time(31_946_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(15_353_000).saturating_mul(a.into())) + Weight::from_ref_time(61_994_000) + // Standard Error: 34_000 + .saturating_add(Weight::from_ref_time(36_370_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) @@ -179,9 +179,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:2 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_mint_sell(a: u32) -> Weight { - Weight::from_ref_time(35_968_000) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(14_347_000).saturating_mul(a.into())) + Weight::from_ref_time(80_675_000) + // Standard Error: 31_000 + .saturating_add(Weight::from_ref_time(33_433_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -190,9 +190,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:2 w:0) fn execute_arbitrage_skipped(a: u32) -> Weight { - Weight::from_ref_time(14_082_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_260_000).saturating_mul(a.into())) + Weight::from_ref_time(29_826_000) + // Standard Error: 13_000 + .saturating_add(Weight::from_ref_time(5_199_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) } @@ -201,9 +201,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:5 w:5) // Storage: System Account (r:1 w:0) fn pool_exit(a: u32) -> Weight { - Weight::from_ref_time(36_569_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(11_401_000).saturating_mul(a.into())) + Weight::from_ref_time(64_421_000) + // Standard Error: 34_000 + .saturating_add(Weight::from_ref_time(27_430_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -213,7 +213,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps SubsidyProviders (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn pool_exit_subsidy() -> Weight { - Weight::from_ref_time(37_487_000) + Weight::from_ref_time(77_761_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -223,7 +223,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_asset_amount() -> Weight { - Weight::from_ref_time(69_403_000) + Weight::from_ref_time(142_560_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -233,7 +233,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_pool_amount() -> Weight { - Weight::from_ref_time(69_695_000) + Weight::from_ref_time(143_190_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -241,9 +241,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:5 w:5) fn pool_join(a: u32) -> Weight { - Weight::from_ref_time(32_481_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(10_527_000).saturating_mul(a.into())) + Weight::from_ref_time(74_055_000) + // Standard Error: 32_000 + .saturating_add(Weight::from_ref_time(26_488_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -253,7 +253,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:1 w:1) // Storage: Swaps SubsidyProviders (r:1 w:1) fn pool_join_subsidy() -> Weight { - Weight::from_ref_time(37_677_000) + Weight::from_ref_time(78_671_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -262,7 +262,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_asset_amount() -> Weight { - Weight::from_ref_time(62_027_000) + Weight::from_ref_time(128_600_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -271,15 +271,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_pool_amount() -> Weight { - Weight::from_ref_time(62_390_000) + Weight::from_ref_time(132_720_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn clean_up_pool_categorical_without_reward_distribution(a: u32) -> Weight { - Weight::from_ref_time(5_716_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(182_000).saturating_mul(a.into())) + Weight::from_ref_time(16_673_000) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(325_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -288,7 +288,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_in_cpmm() -> Weight { - Weight::from_ref_time(81_560_000) + Weight::from_ref_time(170_520_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -299,9 +299,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_in_rikiddo(a: u32) -> Weight { - Weight::from_ref_time(68_347_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(7_471_000).saturating_mul(a.into())) + Weight::from_ref_time(159_946_000) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(19_270_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -311,7 +311,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_out_cpmm() -> Weight { - Weight::from_ref_time(81_909_000) + Weight::from_ref_time(169_581_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -321,39 +321,40 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_out_rikiddo(a: u32) -> Weight { - Weight::from_ref_time(51_173_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(13_039_000).saturating_mul(a.into())) + Weight::from_ref_time(101_410_000) + // Standard Error: 42_000 + .saturating_add(Weight::from_ref_time(35_542_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn open_pool(a: u32) -> Weight { - Weight::from_ref_time(12_594_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(261_000).saturating_mul(a.into())) + Weight::from_ref_time(28_613_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(559_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:1) fn close_pool(a: u32) -> Weight { - Weight::from_ref_time(11_446_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(210_000).saturating_mul(a.into())) + Weight::from_ref_time(31_634_000) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(366_000).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:1) // Storage: Tokens Accounts (r:2 w:2) + // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn destroy_pool(a: u32) -> Weight { - Weight::from_ref_time(15_607_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(10_020_000).saturating_mul(a.into())) - .saturating_add(T::DbWeight::get().reads(1)) + Weight::from_ref_time(38_770_000) + // Standard Error: 30_000 + .saturating_add(Weight::from_ref_time(26_154_000).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } } From fc6265b065f33c73ad3bdd31ef7622e7b61acef6 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 23 Jan 2023 13:08:22 +0100 Subject: [PATCH 10/53] Use tag when publishing a parachain docker image (#951) --- .github/workflows/docker-hub-parachain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub-parachain.yml b/.github/workflows/docker-hub-parachain.yml index 55a6d55a8..75763740d 100644 --- a/.github/workflows/docker-hub-parachain.yml +++ b/.github/workflows/docker-hub-parachain.yml @@ -23,7 +23,7 @@ jobs: images: | zeitgeistpm/zeitgeist-node-parachain tags: | - type=sha + type=semver,pattern={{version}} - name: Set up QEMU uses: docker/setup-qemu-action@v1 From 3f4e65aec73bda38eb83672eafd80e0535b166ef Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Tue, 24 Jan 2023 13:51:59 +0100 Subject: [PATCH 11/53] Add CodeCov and Discord badges (#950) --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 02e898b39..b31e630fb 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,7 @@ # Zeitgeist: An Evolving Blockchain for Prediction Markets and Futarchy -![Rust](https://github.com/zeitgeistpm/zeitgeist/workflows/Rust/badge.svg) - - - - +![Rust](https://github.com/zeitgeistpm/zeitgeist/workflows/Rust/badge.svg) [![Codecov](https://codecov.io/gh/zeitgeistpm/zeitgeist/branch/main/graph/badge.svg)](https://codecov.io/gh/zeitgeistpm/zeitgeist) [![Discord](https://img.shields.io/badge/discord-https%3A%2F%2Fdiscord.gg%2FMD3TbH3ctv-purple)](https://discord.gg/MD3TbH3ctv) [![Telegram](https://img.shields.io/badge/telegram-https%3A%2F%2Ft.me%2Fzeitgeist__official-blue)](https://t.me/zeitgeist_official) Zeitgeist is a decentralized network for creating, betting on, and resolving prediction markets. The platform's native currency, the ZTG, is used to sway the From 0e6475ea8cd0564a219be9655051edbc6c991ece Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Tue, 24 Jan 2023 14:46:42 +0100 Subject: [PATCH 12/53] Fix order of arguments in `get_spot_price` (#937) Fix order of arguments --- zrml/swaps/rpc/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zrml/swaps/rpc/src/lib.rs b/zrml/swaps/rpc/src/lib.rs index 5d8accf7e..7d62e1da9 100644 --- a/zrml/swaps/rpc/src/lib.rs +++ b/zrml/swaps/rpc/src/lib.rs @@ -61,8 +61,8 @@ where pool_id: PoolId, asset_in: Asset, asset_out: Asset, - at: Option, with_fees: bool, + at: Option, ) -> RpcResult>; #[method(name = "swaps_getSpotPrices")] @@ -71,8 +71,8 @@ where pool_id: PoolId, asset_in: Asset, asset_out: Asset, - blocks: Vec, with_fees: bool, + blocks: Vec, ) -> RpcResult>>; } @@ -162,8 +162,8 @@ where pool_id: PoolId, asset_in: Asset, asset_out: Asset, - at: Option<::Hash>, with_fees: bool, + at: Option<::Hash>, ) -> RpcResult> { let api = self.client.runtime_api(); let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash)); @@ -183,8 +183,8 @@ where pool_id: PoolId, asset_in: Asset, asset_out: Asset, - blocks: Vec>, with_fees: bool, + blocks: Vec>, ) -> RpcResult>> { let api = self.client.runtime_api(); blocks From a3894f41181318380f92fd8782c39900690e5985 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Tue, 24 Jan 2023 20:48:17 +0530 Subject: [PATCH 13/53] Basic tag.yml script (#931) * Basic tag.yml script * Use make try-runtime command * Test try-runtime on zeitgeist and match v.X.Y.Z tag * Changes as pre reviews * Changes as per reviews --- .github/workflows/rust.yml | 2 +- .github/workflows/tag.yml | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tag.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e109cd60a..d60f58d27 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -52,7 +52,7 @@ jobs: run: rustup show - name: Cache Dependencies - uses: Swatinem/rust-cache@v1 + uses: Swatinem/rust-cache@v2 - name: Checks run: ./scripts/tests/${{ matrix.scripts }}.sh diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 000000000..49b2fe453 --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,42 @@ +name: Try Runtime on New Tags + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + try_runtime_battery_station: + name: Test Try Runtime + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file + # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due + # to the lack of support of `rust-toolchain` files with TOML syntax: + # https://github.com/actions-rs/toolchain/issues/126. + - name: Install rust toolchain + run: rustup show + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - run: make try-runtime-upgrade-battery-station + try_runtime_zeitgeist: + name: Test Try Runtime + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file + # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due + # to the lack of support of `rust-toolchain` files with TOML syntax: + # https://github.com/actions-rs/toolchain/issues/126. + - name: Install rust toolchain + run: rustup show + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - run: make try-runtime-upgrade-zeitgeist From f5c0766cf3d909c6ff3f3a403acf9c79db98e487 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 25 Jan 2023 13:31:56 +0100 Subject: [PATCH 14/53] Use crystal ball logo in logs (#952) --- node/src/service/service_parachain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/src/service/service_parachain.rs b/node/src/service/service_parachain.rs index 56f44a993..34f298897 100644 --- a/node/src/service/service_parachain.rs +++ b/node/src/service/service_parachain.rs @@ -234,7 +234,7 @@ where /// Start a node with the given parachain `Configuration` and relay chain `Configuration`. /// /// This is the actual implementation that is abstract over the executor and the runtime api. -#[sc_tracing::logging::prefix_logs_with("🌔 Zeitgeist Parachain")] +#[sc_tracing::logging::prefix_logs_with("🔮 Zeitgeist Parachain")] async fn do_new_full( parachain_config: Configuration, polkadot_config: Configuration, From 06ac6a12ef60784699ffcf7a8ea5dadc652de4db Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Wed, 25 Jan 2023 18:44:52 +0530 Subject: [PATCH 15/53] Remove crowdloan_rewards pallet (#958) --- Cargo.lock | 125 +++++++++--------- node/src/chain_spec/additional_chain_spec.rs | 1 - node/src/chain_spec/battery_station.rs | 2 - node/src/chain_spec/dev.rs | 1 - node/src/chain_spec/mod.rs | 2 - node/src/chain_spec/zeitgeist.rs | 2 - primitives/src/constants/ztg.rs | 3 - runtime/battery-station/Cargo.toml | 5 - runtime/battery-station/src/lib.rs | 1 - .../battery-station/src/parachain_params.rs | 8 -- runtime/common/src/lib.rs | 24 ---- runtime/common/src/weights/mod.rs | 2 - runtime/zeitgeist/Cargo.toml | 5 - runtime/zeitgeist/src/lib.rs | 1 - runtime/zeitgeist/src/parachain_params.rs | 8 -- scripts/benchmarks/configuration.sh | 4 +- 16 files changed, 64 insertions(+), 130 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0e78e4f6..71f249cbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.27.0", + "gimli 0.27.1", ] [[package]] @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0224938f92e7aef515fac2ff2d18bd1115c1394ddf4a092e0c87e8be9499ee5" +checksum = "3e90af4de65aa7b293ef2d09daff88501eb254f58edde2e1ac02c82d873eadad" dependencies = [ "derive_arbitrary", ] @@ -327,9 +327,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.62" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689894c2db1ea643a50834b999abf1c110887402542955ff5451dab8f861f9ed" +checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1" dependencies = [ "proc-macro2", "quote", @@ -397,7 +397,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.30.2", + "object 0.30.3", "rustc-demangle", ] @@ -470,7 +470,6 @@ dependencies = [ "pallet-balances", "pallet-bounties", "pallet-collective", - "pallet-crowdloan-rewards", "pallet-democracy", "pallet-grandpa", "pallet-identity", @@ -1999,9 +1998,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf460bbff5f571bfc762da5102729f59f338be7db17a21fade44c5c4f5005350" +checksum = "8beee4701e2e229e8098bbdecdca12449bc3e322f137d269182fa1291e20bd00" dependencies = [ "proc-macro2", "quote", @@ -3014,9 +3013,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" [[package]] name = "glob" @@ -3039,9 +3038,9 @@ dependencies = [ [[package]] name = "gloo-timers" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c4a8d6391675c6b2ee1a6c8d06e8e2d03605c44cec1270675985a4c2a5500b" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" dependencies = [ "futures-channel", "futures-core", @@ -4639,9 +4638,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" @@ -4972,9 +4971,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" +checksum = "260e21fbb6f3d253a14df90eb0000a6066780a15dd901a7519ce02d77a94985b" dependencies = [ "async-io", "bytes", @@ -5065,6 +5064,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + [[package]] name = "num-bigint" version = "0.2.6" @@ -5162,9 +5170,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.2" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] @@ -5665,28 +5673,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-crowdloan-rewards" -version = "0.6.0" -source = "git+https://github.com/zeitgeistpm/crowdloan-rewards?branch=moonbeam-polkadot-v0.9.29#d2c6eb95def2208af2497bbe7e0459b74586762d" -dependencies = [ - "ed25519-dalek", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-balances", - "pallet-utility", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-trie", -] - [[package]] name = "pallet-democracy" version = "4.0.0-dev" @@ -6562,9 +6548,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4257b4a04d91f7e9e6290be5d3da4804dd5784fafde3a497d73eb2b4a158c30a" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" dependencies = [ "thiserror", "ucd-trie", @@ -6572,9 +6558,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241cda393b0cdd65e62e07e12454f1f25d57017dcc514b1514cd3c4645e3a0a6" +checksum = "8bf026e2d0581559db66d837fe5242320f525d85c76283c61f4d51a1238d65ea" dependencies = [ "pest", "pest_generator", @@ -6582,9 +6568,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46b53634d8c8196302953c74d5352f33d0c512a9499bd2ce468fc9f4128fa27c" +checksum = "2b27bd18aa01d91c8ed2b61ea23406a676b42d82609c6e2581fba42f0c15f17f" dependencies = [ "pest", "pest_meta", @@ -6595,9 +6581,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef4f1332a8d4678b41966bb4cc1d0676880e84183a1ecc3f4b69f03e99c7a51" +checksum = "9f02b677c1859756359fc9983c2e56a0237f18624a3789528804406b7e915e5d" dependencies = [ "once_cell", "pest", @@ -7982,13 +7968,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" dependencies = [ "once_cell", - "thiserror", - "toml", + "toml_edit", ] [[package]] @@ -8288,9 +8273,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -9914,9 +9899,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.0" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645926f31b250a2dca3c232496c2d898d91036e45ca0e97e0e2390c54e11be36" +checksum = "7c4437699b6d34972de58652c68b98cb5b53a4199ab126db8e20ec8ded29a721" dependencies = [ "bitflags", "core-foundation", @@ -10960,9 +10945,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d44528162f980c0e03c71e005d334332c8da0aec9f2b0b4bdc557ed4a9f24776" +checksum = "e40c020d72bc0a9c5660bb71e4a6fdef081493583062c474740a7d59f55f0e7b" dependencies = [ "Inflector", "num-format", @@ -11496,6 +11481,23 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" + +[[package]] +name = "toml_edit" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729bfd096e40da9c001f778f5cdecbd2957929a24e10e5883d9392220a751581" +dependencies = [ + "indexmap", + "nom8", + "toml_datetime", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -11771,9 +11773,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046be40136ef78dc325e0edefccf84ccddacd0afcc1ca54103fa3c61bbdab1d" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" @@ -12784,7 +12786,6 @@ dependencies = [ "pallet-balances", "pallet-bounties", "pallet-collective", - "pallet-crowdloan-rewards", "pallet-democracy", "pallet-grandpa", "pallet-identity", diff --git a/node/src/chain_spec/additional_chain_spec.rs b/node/src/chain_spec/additional_chain_spec.rs index de4c9e73b..43fb925fd 100644 --- a/node/src/chain_spec/additional_chain_spec.rs +++ b/node/src/chain_spec/additional_chain_spec.rs @@ -29,7 +29,6 @@ pub struct AdditionalChainSpec { pub blocks_per_round: u32, pub candidates: Vec<(AccountId, NimbusId, Balance)>, pub collator_commission: Perbill, - pub crowdloan_fund_pot: Balance, pub inflation_info: InflationInfo, pub nominations: Vec<(AccountId, AccountId, Balance, Percent)>, pub parachain_bond_reserve_percent: Percent, diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index 4a56c2df9..70c4d8849 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -46,7 +46,6 @@ cfg_if::cfg_if! { pub(super) const DEFAULT_STAKING_AMOUNT_BATTERY_STATION: u128 = 2_000 * BASE; const DEFAULT_COLLATOR_BALANCE_BATTERY_STATION: Option = DEFAULT_STAKING_AMOUNT_BATTERY_STATION.checked_add(CollatorDeposit::get()); - const DEFAULT_INITIAL_CROWDLOAN_FUNDS_BATTERY_STATION: u128 = 100 * BASE; pub type BatteryStationChainSpec = sc_service::GenericChainSpec; } else { pub type BatteryStationChainSpec = sc_service::GenericChainSpec; @@ -68,7 +67,6 @@ fn additional_chain_spec_staging_battery_station( DEFAULT_STAKING_AMOUNT_BATTERY_STATION, )], collator_commission: DefaultCollatorCommission::get(), - crowdloan_fund_pot: DEFAULT_INITIAL_CROWDLOAN_FUNDS_BATTERY_STATION, inflation_info: DEFAULT_COLLATOR_INFLATION_INFO, nominations: vec![], parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index 51f461de0..ef098cc10 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -75,7 +75,6 @@ pub fn dev_config() -> Result { super::battery_station::DEFAULT_STAKING_AMOUNT_BATTERY_STATION, )], collator_commission: DefaultCollatorCommission::get(), - crowdloan_fund_pot: zeitgeist_primitives::constants::BASE.saturating_mul(100), inflation_info: crate::chain_spec::DEFAULT_COLLATOR_INFLATION_INFO, nominations: vec![], parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 58340be30..ca10085c6 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -135,8 +135,6 @@ macro_rules! generate_generic_genesis_function { members: vec![].try_into().unwrap(), phantom: Default::default(), }, - #[cfg(feature = "parachain")] - crowdloan: $runtime::CrowdloanConfig { funded_amount: acs.crowdloan_fund_pot }, democracy: Default::default(), #[cfg(not(feature = "parachain"))] grandpa: $runtime::GrandpaConfig { diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index b5990c7bd..cdae6e7cc 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -41,7 +41,6 @@ cfg_if::cfg_if! { const DEFAULT_STAKING_AMOUNT_ZEITGEIST: u128 = MinCollatorStk::get(); const DEFAULT_COLLATOR_BALANCE_ZEITGEIST: Option = DEFAULT_STAKING_AMOUNT_ZEITGEIST.checked_add(CollatorDeposit::get()); - const DEFAULT_INITIAL_CROWDLOAN_FUNDS_ZEITGEIST: u128 = 0; pub type ZeitgeistChainSpec = sc_service::GenericChainSpec; } else { pub type ZeitgeistChainSpec = sc_service::GenericChainSpec; @@ -98,7 +97,6 @@ fn additional_chain_spec_staging_zeitgeist( ), ], collator_commission: DefaultCollatorCommission::get(), - crowdloan_fund_pot: DEFAULT_INITIAL_CROWDLOAN_FUNDS_ZEITGEIST, inflation_info: DEFAULT_COLLATOR_INFLATION_INFO, nominations: vec![], parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), diff --git a/primitives/src/constants/ztg.rs b/primitives/src/constants/ztg.rs index 849e07add..0d48f629c 100644 --- a/primitives/src/constants/ztg.rs +++ b/primitives/src/constants/ztg.rs @@ -48,9 +48,6 @@ pub const ZEITGEIST_FOUNDATION: u128 = 22_000_000; // Inflation -/// Perthousand crowdloan inflation. 1.5% -pub const CROWDLOAN_PTD: Perbill = Perbill::from_perthousand(15); - /// Perthousand liquidity mining inflation. 2% pub const LIQUIDITY_MINING_PTD: Perbill = Perbill::from_perthousand(20); diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 37b68619a..5748d0ff0 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -68,7 +68,6 @@ nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = f pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/crowdloan-rewards", optional = true } pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } @@ -143,7 +142,6 @@ parachain = [ "pallet-author-inherent", "pallet-author-mapping", "pallet-author-slot-filter", - "pallet-crowdloan-rewards", "pallet-parachain-staking", "polkadot-parachain", "session-keys-primitives", @@ -186,7 +184,6 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-bounties/runtime-benchmarks", "pallet-collective/runtime-benchmarks", - "pallet-crowdloan-rewards?/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-identity/runtime-benchmarks", @@ -281,7 +278,6 @@ std = [ "pallet-author-inherent?/std", "pallet-author-mapping?/std", "pallet-author-slot-filter?/std", - "pallet-crowdloan-rewards?/std", "pallet-parachain-staking?/std", "session-keys-primitives?/std", @@ -388,7 +384,6 @@ try-runtime = [ "pallet-aura/try-runtime", "pallet-sudo/try-runtime", "pallet-xcm?/try-runtime", - "pallet-crowdloan-rewards?/try-runtime", # Cumulus "cumulus-pallet-parachain-system?/try-runtime", diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index f117fc81b..9e169c9e7 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -55,7 +55,6 @@ use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV}; #[cfg(feature = "parachain")] use { frame_support::traits::{AsEnsureOriginWithArg, Everything, Nothing}, - frame_system::EnsureSigned, xcm_builder::{EnsureXcmOrigin, FixedWeightBounds, LocationInverter}, xcm_config::{ asset_registry::CustomAssetProcessor, diff --git a/runtime/battery-station/src/parachain_params.rs b/runtime/battery-station/src/parachain_params.rs index 6f9546de1..64b45a2fd 100644 --- a/runtime/battery-station/src/parachain_params.rs +++ b/runtime/battery-station/src/parachain_params.rs @@ -37,14 +37,6 @@ parameter_types! { /// The amount that should be taken as a security deposit when registering a NimbusId. pub const CollatorDeposit: Balance = 2 * BASE; - // Crowdloan - pub const InitializationPayment: Perbill = Perbill::from_percent(30); - pub const Initialized: bool = false; - pub const MaxInitContributorsBatchSizes: u32 = 500; - pub const MinimumReward: Balance = 0; - pub const RelaySignaturesThreshold: Perbill = Perbill::from_percent(100); - pub const SignatureNetworkIdentifier: &'static [u8] = b"zeitgeist-"; - // Cumulus and Polkadot pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayLocation: MultiLocation = MultiLocation::parent(); diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 15e4efdb1..a54e4df60 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -341,9 +341,6 @@ macro_rules! create_runtime_with_additional_pallets { UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 125, XTokens: orml_xtokens::{Pallet, Storage, Call, Event} = 126, - // Third-party - Crowdloan: pallet_crowdloan_rewards::{Call, Config, Event, Pallet, Storage} = 130, - // Others $($additional_pallets)* ); @@ -595,25 +592,6 @@ macro_rules! impl_config_traits { type XcmExecutor = xcm_executor::XcmExecutor; } - #[cfg(feature = "parachain")] - impl pallet_crowdloan_rewards::Config for Runtime { - type Event = Event; - type InitializationPayment = InitializationPayment; - type Initialized = Initialized; - type MaxInitContributors = MaxInitContributorsBatchSizes; - type MinimumReward = MinimumReward; - type RelayChainAccountId = AccountId; - type RewardCurrency = Balances; - type RewardAddressAssociateOrigin = EnsureSigned; - type RewardAddressChangeOrigin = frame_system::EnsureSigned; - type RewardAddressRelayVoteThreshold = RelaySignaturesThreshold; - type SignatureNetworkIdentifier = SignatureNetworkIdentifier; - type VestingBlockNumber = cumulus_primitives_core::relay_chain::BlockNumber; - type VestingBlockProvider = - cumulus_pallet_parachain_system::RelaychainBlockNumberProvider; - type WeightInfo = pallet_crowdloan_rewards::weights::SubstrateWeight; - } - impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; @@ -1243,7 +1221,6 @@ macro_rules! create_runtime_api { list_benchmark!(list, extra, pallet_author_mapping, AuthorMapping); list_benchmark!(list, extra, pallet_author_slot_filter, AuthorFilter); list_benchmark!(list, extra, pallet_parachain_staking, ParachainStaking); - list_benchmark!(list, extra, pallet_crowdloan_rewards, Crowdloan); } else { list_benchmark!(list, extra, pallet_grandpa, Grandpa); } @@ -1323,7 +1300,6 @@ macro_rules! create_runtime_api { add_benchmark!(params, batches, pallet_author_mapping, AuthorMapping); add_benchmark!(params, batches, pallet_author_slot_filter, AuthorFilter); add_benchmark!(params, batches, pallet_parachain_staking, ParachainStaking); - add_benchmark!(params, batches, pallet_crowdloan_rewards, Crowdloan); } else { add_benchmark!(params, batches, pallet_grandpa, Grandpa); diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index 3d0fbcf4e..2a7825912 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -22,8 +22,6 @@ cfg_if::cfg_if! { pub mod pallet_author_mapping; pub mod pallet_author_slot_filter; pub mod pallet_parachain_staking; - // Currently the benchmark does fail at the verification of least one function - // pub mod pallet_crowdloan_rewards; } else { // Currently the benchmark does yield an invalid weight implementation // pub mod pallet_grandpa; diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index 5ae8d91e0..fd63175bf 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -66,7 +66,6 @@ nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = f pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-crowdloan-rewards = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/crowdloan-rewards", optional = true } pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } @@ -141,7 +140,6 @@ parachain = [ "pallet-author-inherent", "pallet-author-mapping", "pallet-author-slot-filter", - "pallet-crowdloan-rewards", "pallet-parachain-staking", "polkadot-parachain", "session-keys-primitives", @@ -184,7 +182,6 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-bounties/runtime-benchmarks", "pallet-collective/runtime-benchmarks", - "pallet-crowdloan-rewards?/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-identity/runtime-benchmarks", @@ -277,7 +274,6 @@ std = [ "pallet-author-inherent?/std", "pallet-author-mapping?/std", "pallet-author-slot-filter?/std", - "pallet-crowdloan-rewards?/std", "pallet-parachain-staking?/std", "session-keys-primitives?/std", @@ -378,7 +374,6 @@ try-runtime = [ "pallet-grandpa/try-runtime", "pallet-aura/try-runtime", "pallet-xcm/try-runtime", - "pallet-crowdloan-rewards/try-runtime", # Cumulus "cumulus-pallet-dmp-queue?/try-runtime", diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index def87361b..f8759964a 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -55,7 +55,6 @@ use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV}; #[cfg(feature = "parachain")] use { frame_support::traits::{AsEnsureOriginWithArg, Everything, Nothing}, - frame_system::EnsureSigned, xcm_builder::{EnsureXcmOrigin, FixedWeightBounds, LocationInverter}, xcm_config::{ asset_registry::CustomAssetProcessor, diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index aff4b9e42..7cfd9097c 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -37,14 +37,6 @@ parameter_types! { /// The amount that should be taken as a security deposit when registering a NimbusId. pub const CollatorDeposit: Balance = 2 * BASE; - // Crowdloan - pub const InitializationPayment: Perbill = Perbill::from_percent(30); - pub const Initialized: bool = false; - pub const MaxInitContributorsBatchSizes: u32 = 500; - pub const MinimumReward: Balance = 0; - pub const RelaySignaturesThreshold: Perbill = Perbill::from_percent(100); - pub const SignatureNetworkIdentifier: &'static [u8] = b"zeitgeist-"; - // Cumulus and Polkadot pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayLocation: MultiLocation = MultiLocation::parent(); diff --git a/scripts/benchmarks/configuration.sh b/scripts/benchmarks/configuration.sh index 03a203dac..e0e49becb 100644 --- a/scripts/benchmarks/configuration.sh +++ b/scripts/benchmarks/configuration.sh @@ -12,14 +12,12 @@ export FRAME_PALLETS_STEPS="${FRAME_PALLETS_STEPS:-50}" export FRAME_WEIGHT_TEMPLATE="./misc/frame_weight_template.hbs" -# pallet_crowdloan_rewards benchmark lead to an error within the verify function (deprecated) export FRAME_PALLETS_PARACHAIN=( cumulus_pallet_xcmp_queue \ pallet_author_inherent \ pallet_author_slot_filter \ pallet_author_mapping \ pallet_parachain_staking \ - # pallet_crowdloan_rewards \ ) export FRAME_PALLETS_PARACHAIN_RUNS="${FRAME_PALLETS_PARACHAIN_RUNS:-$FRAME_PALLETS_RUNS}" export FRAME_PALLETS_PARACHAIN_STEPS="${FRAME_PALLETS_PARACHAIN_STEPS:-$FRAME_PALLETS_STEPS}" @@ -43,4 +41,4 @@ else fi export EXECUTION="${EXECUTION:-wasm}" export ADDITIONAL="${ADDITIONAL:-}" -export ADDITIONAL_FEATURES="${ADDITIONAL_FEATURES:-with-global-disputes}" \ No newline at end of file +export ADDITIONAL_FEATURES="${ADDITIONAL_FEATURES:-with-global-disputes}" From 4c7817e111e97c70536d9cf76e9ae802eb07610f Mon Sep 17 00:00:00 2001 From: Chralt Date: Thu, 26 Jan 2023 08:48:27 +0100 Subject: [PATCH 16/53] [PM] Set market end when admin closes the market (#943) * set market end when admin closes * add test for period end change * fmt * Update zrml/prediction-markets/src/lib.rs Co-authored-by: Malte Kliemann * empty commit for CI workflow * add test for timestamp period Co-authored-by: Malte Kliemann --- zrml/prediction-markets/src/lib.rs | 18 +++++++++ zrml/prediction-markets/src/tests.rs | 55 ++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 356bd0b05..07acabe04 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -344,6 +344,7 @@ mod pallet { let open_ids_len = Self::clear_auto_open(&market_id)?; let close_ids_len = Self::clear_auto_close(&market_id)?; Self::close_market(&market_id)?; + Self::set_market_end(&market_id)?; // The CloseOrigin should not pay fees for providing this service Ok(( Some(T::WeightInfo::admin_move_market_to_closed(open_ids_len, close_ids_len)), @@ -2346,6 +2347,23 @@ mod pallet { Ok(total_weight) } + pub(crate) fn set_market_end(market_id: &MarketIdOf) -> Result { + >::mutate_market(market_id, |market| { + market.period = match market.period { + MarketPeriod::Block(ref range) => { + let current_block = >::block_number(); + MarketPeriod::Block(range.start..current_block) + } + MarketPeriod::Timestamp(ref range) => { + let now = >::now(); + MarketPeriod::Timestamp(range.start..now) + } + }; + Ok(()) + })?; + Ok(T::DbWeight::get().reads_writes(1, 1)) + } + /// Handle market state transitions at the end of its active phase. fn on_market_close( market_id: &MarketIdOf, diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index fe5d8da83..eb185e5fb 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -21,7 +21,7 @@ use crate::{ default_dispute_bond, mock::*, Config, Disputes, Error, Event, LastTimeFrame, MarketIdsForEdit, MarketIdsPerCloseBlock, MarketIdsPerDisputeBlock, MarketIdsPerOpenBlock, - MarketIdsPerReportBlock, + MarketIdsPerReportBlock, TimeFrame, }; use core::ops::{Range, RangeInclusive}; use frame_support::{ @@ -104,19 +104,66 @@ fn simple_create_scalar_market( } #[test] -fn admin_move_market_to_closed_successfully_closes_market() { +fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_blocknumber() { ExtBuilder::default().build().execute_with(|| { - frame_system::Pallet::::set_block_number(1); + run_blocks(7); + let now = frame_system::Pallet::::block_number(); + let end = 42; simple_create_categorical_market( Asset::Ztg, MarketCreation::Permissionless, - 0..2, + now..end, ScoringRule::CPMM, ); + run_blocks(3); + let market_id = 0; + assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id)); + let market = MarketCommons::market(&market_id).unwrap(); + assert_eq!(market.status, MarketStatus::Closed); + let new_end = now + 3; + assert_eq!(market.period, MarketPeriod::Block(now..new_end)); + assert_ne!(new_end, end); + System::assert_last_event(Event::MarketClosed(market_id).into()); + }); +} + +#[test] +fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_timestamp() { + ExtBuilder::default().build().execute_with(|| { + let start_block = 7; + set_timestamp_for_on_initialize(start_block * MILLISECS_PER_BLOCK as u64); + run_blocks(start_block); + let start = >::now(); + + let end = start + 42.saturated_into::() * MILLISECS_PER_BLOCK as u64; + assert_ok!(PredictionMarkets::create_market( + Origin::signed(ALICE), + Asset::Ztg, + BOB, + MarketPeriod::Timestamp(start..end), + get_deadlines(), + gen_metadata(2), + MarketCreation::Permissionless, + MarketType::Categorical(::MinCategories::get()), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM + )); let market_id = 0; + let market = MarketCommons::market(&market_id).unwrap(); + assert_eq!(market.period, MarketPeriod::Timestamp(start..end)); + + let shift_blocks = 3; + let shift = shift_blocks * MILLISECS_PER_BLOCK as u64; + // millisecs per block is substracted inside the function + set_timestamp_for_on_initialize(start + shift + MILLISECS_PER_BLOCK as u64); + run_blocks(shift_blocks); + assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id)); let market = MarketCommons::market(&market_id).unwrap(); assert_eq!(market.status, MarketStatus::Closed); + let new_end = start + shift; + assert_eq!(market.period, MarketPeriod::Timestamp(start..new_end)); + assert_ne!(new_end, end); System::assert_last_event(Event::MarketClosed(market_id).into()); }); } From 0fd31bf86cbb8135c0be78bb7870df029d279d57 Mon Sep 17 00:00:00 2001 From: Chralt Date: Mon, 30 Jan 2023 12:30:12 +0100 Subject: [PATCH 17/53] [PM] Reserve `OutsiderBond` for report, when the oracle fails to report (#903) * wip * update dependent types * reward the outsider with oracle bond * slash in admin_destroy_market * prepare storage migration * test new functionality * revert storage changes * add outsider bond to market storage * AddOutsiderBond migration, defensive outsider bond * use storage alias to avoid migration mistake * cargo fmt * log warning in impl_repatriate_bond * reconfigure outsider bond * Update zrml/prediction-markets/src/lib.rs Co-authored-by: Malte Kliemann * bump market commons version * Apply suggestions from code review Co-authored-by: Malte Kliemann * use macro for is_bond_pending * restructure resolve_reported_market * improve tests * improve sentinel reserve * fix after merge * cargo fmt * fix after merge * remove storage read write count * simplify assert for base asset * remove old migration * add macro fucntion doc comment * correct comment * cargo fmt * Update zrml/prediction-markets/src/lib.rs Co-authored-by: Malte Kliemann --------- Co-authored-by: Malte Kliemann --- Cargo.lock | 96 +-- primitives/src/constants/mock.rs | 1 + primitives/src/market.rs | 7 +- runtime/battery-station/src/parameters.rs | 3 + runtime/common/src/lib.rs | 12 +- runtime/zeitgeist/src/parameters.rs | 3 + zrml/court/src/tests.rs | 2 +- zrml/market-commons/src/lib.rs | 2 +- zrml/market-commons/src/tests.rs | 2 +- zrml/prediction-markets/src/lib.rs | 214 ++++++- zrml/prediction-markets/src/migrations.rs | 688 +++++----------------- zrml/prediction-markets/src/mock.rs | 6 +- zrml/prediction-markets/src/tests.rs | 288 +++++---- zrml/simple-disputes/src/tests.rs | 2 +- 14 files changed, 607 insertions(+), 719 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71f249cbe..0c068e0e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,11 +190,11 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ - "concurrent-queue", + "concurrent-queue 1.2.4", "event-listener", "futures-core", ] @@ -207,7 +207,7 @@ checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" dependencies = [ "async-lock", "async-task", - "concurrent-queue", + "concurrent-queue 2.1.0", "fastrand", "futures-lite", "slab", @@ -230,13 +230,13 @@ dependencies = [ [[package]] name = "async-io" -version = "1.12.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" dependencies = [ "async-lock", "autocfg", - "concurrent-queue", + "concurrent-queue 1.2.4", "futures-lite", "libc", "log", @@ -245,7 +245,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "windows-sys", + "winapi", ] [[package]] @@ -260,20 +260,20 @@ dependencies = [ [[package]] name = "async-process" -version = "1.6.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6381ead98388605d0d9ff86371043b5aa922a3905824244de40dc263a14fcba4" +checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" dependencies = [ "async-io", - "async-lock", "autocfg", "blocking", "cfg-if 1.0.0", "event-listener", "futures-lite", "libc", + "once_cell", "signal-hook", - "windows-sys", + "winapi", ] [[package]] @@ -711,9 +711,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.3.3" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" +checksum = "895adc16c8b3273fbbc32685a7d55227705eda08c01e77704020f3491924b44b" dependencies = [ "arrayref", "arrayvec 0.7.2", @@ -764,16 +764,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" +checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" dependencies = [ "async-channel", - "async-lock", "async-task", "atomic-waker", "fastrand", "futures-lite", + "once_cell", ] [[package]] @@ -851,6 +851,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + [[package]] name = "camino" version = "1.1.2" @@ -1133,6 +1139,15 @@ dependencies = [ "pallet-vesting", ] +[[package]] +name = "concurrent-queue" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" +dependencies = [ + "cache-padded", +] + [[package]] name = "concurrent-queue" version = "2.1.0" @@ -2283,9 +2298,9 @@ dependencies = [ [[package]] name = "environmental" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" [[package]] name = "errno" @@ -2477,13 +2492,13 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide", + "miniz_oxide 0.5.4", ] [[package]] @@ -4235,9 +4250,9 @@ dependencies = [ [[package]] name = "libp2p-pnet" -version = "0.22.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de160c5631696cea22be326c19bd9d306e254c4964945263aea10f25f6e0864e" +checksum = "1a5a702574223aa55d8878bdc8bf55c84a6086f87ddaddc28ce730b4caa81538" dependencies = [ "futures 0.3.25", "log", @@ -4748,6 +4763,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + [[package]] name = "miniz_oxide" version = "0.6.2" @@ -5033,9 +5057,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.3" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -5095,9 +5119,9 @@ dependencies = [ [[package]] name = "num-format" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +checksum = "54b862ff8df690cf089058c98b183676a7ed0f974cc08b426800093227cbff3b" dependencies = [ "arrayvec 0.7.2", "itoa", @@ -11361,9 +11385,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -11426,9 +11450,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", @@ -11752,9 +11776,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uint" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" dependencies = [ "byteorder", "crunchy", @@ -12854,9 +12878,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.3" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 1436e58a4..0c8c078e2 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -59,6 +59,7 @@ parameter_types! { // 60_000 = 1 minute. Should be raised to something more reasonable in the future. pub const MinSubsidyPeriod: Moment = 60_000; pub const OracleBond: Balance = 50 * CENT; + pub const OutsiderBond: Balance = 2 * OracleBond::get(); pub const PmPalletId: PalletId = PalletId(*b"zge/pred"); pub const ValidityBond: Balance = 50 * CENT; } diff --git a/primitives/src/market.rs b/primitives/src/market.rs index 2591ef2ee..0718766cd 100644 --- a/primitives/src/market.rs +++ b/primitives/src/market.rs @@ -86,6 +86,7 @@ impl Bond { pub struct MarketBonds { pub creation: Option>, pub oracle: Option>, + pub outsider: Option>, } impl MarketBonds { @@ -95,14 +96,16 @@ impl MarketBonds { Some(bond) if bond.who == *who => bond.value, _ => BA::zero(), }; - value_or_default(&self.creation).saturating_add(value_or_default(&self.oracle)) + value_or_default(&self.creation) + .saturating_add(value_or_default(&self.oracle)) + .saturating_add(value_or_default(&self.outsider)) } } // Used primarily for testing purposes. impl Default for MarketBonds { fn default() -> Self { - MarketBonds { creation: None, oracle: None } + MarketBonds { creation: None, oracle: None, outsider: None } } } diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index ed2ba1aa5..fee8dbc3e 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -191,6 +191,9 @@ parameter_types! { /// (Slashable) The orcale bond. Slashed in case the final outcome does not match the /// outcome the oracle reported. pub const OracleBond: Balance = 50 * CENT; + /// (Slashable) A bond for an outcome reporter, who is not the oracle. + /// Slashed in case the final outcome does not match the outcome by the outsider. + pub const OutsiderBond: Balance = 2 * OracleBond::get(); /// Pallet identifier, mainly used for named balance reserves. pub const PmPalletId: PalletId = PM_PALLET_ID; /// (Slashable) A bond for creation markets that do not require approval. Slashed in case diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index a54e4df60..58707f793 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -58,11 +58,7 @@ macro_rules! decl_common_types { frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - pallet_parachain_staking::migrations::MigrateAtStakeAutoCompound, - zrml_prediction_markets::migrations::UpdateMarketsForBaseAssetAndRecordBonds, - zrml_prediction_markets::migrations::AddFieldToAuthorityReport, - ), + zrml_prediction_markets::migrations::AddOutsiderBond, >; #[cfg(not(feature = "parachain"))] @@ -72,10 +68,7 @@ macro_rules! decl_common_types { frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - zrml_prediction_markets::migrations::UpdateMarketsForBaseAssetAndRecordBonds, - zrml_prediction_markets::migrations::AddFieldToAuthorityReport, - ), + zrml_prediction_markets::migrations::AddOutsiderBond, >; pub type Header = generic::Header; @@ -1019,6 +1012,7 @@ macro_rules! impl_config_traits { type MaxEditReasonLen = MaxEditReasonLen; type MaxRejectReasonLen = MaxRejectReasonLen; type OracleBond = OracleBond; + type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; type RejectOrigin = EnsureRootOrHalfAdvisoryCommittee; type RequestEditOrigin = EitherOfDiverse< diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 32745542d..d6eef76ad 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -191,6 +191,9 @@ parameter_types! { /// (Slashable) The orcale bond. Slashed in case the final outcome does not match the /// outcome the oracle reported. pub const OracleBond: Balance = 200 * BASE; + /// (Slashable) A bond for an outcome reporter, who is not the oracle. + /// Slashed in case the final outcome does not match the outcome by the outsider. + pub const OutsiderBond: Balance = 2 * OracleBond::get(); /// Pallet identifier, mainly used for named balance reserves. DO NOT CHANGE. pub const PmPalletId: PalletId = PM_PALLET_ID; /// (Slashable) A bond for creation markets that do not require approval. Slashed in case diff --git a/zrml/court/src/tests.rs b/zrml/court/src/tests.rs index 79df3d108..a383ac109 100644 --- a/zrml/court/src/tests.rs +++ b/zrml/court/src/tests.rs @@ -52,7 +52,7 @@ const DEFAULT_MARKET: MarketOf = Market { resolved_outcome: None, status: MarketStatus::Closed, scoring_rule: ScoringRule::CPMM, - bonds: MarketBonds { creation: None, oracle: None }, + bonds: MarketBonds { creation: None, oracle: None, outsider: None }, }; const DEFAULT_SET_OF_JURORS: &[(u128, Juror)] = &[ (7, Juror { status: JurorStatus::Ok }), diff --git a/zrml/market-commons/src/lib.rs b/zrml/market-commons/src/lib.rs index 29851b11a..3ba87e9ee 100644 --- a/zrml/market-commons/src/lib.rs +++ b/zrml/market-commons/src/lib.rs @@ -50,7 +50,7 @@ mod pallet { use zeitgeist_primitives::types::{Asset, Market, PoolId}; /// The current storage version. - const STORAGE_VERSION: StorageVersion = StorageVersion::new(5); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; diff --git a/zrml/market-commons/src/tests.rs b/zrml/market-commons/src/tests.rs index 40a8cef8d..e0d9cbabf 100644 --- a/zrml/market-commons/src/tests.rs +++ b/zrml/market-commons/src/tests.rs @@ -47,7 +47,7 @@ const MARKET_DUMMY: Market { + /// Settle the $bond_type bond by repatriating it to free balance of beneficiary. + /// + /// This function **should** only be called if the bond is not yet settled, and calling + /// it if the bond is settled is most likely a logic error. If the bond is already + /// settled, storage is not changed, a warning is raised and `Ok(())` is returned. + fn $fn_name(market_id: &MarketIdOf, beneficiary: &T::AccountId) -> DispatchResult { + let market = >::market(market_id)?; + let bond = market.bonds.$bond_type.as_ref().ok_or(Error::::MissingBond)?; + if bond.is_settled { + let warning = format!( + "Attempting to settle the {} bond of market {:?} multiple times", + stringify!($bond_type), + market_id, + ); + log::warn!("{}", warning); + debug_assert!(false, "{}", warning); + return Ok(()); + } + let res = >::repatriate_reserved_named( + &Self::reserve_id(), + &bond.who, + beneficiary, + bond.value, + BalanceStatus::Free, + ); + // If there's an error or missing balance, + // there's nothing we can do, so we don't count this as error + // and log a warning instead. + match res { + Ok(missing) if missing != >::zero() => { + let warning = format!( + "Failed to repatriate all of the {} bond of market {:?} (missing \ + balance {:?}).", + stringify!($bond_type), + market_id, + missing, + ); + log::warn!("{}", warning); + debug_assert!(false, "{}", warning); + } + Ok(_) => (), + Err(_err) => { + let warning = format!( + "Failed to settle the {} bond of market {:?} (error: {}).", + stringify!($bond_type), + market_id, + stringify!(_err), + ); + log::warn!("{}", warning); + debug_assert!(false, "{}", warning); + } + } + >::mutate_market(market_id, |m| { + m.bonds.$bond_type = Some(Bond { is_settled: true, ..bond.clone() }); + Ok(()) + })?; + Ok(()) + } + }; + } + + macro_rules! impl_is_bond_pending { + ($fn_name:ident, $bond_type:ident) => { + /// Check whether the $bond_type is present (ready to get unreserved or slashed). + /// Set the flag `with_warning` to `true`, when warnings should be logged + /// in case the bond is not present or already settled. + /// + /// Return `true` if the bond is present and not settled, `false` otherwise. + fn $fn_name( + market_id: &MarketIdOf, + market: &MarketOf, + with_warning: bool, + ) -> bool { + if let Some(bond) = &market.bonds.$bond_type { + if !bond.is_settled { + return true; + } else if with_warning { + let warning = format!( + "[PredictionMarkets] The {} bond is already settled for market {:?}.", + stringify!($bond_type), + market_id, + ); + log::warn!("{}", warning); + debug_assert!(false, "{}", warning); + } + } else if with_warning { + let warning = format!( + "[PredictionMarkets] The {} bond is not present for market {:?}.", + stringify!($bond_type), + market_id, + ); + log::warn!("{}", warning); + debug_assert!(false, "{}", warning); + } + + false + } + }; + } + #[pallet::call] impl Pallet { /// Destroy a market, including its outcome assets, market account and pool account. @@ -234,16 +336,7 @@ mod pallet { // Slash outstanding bonds; see // https://github.com/zeitgeistpm/runtime-audit-1/issues/34#issuecomment-1120187097 for // details. - if let Some(bond) = market.bonds.creation { - if !bond.is_settled { - Self::slash_creation_bond(&market_id, None)?; - } - } - if let Some(bond) = market.bonds.oracle { - if !bond.is_settled { - Self::slash_oracle_bond(&market_id, None)?; - } - } + Self::slash_pending_bonds(&market_id, &market)?; if market_status == MarketStatus::Proposed { MarketIdsForEdit::::remove(market_id); @@ -692,10 +785,12 @@ mod pallet { MarketCreation::Advised => MarketBonds { creation: Some(Bond::new(sender.clone(), T::AdvisoryBond::get())), oracle: Some(Bond::new(sender.clone(), T::OracleBond::get())), + ..Default::default() }, MarketCreation::Permissionless => MarketBonds { creation: Some(Bond::new(sender.clone(), T::ValidityBond::get())), oracle: Some(Bond::new(sender.clone(), T::OracleBond::get())), + ..Default::default() }, }; @@ -1229,13 +1324,26 @@ mod pallet { } } + let sender_is_oracle = sender == market.oracle; + let origin_has_permission = T::ResolveOrigin::ensure_origin(origin).is_ok(); + let sender_is_outsider = !sender_is_oracle && !origin_has_permission; + if should_check_origin { - let sender_is_oracle = sender == market.oracle; - let origin_has_permission = T::ResolveOrigin::ensure_origin(origin).is_ok(); ensure!( sender_is_oracle || origin_has_permission, Error::::ReporterNotOracle ); + } else if sender_is_outsider { + let outsider_bond = T::OutsiderBond::get(); + + market.bonds.outsider = Some(Bond::new(sender.clone(), outsider_bond)); + + T::AssetManager::reserve_named( + &Self::reserve_id(), + Asset::Ztg, + &sender, + outsider_bond, + )?; } market.report = Some(market_report.clone()); @@ -1547,6 +1655,9 @@ mod pallet { #[pallet::constant] type MaxEditReasonLen: Get; + #[pallet::constant] + type OutsiderBond: Get>; + /// The module identifier. #[pallet::constant] type PalletId: Get; @@ -1955,8 +2066,27 @@ mod pallet { impl Pallet { impl_unreserve_bond!(unreserve_creation_bond, creation); impl_unreserve_bond!(unreserve_oracle_bond, oracle); + impl_unreserve_bond!(unreserve_outsider_bond, outsider); impl_slash_bond!(slash_creation_bond, creation); impl_slash_bond!(slash_oracle_bond, oracle); + impl_slash_bond!(slash_outsider_bond, outsider); + impl_repatriate_bond!(repatriate_oracle_bond, oracle); + impl_is_bond_pending!(is_creation_bond_pending, creation); + impl_is_bond_pending!(is_oracle_bond_pending, oracle); + impl_is_bond_pending!(is_outsider_bond_pending, outsider); + + fn slash_pending_bonds(market_id: &MarketIdOf, market: &MarketOf) -> DispatchResult { + if Self::is_creation_bond_pending(market_id, market, false) { + Self::slash_creation_bond(market_id, None)?; + } + if Self::is_oracle_bond_pending(market_id, market, false) { + Self::slash_oracle_bond(market_id, None)?; + } + if Self::is_outsider_bond_pending(market_id, market, false) { + Self::slash_outsider_bond(market_id, None)?; + } + Ok(()) + } pub fn outcome_assets( market_id: MarketIdOf, @@ -2385,16 +2515,11 @@ mod pallet { if report.by == market.oracle { Self::unreserve_oracle_bond(market_id)?; } else { - let negative_imbalance = Self::slash_oracle_bond(market_id, None)?; - - // deposit only to the real reporter what actually was slashed - if let Err(err) = - T::AssetManager::deposit(Asset::Ztg, &report.by, negative_imbalance.peek()) - { - log::warn!( - "[PredictionMarkets] Cannot deposit to the reporter. error: {:?}", - err - ); + // reward outsider reporter with oracle bond + Self::repatriate_oracle_bond(market_id, &report.by)?; + + if Self::is_outsider_bond_pending(market_id, market, true) { + Self::unreserve_outsider_bond(market_id)?; } } @@ -2441,11 +2566,44 @@ mod pallet { // If the oracle reported right, return the OracleBond, otherwise slash it to // pay the correct reporters. let mut overall_imbalance = NegativeImbalanceOf::::zero(); - if report.by == market.oracle && report.outcome == resolved_outcome { - Self::unreserve_oracle_bond(market_id)?; + + let report_by_oracle = report.by == market.oracle; + let is_correct = report.outcome == resolved_outcome; + + let unreserve_outsider = || -> DispatchResult { + if Self::is_outsider_bond_pending(market_id, market, true) { + Self::unreserve_outsider_bond(market_id)?; + } + Ok(()) + }; + + let slash_outsider = || -> Result, DispatchError> { + if Self::is_outsider_bond_pending(market_id, market, true) { + let imbalance = Self::slash_outsider_bond(market_id, None)?; + return Ok(imbalance); + } + Ok(NegativeImbalanceOf::::zero()) + }; + + if report_by_oracle { + if is_correct { + Self::unreserve_oracle_bond(market_id)?; + } else { + let negative_imbalance = Self::slash_oracle_bond(market_id, None)?; + overall_imbalance.subsume(negative_imbalance); + } } else { - let imbalance = Self::slash_oracle_bond(market_id, None)?; - overall_imbalance.subsume(imbalance); + // outsider report + if is_correct { + // reward outsider reporter with oracle bond + Self::repatriate_oracle_bond(market_id, &report.by)?; + unreserve_outsider()?; + } else { + let oracle_imbalance = Self::slash_oracle_bond(market_id, None)?; + let outsider_imbalance = slash_outsider()?; + overall_imbalance.subsume(oracle_imbalance); + overall_imbalance.subsume(outsider_imbalance); + } } for (i, dispute) in disputes.iter().enumerate() { diff --git a/zrml/prediction-markets/src/migrations.rs b/zrml/prediction-markets/src/migrations.rs index 387d6236f..1f6fab770 100644 --- a/zrml/prediction-markets/src/migrations.rs +++ b/zrml/prediction-markets/src/migrations.rs @@ -17,35 +17,51 @@ #[cfg(feature = "try-runtime")] use crate::MarketIdOf; -use crate::{Config, MarketOf, MomentOf}; +use crate::{BalanceOf, Config, MomentOf}; +#[cfg(feature = "try-runtime")] +use alloc::collections::BTreeMap; #[cfg(feature = "try-runtime")] use alloc::format; -use alloc::{collections::BTreeMap, vec::Vec}; +use alloc::vec::Vec; +#[cfg(feature = "try-runtime")] +use frame_support::migration::storage_key_iter; #[cfg(feature = "try-runtime")] use frame_support::traits::OnRuntimeUpgradeHelpersExt; use frame_support::{ dispatch::Weight, log, - migration::{put_storage_value, storage_iter}, pallet_prelude::PhantomData, traits::{Get, OnRuntimeUpgrade, StorageVersion}, RuntimeDebug, }; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; +use sp_runtime::traits::Saturating; use zeitgeist_primitives::types::{ Asset, Bond, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, }; -use zrml_market_commons::{MarketCommonsPalletApi, Pallet as MarketCommonsPallet}; +#[cfg(feature = "try-runtime")] +use zrml_market_commons::MarketCommonsPalletApi; +use zrml_market_commons::Pallet as MarketCommonsPallet; +#[cfg(any(feature = "try-runtime", test))] const MARKET_COMMONS: &[u8] = b"MarketCommons"; +#[cfg(any(feature = "try-runtime", test))] const MARKETS: &[u8] = b"Markets"; -const MARKET_COMMONS_REQUIRED_STORAGE_VERSION: u16 = 4; -const MARKET_COMMONS_NEXT_STORAGE_VERSION: u16 = 5; + +const MARKET_COMMONS_REQUIRED_STORAGE_VERSION: u16 = 5; +const MARKET_COMMONS_NEXT_STORAGE_VERSION: u16 = 6; + +#[derive(Clone, Decode, Encode, PartialEq, Eq, RuntimeDebug, TypeInfo)] +pub struct OldMarketBonds { + pub creation: Option>, + pub oracle: Option>, +} #[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub struct OldMarket { +pub struct OldMarket { + pub base_asset: A, pub creator: AI, pub creation: MarketCreation, pub creator_fee: u8, @@ -59,88 +75,76 @@ pub struct OldMarket { pub report: Option>, pub resolved_outcome: Option, pub dispute_mechanism: MarketDisputeMechanism, + pub bonds: OldMarketBonds, } type OldMarketOf = OldMarket< ::AccountId, + BalanceOf, ::BlockNumber, MomentOf, + Asset<::MarketId>, +>; + +#[frame_support::storage_alias] +pub(crate) type Markets = StorageMap< + MarketCommonsPallet, + frame_support::Blake2_128Concat, + ::MarketId, + OldMarketOf, >; -pub struct UpdateMarketsForBaseAssetAndRecordBonds(PhantomData); +pub struct AddOutsiderBond(PhantomData); -impl OnRuntimeUpgrade - for UpdateMarketsForBaseAssetAndRecordBonds -{ +impl OnRuntimeUpgrade for AddOutsiderBond { fn on_runtime_upgrade() -> Weight { let mut total_weight = T::DbWeight::get().reads(1); let market_commons_version = StorageVersion::get::>(); if market_commons_version != MARKET_COMMONS_REQUIRED_STORAGE_VERSION { log::info!( - "UpdateMarketsForBaseAssetAndRecordBonds: market-commons version is {:?}, but \ - {:?} is required", + "AddOutsiderBond: market-commons version is {:?}, but {:?} is required", market_commons_version, MARKET_COMMONS_REQUIRED_STORAGE_VERSION, ); return total_weight; } - log::info!("UpdateMarketsForBaseAssetAndRecordBonds: Starting..."); + log::info!("AddOutsiderBond: Starting..."); - let new_markets = storage_iter::>(MARKET_COMMONS, MARKETS) - .map(|(key, old_market)| { - total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); - let creation = Some(match old_market.creation { - MarketCreation::Advised => Bond { - who: old_market.creator.clone(), - value: T::AdvisoryBond::get(), - is_settled: old_market.status != MarketStatus::Proposed, - }, - MarketCreation::Permissionless => Bond { - who: old_market.creator.clone(), - value: T::ValidityBond::get(), - is_settled: matches!( - old_market.status, - MarketStatus::Resolved | MarketStatus::InsufficientSubsidy, - ), - }, - }); - let oracle = Some(Bond { - who: old_market.creator.clone(), - value: T::OracleBond::get(), - is_settled: matches!( - old_market.status, - MarketStatus::Resolved | MarketStatus::InsufficientSubsidy, - ), - }); - let new_market = Market { - base_asset: Asset::Ztg, - creator: old_market.creator, - creation: old_market.creation, - creator_fee: old_market.creator_fee, - oracle: old_market.oracle, - metadata: old_market.metadata, - market_type: old_market.market_type, - period: old_market.period, - scoring_rule: old_market.scoring_rule, - status: old_market.status, - report: old_market.report, - resolved_outcome: old_market.resolved_outcome, - dispute_mechanism: old_market.dispute_mechanism, - deadlines: old_market.deadlines, - bonds: MarketBonds { creation, oracle }, - }; - (key, new_market) - }) - .collect::>(); + let mut translated = 0u64; + zrml_market_commons::Markets::::translate::, _>(|_key, old_market| { + translated.saturating_inc(); - for (key, new_market) in new_markets { - put_storage_value::>(MARKET_COMMONS, MARKETS, &key, new_market); - total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - } + let new_market = Market { + base_asset: old_market.base_asset, + creator: old_market.creator, + creation: old_market.creation, + creator_fee: old_market.creator_fee, + oracle: old_market.oracle, + metadata: old_market.metadata, + market_type: old_market.market_type, + period: old_market.period, + scoring_rule: old_market.scoring_rule, + status: old_market.status, + report: old_market.report, + resolved_outcome: old_market.resolved_outcome, + dispute_mechanism: old_market.dispute_mechanism, + deadlines: old_market.deadlines, + bonds: MarketBonds { + creation: old_market.bonds.creation, + oracle: old_market.bonds.oracle, + outsider: None, + }, + }; + + Some(new_market) + }); + log::info!("AddOutsiderBond: Upgraded {} markets.", translated); + total_weight = + total_weight.saturating_add(T::DbWeight::get().reads_writes(translated, translated)); StorageVersion::new(MARKET_COMMONS_NEXT_STORAGE_VERSION).put::>(); total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - log::info!("UpdateMarketsForBaseAssetAndRecordBonds: Done!"); + log::info!("AddOutsiderBond: Done!"); total_weight } @@ -154,6 +158,19 @@ impl OnRuntimeUpgrade ) .collect::>(); Self::set_temp_storage(old_markets, "old_markets"); + + let markets = Markets::::iter_keys().count() as u32; + let decodable_markets = Markets::::iter_values().count() as u32; + if markets != decodable_markets { + log::error!( + "Can only decode {} of {} markets - others will be dropped", + decodable_markets, + markets + ); + } else { + log::info!("Markets: {}, Decodable Markets: {}", markets, decodable_markets); + } + Ok(()) } @@ -167,13 +184,7 @@ impl OnRuntimeUpgrade let old_market = old_markets .get(&market_id) .expect(&format!("Market {:?} not found", market_id)[..]); - assert_eq!( - new_market.base_asset, - Asset::Ztg, - "found unexpected base_asset in new_market. market_id: {:?}, base_asset: {:?}", - market_id, - new_market.base_asset - ); + assert_eq!(new_market.base_asset, old_market.base_asset); assert_eq!(new_market.creator, old_market.creator); assert_eq!(new_market.creation, old_market.creation); assert_eq!(new_market.creator_fee, old_market.creator_fee); @@ -187,13 +198,13 @@ impl OnRuntimeUpgrade assert_eq!(new_market.report, old_market.report); assert_eq!(new_market.resolved_outcome, old_market.resolved_outcome); assert_eq!(new_market.dispute_mechanism, old_market.dispute_mechanism); - assert_eq!(new_market.bonds.oracle.unwrap().value, T::OracleBond::get()); - let expected_creation_bond = match new_market.creation { - MarketCreation::Advised => T::AdvisoryBond::get(), - MarketCreation::Permissionless => T::ValidityBond::get(), - }; - assert_eq!(new_market.bonds.creation.unwrap().value, expected_creation_bond); + assert_eq!(new_market.bonds.oracle, old_market.bonds.oracle); + assert_eq!(new_market.bonds.creation, old_market.bonds.creation); + // new field + assert_eq!(new_market.bonds.outsider, None); } + log::info!("AddOutsiderBond: Market Counter post-upgrade is {}!", new_market_count); + assert!(new_market_count > 0); Ok(()) } } @@ -203,16 +214,18 @@ mod tests { use super::*; use crate::{ mock::{ExtBuilder, Runtime}, - MarketIdOf, + MarketIdOf, MarketOf, + }; + use frame_support::{ + dispatch::fmt::Debug, migration::put_storage_value, Blake2_128Concat, StorageHasher, }; - use frame_support::{dispatch::fmt::Debug, Blake2_128Concat, StorageHasher}; use zrml_market_commons::MarketCommonsPalletApi; #[test] fn on_runtime_upgrade_increments_the_storage_version() { ExtBuilder::default().build().execute_with(|| { set_up_version(); - UpdateMarketsForBaseAssetAndRecordBonds::::on_runtime_upgrade(); + AddOutsiderBond::::on_runtime_upgrade(); assert_eq!( StorageVersion::get::>(), MARKET_COMMONS_NEXT_STORAGE_VERSION @@ -224,20 +237,15 @@ mod tests { fn on_runtime_upgrade_is_noop_if_versions_are_not_correct() { ExtBuilder::default().build().execute_with(|| { // Don't set up chain to signal that storage is already up to date. - let test_vector = construct_test_vector(); - let new_markets = - test_vector.into_iter().map(|(_, new_market)| new_market).collect::>(); + let (_, new_markets) = construct_old_new_tuple(); populate_test_data::, MarketOf>( MARKET_COMMONS, MARKETS, new_markets.clone(), ); - UpdateMarketsForBaseAssetAndRecordBonds::::on_runtime_upgrade(); - for (market_id, expected) in new_markets.iter().enumerate() { - let actual = - >::market(&(market_id as u128)).unwrap(); - assert_eq!(actual, *expected); - } + AddOutsiderBond::::on_runtime_upgrade(); + let actual = >::market(&0u128).unwrap(); + assert_eq!(actual, new_markets[0]); }); } @@ -245,24 +253,15 @@ mod tests { fn on_runtime_upgrade_correctly_updates_markets() { ExtBuilder::default().build().execute_with(|| { set_up_version(); - let test_vector = construct_test_vector(); - let (old_markets, new_markets): (_, Vec>) = - test_vector.into_iter().unzip(); + let (old_markets, new_markets) = construct_old_new_tuple(); populate_test_data::, OldMarketOf>( MARKET_COMMONS, MARKETS, old_markets, ); - UpdateMarketsForBaseAssetAndRecordBonds::::on_runtime_upgrade(); - for (market_id, expected) in new_markets.iter().enumerate() { - let actual = - >::market(&(market_id as u128)).unwrap(); - assert_eq!(actual, *expected); - } - assert_eq!( - StorageVersion::get::>(), - MARKET_COMMONS_NEXT_STORAGE_VERSION - ); + AddOutsiderBond::::on_runtime_upgrade(); + let actual = >::market(&0u128).unwrap(); + assert_eq!(actual, new_markets[0]); }); } @@ -271,155 +270,66 @@ mod tests { .put::>(); } - fn construct_test_vector() -> Vec<(OldMarketOf, MarketOf)> { + fn construct_old_new_tuple() -> (Vec>, Vec>) { + let base_asset = Asset::Ztg; let creator = 999; - let construct_markets = |creation: MarketCreation, status, bonds| { - let base_asset = Asset::Ztg; - let creator_fee = 1; - let oracle = 2; - let metadata = vec![3, 4, 5]; - let market_type = MarketType::Categorical(6); - let period = MarketPeriod::Block(7..8); - let scoring_rule = ScoringRule::CPMM; - let report = None; - let resolved_outcome = None; - let dispute_mechanism = MarketDisputeMechanism::Authorized; - let deadlines = Deadlines::default(); + let creator_fee = 1; + let oracle = 2; + let metadata = vec![3, 4, 5]; + let market_type = MarketType::Categorical(6); + let period = MarketPeriod::Block(7..8); + let scoring_rule = ScoringRule::CPMM; + let status = MarketStatus::Disputed; + let creation = MarketCreation::Permissionless; + let report = None; + let resolved_outcome = None; + let dispute_mechanism = MarketDisputeMechanism::Authorized; + let deadlines = Deadlines::default(); + let old_bonds = OldMarketBonds { + creation: Some(Bond::new(creator, ::ValidityBond::get())), + oracle: Some(Bond::new(creator, ::OracleBond::get())), + }; + let new_bonds = MarketBonds { + creation: Some(Bond::new(creator, ::ValidityBond::get())), + oracle: Some(Bond::new(creator, ::OracleBond::get())), + outsider: None, + }; - let old_market = OldMarket { - creator, - creation: creation.clone(), - creator_fee, - oracle, - metadata: metadata.clone(), - market_type: market_type.clone(), - period: period.clone(), - scoring_rule, - status, - report: report.clone(), - resolved_outcome: resolved_outcome.clone(), - dispute_mechanism: dispute_mechanism.clone(), - deadlines, - }; - let new_market = Market { - base_asset, - creator, - creation, - creator_fee, - oracle, - metadata, - market_type, - period, - scoring_rule, - status, - report, - resolved_outcome, - dispute_mechanism, - deadlines, - bonds, - }; - (old_market, new_market) + let old_market = OldMarket { + base_asset, + creator, + creation: creation.clone(), + creator_fee, + oracle, + metadata: metadata.clone(), + market_type: market_type.clone(), + period: period.clone(), + scoring_rule, + status, + report: report.clone(), + resolved_outcome: resolved_outcome.clone(), + dispute_mechanism: dispute_mechanism.clone(), + deadlines, + bonds: old_bonds, }; - vec![ - construct_markets( - MarketCreation::Permissionless, - MarketStatus::Disputed, - MarketBonds { - creation: Some(Bond { - who: creator, - value: ::ValidityBond::get(), - is_settled: false, - }), - oracle: Some(Bond { - who: creator, - value: ::OracleBond::get(), - is_settled: false, - }), - }, - ), - construct_markets( - MarketCreation::Permissionless, - MarketStatus::Resolved, - MarketBonds { - creation: Some(Bond { - who: creator, - value: ::ValidityBond::get(), - is_settled: true, - }), - oracle: Some(Bond { - who: creator, - value: ::OracleBond::get(), - is_settled: true, - }), - }, - ), - construct_markets( - MarketCreation::Advised, - MarketStatus::Proposed, - MarketBonds { - creation: Some(Bond { - who: creator, - value: ::AdvisoryBond::get(), - is_settled: false, - }), - oracle: Some(Bond { - who: creator, - value: ::OracleBond::get(), - is_settled: false, - }), - }, - ), - construct_markets( - MarketCreation::Advised, - MarketStatus::Active, - MarketBonds { - creation: Some(Bond { - who: creator, - value: ::AdvisoryBond::get(), - is_settled: true, - }), - oracle: Some(Bond { - who: creator, - value: ::OracleBond::get(), - is_settled: false, - }), - }, - ), - construct_markets( - MarketCreation::Advised, - MarketStatus::Resolved, - MarketBonds { - creation: Some(Bond { - who: creator, - value: ::AdvisoryBond::get(), - is_settled: true, - }), - oracle: Some(Bond { - who: creator, - value: ::OracleBond::get(), - is_settled: true, - }), - }, - ), - // Technically, the market below has the wrong scoring rule, but that's irrelevant to - // the test. - construct_markets( - MarketCreation::Permissionless, - MarketStatus::InsufficientSubsidy, - MarketBonds { - creation: Some(Bond { - who: creator, - value: ::ValidityBond::get(), - is_settled: true, - }), - oracle: Some(Bond { - who: creator, - value: ::OracleBond::get(), - is_settled: true, - }), - }, - ), - ] + let new_market = Market { + base_asset, + creator, + creation, + creator_fee, + oracle, + metadata, + market_type, + period, + scoring_rule, + status, + report, + resolved_outcome, + dispute_mechanism, + deadlines, + bonds: new_bonds, + }; + (vec![old_market], vec![new_market]) } #[allow(unused)] @@ -437,286 +347,6 @@ mod tests { } } -#[cfg(feature = "try-runtime")] -use alloc::string::ToString; -use frame_support::{migration::storage_key_iter, Twox64Concat}; -use frame_system::pallet_prelude::BlockNumberFor; -use sp_runtime::traits::Saturating; -use zeitgeist_primitives::types::AuthorityReport; -use zrml_authorized::Pallet as AuthorizedPallet; - -const AUTHORIZED: &[u8] = b"Authorized"; -const AUTHORIZED_OUTCOME_REPORTS: &[u8] = b"AuthorizedOutcomeReports"; - -const AUTHORIZED_REQUIRED_STORAGE_VERSION: u16 = 2; -const AUTHORIZED_NEXT_STORAGE_VERSION: u16 = 3; - -pub struct AddFieldToAuthorityReport(PhantomData); - -// Add resolve_at block number value field to `AuthorizedOutcomeReports` map. -impl OnRuntimeUpgrade - for AddFieldToAuthorityReport -{ - fn on_runtime_upgrade() -> Weight - where - T: Config, - { - let mut total_weight = T::DbWeight::get().reads(1); - let authorized_version = StorageVersion::get::>(); - if authorized_version != AUTHORIZED_REQUIRED_STORAGE_VERSION { - log::info!( - "AddFieldToAuthorityReport: authorized version is {:?}, require {:?};", - authorized_version, - AUTHORIZED_REQUIRED_STORAGE_VERSION, - ); - return total_weight; - } - log::info!("AddFieldToAuthorityReport: Starting..."); - - let mut authorized_resolutions = - BTreeMap::<::MarketId, BlockNumberFor>::new(); - for (resolve_at, bounded_vec) in crate::MarketIdsPerDisputeBlock::::iter() { - total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); - - for id in bounded_vec.into_inner().iter() { - if let Ok(market) = >::market(id) { - if market.dispute_mechanism == MarketDisputeMechanism::Authorized { - authorized_resolutions.insert(*id, resolve_at); - } - } else { - log::warn!("AddFieldToAuthorityReport: Could not find market with id {:?}", id); - } - } - } - - let mut new_storage_map: Vec<( - ::MarketId, - AuthorityReport>, - )> = Vec::new(); - - let now = frame_system::Pallet::::block_number(); - total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); - - for (market_id, old_value) in storage_key_iter::< - ::MarketId, - OutcomeReport, - Twox64Concat, - >(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS) - { - total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); - - let resolve_at: Option> = - authorized_resolutions.get(&market_id).cloned(); - - match resolve_at { - Some(block) if now <= block => { - new_storage_map.push(( - market_id, - AuthorityReport { resolve_at: block, outcome: old_value }, - )); - } - _ => { - log::warn!( - "AddFieldToAuthorityReport: Market was not found in \ - MarketIdsPerDisputeBlock; market id: {:?}", - market_id - ); - // example case market id 432 - // https://github.com/zeitgeistpm/zeitgeist/pull/701 market id 432 is invalid, because of zero-division error in the past - // we have to handle manually here, because MarketIdsPerDisputeBlock does not contain 432 - let mut resolve_at = now.saturating_add(T::CorrectionPeriod::get()); - total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); - - let mut bounded_vec = >::get(resolve_at); - while bounded_vec.is_full() { - // roll the dice until we find a block that is not full - total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); - resolve_at = resolve_at.saturating_add(1u32.into()); - bounded_vec = >::get(resolve_at); - } - // is not full, so we can push - bounded_vec.force_push(market_id); - >::insert(resolve_at, bounded_vec); - total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - - new_storage_map - .push((market_id, AuthorityReport { resolve_at, outcome: old_value })); - } - } - } - - for (market_id, new_value) in new_storage_map { - let hash = utility::key_to_hash::< - Twox64Concat, - ::MarketId, - >(market_id); - put_storage_value::>( - AUTHORIZED, - AUTHORIZED_OUTCOME_REPORTS, - &hash, - new_value, - ); - total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - } - - StorageVersion::new(AUTHORIZED_NEXT_STORAGE_VERSION).put::>(); - total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - log::info!("AddFieldToAuthorityReport: Done!"); - total_weight - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { - let mut counter = 0_u32; - for (key, value) in storage_iter::(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS) { - Self::set_temp_storage(value, &format!("{:?}", key.as_slice())); - - counter = counter.saturating_add(1_u32); - } - let counter_key = "counter_key".to_string(); - Self::set_temp_storage(counter, &counter_key); - Ok(()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { - let mut markets_count = 0_u32; - let old_counter_key = "counter_key".to_string(); - for (key, new_value) in - storage_iter::>(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS) - { - let key_str = format!("{:?}", key.as_slice()); - - let AuthorityReport { resolve_at: _, outcome } = new_value; - let old_value: OutcomeReport = Self::get_temp_storage(&key_str) - .unwrap_or_else(|| panic!("old value not found for market id {:?}", key_str)); - - assert_eq!(old_value, outcome); - - markets_count += 1_u32; - } - let old_markets_count: u32 = - Self::get_temp_storage(&old_counter_key).expect("old counter key storage not found"); - assert_eq!(markets_count, old_markets_count); - Ok(()) - } -} - -#[cfg(test)] -mod tests_authorized { - use super::*; - use crate::{ - mock::{ExtBuilder, MarketCommons, Runtime, ALICE, BOB}, - CacheSize, MarketIdOf, - }; - use frame_support::{BoundedVec, Twox64Concat}; - use zeitgeist_primitives::types::{MarketId, OutcomeReport}; - use zrml_market_commons::MarketCommonsPalletApi; - - #[test] - fn on_runtime_upgrade_increments_the_storage_versions() { - ExtBuilder::default().build().execute_with(|| { - set_up_chain(); - AddFieldToAuthorityReport::::on_runtime_upgrade(); - let authorized_version = StorageVersion::get::>(); - assert_eq!(authorized_version, AUTHORIZED_NEXT_STORAGE_VERSION); - }); - } - - #[test] - fn on_runtime_sets_new_struct_with_resolve_at() { - ExtBuilder::default().build().execute_with(|| { - set_up_chain(); - - >::set_block_number(10_000); - - let hash = crate::migrations::utility::key_to_hash::(0); - let outcome = OutcomeReport::Categorical(42u16); - put_storage_value::( - AUTHORIZED, - AUTHORIZED_OUTCOME_REPORTS, - &hash, - outcome.clone(), - ); - - let resolve_at = 42_000; - - let sample_market = get_sample_market(); - let market_id: MarketId = MarketCommons::push_market(sample_market).unwrap(); - let bounded_vec = - BoundedVec::, CacheSize>::try_from(vec![market_id]) - .expect("BoundedVec should be created"); - crate::MarketIdsPerDisputeBlock::::insert(resolve_at, bounded_vec); - - AddFieldToAuthorityReport::::on_runtime_upgrade(); - - let expected = AuthorityReport { resolve_at, outcome }; - - let actual = frame_support::migration::get_storage_value::< - AuthorityReport<::BlockNumber>, - >(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS, &hash) - .unwrap(); - assert_eq!(expected, actual); - }); - } - - #[test] - fn on_runtime_is_noop_if_versions_are_not_correct() { - ExtBuilder::default().build().execute_with(|| { - // storage migration already executed (storage version is incremented already) - StorageVersion::new(AUTHORIZED_NEXT_STORAGE_VERSION).put::>(); - - let hash = crate::migrations::utility::key_to_hash::(0); - let outcome = OutcomeReport::Categorical(42u16); - - let report = AuthorityReport { resolve_at: 42, outcome }; - put_storage_value::::BlockNumber>>( - AUTHORIZED, - AUTHORIZED_OUTCOME_REPORTS, - &hash, - report.clone(), - ); - - AddFieldToAuthorityReport::::on_runtime_upgrade(); - - let actual = frame_support::migration::get_storage_value::< - AuthorityReport<::BlockNumber>, - >(AUTHORIZED, AUTHORIZED_OUTCOME_REPORTS, &hash) - .unwrap(); - assert_eq!(report, actual); - }); - } - - fn set_up_chain() { - StorageVersion::new(AUTHORIZED_REQUIRED_STORAGE_VERSION).put::>(); - } - - fn get_sample_market() -> zeitgeist_primitives::types::Market> - { - zeitgeist_primitives::types::Market { - base_asset: Asset::Ztg, - creation: zeitgeist_primitives::types::MarketCreation::Permissionless, - creator_fee: 0, - creator: ALICE, - market_type: zeitgeist_primitives::types::MarketType::Scalar(0..=100), - dispute_mechanism: zeitgeist_primitives::types::MarketDisputeMechanism::Authorized, - metadata: Default::default(), - oracle: BOB, - period: zeitgeist_primitives::types::MarketPeriod::Block(Default::default()), - deadlines: zeitgeist_primitives::types::Deadlines { - grace_period: 1_u32.into(), - oracle_duration: 1_u32.into(), - dispute_duration: 1_u32.into(), - }, - report: None, - resolved_outcome: None, - scoring_rule: zeitgeist_primitives::types::ScoringRule::CPMM, - status: zeitgeist_primitives::types::MarketStatus::Disputed, - bonds: Default::default(), - } - } -} - // We use these utilities to prevent having to make the swaps pallet a dependency of // prediciton-markets. The calls are based on the implementation of `StorageVersion`, found here: // https://github.com/paritytech/substrate/blob/bc7a1e6c19aec92bfa247d8ca68ec63e07061032/frame/support/src/traits/metadata.rs#L168-L230 diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index 7c77a017a..b537658c6 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -44,8 +44,9 @@ use zeitgeist_primitives::{ MaxInRatio, MaxMarketLifetime, MaxOracleDuration, MaxOutRatio, MaxRejectReasonLen, MaxReserves, MaxSubsidyPeriod, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinCategories, MinDisputeDuration, MinLiquidity, MinOracleDuration, MinSubsidy, - MinSubsidyPeriod, MinWeight, MinimumPeriod, PmPalletId, SimpleDisputesPalletId, - StakeWeight, SwapsPalletId, TreasuryPalletId, BASE, CENT, MILLISECS_PER_BLOCK, + MinSubsidyPeriod, MinWeight, MinimumPeriod, OutsiderBond, PmPalletId, + SimpleDisputesPalletId, StakeWeight, SwapsPalletId, TreasuryPalletId, BASE, CENT, + MILLISECS_PER_BLOCK, }, types::{ AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, @@ -168,6 +169,7 @@ impl crate::Config for Runtime { type MaxEditReasonLen = MaxEditReasonLen; type MaxRejectReasonLen = MaxRejectReasonLen; type OracleBond = OracleBond; + type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; type RejectOrigin = EnsureSignedBy; type RequestEditOrigin = EnsureSignedBy; diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index eb185e5fb..576e34ea1 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -34,7 +34,7 @@ use test_case::test_case; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use sp_runtime::traits::{AccountIdConversion, SaturatedConversion, Zero}; use zeitgeist_primitives::{ - constants::mock::{DisputeFactor, BASE, CENT, MILLISECS_PER_BLOCK}, + constants::mock::{DisputeFactor, OutsiderBond, BASE, CENT, MILLISECS_PER_BLOCK}, traits::Swaps as SwapsPalletApi, types::{ AccountIdTest, Asset, Balance, BlockNumber, Bond, Deadlines, Market, MarketBonds, @@ -63,6 +63,30 @@ fn gen_metadata(byte: u8) -> MultiHash { MultiHash::Sha3_384(metadata) } +fn reserve_sentinel_amounts() { + // Reserve a sentinel amount to check that we don't unreserve too much. + assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &ALICE, SENTINEL_AMOUNT)); + assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &BOB, SENTINEL_AMOUNT)); + assert_ok!(Balances::reserve_named( + &PredictionMarkets::reserve_id(), + &CHARLIE, + SENTINEL_AMOUNT + )); + assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &DAVE, SENTINEL_AMOUNT)); + assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &EVE, SENTINEL_AMOUNT)); + assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &FRED, SENTINEL_AMOUNT)); + assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(&BOB), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(&CHARLIE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(&DAVE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(&EVE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(&FRED), SENTINEL_AMOUNT); +} + +fn check_reserve(account: &AccountIdTest, expected: Balance) { + assert_eq!(Balances::reserved_balance(account), SENTINEL_AMOUNT + expected); +} + fn simple_create_categorical_market( base_asset: Asset, creation: MarketCreation, @@ -3955,6 +3979,7 @@ fn authorized_correctly_resolves_disputed_market() { fn approve_market_correctly_unreserves_advisory_bond() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), base_asset, @@ -3968,19 +3993,10 @@ fn approve_market_correctly_unreserves_advisory_bond() { ScoringRule::CPMM, )); let market_id = 0; - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!( - Balances::reserved_balance(&ALICE), - SENTINEL_AMOUNT + AdvisoryBond::get() + OracleBond::get() - ); + check_reserve(&ALICE, AdvisoryBond::get() + OracleBond::get()); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), market_id)); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT + OracleBond::get()); + check_reserve(&ALICE, OracleBond::get()); assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + AdvisoryBond::get()); let market = MarketCommons::market(&market_id).unwrap(); assert!(market.bonds.creation.unwrap().is_settled); @@ -4103,6 +4119,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark { // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4116,17 +4133,8 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!( - Balances::reserved_balance(&ALICE), - SENTINEL_AMOUNT + ValidityBond::get() + OracleBond::get() - ); + check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -4136,7 +4144,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark OutcomeReport::Categorical(0) )); run_to_block(grace_period + market.deadlines.dispute_duration + 1); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); assert_eq!( Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get() + OracleBond::get() @@ -4156,6 +4164,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark { // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4169,30 +4178,111 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!( - Balances::reserved_balance(&ALICE), - SENTINEL_AMOUNT + ValidityBond::get() + OracleBond::get() - ); + check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); + + let charlie_balance_before = Balances::free_balance(&CHARLIE); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; let report_at = grace_period + market.deadlines.oracle_duration + 1; run_to_block(report_at); + + assert!(market.bonds.outsider.is_none()); assert_ok!(PredictionMarkets::report( Origin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); + + let market = MarketCommons::market(&0).unwrap(); + assert_eq!(market.bonds.outsider, Some(Bond::new(CHARLIE, OutsiderBond::get()))); + check_reserve(&CHARLIE, OutsiderBond::get()); + assert_eq!(Balances::free_balance(&CHARLIE), charlie_balance_before - OutsiderBond::get()); + let charlie_balance_before = Balances::free_balance(&CHARLIE); + run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // Check that validity bond didn't get slashed, but oracle bond did assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + + check_reserve(&CHARLIE, 0); + // Check that the outsider gets the OracleBond together with the OutsiderBond + assert_eq!( + Balances::free_balance(&CHARLIE), + charlie_balance_before + OracleBond::get() + OutsiderBond::get() + ); + let market = MarketCommons::market(&0).unwrap(); + assert!(market.bonds.outsider.unwrap().is_settled); + }; + ExtBuilder::default().build().execute_with(|| { + test(Asset::Ztg); + }); + #[cfg(feature = "parachain")] + ExtBuilder::default().build().execute_with(|| { + test(Asset::ForeignAsset(100)); + }); +} + +#[test] +fn outsider_reports_wrong_outcome() { + // NOTE: Bonds are always in ZTG, irrespective of base_asset. + let test = |base_asset: Asset| { + reserve_sentinel_amounts(); + + let end = 100; + let alice_balance_before = Balances::free_balance(&ALICE); + assert_ok!(PredictionMarkets::create_market( + Origin::signed(ALICE), + base_asset, + BOB, + MarketPeriod::Block(0..end), + get_deadlines(), + gen_metadata(2), + MarketCreation::Permissionless, + MarketType::Categorical(2), + MarketDisputeMechanism::SimpleDisputes, + ScoringRule::CPMM, + )); + + let outsider = CHARLIE; + + let market = MarketCommons::market(&0).unwrap(); + let grace_period = end + market.deadlines.grace_period; + let report_at = grace_period + market.deadlines.oracle_duration + 1; + run_to_block(report_at); + assert_ok!(PredictionMarkets::report( + Origin::signed(outsider), + 0, + OutcomeReport::Categorical(1) + )); + + let outsider_balance_before = Balances::free_balance(&outsider); + check_reserve(&outsider, OutsiderBond::get()); + + let dispute_at_0 = report_at + 1; + run_to_block(dispute_at_0); + assert_ok!(PredictionMarkets::dispute( + Origin::signed(EVE), + 0, + OutcomeReport::Categorical(0) + )); + + let eve_balance_before = Balances::free_balance(&EVE); + + // on_resolution called + run_blocks(market.deadlines.dispute_duration); + + assert_eq!(Balances::free_balance(&ALICE), alice_balance_before - OracleBond::get()); + + check_reserve(&outsider, 0); + assert_eq!(Balances::free_balance(&outsider), outsider_balance_before); + + let dispute_bond = crate::default_dispute_bond::(0usize); + // disputor EVE gets the OracleBond and OutsiderBond and dispute bond + assert_eq!( + Balances::free_balance(&EVE), + eve_balance_before + dispute_bond + OutsiderBond::get() + OracleBond::get() + ); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4208,6 +4298,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma { // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4221,15 +4312,9 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT + OracleBond::get()); + check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; let report_at = grace_period + 1; @@ -4240,7 +4325,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma OutcomeReport::Categorical(1) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // Check that nothing got slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + OracleBond::get()); }; @@ -4258,6 +4343,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma { // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4271,15 +4357,9 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT + OracleBond::get()); + check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; let report_at = grace_period + market.deadlines.oracle_duration + 1; @@ -4291,7 +4371,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma )); run_blocks(market.deadlines.dispute_duration); // Check that oracle bond got slashed - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); }; ExtBuilder::default().build().execute_with(|| { @@ -4309,6 +4389,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark // Oracle reports in time but incorrect report, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4322,17 +4403,8 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!( - Balances::reserved_balance(&ALICE), - SENTINEL_AMOUNT + ValidityBond::get() + OracleBond::get() - ); + check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -4347,7 +4419,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark OutcomeReport::Categorical(1) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); }; @@ -4366,6 +4438,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma // Oracle reports in time but incorrect report, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4379,15 +4452,9 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT + OracleBond::get()); + check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -4402,7 +4469,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma OutcomeReport::Categorical(1) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); }; @@ -4421,6 +4488,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark // Oracle reports in time and correct report, so OracleBond does not get slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4434,17 +4502,8 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!( - Balances::reserved_balance(&ALICE), - SENTINEL_AMOUNT + ValidityBond::get() + OracleBond::get() - ); + check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -4465,7 +4524,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark OutcomeReport::Categorical(0) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is not slashed assert_eq!( Balances::free_balance(&ALICE), @@ -4487,6 +4546,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma // Oracle reports in time and correct report, so OracleBond does not get slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4500,15 +4560,9 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT + OracleBond::get()); + check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); @@ -4529,7 +4583,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma OutcomeReport::Categorical(0) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is not slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + OracleBond::get()); }; @@ -4548,6 +4602,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark // Oracle does not report in time, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4561,27 +4616,26 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); + let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!( - Balances::reserved_balance(&ALICE), - SENTINEL_AMOUNT + ValidityBond::get() + OracleBond::get() - ); + check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); + + let outsider = CHARLIE; + let market = MarketCommons::market(&0).unwrap(); let after_oracle_duration = end + market.deadlines.grace_period + market.deadlines.oracle_duration + 1; run_to_block(after_oracle_duration); // CHARLIE is not an Oracle assert_ok!(PredictionMarkets::report( - Origin::signed(CHARLIE), + Origin::signed(outsider), 0, OutcomeReport::Categorical(0) )); + + let outsider_balance_before = Balances::free_balance(&outsider); + check_reserve(&outsider, OutsiderBond::get()); + // EVE disputes with wrong outcome assert_ok!(PredictionMarkets::dispute( Origin::signed(EVE), @@ -4594,9 +4648,15 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark OutcomeReport::Categorical(0) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + + check_reserve(&outsider, 0); + assert_eq!( + Balances::free_balance(&outsider), + outsider_balance_before + OracleBond::get() + OutsiderBond::get() + ); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4613,6 +4673,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma // Oracle does not report in time, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG let test = |base_asset: Asset| { + reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( Origin::signed(ALICE), @@ -4626,25 +4687,26 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - // Reserve a sentinel amount to check that we don't unreserve too much. - assert_ok!(Balances::reserve_named( - &PredictionMarkets::reserve_id(), - &ALICE, - SENTINEL_AMOUNT - )); + + let outsider = CHARLIE; + assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT + OracleBond::get()); + check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let after_oracle_duration = end + market.deadlines.grace_period + market.deadlines.oracle_duration + 1; run_to_block(after_oracle_duration); // CHARLIE is not an Oracle assert_ok!(PredictionMarkets::report( - Origin::signed(CHARLIE), + Origin::signed(outsider), 0, OutcomeReport::Categorical(0) )); + + let outsider_balance_before = Balances::free_balance(&outsider); + check_reserve(&outsider, OutsiderBond::get()); + // EVE disputes with wrong outcome assert_ok!(PredictionMarkets::dispute( Origin::signed(EVE), @@ -4657,9 +4719,15 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma OutcomeReport::Categorical(0) )); run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); + check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + + check_reserve(&outsider, 0); + assert_eq!( + Balances::free_balance(&outsider), + outsider_balance_before + OracleBond::get() + OutsiderBond::get() + ); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4983,6 +5051,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_moments() { MarketBonds { creation: Some(Bond::new(ALICE, ::AdvisoryBond::get())), oracle: Some(Bond::new(ALICE, ::OracleBond::get())), + outsider: None, } )] #[test_case( @@ -4992,6 +5061,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_moments() { MarketBonds { creation: Some(Bond::new(ALICE, ::ValidityBond::get())), oracle: Some(Bond::new(ALICE, ::OracleBond::get())), + outsider: None, } )] fn create_market_sets_the_correct_market_parameters_and_reserves_the_correct_amount( diff --git a/zrml/simple-disputes/src/tests.rs b/zrml/simple-disputes/src/tests.rs index 85a01b8b1..05b93a356 100644 --- a/zrml/simple-disputes/src/tests.rs +++ b/zrml/simple-disputes/src/tests.rs @@ -45,7 +45,7 @@ const DEFAULT_MARKET: MarketOf = Market { resolved_outcome: None, scoring_rule: ScoringRule::CPMM, status: MarketStatus::Disputed, - bonds: MarketBonds { creation: None, oracle: None }, + bonds: MarketBonds { creation: None, oracle: None, outsider: None }, }; #[test] From 4f960a348b432094baecc1311f9398d2ce1cc2f8 Mon Sep 17 00:00:00 2001 From: Chralt Date: Wed, 1 Feb 2023 08:45:45 +0100 Subject: [PATCH 18/53] Use secret token for CodeCov (#962) --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d60f58d27..6921659a6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -99,6 +99,7 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} files: ${{ runner.temp }}/zeitgeist-test-coverage.lcov fail_ci_if_error: true flags: tests From d05860572300b632187c915b9627cd943d010798 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Thu, 2 Feb 2023 06:16:43 +0100 Subject: [PATCH 19/53] Gensis: User proper inflation config and eligiblity ratio (#960) * Gensis: User proper inflation config and eligiblity ratio * Update inflation logic * Use from_perthousand instead of from_parts * Mirror correct inflation in docstrings Co-authored-by: Vivek Pandya * Use STAKING_PTD in genesis config Co-authored-by: Chralt --------- Co-authored-by: Vivek Pandya Co-authored-by: Chralt --- Cargo.lock | 2 +- node/src/chain_spec/battery_station.rs | 18 ++++-- node/src/chain_spec/dev.rs | 16 +++++- node/src/chain_spec/mod.rs | 77 ++++++++++++++------------ node/src/chain_spec/zeitgeist.rs | 24 ++++++-- primitives/src/constants.rs | 1 + primitives/src/constants/ztg.rs | 21 +++++-- 7 files changed, 103 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c068e0e8..8383998b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -396,7 +396,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", "object 0.30.3", "rustc-demangle", ] diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index 70c4d8849..d4c96f14c 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -25,7 +25,7 @@ use sc_service::ChainType; use sp_core::crypto::UncheckedInto; use zeitgeist_primitives::{ constants::{ - ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD}, + ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD, STAKING_PTD}, BASE, }, types::AccountId, @@ -33,12 +33,13 @@ use zeitgeist_primitives::{ #[cfg(feature = "parachain")] use { - super::{Extensions, DEFAULT_COLLATOR_INFLATION_INFO}, + super::{generate_inflation_config_function, Extensions}, crate::BATTERY_STATION_PARACHAIN_ID, battery_station_runtime::{ CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, DefaultParachainBondReservePercent, EligibilityValue, PolkadotXcmConfig, }, + zeitgeist_primitives::constants::ztg::TOTAL_INITIAL_ZTG, }; cfg_if::cfg_if! { @@ -67,7 +68,12 @@ fn additional_chain_spec_staging_battery_station( DEFAULT_STAKING_AMOUNT_BATTERY_STATION, )], collator_commission: DefaultCollatorCommission::get(), - inflation_info: DEFAULT_COLLATOR_INFLATION_INFO, + inflation_info: inflation_config( + STAKING_PTD * Perbill::from_percent(40), + STAKING_PTD * Perbill::from_percent(70), + STAKING_PTD, + TOTAL_INITIAL_ZTG * BASE, + ), nominations: vec![], parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), parachain_id, @@ -92,7 +98,7 @@ fn endowed_accounts_staging_battery_station() -> Vec vec![ // 5D2L4ghyiYE8p2z7VNJo9JYwRuc8uzPWtMBqdVyvjRcsnw4P EndowedAccountWithBalance( - hex!["2a6c61a907556e4c673880b5767dd4be08339ee7f2a58d5137d0c19ca9570a5c"].into(), + root_key_staging_battery_station(), DEFAULT_INITIAL_BALANCE_BATTERY_STATION, ), // 5EeeZVU4SiPG6ZRY7o8aDcav2p2mZMdu3ZLzbREWuHktYdhX @@ -113,7 +119,6 @@ fn root_key_staging_battery_station() -> AccountId { hex!["2a6c61a907556e4c673880b5767dd4be08339ee7f2a58d5137d0c19ca9570a5c"].into() } -#[inline] pub(super) fn get_wasm() -> Result<&'static [u8], String> { battery_station_runtime::WASM_BINARY.ok_or_else(|| "WASM binary is not available".to_string()) } @@ -125,6 +130,9 @@ generate_generic_genesis_function!( }, ); +#[cfg(feature = "parachain")] +generate_inflation_config_function!(battery_station_runtime); + pub fn battery_station_staging_config() -> Result { let wasm = get_wasm()?; diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index ef098cc10..c90118973 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -22,7 +22,6 @@ use super::{ get_account_id_from_seed, get_from_seed, token_properties, AdditionalChainSpec, EndowedAccountWithBalance, }; - #[cfg(feature = "parachain")] use battery_station_runtime::{ DefaultBlocksPerRound, DefaultCollatorCommission, DefaultParachainBondReservePercent, @@ -31,9 +30,15 @@ use battery_station_runtime::{ use sc_service::ChainType; use sp_core::sr25519; use zeitgeist_primitives::{ - constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD}, + constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD, STAKING_PTD}, types::Balance, }; +#[cfg(feature = "parachain")] +use { + super::battery_station::inflation_config, + sp_runtime::Perbill, + zeitgeist_primitives::constants::{ztg::TOTAL_INITIAL_ZTG, BASE}, +}; const INITIAL_BALANCE: Balance = Balance::MAX >> 4; @@ -75,7 +80,12 @@ pub fn dev_config() -> Result { super::battery_station::DEFAULT_STAKING_AMOUNT_BATTERY_STATION, )], collator_commission: DefaultCollatorCommission::get(), - inflation_info: crate::chain_spec::DEFAULT_COLLATOR_INFLATION_INFO, + inflation_info: inflation_config( + STAKING_PTD * Perbill::from_percent(40), + STAKING_PTD * Perbill::from_percent(70), + STAKING_PTD, + TOTAL_INITIAL_ZTG * BASE, + ), nominations: vec![], parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), parachain_id: crate::BATTERY_STATION_PARACHAIN_ID.into(), diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index ca10085c6..2822999a4 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -42,46 +42,53 @@ use zeitgeist_primitives::{ constants::BalanceFractionalDecimals, types::{AccountId, Balance}, }; -#[cfg(feature = "parachain")] -use { - sp_runtime::Perbill, - zeitgeist_primitives::constants::{ztg, MILLISECS_PER_BLOCK}, - zeitgeist_runtime::DefaultBlocksPerRound, -}; cfg_if::cfg_if! { if #[cfg(feature = "parachain")] { // Common - pub(crate) const DEFAULT_COLLATOR_INFLATION_INFO: pallet_parachain_staking::InflationInfo = { - let hours_per_year = 8766; - let millisecs_per_year = hours_per_year * 60 * 60 * 1000; - let round_millisecs = DefaultBlocksPerRound::get() as u64 * MILLISECS_PER_BLOCK as u64; - let rounds_per_year = millisecs_per_year / round_millisecs; - - let annual_inflation = ztg::STAKING_PTD; - let expected_annual_amount = ztg::COLLATORS * zeitgeist_primitives::constants::BASE; - let round_inflation_parts = annual_inflation.deconstruct() as u64 / rounds_per_year; - let round_inflation = Perbill::from_parts(round_inflation_parts as _); - - pallet_parachain_staking::InflationInfo { - annual: pallet_parachain_staking::Range { - ideal: annual_inflation, - max: annual_inflation, - min: annual_inflation, - }, - expect: pallet_parachain_staking::Range { - ideal: expected_annual_amount, - max: expected_annual_amount, - min: expected_annual_amount, - }, - round: pallet_parachain_staking::Range { - ideal: round_inflation, - min: round_inflation, - max: round_inflation, - }, + macro_rules! generate_inflation_config_function { + ($runtime:ident) => { + use sp_runtime::Perbill; + + pub(super) fn inflation_config( + annual_inflation_min: Perbill, + annual_inflation_ideal: Perbill, + annual_inflation_max: Perbill, + total_supply: zeitgeist_primitives::types::Balance + ) -> pallet_parachain_staking::inflation::InflationInfo { + fn to_round_inflation(annual: pallet_parachain_staking::inflation::Range) -> pallet_parachain_staking::inflation::Range { + use pallet_parachain_staking::inflation::{ + perbill_annual_to_perbill_round, + }; + use $runtime::parachain_params::DefaultBlocksPerRound; + + perbill_annual_to_perbill_round( + annual, + // rounds per year + u32::try_from(zeitgeist_primitives::constants::BLOCKS_PER_YEAR).unwrap() / DefaultBlocksPerRound::get() + ) + } + let annual = pallet_parachain_staking::inflation::Range { + min: annual_inflation_min, + ideal: annual_inflation_ideal, + max: annual_inflation_max, + }; + pallet_parachain_staking::inflation::InflationInfo { + // staking expectations + expect: pallet_parachain_staking::inflation::Range { + min: Perbill::from_percent(5).mul_floor(total_supply), + ideal: Perbill::from_percent(10).mul_floor(total_supply), + max: Perbill::from_percent(15).mul_floor(total_supply), + }, + // annual inflation + annual, + round: to_round_inflation(annual), + } + } } - }; + } + pub(crate) use generate_inflation_config_function; pub type DummyChainSpec = sc_service::GenericChainSpec<(), Extensions>; } else { pub type DummyChainSpec = sc_service::GenericChainSpec<()>; @@ -116,7 +123,7 @@ macro_rules! generate_generic_genesis_function { }, #[cfg(feature = "parachain")] author_filter: $runtime::AuthorFilterConfig { - eligible_count: EligibilityValue::new_unchecked(50), + eligible_count: EligibilityValue::new_unchecked(1), }, #[cfg(feature = "parachain")] author_mapping: $runtime::AuthorMappingConfig { diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index cdae6e7cc..cb88a8611 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -17,19 +17,22 @@ #![cfg(feature = "with-zeitgeist-runtime")] -use super::{AdditionalChainSpec, EndowedAccountWithBalance}; -use crate::chain_spec::{generate_generic_genesis_function, telemetry_endpoints, token_properties}; +use super::{ + generate_generic_genesis_function, telemetry_endpoints, token_properties, AdditionalChainSpec, + EndowedAccountWithBalance, +}; use hex_literal::hex; use sc_service::ChainType; use sp_core::crypto::UncheckedInto; use zeitgeist_runtime::parameters::SS58Prefix; -use zeitgeist_primitives::constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD}; +use zeitgeist_primitives::constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD, STAKING_PTD}; #[cfg(feature = "parachain")] use { - super::{Extensions, DEFAULT_COLLATOR_INFLATION_INFO}, + super::{generate_inflation_config_function, Extensions}, crate::KUSAMA_PARACHAIN_ID, + zeitgeist_primitives::constants::ztg::TOTAL_INITIAL_ZTG, zeitgeist_runtime::{ CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, DefaultParachainBondReservePercent, EligibilityValue, MinCollatorStk, PolkadotXcmConfig, @@ -74,6 +77,8 @@ fn endowed_accounts_staging_zeitgeist() -> Vec { fn additional_chain_spec_staging_zeitgeist( parachain_id: cumulus_primitives_core::ParaId, ) -> AdditionalChainSpec { + use zeitgeist_primitives::constants::BASE; + AdditionalChainSpec { blocks_per_round: DefaultBlocksPerRound::get(), candidates: vec![ @@ -97,7 +102,12 @@ fn additional_chain_spec_staging_zeitgeist( ), ], collator_commission: DefaultCollatorCommission::get(), - inflation_info: DEFAULT_COLLATOR_INFLATION_INFO, + inflation_info: inflation_config( + STAKING_PTD * Perbill::from_percent(40), + STAKING_PTD * Perbill::from_percent(70), + STAKING_PTD, + TOTAL_INITIAL_ZTG * BASE, + ), nominations: vec![], parachain_bond_reserve_percent: DefaultParachainBondReservePercent::get(), parachain_id, @@ -118,13 +128,15 @@ fn additional_chain_spec_staging_zeitgeist() -> AdditionalChainSpec { } } -#[inline] pub(super) fn get_wasm() -> Result<&'static [u8], String> { zeitgeist_runtime::WASM_BINARY.ok_or_else(|| "WASM binary is not available".to_string()) } generate_generic_genesis_function!(zeitgeist_runtime,); +#[cfg(feature = "parachain")] +generate_inflation_config_function!(zeitgeist_runtime); + pub fn zeitgeist_staging_config() -> Result { let wasm = get_wasm()?; diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index 1e707fa6f..56477030c 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -29,6 +29,7 @@ use crate::types::{Balance, BlockNumber}; use frame_support::{parameter_types, PalletId}; // Definitions for time +pub const BLOCKS_PER_YEAR: BlockNumber = (BLOCKS_PER_DAY * 36525) / 100; pub const BLOCKS_PER_DAY: BlockNumber = BLOCKS_PER_HOUR * 24; pub const MILLISECS_PER_BLOCK: u32 = 12000; pub const BLOCKS_PER_MINUTE: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); diff --git a/primitives/src/constants/ztg.rs b/primitives/src/constants/ztg.rs index 0d48f629c..cdb5b90d9 100644 --- a/primitives/src/constants/ztg.rs +++ b/primitives/src/constants/ztg.rs @@ -22,10 +22,10 @@ use sp_runtime::Perbill; /// Total ZTG amount for community incentives. pub const COMMUNITY_INCENTIVES: u128 = 2_000_000; -/// Total ZTG amount for collators +/// Total ZTG amount for collators. pub const COLLATORS: u128 = 0; -/// Total ZTG amount for liquidity mining +/// Total ZTG amount for liquidity mining. pub const LIQUIDITY_MINING: u128 = 0; /// Total ZTG amount for parachain lease. @@ -46,10 +46,19 @@ pub const TEAM_AND_ADVISORS: u128 = 15_000_000; /// Total ZTG amount for Zeitgesit foundation. pub const ZEITGEIST_FOUNDATION: u128 = 22_000_000; +/// Total ZTG amount at genesis. +pub const TOTAL_INITIAL_ZTG: u128 = COMMUNITY_INCENTIVES + + PARACHAIN_LEASE + + PUBLIC_SALE + + SEED_SALE + + STRATEGIC_SALE + + TEAM_AND_ADVISORS + + ZEITGEIST_FOUNDATION; + // Inflation -/// Perthousand liquidity mining inflation. 2% -pub const LIQUIDITY_MINING_PTD: Perbill = Perbill::from_perthousand(20); +/// Perthousand liquidity mining inflation. 0% +pub const LIQUIDITY_MINING_PTD: Perbill = Perbill::from_perthousand(0); -/// Perthousand collator staking inflation. 1.5% -pub const STAKING_PTD: Perbill = Perbill::from_perthousand(15); +/// Perthousand collator staking inflation. 5% +pub const STAKING_PTD: Perbill = Perbill::from_perthousand(50); From 45edad63ce9d963430ecd94ccd837ef3523d2ade Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 3 Feb 2023 11:54:54 +0100 Subject: [PATCH 20/53] Include integration tests in runtime only if `test` feature is set (#957) --- runtime/battery-station/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 9e169c9e7..a9f6b6670 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -77,7 +77,6 @@ use sp_runtime::{ use nimbus_primitives::CanAuthor; use sp_version::RuntimeVersion; -#[cfg(feature = "parachain")] #[cfg(test)] pub mod integration_tests; #[cfg(feature = "parachain")] From 941a6756eaf55be8900ef99cd3dec5871c5010d7 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 6 Feb 2023 14:41:45 +0100 Subject: [PATCH 21/53] Fix name of `pallet_multisig` (#965) * Fix name of `pallet_multisig` --- runtime/common/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 58707f793..be56e68cd 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -272,7 +272,7 @@ macro_rules! create_runtime { TransactionPayment: pallet_transaction_payment::{Config, Event, Pallet, Storage} = 11, Treasury: pallet_treasury::{Call, Config, Event, Pallet, Storage} = 12, Vesting: pallet_vesting::{Call, Config, Event, Pallet, Storage} = 13, - MultiSig: pallet_multisig::{Call, Event, Pallet, Storage} = 14, + Multisig: pallet_multisig::{Call, Event, Pallet, Storage} = 14, Bounties: pallet_bounties::{Call, Event, Pallet, Storage} = 15, // Governance @@ -1190,7 +1190,7 @@ macro_rules! create_runtime_api { list_benchmark!(list, extra, pallet_democracy, Democracy); list_benchmark!(list, extra, pallet_identity, Identity); list_benchmark!(list, extra, pallet_membership, AdvisoryCommitteeMembership); - list_benchmark!(list, extra, pallet_multisig, MultiSig); + list_benchmark!(list, extra, pallet_multisig, Multisig); list_benchmark!(list, extra, pallet_preimage, Preimage); list_benchmark!(list, extra, pallet_proxy, Proxy); list_benchmark!(list, extra, pallet_scheduler, Scheduler); @@ -1268,7 +1268,7 @@ macro_rules! create_runtime_api { add_benchmark!(params, batches, pallet_democracy, Democracy); add_benchmark!(params, batches, pallet_identity, Identity); add_benchmark!(params, batches, pallet_membership, AdvisoryCommitteeMembership); - add_benchmark!(params, batches, pallet_multisig, MultiSig); + add_benchmark!(params, batches, pallet_multisig, Multisig); add_benchmark!(params, batches, pallet_preimage, Preimage); add_benchmark!(params, batches, pallet_proxy, Proxy); add_benchmark!(params, batches, pallet_scheduler, Scheduler); From b32774bf2980c2a4db496e7868d0f50221971234 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 6 Feb 2023 14:45:26 +0100 Subject: [PATCH 22/53] Fix licenses (#964) --- node/src/chain_spec/additional_chain_spec.rs | 1 + node/src/chain_spec/battery_station.rs | 1 + node/src/chain_spec/dev.rs | 1 + node/src/chain_spec/mod.rs | 1 + node/src/chain_spec/zeitgeist.rs | 1 + node/src/cli/cli_parachain.rs | 1 + node/src/command.rs | 1 + node/src/main.rs | 1 + node/src/rpc.rs | 1 + node/src/service.rs | 1 + node/src/service/service_parachain.rs | 1 + node/src/service/service_standalone.rs | 1 + primitives/src/asset.rs | 1 + primitives/src/constants.rs | 1 + primitives/src/constants/mock.rs | 18 ++++++++++++++++++ primitives/src/constants/ztg.rs | 1 + primitives/src/market.rs | 1 + primitives/src/traits.rs | 1 + primitives/src/traits/dispute_api.rs | 1 + .../src/traits/market_commons_pallet_api.rs | 1 + .../zeitgeist_multi_reservable_currency.rs | 1 + primitives/src/types.rs | 1 + .../src/integration_tests/mod.rs | 1 + .../src/integration_tests/xcm/mod.rs | 1 + .../src/integration_tests/xcm/setup.rs | 2 +- .../src/integration_tests/xcm/test_net.rs | 3 ++- .../xcm/tests/currency_id_convert.rs | 2 +- .../integration_tests/xcm/tests/transfers.rs | 2 +- runtime/battery-station/src/lib.rs | 1 + .../battery-station/src/parachain_params.rs | 1 + runtime/battery-station/src/parameters.rs | 1 + .../src/xcm_config/asset_registry.rs | 2 +- .../battery-station/src/xcm_config/config.rs | 2 +- runtime/battery-station/src/xcm_config/fees.rs | 2 +- runtime/battery-station/src/xcm_config/mod.rs | 2 +- runtime/common/src/lib.rs | 1 + .../src/weights/cumulus_pallet_xcmp_queue.rs | 1 + runtime/common/src/weights/frame_system.rs | 1 + runtime/common/src/weights/mod.rs | 1 + runtime/common/src/weights/orml_currencies.rs | 1 + runtime/common/src/weights/orml_tokens.rs | 1 + .../src/weights/pallet_author_inherent.rs | 1 + .../src/weights/pallet_author_mapping.rs | 1 + .../src/weights/pallet_author_slot_filter.rs | 1 + runtime/common/src/weights/pallet_balances.rs | 1 + runtime/common/src/weights/pallet_bounties.rs | 1 + .../common/src/weights/pallet_collective.rs | 1 + runtime/common/src/weights/pallet_democracy.rs | 1 + runtime/common/src/weights/pallet_grandpa.rs | 1 + runtime/common/src/weights/pallet_identity.rs | 1 + .../common/src/weights/pallet_membership.rs | 1 + runtime/common/src/weights/pallet_multisig.rs | 1 + .../src/weights/pallet_parachain_staking.rs | 1 + runtime/common/src/weights/pallet_preimage.rs | 1 + runtime/common/src/weights/pallet_proxy.rs | 1 + runtime/common/src/weights/pallet_scheduler.rs | 1 + runtime/common/src/weights/pallet_timestamp.rs | 1 + runtime/common/src/weights/pallet_treasury.rs | 1 + runtime/common/src/weights/pallet_utility.rs | 1 + runtime/common/src/weights/pallet_vesting.rs | 1 + runtime/zeitgeist/src/integration_tests/mod.rs | 1 + .../zeitgeist/src/integration_tests/xcm/mod.rs | 1 + .../src/integration_tests/xcm/setup.rs | 2 +- .../src/integration_tests/xcm/test_net.rs | 3 ++- .../xcm/tests/currency_id_convert.rs | 2 +- .../integration_tests/xcm/tests/transfers.rs | 2 +- runtime/zeitgeist/src/lib.rs | 1 + runtime/zeitgeist/src/parachain_params.rs | 1 + runtime/zeitgeist/src/parameters.rs | 1 + .../zeitgeist/src/xcm_config/asset_registry.rs | 2 +- runtime/zeitgeist/src/xcm_config/config.rs | 2 +- runtime/zeitgeist/src/xcm_config/fees.rs | 2 +- runtime/zeitgeist/src/xcm_config/mod.rs | 2 +- zrml/authorized/src/benchmarks.rs | 1 + zrml/authorized/src/lib.rs | 1 + zrml/authorized/src/migrations.rs | 1 + zrml/authorized/src/mock.rs | 1 + zrml/authorized/src/mock_storage.rs | 1 + zrml/authorized/src/tests.rs | 1 + zrml/authorized/src/weights.rs | 1 + zrml/court/src/benchmarks.rs | 1 + zrml/court/src/lib.rs | 1 + zrml/court/src/mock.rs | 1 + zrml/court/src/tests.rs | 1 + zrml/court/src/weights.rs | 1 + zrml/global-disputes/src/benchmarks.rs | 3 +-- .../src/global_disputes_pallet_api.rs | 2 +- zrml/global-disputes/src/lib.rs | 2 +- zrml/global-disputes/src/mock.rs | 2 +- zrml/global-disputes/src/tests.rs | 2 +- zrml/global-disputes/src/types.rs | 17 +++++++++++++++++ zrml/global-disputes/src/weights.rs | 1 + zrml/liquidity-mining/src/benchmarks.rs | 1 + zrml/liquidity-mining/src/lib.rs | 1 + zrml/liquidity-mining/src/mock.rs | 1 + zrml/liquidity-mining/src/tests.rs | 1 + .../track_incentives_based_on_bought_shares.rs | 1 + .../track_incentives_based_on_sold_shares.rs | 1 + zrml/liquidity-mining/src/weights.rs | 1 + zrml/market-commons/src/lib.rs | 1 + zrml/market-commons/src/migrations.rs | 1 + zrml/market-commons/src/mock.rs | 1 + zrml/market-commons/src/tests.rs | 1 + zrml/orderbook-v1/src/benchmarks.rs | 1 + zrml/orderbook-v1/src/mock.rs | 1 + zrml/orderbook-v1/src/weights.rs | 1 + .../fuzz/pm_full_workflow.rs | 1 + zrml/prediction-markets/src/benchmarks.rs | 1 + zrml/prediction-markets/src/lib.rs | 1 + zrml/prediction-markets/src/migrations.rs | 1 + zrml/prediction-markets/src/mock.rs | 1 + .../src/orml_asset_registry.rs | 2 +- zrml/prediction-markets/src/tests.rs | 1 + zrml/prediction-markets/src/weights.rs | 1 + zrml/rikiddo/src/tests/pallet.rs | 1 + zrml/simple-disputes/src/lib.rs | 1 + zrml/simple-disputes/src/mock.rs | 1 + zrml/simple-disputes/src/tests.rs | 1 + zrml/styx/src/benchmarks.rs | 1 + zrml/styx/src/weights.rs | 1 + zrml/swaps/rpc/src/lib.rs | 1 + zrml/swaps/runtime-api/src/lib.rs | 1 + zrml/swaps/src/arbitrage.rs | 2 +- zrml/swaps/src/benchmarks.rs | 1 + zrml/swaps/src/lib.rs | 1 + zrml/swaps/src/mock.rs | 1 + zrml/swaps/src/root.rs | 2 +- zrml/swaps/src/tests.rs | 1 + zrml/swaps/src/utils.rs | 1 + zrml/swaps/src/weights.rs | 1 + 130 files changed, 165 insertions(+), 25 deletions(-) diff --git a/node/src/chain_spec/additional_chain_spec.rs b/node/src/chain_spec/additional_chain_spec.rs index 43fb925fd..d5324fce9 100644 --- a/node/src/chain_spec/additional_chain_spec.rs +++ b/node/src/chain_spec/additional_chain_spec.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index d4c96f14c..ee3c9809c 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index c90118973..558a132d9 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 2822999a4..acfed5ee2 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index cb88a8611..b0901e44d 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/cli/cli_parachain.rs b/node/src/cli/cli_parachain.rs index b810a471a..9b7810f18 100644 --- a/node/src/cli/cli_parachain.rs +++ b/node/src/cli/cli_parachain.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/command.rs b/node/src/command.rs index 57a609a9e..2e63c259d 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/main.rs b/node/src/main.rs index 45eb875a9..3c6dee50a 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 4fa35ceec..ffa85bead 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/service.rs b/node/src/service.rs index aa89dfb2e..ef120727c 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/service/service_parachain.rs b/node/src/service/service_parachain.rs index 34f298897..b7aab566a 100644 --- a/node/src/service/service_parachain.rs +++ b/node/src/service/service_parachain.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/node/src/service/service_standalone.rs b/node/src/service/service_standalone.rs index 235284feb..e35731387 100644 --- a/node/src/service/service_standalone.rs +++ b/node/src/service/service_standalone.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/asset.rs b/primitives/src/asset.rs index 92a99dc23..094f718c9 100644 --- a/primitives/src/asset.rs +++ b/primitives/src/asset.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index 56477030c..909db474f 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 0c8c078e2..af8d6888e 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -1,3 +1,21 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022 Zeitgeist PM LLC. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, 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. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + #![cfg(feature = "mock")] pub use super::*; diff --git a/primitives/src/constants/ztg.rs b/primitives/src/constants/ztg.rs index cdb5b90d9..c46c63420 100644 --- a/primitives/src/constants/ztg.rs +++ b/primitives/src/constants/ztg.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/market.rs b/primitives/src/market.rs index 0718766cd..7a2cc3127 100644 --- a/primitives/src/market.rs +++ b/primitives/src/market.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 1fc14cba1..fe7ec219f 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/traits/dispute_api.rs b/primitives/src/traits/dispute_api.rs index 584a3193e..caa7b94f3 100644 --- a/primitives/src/traits/dispute_api.rs +++ b/primitives/src/traits/dispute_api.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/traits/market_commons_pallet_api.rs b/primitives/src/traits/market_commons_pallet_api.rs index d246e9f0c..280808028 100644 --- a/primitives/src/traits/market_commons_pallet_api.rs +++ b/primitives/src/traits/market_commons_pallet_api.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/traits/zeitgeist_multi_reservable_currency.rs b/primitives/src/traits/zeitgeist_multi_reservable_currency.rs index 73f5bad68..5348bb01a 100644 --- a/primitives/src/traits/zeitgeist_multi_reservable_currency.rs +++ b/primitives/src/traits/zeitgeist_multi_reservable_currency.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/primitives/src/types.rs b/primitives/src/types.rs index b8cb3b891..a380cf656 100644 --- a/primitives/src/types.rs +++ b/primitives/src/types.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/battery-station/src/integration_tests/mod.rs b/runtime/battery-station/src/integration_tests/mod.rs index 64f89683b..31216c4f4 100644 --- a/runtime/battery-station/src/integration_tests/mod.rs +++ b/runtime/battery-station/src/integration_tests/mod.rs @@ -1,4 +1,5 @@ // Copyright 2022 Forecasting Technologies LTD. +// // This file is part of Zeitgeist. // // Zeitgeist is free software: you can redistribute it and/or modify it diff --git a/runtime/battery-station/src/integration_tests/xcm/mod.rs b/runtime/battery-station/src/integration_tests/xcm/mod.rs index d2226363f..d37a62036 100644 --- a/runtime/battery-station/src/integration_tests/xcm/mod.rs +++ b/runtime/battery-station/src/integration_tests/xcm/mod.rs @@ -1,4 +1,5 @@ // Copyright 2022 Forecasting Technologies LTD. +// // This file is part of Zeitgeist. // // Zeitgeist is free software: you can redistribute it and/or modify it diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index dfda13cf8..159efedcd 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -1,5 +1,5 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021 Centrifuge Foundation (centrifuge.io). -// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index de2b6acac..16a392590 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -1,5 +1,6 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Centrifuge GmbH (centrifuge.io). -// Copyright 2022 Forecasting Technologies LTD. +// // This file is part of Zeitgeist. // // Zeitgeist is free software: you can redistribute it and/or modify it diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs b/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs index a2d744b5a..cda575235 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs @@ -1,5 +1,5 @@ -// Copyright 2021 Centrifuge Foundation (centrifuge.io). // Copyright 2022 Forecasting Technologies LTD. +// Copyright 2021 Centrifuge Foundation (centrifuge.io). // // This file is part of Zeitgeist. // diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index 793d345f7..983ed021e 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -1,5 +1,5 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021 Centrifuge Foundation (centrifuge.io). -// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index a9f6b6670..7d32f7f94 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/battery-station/src/parachain_params.rs b/runtime/battery-station/src/parachain_params.rs index 64b45a2fd..270e3b1f4 100644 --- a/runtime/battery-station/src/parachain_params.rs +++ b/runtime/battery-station/src/parachain_params.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index fee8dbc3e..702fadd9a 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/battery-station/src/xcm_config/asset_registry.rs b/runtime/battery-station/src/xcm_config/asset_registry.rs index 07d62519c..1b2f16f11 100644 --- a/runtime/battery-station/src/xcm_config/asset_registry.rs +++ b/runtime/battery-station/src/xcm_config/asset_registry.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index 238537fe9..f1d1a5f87 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/battery-station/src/xcm_config/fees.rs b/runtime/battery-station/src/xcm_config/fees.rs index bc188eafc..825a20f87 100644 --- a/runtime/battery-station/src/xcm_config/fees.rs +++ b/runtime/battery-station/src/xcm_config/fees.rs @@ -1,5 +1,5 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021 Centrifuge Foundation (centrifuge.io). -// Copyright 2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. // diff --git a/runtime/battery-station/src/xcm_config/mod.rs b/runtime/battery-station/src/xcm_config/mod.rs index 363ac87b1..448000ebe 100644 --- a/runtime/battery-station/src/xcm_config/mod.rs +++ b/runtime/battery-station/src/xcm_config/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index be56e68cd..1888f9ff2 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // Copyright 2019-2020 Parity Technologies (UK) Ltd. // diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index e0a20dbcd..2a79c580f 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index 0fce968ea..a818f1049 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index 2a7825912..7651cf806 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/orml_currencies.rs b/runtime/common/src/weights/orml_currencies.rs index c628d5402..134ebe24e 100644 --- a/runtime/common/src/weights/orml_currencies.rs +++ b/runtime/common/src/weights/orml_currencies.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/orml_tokens.rs b/runtime/common/src/weights/orml_tokens.rs index dc982cd42..fd20584e7 100644 --- a/runtime/common/src/weights/orml_tokens.rs +++ b/runtime/common/src/weights/orml_tokens.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_author_inherent.rs b/runtime/common/src/weights/pallet_author_inherent.rs index e1689a0a6..58c692e04 100644 --- a/runtime/common/src/weights/pallet_author_inherent.rs +++ b/runtime/common/src/weights/pallet_author_inherent.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_author_mapping.rs b/runtime/common/src/weights/pallet_author_mapping.rs index 9dc310e71..c2c35e486 100644 --- a/runtime/common/src/weights/pallet_author_mapping.rs +++ b/runtime/common/src/weights/pallet_author_mapping.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_author_slot_filter.rs b/runtime/common/src/weights/pallet_author_slot_filter.rs index 9ee05ed69..b59599ff7 100644 --- a/runtime/common/src/weights/pallet_author_slot_filter.rs +++ b/runtime/common/src/weights/pallet_author_slot_filter.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 0ed3df5a3..3497719e2 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_bounties.rs b/runtime/common/src/weights/pallet_bounties.rs index 6d3e90d50..d4f205867 100644 --- a/runtime/common/src/weights/pallet_bounties.rs +++ b/runtime/common/src/weights/pallet_bounties.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index b4818d13b..6e19990f0 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index cf952bf8f..ab69d96f6 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_grandpa.rs b/runtime/common/src/weights/pallet_grandpa.rs index 24be43b6a..93c2a162b 100644 --- a/runtime/common/src/weights/pallet_grandpa.rs +++ b/runtime/common/src/weights/pallet_grandpa.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index 75988386b..21325ec38 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index 3f0f627bd..d5291f4cc 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index d2dce8294..15e72f97e 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index 9df5b793e..f20df184a 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index 0536b916e..cd9b38b90 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index 216678e76..940a3f950 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index d94e83b60..81509db9a 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index 083969d6d..c93a29aa3 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index 66d407d9e..22d82ca1f 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index 059ae9918..fe36785fd 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/common/src/weights/pallet_vesting.rs b/runtime/common/src/weights/pallet_vesting.rs index af99820ef..09a8a1a66 100644 --- a/runtime/common/src/weights/pallet_vesting.rs +++ b/runtime/common/src/weights/pallet_vesting.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/zeitgeist/src/integration_tests/mod.rs b/runtime/zeitgeist/src/integration_tests/mod.rs index 64f89683b..31216c4f4 100644 --- a/runtime/zeitgeist/src/integration_tests/mod.rs +++ b/runtime/zeitgeist/src/integration_tests/mod.rs @@ -1,4 +1,5 @@ // Copyright 2022 Forecasting Technologies LTD. +// // This file is part of Zeitgeist. // // Zeitgeist is free software: you can redistribute it and/or modify it diff --git a/runtime/zeitgeist/src/integration_tests/xcm/mod.rs b/runtime/zeitgeist/src/integration_tests/xcm/mod.rs index d2226363f..d37a62036 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/mod.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/mod.rs @@ -1,4 +1,5 @@ // Copyright 2022 Forecasting Technologies LTD. +// // This file is part of Zeitgeist. // // Zeitgeist is free software: you can redistribute it and/or modify it diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index 6ce5521fa..0a643a225 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -1,5 +1,5 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021 Centrifuge Foundation (centrifuge.io). -// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index db07a0ca5..22f3e2b88 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -1,5 +1,6 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Centrifuge GmbH (centrifuge.io). -// Copyright 2022 Forecasting Technologies LTD. +// // This file is part of Zeitgeist. // // Zeitgeist is free software: you can redistribute it and/or modify it diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs index 757e13be5..0737250aa 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs @@ -1,5 +1,5 @@ -// Copyright 2021 Centrifuge Foundation (centrifuge.io). // Copyright 2022 Forecasting Technologies LTD. +// Copyright 2021 Centrifuge Foundation (centrifuge.io). // // This file is part of Zeitgeist. // diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index 9b7f19032..78024b55a 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -1,5 +1,5 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021 Centrifuge Foundation (centrifuge.io). -// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index f8759964a..009e36a53 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index 7cfd9097c..ef89f038f 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index d6eef76ad..712331c8f 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/runtime/zeitgeist/src/xcm_config/asset_registry.rs b/runtime/zeitgeist/src/xcm_config/asset_registry.rs index 07d62519c..1b2f16f11 100644 --- a/runtime/zeitgeist/src/xcm_config/asset_registry.rs +++ b/runtime/zeitgeist/src/xcm_config/asset_registry.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index 0b1b83b6c..b390cf765 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/runtime/zeitgeist/src/xcm_config/fees.rs b/runtime/zeitgeist/src/xcm_config/fees.rs index bc188eafc..825a20f87 100644 --- a/runtime/zeitgeist/src/xcm_config/fees.rs +++ b/runtime/zeitgeist/src/xcm_config/fees.rs @@ -1,5 +1,5 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021 Centrifuge Foundation (centrifuge.io). -// Copyright 2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. // diff --git a/runtime/zeitgeist/src/xcm_config/mod.rs b/runtime/zeitgeist/src/xcm_config/mod.rs index 363ac87b1..448000ebe 100644 --- a/runtime/zeitgeist/src/xcm_config/mod.rs +++ b/runtime/zeitgeist/src/xcm_config/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/authorized/src/benchmarks.rs b/zrml/authorized/src/benchmarks.rs index b2f590903..d4f349161 100644 --- a/zrml/authorized/src/benchmarks.rs +++ b/zrml/authorized/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index bcb064678..64619a232 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/authorized/src/migrations.rs b/zrml/authorized/src/migrations.rs index 55d6e03fb..13a374949 100644 --- a/zrml/authorized/src/migrations.rs +++ b/zrml/authorized/src/migrations.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/authorized/src/mock.rs b/zrml/authorized/src/mock.rs index 49517fc84..53e3a07eb 100644 --- a/zrml/authorized/src/mock.rs +++ b/zrml/authorized/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/authorized/src/mock_storage.rs b/zrml/authorized/src/mock_storage.rs index c7908fa55..d4ea04efc 100644 --- a/zrml/authorized/src/mock_storage.rs +++ b/zrml/authorized/src/mock_storage.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. diff --git a/zrml/authorized/src/tests.rs b/zrml/authorized/src/tests.rs index 7cd33883c..f1a0901d1 100644 --- a/zrml/authorized/src/tests.rs +++ b/zrml/authorized/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index 2aaa24742..685066985 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/court/src/benchmarks.rs b/zrml/court/src/benchmarks.rs index e1b86b30c..d78f614d1 100644 --- a/zrml/court/src/benchmarks.rs +++ b/zrml/court/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index 09671e0b1..cc258e378 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/court/src/mock.rs b/zrml/court/src/mock.rs index fd33e1859..8152b44b7 100644 --- a/zrml/court/src/mock.rs +++ b/zrml/court/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/court/src/tests.rs b/zrml/court/src/tests.rs index a383ac109..46624e6a5 100644 --- a/zrml/court/src/tests.rs +++ b/zrml/court/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index 48d68f719..96b5e68a9 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/global-disputes/src/benchmarks.rs b/zrml/global-disputes/src/benchmarks.rs index 486d08cae..2c7788b31 100644 --- a/zrml/global-disputes/src/benchmarks.rs +++ b/zrml/global-disputes/src/benchmarks.rs @@ -1,5 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. -// Copyright 2022 Zeitgeist PM LLC. +// Copyright 2022-2023 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/global-disputes/src/global_disputes_pallet_api.rs b/zrml/global-disputes/src/global_disputes_pallet_api.rs index b4a14cae7..26682c768 100644 --- a/zrml/global-disputes/src/global_disputes_pallet_api.rs +++ b/zrml/global-disputes/src/global_disputes_pallet_api.rs @@ -1,4 +1,4 @@ -// Copyright 2021-2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/global-disputes/src/lib.rs b/zrml/global-disputes/src/lib.rs index e71ed9e76..5d442f72a 100644 --- a/zrml/global-disputes/src/lib.rs +++ b/zrml/global-disputes/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2021-2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/global-disputes/src/mock.rs b/zrml/global-disputes/src/mock.rs index 94c87681d..f865ca367 100644 --- a/zrml/global-disputes/src/mock.rs +++ b/zrml/global-disputes/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2021-2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/global-disputes/src/tests.rs b/zrml/global-disputes/src/tests.rs index 8c46b357d..4af2596ba 100644 --- a/zrml/global-disputes/src/tests.rs +++ b/zrml/global-disputes/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2021-2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/global-disputes/src/types.rs b/zrml/global-disputes/src/types.rs index 3801890b5..63b7c42e7 100644 --- a/zrml/global-disputes/src/types.rs +++ b/zrml/global-disputes/src/types.rs @@ -1,3 +1,20 @@ +// Copyright 2022 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, 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. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + use frame_support::pallet_prelude::{Decode, Encode, MaxEncodedLen, TypeInfo}; use sp_runtime::traits::Saturating; use zeitgeist_primitives::types::OutcomeReport; diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index 5e8a03f6d..abf1738a7 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/benchmarks.rs b/zrml/liquidity-mining/src/benchmarks.rs index b710d21fd..3afa80121 100644 --- a/zrml/liquidity-mining/src/benchmarks.rs +++ b/zrml/liquidity-mining/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/lib.rs b/zrml/liquidity-mining/src/lib.rs index 76cc13ac2..186f85bf5 100644 --- a/zrml/liquidity-mining/src/lib.rs +++ b/zrml/liquidity-mining/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/mock.rs b/zrml/liquidity-mining/src/mock.rs index b4660ff92..b4b48eb69 100644 --- a/zrml/liquidity-mining/src/mock.rs +++ b/zrml/liquidity-mining/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/tests.rs b/zrml/liquidity-mining/src/tests.rs index 8486df344..818be27f0 100644 --- a/zrml/liquidity-mining/src/tests.rs +++ b/zrml/liquidity-mining/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs b/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs index 877fd8f60..b62893e30 100644 --- a/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs +++ b/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs b/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs index eb6af7b38..1efbacf0d 100644 --- a/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs +++ b/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/liquidity-mining/src/weights.rs b/zrml/liquidity-mining/src/weights.rs index 42b49e781..5a8c215f4 100644 --- a/zrml/liquidity-mining/src/weights.rs +++ b/zrml/liquidity-mining/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/market-commons/src/lib.rs b/zrml/market-commons/src/lib.rs index 3ba87e9ee..a5894c1e7 100644 --- a/zrml/market-commons/src/lib.rs +++ b/zrml/market-commons/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/market-commons/src/migrations.rs b/zrml/market-commons/src/migrations.rs index 69edb3f6a..361b3949a 100644 --- a/zrml/market-commons/src/migrations.rs +++ b/zrml/market-commons/src/migrations.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/market-commons/src/mock.rs b/zrml/market-commons/src/mock.rs index 46f374882..3613179fc 100644 --- a/zrml/market-commons/src/mock.rs +++ b/zrml/market-commons/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/market-commons/src/tests.rs b/zrml/market-commons/src/tests.rs index e0d9cbabf..2d027bb95 100644 --- a/zrml/market-commons/src/tests.rs +++ b/zrml/market-commons/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/orderbook-v1/src/benchmarks.rs b/zrml/orderbook-v1/src/benchmarks.rs index d6e63dd92..64a88e9d3 100644 --- a/zrml/orderbook-v1/src/benchmarks.rs +++ b/zrml/orderbook-v1/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/orderbook-v1/src/mock.rs b/zrml/orderbook-v1/src/mock.rs index 6b71f3c2d..6cecf478d 100644 --- a/zrml/orderbook-v1/src/mock.rs +++ b/zrml/orderbook-v1/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/orderbook-v1/src/weights.rs b/zrml/orderbook-v1/src/weights.rs index a02f0b030..bd6a5ea3a 100644 --- a/zrml/orderbook-v1/src/weights.rs +++ b/zrml/orderbook-v1/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/fuzz/pm_full_workflow.rs b/zrml/prediction-markets/fuzz/pm_full_workflow.rs index 0ca237096..920f748cb 100644 --- a/zrml/prediction-markets/fuzz/pm_full_workflow.rs +++ b/zrml/prediction-markets/fuzz/pm_full_workflow.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index f6e0cebe4..b53f53d07 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies Ltd. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index bf8ff9213..7fda9ce26 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/migrations.rs b/zrml/prediction-markets/src/migrations.rs index 1f6fab770..15c18bf56 100644 --- a/zrml/prediction-markets/src/migrations.rs +++ b/zrml/prediction-markets/src/migrations.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index b537658c6..792a425b9 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/orml_asset_registry.rs b/zrml/prediction-markets/src/orml_asset_registry.rs index 6b277518e..ebabafa10 100644 --- a/zrml/prediction-markets/src/orml_asset_registry.rs +++ b/zrml/prediction-markets/src/orml_asset_registry.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies Ltd. +// Copyright 2023 Forecasting Technologies Ltd. // Copyright 2021 Centrifuge Foundation (centrifuge.io). // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 576e34ea1..35b15307b 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies Ltd. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index bc8659033..4480c5ea7 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies Ltd. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/rikiddo/src/tests/pallet.rs b/zrml/rikiddo/src/tests/pallet.rs index b7242b4bb..c734068d2 100644 --- a/zrml/rikiddo/src/tests/pallet.rs +++ b/zrml/rikiddo/src/tests/pallet.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index f0e7a5f5c..fb4308b53 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index a127cf5a8..af96ecece 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/simple-disputes/src/tests.rs b/zrml/simple-disputes/src/tests.rs index 05b93a356..f9e9d87af 100644 --- a/zrml/simple-disputes/src/tests.rs +++ b/zrml/simple-disputes/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/styx/src/benchmarks.rs b/zrml/styx/src/benchmarks.rs index 684663da9..cfd7ffcde 100644 --- a/zrml/styx/src/benchmarks.rs +++ b/zrml/styx/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/styx/src/weights.rs b/zrml/styx/src/weights.rs index ec465bab8..76ca25625 100644 --- a/zrml/styx/src/weights.rs +++ b/zrml/styx/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/rpc/src/lib.rs b/zrml/swaps/rpc/src/lib.rs index 7d62e1da9..a694d908d 100644 --- a/zrml/swaps/rpc/src/lib.rs +++ b/zrml/swaps/rpc/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/runtime-api/src/lib.rs b/zrml/swaps/runtime-api/src/lib.rs index bd7fc3c48..50aa9264e 100644 --- a/zrml/swaps/runtime-api/src/lib.rs +++ b/zrml/swaps/runtime-api/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/src/arbitrage.rs b/zrml/swaps/src/arbitrage.rs index 3b9f1c680..6d1878083 100644 --- a/zrml/swaps/src/arbitrage.rs +++ b/zrml/swaps/src/arbitrage.rs @@ -1,4 +1,4 @@ -// Copyright 2021-2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index 7698325d5..a8e8990d4 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index 2b14990c7..b2a56dc16 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index 527f311da..19b7031a0 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/src/root.rs b/zrml/swaps/src/root.rs index c1cc94175..4e1222e4f 100644 --- a/zrml/swaps/src/root.rs +++ b/zrml/swaps/src/root.rs @@ -1,4 +1,4 @@ -// Copyright 2021-2022 Zeitgeist PM LLC. +// Copyright 2022 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index f6976cd3b..9c0cff2d7 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/src/utils.rs b/zrml/swaps/src/utils.rs index 893c410b0..f35314271 100644 --- a/zrml/swaps/src/utils.rs +++ b/zrml/swaps/src/utils.rs @@ -1,3 +1,4 @@ +// Copyright 2022 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index db45bbe7f..f74979c4f 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. From c2c7ce9e73b63c812e1f5bb96be23cfb2d09728c Mon Sep 17 00:00:00 2001 From: Nikhil Saboo <36529278+saboonikhil@users.noreply.github.com> Date: Tue, 14 Feb 2023 22:29:42 +0530 Subject: [PATCH 23/53] Delete types.json (#973) Since both the sdks deduce types from the metadata for a while now, we can strike off the requirement of updating this file whenever related changes occur. --- misc/types.json | 347 ------------------------------------------------ 1 file changed, 347 deletions(-) delete mode 100644 misc/types.json diff --git a/misc/types.json b/misc/types.json deleted file mode 100644 index 1484a1354..000000000 --- a/misc/types.json +++ /dev/null @@ -1,347 +0,0 @@ -{ - "alias": { - "tokens": { - "AccountData": "TokensAccountData" - } - }, - "AccountData": { - "free": "Balance", - "reserved": "Balance", - "miscFrozen": "Balance", - "feeFrozen": "Balance" - }, - "Address": "MultiAddress", - "Amount": "i128", - "AmountOf": "i128", - "Asset": { - "_enum": { - "CategoricalOutcome": "(MarketId, CategoryIndex)", - "ScalarOutcome": "(MarketId, ScalarPosition)", - "CombinatorialOutcome": null, - "PoolShare": "u128", - "ZTG": null - } - }, - "AuthorId": "AccountId", - "BlockNumber": "u64", - "Bond": { - "owner": "AccountId", - "amount": "Balance" - }, - "CategoryIndex": "u16", - "Collator2": { - "id": "AccountId", - "bond": "Balance", - "nominators": "Vec", - "topNominators": "Vec", - "bottomNominators": "Vec", - "totalCounted": "Balance", - "totalBacking": "Balance", - "state": "CollatorStatus" - }, - "CollatorSnapshot": { - "bond": "Balance", - "delegations": "Vec", - "total": "Balance" - }, - "CollatorStatus": { - "_enum": { - "Active": null, - "Idle": null, - "Leaving": "RoundIndex" - } - }, - "CommonPoolEventParams": { - "poolId": "u128", - "who": "AccountId" - }, - "Currency": "Asset", - "CurrencyId": "Asset", - "CurrencyIdOf": "Asset", - "DelegatorStatus": { - "_enum": { - "Active": null, - "Leaving": "RoundIndex" - } - }, - "EmaConfig": { - "emaPeriod": "Timespan", - "emaPeriodEstimateAfter": "Option", - "smoothing": "u128" - }, - "EmaMarketVolume": { - "config": "EmaConfig", - "ema": "u128", - "multiplier": "u128", - "lastTime": "UnixTimestamp", - "state": "MarketVolumeState", - "startTime": "UnixTimestamp", - "volumesPerPeriod": "u128" - }, - "ExitQ": { - "candidates": "Vec", - "nominatorsLeaving": "Vec", - "candidateSchedule": "Vec<(AccountId, RoundIndex)>", - "nominatorSchedule": "Vec<(AccountId, Option, RoundIndex)>" - }, - "FeeSigmoid": { - "config": "FeeSigmoidConfig" - }, - "FeeSigmoidConfig": { - "m": "i128", - "p": "i128", - "n": "i128", - "initialFee": "i128", - "minRevenue": "i128" - }, - "Index": "u64", - "InflationInfo": { - "expect": "RangeBalance", - "annual": "RangePerbill", - "round": "RangePerbill" - }, - "Juror": { - "status": "JurorStatus" - }, - "JurorStatus": { - "_enum": [ - "Ok", - "Tardy" - ] - }, - "Lookup": "MultiAddress", - "Market": { - "creator": "AccountId", - "creation": "MarketCreation", - "creatorFee": "u8", - "oracle": "AccountId", - "metadata": "Vec", - "marketType": "MarketType", - "period": "MarketPeriod", - "scoringRule": "ScoringRule", - "status": "MarketStatus", - "report": "Option", - "resolvedOutcome": "Option", - "dispute_mechanism": "MarketDisputeMechanism" - }, - "MarketCreation": { - "_enum": [ - "Permissionless", - "Advised" - ] - }, - "MarketDispute": { - "at": "BlockNumber", - "by": "AccountId", - "outcome": "OutcomeReport" - }, - "MarketDisputeMechanism": { - "_enum": { - "Authorized": "AccountId", - "Court": null, - "SimpleDisputes": null - } - }, - "MarketId": "u128", - "MarketIdOf": "u128", - "MarketPeriod": { - "_enum": { - "Block": "Range", - "Timestamp": "Range" - } - }, - "MarketStatus": { - "_enum": [ - "Proposed", - "Active", - "Suspended", - "Closed", - "CollectingSubsidy", - "InsufficientSubsidy", - "Reported", - "Disputed", - "Resolved" - ] - }, - "MarketType": { - "_enum": { - "Categorical": "u16", - "Scalar": "RangeInclusive" - } - }, - "MarketVolumeState": { - "_enum": [ - "Uninitialized", - "DataCollectionStarted", - "DataCollected" - ] - }, - "MaxRuntimeUsize": "u64", - "Moment": "u64", - "MultiHash": { - "_enum": { - "Sha3_384": "[u8; 50]" - } - }, - "Nominator2": { - "delegations": "Vec", - "revocations": "Vec", - "total": "Balance", - "scheduledRevocationsCount": "u32", - "scheduledRevocationsTotal": "Balance", - "status": "DelegatorStatus" - }, - "NominatorAdded": { - "_enum": { - "AddedToTop": "Balance", - "AddedToBottom": null - } - }, - "Order": { - "side": "OrderSide", - "maker": "AccountId", - "taker": "Option", - "asset": "Asset", - "total": "Balance", - "price": "Balance", - "filled": "Balance" - }, - "OrderSide": { - "_enum": [ - "Bid", - "Ask" - ] - }, - "OrderedSet": "Vec", - "OwnedValuesParams": { - "participatedBlocks": "BlockNumber", - "perpetualIncentives": "Balance", - "totalIncentives": "Balance", - "totalShares": "Balance" - }, - "RangeBalance": { - "min": "Balance", - "ideal": "Balance", - "max": "Balance" - }, - "RangePerbill": { - "min": "Perbill", - "ideal": "Perbill", - "max": "Perbill" - }, - "RelayChainAccountId": "AccountId32", - "RewardInfo": { - "totalReward": "Balance", - "claimedReward": "Balance" - }, - "Rikiddo": { - "config": "RikiddoConfig", - "fees": "FeeSigmoid", - "maShort": "EmaMarketVolume", - "maLong": "EmaMarketVolume" - }, - "RikiddoConfig": { - "initialFee": "i128", - "log2E": "i128" - }, - "ScoringRule": { - "_enum": [ - "CPMM", - "RikiddoSigmoidFeeMarketEma" - ] - }, - "OutcomeReport": { - "_enum": { - "Categorical": "u16", - "Scalar": "u128" - } - }, - "ParachainBondConfig": { - "account": "AccountId", - "percent": "Percent" - }, - "Pool": { - "assets": "Vec", - "baseAsset": "Asset", - "marketId": "MarketId", - "poolStatus": "PoolStatus", - "scoringRule": "ScoringRule", - "swapFee": "Option", - "totalSubsidy": "Option", - "totalWeight": "Option", - "weights": "Option>" - }, - "PoolAssetEvent": { - "asset": "Asset", - "bound": "Balance", - "cpep": "CommonPoolEventParams", - "transferred": "Balance" - }, - "PoolAssetsEvent": { - "assets": "Vec", - "bounds": "Vec", - "cpep": "CommonPoolEventParams", - "transferred": "Vec" - }, - "PoolId": "u128", - "PoolStatus": { - "_enum": [ - "Active", - "CollectingSubsidy", - "Closed", - "Clean", - "Initialized" - ] - }, - "RegistrationInfo": { - "account": "AccountId", - "deposit": "Balance" - }, - "Report": { - "at": "BlockNumber", - "by": "AccountId", - "outcome": "OutcomeReport" - }, - "RoundInfo": { - "current": "RoundIndex", - "first": "BlockNumber", - "length": "u32" - }, - "RoundIndex": "u32", - "ScalarPosition": { - "_enum": [ - "Long", - "Short" - ] - }, - "SerdeWrapper": "Balance", - "SubsidyUntil": { - "marketId": "MarketId", - "period": "MarketPeriod" - }, - "SwapEvent": { - "assetAmountIn": "Balance", - "assetAmountOut": "Balance", - "assetBound": "Balance", - "assetIn": "Asset", - "assetOut": "Asset", - "cpep": "CommonPoolEventParams", - "maxPrice": "Balance" - }, - "Timespan": { - "_enum": { - "Seconds": "u32", - "Minutes": "u32", - "Hours": "u32", - "Days": "u16", - "Weeks": "u16" - } - }, - "TokensAccountData": { - "free": "Balance", - "reserved": "Balance", - "frozen": "Balance" - }, - "UnixTimestamp": "u64", - "VestingBlockNumber": "u32" -} From 1f7ea6192eb9ad5921a99ad959e14d9065d8ca09 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Thu, 23 Feb 2023 12:49:42 +0100 Subject: [PATCH 24/53] Adjust Advisory Committee voting ratios (#975) * Adjust Advisory Committee's voting ratios * Remove unused imports * Fix imports * Change `request_edit` threshold to 30% * Fix formatting * Fix voting ratios * Fix name of 1/3 AC --- node/src/chain_spec/battery_station.rs | 3 ++- node/src/chain_spec/dev.rs | 3 ++- node/src/chain_spec/zeitgeist.rs | 3 ++- runtime/battery-station/src/lib.rs | 1 + runtime/common/src/lib.rs | 37 +++++++++++++++----------- runtime/zeitgeist/src/lib.rs | 2 +- 6 files changed, 29 insertions(+), 20 deletions(-) diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index ee3c9809c..fb4556f72 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -26,7 +26,7 @@ use sc_service::ChainType; use sp_core::crypto::UncheckedInto; use zeitgeist_primitives::{ constants::{ - ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD, STAKING_PTD}, + ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD}, BASE, }, types::AccountId, @@ -40,6 +40,7 @@ use { CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, DefaultParachainBondReservePercent, EligibilityValue, PolkadotXcmConfig, }, + zeitgeist_primitives::constants::ztg::STAKING_PTD, zeitgeist_primitives::constants::ztg::TOTAL_INITIAL_ZTG, }; diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index 558a132d9..146c5c9b7 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -31,13 +31,14 @@ use battery_station_runtime::{ use sc_service::ChainType; use sp_core::sr25519; use zeitgeist_primitives::{ - constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD, STAKING_PTD}, + constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD}, types::Balance, }; #[cfg(feature = "parachain")] use { super::battery_station::inflation_config, sp_runtime::Perbill, + zeitgeist_primitives::constants::ztg::STAKING_PTD, zeitgeist_primitives::constants::{ztg::TOTAL_INITIAL_ZTG, BASE}, }; diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index b0901e44d..932c7dc57 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -27,12 +27,13 @@ use sc_service::ChainType; use sp_core::crypto::UncheckedInto; use zeitgeist_runtime::parameters::SS58Prefix; -use zeitgeist_primitives::constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD, STAKING_PTD}; +use zeitgeist_primitives::constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PTD}; #[cfg(feature = "parachain")] use { super::{generate_inflation_config_function, Extensions}, crate::KUSAMA_PARACHAIN_ID, + zeitgeist_primitives::constants::ztg::STAKING_PTD, zeitgeist_primitives::constants::ztg::TOTAL_INITIAL_ZTG, zeitgeist_runtime::{ CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 7d32f7f94..7d74f2494 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -35,6 +35,7 @@ pub use frame_system::{ #[cfg(feature = "parachain")] pub use pallet_author_slot_filter::EligibilityValue; pub use pallet_balances::Call as BalancesCall; +use pallet_collective::EnsureProportionMoreThan; #[cfg(feature = "parachain")] pub use crate::parachain_params::*; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 1888f9ff2..cd74fcbf1 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -133,14 +133,25 @@ macro_rules! decl_common_types { EnsureProportionAtLeast, >; - // Advisory committee vote proportions - // At least 50% - type EnsureRootOrHalfAdvisoryCommittee = EitherOfDiverse< + // Advisory Committee vote proportions + // More than 33% + type EnsureRootOrMoreThanOneThirdAdvisoryCommittee = EitherOfDiverse< EnsureRoot, - EnsureProportionAtLeast, + EnsureProportionMoreThan, + >; + + // More than 50% + type EnsureRootOrMoreThanHalfAdvisoryCommittee = EitherOfDiverse< + EnsureRoot, + EnsureProportionMoreThan, + >; + + // More than 66% + type EnsureRootOrMoreThanTwoThirdsAdvisoryCommittee = EitherOfDiverse< + EnsureRoot, + EnsureProportionMoreThan, >; - // Technical committee vote proportions // At least 66% type EnsureRootOrTwoThirdsAdvisoryCommittee = EitherOfDiverse< EnsureRoot, @@ -920,7 +931,7 @@ macro_rules! impl_config_traits { impl parachain_info::Config for Runtime {} impl zrml_authorized::Config for Runtime { - type AuthorizedDisputeResolutionOrigin = EnsureRootOrHalfAdvisoryCommittee; + type AuthorizedDisputeResolutionOrigin = EnsureRootOrMoreThanHalfAdvisoryCommittee; type CorrectionPeriod = CorrectionPeriod; type DisputeResolution = zrml_prediction_markets::Pallet; type Event = Event; @@ -980,13 +991,10 @@ macro_rules! impl_config_traits { impl zrml_prediction_markets::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; - type ApproveOrigin = EitherOfDiverse< - EnsureRoot, - pallet_collective::EnsureMember - >; + type ApproveOrigin = EnsureRootOrMoreThanOneThirdAdvisoryCommittee; type Authorized = Authorized; type Court = Court; - type CloseOrigin = EnsureRootOrTwoThirdsAdvisoryCommittee; + type CloseOrigin = EnsureRoot; type DestroyOrigin = EnsureRootOrAllAdvisoryCommittee; type DisputeBond = DisputeBond; type DisputeFactor = DisputeFactor; @@ -1015,11 +1023,8 @@ macro_rules! impl_config_traits { type OracleBond = OracleBond; type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; - type RejectOrigin = EnsureRootOrHalfAdvisoryCommittee; - type RequestEditOrigin = EitherOfDiverse< - EnsureRoot, - pallet_collective::EnsureMember, - >; + type RejectOrigin = EnsureRootOrMoreThanTwoThirdsAdvisoryCommittee; + type RequestEditOrigin = EnsureRootOrMoreThanOneThirdAdvisoryCommittee; type ResolveOrigin = EnsureRoot; type AssetManager = AssetManager; #[cfg(feature = "parachain")] diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 009e36a53..59fd70ed0 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -45,7 +45,7 @@ use frame_support::{ weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee}, }; use frame_system::EnsureRoot; -use pallet_collective::{EnsureProportionAtLeast, PrimeDefaultVote}; +use pallet_collective::{EnsureProportionAtLeast, EnsureProportionMoreThan, PrimeDefaultVote}; use pallet_transaction_payment::ChargeTransactionPayment; use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}; #[cfg(feature = "std")] From 201c662af0378986b7374f5e08eecaba8c73cfc7 Mon Sep 17 00:00:00 2001 From: Chralt Date: Fri, 31 Mar 2023 11:55:28 +0200 Subject: [PATCH 25/53] Use rust default toolchain for ci tests (#993) --- .github/workflows/rust.yml | 9 +-------- rust-toolchain | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6921659a6..4af14a7ae 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,14 +76,7 @@ jobs: uses: actions/checkout@v2 - name: Install rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - target: wasm32-unknown-unknown - default: true - override: true - profile: minimal - components: rustfmt, clippy, llvm-tools-preview + run: rustup show - uses: actions-rs/install@v0.1 with: diff --git a/rust-toolchain b/rust-toolchain index 11954de2c..2277d1a71 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,5 +1,5 @@ [toolchain] channel = "nightly-2022-09-24" -components = ["clippy", "rustfmt"] +components = ["clippy", "rustfmt", "llvm-tools-preview"] profile = "minimal" targets = ["wasm32-unknown-unknown"] From 6a5dae277962c235bf69be0f50faa1fc3710eb61 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Mon, 3 Apr 2023 16:38:59 +0200 Subject: [PATCH 26/53] Move BS to Rococo and Zeitgeist to Polkadot (#992) * Prepare chainspec and client for Polkadot parachain (#989) * Adjust chainspecs and clients * Bump runtime version * Use DOT in Zeitgeist XCM integration tests * Use Rococo in Battery Station XCM tests --- Cargo.lock | 4 +-- integration-tests/package-lock.json | 2 +- node/res/bs_parachain.json | 6 ++-- node/res/zeitgeist_parachain.json | 6 ++-- node/src/chain_spec/battery_station.rs | 1 + node/src/chain_spec/dev.rs | 1 + node/src/chain_spec/mod.rs | 2 ++ node/src/chain_spec/zeitgeist.rs | 12 +++---- node/src/command.rs | 2 +- node/src/main.rs | 6 ++-- node/src/service/service_parachain.rs | 4 +-- runtime/battery-station/Cargo.toml | 16 ++++----- .../src/integration_tests/xcm/setup.rs | 10 +++--- .../src/integration_tests/xcm/test_net.rs | 20 +++++------ .../integration_tests/xcm/tests/transfers.rs | 34 +++++++++--------- runtime/battery-station/src/lib.rs | 4 +-- .../battery-station/src/xcm_config/config.rs | 2 +- runtime/common/src/lib.rs | 11 ------ runtime/zeitgeist/Cargo.toml | 8 ++--- .../src/integration_tests/xcm/setup.rs | 14 ++++---- .../src/integration_tests/xcm/test_net.rs | 20 +++++------ .../integration_tests/xcm/tests/transfers.rs | 36 +++++++++---------- runtime/zeitgeist/src/lib.rs | 4 +-- runtime/zeitgeist/src/parachain_params.rs | 2 +- runtime/zeitgeist/src/xcm_config/config.rs | 2 +- scripts/parachain/bootstrap.sh | 2 +- scripts/parachain/local.sh | 2 +- 27 files changed, 113 insertions(+), 120 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8383998b6..bb4ae6a7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -452,7 +452,6 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", - "kusama-runtime", "log", "nimbus-primitives", "orml-asset-registry", @@ -493,6 +492,7 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "polkadot-runtime-parachains", + "rococo-runtime", "scale-info", "session-keys-primitives", "sp-api", @@ -12792,7 +12792,6 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", - "kusama-runtime", "log", "nimbus-primitives", "orml-asset-registry", @@ -12831,6 +12830,7 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", + "polkadot-runtime", "polkadot-runtime-parachains", "scale-info", "session-keys-primitives", diff --git a/integration-tests/package-lock.json b/integration-tests/package-lock.json index 95ee09cd1..996ae53cd 100644 --- a/integration-tests/package-lock.json +++ b/integration-tests/package-lock.json @@ -3297,7 +3297,7 @@ "string.prototype.trimstart": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgroccWwziwYuZw==", "dev": true, "requires": { "call-bind": "^1.0.2", diff --git a/node/res/bs_parachain.json b/node/res/bs_parachain.json index b34034a25..24eae3dbe 100644 --- a/node/res/bs_parachain.json +++ b/node/res/bs_parachain.json @@ -16,14 +16,14 @@ 0 ] ], - "protocolId": "battery_station_v2", + "protocolId": "battery_station_v3", "properties": { "ss58Format": 73, "tokenDecimals": 10, "tokenSymbol": "ZBS" }, - "parachain_id": 2050, - "relay_chain": "battery_station_relay_v3", + "parachain_id": 2101, + "relay_chain": "rococo", "consensusEngine": null, "codeSubstitutes": {}, "genesis": { diff --git a/node/res/zeitgeist_parachain.json b/node/res/zeitgeist_parachain.json index 1b956577b..18802a0af 100644 --- a/node/res/zeitgeist_parachain.json +++ b/node/res/zeitgeist_parachain.json @@ -18,14 +18,14 @@ 0 ] ], - "protocolId": "zeitgeist", + "protocolId": "zeitgeist-polkadot", "properties": { "ss58Format": 73, "tokenDecimals": 10, "tokenSymbol": "ZTG" }, - "parachain_id": 2101, - "relay_chain": "kusama", + "parachain_id": 2092, + "relay_chain": "polkadot", "consensusEngine": null, "codeSubstitutes": {}, "genesis": { diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index fb4556f72..2da6d4c22 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -161,6 +161,7 @@ pub fn battery_station_staging_config() -> Result Result { crate::chain_spec::Extensions { relay_chain: "rococo-dev".into(), parachain_id: crate::BATTERY_STATION_PARACHAIN_ID, + bad_blocks: None, }, #[cfg(not(feature = "parachain"))] Default::default(), diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index acfed5ee2..bedb1a0f5 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -228,6 +228,8 @@ pub struct Extensions { pub parachain_id: u32, /// The relay chain of the Parachain. pub relay_chain: String, + /// Known bad block hashes. + pub bad_blocks: sc_client_api::BadBlocks, } #[cfg(feature = "parachain")] diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index 932c7dc57..ab0a0420e 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -32,9 +32,8 @@ use zeitgeist_primitives::constants::ztg::{LIQUIDITY_MINING, LIQUIDITY_MINING_PT #[cfg(feature = "parachain")] use { super::{generate_inflation_config_function, Extensions}, - crate::KUSAMA_PARACHAIN_ID, - zeitgeist_primitives::constants::ztg::STAKING_PTD, - zeitgeist_primitives::constants::ztg::TOTAL_INITIAL_ZTG, + crate::POLKADOT_PARACHAIN_ID, + zeitgeist_primitives::constants::ztg::{STAKING_PTD, TOTAL_INITIAL_ZTG}, zeitgeist_runtime::{ CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, DefaultParachainBondReservePercent, EligibilityValue, MinCollatorStk, PolkadotXcmConfig, @@ -150,7 +149,7 @@ pub fn zeitgeist_staging_config() -> Result { generic_genesis( additional_chain_spec_staging_zeitgeist( #[cfg(feature = "parachain")] - KUSAMA_PARACHAIN_ID.into(), + POLKADOT_PARACHAIN_ID.into(), ), endowed_accounts_staging_zeitgeist(), wasm, @@ -163,8 +162,9 @@ pub fn zeitgeist_staging_config() -> Result { Some(token_properties("ZTG", SS58Prefix::get())), #[cfg(feature = "parachain")] crate::chain_spec::Extensions { - relay_chain: "kusama".into(), - parachain_id: KUSAMA_PARACHAIN_ID, + relay_chain: "polkadot".into(), + parachain_id: POLKADOT_PARACHAIN_ID, + bad_blocks: None, }, #[cfg(not(feature = "parachain"))] Default::default(), diff --git a/node/src/command.rs b/node/src/command.rs index 2e63c259d..40f02340f 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -488,7 +488,7 @@ fn none_command(cli: &Cli) -> sc_cli::Result<()> { ); let parachain_id = cumulus_primitives_core::ParaId::from( - cli.parachain_id.or(parachain_id_extension).unwrap_or(super::KUSAMA_PARACHAIN_ID), + cli.parachain_id.or(parachain_id_extension).unwrap_or(super::POLKADOT_PARACHAIN_ID), ); let parachain_account = diff --git a/node/src/main.rs b/node/src/main.rs index 3c6dee50a..256b159d6 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -35,9 +35,9 @@ pub const ZEITGEIST_RUNTIME_NOT_AVAILABLE: &str = "Zeitgeist runtime is not avai cfg_if::cfg_if!( if #[cfg(feature = "parachain")] { - const KUSAMA_PARACHAIN_ID: u32 = 2101; - const BATTERY_STATION_PARACHAIN_ID: u32 = 2050; - const KUSAMA_BLOCK_DURATION: core::time::Duration = core::time::Duration::from_secs(6); + const POLKADOT_PARACHAIN_ID: u32 = 2092; + const BATTERY_STATION_PARACHAIN_ID: u32 = 2101; + const POLKADOT_BLOCK_DURATION: core::time::Duration = core::time::Duration::from_secs(6); const SOFT_DEADLINE_PERCENT: sp_runtime::Percent = sp_runtime::Percent::from_percent(100); } ); diff --git a/node/src/service/service_parachain.rs b/node/src/service/service_parachain.rs index b7aab566a..9129f3279 100644 --- a/node/src/service/service_parachain.rs +++ b/node/src/service/service_parachain.rs @@ -18,7 +18,7 @@ use crate::{ service::{AdditionalRuntimeApiCollection, RuntimeApiCollection}, - KUSAMA_BLOCK_DURATION, SOFT_DEADLINE_PERCENT, + POLKADOT_BLOCK_DURATION, SOFT_DEADLINE_PERCENT, }; use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_common::ParachainConsensus; @@ -347,7 +347,7 @@ where Arc::new(move |hash, data| network.announce_block(hash, data)) }; - let relay_chain_slot_duration = KUSAMA_BLOCK_DURATION; + let relay_chain_slot_duration = POLKADOT_BLOCK_DURATION; if collator { let parachain_consensus = build_consensus( diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 5748d0ff0..c1c862cc5 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -88,7 +88,6 @@ hex-literal = { default-features = false, optional = true, version = "0.3.4" } log = { version = "0.4.17", default-features = false, optional = true } # XCM -kusama-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } orml-unknown-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } orml-xcm-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } @@ -96,6 +95,7 @@ orml-xtokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } polkadot-runtime-parachains = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +rococo-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } xcm-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } xcm-executor = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } @@ -148,14 +148,14 @@ parachain = [ # XCM - "kusama-runtime", - "polkadot-primitives", - "polkadot-runtime-parachains", "orml-asset-registry", "orml-unknown-tokens", "orml-xcm-support", "orml-xtokens", "pallet-xcm", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rococo-runtime", "xcm-builder", "xcm-executor", "xcm", @@ -173,7 +173,6 @@ runtime-benchmarks = [ "frame-system-benchmarking", "frame-system/runtime-benchmarks", "hex-literal", - "kusama-runtime?/runtime-benchmarks", "orml-asset-registry?/runtime-benchmarks", "orml-tokens/runtime-benchmarks", "orml-benchmarking", @@ -198,6 +197,7 @@ runtime-benchmarks = [ "pallet-vesting/runtime-benchmarks", "pallet-xcm?/runtime-benchmarks", "pallet-parachain-staking?/runtime-benchmarks", + "rococo-runtime?/runtime-benchmarks", "nimbus-primitives?/runtime-benchmarks", "session-keys-primitives?/runtime-benchmarks", "sp-runtime/runtime-benchmarks", @@ -295,14 +295,14 @@ std = [ # XCM - "kusama-runtime?/std", - "polkadot-primitives?/std", - "polkadot-runtime-parachains?/std", "orml-asset-registry?/std", "orml-unknown-tokens?/std", "orml-xcm-support?/std", "orml-xtokens?/std", "pallet-xcm?/std", + "polkadot-primitives?/std", + "polkadot-runtime-parachains?/std", + "rococo-runtime?/std", "xcm-builder?/std", "xcm-executor?/std", "xcm?/std", diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index 159efedcd..1ef5f52b0 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -151,12 +151,12 @@ pub(super) fn register_foreign_sibling(additional_meta: Option) } pub(super) fn register_foreign_parent(additional_meta: Option) { - // Register KSM as foreign asset in the sibling parachain + // Register roc as foreign asset in the sibling parachain let meta: AssetMetadata = AssetMetadata { decimals: 12, - name: "Kusama".into(), - symbol: "KSM".into(), - existential_deposit: 10_000_000_000, // 0.01 + name: "Rococo".into(), + symbol: "ROC".into(), + existential_deposit: 33_333_333, // 0.0033333333 location: Some(VersionedMultiLocation::V1(foreign_parent_multilocation())), additional: additional_meta.unwrap_or_default(), }; @@ -170,7 +170,7 @@ pub(super) fn ztg(amount: Balance) -> Balance { } #[inline] -pub(super) fn ksm(amount: Balance) -> Balance { +pub(super) fn roc(amount: Balance) -> Balance { foreign(amount, 12) } diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index 16a392590..ce93bca74 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -25,12 +25,12 @@ use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; use polkadot_runtime_parachains::configuration::HostConfiguration; use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; -use super::setup::{ksm, ztg, ExtBuilder, ALICE, FOREIGN_PARENT_ID, PARA_ID_SIBLING}; +use super::setup::{roc, ztg, ExtBuilder, ALICE, FOREIGN_PARENT_ID, PARA_ID_SIBLING}; decl_test_relay_chain! { - pub struct KusamaNet { - Runtime = kusama_runtime::Runtime, - XcmConfig = kusama_runtime::xcm_config::XcmConfig, + pub struct RococoNet { + Runtime = rococo_runtime::Runtime, + XcmConfig = rococo_runtime::xcm_config::XcmConfig, new_ext = relay_ext(), } } @@ -57,13 +57,13 @@ decl_test_parachain! { decl_test_network! { pub struct TestNet { - relay_chain = KusamaNet, + relay_chain = RococoNet, parachains = vec![ // N.B: Ideally, we could use the defined para id constants but doing so // fails with: "error: arbitrary expressions aren't allowed in patterns" // Be sure to use `xcm_config::config::battery_station::ID` - (2050, Zeitgeist), + (2101, Zeitgeist), // Be sure to use `PARA_ID_SIBLING` (3000, Sibling), ], @@ -71,12 +71,12 @@ decl_test_network! { } pub(super) fn relay_ext() -> sp_io::TestExternalities { - use kusama_runtime::{Runtime, System}; + use rococo_runtime::{Runtime, System}; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); pallet_balances::GenesisConfig:: { - balances: vec![(AccountId::from(ALICE), ksm(2002))], + balances: vec![(AccountId::from(ALICE), roc(2002))], } .assimilate_storage(&mut t) .unwrap(); @@ -102,8 +102,8 @@ pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { ExtBuilder::default() .set_balances(vec![ (AccountId::from(ALICE), CurrencyId::Ztg, ztg(10)), - (AccountId::from(ALICE), FOREIGN_PARENT_ID, ksm(10)), - (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, ksm(1)), + (AccountId::from(ALICE), FOREIGN_PARENT_ID, roc(10)), + (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, roc(1)), ]) .set_parachain_id(parachain_id) .build() diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index 983ed021e..890326ab6 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -19,11 +19,11 @@ use crate::{ integration_tests::xcm::{ setup::{ - ksm, register_foreign_parent, register_foreign_ztg, sibling_parachain_account, + register_foreign_parent, register_foreign_ztg, roc, sibling_parachain_account, zeitgeist_parachain_account, ztg, ALICE, BOB, FOREIGN_PARENT_ID, FOREIGN_ZTG_ID, PARA_ID_SIBLING, }, - test_net::{KusamaNet, Sibling, TestNet, Zeitgeist}, + test_net::{RococoNet, Sibling, TestNet, Zeitgeist}, }, xcm_config::{config::battery_station, fees::default_per_second}, AssetRegistry, Balance, Balances, CurrencyId, Origin, Tokens, XTokens, @@ -173,21 +173,21 @@ fn transfer_ztg_sibling_to_zeitgeist() { } #[test] -fn transfer_ksm_from_relay_chain() { +fn transfer_roc_from_relay_chain() { TestNet::reset(); - let transfer_amount: Balance = ksm(1); + let transfer_amount: Balance = roc(1); Zeitgeist::execute_with(|| { register_foreign_parent(None); }); - KusamaNet::execute_with(|| { - let initial_balance = kusama_runtime::Balances::free_balance(&ALICE.into()); + RococoNet::execute_with(|| { + let initial_balance = rococo_runtime::Balances::free_balance(&ALICE.into()); assert!(initial_balance >= transfer_amount); - assert_ok!(kusama_runtime::XcmPallet::reserve_transfer_assets( - kusama_runtime::Origin::signed(ALICE.into()), + assert_ok!(rococo_runtime::XcmPallet::reserve_transfer_assets( + rococo_runtime::Origin::signed(ALICE.into()), Box::new(Parachain(battery_station::ID).into().into()), Box::new(Junction::AccountId32 { network: NetworkId::Any, id: BOB }.into().into()), Box::new((Here, transfer_amount).into()), @@ -198,17 +198,17 @@ fn transfer_ksm_from_relay_chain() { Zeitgeist::execute_with(|| { assert_eq!( Tokens::free_balance(FOREIGN_PARENT_ID, &BOB.into()), - transfer_amount - ksm_fee() + transfer_amount - roc_fee() ); }); } #[test] -fn transfer_ksm_to_relay_chain() { +fn transfer_roc_to_relay_chain() { TestNet::reset(); - let transfer_amount: Balance = ksm(1); - transfer_ksm_from_relay_chain(); + let transfer_amount: Balance = roc(1); + transfer_roc_from_relay_chain(); Zeitgeist::execute_with(|| { let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE.into()); @@ -234,8 +234,8 @@ fn transfer_ksm_to_relay_chain() { ) }); - KusamaNet::execute_with(|| { - assert_eq!(kusama_runtime::Balances::free_balance(&BOB.into()), 999_988_476_752); + RococoNet::execute_with(|| { + assert_eq!(rococo_runtime::Balances::free_balance(&BOB.into()), 948_894_198_216); }); } @@ -318,7 +318,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { #[test] fn test_total_fee() { assert_eq!(ztg_fee(), 92_696_000); - assert_eq!(ksm_fee(), 9_269_600_000); + assert_eq!(roc_fee(), 9_269_600_000); } #[inline] @@ -331,9 +331,9 @@ fn fee(decimals: u32) -> Balance { calc_fee(default_per_second(decimals)) } -// The fee associated with transferring KSM tokens +// The fee associated with transferring roc tokens #[inline] -fn ksm_fee() -> Balance { +fn roc_fee() -> Balance { fee(12) } diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 7d74f2494..8e2f6b1b0 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -91,10 +91,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 42, + spec_version: 45, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 19, + transaction_version: 20, state_version: 1, }; diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index f1d1a5f87..b60d79506 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -50,7 +50,7 @@ use zeitgeist_primitives::types::Asset; pub mod battery_station { #[cfg(test)] - pub const ID: u32 = 2050; + pub const ID: u32 = 2101; pub const KEY: &[u8] = &[0, 1]; } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index cd74fcbf1..b1a581b20 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -52,17 +52,6 @@ macro_rules! decl_common_types { type Address = sp_runtime::MultiAddress; - #[cfg(feature = "parachain")] - pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, - zrml_prediction_markets::migrations::AddOutsiderBond, - >; - - #[cfg(not(feature = "parachain"))] pub type Executive = frame_executive::Executive< Runtime, Block, diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index fd63175bf..931420377 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -86,13 +86,13 @@ hex-literal = { default-features = false, optional = true, version = "0.3.4" } log = { version = "0.4.17", default-features = false, optional = true } # XCM -kusama-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } orml-unknown-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } orml-xcm-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } orml-xtokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } polkadot-runtime-parachains = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } xcm-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } @@ -146,7 +146,7 @@ parachain = [ # XCM - "kusama-runtime", + "polkadot-runtime", "polkadot-primitives", "polkadot-runtime-parachains", "orml-asset-registry", @@ -171,7 +171,7 @@ runtime-benchmarks = [ "frame-system-benchmarking", "frame-system/runtime-benchmarks", "hex-literal", - "kusama-runtime?/runtime-benchmarks", + "polkadot-runtime?/runtime-benchmarks", "orml-asset-registry?/runtime-benchmarks", "orml-tokens/runtime-benchmarks", "orml-xtokens?/runtime-benchmarks", @@ -279,7 +279,7 @@ std = [ # XCM - "kusama-runtime?/std", + "polkadot-runtime?/std", "polkadot-primitives?/std", "polkadot-runtime-parachains?/std", "orml-asset-registry?/std", diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index 0a643a225..d92c9430f 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -151,12 +151,12 @@ pub(super) fn register_foreign_sibling(additional_meta: Option) } pub(super) fn register_foreign_parent(additional_meta: Option) { - // Register KSM as foreign asset in the sibling parachain + // Register dot as foreign asset in the sibling parachain let meta: AssetMetadata = AssetMetadata { - decimals: 12, - name: "Kusama".into(), - symbol: "KSM".into(), - existential_deposit: 10_000_000_000, // 0.01 + decimals: 10, + name: "Polkadot".into(), + symbol: "DOT".into(), + existential_deposit: 10_000_000_000, // 1 location: Some(VersionedMultiLocation::V1(foreign_parent_multilocation())), additional: additional_meta.unwrap_or_default(), }; @@ -170,8 +170,8 @@ pub(super) fn ztg(amount: Balance) -> Balance { } #[inline] -pub(super) fn ksm(amount: Balance) -> Balance { - foreign(amount, 12) +pub(super) fn dot(amount: Balance) -> Balance { + foreign(amount, 10) } #[inline] diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index 22f3e2b88..0b90d1f9e 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -25,12 +25,12 @@ use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; use polkadot_runtime_parachains::configuration::HostConfiguration; use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; -use super::setup::{ksm, ztg, ExtBuilder, ALICE, FOREIGN_PARENT_ID, PARA_ID_SIBLING}; +use super::setup::{dot, ztg, ExtBuilder, ALICE, FOREIGN_PARENT_ID, PARA_ID_SIBLING}; decl_test_relay_chain! { - pub struct KusamaNet { - Runtime = kusama_runtime::Runtime, - XcmConfig = kusama_runtime::xcm_config::XcmConfig, + pub struct PolkadotNet { + Runtime = polkadot_runtime::Runtime, + XcmConfig = polkadot_runtime::xcm_config::XcmConfig, new_ext = relay_ext(), } } @@ -57,13 +57,13 @@ decl_test_parachain! { decl_test_network! { pub struct TestNet { - relay_chain = KusamaNet, + relay_chain = PolkadotNet, parachains = vec![ // N.B: Ideally, we could use the defined para id constants but doing so // fails with: "error: arbitrary expressions aren't allowed in patterns" // Be sure to use `xcm_config::config::zeitgeist::ID` - (2101, Zeitgeist), + (2092, Zeitgeist), // Be sure to use `PARA_ID_SIBLING` (3000, Sibling), ], @@ -71,12 +71,12 @@ decl_test_network! { } pub(super) fn relay_ext() -> sp_io::TestExternalities { - use kusama_runtime::{Runtime, System}; + use polkadot_runtime::{Runtime, System}; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); pallet_balances::GenesisConfig:: { - balances: vec![(AccountId::from(ALICE), ksm(2002))], + balances: vec![(AccountId::from(ALICE), dot(2002))], } .assimilate_storage(&mut t) .unwrap(); @@ -102,8 +102,8 @@ pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { ExtBuilder::default() .set_balances(vec![ (AccountId::from(ALICE), CurrencyId::Ztg, ztg(10)), - (AccountId::from(ALICE), FOREIGN_PARENT_ID, ksm(10)), - (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, ksm(1)), + (AccountId::from(ALICE), FOREIGN_PARENT_ID, dot(10)), + (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, dot(10)), ]) .set_parachain_id(parachain_id) .build() diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index 78024b55a..f95da672f 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -19,11 +19,11 @@ use crate::{ integration_tests::xcm::{ setup::{ - ksm, register_foreign_parent, register_foreign_ztg, sibling_parachain_account, + dot, register_foreign_parent, register_foreign_ztg, sibling_parachain_account, zeitgeist_parachain_account, ztg, ALICE, BOB, FOREIGN_PARENT_ID, FOREIGN_ZTG_ID, PARA_ID_SIBLING, }, - test_net::{KusamaNet, Sibling, TestNet, Zeitgeist}, + test_net::{PolkadotNet, Sibling, TestNet, Zeitgeist}, }, xcm_config::{config::zeitgeist, fees::default_per_second}, AssetRegistry, Balance, Balances, CurrencyId, Origin, Tokens, XTokens, @@ -173,21 +173,21 @@ fn transfer_ztg_sibling_to_zeitgeist() { } #[test] -fn transfer_ksm_from_relay_chain() { +fn transfer_dot_from_relay_chain() { TestNet::reset(); - let transfer_amount: Balance = ksm(1); + let transfer_amount: Balance = dot(2); Zeitgeist::execute_with(|| { register_foreign_parent(None); }); - KusamaNet::execute_with(|| { - let initial_balance = kusama_runtime::Balances::free_balance(&ALICE.into()); + PolkadotNet::execute_with(|| { + let initial_balance = polkadot_runtime::Balances::free_balance(&ALICE.into()); assert!(initial_balance >= transfer_amount); - assert_ok!(kusama_runtime::XcmPallet::reserve_transfer_assets( - kusama_runtime::Origin::signed(ALICE.into()), + assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets( + polkadot_runtime::Origin::signed(ALICE.into()), Box::new(Parachain(zeitgeist::ID).into().into()), Box::new(Junction::AccountId32 { network: NetworkId::Any, id: BOB }.into().into()), Box::new((Here, transfer_amount).into()), @@ -198,17 +198,17 @@ fn transfer_ksm_from_relay_chain() { Zeitgeist::execute_with(|| { assert_eq!( Tokens::free_balance(FOREIGN_PARENT_ID, &BOB.into()), - transfer_amount - ksm_fee() + transfer_amount - dot_fee() ); }); } #[test] -fn transfer_ksm_to_relay_chain() { +fn transfer_dot_to_relay_chain() { TestNet::reset(); - let transfer_amount: Balance = ksm(1); - transfer_ksm_from_relay_chain(); + let transfer_amount: Balance = dot(2); + transfer_dot_from_relay_chain(); Zeitgeist::execute_with(|| { let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE.into()); @@ -234,8 +234,8 @@ fn transfer_ksm_to_relay_chain() { ) }); - KusamaNet::execute_with(|| { - assert_eq!(kusama_runtime::Balances::free_balance(&BOB.into()), 999_988_476_752); + PolkadotNet::execute_with(|| { + assert_eq!(polkadot_runtime::Balances::free_balance(&BOB.into()), 19_530_582_548); }); } @@ -318,7 +318,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { #[test] fn test_total_fee() { assert_eq!(ztg_fee(), 92_696_000); - assert_eq!(ksm_fee(), 9_269_600_000); + assert_eq!(dot_fee(), 92_696_000); } #[inline] @@ -331,10 +331,10 @@ fn fee(decimals: u32) -> Balance { calc_fee(default_per_second(decimals)) } -// The fee associated with transferring KSM tokens +// The fee associated with transferring dot tokens #[inline] -fn ksm_fee() -> Balance { - fee(12) +fn dot_fee() -> Balance { + fee(10) } #[inline] diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 59fd70ed0..71477fd01 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -90,10 +90,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 42, + spec_version: 45, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 19, + transaction_version: 20, state_version: 1, }; diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index ef89f038f..c2a81c52c 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -41,7 +41,7 @@ parameter_types! { // Cumulus and Polkadot pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Kusama; + pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index b390cf765..c8312fda6 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -50,7 +50,7 @@ use zeitgeist_primitives::types::Asset; pub mod zeitgeist { #[cfg(test)] - pub const ID: u32 = 2101; + pub const ID: u32 = 2092; pub const KEY: &[u8] = &[0, 1]; } diff --git a/scripts/parachain/bootstrap.sh b/scripts/parachain/bootstrap.sh index db053acde..eb5088a79 100755 --- a/scripts/parachain/bootstrap.sh +++ b/scripts/parachain/bootstrap.sh @@ -24,7 +24,7 @@ export DATA_DIR="$HOME/battery-station-relay" export PARACHAIN_CHAIN="battery_station" export PARACHAIN_FIRST_BOOTNODE_ADDR="/ip4/127.0.0.1/tcp/30001/p2p/12D3KooWBMSGsvMa2A7A9PA2CptRFg9UFaWmNgcaXRxr1pE1jbe9" -export PARACHAIN_ID="2050" +export PARACHAIN_ID="2101" export PARACHAIN_IMAGE="zeitgeistpm/zeitgeist-node-parachain:sha-8ea9683" export PARACHAIN_NIMBUS_PK="0xe6ea0b63b2b5b7247a1e8280350a14c5f9e7745dec2fe3428b68aa4167d48e66" export PARACHAIN_PORT="30000" diff --git a/scripts/parachain/local.sh b/scripts/parachain/local.sh index 62f1e4b54..39bb1e4a6 100755 --- a/scripts/parachain/local.sh +++ b/scripts/parachain/local.sh @@ -7,7 +7,7 @@ set -euxo pipefail PARACHAIN_CHAIN=dev -PARACHAIN_ID=2050 +PARACHAIN_ID=2101 POLKADOT_BRANCH=release-v0.9.11 POLKADOT_DIR="target/polkadot" RELAYCHAIN_CHAIN=rococo-local From d8ec992e5447b724bf880bee294bc5c7c0cedea9 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Fri, 5 May 2023 11:52:12 +0200 Subject: [PATCH 27/53] Add missing changes to changelog (#1000) * Add missing items to changelog and update style * Add missing links * Fix formatting * Add missing note about extrinsics * Update docs/changelog_for_devs.md Co-authored-by: Harald Heckmann --------- Co-authored-by: Harald Heckmann --- docs/changelog_for_devs.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index fcad5fd20..28b75a85d 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -1,4 +1,32 @@ -# v0.3.8 +# Changelog for Developers + +Used for communicating changes to other parts of Zeitgeist infrastructure +([zeitgeistpm/ui](https://github.com/zeitgeistpm/ui), +[zeitgeistpm/sdk-next](https://github.com/zeitgeistpm/sdk-next), +[zeitgeistpm/zeitgeist-subsquid](https://github.com/zeitgeistpm/zeitgeist-subsquid)) +and does not represent a complete changelog for the zeitgeistpm/zeitgeist +repository. + +As of 0.3.9, the changelog's format is based on +https://keepachangelog.com/en/1.0.0/ and ⚠️ marks changes that might break +components which query the chain's storage, the extrinsics or the runtime +APIs/RPC interface. + +## v0.3.9 + +[#937]: https://github.com/zeitgeistpm/zeitgeist/pull/937 +[#903]: https://github.com/zeitgeistpm/zeitgeist/pull/903 + +### Changed + +- ⚠️ Add `outsider` field to `MarketBonds` struct. In particular, the `Market` + struct's layout has changed ([#903]). + +### Fixed + +- ⚠️ Fix order of arguments for `get_spot_price` ([#937]). + +## v0.3.8 - Added the `bonds` field to the `Market` struct, which tracks the status of the advisory, oracle and validity bonds. Each of its members has type `Bond`, @@ -12,8 +40,8 @@ This is the time of the first call to `authorize_market_outcome` plus the `CorrectionPeriod`. - Create prediction markets with Ztg or registered foreign asset which has - `allow_as_base_asset` set to `true` in `AssetRegistry` metadata. Extrinsics related - to prediction market creation/editing now have `base_asset` parameter. + `allow_as_base_asset` set to `true` in `AssetRegistry` metadata. Extrinsics + related to prediction market creation/editing now have `base_asset` parameter. # v0.3.7 From af86377601a1f60b2e3c14d61a67a225458a5241 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 8 May 2023 15:12:10 +0200 Subject: [PATCH 28/53] Remove `MinLiquidity` parameter (#999) * Remove `MinLiquidity` parameter * Fix benchmarks * Fix fuzz tests * Minor fixes * Update zrml/swaps/src/lib.rs Co-authored-by: Harald Heckmann * Update zrml/swaps/src/lib.rs Co-authored-by: Harald Heckmann * Update zrml/swaps/src/tests.rs Co-authored-by: Chralt * Fix docstring --------- Co-authored-by: Harald Heckmann Co-authored-by: Chralt --- primitives/src/constants/mock.rs | 3 +- primitives/src/traits/swaps.rs | 2 +- runtime/battery-station/src/parameters.rs | 4 +- runtime/common/src/lib.rs | 1 - runtime/zeitgeist/src/parameters.rs | 4 +- zrml/prediction-markets/src/benchmarks.rs | 24 ++-- zrml/prediction-markets/src/mock.rs | 8 +- zrml/prediction-markets/src/tests.rs | 50 +++---- zrml/swaps/fuzz/utils.rs | 6 +- zrml/swaps/src/benchmarks.rs | 28 ++-- zrml/swaps/src/lib.rs | 36 +++-- zrml/swaps/src/mock.rs | 5 +- zrml/swaps/src/tests.rs | 162 +++++++++++++--------- 13 files changed, 192 insertions(+), 141 deletions(-) diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index af8d6888e..3c0f64294 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -97,8 +97,7 @@ parameter_types! { pub const MaxSwapFee: Balance = BASE / 10; // 10% pub const MaxTotalWeight: Balance = 50 * BASE; pub const MaxWeight: Balance = 50 * BASE; - pub const MinLiquidity: Balance = 100 * BASE; - pub const MinSubsidy: Balance = MinLiquidity::get(); + pub const MinSubsidy: Balance = 100 * BASE; pub const MinSubsidyPerAccount: Balance = MinSubsidy::get(); pub const MinWeight: Balance = BASE; pub const SwapsPalletId: PalletId = PalletId(*b"zge/swap"); diff --git a/primitives/src/traits/swaps.rs b/primitives/src/traits/swaps.rs index f8c5f6d2b..007808286 100644 --- a/primitives/src/traits/swaps.rs +++ b/primitives/src/traits/swaps.rs @@ -31,7 +31,7 @@ pub trait Swaps { /// # Arguments /// /// * `who`: The account that is the creator of the pool. Must have enough - /// funds for each of the assets to cover the `MinLiqudity`. + /// funds for each of the assets to cover the minimum balance. /// * `assets`: The assets that are used in the pool. /// * `base_asset`: The base asset in a prediction market swap pool (usually a currency). /// * `market_id`: The market id of the market the pool belongs to. diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 702fadd9a..4b37e26c1 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -243,10 +243,8 @@ parameter_types! { pub const MaxTotalWeight: Balance = MaxWeight::get() * 2; /// The maximum weight a single asset can have. pub const MaxWeight: Balance = 64 * BASE; - /// Minimum amount of liquidity required to launch a CPMM pool. - pub const MinLiquidity: Balance = 100 * BASE; /// Minimum subsidy required to launch a Rikiddo pool. - pub const MinSubsidy: Balance = MinLiquidity::get(); + pub const MinSubsidy: Balance = 100 * BASE; /// Minimum subsidy a single account can provide. pub const MinSubsidyPerAccount: Balance = MinSubsidy::get(); /// Minimum weight a single asset can have. diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index b1a581b20..0151f932d 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -1079,7 +1079,6 @@ macro_rules! impl_config_traits { type MaxSwapFee = MaxSwapFee; type MaxTotalWeight = MaxTotalWeight; type MaxWeight = MaxWeight; - type MinLiquidity = MinLiquidity; type MinSubsidy = MinSubsidy; type MinSubsidyPerAccount = MinSubsidyPerAccount; type MinWeight = MinWeight; diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 712331c8f..794afd2a5 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -243,10 +243,8 @@ parameter_types! { pub const MaxTotalWeight: Balance = MaxWeight::get() * 2; /// The maximum weight a single asset can have. pub const MaxWeight: Balance = 64 * BASE; - /// Minimum amount of liquidity required to launch a CPMM pool. - pub const MinLiquidity: Balance = 100 * BASE; /// Minimum subsidy required to launch a Rikiddo pool. - pub const MinSubsidy: Balance = MinLiquidity::get(); + pub const MinSubsidy: Balance = 100 * BASE; /// Minimum subsidy a single account can provide. pub const MinSubsidyPerAccount: Balance = MinSubsidy::get(); /// Minimum weight a single asset can have. diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index b53f53d07..ad3713ad0 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -36,7 +36,7 @@ use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_runtime::traits::{One, SaturatedConversion, Saturating, Zero}; use zeitgeist_primitives::{ - constants::mock::{MaxSwapFee, MinLiquidity, MinWeight, BASE, MILLISECS_PER_BLOCK}, + constants::mock::{MaxSwapFee, MinWeight, BASE, MILLISECS_PER_BLOCK}, traits::Swaps, types::{ Asset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, @@ -53,6 +53,8 @@ fn assert_last_event(generic_event: ::Event) { frame_system::Pallet::::assert_last_event(generic_event.into()); } +const LIQUIDITY: u128 = 100 * BASE; + // Get default values for market creation. Also spawns an account with maximum // amount of native currency fn create_market_common_parameters( @@ -62,8 +64,7 @@ fn create_market_common_parameters( &'static str, > { let caller: T::AccountId = whitelisted_caller(); - T::AssetManager::deposit(Asset::Ztg, &caller, (100 * MinLiquidity::get()).saturated_into()) - .unwrap(); + T::AssetManager::deposit(Asset::Ztg, &caller, (100u128 * LIQUIDITY).saturated_into()).unwrap(); let oracle = caller.clone(); let deadlines = Deadlines:: { grace_period: 1_u32.into(), @@ -153,11 +154,7 @@ fn setup_redeem_shares_common( panic!("setup_redeem_shares_common: Unsupported market type: {market_type:?}"); } - Pallet::::do_buy_complete_set( - caller.clone(), - market_id, - MinLiquidity::get().saturated_into(), - )?; + Pallet::::do_buy_complete_set(caller.clone(), market_id, LIQUIDITY.saturated_into())?; let close_origin = T::CloseOrigin::successful_origin(); let resolve_origin = T::ResolveOrigin::successful_origin(); Call::::admin_move_market_to_closed { market_id }.dispatch_bypass_filter(close_origin)?; @@ -190,7 +187,7 @@ fn setup_reported_categorical_market_with_pool = MaxSwapFee::get().saturated_into(); - let min_liquidity: BalanceOf = MinLiquidity::get().saturated_into(); + let min_liquidity: BalanceOf = LIQUIDITY.saturated_into(); Call::::buy_complete_set { market_id, amount: min_liquidity } .dispatch_bypass_filter(RawOrigin::Signed(caller.clone()).into())?; let weight_len: usize = MaxRuntimeUsize::from(categories).into(); @@ -712,7 +709,7 @@ benchmarks! { Pallet::::calculate_time_frame_of_moment(range_start)).len(); let max_swap_fee: BalanceOf:: = MaxSwapFee::get().saturated_into(); - let min_liquidity: BalanceOf:: = MinLiquidity::get().saturated_into(); + let min_liquidity: BalanceOf:: = LIQUIDITY.saturated_into(); Pallet::::buy_complete_set( RawOrigin::Signed(caller.clone()).into(), market_id, @@ -755,7 +752,7 @@ benchmarks! { let market = >::market(&market_id.saturated_into())?; let max_swap_fee: BalanceOf:: = MaxSwapFee::get().saturated_into(); - let min_liquidity: BalanceOf:: = MinLiquidity::get().saturated_into(); + let min_liquidity: BalanceOf:: = LIQUIDITY.saturated_into(); Pallet::::buy_complete_set( RawOrigin::Signed(caller.clone()).into(), market_id, @@ -774,7 +771,8 @@ benchmarks! { }: { call.dispatch_bypass_filter(RawOrigin::Signed(caller).into())?; } verify { - let market_pool_id = >::market_pool(&market_id.saturated_into())?; + let market_pool_id = + >::market_pool(&market_id.saturated_into())?; let pool = T::Swaps::pool(market_pool_id)?; assert_eq!(pool.pool_status, PoolStatus::Active); } @@ -1097,7 +1095,7 @@ benchmarks! { ScoringRule::CPMM, None, )?; - let amount: BalanceOf = MinLiquidity::get().saturated_into(); + let amount: BalanceOf = LIQUIDITY.saturated_into(); Pallet::::buy_complete_set( RawOrigin::Signed(caller.clone()).into(), market_id, diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index 792a425b9..04b4d8c95 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -44,10 +44,9 @@ use zeitgeist_primitives::{ MaxCategories, MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGracePeriod, MaxInRatio, MaxMarketLifetime, MaxOracleDuration, MaxOutRatio, MaxRejectReasonLen, MaxReserves, MaxSubsidyPeriod, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, - MinCategories, MinDisputeDuration, MinLiquidity, MinOracleDuration, MinSubsidy, - MinSubsidyPeriod, MinWeight, MinimumPeriod, OutsiderBond, PmPalletId, - SimpleDisputesPalletId, StakeWeight, SwapsPalletId, TreasuryPalletId, BASE, CENT, - MILLISECS_PER_BLOCK, + MinCategories, MinDisputeDuration, MinOracleDuration, MinSubsidy, MinSubsidyPeriod, + MinWeight, MinimumPeriod, OutsiderBond, PmPalletId, SimpleDisputesPalletId, StakeWeight, + SwapsPalletId, TreasuryPalletId, BASE, CENT, MILLISECS_PER_BLOCK, }, types::{ AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, @@ -355,7 +354,6 @@ impl zrml_swaps::Config for Runtime { type MaxTotalWeight = MaxTotalWeight; type MaxWeight = MaxWeight; type MinAssets = MinAssets; - type MinLiquidity = MinLiquidity; type MinSubsidy = MinSubsidy; type MinSubsidyPerAccount = MinSubsidyPerAccount; type MinWeight = MinWeight; diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 35b15307b..1dc1a7955 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -48,6 +48,7 @@ use zrml_market_commons::MarketCommonsPalletApi; use zrml_swaps::Pools; const SENTINEL_AMOUNT: u128 = BASE; +const LIQUIDITY: u128 = 100 * BASE; fn get_deadlines() -> Deadlines<::BlockNumber> { Deadlines { @@ -244,7 +245,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( @@ -257,7 +258,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( @@ -270,7 +271,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), 0)); @@ -990,7 +991,6 @@ fn admin_destroy_market_correctly_cleans_up_accounts() { let alice_base_asset_before_market_creation = AssetManager::free_balance(base_asset, &ALICE); let swap_fee = ::MaxSwapFee::get(); - let min_liquidity = ::MinLiquidity::get(); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( Origin::signed(ALICE), base_asset, @@ -1001,7 +1001,7 @@ fn admin_destroy_market_correctly_cleans_up_accounts() { MarketType::Categorical(3), MarketDisputeMechanism::SimpleDisputes, swap_fee, - min_liquidity, + LIQUIDITY, vec![::MinWeight::get(); 3], )); // Buy some outcome tokens for Alice so that we can check that they get destroyed. @@ -1022,11 +1022,11 @@ fn admin_destroy_market_correctly_cleans_up_accounts() { // premissionless market so using ValidityBond let creation_bond = ::ValidityBond::get(); let oracle_bond = ::OracleBond::get(); - // substract min_liquidity twice, one for buy_complete_set() in + // substract LIQUIDITY twice, one for buy_complete_set() in // create_cpmm_market_and_deploy_assets() and one in swaps::create_pool() // then again substract BASE as buy_complete_set() above let expected_base_asset_value = - alice_base_asset_before_market_creation - min_liquidity - min_liquidity - BASE; + alice_base_asset_before_market_creation - LIQUIDITY - LIQUIDITY - BASE; if base_asset == Asset::Ztg { let alice_base_asset_balance = AssetManager::free_balance(base_asset, &ALICE); assert_eq!( @@ -1066,7 +1066,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( @@ -1079,7 +1079,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( @@ -1092,7 +1092,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); @@ -1776,7 +1776,7 @@ fn on_market_open_successfully_auto_opens_market_pool_with_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); let market_id = 0; @@ -1807,7 +1807,7 @@ fn on_market_close_successfully_auto_closes_market_with_blocks() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); let market_id = 0; @@ -1845,7 +1845,7 @@ fn on_market_open_successfully_auto_opens_market_with_timestamps() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); let market_id = 0; @@ -1879,7 +1879,7 @@ fn on_market_close_successfully_auto_closes_market_with_timestamps() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); let market_id = 0; @@ -1925,7 +1925,7 @@ fn on_market_open_successfully_auto_opens_multiple_markets_after_stall() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( @@ -1938,7 +1938,7 @@ fn on_market_open_successfully_auto_opens_multiple_markets_after_stall() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); @@ -1970,7 +1970,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( @@ -1983,7 +1983,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 0, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); @@ -2022,7 +2022,7 @@ fn on_initialize_skips_the_genesis_block() { MarketType::Categorical(category_count), MarketDisputeMechanism::SimpleDisputes, 123, - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); @@ -2253,7 +2253,7 @@ fn it_allows_to_deploy_a_pool() { Origin::signed(BOB), 0, ::MaxSwapFee::get(), - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); 2], )); }; @@ -2280,7 +2280,7 @@ fn deploy_swap_pool_for_market_fails_if_market_has_a_pool() { Origin::signed(BOB), 0, ::MaxSwapFee::get(), - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); 2], )); assert_noop!( @@ -2288,7 +2288,7 @@ fn deploy_swap_pool_for_market_fails_if_market_has_a_pool() { Origin::signed(BOB), 0, ::MaxSwapFee::get(), - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); 2], ), zrml_market_commons::Error::::PoolAlreadyExists, @@ -2312,7 +2312,7 @@ fn it_does_not_allow_to_deploy_a_pool_on_pending_advised_market() { Origin::signed(BOB), 0, ::MaxSwapFee::get(), - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); 2], ), Error::::MarketIsNotActive, @@ -4029,7 +4029,7 @@ fn deploy_swap_pool_correctly_sets_weight_of_base_asset() { MarketType::Categorical(3), MarketDisputeMechanism::SimpleDisputes, 1, - ::MinLiquidity::get(), + LIQUIDITY, weights, )); let pool = >::get(0).unwrap(); @@ -5129,7 +5129,7 @@ fn deploy_swap_pool( Origin::signed(FRED), 0, ::MaxSwapFee::get(), - ::MinLiquidity::get(), + LIQUIDITY, vec![::MinWeight::get(); outcome_assets_len], ) } diff --git a/zrml/swaps/fuzz/utils.rs b/zrml/swaps/fuzz/utils.rs index ec6e54171..9051538ac 100644 --- a/zrml/swaps/fuzz/utils.rs +++ b/zrml/swaps/fuzz/utils.rs @@ -25,7 +25,7 @@ use arbitrary::{Arbitrary, Result, Unstructured}; use rand::{rngs::ThreadRng, seq::SliceRandom, Rng}; use zeitgeist_primitives::{ constants::mock::{ - MaxAssets, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinLiquidity, MinWeight, BASE, + MaxAssets, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinWeight, BASE, CENT, }, traits::Swaps as SwapsTrait, types::{Asset, PoolId, ScalarPosition, ScoringRule, SerdeWrapper}, @@ -102,7 +102,9 @@ impl<'a> arbitrary::Arbitrary<'a> for ValidPoolData { let origin = rng.gen::(); let market_id = rng.gen::(); let swap_fee = rng.gen_range(0..BASE); - let amount = rng.gen_range(MinLiquidity::get()..u128::MAX); + // Slightly dirty hack: We're assuming that the minimum liquidity is CENT. This is not + // guaranteed by the protocol, but will most likely remain so forever. + let amount = rng.gen_range(CENT..u128::MAX); Ok(ValidPoolData { origin, assets, base_asset, market_id, swap_fee, amount, weights }) } diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index a8e8990d4..22038d993 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -48,6 +48,8 @@ use zeitgeist_primitives::{ }; use zrml_market_commons::MarketCommonsPalletApi; +const LIQUIDITY: u128 = 100 * BASE; + fn assert_last_event(generic_event: ::Event) { frame_system::Pallet::::assert_last_event(generic_event.into()); } @@ -85,7 +87,7 @@ fn generate_assets( let asset_amount_unwrapped: BalanceOf = { match asset_amount { Some(ac) => ac, - _ => T::MinLiquidity::get(), + _ => LIQUIDITY.saturated_into(), } }; @@ -130,7 +132,7 @@ fn initialize_pool( market_id, scoring_rule, if scoring_rule == ScoringRule::CPMM { Some(Zero::zero()) } else { None }, - if scoring_rule == ScoringRule::CPMM { Some(T::MinLiquidity::get()) } else { None }, + if scoring_rule == ScoringRule::CPMM { Some(LIQUIDITY.saturated_into()) } else { None }, if scoring_rule == ScoringRule::CPMM { some_weights } else { None }, ) .unwrap(); @@ -569,12 +571,12 @@ benchmarks! { let (pool_id, ..) = bench_create_pool::( caller.clone(), Some(a as usize), - Some(T::MinLiquidity::get() * 2u32.into()), + Some((2u128 * LIQUIDITY).saturated_into()), ScoringRule::CPMM, false, None, ); - let pool_amount = T::MinLiquidity::get() / 2u32.into(); + let pool_amount = (LIQUIDITY / 2u128).saturated_into(); let min_assets_out = vec![0u32.into(); a as usize]; }: _(RawOrigin::Signed(caller), pool_id, pool_amount, min_assets_out) @@ -607,7 +609,7 @@ benchmarks! { None, ); let asset_amount: BalanceOf = BASE.saturated_into(); - let pool_amount = T::MinLiquidity::get(); + let pool_amount = LIQUIDITY.saturated_into(); }: _(RawOrigin::Signed(caller), pool_id, assets[0], asset_amount, pool_amount) pool_exit_with_exact_pool_amount { @@ -631,13 +633,13 @@ benchmarks! { let (pool_id, ..) = bench_create_pool::( caller.clone(), Some(a as usize), - Some(T::MinLiquidity::get() * 2u32.into()), + Some((2u128 * LIQUIDITY).saturated_into()), ScoringRule::CPMM, false, None, ); - let pool_amount = T::MinLiquidity::get(); - let max_assets_in = vec![T::MinLiquidity::get(); a as usize]; + let pool_amount = LIQUIDITY.saturated_into(); + let max_assets_in = vec![LIQUIDITY.saturated_into(); a as usize]; }: _(RawOrigin::Signed(caller), pool_id, pool_amount, max_assets_in) pool_join_subsidy { @@ -658,7 +660,7 @@ benchmarks! { let (pool_id, assets, ..) = bench_create_pool::( caller.clone(), Some(a as usize), - Some(T::MinLiquidity::get() * 2u32.into()), + Some((2u128 * LIQUIDITY).saturated_into()), ScoringRule::CPMM, false, None, @@ -673,13 +675,13 @@ benchmarks! { let (pool_id, assets, ..) = bench_create_pool::( caller.clone(), Some(a as usize), - Some(T::MinLiquidity::get() * 2u32.into()), + Some((2u128 * LIQUIDITY).saturated_into()), ScoringRule::CPMM, false, None, ); let pool_amount = BASE.saturated_into(); - let max_asset_amount: BalanceOf = T::MinLiquidity::get(); + let max_asset_amount: BalanceOf = LIQUIDITY.saturated_into(); }: _(RawOrigin::Signed(caller), pool_id, assets[0], pool_amount, max_asset_amount) clean_up_pool_categorical_without_reward_distribution { @@ -718,7 +720,7 @@ benchmarks! { // `math::calc_out_given_in`). To get these values, we use the following parameters: // amount_in = 1/3 * balance_in, weight_in = 1, weight_out = 2. let asset_count = T::MaxAssets::get(); - let balance: BalanceOf = T::MinLiquidity::get(); + let balance: BalanceOf = LIQUIDITY.saturated_into(); let asset_amount_in: BalanceOf = bmul( balance.saturated_into(), T::MaxInRatio::get().saturated_into(), @@ -784,7 +786,7 @@ benchmarks! { // `math::calc_in_given_out`). To get these values, we use the following parameters: // amount_out = 1/3 * balance_out, weight_out = 1, weight_in = 4. let asset_count = T::MaxAssets::get(); - let balance: BalanceOf = T::MinLiquidity::get(); + let balance: BalanceOf = LIQUIDITY.saturated_into(); let asset_amount_out: BalanceOf = bmul( balance.saturated_into(), T::MaxOutRatio::get().saturated_into(), diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index b2a56dc16..a386c0731 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -823,10 +823,6 @@ mod pallet { /// The minimum amount of assets in a pool. type MinAssets: Get; - /// The minimum amount of liqudity required to bootstrap a pool. - #[pallet::constant] - type MinLiquidity: Get>; - /// The minimum amount of subsidy required to state transit a market into active state. /// Must be greater than 0, but can be arbitrarily close to 0. #[pallet::constant] @@ -882,7 +878,7 @@ mod pallet { BelowMinimumWeight, /// Some funds could not be transferred due to a too low balance. InsufficientBalance, - /// Liquidity provided to new CPMM pool is less than `MinLiquidity`. + /// Liquidity provided to new CPMM pool is less than the minimum allowed balance. InsufficientLiquidity, /// The market was not started since the subsidy goal was not reached. InsufficientSubsidy, @@ -1475,11 +1471,32 @@ mod pallet { T::PalletId::get().into_sub_account_truncating((*pool_id).saturated_into::()) } - // The minimum allowed balance in a liquidity pool. + /// The minimum allowed balance of `asset` in a liquidity pool. pub(crate) fn min_balance(asset: Asset>) -> BalanceOf { T::AssetManager::minimum_balance(asset).max(MIN_BALANCE.saturated_into()) } + /// Returns the minimum allowed balance allowed for a pool with id `pool_id` containing + /// `assets`. + /// + /// The minimum allowed balance is the maximum of all minimum allowed balances of assets + /// contained in the pool, _including_ the pool shares asset. This ensures that none of the + /// accounts involved are slashed when a pool is created with the minimum amount. + /// + /// **Should** only be called if `assets` is non-empty. Note that the existence of a pool + /// with the specified `pool_id` is not mandatory. + pub(crate) fn min_balance_of_pool( + pool_id: PoolId, + assets: &[Asset>], + ) -> BalanceOf { + assets + .iter() + .map(|asset| Self::min_balance(*asset)) + .max() + .unwrap_or_else(|| MIN_BALANCE.saturated_into()) + .max(Self::min_balance(Self::pool_shares_id(pool_id))) + } + fn ensure_minimum_liquidity_shares( pool_id: PoolId, pool: &Pool, MarketIdOf>, @@ -1687,7 +1704,7 @@ mod pallet { /// # Arguments /// /// * `who`: The account that is the creator of the pool. Must have enough - /// funds for each of the assets to cover the `MinLiqudity`. + /// funds for each of the assets to cover the `amount`. /// * `assets`: The assets that are used in the pool. /// * `base_asset`: The base asset in a prediction market swap pool (usually a currency). /// * `market_id`: The market id of the market the pool belongs to. @@ -1729,8 +1746,11 @@ mod pallet { match scoring_rule { ScoringRule::CPMM => { ensure!(amount.is_some(), Error::::InvalidAmountArgument); + // `amount` must be larger than all minimum balances. As we deposit `amount` + // liquidity shares, we must also ensure that `amount` is larger than the + // existential deposit of the liquidity shares. ensure!( - amount_unwrapped >= T::MinLiquidity::get(), + amount_unwrapped >= Self::min_balance_of_pool(next_pool_id, &assets), Error::::InsufficientLiquidity ); let swap_fee_unwrapped = swap_fee.ok_or(Error::::InvalidFeeArgument)?; diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index 19b7031a0..8e781e972 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -39,8 +39,8 @@ use zeitgeist_primitives::{ constants::mock::{ BalanceFractionalDecimals, BlockHashCount, ExistentialDeposit, ExistentialDeposits, GetNativeCurrencyId, LiquidityMiningPalletId, MaxAssets, MaxInRatio, MaxLocks, MaxOutRatio, - MaxReserves, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinLiquidity, MinSubsidy, - MinWeight, MinimumPeriod, PmPalletId, SwapsPalletId, BASE, + MaxReserves, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinSubsidy, MinWeight, + MinimumPeriod, PmPalletId, SwapsPalletId, BASE, }, types::{ AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, @@ -98,7 +98,6 @@ impl crate::Config for Runtime { type MaxTotalWeight = MaxTotalWeight; type MaxWeight = MaxWeight; type MinAssets = MinAssets; - type MinLiquidity = MinLiquidity; type MinSubsidy = MinSubsidy; type MinSubsidyPerAccount = MinSubsidyPerAccount; type MinWeight = MinWeight; diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index 9c0cff2d7..6e41b8d69 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -92,6 +92,8 @@ const _900: u128 = 900 * BASE; const _1234: u128 = 1234 * BASE; const _10000: u128 = 10000 * BASE; +const LIQUIDITY: u128 = _100; + // Macro for comparing fixed point u128. #[allow(unused_macros)] macro_rules! assert_approx { @@ -129,7 +131,7 @@ fn create_pool_fails_with_duplicate_assets(assets: Vec 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec![_2; asset_count]), ), crate::Error::::SomeIdenticalAssets @@ -309,7 +311,7 @@ fn create_pool_generates_a_new_pool_with_correct_parameters_for_cpmm() { let next_pool_before = Swaps::next_pool_id(); assert_eq!(next_pool_before, 0); - let amount = ::MinLiquidity::get(); + let amount = LIQUIDITY; let base_asset = ASSETS.last().unwrap(); ASSETS.iter().cloned().for_each(|asset| { assert_ok!(Currencies::deposit(asset, &BOB, amount)); @@ -713,10 +715,10 @@ fn get_spot_price_returns_correct_results_cpmm( ) { ExtBuilder::default().build().execute_with(|| { // We always swap ASSET_A for ASSET_B, but we vary the weights, balances and swap fees. + let amount_in_pool = LIQUIDITY; ASSETS.iter().cloned().for_each(|asset| { - assert_ok!(Currencies::deposit(asset, &BOB, _100)); + assert_ok!(Currencies::deposit(asset, &BOB, amount_in_pool)); }); - let amount_in_pool = ::MinLiquidity::get(); assert_ok!(Swaps::create_pool( BOB, ASSETS.to_vec(), @@ -804,8 +806,9 @@ fn pool_exit_with_exact_asset_amount_satisfies_max_out_ratio_constraints() { ExtBuilder::default().build().execute_with(|| { // We make sure that the individual asset weights don't divide total weight so we trigger // the calculation of exp using the binomial series. + let amount_in_pool = LIQUIDITY; ASSETS.iter().cloned().for_each(|asset| { - assert_ok!(Currencies::deposit(asset, &BOB, _100)); + assert_ok!(Currencies::deposit(asset, &BOB, amount_in_pool)); }); assert_ok!(Swaps::create_pool( BOB, @@ -814,7 +817,7 @@ fn pool_exit_with_exact_asset_amount_satisfies_max_out_ratio_constraints() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(amount_in_pool), Some(vec!(_2, _2, _2, _5)), )); let pool_id = 0; @@ -838,8 +841,9 @@ fn pool_exit_with_exact_pool_amount_satisfies_max_in_ratio_constraints() { ExtBuilder::default().build().execute_with(|| { // We make sure that the individual asset weights don't divide total weight so we trigger // the calculation of exp using the binomial series. + let amount_in_pool = LIQUIDITY; ASSETS.iter().cloned().for_each(|asset| { - assert_ok!(Currencies::deposit(asset, &BOB, _100)); + assert_ok!(Currencies::deposit(asset, &BOB, amount_in_pool)); }); assert_ok!(Swaps::create_pool( BOB, @@ -848,7 +852,7 @@ fn pool_exit_with_exact_pool_amount_satisfies_max_in_ratio_constraints() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(amount_in_pool), Some(vec!(_2, _2, _2, _5)), )); let pool_id = 0; @@ -872,8 +876,9 @@ fn pool_join_with_exact_asset_amount_satisfies_max_in_ratio_constraints() { ExtBuilder::default().build().execute_with(|| { // We make sure that the individual asset weights don't divide total weight so we trigger // the calculation of exp using the binomial series. + let amount_in_pool = LIQUIDITY; ASSETS.iter().cloned().for_each(|asset| { - assert_ok!(Currencies::deposit(asset, &BOB, _100)); + assert_ok!(Currencies::deposit(asset, &BOB, amount_in_pool)); }); assert_ok!(Swaps::create_pool( BOB, @@ -882,12 +887,12 @@ fn pool_join_with_exact_asset_amount_satisfies_max_in_ratio_constraints() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(amount_in_pool), Some(vec!(_2, _2, _2, _5)), )); let pool_id = 0; assert_ok!(Swaps::open_pool(pool_id)); - let asset_amount = _100; + let asset_amount = LIQUIDITY; assert_ok!(Currencies::deposit(ASSET_A, &ALICE, asset_amount)); assert_noop!( @@ -912,8 +917,9 @@ fn pool_join_with_exact_pool_amount_satisfies_max_out_ratio_constraints() { ExtBuilder::default().build().execute_with(|| { // We make sure that the individual asset weights don't divide total weight so we trigger // the calculation of exp using the binomial series. + let amount_in_pool = LIQUIDITY; ASSETS.iter().cloned().for_each(|asset| { - assert_ok!(Currencies::deposit(asset, &BOB, _100)); + assert_ok!(Currencies::deposit(asset, &BOB, amount_in_pool)); }); assert_ok!(Swaps::create_pool( BOB, @@ -922,7 +928,7 @@ fn pool_join_with_exact_pool_amount_satisfies_max_out_ratio_constraints() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(amount_in_pool), Some(vec!(_2, _2, _2, _5)), )); let pool_id = 0; @@ -1038,8 +1044,8 @@ fn pool_exit_decreases_correct_pool_parameters() { assert_all_parameters( [_25 + 1, _25 + 1, _25 + 1, _25 + 1], 0, - [_100 - 1, _100 - 1, _100 - 1, _100 - 1], - _100, + [LIQUIDITY - 1, LIQUIDITY - 1, LIQUIDITY - 1, LIQUIDITY - 1], + LIQUIDITY, ); }) } @@ -1078,12 +1084,12 @@ fn pool_exit_decreases_correct_pool_parameters_with_exit_fee() { assert_eq!(Currencies::free_balance(ASSET_B, &BOB), _9); assert_eq!(Currencies::free_balance(ASSET_C, &BOB), _9); assert_eq!(Currencies::free_balance(ASSET_D, &BOB), _9); - assert_eq!(Currencies::free_balance(pool_shares_id, &BOB), _100 - _10); - assert_eq!(Currencies::free_balance(ASSET_A, &pool_account), _100 - _9); - assert_eq!(Currencies::free_balance(ASSET_B, &pool_account), _100 - _9); - assert_eq!(Currencies::free_balance(ASSET_C, &pool_account), _100 - _9); - assert_eq!(Currencies::free_balance(ASSET_D, &pool_account), _100 - _9); - assert_eq!(Currencies::total_issuance(pool_shares_id), _100 - _10); + assert_eq!(Currencies::free_balance(pool_shares_id, &BOB), LIQUIDITY - _10); + assert_eq!(Currencies::free_balance(ASSET_A, &pool_account), LIQUIDITY - _9); + assert_eq!(Currencies::free_balance(ASSET_B, &pool_account), LIQUIDITY - _9); + assert_eq!(Currencies::free_balance(ASSET_C, &pool_account), LIQUIDITY - _9); + assert_eq!(Currencies::free_balance(ASSET_D, &pool_account), LIQUIDITY - _9); + assert_eq!(Currencies::total_issuance(pool_shares_id), LIQUIDITY - _10); System::assert_last_event( Event::PoolExit(PoolAssetsEvent { @@ -1127,8 +1133,8 @@ fn pool_exit_decreases_correct_pool_parameters_on_cleaned_up_pool() { 0, // Note: Although the asset is deleted from the pool, the assets B/C still remain on the // pool account. - [_100 - 1, _101, _101, _100 - 1], - _100, + [LIQUIDITY - 1, LIQUIDITY + _1, LIQUIDITY + _1, LIQUIDITY - 1], + LIQUIDITY, ); }) } @@ -1295,8 +1301,13 @@ fn pool_exit_with_exact_pool_amount_exchanges_correct_values( assert_all_parameters( [_25 - asset_amount_joined + asset_amount_expected, _25, _25, _25], 0, - [_100 + asset_amount_joined - asset_amount_expected, _100, _100, _100], - _100, + [ + LIQUIDITY + asset_amount_joined - asset_amount_expected, + LIQUIDITY, + LIQUIDITY, + LIQUIDITY, + ], + LIQUIDITY, ) }); } @@ -1356,8 +1367,8 @@ fn pool_exit_with_exact_asset_amount_exchanges_correct_values( assert_all_parameters( [_25 - asset_amount_joined + asset_amount, _25, _25, _25], dust, - [_100 + asset_amount_joined - asset_amount, _100, _100, _100], - _100 + dust, + [LIQUIDITY + asset_amount_joined - asset_amount, LIQUIDITY, LIQUIDITY, LIQUIDITY], + LIQUIDITY + dust, ) }); } @@ -1601,8 +1612,8 @@ fn pool_join_with_exact_asset_amount_exchanges_correct_values( assert_all_parameters( [_25 - asset_amount, _25, _25, _25], pool_amount_expected, - [_100 + alice_sent, _100, _100, _100], - _100 + pool_amount_expected, + [LIQUIDITY + alice_sent, LIQUIDITY, LIQUIDITY, LIQUIDITY], + LIQUIDITY + pool_amount_expected, ); }); } @@ -1638,8 +1649,8 @@ fn pool_join_with_exact_pool_amount_exchanges_correct_values( assert_all_parameters( [_25 - asset_amount_expected, _25, _25, _25], pool_amount, - [_100 + asset_amount_expected, _100, _100, _100], - _100 + pool_amount, + [LIQUIDITY + asset_amount_expected, LIQUIDITY, LIQUIDITY, LIQUIDITY], + LIQUIDITY + pool_amount, ); }); } @@ -1781,8 +1792,8 @@ fn swap_exact_amount_in_exchanges_correct_values_with_cpmm() { assert_all_parameters( [_24, _25 + 9900990100, _25, _25], 0, - [_101, _99 + 99009900, _100, _100], - _100, + [LIQUIDITY + _1, LIQUIDITY - 9900990100, LIQUIDITY, LIQUIDITY], + LIQUIDITY, ); }); } @@ -1802,7 +1813,7 @@ fn swap_exact_amount_in_exchanges_correct_values_with_cpmm_with_fees() { 0, ScoringRule::CPMM, Some(BASE / 10), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_2, _2, _2, _2)), )); let pool_id = 0; @@ -1838,8 +1849,8 @@ fn swap_exact_amount_in_exchanges_correct_values_with_cpmm_with_fees() { assert_all_parameters( [_25 - asset_amount_in, _25 + asset_amount_out, _25, _25], 0, - [_100 + asset_amount_in, _100 - asset_amount_out, _100, _100], - _100, + [LIQUIDITY + asset_amount_in, LIQUIDITY - asset_amount_out, LIQUIDITY, LIQUIDITY], + LIQUIDITY, ); }); } @@ -1983,8 +1994,8 @@ fn swap_exact_amount_out_exchanges_correct_values_with_cpmm() { assert_all_parameters( [239898989900, _26, _25, _25], 0, - [_101 + 101010100, _99, _100, _100], - _100, + [LIQUIDITY + _1 + 101010100, LIQUIDITY - _1, LIQUIDITY, LIQUIDITY], + LIQUIDITY, ); }); } @@ -2004,7 +2015,7 @@ fn swap_exact_amount_out_exchanges_correct_values_with_cpmm_with_fees() { 0, ScoringRule::CPMM, Some(BASE / 10), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_2, _2, _2, _2)), )); let pool_id = 0; @@ -2038,8 +2049,8 @@ fn swap_exact_amount_out_exchanges_correct_values_with_cpmm_with_fees() { assert_all_parameters( [_25 - asset_amount_in, _25 + asset_amount_out, _25, _25], 0, - [_100 + asset_amount_in, _100 - asset_amount_out, _100, _100], - _100, + [LIQUIDITY + asset_amount_in, LIQUIDITY - asset_amount_out, LIQUIDITY, LIQUIDITY], + LIQUIDITY, ); }); } @@ -2171,7 +2182,7 @@ fn create_pool_fails_on_too_many_assets() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(weights), ), crate::Error::::TooManyAssets @@ -2190,7 +2201,7 @@ fn create_pool_fails_on_too_few_assets() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_2, _2, _2, _2)), ), crate::Error::::TooFewAssets @@ -2209,7 +2220,7 @@ fn create_pool_fails_if_base_asset_is_not_in_asset_vector() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_2, _2, _2)), ), crate::Error::::BaseAssetNotFound @@ -2220,7 +2231,7 @@ fn create_pool_fails_if_base_asset_is_not_in_asset_vector() { #[test] fn create_pool_fails_if_swap_fee_is_too_high() { ExtBuilder::default().build().execute_with(|| { - let amount = ::MinLiquidity::get(); + let amount = _100; ASSETS.iter().cloned().for_each(|asset| { let _ = Currencies::deposit(asset, &BOB, amount); }); @@ -2243,7 +2254,7 @@ fn create_pool_fails_if_swap_fee_is_too_high() { #[test] fn create_pool_fails_if_swap_fee_is_unspecified_for_cpmm() { ExtBuilder::default().build().execute_with(|| { - let amount = ::MinLiquidity::get(); + let amount = _100; ASSETS.iter().cloned().for_each(|asset| { let _ = Currencies::deposit(asset, &BOB, amount); }); @@ -2309,7 +2320,7 @@ fn create_pool_fails_on_weight_below_minimum_weight() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_2, ::MinWeight::get() - 1, _2, _2)), ), crate::Error::::BelowMinimumWeight, @@ -2331,7 +2342,7 @@ fn create_pool_fails_on_weight_above_maximum_weight() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_2, ::MaxWeight::get() + 1, _2, _2)), ), crate::Error::::AboveMaximumWeight, @@ -2354,7 +2365,7 @@ fn create_pool_fails_on_total_weight_above_maximum_total_weight() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec![weight; 4]), ), crate::Error::::MaxTotalWeight, @@ -2368,6 +2379,7 @@ fn create_pool_fails_on_insufficient_liquidity() { ASSETS.iter().cloned().for_each(|asset| { let _ = Currencies::deposit(asset, &BOB, _100); }); + let min_balance = Swaps::min_balance_of_pool(0, ASSETS.as_ref()); assert_noop!( Swaps::create_pool( BOB, @@ -2376,7 +2388,7 @@ fn create_pool_fails_on_insufficient_liquidity() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get() - 1), + Some(min_balance - 1), Some(vec!(_2, _2, _2, _2)), ), crate::Error::::InsufficientLiquidity, @@ -2384,6 +2396,36 @@ fn create_pool_fails_on_insufficient_liquidity() { }); } +#[test] +fn create_pool_succeeds_on_min_liquidity() { + ExtBuilder::default().build().execute_with(|| { + ASSETS.iter().cloned().for_each(|asset| { + let _ = Currencies::deposit(asset, &BOB, _100); + }); + // Only got one type of tokens in the pool, so we can sample the minimum balance using one + // asset. + let min_balance = Swaps::min_balance_of_pool(0, ASSETS.as_ref()); + assert_ok!(Swaps::create_pool( + BOB, + ASSETS.to_vec(), + *ASSETS.last().unwrap(), + 0, + ScoringRule::CPMM, + Some(0), + Some(min_balance), + Some(vec!(_2, _2, _2, _2)), + )); + assert_all_parameters( + [0; 4], + 0, + [min_balance, min_balance, min_balance, min_balance], + min_balance, + ); + let pool_shares_id = Swaps::pool_shares_id(0); + assert_eq!(Currencies::free_balance(pool_shares_id, &BOB), min_balance); + }); +} + #[test] fn create_pool_transfers_the_correct_amount_of_tokens() { ExtBuilder::default().build().execute_with(|| { @@ -2478,7 +2520,7 @@ fn open_pool_fails_if_pool_is_not_closed(pool_status: PoolStatus) { fn open_pool_succeeds_and_emits_correct_event_if_pool_exists() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - let amount = ::MinLiquidity::get(); + let amount = _100; ASSETS.iter().cloned().for_each(|asset| { assert_ok!(Currencies::deposit(asset, &BOB, amount)); }); @@ -2618,7 +2660,7 @@ fn create_pool_correctly_associates_weights_with_assets() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec!(_1, _2, _3, _4)), )); let pool = Swaps::pool(0).unwrap(); @@ -3116,7 +3158,7 @@ fn on_idle_skips_arbitrage_if_price_does_not_exceed_threshold() { 0, ScoringRule::CPMM, Some(0), - Some(::MinLiquidity::get()), + Some(LIQUIDITY), Some(vec![_3, _1, _1, _1]), )); let pool_id = 0; @@ -3135,7 +3177,7 @@ fn on_idle_arbitrages_pools_with_mint_sell() { assets.iter().cloned().for_each(|asset| { assert_ok!(Currencies::deposit(asset, &BOB, _10000)); }); - let balance = ::MinLiquidity::get(); + let balance = _100; let base_asset = ASSET_A; assert_ok!(Swaps::create_pool( BOB, @@ -3185,7 +3227,7 @@ fn on_idle_arbitrages_pools_with_buy_burn() { assets.iter().cloned().for_each(|asset| { assert_ok!(Currencies::deposit(asset, &BOB, _10000)); }); - let balance = ::MinLiquidity::get(); + let balance = _100; let base_asset = ASSET_A; assert_ok!(Swaps::create_pool( BOB, @@ -3264,7 +3306,7 @@ fn execute_arbitrage_correctly_observes_min_balance_buy_burn() { assets.iter().cloned().for_each(|asset| { assert_ok!(Currencies::deposit(asset, &BOB, _10000)); }); - let balance = ::MinLiquidity::get(); + let balance = _100; let base_asset = ASSET_A; assert_ok!(Swaps::create_pool( BOB, @@ -3323,7 +3365,7 @@ fn execute_arbitrage_observes_min_balances_mint_sell() { assets.iter().cloned().for_each(|asset| { assert_ok!(Currencies::deposit(asset, &BOB, _10000)); }); - let balance = ::MinLiquidity::get(); + let balance = _100; let base_asset = ASSET_A; assert_ok!(Swaps::create_pool( BOB, @@ -3403,11 +3445,7 @@ fn create_initial_pool( 0, scoring_rule, swap_fee, - if scoring_rule == ScoringRule::CPMM { - Some(::MinLiquidity::get()) - } else { - None - }, + if scoring_rule == ScoringRule::CPMM { Some(LIQUIDITY) } else { None }, if scoring_rule == ScoringRule::CPMM { Some(vec!(_2, _2, _2, _2)) } else { None }, )); if scoring_rule == ScoringRule::CPMM { From 033b6a371db6b50e308ff3ff6fb6210f22652118 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 26 May 2023 09:19:02 +0200 Subject: [PATCH 29/53] Transfer token dust to treasury (#1005) --- runtime/battery-station/src/parameters.rs | 1 - runtime/common/src/lib.rs | 2 +- runtime/zeitgeist/src/parameters.rs | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 4b37e26c1..bca43038d 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -144,7 +144,6 @@ parameter_types! { // ORML pub const GetNativeCurrencyId: CurrencyId = Asset::Ztg; - pub DustAccount: AccountId = PalletId(*b"orml/dst").into_account_truncating(); // Prediction Market parameters /// (Slashable) Bond that is provided for creating an advised market that needs approval. diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 0151f932d..ff1ae26ce 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -556,7 +556,7 @@ macro_rules! impl_config_traits { type ExistentialDeposits = ExistentialDeposits; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; - type OnDust = orml_tokens::TransferDust; + type OnDust = orml_tokens::TransferDust; type OnKilledTokenAccount = (); type OnNewTokenAccount = (); type ReserveIdentifier = [u8; 8]; diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 794afd2a5..e0ebcbd56 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -144,7 +144,6 @@ parameter_types! { // ORML pub const GetNativeCurrencyId: CurrencyId = Asset::Ztg; - pub DustAccount: AccountId = PalletId(*b"orml/dst").into_account_truncating(); // Prediction Market parameters /// (Slashable) Bond that is provided for creating an advised market that needs approval. From 24ab42e7195c5ddfadcd6b995267c13d46472c09 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Fri, 26 May 2023 14:55:11 +0530 Subject: [PATCH 30/53] Upgrade 0932 (#966) * Download external dependencies to external directory * Use all polkadot related dependencies from paritytech github. Make things compile with polkadot v0.9.32. Please note that certain things are just commneted out and will be fixed/improved in upcoming commits. * Add migrations for parity pallets * Set proof_size in MAXIMUM_BLOCK_WEIGHT to avoid test failures * Update weights * Remove commented code which is not required * Upgrade log crate version * Move code from external directory to separate repo on github.com * Fix dependencies * Add missing feature to polkadot-cli * Use proper origins and traits * Apply most recent migration code * Use new state transfer scheme in try-runtime * Respect new XCM fee on Rococo & Polkadot --------- Co-authored-by: Harald Heckmann --- .github/workflows/benchmark.yml | 3 + .github/workflows/migration.yml | 3 + .github/workflows/rust.yml | 15 + .github/workflows/tag.yml | 6 + Cargo.lock | 1993 +++++++++-------- node/Cargo.toml | 138 +- node/src/benchmarking.rs | 4 +- node/src/cli.rs | 36 +- node/src/command.rs | 5 + node/src/service/service_parachain.rs | 5 +- node/src/service/service_standalone.rs | 20 +- primitives/Cargo.toml | 14 +- runtime/battery-station/Cargo.toml | 148 +- .../src/integration_tests/xcm/setup.rs | 13 +- .../src/integration_tests/xcm/test_net.rs | 11 +- .../integration_tests/xcm/tests/transfers.rs | 22 +- runtime/battery-station/src/lib.rs | 14 +- .../battery-station/src/parachain_params.rs | 4 +- runtime/battery-station/src/parameters.rs | 9 +- .../battery-station/src/xcm_config/config.rs | 23 +- runtime/common/Cargo.toml | 52 +- runtime/common/src/lib.rs | 195 +- .../src/weights/cumulus_pallet_xcmp_queue.rs | 6 +- runtime/common/src/weights/frame_system.rs | 34 +- runtime/common/src/weights/mod.rs | 2 +- runtime/common/src/weights/orml_currencies.rs | 12 +- runtime/common/src/weights/orml_tokens.rs | 12 +- .../src/weights/pallet_author_inherent.rs | 4 +- .../src/weights/pallet_author_mapping.rs | 12 +- .../src/weights/pallet_author_slot_filter.rs | 4 +- runtime/common/src/weights/pallet_balances.rs | 16 +- runtime/common/src/weights/pallet_bounties.rs | 36 +- .../common/src/weights/pallet_collective.rs | 104 +- .../common/src/weights/pallet_democracy.rs | 152 +- runtime/common/src/weights/pallet_identity.rs | 130 +- .../common/src/weights/pallet_membership.rs | 45 +- runtime/common/src/weights/pallet_multisig.rs | 100 +- .../src/weights/pallet_parachain_staking.rs | 173 +- runtime/common/src/weights/pallet_preimage.rs | 61 +- runtime/common/src/weights/pallet_proxy.rs | 78 +- .../common/src/weights/pallet_scheduler.rs | 140 +- .../common/src/weights/pallet_timestamp.rs | 6 +- runtime/common/src/weights/pallet_treasury.rs | 22 +- runtime/common/src/weights/pallet_utility.rs | 24 +- runtime/common/src/weights/pallet_vesting.rs | 68 +- runtime/zeitgeist/Cargo.toml | 146 +- .../src/integration_tests/xcm/setup.rs | 13 +- .../src/integration_tests/xcm/test_net.rs | 6 +- .../integration_tests/xcm/tests/transfers.rs | 22 +- runtime/zeitgeist/src/lib.rs | 26 +- runtime/zeitgeist/src/parachain_params.rs | 4 +- runtime/zeitgeist/src/parameters.rs | 9 +- runtime/zeitgeist/src/xcm_config/config.rs | 23 +- zrml/authorized/Cargo.toml | 14 +- zrml/authorized/src/lib.rs | 6 +- zrml/authorized/src/mock.rs | 10 +- zrml/authorized/src/tests.rs | 34 +- zrml/authorized/src/weights.rs | 10 +- zrml/court/Cargo.toml | 16 +- zrml/court/src/lib.rs | 4 +- zrml/court/src/mock.rs | 10 +- zrml/court/src/tests.rs | 92 +- zrml/court/src/weights.rs | 8 +- zrml/global-disputes/Cargo.toml | 16 +- zrml/global-disputes/src/benchmarks.rs | 2 +- zrml/global-disputes/src/lib.rs | 2 +- zrml/global-disputes/src/mock.rs | 10 +- zrml/global-disputes/src/tests.rs | 152 +- zrml/global-disputes/src/weights.rs | 56 +- zrml/liquidity-mining/Cargo.toml | 14 +- zrml/liquidity-mining/src/lib.rs | 2 +- zrml/liquidity-mining/src/mock.rs | 10 +- zrml/liquidity-mining/src/tests.rs | 4 +- zrml/liquidity-mining/src/weights.rs | 4 +- zrml/market-commons/Cargo.toml | 14 +- zrml/market-commons/src/mock.rs | 8 +- zrml/orderbook-v1/Cargo.toml | 16 +- zrml/orderbook-v1/fuzz/Cargo.toml | 2 +- .../fuzz/orderbook_v1_full_workflow.rs | 15 +- zrml/orderbook-v1/src/lib.rs | 2 +- zrml/orderbook-v1/src/mock.rs | 16 +- zrml/orderbook-v1/src/tests.rs | 20 +- zrml/prediction-markets/Cargo.toml | 32 +- zrml/prediction-markets/fuzz/Cargo.toml | 2 +- .../fuzz/pm_full_workflow.rs | 12 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/prediction-markets/src/benchmarks.rs | 2 +- zrml/prediction-markets/src/lib.rs | 26 +- zrml/prediction-markets/src/migrations.rs | 12 +- zrml/prediction-markets/src/mock.rs | 34 +- zrml/prediction-markets/src/tests.rs | 590 ++--- zrml/prediction-markets/src/weights.rs | 193 +- zrml/rikiddo/Cargo.toml | 14 +- zrml/rikiddo/fuzz/Cargo.toml | 4 +- zrml/rikiddo/src/mock.rs | 10 +- zrml/simple-disputes/Cargo.toml | 14 +- zrml/simple-disputes/src/lib.rs | 4 +- zrml/simple-disputes/src/mock.rs | 10 +- zrml/styx/Cargo.toml | 14 +- zrml/styx/src/lib.rs | 4 +- zrml/styx/src/mock.rs | 10 +- zrml/styx/src/tests.rs | 19 +- zrml/styx/src/weights.rs | 6 +- zrml/swaps/Cargo.toml | 22 +- zrml/swaps/fuzz/Cargo.toml | 6 +- zrml/swaps/fuzz/pool_exit.rs | 4 +- .../fuzz/pool_exit_with_exact_asset_amount.rs | 4 +- .../fuzz/pool_exit_with_exact_pool_amount.rs | 4 +- zrml/swaps/fuzz/pool_join.rs | 4 +- .../fuzz/pool_join_with_exact_asset_amount.rs | 4 +- .../fuzz/pool_join_with_exact_pool_amount.rs | 4 +- zrml/swaps/fuzz/swap_exact_amount_in.rs | 4 +- zrml/swaps/fuzz/swap_exact_amount_out.rs | 4 +- zrml/swaps/rpc/Cargo.toml | 6 +- zrml/swaps/runtime-api/Cargo.toml | 4 +- zrml/swaps/src/benchmarks.rs | 2 +- zrml/swaps/src/lib.rs | 4 +- zrml/swaps/src/mock.rs | 18 +- zrml/swaps/src/tests.rs | 84 +- zrml/swaps/src/weights.rs | 136 +- 120 files changed, 3133 insertions(+), 2987 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e39b9c046..83b3d1660 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,6 +17,9 @@ jobs: run: shell: bash steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler # Ensure that at most one benchmark worklow runs across all workflows - name: Turnstyle uses: softprops/turnstyle@v1 diff --git a/.github/workflows/migration.yml b/.github/workflows/migration.yml index 02b4857cd..c7b2785c0 100644 --- a/.github/workflows/migration.yml +++ b/.github/workflows/migration.yml @@ -11,6 +11,9 @@ jobs: name: Test migration runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4af14a7ae..ecff426c4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,6 +14,9 @@ jobs: name: Format runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 @@ -45,6 +48,9 @@ jobs: "standalone" ] steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 @@ -60,6 +66,9 @@ jobs: name: Quick check benchmarks runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 @@ -72,6 +81,9 @@ jobs: name: Tests runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 @@ -103,6 +115,9 @@ jobs: name: Fuzz runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 49b2fe453..1c4af3b64 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -10,6 +10,9 @@ jobs: name: Test Try Runtime runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v3 @@ -27,6 +30,9 @@ jobs: name: Test Try Runtime runs-on: ubuntu-latest steps: + - name: Install ProtoBuf Compiler + run: | + sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index bb4ae6a7a..46d0b186f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,7 +52,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if 1.0.0", - "cipher 0.3.0", + "cipher", "cpufeatures", "opaque-debug 0.3.0", ] @@ -65,7 +65,7 @@ checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ "aead", "aes", - "cipher 0.3.0", + "cipher", "ctr", "ghash", "subtle", @@ -139,6 +139,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "array-bytes" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" + [[package]] name = "arrayref" version = "0.3.6" @@ -306,9 +312,9 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" +checksum = "6ba50e24d9ee0a8950d3d03fc6d0dd10aa14b5de3b101949b4e160f7fee7c723" dependencies = [ "async-std", "async-trait", @@ -431,6 +437,12 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "battery-station-runtime" version = "0.3.8" @@ -505,6 +517,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-fixed", @@ -540,14 +553,14 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", "beefy-primitives", "fnv", "futures 0.3.25", "futures-timer", - "hex", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -557,6 +570,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", + "sc-network-common", "sc-network-gossip", "sc-utils", "sp-api", @@ -576,7 +590,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -596,32 +610,30 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "beefy-primitives", "sp-api", + "sp-runtime", ] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", + "serde", "sp-api", "sp-application-crypto", "sp-core", + "sp-io", + "sp-mmr-primitives", "sp-runtime", "sp-std", ] -[[package]] -name = "bimap" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" - [[package]] name = "bincode" version = "1.3.3" @@ -633,9 +645,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" dependencies = [ "bitflags", "cexpr", @@ -940,7 +952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if 1.0.0", - "cipher 0.3.0", + "cipher", "cpufeatures", "zeroize", ] @@ -953,7 +965,7 @@ checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ "aead", "chacha20", - "cipher 0.3.0", + "cipher", "poly1305", "zeroize", ] @@ -995,16 +1007,6 @@ dependencies = [ "generic-array 0.14.6", ] -[[package]] -name = "cipher" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "ckb-merkle-mountain-range" version = "0.3.2" @@ -1022,31 +1024,29 @@ checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading", ] [[package]] name = "clap" -version = "3.2.23" +version = "4.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", + "is-terminal", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", "proc-macro-error", @@ -1057,22 +1057,13 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" dependencies = [ "os_str_bytes", ] -[[package]] -name = "cmake" -version = "0.1.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" -dependencies = [ - "cc", -] - [[package]] name = "coarsetime" version = "0.1.22" @@ -1226,19 +1217,21 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749d0d6022c9038dccf480bdde2a38d435937335bf2bb0f14e815d94517cdce8" +checksum = "52056f6d0584484b57fa6c1a65c1fcb15f3780d8b6a758426d9e3084169b2ddd" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94370cc7b37bf652ccd8bb8f09bd900997f7ccf97520edfc75554bb5c4abbea" +checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" dependencies = [ + "arrayvec 0.7.2", + "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", @@ -1253,33 +1246,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a3cea8fdab90e44018c5b9a1dfd460d8ee265ac354337150222a354628bdb6" +checksum = "1c451b81faf237d11c7e4f3165eeb6bac61112762c5cfe7b4c0fb7241474358f" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac72f76f2698598951ab26d8c96eaa854810e693e7dd52523958b5909fde6b2" +checksum = "e7c940133198426d26128f08be2b40b0bd117b84771fd36798969c4d712d81fc" [[package]] name = "cranelift-entity" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09eaeacfcd2356fe0e66b295e8f9d59fdd1ac3ace53ba50de14d628ec902f72d" +checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba69c9980d5ffd62c18a2bde927855fcd7c8dc92f29feaf8636052662cbd99c" +checksum = "34897538b36b216cc8dd324e73263596d51b8cf610da6498322838b2546baf8a" dependencies = [ "cranelift-codegen", "log", @@ -1289,15 +1282,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2920dc1e05cac40304456ed3301fde2c09bd6a9b0210bcfa2f101398d628d5b" +checksum = "1b2629a569fae540f16a76b70afcc87ad7decb38dc28fa6c648ac73b51e78470" [[package]] name = "cranelift-native" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04dfa45f9b2a6f587c564d6b63388e00cd6589d2df6ea2758cf79e1a13285e6" +checksum = "20937dab4e14d3e225c5adfc9c7106bafd4ac669bdb43027b911ff794c6fb318" dependencies = [ "cranelift-codegen", "libc", @@ -1306,9 +1299,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.85.3" +version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a46513ae6f26f3f267d8d75b5373d555fbbd1e68681f348d99df43f747ec54" +checksum = "80fc2288957a94fd342a015811479de1837850924166d1f1856d8406e6f3609b" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1446,24 +1439,13 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher 0.3.0", -] - -[[package]] -name = "cuckoofilter" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18" -dependencies = [ - "byteorder", - "fnv", - "rand 0.7.3", + "cipher", ] [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "clap", "parity-scale-codec", @@ -1478,12 +1460,11 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", - "cumulus-relay-chain-interface", "futures 0.3.25", "parity-scale-codec", "parking_lot 0.12.1", @@ -1502,7 +1483,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -1512,7 +1493,6 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", - "sp-api", "sp-blockchain", "sp-consensus", "sp-runtime", @@ -1523,7 +1503,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -1531,7 +1511,6 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.25", "parking_lot 0.12.1", - "sc-client-api", "sc-consensus", "sp-api", "sp-block-builder", @@ -1547,11 +1526,10 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-relay-chain-interface", - "derive_more", "futures 0.3.25", "futures-timer", "parity-scale-codec", @@ -1560,7 +1538,6 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "sc-client-api", - "sp-api", "sp-blockchain", "sp-consensus", "sp-core", @@ -1572,7 +1549,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", @@ -1586,7 +1563,6 @@ dependencies = [ "rand 0.8.5", "sc-client-api", "sc-consensus", - "sp-api", "sp-consensus", "sp-maybe-compressed-blob", "sp-runtime", @@ -1596,7 +1572,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -1605,26 +1581,21 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "parking_lot 0.12.1", - "polkadot-overseer", "polkadot-primitives", "sc-client-api", "sc-consensus", - "sc-consensus-babe", "sc-service", - "sc-telemetry", - "sc-tracing", "sp-api", "sp-blockchain", "sp-consensus", "sp-core", "sp-runtime", - "tracing", ] [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1636,13 +1607,12 @@ dependencies = [ "sp-runtime", "sp-std", "xcm", - "xcm-executor", ] [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1653,11 +1623,9 @@ dependencies = [ "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances", "parity-scale-codec", "polkadot-parachain", "scale-info", - "serde", "sp-core", "sp-externalities", "sp-inherents", @@ -1667,13 +1635,12 @@ dependencies = [ "sp-std", "sp-trie", "sp-version", - "xcm", ] [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1684,14 +1651,13 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde", "sp-io", "sp-runtime", "sp-std", @@ -1701,7 +1667,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -1720,9 +1686,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ - "frame-support", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain", @@ -1736,7 +1701,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1759,7 +1724,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "futures 0.3.25", @@ -1772,18 +1737,14 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", "log", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain", - "polkadot-primitives", "sp-runtime", "sp-std", - "sp-trie", "xcm", "xcm-builder", "xcm-executor", @@ -1792,7 +1753,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1804,39 +1765,31 @@ dependencies = [ "polkadot-service", "sc-cli", "sc-client-api", - "sc-consensus-babe", - "sc-network", "sc-sysinfo", "sc-telemetry", "sc-tracing", "sp-api", - "sp-blockchain", "sp-consensus", "sp-core", "sp-runtime", "sp-state-machine", - "tracing", ] [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "cumulus-primitives-core", - "derive_more", "futures 0.3.25", "jsonrpsee-core", "parity-scale-codec", - "parking_lot 0.12.1", "polkadot-overseer", "polkadot-service", "sc-client-api", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", "sp-state-machine", "thiserror", ] @@ -1844,7 +1797,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "async-trait", "backoff", @@ -1854,11 +1807,12 @@ dependencies = [ "futures-timer", "jsonrpsee", "parity-scale-codec", - "parking_lot 0.12.1", "polkadot-service", "sc-client-api", "sc-rpc-api", "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", "sp-core", "sp-runtime", "sp-state-machine", @@ -1871,7 +1825,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2035,6 +1989,12 @@ dependencies = [ "syn", ] +[[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" @@ -2115,6 +2075,12 @@ dependencies = [ "quick-error", ] +[[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" @@ -2229,9 +2195,9 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck", "proc-macro2", @@ -2453,7 +2419,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2474,9 +2440,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", "rand 0.8.5", @@ -2501,6 +2467,15 @@ dependencies = [ "miniz_oxide 0.5.4", ] +[[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" @@ -2510,7 +2485,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", ] @@ -2524,10 +2499,16 @@ 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/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -2550,9 +2531,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "Inflector", + "array-bytes", "chrono", "clap", "comfy-table", @@ -2562,7 +2544,6 @@ dependencies = [ "gethostname", "handlebars", "hash-db", - "hex", "itertools", "kvdb", "lazy_static", @@ -2601,7 +2582,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2612,7 +2593,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2628,7 +2609,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -2657,7 +2638,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "bitflags", "frame-metadata", @@ -2682,13 +2663,14 @@ dependencies = [ "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/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "Inflector", "cfg-expr", @@ -2702,7 +2684,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2714,7 +2696,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro2", "quote", @@ -2724,7 +2706,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "log", @@ -2736,12 +2718,13 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version", + "sp-weights", ] [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -2756,7 +2739,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-api", @@ -2765,7 +2748,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "parity-scale-codec", @@ -2780,18 +2763,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi", -] - [[package]] name = "fs2" version = "0.4.3" @@ -3176,12 +3147,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "hex_fmt" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" - [[package]] name = "hmac" version = "0.8.1" @@ -3360,9 +3325,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "1.1.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" +checksum = "065c008e570a43c00de6aed9714035e5ea6a498c255323db9091722af6ee67dd" dependencies = [ "async-io", "core-foundation", @@ -3387,9 +3352,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ "serde", ] @@ -3416,15 +3381,6 @@ dependencies = [ "serde", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array 0.14.6", -] - [[package]] name = "instant" version = "0.1.12" @@ -3449,12 +3405,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "io-lifetimes" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" - [[package]] name = "io-lifetimes" version = "0.7.5" @@ -3468,7 +3418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3504,7 +3454,7 @@ dependencies = [ "hermit-abi 0.2.6", "io-lifetimes 1.0.4", "rustix 0.36.7", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3707,8 +3657,8 @@ dependencies = [ [[package]] name = "kusama-runtime" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -3731,10 +3681,12 @@ dependencies = [ "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-gilt", "pallet-grandpa", "pallet-identity", @@ -3749,7 +3701,9 @@ dependencies = [ "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", + "pallet-ranked-collective", "pallet-recovery", + "pallet-referenda", "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", @@ -3763,6 +3717,7 @@ dependencies = [ "pallet-treasury", "pallet-utility", "pallet-vesting", + "pallet-whitelist", "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", @@ -3800,14 +3755,16 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] @@ -3821,9 +3778,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" +checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" dependencies = [ "parity-util-mem", "smallvec", @@ -3831,9 +3788,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" +checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" dependencies = [ "kvdb", "parity-util-mem", @@ -3842,15 +3799,13 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" +checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" dependencies = [ - "fs-swap", "kvdb", "log", "num_cpus", - "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3887,16 +3842,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - [[package]] name = "libloading" version = "0.7.4" @@ -3921,9 +3866,9 @@ checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "libp2p" -version = "0.46.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" +checksum = "ec878fda12ebec479186b3914ebc48ff180fa4c51847e11a1a68bf65249e02c1" dependencies = [ "bytes", "futures 0.3.25", @@ -3931,12 +3876,8 @@ dependencies = [ "getrandom 0.2.8", "instant", "lazy_static", - "libp2p-autonat", "libp2p-core", - "libp2p-deflate", "libp2p-dns", - "libp2p-floodsub", - "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-mdns", @@ -3944,49 +3885,24 @@ dependencies = [ "libp2p-mplex", "libp2p-noise", "libp2p-ping", - "libp2p-plaintext", - "libp2p-pnet", - "libp2p-relay", - "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", "libp2p-swarm-derive", "libp2p-tcp", - "libp2p-uds", "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr", "parking_lot 0.12.1", "pin-project", - "rand 0.7.3", "smallvec", ] -[[package]] -name = "libp2p-autonat" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" -dependencies = [ - "async-trait", - "futures 0.3.25", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-request-response", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.8.5", -] - [[package]] name = "libp2p-core" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" +checksum = "799676bb0807c788065e57551c6527d461ad572162b0519d1958946ff9e0539d" dependencies = [ "asn1_der", "bs58", @@ -3997,7 +3913,6 @@ dependencies = [ "futures-timer", "instant", "lazy_static", - "libsecp256k1", "log", "multiaddr", "multihash", @@ -4007,7 +3922,6 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "ring", "rw-stream-sink", "sha2 0.10.6", "smallvec", @@ -4017,22 +3931,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-deflate" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" -dependencies = [ - "flate2", - "futures 0.3.25", - "libp2p-core", -] - [[package]] name = "libp2p-dns" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" +checksum = "2322c9fb40d99101def6a01612ee30500c89abbbecb6297b3cd252903a4c1720" dependencies = [ "async-std-resolver", "futures 0.3.25", @@ -4043,57 +3946,11 @@ dependencies = [ "trust-dns-resolver", ] -[[package]] -name = "libp2p-floodsub" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" -dependencies = [ - "cuckoofilter", - "fnv", - "futures 0.3.25", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "smallvec", -] - -[[package]] -name = "libp2p-gossipsub" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" -dependencies = [ - "asynchronous-codec", - "base64 0.13.1", - "byteorder", - "bytes", - "fnv", - "futures 0.3.25", - "hex_fmt", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prometheus-client", - "prost", - "prost-build", - "rand 0.7.3", - "regex", - "sha2 0.10.6", - "smallvec", - "unsigned-varint", - "wasm-timer", -] - [[package]] name = "libp2p-identify" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" +checksum = "dcf9a121f699e8719bda2e6e9e9b6ddafc6cff4602471d6481c1067930ccb29b" dependencies = [ "asynchronous-codec", "futures 0.3.25", @@ -4101,7 +3958,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "lru 0.7.8", + "lru 0.8.1", "prost", "prost-build", "prost-codec", @@ -4112,9 +3969,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.38.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" +checksum = "6721c200e2021f6c3fab8b6cf0272ead8912d871610ee194ebd628cecf428f22" dependencies = [ "arrayvec 0.7.2", "asynchronous-codec", @@ -4129,7 +3986,7 @@ dependencies = [ "log", "prost", "prost-build", - "rand 0.7.3", + "rand 0.8.5", "sha2 0.10.6", "smallvec", "thiserror", @@ -4140,16 +3997,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.38.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" +checksum = "761704e727f7d68d58d7bc2231eafae5fc1b9814de24290f126df09d4bd37a15" dependencies = [ "async-io", "data-encoding", "dns-parser", "futures 0.3.25", "if-watch", - "lazy_static", "libp2p-core", "libp2p-swarm", "log", @@ -4161,25 +4017,23 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" +checksum = "9ee31b08e78b7b8bfd1c4204a9dd8a87b4fcdf6dafc57eb51701c1c264a81cb9" dependencies = [ "libp2p-core", - "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-ping", - "libp2p-relay", "libp2p-swarm", "prometheus-client", ] [[package]] name = "libp2p-mplex" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" +checksum = "692664acfd98652de739a8acbb0a0d670f1d67190a49be6b4395e22c37337d89" dependencies = [ "asynchronous-codec", "bytes", @@ -4188,16 +4042,16 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "unsigned-varint", ] [[package]] name = "libp2p-noise" -version = "0.37.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" +checksum = "048155686bd81fe6cb5efdef0c6290f25ad32a0a42e8f4f72625cf6a505a206f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -4217,105 +4071,25 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" -dependencies = [ - "futures 0.3.25", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "rand 0.7.3", - "void", -] - -[[package]] -name = "libp2p-plaintext" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures 0.3.25", - "libp2p-core", - "log", - "prost", - "prost-build", - "unsigned-varint", - "void", -] - -[[package]] -name = "libp2p-pnet" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5a702574223aa55d8878bdc8bf55c84a6086f87ddaddc28ce730b4caa81538" -dependencies = [ - "futures 0.3.25", - "log", - "pin-project", - "rand 0.8.5", - "salsa20", - "sha3", -] - -[[package]] -name = "libp2p-relay" -version = "0.10.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" +checksum = "7228b9318d34689521349a86eb39a3c3a802c9efc99a0568062ffb80913e3f91" dependencies = [ - "asynchronous-codec", - "bytes", - "either", "futures 0.3.25", "futures-timer", "instant", "libp2p-core", "libp2p-swarm", "log", - "pin-project", - "prost", - "prost-build", - "prost-codec", "rand 0.8.5", - "smallvec", - "static_assertions", - "thiserror", - "void", -] - -[[package]] -name = "libp2p-rendezvous" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" -dependencies = [ - "asynchronous-codec", - "bimap", - "futures 0.3.25", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prost", - "prost-build", - "rand 0.8.5", - "sha2 0.10.6", - "thiserror", - "unsigned-varint", "void", ] [[package]] name = "libp2p-request-response" -version = "0.19.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" +checksum = "8827af16a017b65311a410bb626205a9ad92ec0473967618425039fa5231adc1" dependencies = [ "async-trait", "bytes", @@ -4324,16 +4098,16 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.37.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" +checksum = "46d13df7c37807965d82930c0e4b04a659efcb6cca237373b206043db5398ecf" dependencies = [ "either", "fnv", @@ -4343,7 +4117,7 @@ dependencies = [ "libp2p-core", "log", "pin-project", - "rand 0.7.3", + "rand 0.8.5", "smallvec", "thiserror", "void", @@ -4351,48 +4125,36 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.28.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" +checksum = "a0eddc4497a8b5a506013c40e8189864f9c3a00db2b25671f428ae9007f3ba32" dependencies = [ + "heck", "quote", "syn", ] [[package]] name = "libp2p-tcp" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" +checksum = "9839d96761491c6d3e238e70554b856956fca0ab60feb9de2cd08eed4473fa92" dependencies = [ "async-io", "futures 0.3.25", "futures-timer", "if-watch", - "ipnet", "libc", "libp2p-core", "log", "socket2", ] -[[package]] -name = "libp2p-uds" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" -dependencies = [ - "async-std", - "futures 0.3.25", - "libp2p-core", - "log", -] - [[package]] name = "libp2p-wasm-ext" -version = "0.34.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" +checksum = "a17b5b8e7a73e379e47b1b77f8a82c4721e97eca01abcd18e9cd91a23ca6ce97" dependencies = [ "futures 0.3.25", "js-sys", @@ -4404,9 +4166,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.36.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" +checksum = "3758ae6f89b2531a24b6d9f5776bda6a626b60a57600d7185d43dfa75ca5ecc4" dependencies = [ "either", "futures 0.3.25", @@ -4423,12 +4185,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.38.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" +checksum = "0d6874d66543c4f7e26e3b8ca9a6bead351563a13ab4fafd43c7927f7c0d6c12" dependencies = [ "futures 0.3.25", "libp2p-core", + "log", "parking_lot 0.12.1", "thiserror", "yamux", @@ -4436,9 +4199,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.6.1+6.28.2" +version = "0.8.0+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" dependencies = [ "bindgen", "bzip2-sys", @@ -4542,12 +4305,6 @@ dependencies = [ "statrs", ] -[[package]] -name = "linux-raw-sys" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284f00d480e1c39af34e72f8ad60b94f47007e3481cd3b731c1d67190ddc7b7" - [[package]] name = "linux-raw-sys" version = "0.0.46" @@ -4674,11 +4431,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.4.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" dependencies = [ - "libc", + "rustix 0.36.7", ] [[package]] @@ -4710,9 +4467,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" dependencies = [ "hash-db", "hashbrown 0.12.3", @@ -4730,9 +4487,9 @@ dependencies = [ [[package]] name = "memory_units" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "merlin" @@ -4790,13 +4547,40 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.42.0", +] + +[[package]] +name = "mockall" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" +dependencies = [ + "cfg-if 1.0.0", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" +dependencies = [ + "cfg-if 1.0.0", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "moonbeam-vrf" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "nimbus-primitives", "parity-scale-codec", @@ -4884,9 +4668,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" +checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ "bytes", "futures 0.3.25", @@ -5009,7 +4793,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -5040,7 +4824,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "async-trait", "frame-benchmarking", @@ -5097,6 +4881,12 @@ dependencies = [ "memchr", ] +[[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.2.6" @@ -5108,6 +4898,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.3" @@ -5144,7 +4945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ "autocfg", - "num-bigint", + "num-bigint 0.2.6", "num-integer", "num-traits", ] @@ -5156,6 +4957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", + "num-bigint 0.4.3", "num-integer", "num-traits", ] @@ -5182,12 +4984,12 @@ dependencies = [ [[package]] name = "object" -version = "0.28.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", - "hashbrown 0.11.2", + "hashbrown 0.12.3", "indexmap", "memchr", ] @@ -5227,8 +5029,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" -version = "0.0.1" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aab54694ddaa8a9b703724c6ef04272b2d27bc32d2c855aae5cdd1857216b43" dependencies = [ "async-trait", "dyn-clonable", @@ -5243,8 +5046,9 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.0.1" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a702b2f6bf592b3eb06c00d80d05afaf7a8eff6b41bb361e397d799acc21b45a" dependencies = [ "expander 0.0.6", "itertools", @@ -5267,7 +5071,7 @@ dependencies = [ [[package]] name = "orml-asset-registry" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "frame-system", @@ -5286,7 +5090,7 @@ dependencies = [ [[package]] name = "orml-benchmarking" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-benchmarking", "frame-support", @@ -5306,7 +5110,7 @@ dependencies = [ [[package]] name = "orml-currencies" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "frame-system", @@ -5323,7 +5127,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "frame-system", @@ -5338,7 +5142,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5356,7 +5160,7 @@ dependencies = [ [[package]] name = "orml-unknown-tokens" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "frame-system", @@ -5371,7 +5175,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "parity-scale-codec", @@ -5385,7 +5189,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "frame-support", "orml-traits", @@ -5399,7 +5203,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/zeitgeistpm/open-runtime-module-library?branch=moonbeam-polkadot-v0.9.29#d231a39d4583445d1af7326a9e6e78ba744ce6e9" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.32#f336875e48599b5e9500b301385259354821f01f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -5423,15 +5227,6 @@ version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" -[[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 = "packed_simd_2" version = "0.3.8" @@ -5445,7 +5240,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5461,7 +5256,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "frame-benchmarking", "frame-support", @@ -5481,7 +5276,7 @@ dependencies = [ [[package]] name = "pallet-author-mapping" version = "2.0.5" -source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "frame-benchmarking", "frame-support", @@ -5499,7 +5294,7 @@ dependencies = [ [[package]] name = "pallet-author-slot-filter" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=moonbeam-polkadot-v0.9.29#9cb2d9280c4f99bf4ea5acbe57b731dfad1c0e23" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "frame-benchmarking", "frame-support", @@ -5517,7 +5312,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5533,7 +5328,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5548,7 +5343,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5572,7 +5367,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5592,7 +5387,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5607,7 +5402,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "beefy-primitives", "frame-support", @@ -5623,13 +5418,13 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "beefy-merkle-tree", "beefy-primitives", "frame-support", "frame-system", - "hex", "log", "pallet-beefy", "pallet-mmr", @@ -5646,7 +5441,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5664,7 +5459,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5683,7 +5478,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5697,17 +5492,36 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-conviction-voting" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "assert_matches", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5716,13 +5530,14 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "log", + "pallet-election-provider-support-benchmarking", "parity-scale-codec", "rand 0.7.3", "scale-info", @@ -5739,7 +5554,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5752,7 +5567,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5767,10 +5582,31 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-fast-unstake" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-staking", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5785,7 +5621,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5808,7 +5644,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5824,7 +5660,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5844,7 +5680,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5861,7 +5697,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -5878,7 +5714,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5896,7 +5732,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5911,11 +5747,12 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5926,7 +5763,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5943,7 +5780,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5955,6 +5792,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", + "sp-runtime-interface", "sp-staking", "sp-std", ] @@ -5962,7 +5800,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-api", @@ -5972,7 +5810,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -5989,7 +5827,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6012,7 +5850,7 @@ dependencies = [ [[package]] name = "pallet-parachain-staking" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "frame-benchmarking", "frame-support", @@ -6030,11 +5868,12 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -6046,7 +5885,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6061,7 +5900,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6072,16 +5911,52 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-ranked-collective" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "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.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "assert_matches", "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", + "serde", + "sp-arithmetic", "sp-io", "sp-runtime", "sp-std", @@ -6090,7 +5965,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6106,7 +5981,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6127,7 +6002,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6143,7 +6018,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6157,7 +6032,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6180,7 +6055,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6191,7 +6066,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "sp-arithmetic", @@ -6200,7 +6075,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6214,7 +6089,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6232,7 +6107,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6251,7 +6126,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-support", "frame-system", @@ -6267,7 +6142,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6277,23 +6152,25 @@ dependencies = [ "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/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", "sp-runtime", + "sp-weights", ] [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6310,7 +6187,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6326,7 +6203,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6338,10 +6215,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-whitelist" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-xcm" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "frame-system", @@ -6358,8 +6250,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-benchmarking", "frame-support", @@ -6376,14 +6268,13 @@ dependencies = [ [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/cumulus?branch=moonbeam-polkadot-v0.9.29#e4f9bb8949e12e174ec6350cef81e556a5c94b5f" +source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.32#6abd385ce49f7feb882218646410feb063404b77" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde", ] [[package]] @@ -6440,9 +6331,9 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.12.3", @@ -6476,9 +6367,9 @@ dependencies = [ [[package]] name = "parity-wasm" -version = "0.42.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" @@ -6531,7 +6422,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -6662,6 +6553,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "pkg-config" version = "0.3.26" @@ -6682,8 +6584,8 @@ checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkadot-approval-distribution" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -6697,8 +6599,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -6711,13 +6613,13 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derive_more", "fatality", "futures 0.3.25", - "lru 0.7.8", + "lru 0.8.1", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6734,12 +6636,12 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "fatality", "futures 0.3.25", - "lru 0.7.8", + "lru 0.8.1", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6755,8 +6657,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "clap", "frame-benchmarking-cli", @@ -6781,8 +6683,8 @@ dependencies = [ [[package]] name = "polkadot-client" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -6821,10 +6723,11 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "always-assert", + "bitvec", "fatality", "futures 0.3.25", "futures-timer", @@ -6842,8 +6745,8 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -6855,13 +6758,15 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derive_more", "fatality", "futures 0.3.25", - "lru 0.7.8", + "futures-timer", + "indexmap", + "lru 0.8.1", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6878,8 +6783,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -6892,8 +6797,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "futures-timer", @@ -6912,8 +6817,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "always-assert", "async-trait", @@ -6936,8 +6841,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "parity-scale-codec", @@ -6954,15 +6859,15 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "derive_more", "futures 0.3.25", "futures-timer", "kvdb", - "lru 0.7.8", + "lru 0.8.1", "merlin", "parity-scale-codec", "polkadot-node-jaeger", @@ -6983,8 +6888,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "futures 0.3.25", @@ -7003,8 +6908,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "fatality", @@ -7022,8 +6927,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -7037,8 +6942,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "futures 0.3.25", @@ -7055,8 +6960,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -7070,8 +6975,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "futures-timer", @@ -7087,13 +6992,13 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "fatality", "futures 0.3.25", "kvdb", - "lru 0.7.8", + "lru 0.8.1", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7106,8 +7011,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "futures 0.3.25", @@ -7123,8 +7028,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "fatality", @@ -7141,8 +7046,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "always-assert", "assert_matches", @@ -7153,7 +7058,7 @@ dependencies = [ "parity-scale-codec", "pin-project", "polkadot-core-primitives", - "polkadot-node-subsystem-util", + "polkadot-node-metrics", "polkadot-parachain", "rand 0.8.5", "rayon", @@ -7173,8 +7078,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "polkadot-node-primitives", @@ -7189,8 +7094,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "futures 0.3.25", "memory-lru", @@ -7205,8 +7110,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-std", "lazy_static", @@ -7223,8 +7128,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bs58", "futures 0.3.25", @@ -7242,8 +7147,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "derive_more", @@ -7257,6 +7162,7 @@ dependencies = [ "rand 0.8.5", "sc-authority-discovery", "sc-network", + "sc-network-common", "strum", "thiserror", "tracing-gum", @@ -7264,8 +7170,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bounded-vec", "futures 0.3.25", @@ -7286,8 +7192,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7296,8 +7202,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "derive_more", @@ -7319,8 +7225,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "derive_more", @@ -7328,7 +7234,7 @@ dependencies = [ "futures 0.3.25", "itertools", "kvdb", - "lru 0.7.8", + "lru 0.8.1", "parity-db", "parity-scale-codec", "parity-util-mem", @@ -7352,13 +7258,13 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "futures 0.3.25", "futures-timer", - "lru 0.7.8", + "lru 0.8.1", "orchestra", "parity-util-mem", "parking_lot 0.12.1", @@ -7375,8 +7281,8 @@ dependencies = [ [[package]] name = "polkadot-parachain" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derive_more", "frame-support", @@ -7392,8 +7298,8 @@ dependencies = [ [[package]] name = "polkadot-performance-test" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "env_logger 0.9.3", "kusama-runtime", @@ -7407,8 +7313,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitvec", "frame-system", @@ -7437,8 +7343,8 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7469,8 +7375,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -7496,6 +7402,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -7557,8 +7464,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -7604,20 +7511,22 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] name = "polkadot-runtime-metrics" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bs58", "parity-scale-codec", @@ -7628,8 +7537,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "bitflags", "bitvec", @@ -7671,8 +7580,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "async-trait", "beefy-gadget", @@ -7684,7 +7593,7 @@ dependencies = [ "kusama-runtime", "kvdb", "kvdb-rocksdb", - "lru 0.7.8", + "lru 0.8.1", "pallet-babe", "pallet-im-online", "pallet-staking", @@ -7775,8 +7684,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -7796,8 +7705,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -7806,8 +7715,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -7867,8 +7776,8 @@ dependencies = [ [[package]] name = "polkadot-test-service" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-benchmarking", "frame-system", @@ -7930,7 +7839,7 @@ dependencies = [ "libc", "log", "wepoll-ffi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -7962,11 +7871,51 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" + +[[package]] +name = "predicates-tree" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "prettyplease" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "primitive-types" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", @@ -7978,7 +7927,8 @@ dependencies = [ [[package]] name = "prioritized-metered-channel" version = "0.2.0" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382698e48a268c832d0b181ed438374a6bb708a82a8ca273bb0f61c74cf209c4" dependencies = [ "coarsetime", "crossbeam-queue", @@ -8049,21 +7999,21 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.16.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" +checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" dependencies = [ "dtoa", "itoa", - "owning_ref", + "parking_lot 0.12.1", "prometheus-client-derive-text-encode", ] [[package]] name = "prometheus-client-derive-text-encode" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" +checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", @@ -8072,9 +8022,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.10.4" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698" dependencies = [ "bytes", "prost-derive", @@ -8082,31 +8032,31 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.10.4" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" dependencies = [ "bytes", - "cfg-if 1.0.0", - "cmake", "heck", "itertools", "lazy_static", "log", "multimap", "petgraph", + "prettyplease", "prost", "prost-types", "regex", + "syn", "tempfile", "which", ] [[package]] name = "prost-codec" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" +checksum = "011ae9ff8359df7915f97302d591cdd9e0e27fbd5a4ddc5bd13b71079bb20987" dependencies = [ "asynchronous-codec", "bytes", @@ -8117,9 +8067,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.10.1" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d" dependencies = [ "anyhow", "itertools", @@ -8130,9 +8080,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.10.1" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" dependencies = [ "bytes", "prost", @@ -8336,7 +8286,7 @@ dependencies = [ "derive_more", "fs-err", "itertools", - "static_init", + "static_init 0.5.2", "thiserror", ] @@ -8362,9 +8312,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.2.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" +checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" dependencies = [ "fxhash", "log", @@ -8398,25 +8348,12 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "env_logger 0.9.3", - "jsonrpsee", "log", "parity-scale-codec", "serde", @@ -8425,6 +8362,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-version", + "substrate-rpc-client", ] [[package]] @@ -8474,9 +8412,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys", @@ -8484,8 +8422,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -8503,23 +8441,37 @@ dependencies = [ "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", "pallet-collective", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-gilt", "pallet-grandpa", + "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-offences", + "pallet-preimage", "pallet-proxy", + "pallet-recovery", + "pallet-scheduler", "pallet-session", + "pallet-society", "pallet-staking", "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", "polkadot-parachain", "polkadot-primitives", @@ -8545,6 +8497,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", + "static_assertions", "substrate-wasm-builder", "xcm", "xcm-builder", @@ -8553,14 +8506,16 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] @@ -8635,20 +8590,6 @@ dependencies = [ "semver 1.0.16", ] -[[package]] -name = "rustix" -version = "0.33.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938a344304321a9da4973b9ff4f9f8db9caf4597dfd9dda6a60b523340a0fff0" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes 0.5.3", - "libc", - "linux-raw-sys 0.0.42", - "winapi", -] - [[package]] name = "rustix" version = "0.35.13" @@ -8660,7 +8601,7 @@ dependencies = [ "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -8674,7 +8615,7 @@ dependencies = [ "io-lifetimes 1.0.4", "libc", "linux-raw-sys 0.1.4", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -8742,15 +8683,6 @@ dependencies = [ "rustc_version 0.2.3", ] -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher 0.4.3", -] - [[package]] name = "same-file" version = "1.0.6" @@ -8763,7 +8695,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "sp-core", @@ -8774,7 +8706,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures 0.3.25", @@ -8801,7 +8733,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "futures-timer", @@ -8824,7 +8756,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8840,7 +8772,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -8857,7 +8789,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8868,13 +8800,13 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "chrono", "clap", "fdlimit", "futures 0.3.25", - "hex", "libp2p", "log", "names", @@ -8886,6 +8818,7 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", + "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -8907,7 +8840,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "fnv", "futures 0.3.25", @@ -8935,7 +8868,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "hash-db", "kvdb", @@ -8960,7 +8893,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures 0.3.25", @@ -8984,7 +8917,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures 0.3.25", @@ -9013,14 +8946,14 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "fork-tree", "futures 0.3.25", "log", "merlin", - "num-bigint", + "num-bigint 0.2.6", "num-rational 0.2.4", "num-traits", "parity-scale-codec", @@ -9055,7 +8988,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -9077,7 +9010,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "fork-tree", "parity-scale-codec", @@ -9090,7 +9023,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "assert_matches", "async-trait", @@ -9124,7 +9057,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures 0.3.25", @@ -9142,14 +9075,13 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-timestamp", "thiserror", ] [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "lazy_static", "lru 0.7.8", @@ -9176,7 +9108,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "environmental", "parity-scale-codec", @@ -9192,7 +9124,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", @@ -9207,15 +9139,14 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "cfg-if 1.0.0", "libc", "log", "once_cell", "parity-scale-codec", - "parity-wasm 0.42.2", - "rustix 0.33.7", + "parity-wasm 0.45.0", "rustix 0.35.13", "sc-allocator", "sc-executor-common", @@ -9228,16 +9159,16 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", "fork-tree", "futures 0.3.25", "futures-timer", - "hex", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9269,7 +9200,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "finality-grandpa", "futures 0.3.25", @@ -9290,7 +9221,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ansi_term", "futures 0.3.25", @@ -9307,10 +9238,10 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", - "hex", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -9322,8 +9253,9 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", "asynchronous-codec", "bitflags", @@ -9334,7 +9266,6 @@ dependencies = [ "fork-tree", "futures 0.3.25", "futures-timer", - "hex", "ip_network", "libp2p", "linked-hash-map", @@ -9345,7 +9276,6 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "prost", - "prost-build", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9364,20 +9294,41 @@ dependencies = [ "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", - "void", "zeroize", ] +[[package]] +name = "sc-network-bitswap" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "cid", + "futures 0.3.25", + "libp2p", + "log", + "prost", + "prost-build", + "sc-client-api", + "sc-network-common", + "sp-blockchain", + "sp-runtime", + "thiserror", + "unsigned-varint", + "void", +] + [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "bitflags", "bytes", "futures 0.3.25", + "futures-timer", "libp2p", + "linked_hash_set", "parity-scale-codec", "prost-build", "sc-consensus", @@ -9388,13 +9339,14 @@ dependencies = [ "sp-consensus", "sp-finality-grandpa", "sp-runtime", + "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ahash", "futures 0.3.25", @@ -9412,10 +9364,10 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "futures 0.3.25", - "hex", "libp2p", "log", "parity-scale-codec", @@ -9433,14 +9385,15 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "fork-tree", "futures 0.3.25", - "hex", "libp2p", "log", "lru 0.7.8", + "mockall", "parity-scale-codec", "prost", "prost-build", @@ -9448,6 +9401,7 @@ dependencies = [ "sc-consensus", "sc-network-common", "sc-peerset", + "sc-utils", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -9458,16 +9412,35 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-network-transactions" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "array-bytes", + "futures 0.3.25", + "hex", + "libp2p", + "log", + "parity-scale-codec", + "pin-project", + "sc-network-common", + "sc-peerset", + "sp-consensus", + "sp-runtime", + "substrate-prometheus-endpoint", +] + [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "bytes", "fnv", "futures 0.3.25", "futures-timer", - "hex", "hyper", "hyper-rustls", "libp2p", @@ -9491,7 +9464,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "libp2p", @@ -9504,7 +9477,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9513,7 +9486,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "hash-db", @@ -9543,7 +9516,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -9566,7 +9539,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "jsonrpsee", @@ -9576,10 +9549,29 @@ dependencies = [ "tokio", ] +[[package]] +name = "sc-rpc-spec-v2" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "futures 0.3.25", + "hex", + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "directories", @@ -9603,12 +9595,15 @@ dependencies = [ "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-sysinfo", "sc-telemetry", "sc-tracing", @@ -9635,6 +9630,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", + "static_init 1.0.3", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -9646,7 +9642,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", @@ -9660,7 +9656,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9679,7 +9675,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "libc", @@ -9698,7 +9694,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "chrono", "futures 0.3.25", @@ -9716,7 +9712,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ansi_term", "atty", @@ -9747,7 +9743,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9758,8 +9754,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "async-trait", "futures 0.3.25", "futures-timer", "linked-hash-map", @@ -9784,8 +9781,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "async-trait", "futures 0.3.25", "log", "serde", @@ -9797,7 +9795,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "futures-timer", @@ -9839,7 +9837,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -9890,6 +9888,7 @@ checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der", "generic-array 0.14.6", + "pkcs8", "subtle", "zeroize", ] @@ -10020,7 +10019,7 @@ dependencies = [ [[package]] name = "session-keys-primitives" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?tag=v0.27.2-a#cf8094af82c8324378f18ac4b4a647cc06705c33" +source = "git+https://github.com/zeitgeistpm/external#fc957f4629c4a4ee650d912e5d1cf1d50c1a2126" dependencies = [ "async-trait", "frame-support", @@ -10170,8 +10169,8 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "enumn", "parity-scale-codec", @@ -10247,7 +10246,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "hash-db", "log", @@ -10265,7 +10264,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "blake2", "proc-macro-crate", @@ -10277,7 +10276,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10290,7 +10289,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "integer-sqrt", "num-traits", @@ -10305,7 +10304,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10318,7 +10317,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "parity-scale-codec", @@ -10330,7 +10329,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-api", @@ -10342,7 +10341,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures 0.3.25", "log", @@ -10360,7 +10359,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures 0.3.25", @@ -10379,7 +10378,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "parity-scale-codec", @@ -10397,7 +10396,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "merlin", @@ -10420,7 +10419,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10434,7 +10433,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10447,18 +10446,18 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "base58", "bitflags", - "blake2-rfc", + "blake2", "byteorder", "dyn-clonable", "ed25519-zebra", "futures 0.3.25", "hash-db", "hash256-std-hasher", - "hex", "impl-serde", "lazy_static", "libsecp256k1", @@ -10493,7 +10492,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "blake2", "byteorder", @@ -10507,7 +10506,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro2", "quote", @@ -10518,7 +10517,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10527,7 +10526,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "proc-macro2", "quote", @@ -10537,7 +10536,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "environmental", "parity-scale-codec", @@ -10548,7 +10547,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "finality-grandpa", "log", @@ -10566,7 +10565,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10580,10 +10579,9 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "bytes", - "ed25519-dalek", "futures 0.3.25", "hash-db", "libsecp256k1", @@ -10607,7 +10605,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "lazy_static", "sp-core", @@ -10618,7 +10616,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures 0.3.25", @@ -10635,7 +10633,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "thiserror", "zstd", @@ -10644,10 +10642,11 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", + "scale-info", "serde", "sp-api", "sp-core", @@ -10659,7 +10658,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10673,7 +10672,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "sp-api", "sp-core", @@ -10683,7 +10682,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "backtrace", "lazy_static", @@ -10693,7 +10692,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "rustc-hash", "serde", @@ -10703,7 +10702,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "either", "hash256-std-hasher", @@ -10720,12 +10719,13 @@ dependencies = [ "sp-core", "sp-io", "sp-std", + "sp-weights", ] [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10743,7 +10743,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "Inflector", "proc-macro-crate", @@ -10755,7 +10755,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "parity-scale-codec", @@ -10769,7 +10769,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10783,7 +10783,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "scale-info", @@ -10794,7 +10794,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "hash-db", "log", @@ -10816,12 +10816,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10834,7 +10834,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "log", "sp-core", @@ -10847,7 +10847,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "futures-timer", @@ -10863,7 +10863,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "sp-std", @@ -10875,7 +10875,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "sp-api", "sp-runtime", @@ -10884,7 +10884,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "async-trait", "log", @@ -10900,7 +10900,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ahash", "hash-db", @@ -10923,11 +10923,11 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-serde", "parity-scale-codec", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "scale-info", "serde", "sp-core-hashing-proc-macro", @@ -10940,7 +10940,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10951,7 +10951,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "impl-trait-for-tuples", "log", @@ -10961,12 +10961,38 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "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 = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "ss58-registry" version = "1.38.0" @@ -11003,7 +11029,22 @@ dependencies = [ "cfg_aliases", "libc", "parking_lot 0.11.2", - "static_init_macro", + "static_init_macro 0.5.0", +] + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags", + "cfg_aliases", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.6", + "static_init_macro 1.0.2", + "winapi", ] [[package]] @@ -11019,6 +11060,19 @@ dependencies = [ "syn", ] +[[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", +] + [[package]] name = "statrs" version = "0.15.0" @@ -11076,7 +11130,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "platforms 2.0.0", ] @@ -11095,7 +11149,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.25", @@ -11116,7 +11170,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "futures-util", "hyper", @@ -11126,10 +11180,23 @@ dependencies = [ "tokio", ] +[[package]] +name = "substrate-rpc-client" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +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/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "jsonrpsee", "log", @@ -11150,11 +11217,11 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ + "array-bytes", "async-trait", "futures 0.3.25", - "hex", "parity-scale-codec", "sc-client-api", "sc-client-db", @@ -11176,7 +11243,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "ansi_term", "build-helper", @@ -11275,6 +11342,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "termtree" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" + [[package]] name = "test-case" version = "2.2.2" @@ -11299,22 +11372,18 @@ dependencies = [ [[package]] name = "test-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] -[[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.38" @@ -11374,9 +11443,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.4.3+5.2.1-patched.2" +version = "0.5.2+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1792ccb507d955b46af42c123ea8863668fae24d03721e40cad6a41773dbb49" +checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" dependencies = [ "cc", "fs_extra", @@ -11445,7 +11514,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -11573,8 +11642,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -11584,8 +11653,8 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -11662,9 +11731,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -11676,30 +11745,30 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "log", "rand 0.8.5", "smallvec", "thiserror", "tinyvec", + "tracing", "url", ] [[package]] name = "trust-dns-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ "cfg-if 1.0.0", "futures-util", "ipconfig", "lazy_static", - "log", "lru-cache", "parking_lot 0.12.1", "resolv-conf", "smallvec", "thiserror", + "tracing", "trust-dns-proto", ] @@ -11712,11 +11781,10 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate?branch=moonbeam-polkadot-v0.9.29#b7176298ae07e18077b13521e6e0ef678a557aa2" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" dependencies = [ "clap", "frame-try-runtime", - "jsonrpsee", "log", "parity-scale-codec", "remote-externalities", @@ -11732,6 +11800,8 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-version", + "sp-weights", + "substrate-rpc-client", "zstd", ] @@ -11747,7 +11817,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.6", "rand 0.8.5", "static_assertions", @@ -12025,11 +12095,11 @@ dependencies = [ [[package]] name = "wasm-instrument" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" dependencies = [ - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", ] [[package]] @@ -12049,58 +12119,63 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.9.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ - "downcast-rs", - "libc", - "libm 0.2.6", - "memory_units", - "num-rational 0.2.4", - "num-traits", - "parity-wasm 0.42.2", + "parity-wasm 0.45.0", "wasmi-validation", + "wasmi_core", ] [[package]] name = "wasmi-validation" -version = "0.4.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +dependencies = [ + "parity-wasm 0.45.0", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" dependencies = [ - "parity-wasm 0.42.2", + "downcast-rs", + "libm 0.2.6", + "memory_units", + "num-rational 0.4.1", + "num-traits", ] [[package]] name = "wasmparser" -version = "0.85.0" +version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570460c58b21e9150d2df0eaaedbb7816c34bcec009ae0dcc976e40ba81463e7" +checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ "indexmap", ] [[package]] name = "wasmtime" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f50eadf868ab6a04b7b511460233377d0bfbb92e417b2f6a98b98fef2e098f5" +checksum = "4ad5af6ba38311282f2a21670d96e78266e8c8e2f38cbcd52c254df6ccbc7731" dependencies = [ "anyhow", - "backtrace", "bincode", "cfg-if 1.0.0", "indexmap", - "lazy_static", "libc", "log", - "object 0.28.4", + "object 0.29.0", "once_cell", "paste", "psm", "rayon", - "region", "serde", "target-lexicon", "wasmparser", @@ -12109,14 +12184,23 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45de63ddfc8b9223d1adc8f7b2ee5f35d1f6d112833934ad7ea66e4f4339e597" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] name = "wasmtime-cache" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1df23c642e1376892f3b72f311596976979cbf8b85469680cdd3a8a063d12a2" +checksum = "bcd849399d17d2270141cfe47fa0d91ee52d5f8ea9b98cf7ddde0d53e5f79882" dependencies = [ "anyhow", "base64 0.13.1", @@ -12124,19 +12208,19 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.33.7", + "rustix 0.35.13", "serde", "sha2 0.9.9", "toml", - "winapi", + "windows-sys 0.36.1", "zstd", ] [[package]] name = "wasmtime-cranelift" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f264ff6b4df247d15584f2f53d009fbc90032cfdc2605b52b961bffc71b6eccd" +checksum = "4bd91339b742ff20bfed4532a27b73c86b5bcbfedd6bea2dcdf2d64471e1b5c6" dependencies = [ "anyhow", "cranelift-codegen", @@ -12146,8 +12230,7 @@ dependencies = [ "cranelift-wasm", "gimli 0.26.2", "log", - "more-asserts", - "object 0.28.4", + "object 0.29.0", "target-lexicon", "thiserror", "wasmparser", @@ -12156,17 +12239,16 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "839d2820e4b830f4b9e7aa08d4c0acabf4a5036105d639f6dfa1c6891c73bdc6" +checksum = "ebb881c61f4f627b5d45c54e629724974f8a8890d455bcbe634330cc27309644" dependencies = [ "anyhow", "cranelift-entity", "gimli 0.26.2", "indexmap", "log", - "more-asserts", - "object 0.28.4", + "object 0.29.0", "serde", "target-lexicon", "thiserror", @@ -12176,9 +12258,9 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef0a0bcbfa18b946d890078ba0e1bc76bcc53eccfb40806c0020ec29dcd1bd49" +checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681" dependencies = [ "addr2line 0.17.0", "anyhow", @@ -12187,38 +12269,36 @@ dependencies = [ "cpp_demangle", "gimli 0.26.2", "log", - "object 0.28.4", - "region", + "object 0.29.0", "rustc-demangle", - "rustix 0.33.7", + "rustix 0.35.13", "serde", "target-lexicon", "thiserror", "wasmtime-environ", "wasmtime-jit-debug", "wasmtime-runtime", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-jit-debug" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4779d976206c458edd643d1ac622b6c37e4a0800a8b1d25dfbf245ac2f2cac" +checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" dependencies = [ - "lazy_static", - "object 0.28.4", - "rustix 0.33.7", + "object 0.29.0", + "once_cell", + "rustix 0.35.13", ] [[package]] name = "wasmtime-runtime" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7eb6ffa169eb5dcd18ac9473c817358cd57bc62c244622210566d473397954a" +checksum = "ee8f92ad4b61736339c29361da85769ebc200f184361959d1792832e592a1afd" dependencies = [ "anyhow", - "backtrace", "cc", "cfg-if 1.0.0", "indexmap", @@ -12227,21 +12307,21 @@ dependencies = [ "mach", "memfd", "memoffset 0.6.5", - "more-asserts", + "paste", "rand 0.8.5", - "region", - "rustix 0.33.7", + "rustix 0.35.13", "thiserror", + "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "winapi", + "windows-sys 0.36.1", ] [[package]] name = "wasmtime-types" -version = "0.38.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d932b0ac5336f7308d869703dd225610a6a3aeaa8e968c52b43eed96cefb1c2" +checksum = "d23d61cb4c46e837b431196dd06abb11731541021916d03476a178b54dc07aeb" dependencies = [ "cranelift-entity", "serde", @@ -12289,8 +12369,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "beefy-primitives", "bitvec", @@ -12314,6 +12394,7 @@ dependencies = [ "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", + "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", "pallet-im-online", @@ -12378,14 +12459,16 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "polkadot-primitives", "polkadot-runtime-common", "smallvec", + "sp-core", "sp-runtime", + "sp-weights", ] [[package]] @@ -12449,6 +12532,19 @@ dependencies = [ "windows_x86_64_msvc 0.34.0", ] +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -12476,6 +12572,12 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.1" @@ -12488,6 +12590,12 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.1" @@ -12500,6 +12608,12 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.1" @@ -12512,6 +12626,12 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.1" @@ -12530,6 +12650,12 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.42.1" @@ -12567,8 +12693,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -12581,8 +12707,8 @@ dependencies = [ [[package]] name = "xcm-builder" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-support", "frame-system", @@ -12602,7 +12728,7 @@ dependencies = [ [[package]] name = "xcm-emulator" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/xcm-simulator?branch=moonbeam-polkadot-v0.9.29#4d235aab4d2ab8527aceb8b5849ca4eb18a08a08" +source = "git+https://github.com/shaunxw/xcm-simulator?rev=158a6bd2768c679563efa891aa17329635b2764b#158a6bd2768c679563efa891aa17329635b2764b" dependencies = [ "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12627,8 +12753,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "frame-benchmarking", "frame-support", @@ -12645,8 +12771,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "0.9.29" -source = "git+https://github.com/zeitgeistpm/polkadot?branch=moonbeam-polkadot-v0.9.29#91a493ceb0db61c9208dfe8c18e3886b1e5f119b" +version = "0.9.32" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" dependencies = [ "Inflector", "proc-macro2", @@ -12844,6 +12970,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-fixed", diff --git a/node/Cargo.toml b/node/Cargo.toml index a66b5e24b..9b8bf813d 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -3,99 +3,99 @@ name = "zeitgeist" path = "./src/main.rs" [build-dependencies] -substrate-build-script-utils = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +substrate-build-script-utils = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } [dependencies] -pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment-rpc = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-basic-authorship = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-cli = { branch = "moonbeam-polkadot-v0.9.29", features = ["wasmtime"], git = "https://github.com/zeitgeistpm/substrate" } -sc-client-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-consensus = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-executor = { branch = "moonbeam-polkadot-v0.9.29", features = ["wasmtime"], git = "https://github.com/zeitgeistpm/substrate" } -sc-keystore = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-rpc = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-rpc-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-service = { branch = "moonbeam-polkadot-v0.9.29", features = ["wasmtime"], git = "https://github.com/zeitgeistpm/substrate" } -sc-sysinfo = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-telemetry = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-transaction-pool-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-block-builder = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-blockchain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-consensus = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-core = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-inherents = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-keyring = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-offchain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-session = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-storage = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-trie = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -substrate-frame-rpc-system = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-transaction-payment = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment-rpc = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-basic-authorship = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-cli = { branch = "polkadot-v0.9.32", features = ["wasmtime"], git = "https://github.com/paritytech/substrate" } +sc-client-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-consensus = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-executor = { branch = "polkadot-v0.9.32", features = ["wasmtime"], git = "https://github.com/paritytech/substrate" } +sc-keystore = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-rpc = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-rpc-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-service = { branch = "polkadot-v0.9.32", features = ["wasmtime"], git = "https://github.com/paritytech/substrate" } +sc-sysinfo = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-telemetry = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-transaction-pool = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-transaction-pool-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-block-builder = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-blockchain = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-consensus = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-core = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-inherents = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-keyring = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-offchain = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-session = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-storage = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-transaction-pool = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-trie = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +substrate-frame-rpc-system = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } # Try-Runtime -try-runtime-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +try-runtime-cli = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } # Benchmark -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -frame-benchmarking-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +frame-benchmarking-cli = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } # Cumulus -cumulus-client-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-client-collator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-client-consensus-common = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-client-consensus-relay-chain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-client-network = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-client-service = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-core = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-parachain-inherent = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-relay-chain-inprocess-interface = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-relay-chain-interface = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-relay-chain-rpc-interface = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-client-cli = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-client-collator = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-client-consensus-common = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-client-consensus-relay-chain = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-client-network = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-client-service = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-core = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-parachain-inherent = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-relay-chain-inprocess-interface = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-relay-chain-interface = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-relay-chain-rpc-interface = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/cumulus", optional = true } # Parachain -moonbeam-vrf = { tag = "v0.27.2-a", git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -nimbus-consensus = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-parachain-staking = { tag = "v0.27.2-a", git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +moonbeam-vrf = { git = "https://github.com/zeitgeistpm/external", optional = true } +nimbus-consensus = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +nimbus-primitives = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-inherent = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-parachain-staking = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } parity-scale-codec = { optional = true, version = "3.0.0" } -sc-chain-spec = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sc-network = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sc-network-common = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sc-tracing = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +sc-chain-spec = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sc-network = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sc-network-common = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sc-tracing = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } serde = { features = ["derive"], optional = true, version = "1.0.144" } -session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -sp-keystore = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -substrate-prometheus-endpoint = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +session-keys-primitives = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +sp-keystore = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +substrate-prometheus-endpoint = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } # Polkadot -polkadot-cli = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-parachain = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-service = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-test-service = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-cli = { branch = "release-v0.9.32", git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-parachain = { branch = "release-v0.9.32", git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-primitives = { branch = "release-v0.9.32", git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-service = { branch = "release-v0.9.32", git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-test-service = { branch = "release-v0.9.32", git = "https://github.com/paritytech/polkadot", optional = true } # Standalone -sc-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sc-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sc-consensus-aura = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sc-finality-grandpa = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-consensus-aura = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-finality-grandpa = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } # Utility cfg-if = { version = "1.0.0" } -clap = { version = "3.2.20", features = ["derive"] } +clap = { version = "4.0.9", features = ["derive"] } hex-literal = { version = "0.3.4" } jsonrpsee = { version = "0.15.1", features = ["server"] } log = { optional = true, version = "0.4.17" } @@ -157,6 +157,8 @@ parachain = [ runtime-benchmarks = [ "battery-station-runtime?/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", + "polkadot-cli?/runtime-benchmarks", "polkadot-service?/runtime-benchmarks", "zeitgeist-runtime?/runtime-benchmarks", ] diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index 9845c461b..d893ff953 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -163,7 +163,7 @@ pub fn create_benchmark_extrinsic_zeitgeist< >( client: &FullClient, sender: sp_core::sr25519::Pair, - call: zeitgeist_runtime::Call, + call: zeitgeist_runtime::RuntimeCall, nonce: u32, ) -> zeitgeist_runtime::UncheckedExtrinsic { let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); @@ -221,7 +221,7 @@ pub fn create_benchmark_extrinsic_battery_station< >( client: &FullClient, sender: sp_core::sr25519::Pair, - call: battery_station_runtime::Call, + call: battery_station_runtime::RuntimeCall, nonce: u32, ) -> battery_station_runtime::UncheckedExtrinsic { let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); diff --git a/node/src/cli.rs b/node/src/cli.rs index e0609c5eb..0446312c5 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -442,84 +442,84 @@ impl sc_client_api::BlockBackend for Client { impl sc_client_api::StorageProvider for Client { fn storage( &self, - id: &BlockId, + hash: &::Hash, key: &StorageKey, ) -> sp_blockchain::Result> { - match_client!(self, storage(id, key)) + match_client!(self, storage(hash, key)) } fn storage_keys( &self, - id: &BlockId, + hash: &::Hash, key_prefix: &StorageKey, ) -> sp_blockchain::Result> { - match_client!(self, storage_keys(id, key_prefix)) + match_client!(self, storage_keys(hash, key_prefix)) } fn storage_hash( &self, - id: &BlockId, + hash: &::Hash, key: &StorageKey, ) -> sp_blockchain::Result::Hash>> { - match_client!(self, storage_hash(id, key)) + match_client!(self, storage_hash(hash, key)) } fn storage_pairs( &self, - id: &BlockId, + hash: &::Hash, key_prefix: &StorageKey, ) -> sp_blockchain::Result> { - match_client!(self, storage_pairs(id, key_prefix)) + match_client!(self, storage_pairs(hash, key_prefix)) } fn storage_keys_iter<'a>( &self, - id: &BlockId, + hash: &::Hash, prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< KeyIterator<'a, >::State, Block>, > { - match_client!(self, storage_keys_iter(id, prefix, start_key)) + match_client!(self, storage_keys_iter(hash, prefix, start_key)) } fn child_storage( &self, - id: &BlockId, + hash: &::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> sp_blockchain::Result> { - match_client!(self, child_storage(id, child_info, key)) + match_client!(self, child_storage(hash, child_info, key)) } fn child_storage_keys( &self, - id: &BlockId, + hash: &::Hash, child_info: &ChildInfo, key_prefix: &StorageKey, ) -> sp_blockchain::Result> { - match_client!(self, child_storage_keys(id, child_info, key_prefix)) + match_client!(self, child_storage_keys(hash, child_info, key_prefix)) } fn child_storage_keys_iter<'a>( &self, - id: &BlockId, + hash: &::Hash, child_info: ChildInfo, prefix: Option<&'a StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< KeyIterator<'a, >::State, Block>, > { - match_client!(self, child_storage_keys_iter(id, child_info, prefix, start_key)) + match_client!(self, child_storage_keys_iter(hash, child_info, prefix, start_key)) } fn child_storage_hash( &self, - id: &BlockId, + hash: &::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> sp_blockchain::Result::Hash>> { - match_client!(self, child_storage_hash(id, child_info, key)) + match_client!(self, child_storage_hash(hash, child_info, key)) } } diff --git a/node/src/command.rs b/node/src/command.rs index 40f02340f..c0ef23837 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -115,6 +115,11 @@ pub fn run() -> sc_cli::Result<()> { BenchmarkCmd::Machine(cmd) => { runner.sync_run(|config| cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())) } + #[cfg(not(feature = "runtime-benchmarks"))] + BenchmarkCmd::Storage(_) => Err("Storage benchmarking can be enabled with \ + `--features runtime-benchmarks`." + .into()), + #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Storage(cmd) => match chain_spec { #[cfg(feature = "with-zeitgeist-runtime")] spec if spec.is_zeitgeist() => runner.sync_run(|config| { diff --git a/node/src/service/service_parachain.rs b/node/src/service/service_parachain.rs index 9129f3279..b9adec1c1 100644 --- a/node/src/service/service_parachain.rs +++ b/node/src/service/service_parachain.rs @@ -20,7 +20,6 @@ use crate::{ service::{AdditionalRuntimeApiCollection, RuntimeApiCollection}, POLKADOT_BLOCK_DURATION, SOFT_DEADLINE_PERCENT, }; -use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_common::ParachainConsensus; use cumulus_client_network::BlockAnnounceValidator; use cumulus_client_service::{ @@ -291,7 +290,7 @@ where let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue); - let (network, system_rpc_tx, start_network) = + let (network, system_rpc_tx, tx_handler_controller, start_network) = sc_service::build_network(sc_service::BuildNetworkParams { config: ¶chain_config, client: client.clone(), @@ -323,6 +322,7 @@ where keystore: params.keystore_container.sync_keystore(), network: network.clone(), rpc_builder, + tx_handler_controller, system_rpc_tx, task_manager: &mut task_manager, telemetry: telemetry.as_mut(), @@ -390,7 +390,6 @@ where relay_chain_interface, relay_chain_slot_duration, import_queue, - collator_options: CollatorOptions { relay_chain_rpc_url: Default::default() }, }; start_full_node(params)?; diff --git a/node/src/service/service_standalone.rs b/node/src/service/service_standalone.rs index e35731387..6fe00885c 100644 --- a/node/src/service/service_standalone.rs +++ b/node/src/service/service_standalone.rs @@ -19,7 +19,7 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. use crate::service::{AdditionalRuntimeApiCollection, RuntimeApiCollection}; -use sc_client_api::{BlockBackend, ExecutorProvider}; +use sc_client_api::BlockBackend; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; use sc_finality_grandpa::{grandpa_peers_set_config, protocol_standard_name, SharedVoterState}; @@ -96,7 +96,7 @@ where Vec::default(), )); - let (network, system_rpc_tx, network_starter) = + let (network, system_rpc_tx, tx_handler_controller, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, client: client.clone(), @@ -142,6 +142,7 @@ where task_manager: &mut task_manager, transaction_pool: transaction_pool.clone(), rpc_builder: rpc_builder, + tx_handler_controller: tx_handler_controller, backend, system_rpc_tx, config, @@ -170,12 +171,9 @@ where telemetry.as_ref().map(|x| x.handle()), ); - let can_author_with = - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let aura = sc_consensus_aura::start_aura::( + let aura = sc_consensus_aura::start_aura::( StartAuraParams { slot_duration, client, @@ -191,12 +189,11 @@ where slot_duration, ); - Ok((timestamp, slot)) + Ok((slot, timestamp)) }, force_authoring, backoff_authoring_blocks, keystore: keystore_container.sync_keystore(), - can_author_with, sync_oracle: network.clone(), justification_sync_link: network.clone(), block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), @@ -341,7 +338,7 @@ where let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let import_queue = sc_consensus_aura::import_queue::( + let import_queue = sc_consensus_aura::import_queue::( ImportQueueParams { block_import: grandpa_block_import.clone(), justification_import: Some(Box::new(grandpa_block_import.clone())), @@ -355,12 +352,9 @@ where slot_duration, ); - Ok((timestamp, slot)) + Ok((slot, timestamp)) }, spawner: &task_manager.spawn_essential_handle(), - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new( - client.executor().clone(), - ), registry: config.prometheus_registry(), check_for_equivocation: Default::default(), telemetry: telemetry.as_ref().map(|x| x.handle()), diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 38ffb0fac..8de2c8957 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,15 +1,15 @@ [dependencies] arbitrary = { default-features = false, optional = true, version = "1.0" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-currencies = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-tokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { default-features = false, features = ["derive"], optional = true, version = "1.0.144" } -sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-core = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } [dev-dependencies] test-case = "2.0.2" diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index c1c862cc5..5ebb54694 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -1,86 +1,88 @@ [build-dependencies] -substrate-wasm-builder = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +substrate-wasm-builder = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } [dependencies] -frame-executive = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-bounties = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-collective = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-democracy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-identity = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-membership = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-multisig = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-preimage = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-proxy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-scheduler = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-sudo = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-vesting = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-executive = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system-rpc-runtime-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-currencies = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-tokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +pallet-balances = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-bounties = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-collective = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-democracy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-identity = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-membership = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-multisig = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-preimage = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-proxy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-randomness-collective-flip = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-scheduler = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-sudo = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-treasury = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-utility = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-vesting = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } +polkadot-primitives = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-block-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-inherents = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-offchain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-session = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-version = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-block-builder = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-core = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-inherents = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-offchain = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-session = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-std = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-transaction-pool = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-version = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" } # Try-Runtime -frame-try-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-try-runtime = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } # Benchmark -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } -frame-system-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } +frame-system-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } # Cumulus -cumulus-pallet-dmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-pallet-parachain-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-pallet-xcmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -parachain-info = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-dmp-queue = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-parachain-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-xcm = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-xcmp-queue = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-core = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-timestamp = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-utility = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +parachain-info = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } # Parachain +nimbus-primitives = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-inherent = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-mapping = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-slot-filter = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-parachain-staking = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +session-keys-primitives = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } -nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } # Polkadot -polkadot-parachain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-parachain = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } # Standalone -pallet-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-aura = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-grandpa = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-consensus-aura = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-finality-grandpa = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } # Utility cfg-if = { version = "1.0.0" } @@ -88,17 +90,16 @@ hex-literal = { default-features = false, optional = true, version = "0.3.4" } log = { version = "0.4.17", default-features = false, optional = true } # XCM -orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-unknown-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-xcm-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-xtokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-runtime-parachains = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -rococo-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -xcm-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -xcm-executor = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +orml-asset-registry = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-unknown-tokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-xcm-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-xtokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +pallet-xcm = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-runtime-parachains = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +rococo-runtime = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +xcm = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +xcm-builder = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +xcm-executor = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } # Zeitgeist @@ -117,9 +118,9 @@ zrml-swaps = { default-features = false, path = "../../zrml/swaps" } zrml-swaps-runtime-api = { default-features = false, path = "../../zrml/swaps/runtime-api" } [dev-dependencies] -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } test-case = "2.0.2" -xcm-emulator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/xcm-simulator" } +xcm-emulator = { rev = "158a6bd2768c679563efa891aa17329635b2764b", git = "https://github.com/shaunxw/xcm-simulator" } [features] default = ["std"] @@ -153,7 +154,6 @@ parachain = [ "orml-xcm-support", "orml-xtokens", "pallet-xcm", - "polkadot-primitives", "polkadot-runtime-parachains", "rococo-runtime", "xcm-builder", @@ -170,7 +170,7 @@ runtime-benchmarks = [ "cumulus-pallet-xcmp-queue?/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", "orml-asset-registry?/runtime-benchmarks", @@ -241,6 +241,7 @@ std = [ "pallet-utility/std", "pallet-vesting/std", "parity-scale-codec/std", + "polkadot-primitives/std", "scale-info/std", "sp-api/std", "sp-block-builder/std", @@ -300,7 +301,6 @@ std = [ "orml-xcm-support?/std", "orml-xtokens?/std", "pallet-xcm?/std", - "polkadot-primitives?/std", "polkadot-runtime-parachains?/std", "rococo-runtime?/std", "xcm-builder?/std", diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index 1ef5f52b0..df2ebbae0 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -18,7 +18,8 @@ use crate::{ xcm_config::config::{battery_station, general_key}, - AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Origin, Runtime, System, + AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Runtime, RuntimeOrigin, + System, }; use frame_support::{assert_ok, traits::GenesisBuild}; use orml_traits::asset_registry::AssetMetadata; @@ -133,7 +134,7 @@ pub(super) fn register_foreign_ztg(additional_meta: Option) { additional: additional_meta.unwrap_or_default(), }; - assert_ok!(AssetRegistry::register_asset(Origin::root(), meta, Some(FOREIGN_ZTG_ID))); + assert_ok!(AssetRegistry::register_asset(RuntimeOrigin::root(), meta, Some(FOREIGN_ZTG_ID))); } pub(super) fn register_foreign_sibling(additional_meta: Option) { @@ -147,7 +148,11 @@ pub(super) fn register_foreign_sibling(additional_meta: Option) additional: additional_meta.unwrap_or_default(), }; - assert_ok!(AssetRegistry::register_asset(Origin::root(), meta, Some(FOREIGN_SIBLING_ID))); + assert_ok!(AssetRegistry::register_asset( + RuntimeOrigin::root(), + meta, + Some(FOREIGN_SIBLING_ID) + )); } pub(super) fn register_foreign_parent(additional_meta: Option) { @@ -161,7 +166,7 @@ pub(super) fn register_foreign_parent(additional_meta: Option) { additional: additional_meta.unwrap_or_default(), }; - assert_ok!(AssetRegistry::register_asset(Origin::root(), meta, Some(FOREIGN_PARENT_ID))); + assert_ok!(AssetRegistry::register_asset(RuntimeOrigin::root(), meta, Some(FOREIGN_PARENT_ID))); } #[inline] diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index ce93bca74..bd7e87b94 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -18,10 +18,13 @@ use crate::{ parameters::ZeitgeistTreasuryAccount, xcm_config::config::battery_station, AccountId, - CurrencyId, DmpQueue, Origin, Runtime, XcmpQueue, + CurrencyId, DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, }; use frame_support::{traits::GenesisBuild, weights::Weight}; -use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; +use polkadot_primitives::{ + runtime_api::runtime_decl_for_ParachainHost::ParachainHostV3, + v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}, +}; use polkadot_runtime_parachains::configuration::HostConfiguration; use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; @@ -38,7 +41,7 @@ decl_test_relay_chain! { decl_test_parachain! { pub struct Zeitgeist { Runtime = Runtime, - Origin = Origin, + RuntimeOrigin = RuntimeOrigin, XcmpMessageHandler = XcmpQueue, DmpMessageHandler = DmpQueue, new_ext = para_ext(battery_station::ID), @@ -48,7 +51,7 @@ decl_test_parachain! { decl_test_parachain! { pub struct Sibling { Runtime = Runtime, - Origin = Origin, + RuntimeOrigin = RuntimeOrigin, XcmpMessageHandler = XcmpQueue, DmpMessageHandler = DmpQueue, new_ext = para_ext(PARA_ID_SIBLING), diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index 890326ab6..77631353a 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -26,7 +26,7 @@ use crate::{ test_net::{RococoNet, Sibling, TestNet, Zeitgeist}, }, xcm_config::{config::battery_station, fees::default_per_second}, - AssetRegistry, Balance, Balances, CurrencyId, Origin, Tokens, XTokens, + AssetRegistry, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; @@ -58,7 +58,7 @@ fn transfer_ztg_to_sibling() { assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - Origin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE.into()), CurrencyId::Ztg, transfer_amount, Box::new( @@ -71,7 +71,7 @@ fn transfer_ztg_to_sibling() { ) .into() ), - 4_000_000_000, + xcm_emulator::Limited(4_000_000_000), )); // Confirm that Alice's balance is initial_balance - amount_transferred @@ -128,7 +128,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { assert_eq!(Balances::free_balance(&zeitgeist_parachain_account()), 0); assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), bob_initial_balance); assert_ok!(XTokens::transfer( - Origin::signed(BOB.into()), + RuntimeOrigin::signed(BOB.into()), FOREIGN_ZTG_ID, transfer_amount, Box::new( @@ -141,7 +141,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { ) .into() ), - 4_000_000_000, + xcm_emulator::Limited(4_000_000_000), )); // Confirm that Bobs's balance is initial balance - amount transferred @@ -187,7 +187,7 @@ fn transfer_roc_from_relay_chain() { assert!(initial_balance >= transfer_amount); assert_ok!(rococo_runtime::XcmPallet::reserve_transfer_assets( - rococo_runtime::Origin::signed(ALICE.into()), + rococo_runtime::RuntimeOrigin::signed(ALICE.into()), Box::new(Parachain(battery_station::ID).into().into()), Box::new(Junction::AccountId32 { network: NetworkId::Any, id: BOB }.into().into()), Box::new((Here, transfer_amount).into()), @@ -215,7 +215,7 @@ fn transfer_roc_to_relay_chain() { assert!(initial_balance >= transfer_amount); assert_ok!(XTokens::transfer( - Origin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE.into()), FOREIGN_PARENT_ID, transfer_amount, Box::new( @@ -225,7 +225,7 @@ fn transfer_roc_to_relay_chain() { ) .into() ), - 4_000_000_000 + xcm_emulator::Limited(4_000_000_000) )); assert_eq!( @@ -235,7 +235,7 @@ fn transfer_roc_to_relay_chain() { }); RococoNet::execute_with(|| { - assert_eq!(rococo_runtime::Balances::free_balance(&BOB.into()), 948_894_198_216); + assert_eq!(rococo_runtime::Balances::free_balance(&BOB.into()), 999_988_806_429); }); } @@ -274,7 +274,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - Origin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE.into()), CurrencyId::Ztg, transfer_amount, Box::new( @@ -287,7 +287,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { ) .into() ), - 4_000_000_000, + xcm_emulator::Limited(4_000_000_000), )); // Confirm that Alice's balance is initial_balance - amount_transferred diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 8e2f6b1b0..ed7b8c43a 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -102,8 +102,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { pub struct IsCallable; // Currently disables Court, Rikiddo and creation of markets using Court. -impl Contains for IsCallable { - fn contains(call: &Call) -> bool { +impl Contains for IsCallable { + fn contains(call: &RuntimeCall) -> bool { use zeitgeist_primitives::types::{ MarketDisputeMechanism::Court, ScoringRule::RikiddoSigmoidFeeMarketEma, }; @@ -113,9 +113,9 @@ impl Contains for IsCallable { #[allow(clippy::match_like_matches_macro)] match call { - Call::Court(_) => false, - Call::LiquidityMining(_) => false, - Call::PredictionMarkets(inner_call) => { + RuntimeCall::Court(_) => false, + RuntimeCall::LiquidityMining(_) => false, + RuntimeCall::PredictionMarkets(inner_call) => { match inner_call { // Disable Rikiddo markets create_market { scoring_rule: RikiddoSigmoidFeeMarketEma, .. } => false, @@ -146,8 +146,8 @@ create_runtime_with_additional_pallets!( ); impl pallet_sudo::Config for Runtime { - type Call = Call; - type Event = Event; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; } impl_config_traits!(); diff --git a/runtime/battery-station/src/parachain_params.rs b/runtime/battery-station/src/parachain_params.rs index 270e3b1f4..d602239bd 100644 --- a/runtime/battery-station/src/parachain_params.rs +++ b/runtime/battery-station/src/parachain_params.rs @@ -23,7 +23,7 @@ )] #![cfg(feature = "parachain")] -use super::{parameters::MAXIMUM_BLOCK_WEIGHT, Origin, ParachainInfo}; +use super::{parameters::MAXIMUM_BLOCK_WEIGHT, ParachainInfo, RuntimeOrigin}; use frame_support::{parameter_types, weights::Weight}; use orml_traits::parameter_type_with_key; use sp_runtime::{Perbill, Percent}; @@ -44,7 +44,7 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Any; pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UnitWeightCost: u64 = 200_000_000; // Staking diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index bca43038d..eb8e91107 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -24,10 +24,12 @@ use super::VERSION; use frame_support::{ + dispatch::DispatchClass, parameter_types, + traits::WithdrawReasons, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_PER_SECOND}, - DispatchClass, Weight, + Weight, }, PalletId, }; @@ -46,7 +48,8 @@ use frame_support::traits::LockIdentifier; pub(crate) const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 2); + Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 2) + .set_proof_size(polkadot_primitives::v2::MAX_POV_SIZE as u64); pub(crate) const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub(crate) const FEES_AND_TIPS_TREASURY_PERCENTAGE: u32 = 100; pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; @@ -349,6 +352,8 @@ parameter_types! { // Vesting pub const MinVestedTransfer: Balance = ExistentialDeposit::get(); + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } #[cfg(feature = "with-global-disputes")] diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index b60d79506..003801fda 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -17,9 +17,9 @@ use super::fees::{native_per_second, FixedConversionRateProvider}; use crate::{ - AccountId, Ancestry, AssetManager, AssetRegistry, Balance, Call, CurrencyId, MaxInstructions, - Origin, ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, - UnitWeightCost, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, + AccountId, Ancestry, AssetManager, AssetRegistry, Balance, CurrencyId, MaxInstructions, + ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, RuntimeCall, + RuntimeOrigin, UnitWeightCost, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, }; use frame_support::{parameter_types, traits::Everything, WeakBoundedVec}; @@ -70,8 +70,7 @@ impl Config for XcmConfig { /// Additional filters that specify whether the XCM instruction should be executed at all. type Barrier = Barrier; /// The outer call dispatch type. - type Call = Call; - type CallDispatcher = Call; + type RuntimeCall = RuntimeCall; /// Combinations of (Location, Asset) pairs which are trusted as reserves. // Trust the parent chain, sibling parachains and children chains of this chain. type IsReserve = MultiNativeAsset; @@ -90,7 +89,7 @@ impl Config for XcmConfig { /// The means of determining an XCM message's weight. // Adds UnitWeightCost per instruction plus the weight of each instruction. // The total number of instructions are bounded by MaxInstructions - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; /// How to send an onward XCM message. type XcmSender = XcmRouter; } @@ -262,7 +261,7 @@ impl Convert for AccountIdToMultiLocation { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM @@ -283,18 +282,18 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); /// The means for routing XCM messages which are not for local execution into the right message diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index fae491e83..c35c07394 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,31 +1,31 @@ [dependencies] # Pallets -cumulus-pallet-xcmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-bounties = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-collective = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-democracy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-identity = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-membership = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-multisig = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -pallet-preimage = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-proxy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-scheduler = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-vesting = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +cumulus-pallet-xcmp-queue = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-currencies = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-tokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +pallet-author-inherent = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-mapping = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-slot-filter = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-balances = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-bounties = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-collective = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-democracy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-identity = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-membership = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-multisig = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-parachain-staking = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-preimage = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-proxy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-randomness-collective-flip = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-scheduler = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-treasury = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-utility = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-vesting = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } # Utility cfg-if = { version = "1.0.0" } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index ff1ae26ce..bee05ab00 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -46,19 +46,33 @@ pub mod weights; macro_rules! decl_common_types { {} => { use sp_runtime::generic; - use frame_support::traits::{Currency, Imbalance, OnUnbalanced, NeverEnsureOrigin, TryStateSelect}; + use frame_support::traits::{Currency, Imbalance, OnRuntimeUpgrade, OnUnbalanced, NeverEnsureOrigin, TryStateSelect}; pub type Block = generic::Block; type Address = sp_runtime::MultiAddress; + // Migration for scheduler pallet to move from a plain RuntimeCall to a CallOrHash. + pub struct SchedulerMigrationV1toV4; + impl OnRuntimeUpgrade for SchedulerMigrationV1toV4 { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + Scheduler::migrate_v1_to_v4() + } + } + pub type Executive = frame_executive::Executive< Runtime, Block, frame_system::ChainContext, Runtime, AllPalletsWithSystem, - zrml_prediction_markets::migrations::AddOutsiderBond, + ( + SchedulerMigrationV1toV4, + pallet_multisig::migrations::v1::MigrateToV1, + pallet_preimage::migration::v1::Migration, + pallet_democracy::migrations::v1::Migration, + zrml_prediction_markets::migrations::AddOutsiderBond, + ), >; pub type Header = generic::Header; @@ -74,8 +88,8 @@ macro_rules! decl_common_types { CheckWeight, ChargeTransactionPayment, ); - pub type SignedPayload = generic::SignedPayload; - pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; + pub type SignedPayload = generic::SignedPayload; + pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; // Governance type AdvisoryCommitteeInstance = pallet_collective::Instance1; @@ -361,7 +375,7 @@ macro_rules! impl_config_traits { // Configure Pallets #[cfg(feature = "parachain")] impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExecuteOverweightOrigin = EnsureRootOrHalfTechnicalCommittee; type XcmExecutor = xcm_executor::XcmExecutor; } @@ -370,7 +384,7 @@ macro_rules! impl_config_traits { impl cumulus_pallet_parachain_system::Config for Runtime { type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; type DmpMessageHandler = DmpQueue; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type OutboundXcmpMessageSource = XcmpQueue; type ReservedDmpWeight = crate::parachain_params::ReservedDmpWeight; @@ -381,7 +395,7 @@ macro_rules! impl_config_traits { #[cfg(feature = "parachain")] impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = xcm_executor::XcmExecutor; } @@ -390,7 +404,7 @@ macro_rules! impl_config_traits { type ChannelInfo = ParachainSystem; type ControllerOrigin = EnsureRootOrTwoThirdsTechnicalCommittee; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExecuteOverweightOrigin = EnsureRootOrHalfTechnicalCommittee; type VersionWrapper = (); type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; @@ -405,9 +419,9 @@ macro_rules! impl_config_traits { type BlockLength = RuntimeBlockLength; type BlockNumber = BlockNumber; type BlockWeights = RuntimeBlockWeights; - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = RocksDbWeight; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; type Header = generic::Header; @@ -420,7 +434,7 @@ macro_rules! impl_config_traits { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; #[cfg(not(feature = "parachain"))] type OnSetCode = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = SS58Prefix; type SystemWeightInfo = weights::frame_system::WeightInfo; @@ -446,14 +460,14 @@ macro_rules! impl_config_traits { impl pallet_author_mapping::Config for Runtime { type DepositAmount = CollatorDeposit; type DepositCurrency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Keys = session_keys_primitives::VrfId; type WeightInfo = weights::pallet_author_mapping::WeightInfo; } #[cfg(feature = "parachain")] impl pallet_author_slot_filter::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type RandomnessSource = RandomnessCollectiveFlip; type PotentialAuthors = ParachainStaking; type WeightInfo = weights::pallet_author_slot_filter::WeightInfo; @@ -461,8 +475,7 @@ macro_rules! impl_config_traits { #[cfg(not(feature = "parachain"))] impl pallet_grandpa::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; type KeyOwnerProofSystem = (); type KeyOwnerProof = ; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. type XcmExecutor = xcm_executor::XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default @@ -509,7 +522,7 @@ macro_rules! impl_config_traits { type CandidateBondLessDelay = CandidateBondLessDelay; type Currency = Balances; type DelegationBondLessDelay = DelegationBondLessDelay; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type LeaveCandidatesDelay = LeaveCandidatesDelay; type LeaveDelegatorsDelay = LeaveDelegatorsDelay; type MaxBottomDelegationsPerCandidate = MaxBottomDelegationsPerCandidate; @@ -523,6 +536,7 @@ macro_rules! impl_config_traits { type MinSelectedCandidates = MinSelectedCandidates; type MonetaryGovernanceOrigin = EnsureRoot; type OnCollatorPayout = (); + type PayoutCollatorReward = (); type OnNewRound = (); type RevokeDelegationDelay = RevokeDelegationDelay; type RewardPaymentDelay = RewardPaymentDelay; @@ -536,7 +550,7 @@ macro_rules! impl_config_traits { type AuthorityOrigin = AsEnsureOriginWithArg; type Balance = Balance; type CustomMetadata = CustomMetadata; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type WeightInfo = (); } @@ -547,25 +561,35 @@ macro_rules! impl_config_traits { type WeightInfo = weights::orml_currencies::WeightInfo; } + pub struct CurrencyHooks(sp_std::marker::PhantomData); + impl orml_traits::currency::MutationHooks for CurrencyHooks { + type OnDust = orml_tokens::TransferDust; + type OnKilledTokenAccount = (); + type OnNewTokenAccount = (); + type OnSlash = (); + type PostDeposit = (); + type PostTransfer = (); + type PreDeposit = (); + type PreTransfer = (); + } + impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; + type CurrencyHooks = CurrencyHooks; type CurrencyId = CurrencyId; type DustRemovalWhitelist = DustRemovalWhitelist; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; - type OnDust = orml_tokens::TransferDust; - type OnKilledTokenAccount = (); - type OnNewTokenAccount = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = weights::orml_tokens::WeightInfo; } #[cfg(feature = "parachain")] impl orml_unknown_tokens::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; } #[cfg(feature = "parachain")] @@ -575,14 +599,14 @@ macro_rules! impl_config_traits { type BaseXcmWeight = BaseXcmWeight; type CurrencyId = CurrencyId; type CurrencyIdConvert = AssetConvert; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type LocationInverter = LocationInverter; type MaxAssetsForTransfer = MaxAssetsForTransfer; type MinXcmFee = ParachainMinFee; type MultiLocationsFilter = Everything; type ReserveProvider = orml_traits::location::AbsoluteReserveProvider; type SelfLocation = SelfLocation; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type XcmExecutor = xcm_executor::XcmExecutor; } @@ -590,7 +614,7 @@ macro_rules! impl_config_traits { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; @@ -600,40 +624,39 @@ macro_rules! impl_config_traits { impl pallet_collective::Config for Runtime { type DefaultVote = PrimeDefaultVote; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxMembers = AdvisoryCommitteeMaxMembers; type MaxProposals = AdvisoryCommitteeMaxProposals; type MotionDuration = AdvisoryCommitteeMotionDuration; - type Origin = Origin; - type Proposal = Call; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; type WeightInfo = weights::pallet_collective::WeightInfo; } impl pallet_collective::Config for Runtime { type DefaultVote = PrimeDefaultVote; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxMembers = CouncilMaxMembers; type MaxProposals = CouncilMaxProposals; type MotionDuration = CouncilMotionDuration; - type Origin = Origin; - type Proposal = Call; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; type WeightInfo = weights::pallet_collective::WeightInfo; } impl pallet_collective::Config for Runtime { type DefaultVote = PrimeDefaultVote; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxMembers = TechnicalCommitteeMaxMembers; type MaxProposals = TechnicalCommitteeMaxProposals; type MotionDuration = TechnicalCommitteeMotionDuration; - type Origin = Origin; - type Proposal = Call; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; type WeightInfo = weights::pallet_collective::WeightInfo; } impl pallet_democracy::Config for Runtime { - type Proposal = Call; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; type LaunchPeriod = LaunchPeriod; @@ -664,20 +687,21 @@ macro_rules! impl_config_traits { /// Origin for anyone able to veto proposals. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxBlacklisted = ConstU32<100>; + type MaxDeposits = ConstU32<100>; } impl pallet_identity::Config for Runtime { type BasicDeposit = BasicDeposit; type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type FieldDeposit = FieldDeposit; type ForceOrigin = EnsureRootOrTwoThirdsAdvisoryCommittee; type MaxAdditionalFields = MaxAdditionalFields; @@ -691,7 +715,7 @@ macro_rules! impl_config_traits { impl pallet_membership::Config for Runtime { type AddOrigin = EnsureRootOrTwoThirdsCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxMembers = AdvisoryCommitteeMaxMembers; type MembershipChanged = AdvisoryCommittee; type MembershipInitialized = AdvisoryCommittee; @@ -704,7 +728,7 @@ macro_rules! impl_config_traits { impl pallet_membership::Config for Runtime { type AddOrigin = EnsureRootOrThreeFourthsCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxMembers = CouncilMaxMembers; type MembershipChanged = Council; type MembershipInitialized = Council; @@ -717,7 +741,7 @@ macro_rules! impl_config_traits { impl pallet_membership::Config for Runtime { type AddOrigin = EnsureRootOrTwoThirdsCouncil; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxMembers = TechnicalCommitteeMaxMembers; type MembershipChanged = TechnicalCommittee; type MembershipInitialized = TechnicalCommittee; @@ -729,8 +753,8 @@ macro_rules! impl_config_traits { } impl pallet_multisig::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type DepositBase = DepositBase; type DepositFactor = DepositFactor; @@ -740,31 +764,30 @@ macro_rules! impl_config_traits { impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } - impl InstanceFilter for ProxyType { - fn filter(&self, c: &Call) -> bool { + impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { match self { ProxyType::Any => true, ProxyType::CancelProxy => { - matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. })) + matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })) } ProxyType::Governance => matches!( c, - Call::Democracy(..) - | Call::Council(..) - | Call::TechnicalCommittee(..) - | Call::AdvisoryCommittee(..) - | Call::Treasury(..) + RuntimeCall::Democracy(..) + | RuntimeCall::Council(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::AdvisoryCommittee(..) + | RuntimeCall::Treasury(..) ), #[cfg(feature = "parachain")] - ProxyType::Staking => matches!(c, Call::ParachainStaking(..)), + ProxyType::Staking => matches!(c, RuntimeCall::ParachainStaking(..)), #[cfg(not(feature = "parachain"))] ProxyType::Staking => false, } @@ -781,8 +804,8 @@ macro_rules! impl_config_traits { } impl pallet_proxy::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type Currency = Balances; type ProxyType = ProxyType; type ProxyDepositBase = ProxyDepositBase; @@ -798,17 +821,16 @@ macro_rules! impl_config_traits { impl pallet_randomness_collective_flip::Config for Runtime {} impl pallet_scheduler::Config for Runtime { - type Event = Event; - type Origin = Origin; + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; type PalletsOrigin = OriginCaller; - type Call = Call; + type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = EqualPrivilegeOnly; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } // Timestamp @@ -854,7 +876,7 @@ macro_rules! impl_config_traits { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; type LengthToFee = ConstantMultiplier; type OnChargeTransaction = @@ -868,7 +890,7 @@ macro_rules! impl_config_traits { type Burn = Burn; type BurnDestination = (); type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxApprovals = MaxApprovals; type OnSlash = (); type PalletId = TreasuryPalletId; @@ -892,23 +914,24 @@ macro_rules! impl_config_traits { type CuratorDepositMin = CuratorDepositMin; type CuratorDepositMultiplier = CuratorDepositMultiplier; type DataDepositPerByte = DataDepositPerByte; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaximumReasonLength = MaximumReasonLength; type WeightInfo = weights::pallet_bounties::WeightInfo; } impl pallet_utility::Config for Runtime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type PalletsOrigin = OriginCaller; type WeightInfo = weights::pallet_utility::WeightInfo; } impl pallet_vesting::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type BlockNumberToBalance = sp_runtime::traits::ConvertInto; type MinVestedTransfer = MinVestedTransfer; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; type WeightInfo = weights::pallet_vesting::WeightInfo; // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the @@ -923,7 +946,7 @@ macro_rules! impl_config_traits { type AuthorizedDisputeResolutionOrigin = EnsureRootOrMoreThanHalfAdvisoryCommittee; type CorrectionPeriod = CorrectionPeriod; type DisputeResolution = zrml_prediction_markets::Pallet; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type PalletId = AuthorizedPalletId; type WeightInfo = zrml_authorized::weights::WeightInfo; @@ -932,7 +955,7 @@ macro_rules! impl_config_traits { impl zrml_court::Config for Runtime { type CourtCaseDuration = CourtCaseDuration; type DisputeResolution = zrml_prediction_markets::Pallet; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type PalletId = CourtPalletId; type Random = RandomnessCollectiveFlip; @@ -942,7 +965,7 @@ macro_rules! impl_config_traits { } impl zrml_liquidity_mining::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type MarketId = MarketId; type PalletId = LiquidityMiningPalletId; @@ -987,7 +1010,7 @@ macro_rules! impl_config_traits { type DestroyOrigin = EnsureRootOrAllAdvisoryCommittee; type DisputeBond = DisputeBond; type DisputeFactor = DisputeFactor; - type Event = Event; + type RuntimeEvent = RuntimeEvent; #[cfg(feature = "with-global-disputes")] type GlobalDisputes = GlobalDisputes; #[cfg(feature = "with-global-disputes")] @@ -1042,7 +1065,7 @@ macro_rules! impl_config_traits { impl zrml_simple_disputes::Config for Runtime { type DisputeResolution = zrml_prediction_markets::Pallet; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type PalletId = SimpleDisputesPalletId; } @@ -1050,7 +1073,7 @@ macro_rules! impl_config_traits { #[cfg(feature = "with-global-disputes")] impl zrml_global_disputes::Config for Runtime { type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type GlobalDisputeLockId = GlobalDisputeLockId; type GlobalDisputesPalletId = GlobalDisputesPalletId; type MarketCommons = MarketCommons; @@ -1063,7 +1086,7 @@ macro_rules! impl_config_traits { } impl zrml_swaps::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExitFee = ExitFee; type FixedTypeU = FixedU128; type FixedTypeS = FixedI128; @@ -1089,7 +1112,7 @@ macro_rules! impl_config_traits { } impl zrml_styx::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SetBurnAmountOrigin = EnsureRootOrHalfCouncil; type Currency = Balances; type WeightInfo = zrml_styx::weights::WeightInfo; @@ -1323,17 +1346,17 @@ macro_rules! create_runtime_api { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi for Runtime { fn query_call_info( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::RuntimeDispatchInfo { TransactionPayment::query_call_info(call, len) } fn query_call_fee_details( - call: Call, + call: RuntimeCall, len: u32, ) -> pallet_transaction_payment::FeeDetails { TransactionPayment::query_call_fee_details(call, len) @@ -1794,7 +1817,7 @@ macro_rules! create_common_tests { mod common_tests { mod fees { use crate::*; - use frame_support::weights::{DispatchClass, Weight}; + use frame_support::{dispatch::DispatchClass, weights::Weight}; use sp_core::H256; use sp_runtime::traits::Convert; diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index 2a79c580f..a1dcae571 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,13 +51,13 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::weights::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - Weight::from_ref_time(13_891_000) + Weight::from_ref_time(5_117_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - Weight::from_ref_time(13_630_000) + Weight::from_ref_time(4_929_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index a818f1049..4ff36d522 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,41 +50,41 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl frame_system::weights::WeightInfo for WeightInfo { fn remark(b: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) + Weight::from_ref_time(14_250_344) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(221).saturating_mul(b.into())) } fn remark_with_event(b: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000).saturating_mul(b.into())) + Weight::from_ref_time(8_451_000) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(1_022).saturating_mul(b.into())) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - Weight::from_ref_time(15_370_000) + Weight::from_ref_time(5_344_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Skipped Metadata (r:0 w:0) fn set_storage(i: u32) -> Weight { - Weight::from_ref_time(8_585_000) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(1_059_000).saturating_mul(i.into())) + Weight::from_ref_time(2_566_000) + // Standard Error: 641 + .saturating_add(Weight::from_ref_time(422_592).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_storage(i: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(1_075_000).saturating_mul(i.into())) + Weight::from_ref_time(171_591) + // Standard Error: 1_072 + .saturating_add(Weight::from_ref_time(374_557).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_prefix(p: u32) -> Weight { - Weight::from_ref_time(4_159_000) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(2_234_000).saturating_mul(p.into())) + Weight::from_ref_time(3_820_435) + // Standard Error: 1_116 + .saturating_add(Weight::from_ref_time(802_972).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } } diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index 7651cf806..02d4ad48c 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -19,8 +19,8 @@ cfg_if::cfg_if! { if #[cfg(feature = "parachain")] { pub mod cumulus_pallet_xcmp_queue; - pub mod pallet_author_inherent; pub mod pallet_author_mapping; + pub mod pallet_author_inherent; pub mod pallet_author_slot_filter; pub mod pallet_parachain_staking; } else { diff --git a/runtime/common/src/weights/orml_currencies.rs b/runtime/common/src/weights/orml_currencies.rs index 134ebe24e..56f819471 100644 --- a/runtime/common/src/weights/orml_currencies.rs +++ b/runtime/common/src/weights/orml_currencies.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for orml_currencies //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,13 +49,13 @@ impl orml_currencies::WeightInfo for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_non_native_currency() -> Weight { - Weight::from_ref_time(76_920_000) + Weight::from_ref_time(32_440_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn transfer_native_currency() -> Weight { - Weight::from_ref_time(56_290_000) + Weight::from_ref_time(26_112_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -63,19 +63,19 @@ impl orml_currencies::WeightInfo for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn update_balance_non_native_currency() -> Weight { - Weight::from_ref_time(53_350_000) + Weight::from_ref_time(21_841_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn update_balance_native_currency_creating() -> Weight { - Weight::from_ref_time(52_710_000) + Weight::from_ref_time(21_761_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn update_balance_native_currency_killing() -> Weight { - Weight::from_ref_time(48_730_000) + Weight::from_ref_time(19_903_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/orml_tokens.rs b/runtime/common/src/weights/orml_tokens.rs index fd20584e7..35439a294 100644 --- a/runtime/common/src/weights/orml_tokens.rs +++ b/runtime/common/src/weights/orml_tokens.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,28 +49,28 @@ impl orml_tokens::WeightInfo for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(76_440_000) + Weight::from_ref_time(32_422_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(78_740_000) + Weight::from_ref_time(33_839_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(61_710_000) + Weight::from_ref_time(26_131_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:2 w:1) fn force_transfer() -> Weight { - Weight::from_ref_time(68_460_000) + Weight::from_ref_time(29_017_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -78,7 +78,7 @@ impl orml_tokens::WeightInfo for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn set_balance() -> Weight { - Weight::from_ref_time(51_830_000) + Weight::from_ref_time(21_766_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_inherent.rs b/runtime/common/src/weights/pallet_author_inherent.rs index 58c692e04..32d3ad1f3 100644 --- a/runtime/common/src/weights/pallet_author_inherent.rs +++ b/runtime/common/src/weights/pallet_author_inherent.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_author_inherent //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -56,7 +56,7 @@ impl pallet_author_inherent::weights::WeightInfo for We // Storage: AuthorFilter EligibleCount (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn kick_off_authorship_validation() -> Weight { - Weight::from_ref_time(47_670_000) + Weight::from_ref_time(17_682_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_author_mapping.rs b/runtime/common/src/weights/pallet_author_mapping.rs index c2c35e486..c209eb3a7 100644 --- a/runtime/common/src/weights/pallet_author_mapping.rs +++ b/runtime/common/src/weights/pallet_author_mapping.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_author_mapping //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,14 +53,14 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn add_association() -> Weight { - Weight::from_ref_time(59_320_000) + Weight::from_ref_time(22_888_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn update_association() -> Weight { - Weight::from_ref_time(42_141_000) + Weight::from_ref_time(19_480_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -68,7 +68,7 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn clear_association() -> Weight { - Weight::from_ref_time(54_180_000) + Weight::from_ref_time(25_500_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -76,14 +76,14 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: AuthorMapping MappingWithDeposit (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_keys() -> Weight { - Weight::from_ref_time(66_530_000) + Weight::from_ref_time(28_334_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping NimbusLookup (r:1 w:1) // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) fn set_keys() -> Weight { - Weight::from_ref_time(52_730_000) + Weight::from_ref_time(21_788_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_slot_filter.rs b/runtime/common/src/weights/pallet_author_slot_filter.rs index b59599ff7..05125ed59 100644 --- a/runtime/common/src/weights/pallet_author_slot_filter.rs +++ b/runtime/common/src/weights/pallet_author_slot_filter.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_author_slot_filter //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,6 +51,6 @@ pub struct WeightInfo(PhantomData); impl pallet_author_slot_filter::weights::WeightInfo for WeightInfo { // Storage: AuthorFilter EligibleCount (r:0 w:1) fn set_eligible() -> Weight { - Weight::from_ref_time(24_640_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(9_073_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 3497719e2..c36932388 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,43 +51,43 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::weights::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(75_550_000) + Weight::from_ref_time(31_432_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(61_350_000) + Weight::from_ref_time(23_506_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - Weight::from_ref_time(44_461_000) + Weight::from_ref_time(17_067_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - Weight::from_ref_time(47_560_000) + Weight::from_ref_time(19_078_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - Weight::from_ref_time(74_281_000) + Weight::from_ref_time(31_192_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(65_200_000) + Weight::from_ref_time(26_679_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - Weight::from_ref_time(37_050_000) + Weight::from_ref_time(14_123_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_bounties.rs b/runtime/common/src/weights/pallet_bounties.rs index d4f205867..8883f6ee5 100644 --- a/runtime/common/src/weights/pallet_bounties.rs +++ b/runtime/common/src/weights/pallet_bounties.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,42 +53,42 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: Bounties BountyDescriptions (r:0 w:1) // Storage: Bounties Bounties (r:0 w:1) fn propose_bounty(d: u32) -> Weight { - Weight::from_ref_time(54_421_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000).saturating_mul(d.into())) + Weight::from_ref_time(22_070_891) + // Standard Error: 7 + .saturating_add(Weight::from_ref_time(513).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) fn approve_bounty() -> Weight { - Weight::from_ref_time(28_180_000) + Weight::from_ref_time(9_036_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn propose_curator() -> Weight { - Weight::from_ref_time(23_090_000) + Weight::from_ref_time(8_789_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn unassign_curator() -> Weight { - Weight::from_ref_time(61_871_000) + Weight::from_ref_time(25_810_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - Weight::from_ref_time(51_330_000) + Weight::from_ref_time(21_446_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn award_bounty() -> Weight { - Weight::from_ref_time(47_600_000) + Weight::from_ref_time(16_247_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -96,14 +96,14 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn claim_bounty() -> Weight { - Weight::from_ref_time(116_790_000) + Weight::from_ref_time(50_791_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_proposed() -> Weight { - Weight::from_ref_time(63_830_000) + Weight::from_ref_time(26_410_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -111,23 +111,23 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_active() -> Weight { - Weight::from_ref_time(90_651_000) + Weight::from_ref_time(39_490_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) fn extend_bounty_expiry() -> Weight { - Weight::from_ref_time(40_350_000) + Weight::from_ref_time(16_379_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties BountyApprovals (r:1 w:1) - // Storage: Bounties Bounties (r:1 w:1) - // Storage: System Account (r:1 w:1) + // Storage: Bounties Bounties (r:2 w:2) + // Storage: System Account (r:3 w:3) fn spend_funds(b: u32) -> Weight { - Weight::from_ref_time(24_132_000) - // Standard Error: 235_000 - .saturating_add(Weight::from_ref_time(46_899_000).saturating_mul(b.into())) + Weight::from_ref_time(19_140_664) + // Standard Error: 26_913 + .saturating_add(Weight::from_ref_time(18_448_072).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) } diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index 6e19990f0..383666603 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,16 +51,14 @@ pub struct WeightInfo(PhantomData); impl pallet_collective::weights::WeightInfo for WeightInfo { // Storage: AdvisoryCommittee Members (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:0) - // Storage: AdvisoryCommittee Voting (r:255 w:255) // Storage: AdvisoryCommittee Prime (r:0 w:1) - fn set_members(m: u32, n: u32, p: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 195_000 - .saturating_add(Weight::from_ref_time(41_182_000).saturating_mul(m.into())) - // Standard Error: 195_000 - .saturating_add(Weight::from_ref_time(210_000).saturating_mul(n.into())) - // Standard Error: 76_000 - .saturating_add(Weight::from_ref_time(21_533_000).saturating_mul(p.into())) + // Storage: AdvisoryCommittee Voting (r:255 w:255) + fn set_members(m: u32, _n: u32, p: u32) -> Weight { + Weight::from_ref_time(12_092_000) + // Standard Error: 120_533 + .saturating_add(Weight::from_ref_time(9_830_156).saturating_mul(m.into())) + // Standard Error: 47_324 + .saturating_add(Weight::from_ref_time(5_530_913).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -68,21 +66,21 @@ impl pallet_collective::weights::WeightInfo for WeightI } // Storage: AdvisoryCommittee Members (r:1 w:0) fn execute(b: u32, m: u32) -> Weight { - Weight::from_ref_time(38_237_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(40_000).saturating_mul(m.into())) + Weight::from_ref_time(13_910_710) + // Standard Error: 39 + .saturating_add(Weight::from_ref_time(1_329).saturating_mul(b.into())) + // Standard Error: 409 + .saturating_add(Weight::from_ref_time(13_307).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee ProposalOf (r:1 w:0) fn propose_execute(b: u32, m: u32) -> Weight { - Weight::from_ref_time(44_582_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(14_000).saturating_mul(m.into())) + Weight::from_ref_time(15_156_779) + // Standard Error: 36 + .saturating_add(Weight::from_ref_time(1_439).saturating_mul(b.into())) + // Standard Error: 378 + .saturating_add(Weight::from_ref_time(17_083).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) } // Storage: AdvisoryCommittee Members (r:1 w:0) @@ -91,22 +89,22 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalCount (r:1 w:1) // Storage: AdvisoryCommittee Voting (r:0 w:1) fn propose_proposed(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(37_436_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(20_000).saturating_mul(b.into())) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(39_000).saturating_mul(m.into())) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(279_000).saturating_mul(p.into())) + Weight::from_ref_time(22_819_241) + // Standard Error: 354 + .saturating_add(Weight::from_ref_time(4_011).saturating_mul(b.into())) + // Standard Error: 3_707 + .saturating_add(Weight::from_ref_time(35_095).saturating_mul(m.into())) + // Standard Error: 1_427 + .saturating_add(Weight::from_ref_time(90_320).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee Voting (r:1 w:1) fn vote(m: u32) -> Weight { - Weight::from_ref_time(75_377_000) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(454_000).saturating_mul(m.into())) + Weight::from_ref_time(34_942_963) + // Standard Error: 5_250 + .saturating_add(Weight::from_ref_time(43_923).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -115,9 +113,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_early_disapproved(_m: u32, p: u32) -> Weight { - Weight::from_ref_time(125_780_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(208_000).saturating_mul(p.into())) + Weight::from_ref_time(31_521_383) + // Standard Error: 1_768 + .saturating_add(Weight::from_ref_time(91_263).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -126,13 +124,13 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_early_approved(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(50_328_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(14_000).saturating_mul(b.into())) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(134_000).saturating_mul(m.into())) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(320_000).saturating_mul(p.into())) + Weight::from_ref_time(27_750_291) + // Standard Error: 381 + .saturating_add(Weight::from_ref_time(3_284).saturating_mul(b.into())) + // Standard Error: 4_030 + .saturating_add(Weight::from_ref_time(77_635).saturating_mul(m.into())) + // Standard Error: 1_532 + .saturating_add(Weight::from_ref_time(101_653).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -142,9 +140,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_disapproved(_m: u32, p: u32) -> Weight { - Weight::from_ref_time(77_551_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(224_000).saturating_mul(p.into())) + Weight::from_ref_time(35_447_953) + // Standard Error: 1_843 + .saturating_add(Weight::from_ref_time(82_511).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -154,13 +152,13 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_approved(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(23_404_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(30_000).saturating_mul(b.into())) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(288_000).saturating_mul(m.into())) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(360_000).saturating_mul(p.into())) + Weight::from_ref_time(32_560_116) + // Standard Error: 378 + .saturating_add(Weight::from_ref_time(1_465).saturating_mul(b.into())) + // Standard Error: 4_008 + .saturating_add(Weight::from_ref_time(62_930).saturating_mul(m.into())) + // Standard Error: 1_523 + .saturating_add(Weight::from_ref_time(101_811).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -168,9 +166,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Voting (r:0 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn disapprove_proposal(p: u32) -> Weight { - Weight::from_ref_time(48_539_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(202_000).saturating_mul(p.into())) + Weight::from_ref_time(20_281_170) + // Standard Error: 1_763 + .saturating_add(Weight::from_ref_time(84_565).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index ab69d96f6..de3816890 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,122 +54,99 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(85_600_000) + Weight::from_ref_time(41_898_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second(s: u32) -> Weight { - Weight::from_ref_time(60_373_000) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(160_000).saturating_mul(s.into())) + fn second() -> Weight { + Weight::from_ref_time(35_120_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new(r: u32) -> Weight { - Weight::from_ref_time(82_360_000) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(175_000).saturating_mul(r.into())) + fn vote_new() -> Weight { + Weight::from_ref_time(41_886_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing(r: u32) -> Weight { - Weight::from_ref_time(78_219_000) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(234_000).saturating_mul(r.into())) + fn vote_existing() -> Weight { + Weight::from_ref_time(41_576_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(40_670_000) + Weight::from_ref_time(14_658_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:2 w:2) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:2 w:2) - fn blacklist(p: u32) -> Weight { - Weight::from_ref_time(105_157_000) - // Standard Error: 22_000 - .saturating_add(Weight::from_ref_time(412_000).saturating_mul(p.into())) + fn blacklist() -> Weight { + Weight::from_ref_time(67_163_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose(v: u32) -> Weight { - Weight::from_ref_time(31_020_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(16_000).saturating_mul(v.into())) + fn external_propose() -> Weight { + Weight::from_ref_time(11_206_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(10_040_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(3_060_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(9_880_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(3_068_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(40_500_000) + Weight::from_ref_time(15_630_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external(v: u32) -> Weight { - Weight::from_ref_time(44_735_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(37_000).saturating_mul(v.into())) + fn veto_external() -> Weight { + Weight::from_ref_time(19_253_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:2 w:2) - fn cancel_proposal(p: u32) -> Weight { - Weight::from_ref_time(86_644_000) - // Standard Error: 12_000 - .saturating_add(Weight::from_ref_time(307_000).saturating_mul(p.into())) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(58_487_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(43_850_000).saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - fn cancel_queued(r: u32) -> Weight { - Weight::from_ref_time(49_773_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(801_000).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + Weight::from_ref_time(9_790_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) + // Storage: Democracy ReferendumInfoOf (r:2 w:0) fn on_initialize_base(r: u32) -> Weight { - Weight::from_ref_time(29_677_000) - // Standard Error: 32_000 - .saturating_add(Weight::from_ref_time(3_533_000).saturating_mul(r.into())) + Weight::from_ref_time(8_978_113) + // Standard Error: 4_589 + .saturating_add(Weight::from_ref_time(1_536_205).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -179,33 +156,33 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) + // Storage: Democracy ReferendumInfoOf (r:2 w:0) fn on_initialize_base_with_launch_period(r: u32) -> Weight { - Weight::from_ref_time(31_642_000) - // Standard Error: 31_000 - .saturating_add(Weight::from_ref_time(3_606_000).saturating_mul(r.into())) + Weight::from_ref_time(10_988_037) + // Standard Error: 4_483 + .saturating_add(Weight::from_ref_time(1_538_250).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) + // Storage: Democracy ReferendumInfoOf (r:2 w:2) fn delegate(r: u32) -> Weight { - Weight::from_ref_time(92_827_000) - // Standard Error: 52_000 - .saturating_add(Weight::from_ref_time(5_479_000).saturating_mul(r.into())) + Weight::from_ref_time(33_942_458) + // Standard Error: 6_275 + .saturating_add(Weight::from_ref_time(2_384_438).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) + // Storage: Democracy ReferendumInfoOf (r:2 w:2) fn undelegate(r: u32) -> Weight { - Weight::from_ref_time(51_753_000) - // Standard Error: 59_000 - .saturating_add(Weight::from_ref_time(5_388_000).saturating_mul(r.into())) + Weight::from_ref_time(20_552_008) + // Standard Error: 4_945 + .saturating_add(Weight::from_ref_time(2_352_801).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -213,40 +190,15 @@ impl pallet_democracy::weights::WeightInfo for WeightIn } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(10_700_000).saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: Democracy Preimages (r:1 w:1) - fn note_preimage(b: u32) -> Weight { - Weight::from_ref_time(54_036_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: Democracy Preimages (r:1 w:1) - fn note_imminent_preimage(b: u32) -> Weight { - Weight::from_ref_time(42_055_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - fn reap_preimage(b: u32) -> Weight { - Weight::from_ref_time(71_620_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + Weight::from_ref_time(4_079_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_remove(r: u32) -> Weight { - Weight::from_ref_time(57_238_000) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(146_000).saturating_mul(r.into())) + Weight::from_ref_time(23_309_726) + // Standard Error: 1_610 + .saturating_add(Weight::from_ref_time(51_836).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -254,27 +206,27 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_set(r: u32) -> Weight { - Weight::from_ref_time(55_627_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(214_000).saturating_mul(r.into())) + Weight::from_ref_time(23_116_641) + // Standard Error: 932 + .saturating_add(Weight::from_ref_time(78_997).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_vote(r: u32) -> Weight { - Weight::from_ref_time(35_445_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(251_000).saturating_mul(r.into())) + Weight::from_ref_time(13_637_289) + // Standard Error: 991 + .saturating_add(Weight::from_ref_time(83_991).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_other_vote(r: u32) -> Weight { - Weight::from_ref_time(36_669_000) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(221_000).saturating_mul(r.into())) + Weight::from_ref_time(14_220_574) + // Standard Error: 3_420 + .saturating_add(Weight::from_ref_time(81_496).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index 21325ec38..7a1ec50f4 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,19 +51,19 @@ pub struct WeightInfo(PhantomData); impl pallet_identity::weights::WeightInfo for WeightInfo { // Storage: Identity Registrars (r:1 w:1) fn add_registrar(r: u32) -> Weight { - Weight::from_ref_time(32_453_000) - // Standard Error: 71_000 - .saturating_add(Weight::from_ref_time(830_000).saturating_mul(r.into())) + Weight::from_ref_time(12_045_217) + // Standard Error: 5_701 + .saturating_add(Weight::from_ref_time(411_913).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) fn set_identity(r: u32, x: u32) -> Weight { - Weight::from_ref_time(57_592_000) - // Standard Error: 79_000 - .saturating_add(Weight::from_ref_time(453_000).saturating_mul(r.into())) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(614_000).saturating_mul(x.into())) + Weight::from_ref_time(23_218_766) + // Standard Error: 21_173 + .saturating_add(Weight::from_ref_time(396_383).saturating_mul(r.into())) + // Standard Error: 2_459 + .saturating_add(Weight::from_ref_time(216_337).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -71,9 +71,9 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:1 w:1) fn set_subs_new(s: u32) -> Weight { - Weight::from_ref_time(57_926_000) - // Standard Error: 76_000 - .saturating_add(Weight::from_ref_time(4_193_000).saturating_mul(s.into())) + Weight::from_ref_time(20_621_097) + // Standard Error: 5_753 + .saturating_add(Weight::from_ref_time(1_822_204).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -83,9 +83,9 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:1) fn set_subs_old(p: u32) -> Weight { - Weight::from_ref_time(50_949_000) - // Standard Error: 12_000 - .saturating_add(Weight::from_ref_time(1_846_000).saturating_mul(p.into())) + Weight::from_ref_time(21_538_109) + // Standard Error: 5_896 + .saturating_add(Weight::from_ref_time(819_934).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) @@ -94,64 +94,70 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity IdentityOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:64) fn clear_identity(r: u32, s: u32, x: u32) -> Weight { - Weight::from_ref_time(61_225_000) - // Standard Error: 216_000 - .saturating_add(Weight::from_ref_time(442_000).saturating_mul(r.into())) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(1_828_000).saturating_mul(s.into())) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(236_000).saturating_mul(x.into())) + Weight::from_ref_time(24_817_395) + // Standard Error: 18_666 + .saturating_add(Weight::from_ref_time(261_241).saturating_mul(r.into())) + // Standard Error: 2_173 + .saturating_add(Weight::from_ref_time(813_003).saturating_mul(s.into())) + // Standard Error: 2_173 + .saturating_add(Weight::from_ref_time(97_431).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) - fn request_judgement(_r: u32, x: u32) -> Weight { - Weight::from_ref_time(68_611_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(616_000).saturating_mul(x.into())) + fn request_judgement(r: u32, x: u32) -> Weight { + Weight::from_ref_time(24_883_132) + // Standard Error: 8_677 + .saturating_add(Weight::from_ref_time(391_028).saturating_mul(r.into())) + // Standard Error: 1_007 + .saturating_add(Weight::from_ref_time(209_582).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) - fn cancel_request(_r: u32, x: u32) -> Weight { - Weight::from_ref_time(75_094_000) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(550_000).saturating_mul(x.into())) + fn cancel_request(r: u32, x: u32) -> Weight { + Weight::from_ref_time(23_411_702) + // Standard Error: 8_263 + .saturating_add(Weight::from_ref_time(261_255).saturating_mul(r.into())) + // Standard Error: 959 + .saturating_add(Weight::from_ref_time(207_342).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_fee(r: u32) -> Weight { - Weight::from_ref_time(18_492_000) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(339_000).saturating_mul(r.into())) + Weight::from_ref_time(6_373_117) + // Standard Error: 3_180 + .saturating_add(Weight::from_ref_time(272_816).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_account_id(r: u32) -> Weight { - Weight::from_ref_time(17_817_000) - // Standard Error: 52_000 - .saturating_add(Weight::from_ref_time(709_000).saturating_mul(r.into())) + Weight::from_ref_time(6_536_881) + // Standard Error: 3_217 + .saturating_add(Weight::from_ref_time(268_060).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) - fn set_fields(_r: u32) -> Weight { - Weight::from_ref_time(20_985_000) + fn set_fields(r: u32) -> Weight { + Weight::from_ref_time(6_379_872) + // Standard Error: 3_198 + .saturating_add(Weight::from_ref_time(284_984).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn provide_judgement(r: u32, x: u32) -> Weight { - Weight::from_ref_time(44_404_000) - // Standard Error: 84_000 - .saturating_add(Weight::from_ref_time(865_000).saturating_mul(r.into())) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(993_000).saturating_mul(x.into())) + Weight::from_ref_time(18_544_167) + // Standard Error: 8_411 + .saturating_add(Weight::from_ref_time(298_269).saturating_mul(r.into())) + // Standard Error: 859 + .saturating_add(Weight::from_ref_time(347_720).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -159,12 +165,14 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity IdentityOf (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Identity SuperOf (r:0 w:64) - fn kill_identity(_r: u32, s: u32, x: u32) -> Weight { - Weight::from_ref_time(109_373_000) - // Standard Error: 31_000 - .saturating_add(Weight::from_ref_time(1_657_000).saturating_mul(s.into())) - // Standard Error: 31_000 - .saturating_add(Weight::from_ref_time(75_000).saturating_mul(x.into())) + fn kill_identity(r: u32, s: u32, x: u32) -> Weight { + Weight::from_ref_time(33_739_768) + // Standard Error: 21_993 + .saturating_add(Weight::from_ref_time(179_160).saturating_mul(r.into())) + // Standard Error: 2_560 + .saturating_add(Weight::from_ref_time(816_776).saturating_mul(s.into())) + // Standard Error: 2_560 + .saturating_add(Weight::from_ref_time(93_630).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -173,18 +181,18 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn add_sub(s: u32) -> Weight { - Weight::from_ref_time(75_288_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(50_000).saturating_mul(s.into())) + Weight::from_ref_time(26_774_459) + // Standard Error: 2_099 + .saturating_add(Weight::from_ref_time(142_653).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) fn rename_sub(s: u32) -> Weight { - Weight::from_ref_time(29_243_000) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(188_000).saturating_mul(s.into())) + Weight::from_ref_time(11_263_610) + // Standard Error: 1_038 + .saturating_add(Weight::from_ref_time(68_019).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -192,18 +200,18 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn remove_sub(s: u32) -> Weight { - Weight::from_ref_time(71_661_000) - // Standard Error: 15_000 - .saturating_add(Weight::from_ref_time(227_000).saturating_mul(s.into())) + Weight::from_ref_time(29_027_542) + // Standard Error: 2_964 + .saturating_add(Weight::from_ref_time(102_862).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn quit_sub(s: u32) -> Weight { - Weight::from_ref_time(57_480_000) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(184_000).saturating_mul(s.into())) + Weight::from_ref_time(20_501_723) + // Standard Error: 1_836 + .saturating_add(Weight::from_ref_time(126_775).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index d5291f4cc..dc18101ec 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,9 +54,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn add_member(m: u32) -> Weight { - Weight::from_ref_time(44_484_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(37_000).saturating_mul(m.into())) + Weight::from_ref_time(15_790_016) + // Standard Error: 647 + .saturating_add(Weight::from_ref_time(31_177).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -66,9 +66,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn remove_member(m: u32) -> Weight { - Weight::from_ref_time(47_524_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(77_000).saturating_mul(m.into())) + Weight::from_ref_time(17_898_825) + // Standard Error: 616 + .saturating_add(Weight::from_ref_time(27_596).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -78,9 +78,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn swap_member(m: u32) -> Weight { - Weight::from_ref_time(46_637_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(128_000).saturating_mul(m.into())) + Weight::from_ref_time(17_795_029) + // Standard Error: 628 + .saturating_add(Weight::from_ref_time(36_370).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -90,9 +90,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn reset_member(m: u32) -> Weight { - Weight::from_ref_time(46_814_000) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(267_000).saturating_mul(m.into())) + Weight::from_ref_time(17_561_643) + // Standard Error: 691 + .saturating_add(Weight::from_ref_time(104_626).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -102,9 +102,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn change_key(m: u32) -> Weight { - Weight::from_ref_time(48_470_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(89_000).saturating_mul(m.into())) + Weight::from_ref_time(18_510_706) + // Standard Error: 686 + .saturating_add(Weight::from_ref_time(34_672).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -112,15 +112,18 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn set_prime(m: u32) -> Weight { - Weight::from_ref_time(18_199_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(72_000).saturating_mul(m.into())) + Weight::from_ref_time(6_527_451) + // Standard Error: 269 + .saturating_add(Weight::from_ref_time(10_485).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) - fn clear_prime(_m: u32) -> Weight { - Weight::from_ref_time(11_622_000).saturating_add(T::DbWeight::get().writes(2)) + fn clear_prime(m: u32) -> Weight { + Weight::from_ref_time(3_713_794) + // Standard Error: 136 + .saturating_add(Weight::from_ref_time(834).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index 15e72f97e..431e903fa 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,99 +50,65 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_multisig::weights::WeightInfo for WeightInfo { fn as_multi_threshold_1(z: u32) -> Weight { - Weight::from_ref_time(40_350_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + Weight::from_ref_time(15_009_826) + // Standard Error: 4 + .saturating_add(Weight::from_ref_time(279).saturating_mul(z.into())) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) - fn as_multi_create(_s: u32, z: u32) -> Weight { - Weight::from_ref_time(98_340_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + fn as_multi_create(s: u32, z: u32) -> Weight { + Weight::from_ref_time(26_652_211) + // Standard Error: 1_415 + .saturating_add(Weight::from_ref_time(94_659).saturating_mul(s.into())) + // Standard Error: 13 + .saturating_add(Weight::from_ref_time(1_052).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) - // Storage: MultiSig Calls (r:1 w:1) - // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) - fn as_multi_create_store(s: u32, z: u32) -> Weight { - Weight::from_ref_time(89_465_000) - // Standard Error: 19_000 - .saturating_add(Weight::from_ref_time(14_000).saturating_mul(s.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: MultiSig Multisigs (r:1 w:1) fn as_multi_approve(s: u32, z: u32) -> Weight { - Weight::from_ref_time(48_826_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(139_000).saturating_mul(s.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000).saturating_mul(z.into())) + Weight::from_ref_time(20_049_942) + // Standard Error: 908 + .saturating_add(Weight::from_ref_time(84_603).saturating_mul(s.into())) + // Standard Error: 8 + .saturating_add(Weight::from_ref_time(995).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) - // Storage: MultiSig Calls (r:1 w:1) - fn as_multi_approve_store(s: u32, z: u32) -> Weight { - Weight::from_ref_time(73_692_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(110_000).saturating_mul(s.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: MultiSig Multisigs (r:1 w:1) - // Storage: MultiSig Calls (r:1 w:1) // Storage: System Account (r:1 w:1) fn as_multi_complete(s: u32, z: u32) -> Weight { - Weight::from_ref_time(91_645_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(105_000).saturating_mul(s.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + Weight::from_ref_time(27_852_359) + // Standard Error: 1_356 + .saturating_add(Weight::from_ref_time(117_468).saturating_mul(s.into())) + // Standard Error: 13 + .saturating_add(Weight::from_ref_time(1_031).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MultiSig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn approve_as_multi_create(s: u32) -> Weight { - Weight::from_ref_time(59_874_000) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(182_000).saturating_mul(s.into())) + Weight::from_ref_time(24_697_515) + // Standard Error: 1_850 + .saturating_add(Weight::from_ref_time(97_497).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) - // Storage: MultiSig Calls (r:1 w:0) fn approve_as_multi_approve(s: u32) -> Weight { - Weight::from_ref_time(43_800_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(173_000).saturating_mul(s.into())) + Weight::from_ref_time(17_670_882) + // Standard Error: 1_328 + .saturating_add(Weight::from_ref_time(94_493).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: MultiSig Multisigs (r:1 w:1) - // Storage: MultiSig Calls (r:1 w:1) - // Storage: System Account (r:1 w:1) - fn approve_as_multi_complete(s: u32) -> Weight { - Weight::from_ref_time(103_694_000) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(194_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - // Storage: MultiSig Multisigs (r:1 w:1) - // Storage: MultiSig Calls (r:1 w:1) fn cancel_as_multi(s: u32) -> Weight { - Weight::from_ref_time(89_339_000) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(197_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + Weight::from_ref_time(24_687_555) + // Standard Error: 1_647 + .saturating_add(Weight::from_ref_time(108_089).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index f20df184a..7f8ea8f17 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_parachain_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,39 +51,39 @@ pub struct WeightInfo(PhantomData); impl pallet_parachain_staking::weights::WeightInfo for WeightInfo { // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_staking_expectations() -> Weight { - Weight::from_ref_time(36_750_000) + Weight::from_ref_time(22_959_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking InflationConfig (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_inflation() -> Weight { - Weight::from_ref_time(94_430_000) + Weight::from_ref_time(53_944_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_account() -> Weight { - Weight::from_ref_time(33_460_000) + Weight::from_ref_time(12_549_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_reserve_percent() -> Weight { - Weight::from_ref_time(32_350_000) + Weight::from_ref_time(12_385_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking TotalSelected (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_total_selected() -> Weight { - Weight::from_ref_time(36_990_000) + Weight::from_ref_time(14_233_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking CollatorCommission (r:1 w:1) fn set_collator_commission() -> Weight { - Weight::from_ref_time(31_200_000) + Weight::from_ref_time(12_029_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -91,7 +91,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TotalSelected (r:1 w:0) // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_blocks_per_round() -> Weight { - Weight::from_ref_time(99_720_000) + Weight::from_ref_time(35_350_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -104,9 +104,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TopDelegations (r:0 w:1) // Storage: ParachainStaking BottomDelegations (r:0 w:1) fn join_candidates(x: u32) -> Weight { - Weight::from_ref_time(105_148_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(369_000).saturating_mul(x.into())) + Weight::from_ref_time(32_869_323) + // Standard Error: 1_610 + .saturating_add(Weight::from_ref_time(193_154).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -114,9 +114,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn schedule_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(118_551_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(313_000).saturating_mul(x.into())) + Weight::from_ref_time(25_820_357) + // Standard Error: 1_488 + .saturating_add(Weight::from_ref_time(174_057).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -131,9 +131,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking BottomDelegations (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 226_000 - .saturating_add(Weight::from_ref_time(44_890_000).saturating_mul(x.into())) + Weight::from_ref_time(62_477_000) + // Standard Error: 41_796 + .saturating_add(Weight::from_ref_time(15_946_001).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -142,23 +142,23 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn cancel_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(115_324_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(358_000).saturating_mul(x.into())) + Weight::from_ref_time(23_095_410) + // Standard Error: 1_510 + .saturating_add(Weight::from_ref_time(190_401).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_offline() -> Weight { - Weight::from_ref_time(52_570_000) + Weight::from_ref_time(20_218_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_online() -> Weight { - Weight::from_ref_time(51_920_000) + Weight::from_ref_time(20_722_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -168,14 +168,14 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn candidate_bond_more() -> Weight { - Weight::from_ref_time(97_240_000) + Weight::from_ref_time(34_948_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_candidate_bond_less() -> Weight { - Weight::from_ref_time(47_370_000) + Weight::from_ref_time(19_230_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -186,13 +186,13 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: System Account (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn execute_candidate_bond_less() -> Weight { - Weight::from_ref_time(94_561_000) + Weight::from_ref_time(40_550_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) fn cancel_candidate_bond_less() -> Weight { - Weight::from_ref_time(50_120_000) + Weight::from_ref_time(17_798_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -203,12 +203,10 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) - fn delegate(x: u32, y: u32) -> Weight { - Weight::from_ref_time(221_620_000) - // Standard Error: 48_000 - .saturating_add(Weight::from_ref_time(372_000).saturating_mul(x.into())) - // Standard Error: 15_000 - .saturating_add(Weight::from_ref_time(527_000).saturating_mul(y.into())) + fn delegate(_x: u32, y: u32) -> Weight { + Weight::from_ref_time(98_852_381) + // Standard Error: 3_632 + .saturating_add(Weight::from_ref_time(74_937).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -216,7 +214,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn schedule_leave_delegators() -> Weight { - Weight::from_ref_time(63_370_000) + Weight::from_ref_time(21_612_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -231,9 +229,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn execute_leave_delegators(x: u32) -> Weight { - Weight::from_ref_time(27_207_000) - // Standard Error: 226_000 - .saturating_add(Weight::from_ref_time(34_240_000).saturating_mul(x.into())) + Weight::from_ref_time(17_452_622) + // Standard Error: 21_795 + .saturating_add(Weight::from_ref_time(13_924_996).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -242,7 +240,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_leave_delegators() -> Weight { - Weight::from_ref_time(52_221_000) + Weight::from_ref_time(20_919_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -250,7 +248,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_revoke_delegation() -> Weight { - Weight::from_ref_time(51_631_000) + Weight::from_ref_time(22_510_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -263,7 +261,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn delegator_bond_more() -> Weight { - Weight::from_ref_time(109_970_000) + Weight::from_ref_time(47_725_000) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -271,7 +269,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_delegator_bond_less() -> Weight { - Weight::from_ref_time(51_671_000) + Weight::from_ref_time(22_039_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -286,7 +284,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_revoke_delegation() -> Weight { - Weight::from_ref_time(138_000_000) + Weight::from_ref_time(62_301_000) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(8)) } @@ -300,59 +298,72 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_delegator_bond_less() -> Weight { - Weight::from_ref_time(121_801_000) + Weight::from_ref_time(51_233_000) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_revoke_delegation() -> Weight { - Weight::from_ref_time(49_720_000) + Weight::from_ref_time(21_273_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_delegator_bond_less() -> Weight { - Weight::from_ref_time(61_280_000) + Weight::from_ref_time(26_229_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: ParachainStaking Round (r:1 w:1) // Storage: ParachainStaking Points (r:1 w:0) - // Storage: ParachainStaking Staked (r:1 w:2) + // Storage: ParachainStaking Staked (r:1 w:1) // Storage: ParachainStaking InflationConfig (r:1 w:0) // Storage: ParachainStaking ParachainBondInfo (r:1 w:0) - // Storage: System Account (r:302 w:301) + // Storage: System Account (r:1 w:1) // Storage: ParachainStaking CollatorCommission (r:1 w:0) + // Storage: ParachainStaking DelayedPayouts (r:0 w:1) + fn prepare_staking_payouts() -> Weight { + Weight::from_ref_time(30_172_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) + // Storage: ParachainStaking TopDelegations (r:1 w:0) + fn get_rewardable_delegators(y: u32) -> Weight { + Weight::from_ref_time(9_044_052) + // Standard Error: 934 + .saturating_add(Weight::from_ref_time(166_721).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2)) + } // Storage: ParachainStaking CandidatePool (r:1 w:0) // Storage: ParachainStaking TotalSelected (r:1 w:0) - // Storage: ParachainStaking CandidateInfo (r:9 w:0) - // Storage: ParachainStaking DelegationScheduledRequests (r:9 w:0) - // Storage: ParachainStaking TopDelegations (r:9 w:0) - // Storage: ParachainStaking AutoCompoundingDelegations (r:9 w:0) - // Storage: ParachainStaking Total (r:1 w:0) - // Storage: ParachainStaking AwardedPts (r:2 w:1) - // Storage: ParachainStaking AtStake (r:1 w:10) + // Storage: ParachainStaking CandidateInfo (r:1 w:0) + // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) + // Storage: ParachainStaking TopDelegations (r:1 w:0) + // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:0) // Storage: ParachainStaking SelectedCandidates (r:0 w:1) - // Storage: ParachainStaking DelayedPayouts (r:0 w:1) - fn round_transition_on_initialize(x: u32, y: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 1_640_000 - .saturating_add(Weight::from_ref_time(58_147_000).saturating_mul(x.into())) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(398_000).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) + // Storage: ParachainStaking AtStake (r:0 w:1) + fn select_top_candidates(x: u32, y: u32) -> Weight { + Weight::from_ref_time(19_457_000) + // Standard Error: 194_470 + .saturating_add(Weight::from_ref_time(14_446_541).saturating_mul(x.into())) + // Standard Error: 96_977 + .saturating_add(Weight::from_ref_time(2_854_011).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into()))) } // Storage: ParachainStaking DelayedPayouts (r:1 w:0) // Storage: ParachainStaking Points (r:1 w:0) - // Storage: ParachainStaking AwardedPts (r:2 w:1) - // Storage: ParachainStaking AtStake (r:1 w:1) + // Storage: ParachainStaking AtStake (r:2 w:1) + // Storage: ParachainStaking AwardedPts (r:1 w:1) // Storage: System Account (r:1 w:1) fn pay_one_collator_reward(y: u32) -> Weight { - Weight::from_ref_time(74_512_000) - // Standard Error: 78_000 - .saturating_add(Weight::from_ref_time(18_939_000).saturating_mul(y.into())) + Weight::from_ref_time(41_033_942) + // Standard Error: 5_622 + .saturating_add(Weight::from_ref_time(7_673_326).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -360,16 +371,16 @@ impl pallet_parachain_staking::weights::WeightInfo for } // Storage: ParachainStaking Round (r:1 w:0) fn base_on_initialize() -> Weight { - Weight::from_ref_time(15_540_000).saturating_add(T::DbWeight::get().reads(1)) + Weight::from_ref_time(5_312_000).saturating_add(T::DbWeight::get().reads(1)) } // Storage: ParachainStaking DelegatorState (r:1 w:0) // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) fn set_auto_compound(x: u32, y: u32) -> Weight { - Weight::from_ref_time(172_244_000) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(387_000).saturating_mul(x.into())) - // Standard Error: 35_000 - .saturating_add(Weight::from_ref_time(30_000).saturating_mul(y.into())) + Weight::from_ref_time(42_718_871) + // Standard Error: 2_814 + .saturating_add(Weight::from_ref_time(161_876).saturating_mul(x.into())) + // Standard Error: 8_425 + .saturating_add(Weight::from_ref_time(104_510).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -383,12 +394,18 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Total (r:1 w:1) // Storage: ParachainStaking BottomDelegations (r:1 w:1) fn delegate_with_auto_compound(x: u32, y: u32, _z: u32) -> Weight { - Weight::from_ref_time(290_047_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(115_000).saturating_mul(x.into())) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(184_000).saturating_mul(y.into())) + Weight::from_ref_time(100_631_109) + // Standard Error: 2_763 + .saturating_add(Weight::from_ref_time(81_505).saturating_mul(x.into())) + // Standard Error: 2_763 + .saturating_add(Weight::from_ref_time(48_166).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(8)) } + // Storage: System Account (r:1 w:1) + fn mint_collator_reward() -> Weight { + Weight::from_ref_time(18_241_000) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index cd9b38b90..0e47fa95b 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,88 +49,87 @@ use frame_support::{ /// Weight functions for pallet_preimage (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_preimage::weights::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn note_preimage(s: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) + Weight::from_ref_time(21_280_000) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(1_231).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn note_requested_preimage(s: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(14_404_000) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(1_233).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn note_no_deposit_preimage(s: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(13_424_000) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(1_231).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(97_561_000) + Weight::from_ref_time(28_640_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(68_920_000) + Weight::from_ref_time(16_748_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(93_040_000) + Weight::from_ref_time(15_219_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(72_890_000) + Weight::from_ref_time(6_886_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(47_821_000) + Weight::from_ref_time(13_170_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(18_310_000) + Weight::from_ref_time(6_794_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(74_260_000) + Weight::from_ref_time(16_478_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(38_170_000) + Weight::from_ref_time(6_985_000) .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(20_180_000) + Weight::from_ref_time(6_886_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index 940a3f950..54077497e 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,40 +51,38 @@ pub struct WeightInfo(PhantomData); impl pallet_proxy::weights::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32) -> Weight { - Weight::from_ref_time(39_097_000) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(94_000).saturating_mul(p.into())) + Weight::from_ref_time(14_846_152) + // Standard Error: 3_656 + .saturating_add(Weight::from_ref_time(20_035).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32) -> Weight { - Weight::from_ref_time(71_706_000) - // Standard Error: 26_000 - .saturating_add(Weight::from_ref_time(185_000).saturating_mul(a.into())) - // Standard Error: 27_000 - .saturating_add(Weight::from_ref_time(78_000).saturating_mul(p.into())) + Weight::from_ref_time(29_808_110) + // Standard Error: 3_086 + .saturating_add(Weight::from_ref_time(68_700).saturating_mul(a.into())) + // Standard Error: 3_189 + .saturating_add(Weight::from_ref_time(27_747).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) - fn remove_announcement(a: u32, p: u32) -> Weight { - Weight::from_ref_time(48_284_000) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(166_000).saturating_mul(a.into())) - // Standard Error: 18_000 - .saturating_add(Weight::from_ref_time(69_000).saturating_mul(p.into())) + fn remove_announcement(a: u32, _p: u32) -> Weight { + Weight::from_ref_time(21_154_842) + // Standard Error: 2_354 + .saturating_add(Weight::from_ref_time(67_662).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_announcement(a: u32, _p: u32) -> Weight { - Weight::from_ref_time(52_265_000) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(84_000).saturating_mul(a.into())) + Weight::from_ref_time(20_587_474) + // Standard Error: 2_191 + .saturating_add(Weight::from_ref_time(91_044).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -92,52 +90,52 @@ impl pallet_proxy::weights::WeightInfo for WeightInfo Weight { - Weight::from_ref_time(64_000_000) - // Standard Error: 26_000 - .saturating_add(Weight::from_ref_time(117_000).saturating_mul(a.into())) - // Standard Error: 26_000 - .saturating_add(Weight::from_ref_time(91_000).saturating_mul(p.into())) + Weight::from_ref_time(25_960_647) + // Standard Error: 3_453 + .saturating_add(Weight::from_ref_time(90_065).saturating_mul(a.into())) + // Standard Error: 3_567 + .saturating_add(Weight::from_ref_time(54_574).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32) -> Weight { - Weight::from_ref_time(48_885_000) - // Standard Error: 76_000 - .saturating_add(Weight::from_ref_time(439_000).saturating_mul(p.into())) + Weight::from_ref_time(21_515_673) + // Standard Error: 9_730 + .saturating_add(Weight::from_ref_time(27_609).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32) -> Weight { - Weight::from_ref_time(52_080_000) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(146_000).saturating_mul(p.into())) + Weight::from_ref_time(20_632_234) + // Standard Error: 2_374 + .saturating_add(Weight::from_ref_time(68_381).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32) -> Weight { - Weight::from_ref_time(46_847_000) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(19_000).saturating_mul(p.into())) + Weight::from_ref_time(17_793_375) + // Standard Error: 1_672 + .saturating_add(Weight::from_ref_time(42_726).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) - fn anonymous(p: u32) -> Weight { - Weight::from_ref_time(55_708_000) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(50_000).saturating_mul(p.into())) + fn create_pure(p: u32) -> Weight { + Weight::from_ref_time(22_473_896) + // Standard Error: 1_953 + .saturating_add(Weight::from_ref_time(15_155).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) - fn kill_anonymous(p: u32) -> Weight { - Weight::from_ref_time(46_563_000) - // Standard Error: 30_000 - .saturating_add(Weight::from_ref_time(250_000).saturating_mul(p.into())) + fn kill_pure(p: u32) -> Weight { + Weight::from_ref_time(18_850_050) + // Standard Error: 1_796 + .saturating_add(Weight::from_ref_time(42_672).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index 81509db9a..5af128495 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,149 +49,77 @@ use frame_support::{ /// Weight functions for pallet_scheduler (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_scheduler::weights::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_periodic_named_resolved(s: u32) -> Weight { - Weight::from_ref_time(77_951_000) - // Standard Error: 354_000 - .saturating_add(Weight::from_ref_time(33_430_000).saturating_mul(s.into())) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(3_351_000) .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(s.into()))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named_resolved(s: u32) -> Weight { - Weight::from_ref_time(30_364_000) - // Standard Error: 290_000 - .saturating_add(Weight::from_ref_time(28_276_000).saturating_mul(s.into())) + fn service_agenda_base(s: u32) -> Weight { + Weight::from_ref_time(5_402_281) + // Standard Error: 2_213 + .saturating_add(Weight::from_ref_time(239_796).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(s.into()))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - fn on_initialize_periodic_resolved(s: u32) -> Weight { - Weight::from_ref_time(15_153_000) - // Standard Error: 630_000 - .saturating_add(Weight::from_ref_time(30_716_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(s.into()))) + fn service_task_base() -> Weight { + Weight::from_ref_time(6_133_000) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - fn on_initialize_resolved(s: u32) -> Weight { - Weight::from_ref_time(29_624_000) - // Standard Error: 210_000 - .saturating_add(Weight::from_ref_time(26_634_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(s.into()))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named_aborted(s: u32) -> Weight { - Weight::from_ref_time(18_753_000) - // Standard Error: 74_000 - .saturating_add(Weight::from_ref_time(10_211_000).saturating_mul(s.into())) + fn service_task_fetched(s: u32) -> Weight { + Weight::from_ref_time(15_508_000) + // Standard Error: 6 + .saturating_add(Weight::from_ref_time(902).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - fn on_initialize_aborted(s: u32) -> Weight { - Weight::from_ref_time(12_642_000) - // Standard Error: 91_000 - .saturating_add(Weight::from_ref_time(5_181_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_periodic_named(s: u32) -> Weight { - Weight::from_ref_time(57_881_000) - // Standard Error: 117_000 - .saturating_add(Weight::from_ref_time(16_508_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(s.into()))) + fn service_task_named() -> Weight { + Weight::from_ref_time(7_623_000).saturating_add(T::DbWeight::get().writes(1)) } - // Storage: Scheduler Agenda (r:2 w:2) - fn on_initialize_periodic(s: u32) -> Weight { - Weight::from_ref_time(32_402_000) - // Standard Error: 103_000 - .saturating_add(Weight::from_ref_time(13_081_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(6_381_000) } - // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - fn on_initialize_named(s: u32) -> Weight { - Weight::from_ref_time(39_741_000) - // Standard Error: 73_000 - .saturating_add(Weight::from_ref_time(11_308_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(2_668_000) } - // Storage: Scheduler Agenda (r:1 w:1) - fn on_initialize(s: u32) -> Weight { - Weight::from_ref_time(34_782_000) - // Standard Error: 61_000 - .saturating_add(Weight::from_ref_time(9_525_000).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(2_690_000) } // Storage: Scheduler Agenda (r:1 w:1) fn schedule(s: u32) -> Weight { - Weight::from_ref_time(42_112_000) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(179_000).saturating_mul(s.into())) + Weight::from_ref_time(14_386_290) + // Standard Error: 8_210 + .saturating_add(Weight::from_ref_time(290_508).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn cancel(s: u32) -> Weight { - Weight::from_ref_time(40_100_000) - // Standard Error: 21_000 - .saturating_add(Weight::from_ref_time(996_000).saturating_mul(s.into())) + Weight::from_ref_time(14_618_067) + // Standard Error: 2_673 + .saturating_add(Weight::from_ref_time(244_365).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32) -> Weight { - Weight::from_ref_time(44_125_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(242_000).saturating_mul(s.into())) + Weight::from_ref_time(17_125_968) + // Standard Error: 3_579 + .saturating_add(Weight::from_ref_time(283_692).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32) -> Weight { - Weight::from_ref_time(42_315_000) - // Standard Error: 44_000 - .saturating_add(Weight::from_ref_time(1_239_000).saturating_mul(s.into())) + Weight::from_ref_time(16_091_884) + // Standard Error: 2_674 + .saturating_add(Weight::from_ref_time(274_337).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index c93a29aa3..02f45199b 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,11 +52,11 @@ impl pallet_timestamp::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:1) // Storage: Aura CurrentSlot (r:1 w:0) fn set() -> Weight { - Weight::from_ref_time(27_600_000) + Weight::from_ref_time(8_108_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn on_finalize() -> Weight { - Weight::from_ref_time(10_360_000) + Weight::from_ref_time(3_570_000) } } diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index 22d82ca1f..7a7fe4d36 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_treasury //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,33 +50,33 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_treasury::weights::WeightInfo for WeightInfo { fn spend() -> Weight { - Weight::from_ref_time(280_000) + Weight::from_ref_time(95_000) } // Storage: Treasury ProposalCount (r:1 w:1) // Storage: Treasury Proposals (r:0 w:1) fn propose_spend() -> Weight { - Weight::from_ref_time(60_380_000) + Weight::from_ref_time(20_565_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Treasury Proposals (r:1 w:1) fn reject_proposal() -> Weight { - Weight::from_ref_time(72_761_000) + Weight::from_ref_time(24_762_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Proposals (r:1 w:0) // Storage: Treasury Approvals (r:1 w:1) fn approve_proposal(p: u32) -> Weight { - Weight::from_ref_time(27_423_000) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(174_000).saturating_mul(p.into())) + Weight::from_ref_time(10_471_736) + // Standard Error: 1_016 + .saturating_add(Weight::from_ref_time(105_175).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Approvals (r:1 w:1) fn remove_approval() -> Weight { - Weight::from_ref_time(19_090_000) + Weight::from_ref_time(6_422_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,9 +85,9 @@ impl pallet_treasury::weights::WeightInfo for WeightInf // Storage: Bounties BountyApprovals (r:1 w:1) // Storage: Treasury Proposals (r:2 w:2) fn on_initialize_proposals(p: u32) -> Weight { - Weight::from_ref_time(43_929_000) - // Standard Error: 358_000 - .saturating_add(Weight::from_ref_time(45_522_000).saturating_mul(p.into())) + Weight::from_ref_time(38_410_434) + // Standard Error: 20_814 + .saturating_add(Weight::from_ref_time(18_295_935).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index fe36785fd..ea56ed59f 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,24 +50,24 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_utility::weights::WeightInfo for WeightInfo { fn batch(c: u32) -> Weight { - Weight::from_ref_time(73_233_000) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(6_159_000).saturating_mul(c.into())) + Weight::from_ref_time(31_466_915) + // Standard Error: 2_630 + .saturating_add(Weight::from_ref_time(2_383_207).saturating_mul(c.into())) } fn as_derivative() -> Weight { - Weight::from_ref_time(10_870_000) + Weight::from_ref_time(4_073_000) } fn batch_all(c: u32) -> Weight { - Weight::from_ref_time(44_965_000) - // Standard Error: 48_000 - .saturating_add(Weight::from_ref_time(6_460_000).saturating_mul(c.into())) + Weight::from_ref_time(33_997_301) + // Standard Error: 3_559 + .saturating_add(Weight::from_ref_time(2_433_000).saturating_mul(c.into())) } fn dispatch_as() -> Weight { - Weight::from_ref_time(23_170_000) + Weight::from_ref_time(9_493_000) } fn force_batch(c: u32) -> Weight { - Weight::from_ref_time(35_547_000) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(6_274_000).saturating_mul(c.into())) + Weight::from_ref_time(25_346_023) + // Standard Error: 3_911 + .saturating_add(Weight::from_ref_time(2_393_869).saturating_mul(c.into())) } } diff --git a/runtime/common/src/weights/pallet_vesting.rs b/runtime/common/src/weights/pallet_vesting.rs index 09a8a1a66..8f70164d4 100644 --- a/runtime/common/src/weights/pallet_vesting.rs +++ b/runtime/common/src/weights/pallet_vesting.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,19 +51,21 @@ pub struct WeightInfo(PhantomData); impl pallet_vesting::weights::WeightInfo for WeightInfo { // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vest_locked(_l: u32, _s: u32) -> Weight { - Weight::from_ref_time(74_193_000) + fn vest_locked(l: u32, s: u32) -> Weight { + Weight::from_ref_time(28_454_811) + // Standard Error: 2_342 + .saturating_add(Weight::from_ref_time(30_427).saturating_mul(l.into())) + // Standard Error: 4_167 + .saturating_add(Weight::from_ref_time(10_709).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vest_unlocked(l: u32, s: u32) -> Weight { - Weight::from_ref_time(59_403_000) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(142_000).saturating_mul(l.into())) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(76_000).saturating_mul(s.into())) + fn vest_unlocked(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(28_053_460) + // Standard Error: 2_049 + .saturating_add(Weight::from_ref_time(24_548).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -71,9 +73,9 @@ impl pallet_vesting::weights::WeightInfo for WeightInfo // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn vest_other_locked(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(69_282_000) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(33_000).saturating_mul(l.into())) + Weight::from_ref_time(28_646_528) + // Standard Error: 2_267 + .saturating_add(Weight::from_ref_time(14_776).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -81,51 +83,51 @@ impl pallet_vesting::weights::WeightInfo for WeightInfo // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn vest_other_unlocked(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(64_138_000) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(101_000).saturating_mul(l.into())) + Weight::from_ref_time(29_263_562) + // Standard Error: 2_411 + .saturating_add(Weight::from_ref_time(2_655).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vested_transfer(l: u32, s: u32) -> Weight { - Weight::from_ref_time(89_063_000) - // Standard Error: 24_000 - .saturating_add(Weight::from_ref_time(74_000).saturating_mul(l.into())) - // Standard Error: 43_000 - .saturating_add(Weight::from_ref_time(240_000).saturating_mul(s.into())) + fn vested_transfer(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(40_625_249) + // Standard Error: 2_877 + .saturating_add(Weight::from_ref_time(30_587).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:1 w:1) - fn force_vested_transfer(_l: u32, s: u32) -> Weight { - Weight::from_ref_time(95_489_000) - // Standard Error: 61_000 - .saturating_add(Weight::from_ref_time(44_000).saturating_mul(s.into())) + fn force_vested_transfer(l: u32, s: u32) -> Weight { + Weight::from_ref_time(38_574_791) + // Standard Error: 6_754 + .saturating_add(Weight::from_ref_time(40_472).saturating_mul(l.into())) + // Standard Error: 12_017 + .saturating_add(Weight::from_ref_time(33_756).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn not_unlocking_merge_schedules(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(67_438_000) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(158_000).saturating_mul(l.into())) + Weight::from_ref_time(28_978_945) + // Standard Error: 1_850 + .saturating_add(Weight::from_ref_time(38_600).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn unlocking_merge_schedules(l: u32, s: u32) -> Weight { - Weight::from_ref_time(67_798_000) - // Standard Error: 22_000 - .saturating_add(Weight::from_ref_time(48_000).saturating_mul(l.into())) - // Standard Error: 41_000 - .saturating_add(Weight::from_ref_time(115_000).saturating_mul(s.into())) + Weight::from_ref_time(29_199_036) + // Standard Error: 2_331 + .saturating_add(Weight::from_ref_time(15_809).saturating_mul(l.into())) + // Standard Error: 4_306 + .saturating_add(Weight::from_ref_time(16_241).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index 931420377..417df6562 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -1,84 +1,86 @@ [build-dependencies] -substrate-wasm-builder = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +substrate-wasm-builder = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } [dependencies] -frame-executive = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-bounties = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-collective = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-democracy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-identity = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-membership = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-multisig = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-preimage = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-proxy = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-scheduler = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-transaction-payment-rpc-runtime-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-vesting = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-executive = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system-rpc-runtime-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-currencies = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-tokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } +pallet-balances = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-bounties = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-collective = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-democracy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-identity = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-membership = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-multisig = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-preimage = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-proxy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-randomness-collective-flip = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-scheduler = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-transaction-payment-rpc-runtime-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-treasury = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-utility = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-vesting = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } +polkadot-primitives = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-block-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-inherents = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-offchain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-session = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-transaction-pool = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-version = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-block-builder = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-core = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-inherents = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-offchain = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-session = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-std = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-transaction-pool = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-version = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" } # Try-Runtime -frame-try-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } +frame-try-runtime = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } # Benchmark -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } -frame-system-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } +frame-system-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } # Cumulus -cumulus-pallet-dmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-pallet-parachain-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-pallet-xcmp-queue = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -cumulus-primitives-utility = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } -parachain-info = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/cumulus", optional = true } +cumulus-pallet-dmp-queue = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-parachain-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-xcm = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-pallet-xcmp-queue = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-core = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-timestamp = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +cumulus-primitives-utility = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } +parachain-info = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/cumulus", optional = true } # Parachain -nimbus-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-author-inherent = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-author-mapping = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -pallet-author-slot-filter = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/nimbus", optional = true } -pallet-parachain-staking = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } -session-keys-primitives = { tag = "v0.27.2-a", default-features = false, git = "https://github.com/zeitgeistpm/moonbeam", optional = true } +nimbus-primitives = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-inherent = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-mapping = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-author-slot-filter = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +pallet-parachain-staking = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } +session-keys-primitives = { default-features = false, git = "https://github.com/zeitgeistpm/external", optional = true } # Polkadot -polkadot-parachain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +polkadot-parachain = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } # Standalone -pallet-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -pallet-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-consensus-aura = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-finality-grandpa = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +pallet-aura = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-grandpa = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-consensus-aura = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-finality-grandpa = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } # Utility cfg-if = { version = "1.0.0" } @@ -86,17 +88,16 @@ hex-literal = { default-features = false, optional = true, version = "0.3.4" } log = { version = "0.4.17", default-features = false, optional = true } # XCM -orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-unknown-tokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-xcm-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-xtokens = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -pallet-xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-primitives = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -polkadot-runtime-parachains = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -xcm = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -xcm-builder = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } -xcm-executor = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/polkadot", optional = true } +orml-asset-registry = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-unknown-tokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-xcm-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-xtokens = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +pallet-xcm = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-runtime = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +polkadot-runtime-parachains = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +xcm = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +xcm-builder = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } +xcm-executor = { branch = "release-v0.9.32", default-features = false, git = "https://github.com/paritytech/polkadot", optional = true } # Zeitgeist @@ -115,9 +116,9 @@ zrml-swaps = { default-features = false, path = "../../zrml/swaps" } zrml-swaps-runtime-api = { default-features = false, path = "../../zrml/swaps/runtime-api" } [dev-dependencies] -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } test-case = "2.0.2" -xcm-emulator = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/xcm-simulator" } +xcm-emulator = { rev = "158a6bd2768c679563efa891aa17329635b2764b", git = "https://github.com/shaunxw/xcm-simulator" } [features] default = ["std"] @@ -147,7 +148,6 @@ parachain = [ # XCM "polkadot-runtime", - "polkadot-primitives", "polkadot-runtime-parachains", "orml-asset-registry", "orml-unknown-tokens", @@ -168,7 +168,7 @@ runtime-benchmarks = [ "cumulus-pallet-xcmp-queue?/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "hex-literal", "polkadot-runtime?/runtime-benchmarks", @@ -237,6 +237,7 @@ std = [ "pallet-utility/std", "pallet-vesting/std", "parity-scale-codec/std", + "polkadot-primitives/std", "scale-info/std", "sp-api/std", "sp-block-builder/std", @@ -280,7 +281,6 @@ std = [ # XCM "polkadot-runtime?/std", - "polkadot-primitives?/std", "polkadot-runtime-parachains?/std", "orml-asset-registry?/std", "orml-unknown-tokens?/std", diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index d92c9430f..8cceae716 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -18,7 +18,8 @@ use crate::{ xcm_config::config::{general_key, zeitgeist}, - AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Origin, Runtime, System, + AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Runtime, RuntimeOrigin, + System, }; use frame_support::{assert_ok, traits::GenesisBuild}; use orml_traits::asset_registry::AssetMetadata; @@ -133,7 +134,7 @@ pub(super) fn register_foreign_ztg(additional_meta: Option) { additional: additional_meta.unwrap_or_default(), }; - assert_ok!(AssetRegistry::register_asset(Origin::root(), meta, Some(FOREIGN_ZTG_ID))); + assert_ok!(AssetRegistry::register_asset(RuntimeOrigin::root(), meta, Some(FOREIGN_ZTG_ID))); } pub(super) fn register_foreign_sibling(additional_meta: Option) { @@ -147,7 +148,11 @@ pub(super) fn register_foreign_sibling(additional_meta: Option) additional: additional_meta.unwrap_or_default(), }; - assert_ok!(AssetRegistry::register_asset(Origin::root(), meta, Some(FOREIGN_SIBLING_ID))); + assert_ok!(AssetRegistry::register_asset( + RuntimeOrigin::root(), + meta, + Some(FOREIGN_SIBLING_ID) + )); } pub(super) fn register_foreign_parent(additional_meta: Option) { @@ -161,7 +166,7 @@ pub(super) fn register_foreign_parent(additional_meta: Option) { additional: additional_meta.unwrap_or_default(), }; - assert_ok!(AssetRegistry::register_asset(Origin::root(), meta, Some(FOREIGN_PARENT_ID))); + assert_ok!(AssetRegistry::register_asset(RuntimeOrigin::root(), meta, Some(FOREIGN_PARENT_ID))); } #[inline] diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index 0b90d1f9e..5a62e099b 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -18,7 +18,7 @@ use crate::{ parameters::ZeitgeistTreasuryAccount, xcm_config::config::zeitgeist, AccountId, CurrencyId, - DmpQueue, Origin, Runtime, XcmpQueue, + DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, }; use frame_support::{traits::GenesisBuild, weights::Weight}; use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; @@ -38,7 +38,7 @@ decl_test_relay_chain! { decl_test_parachain! { pub struct Zeitgeist { Runtime = Runtime, - Origin = Origin, + RuntimeOrigin = RuntimeOrigin, XcmpMessageHandler = XcmpQueue, DmpMessageHandler = DmpQueue, new_ext = para_ext(zeitgeist::ID), @@ -48,7 +48,7 @@ decl_test_parachain! { decl_test_parachain! { pub struct Sibling { Runtime = Runtime, - Origin = Origin, + RuntimeOrigin = RuntimeOrigin, XcmpMessageHandler = XcmpQueue, DmpMessageHandler = DmpQueue, new_ext = para_ext(PARA_ID_SIBLING), diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index f95da672f..316fb19d1 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -26,7 +26,7 @@ use crate::{ test_net::{PolkadotNet, Sibling, TestNet, Zeitgeist}, }, xcm_config::{config::zeitgeist, fees::default_per_second}, - AssetRegistry, Balance, Balances, CurrencyId, Origin, Tokens, XTokens, + AssetRegistry, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; @@ -58,7 +58,7 @@ fn transfer_ztg_to_sibling() { assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - Origin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE.into()), CurrencyId::Ztg, transfer_amount, Box::new( @@ -71,7 +71,7 @@ fn transfer_ztg_to_sibling() { ) .into() ), - 4_000_000_000, + xcm_emulator::Limited(4_000_000_000), )); // Confirm that Alice's balance is initial_balance - amount_transferred @@ -128,7 +128,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { assert_eq!(Balances::free_balance(&zeitgeist_parachain_account()), 0); assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), bob_initial_balance); assert_ok!(XTokens::transfer( - Origin::signed(BOB.into()), + RuntimeOrigin::signed(BOB.into()), FOREIGN_ZTG_ID, transfer_amount, Box::new( @@ -141,7 +141,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { ) .into() ), - 4_000_000_000, + xcm_emulator::Limited(4_000_000_000), )); // Confirm that Bobs's balance is initial balance - amount transferred @@ -187,7 +187,7 @@ fn transfer_dot_from_relay_chain() { assert!(initial_balance >= transfer_amount); assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets( - polkadot_runtime::Origin::signed(ALICE.into()), + polkadot_runtime::RuntimeOrigin::signed(ALICE.into()), Box::new(Parachain(zeitgeist::ID).into().into()), Box::new(Junction::AccountId32 { network: NetworkId::Any, id: BOB }.into().into()), Box::new((Here, transfer_amount).into()), @@ -215,7 +215,7 @@ fn transfer_dot_to_relay_chain() { assert!(initial_balance >= transfer_amount); assert_ok!(XTokens::transfer( - Origin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE.into()), FOREIGN_PARENT_ID, transfer_amount, Box::new( @@ -225,7 +225,7 @@ fn transfer_dot_to_relay_chain() { ) .into() ), - 4_000_000_000 + xcm_emulator::Limited(4_000_000_000) )); assert_eq!( @@ -235,7 +235,7 @@ fn transfer_dot_to_relay_chain() { }); PolkadotNet::execute_with(|| { - assert_eq!(polkadot_runtime::Balances::free_balance(&BOB.into()), 19_530_582_548); + assert_eq!(polkadot_runtime::Balances::free_balance(&BOB.into()), 19_573_469_824); }); } @@ -274,7 +274,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - Origin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE.into()), CurrencyId::Ztg, transfer_amount, Box::new( @@ -287,7 +287,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { ) .into() ), - 4_000_000_000, + xcm_emulator::Limited(4_000_000_000), )); // Confirm that Alice's balance is initial_balance - amount_transferred diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 71477fd01..4b3c6a8cc 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -102,8 +102,8 @@ pub struct IsCallable; // Currently disables Court, Rikiddo and creation of markets using Court or SimpleDisputes // dispute mechanism. -impl Contains for IsCallable { - fn contains(call: &Call) -> bool { +impl Contains for IsCallable { + fn contains(call: &RuntimeCall) -> bool { #[cfg(feature = "parachain")] use cumulus_pallet_dmp_queue::Call::service_overweight; use frame_system::Call::{ @@ -125,10 +125,10 @@ impl Contains for IsCallable { #[allow(clippy::match_like_matches_macro)] match call { // Membership is managed by the respective Membership instance - Call::AdvisoryCommittee(set_members { .. }) => false, + RuntimeCall::AdvisoryCommittee(set_members { .. }) => false, // See "balance.set_balance" - Call::AssetManager(update_balance { .. }) => false, - Call::Balances(inner_call) => { + RuntimeCall::AssetManager(update_balance { .. }) => false, + RuntimeCall::Balances(inner_call) => { match inner_call { // Balances should not be set. All newly generated tokens be minted by well // known and approved processes, like staking. However, this could be used @@ -143,12 +143,12 @@ impl Contains for IsCallable { } } // Membership is managed by the respective Membership instance - Call::Council(set_members { .. }) => false, - Call::Court(_) => false, + RuntimeCall::Council(set_members { .. }) => false, + RuntimeCall::Court(_) => false, #[cfg(feature = "parachain")] - Call::DmpQueue(service_overweight { .. }) => false, - Call::LiquidityMining(_) => false, - Call::PredictionMarkets(inner_call) => { + RuntimeCall::DmpQueue(service_overweight { .. }) => false, + RuntimeCall::LiquidityMining(_) => false, + RuntimeCall::PredictionMarkets(inner_call) => { match inner_call { // Disable Rikiddo markets create_market { scoring_rule: RikiddoSigmoidFeeMarketEma, .. } => false, @@ -163,7 +163,7 @@ impl Contains for IsCallable { _ => true, } } - Call::System(inner_call) => { + RuntimeCall::System(inner_call) => { match inner_call { // Some "waste" storage will never impact proper operation. // Cleaning up storage should be done by pallets or independent migrations. @@ -184,9 +184,9 @@ impl Contains for IsCallable { } } // Membership is managed by the respective Membership instance - Call::TechnicalCommittee(set_members { .. }) => false, + RuntimeCall::TechnicalCommittee(set_members { .. }) => false, // There should be no reason to force vested transfer. - Call::Vesting(force_vested_transfer { .. }) => false, + RuntimeCall::Vesting(force_vested_transfer { .. }) => false, _ => true, } } diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index c2a81c52c..ba42d6728 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -23,7 +23,7 @@ )] #![cfg(feature = "parachain")] -use super::{parameters::MAXIMUM_BLOCK_WEIGHT, Origin, ParachainInfo}; +use super::{parameters::MAXIMUM_BLOCK_WEIGHT, ParachainInfo, RuntimeOrigin}; use frame_support::{parameter_types, weights::Weight}; use orml_traits::parameter_type_with_key; use sp_runtime::{Perbill, Percent}; @@ -44,7 +44,7 @@ parameter_types! { pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UnitWeightCost: u64 = 200_000_000; // Staking diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index e0ebcbd56..56c8e5b27 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -24,10 +24,12 @@ use super::VERSION; use frame_support::{ + dispatch::DispatchClass, parameter_types, + traits::WithdrawReasons, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_PER_SECOND}, - DispatchClass, Weight, + Weight, }, PalletId, }; @@ -46,7 +48,8 @@ use frame_support::traits::LockIdentifier; pub(crate) const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 2); + Weight::from_ref_time(WEIGHT_PER_SECOND.ref_time() / 2) + .set_proof_size(polkadot_primitives::v2::MAX_POV_SIZE as u64); pub(crate) const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub(crate) const FEES_AND_TIPS_TREASURY_PERCENTAGE: u32 = 100; pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; @@ -349,6 +352,8 @@ parameter_types! { // Vesting pub const MinVestedTransfer: Balance = ExistentialDeposit::get(); + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } #[cfg(feature = "with-global-disputes")] diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index c8312fda6..888b97a3c 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -17,9 +17,9 @@ use super::fees::{native_per_second, FixedConversionRateProvider}; use crate::{ - AccountId, Ancestry, AssetManager, AssetRegistry, Balance, Call, CurrencyId, MaxInstructions, - Origin, ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, - UnitWeightCost, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, + AccountId, Ancestry, AssetManager, AssetRegistry, Balance, CurrencyId, MaxInstructions, + ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, RuntimeCall, + RuntimeOrigin, UnitWeightCost, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, }; use frame_support::{parameter_types, traits::Everything, WeakBoundedVec}; @@ -70,8 +70,7 @@ impl Config for XcmConfig { /// Additional filters that specify whether the XCM instruction should be executed at all. type Barrier = Barrier; /// The outer call dispatch type. - type Call = Call; - type CallDispatcher = Call; + type RuntimeCall = RuntimeCall; /// Combinations of (Location, Asset) pairs which are trusted as reserves. // Trust the parent chain, sibling parachains and children chains of this chain. type IsReserve = MultiNativeAsset; @@ -90,7 +89,7 @@ impl Config for XcmConfig { /// The means of determining an XCM message's weight. // Adds UnitWeightCost per instruction plus the weight of each instruction. // The total number of instructions are bounded by MaxInstructions - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; /// How to send an onward XCM message. type XcmSender = XcmRouter; } @@ -262,7 +261,7 @@ impl Convert for AccountIdToMultiLocation { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM @@ -283,18 +282,18 @@ pub type XcmOriginToTransactDispatchOrigin = ( // Sovereign account converter; this attempts to derive an `AccountId` from the origin location // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); /// The means for routing XCM messages which are not for local execution into the right message diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index 7f2098d5f..95c2850de 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -1,17 +1,17 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index 64619a232..0fb633207 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -121,7 +121,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Event - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The period, in which the authority can correct the outcome of a market. /// This value must not be zero. @@ -141,7 +141,7 @@ mod pallet { >; /// The origin that is allowed to resolved disupute in Authorized dispute mechanism. - type AuthorizedDisputeResolutionOrigin: EnsureOrigin; + type AuthorizedDisputeResolutionOrigin: EnsureOrigin; /// Identifier of this pallet #[pallet::constant] @@ -194,7 +194,7 @@ mod pallet { type BlockNumber = T::BlockNumber; type MarketId = MarketIdOf; type Moment = MomentOf; - type Origin = T::Origin; + type Origin = T::RuntimeOrigin; fn on_dispute( disputes: &[MarketDispute], diff --git a/zrml/authorized/src/mock.rs b/zrml/authorized/src/mock.rs index 53e3a07eb..f34cdc7bc 100644 --- a/zrml/authorized/src/mock.rs +++ b/zrml/authorized/src/mock.rs @@ -133,7 +133,7 @@ impl DisputeResolutionApi for MockResolution { } impl crate::Config for Runtime { - type Event = (); + type RuntimeEvent = (); type CorrectionPeriod = CorrectionPeriod; type DisputeResolution = MockResolution; type MarketCommons = MarketCommons; @@ -155,9 +155,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = (); + type RuntimeEvent = (); type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -166,7 +166,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -178,7 +178,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = (); type MaxLocks = (); type MaxReserves = MaxReserves; diff --git a/zrml/authorized/src/tests.rs b/zrml/authorized/src/tests.rs index f1a0901d1..3682ac5e1 100644 --- a/zrml/authorized/src/tests.rs +++ b/zrml/authorized/src/tests.rs @@ -20,7 +20,7 @@ use crate::{ market_mock, - mock::{Authorized, AuthorizedDisputeResolutionUser, ExtBuilder, Origin, Runtime, BOB}, + mock::{Authorized, AuthorizedDisputeResolutionUser, ExtBuilder, Runtime, RuntimeOrigin, BOB}, mock_storage::pallet as mock_storage, AuthorizedOutcomeReports, Error, }; @@ -36,7 +36,7 @@ fn authorize_market_outcome_inserts_a_new_outcome() { ExtBuilder::default().build().execute_with(|| { Markets::::insert(0, market_mock::()); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1) )); @@ -55,7 +55,7 @@ fn authorize_market_outcome_does_not_reset_dispute_resolution() { Markets::::insert(0, market_mock::()); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1), )); @@ -69,7 +69,7 @@ fn authorize_market_outcome_does_not_reset_dispute_resolution() { assert_eq!(mock_storage::MarketIdsPerDisputeBlock::::get(resolve_at_0), vec![0]); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(2) )); @@ -88,7 +88,7 @@ fn authorize_market_outcome_fails_if_market_does_not_exist() { ExtBuilder::default().build().execute_with(|| { assert_noop!( Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1) ), @@ -105,7 +105,7 @@ fn authorize_market_outcome_fails_on_non_authorized_market() { Markets::::insert(0, market); assert_noop!( Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1) ), @@ -122,7 +122,7 @@ fn authorize_market_outcome_fails_on_undisputed_market() { Markets::::insert(0, market); assert_noop!( Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1) ), @@ -137,7 +137,7 @@ fn authorize_market_outcome_fails_on_invalid_report() { Markets::::insert(0, market_mock::()); assert_noop!( Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Categorical(123) ), @@ -151,7 +151,11 @@ fn authorize_market_outcome_fails_on_unauthorized_account() { ExtBuilder::default().build().execute_with(|| { Markets::::insert(0, market_mock::()); assert_noop!( - Authorized::authorize_market_outcome(Origin::signed(BOB), 0, OutcomeReport::Scalar(1)), + Authorized::authorize_market_outcome( + RuntimeOrigin::signed(BOB), + 0, + OutcomeReport::Scalar(1) + ), DispatchError::BadOrigin, ); }); @@ -183,7 +187,7 @@ fn on_resolution_removes_stored_outcomes() { let market = market_mock::(); Markets::::insert(0, &market); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(2) )); @@ -199,12 +203,12 @@ fn on_resolution_returns_the_reported_outcome() { Markets::::insert(0, &market); // Authorize outcome, then overwrite it. assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1) )); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(2) )); @@ -221,12 +225,12 @@ fn authorized_market_outcome_can_handle_multiple_markets() { Markets::::insert(0, market_mock::()); Markets::::insert(1, market_mock::()); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(123) )); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 1, OutcomeReport::Scalar(456) )); @@ -250,7 +254,7 @@ fn get_auto_resolve_works() { let market = market_mock::(); Markets::::insert(0, &market); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Scalar(1) )); diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index 685066985..51e818f23 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_authorized //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -57,16 +57,16 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn authorize_market_outcome_first_report(m: u32) -> Weight { - Weight::from_ref_time(38_444_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(173_000).saturating_mul(m.into())) + Weight::from_ref_time(15_718_181) + // Standard Error: 220 + .saturating_add(Weight::from_ref_time(93_904).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) fn authorize_market_outcome_existing_report() -> Weight { - Weight::from_ref_time(30_850_000) + Weight::from_ref_time(11_771_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index 096c6da68..4ff800939 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -1,20 +1,20 @@ [dependencies] arrayvec = { default-features = false, version = "0.7" } -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } rand = { default-features = false, features = ["alloc", "std_rng"], version = "0.8" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-randomness-collective-flip = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index cc258e378..70083ce65 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -161,7 +161,7 @@ mod pallet { >; /// Event - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Market commons type MarketCommons: MarketCommonsPalletApi< @@ -509,7 +509,7 @@ mod pallet { type BlockNumber = T::BlockNumber; type MarketId = MarketIdOf; type Moment = MomentOf; - type Origin = T::Origin; + type Origin = T::RuntimeOrigin; fn on_dispute( disputes: &[MarketDispute], diff --git a/zrml/court/src/mock.rs b/zrml/court/src/mock.rs index 8152b44b7..9167f6dc3 100644 --- a/zrml/court/src/mock.rs +++ b/zrml/court/src/mock.rs @@ -116,7 +116,7 @@ impl DisputeResolutionApi for NoopResolution { impl crate::Config for Runtime { type CourtCaseDuration = CourtCaseDuration; type DisputeResolution = NoopResolution; - type Event = (); + type RuntimeEvent = (); type MarketCommons = MarketCommons; type PalletId = CourtPalletId; type Random = RandomnessCollectiveFlip; @@ -133,9 +133,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = (); + type RuntimeEvent = (); type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -144,7 +144,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -156,7 +156,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = (); type MaxLocks = (); type MaxReserves = MaxReserves; diff --git a/zrml/court/src/tests.rs b/zrml/court/src/tests.rs index 46624e6a5..48fc37a10 100644 --- a/zrml/court/src/tests.rs +++ b/zrml/court/src/tests.rs @@ -20,8 +20,8 @@ use crate::{ mock::{ - Balances, Court, ExtBuilder, Origin, RandomnessCollectiveFlip, Runtime, System, ALICE, BOB, - CHARLIE, INITIAL_BALANCE, + Balances, Court, ExtBuilder, RandomnessCollectiveFlip, Runtime, RuntimeOrigin, System, + ALICE, BOB, CHARLIE, INITIAL_BALANCE, }, Error, Juror, JurorStatus, Jurors, MarketOf, RequestedJurors, Votes, }; @@ -68,11 +68,11 @@ const DEFAULT_SET_OF_JURORS: &[(u128, Juror)] = &[ #[test] fn exit_court_successfully_removes_a_juror_and_frees_balances() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Court::join_court(Origin::signed(ALICE))); + assert_ok!(Court::join_court(RuntimeOrigin::signed(ALICE))); assert_eq!(Jurors::::iter().count(), 1); assert_eq!(Balances::free_balance(ALICE), 998 * BASE); assert_eq!(Balances::reserved_balance_named(&Court::reserve_id(), &ALICE), 2 * BASE); - assert_ok!(Court::exit_court(Origin::signed(ALICE))); + assert_ok!(Court::exit_court(RuntimeOrigin::signed(ALICE))); assert_eq!(Jurors::::iter().count(), 0); assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE); assert_eq!(Balances::reserved_balance_named(&Court::reserve_id(), &ALICE), 0); @@ -83,7 +83,7 @@ fn exit_court_successfully_removes_a_juror_and_frees_balances() { fn exit_court_will_not_remove_an_unknown_juror() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - Court::exit_court(Origin::signed(ALICE)), + Court::exit_court(RuntimeOrigin::signed(ALICE)), Error::::JurorDoesNotExists ); }); @@ -93,12 +93,12 @@ fn exit_court_will_not_remove_an_unknown_juror() { fn join_court_reserves_balance_according_to_the_number_of_jurors() { ExtBuilder::default().build().execute_with(|| { assert_eq!(Balances::free_balance(ALICE), 1000 * BASE); - assert_ok!(Court::join_court(Origin::signed(ALICE))); + assert_ok!(Court::join_court(RuntimeOrigin::signed(ALICE))); assert_eq!(Balances::free_balance(ALICE), 998 * BASE); assert_eq!(Balances::reserved_balance_named(&Court::reserve_id(), &ALICE), 2 * BASE); assert_eq!(Balances::free_balance(BOB), 1000 * BASE); - assert_ok!(Court::join_court(Origin::signed(BOB))); + assert_ok!(Court::join_court(RuntimeOrigin::signed(BOB))); assert_eq!(Balances::free_balance(BOB), 996 * BASE); assert_eq!(Balances::reserved_balance_named(&Court::reserve_id(), &BOB), 4 * BASE); }); @@ -107,7 +107,7 @@ fn join_court_reserves_balance_according_to_the_number_of_jurors() { #[test] fn join_court_successfully_stores_a_juror() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Court::join_court(Origin::signed(ALICE))); + assert_ok!(Court::join_court(RuntimeOrigin::signed(ALICE))); assert_eq!( Jurors::::iter().next().unwrap(), (ALICE, Juror { status: JurorStatus::Ok }) @@ -118,9 +118,9 @@ fn join_court_successfully_stores_a_juror() { #[test] fn join_court_will_not_insert_an_already_stored_juror() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Court::join_court(Origin::signed(ALICE))); + assert_ok!(Court::join_court(RuntimeOrigin::signed(ALICE))); assert_noop!( - Court::join_court(Origin::signed(ALICE)), + Court::join_court(RuntimeOrigin::signed(ALICE)), Error::::JurorAlreadyExists ); }); @@ -154,11 +154,11 @@ fn on_resolution_denies_non_court_markets() { fn on_dispute_stores_jurors_that_should_vote() { ExtBuilder::default().build().execute_with(|| { setup_blocks(123); - let _ = Court::join_court(Origin::signed(ALICE)); - let _ = Court::join_court(Origin::signed(BOB)); + let _ = Court::join_court(RuntimeOrigin::signed(ALICE)); + let _ = Court::join_court(RuntimeOrigin::signed(BOB)); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); assert_noop!( - Court::join_court(Origin::signed(ALICE)), + Court::join_court(RuntimeOrigin::signed(ALICE)), Error::::JurorAlreadyExists ); assert_eq!(RequestedJurors::::iter().count(), 2); @@ -170,13 +170,13 @@ fn on_dispute_stores_jurors_that_should_vote() { fn on_resolution_awards_winners_and_slashes_losers() { ExtBuilder::default().build().execute_with(|| { setup_blocks(2); - Court::join_court(Origin::signed(ALICE)).unwrap(); - Court::join_court(Origin::signed(BOB)).unwrap(); - Court::join_court(Origin::signed(CHARLIE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(ALICE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(BOB)).unwrap(); + Court::join_court(RuntimeOrigin::signed(CHARLIE)).unwrap(); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(BOB), 0, OutcomeReport::Scalar(2)).unwrap(); - Court::vote(Origin::signed(CHARLIE), 0, OutcomeReport::Scalar(3)).unwrap(); + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Scalar(2)).unwrap(); + Court::vote(RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Scalar(3)).unwrap(); let _ = Court::on_resolution(&[], &0, &DEFAULT_MARKET).unwrap(); assert_eq!(Balances::free_balance(ALICE), 998 * BASE + 3 * BASE); assert_eq!(Balances::reserved_balance_named(&Court::reserve_id(), &ALICE), 2 * BASE); @@ -191,13 +191,13 @@ fn on_resolution_awards_winners_and_slashes_losers() { fn on_resolution_decides_market_outcome_based_on_the_majority() { ExtBuilder::default().build().execute_with(|| { setup_blocks(2); - Court::join_court(Origin::signed(ALICE)).unwrap(); - Court::join_court(Origin::signed(BOB)).unwrap(); - Court::join_court(Origin::signed(CHARLIE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(ALICE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(BOB)).unwrap(); + Court::join_court(RuntimeOrigin::signed(CHARLIE)).unwrap(); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(BOB), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(CHARLIE), 0, OutcomeReport::Scalar(2)).unwrap(); + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Scalar(2)).unwrap(); let outcome = Court::on_resolution(&[], &0, &DEFAULT_MARKET).unwrap(); assert_eq!(outcome, Some(OutcomeReport::Scalar(1))); }); @@ -207,9 +207,9 @@ fn on_resolution_decides_market_outcome_based_on_the_majority() { fn on_resolution_sets_late_jurors_as_tardy() { ExtBuilder::default().build().execute_with(|| { setup_blocks(2); - Court::join_court(Origin::signed(ALICE)).unwrap(); - Court::join_court(Origin::signed(BOB)).unwrap(); - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::join_court(RuntimeOrigin::signed(ALICE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(BOB)).unwrap(); + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); let _ = Court::on_resolution(&[], &0, &DEFAULT_MARKET).unwrap(); assert_eq!(Jurors::::get(ALICE).unwrap().status, JurorStatus::Ok); @@ -221,13 +221,13 @@ fn on_resolution_sets_late_jurors_as_tardy() { fn on_resolution_sets_jurors_that_voted_on_the_second_most_voted_outcome_as_tardy() { ExtBuilder::default().build().execute_with(|| { setup_blocks(2); - Court::join_court(Origin::signed(ALICE)).unwrap(); - Court::join_court(Origin::signed(BOB)).unwrap(); - Court::join_court(Origin::signed(CHARLIE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(ALICE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(BOB)).unwrap(); + Court::join_court(RuntimeOrigin::signed(CHARLIE)).unwrap(); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(BOB), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(CHARLIE), 0, OutcomeReport::Scalar(2)).unwrap(); + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Scalar(2)).unwrap(); let _ = Court::on_resolution(&[], &0, &DEFAULT_MARKET).unwrap(); assert_eq!(Jurors::::get(CHARLIE).unwrap().status, JurorStatus::Tardy); }); @@ -237,10 +237,10 @@ fn on_resolution_sets_jurors_that_voted_on_the_second_most_voted_outcome_as_tard fn on_resolution_punishes_tardy_jurors_that_failed_to_vote_a_second_time() { ExtBuilder::default().build().execute_with(|| { setup_blocks(2); - Court::join_court(Origin::signed(ALICE)).unwrap(); - Court::join_court(Origin::signed(BOB)).unwrap(); + Court::join_court(RuntimeOrigin::signed(ALICE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(BOB)).unwrap(); Court::set_stored_juror_as_tardy(&BOB).unwrap(); - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); let _ = Court::on_resolution(&[], &0, &DEFAULT_MARKET).unwrap(); let join_court_stake = 40000000000; @@ -255,13 +255,13 @@ fn on_resolution_punishes_tardy_jurors_that_failed_to_vote_a_second_time() { fn on_resolution_removes_requested_jurors_and_votes() { ExtBuilder::default().build().execute_with(|| { setup_blocks(2); - Court::join_court(Origin::signed(ALICE)).unwrap(); - Court::join_court(Origin::signed(BOB)).unwrap(); - Court::join_court(Origin::signed(CHARLIE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(ALICE)).unwrap(); + Court::join_court(RuntimeOrigin::signed(BOB)).unwrap(); + Court::join_court(RuntimeOrigin::signed(CHARLIE)).unwrap(); Court::on_dispute(&[], &0, &DEFAULT_MARKET).unwrap(); - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(BOB), 0, OutcomeReport::Scalar(1)).unwrap(); - Court::vote(Origin::signed(CHARLIE), 0, OutcomeReport::Scalar(2)).unwrap(); + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Scalar(1)).unwrap(); + Court::vote(RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Scalar(2)).unwrap(); let _ = Court::on_resolution(&[], &0, &DEFAULT_MARKET).unwrap(); assert_eq!(RequestedJurors::::iter().count(), 0); assert_eq!(Votes::::iter().count(), 0); @@ -318,7 +318,7 @@ fn random_jurors_returns_a_subset_of_jurors() { fn vote_will_not_accept_unknown_accounts() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(0)), + Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(0)), Error::::OnlyJurorsCanVote ); }); @@ -327,8 +327,8 @@ fn vote_will_not_accept_unknown_accounts() { #[test] fn vote_will_stored_outcome_from_a_juror() { ExtBuilder::default().build().execute_with(|| { - let _ = Court::join_court(Origin::signed(ALICE)); - let _ = Court::vote(Origin::signed(ALICE), 0, OutcomeReport::Scalar(0)); + let _ = Court::join_court(RuntimeOrigin::signed(ALICE)); + let _ = Court::vote(RuntimeOrigin::signed(ALICE), 0, OutcomeReport::Scalar(0)); assert_eq!(Votes::::get(ALICE, 0).unwrap(), (0, OutcomeReport::Scalar(0))); }); } diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index 96b5e68a9..c1344abd2 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_court //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -60,7 +60,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court RequestedJurors (r:1 w:0) // Storage: Court Votes (r:1 w:0) fn exit_court() -> Weight { - Weight::from_ref_time(76_500_000) + Weight::from_ref_time(32_565_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -68,14 +68,14 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court CounterForJurors (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) fn join_court() -> Weight { - Weight::from_ref_time(54_370_000) + Weight::from_ref_time(23_581_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Court Jurors (r:1 w:0) // Storage: Court Votes (r:0 w:1) fn vote() -> Weight { - Weight::from_ref_time(25_540_000) + Weight::from_ref_time(10_028_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/global-disputes/Cargo.toml b/zrml/global-disputes/Cargo.toml index dde21457d..25a78dbba 100644 --- a/zrml/global-disputes/Cargo.toml +++ b/zrml/global-disputes/Cargo.toml @@ -1,11 +1,11 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-std = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-std = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } @@ -14,9 +14,9 @@ num-traits = { version = "0.2.15", default-features = false, optional = true } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } test-case = "2.0.2" diff --git a/zrml/global-disputes/src/benchmarks.rs b/zrml/global-disputes/src/benchmarks.rs index 2c7788b31..ef5d2bec9 100644 --- a/zrml/global-disputes/src/benchmarks.rs +++ b/zrml/global-disputes/src/benchmarks.rs @@ -47,7 +47,7 @@ where T::Currency::deposit_creating(caller, BalanceOf::::max_value() / 2u128.saturated_into()); } -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/zrml/global-disputes/src/lib.rs b/zrml/global-disputes/src/lib.rs index 5d442f72a..8798937ba 100644 --- a/zrml/global-disputes/src/lib.rs +++ b/zrml/global-disputes/src/lib.rs @@ -58,7 +58,7 @@ mod pallet { /// The currency implementation used to lock tokens for voting. type Currency: LockableCurrency; - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The vote lock identifier. #[pallet::constant] diff --git a/zrml/global-disputes/src/mock.rs b/zrml/global-disputes/src/mock.rs index f865ca367..82750e2ed 100644 --- a/zrml/global-disputes/src/mock.rs +++ b/zrml/global-disputes/src/mock.rs @@ -63,7 +63,7 @@ parameter_types! { impl crate::Config for Runtime { type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type GlobalDisputeLockId = GlobalDisputeLockId; type GlobalDisputesPalletId = GlobalDisputesPalletId; type MarketCommons = MarketCommons; @@ -83,9 +83,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -94,7 +94,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -106,7 +106,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = (); type MaxLocks = (); type MaxReserves = MaxReserves; diff --git a/zrml/global-disputes/src/tests.rs b/zrml/global-disputes/src/tests.rs index 4af2596ba..f070a6be2 100644 --- a/zrml/global-disputes/src/tests.rs +++ b/zrml/global-disputes/src/tests.rs @@ -83,7 +83,7 @@ fn add_vote_outcome_works() { let free_balance_reward_account = Balances::free_balance(GlobalDisputes::reward_account(&market_id)); assert_ok!(GlobalDisputes::add_vote_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), )); @@ -112,7 +112,7 @@ fn add_vote_outcome_fails_if_no_global_dispute_present() { let market_id = 0u128; assert_noop!( GlobalDisputes::add_vote_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), ), @@ -131,7 +131,7 @@ fn add_vote_outcome_fails_if_global_dispute_finished() { assert_noop!( GlobalDisputes::add_vote_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), ), @@ -158,7 +158,7 @@ fn add_vote_outcome_fails_if_outcome_already_exists() { ); assert_noop!( GlobalDisputes::add_vote_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), ), @@ -180,7 +180,7 @@ fn add_vote_outcome_fails_if_balance_too_low() { .unwrap(); assert_noop!( GlobalDisputes::add_vote_outcome( - Origin::signed(POOR_PAUL), + RuntimeOrigin::signed(POOR_PAUL), market_id, OutcomeReport::Scalar(20), ), @@ -216,11 +216,11 @@ fn reward_outcome_owner_works_for_multiple_owners() { let free_balance_bob_before = Balances::free_balance(&BOB); let free_balance_charlie_before = Balances::free_balance(&CHARLIE); - assert_ok!(GlobalDisputes::purge_outcomes(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); - assert_ok!(GlobalDisputes::reward_outcome_owner(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(ALICE), market_id,)); System::assert_last_event( Event::::OutcomeOwnersRewarded { @@ -264,9 +264,9 @@ fn reward_outcome_owner_has_dust() { }; >::insert(market_id, winner_info); - assert_ok!(GlobalDisputes::purge_outcomes(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); - assert_ok!(GlobalDisputes::reward_outcome_owner(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(ALICE), market_id,)); // 100 * BASE = 1_000_000_000_000 checked_div 6 = 166_666_666_666 // 166_666_666_666 * 6 = 999_999_999_996 so 4 left @@ -297,13 +297,13 @@ fn reward_outcome_owner_works_for_one_owner() { }; >::insert(market_id, winner_info); - assert_ok!(GlobalDisputes::purge_outcomes(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); let free_balance_alice_before = Balances::free_balance(&ALICE); - assert_ok!(GlobalDisputes::reward_outcome_owner(Origin::signed(ALICE), market_id)); + assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(ALICE), market_id)); System::assert_last_event( Event::::OutcomeOwnersRewarded { market_id, owners: vec![ALICE] }.into(), @@ -332,7 +332,7 @@ fn reward_outcome_owner_works_for_no_reward_funds() { }; >::insert(market_id, winner_info); - assert_ok!(GlobalDisputes::purge_outcomes(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); @@ -344,7 +344,7 @@ fn reward_outcome_owner_works_for_no_reward_funds() { // so no loosers, who provided the VotingOutcomeFee assert!(reward_account_free_balance.is_zero()); - assert_ok!(GlobalDisputes::reward_outcome_owner(Origin::signed(ALICE), market_id)); + assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(ALICE), market_id)); System::assert_last_event( Event::::OutcomeOwnersRewardedWithNoFunds { market_id }.into(), @@ -391,7 +391,7 @@ fn vote_fails_if_amount_below_min_outcome_vote_amount() { assert_noop!( GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(40), MinOutcomeVoteAmount::get() - 1, @@ -422,7 +422,7 @@ fn vote_fails_for_insufficient_funds() { // Paul does not have 50 * BASE assert_noop!( GlobalDisputes::vote_on_outcome( - Origin::signed(POOR_PAUL), + RuntimeOrigin::signed(POOR_PAUL), market_id, OutcomeReport::Scalar(0), 50 * BASE @@ -440,28 +440,28 @@ fn determine_voting_winner_sets_the_last_outcome_for_same_vote_balances_as_the_c setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(0), 42 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Scalar(20), 42 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Scalar(40), 42 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(60), 42 * BASE @@ -485,7 +485,7 @@ fn vote_on_outcome_check_event() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(60), 42 * BASE @@ -537,7 +537,7 @@ fn reserve_before_init_vote_outcome_is_not_allowed_for_voting() { assert_noop!( GlobalDisputes::vote_on_outcome( - Origin::signed(*disputor), + RuntimeOrigin::signed(*disputor), market_id, OutcomeReport::Scalar(0), arbitrary_amount + 1 @@ -546,7 +546,7 @@ fn reserve_before_init_vote_outcome_is_not_allowed_for_voting() { ); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(*disputor), + RuntimeOrigin::signed(*disputor), market_id, OutcomeReport::Scalar(0), arbitrary_amount @@ -573,7 +573,7 @@ fn transfer_fails_with_fully_locked_balance() { let arbitrary_amount = 42 * BASE; assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(*disputor), + RuntimeOrigin::signed(*disputor), market_id, OutcomeReport::Scalar(0), free_balance_disputor_before - arbitrary_amount @@ -586,10 +586,10 @@ fn transfer_fails_with_fully_locked_balance() { ); assert_noop!( - Balances::transfer(Origin::signed(*disputor), BOB, arbitrary_amount + 1), + Balances::transfer(RuntimeOrigin::signed(*disputor), BOB, arbitrary_amount + 1), pallet_balances::Error::::LiquidityRestrictions ); - assert_ok!(Balances::transfer(Origin::signed(*disputor), BOB, arbitrary_amount)); + assert_ok!(Balances::transfer(RuntimeOrigin::signed(*disputor), BOB, arbitrary_amount)); }); } @@ -605,7 +605,7 @@ fn reserve_fails_with_fully_locked_balance() { let arbitrary_amount = 42 * BASE; assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(*disputor), + RuntimeOrigin::signed(*disputor), market_id, OutcomeReport::Scalar(0), free_balance_disputor_before - arbitrary_amount @@ -633,26 +633,26 @@ fn determine_voting_winner_works_four_outcome_votes() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(0), 10 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Scalar(20), 10 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Scalar(40), 11 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(60), 10 * BASE @@ -680,25 +680,25 @@ fn determine_voting_winner_works_three_outcome_votes() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), 30 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Scalar(40), 50 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Scalar(0), 10 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(0), 41 * BASE @@ -724,25 +724,25 @@ fn determine_voting_winner_works_two_outcome_votes() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(60), 10 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Scalar(20), 50 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Scalar(60), 20 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(60), 21 * BASE @@ -768,7 +768,7 @@ fn determine_voting_winner_works_with_accumulated_votes_for_alice() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), BASE @@ -776,7 +776,7 @@ fn determine_voting_winner_works_with_accumulated_votes_for_alice() { check_outcome_sum(&market_id, OutcomeReport::Scalar(20), BASE); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Scalar(0), 10 * BASE @@ -784,7 +784,7 @@ fn determine_voting_winner_works_with_accumulated_votes_for_alice() { check_outcome_sum(&market_id, OutcomeReport::Scalar(0), 10 * BASE); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), 10 * BASE @@ -792,7 +792,7 @@ fn determine_voting_winner_works_with_accumulated_votes_for_alice() { check_outcome_sum(&market_id, OutcomeReport::Scalar(20), 11 * BASE); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(0), 40 * BASE @@ -802,7 +802,7 @@ fn determine_voting_winner_works_with_accumulated_votes_for_alice() { // Now Alice wins again assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(20), 40 * BASE @@ -826,14 +826,14 @@ fn reward_outcome_owner_cleans_outcome_info() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(0), 10 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Scalar(20), 10 * BASE @@ -845,14 +845,14 @@ fn reward_outcome_owner_cleans_outcome_info() { assert!(GlobalDisputes::determine_voting_winner(&market_id).is_some()); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(BOB), BOB)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(BOB), BOB)); - assert_ok!(GlobalDisputes::purge_outcomes(Origin::signed(ALICE), market_id,)); + assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); - assert_ok!(GlobalDisputes::reward_outcome_owner(Origin::signed(BOB), market_id,)); + assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(BOB), market_id,)); assert_eq!(>::iter_prefix(market_id).next(), None); }); @@ -866,7 +866,7 @@ fn unlock_clears_lock_info() { setup_vote_outcomes_with_hundred(&market_id); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(0), 50 * BASE @@ -876,7 +876,7 @@ fn unlock_clears_lock_info() { assert_eq!(>::get(ALICE), vec![(market_id, 50 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); assert_eq!(>::get(ALICE), vec![]); }); @@ -917,7 +917,7 @@ fn vote_fails_if_outcome_does_not_exist() { assert_noop!( GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(42), 50 * BASE @@ -944,25 +944,25 @@ fn locking_works_for_one_market() { assert!(Balances::locks(EVE).is_empty()); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id, OutcomeReport::Scalar(0), 50 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Scalar(20), 40 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Scalar(40), 30 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), market_id, OutcomeReport::Scalar(60), 20 * BASE @@ -982,7 +982,7 @@ fn locking_works_for_one_market() { assert_eq!(>::get(ALICE), vec![(market_id, 50 * BASE)]); assert_eq!(Balances::locks(ALICE), vec![the_lock(50 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); assert_eq!(>::get(ALICE), vec![]); assert!(Balances::locks(ALICE).is_empty()); @@ -993,7 +993,7 @@ fn locking_works_for_one_market() { assert_eq!(>::get(EVE), vec![(market_id, 20 * BASE)]); assert_eq!(Balances::locks(EVE), vec![the_lock(20 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(BOB), BOB)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(BOB), BOB)); assert_eq!(>::get(BOB), vec![]); assert!(Balances::locks(BOB).is_empty()); assert_eq!(>::get(CHARLIE), vec![(market_id, 30 * BASE)]); @@ -1001,13 +1001,13 @@ fn locking_works_for_one_market() { assert_eq!(>::get(EVE), vec![(market_id, 20 * BASE)]); assert_eq!(Balances::locks(EVE), vec![the_lock(20 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(CHARLIE), CHARLIE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(CHARLIE), CHARLIE)); assert_eq!(>::get(CHARLIE), vec![]); assert!(Balances::locks(CHARLIE).is_empty()); assert_eq!(>::get(EVE), vec![(market_id, 20 * BASE)]); assert_eq!(Balances::locks(EVE), vec![the_lock(20 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(EVE), EVE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(EVE), EVE)); assert_eq!(>::get(EVE), vec![]); assert!(Balances::locks(EVE).is_empty()); }); @@ -1028,26 +1028,26 @@ fn locking_works_for_two_markets_with_stronger_first_unlock() { assert!(Balances::locks(BOB).is_empty()); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id_1, OutcomeReport::Scalar(0), 50 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id_1, OutcomeReport::Scalar(20), 40 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id_2, OutcomeReport::Scalar(0), 30 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id_2, OutcomeReport::Scalar(20), 20 * BASE @@ -1072,7 +1072,7 @@ fn locking_works_for_two_markets_with_stronger_first_unlock() { vec![(market_id_1, 50 * BASE), (market_id_2, 30 * BASE)] ); assert_eq!(Balances::locks(ALICE), vec![the_lock(50 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); assert_eq!(>::get(ALICE), vec![(market_id_2, 30 * BASE)]); assert_eq!(Balances::locks(ALICE), vec![the_lock(30 * BASE)]); assert_eq!( @@ -1081,7 +1081,7 @@ fn locking_works_for_two_markets_with_stronger_first_unlock() { ); assert_eq!(Balances::locks(BOB), vec![the_lock(40 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(BOB), BOB)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(BOB), BOB)); assert_eq!(>::get(BOB), vec![(market_id_2, 20 * BASE)]); assert_eq!(Balances::locks(BOB), vec![the_lock(20 * BASE)]); assert_eq!(>::get(ALICE), vec![(market_id_2, 30 * BASE)]); @@ -1090,14 +1090,14 @@ fn locking_works_for_two_markets_with_stronger_first_unlock() { assert!(GlobalDisputes::determine_voting_winner(&market_id_2).is_some()); assert_eq!(>::get(ALICE), vec![(market_id_2, 30 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); assert_eq!(>::get(ALICE), vec![]); assert!(Balances::locks(ALICE).is_empty()); assert_eq!(>::get(BOB), vec![(market_id_2, 20 * BASE)]); assert_eq!(Balances::locks(BOB), vec![the_lock(20 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(BOB), BOB)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(BOB), BOB)); assert_eq!(>::get(BOB), vec![]); assert!(Balances::locks(BOB).is_empty()); }); @@ -1118,26 +1118,26 @@ fn locking_works_for_two_markets_with_weaker_first_unlock() { assert!(Balances::locks(BOB).is_empty()); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id_1, OutcomeReport::Scalar(0), 50 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id_1, OutcomeReport::Scalar(20), 40 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), market_id_2, OutcomeReport::Scalar(0), 30 * BASE )); assert_ok!(GlobalDisputes::vote_on_outcome( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id_2, OutcomeReport::Scalar(20), 20 * BASE @@ -1162,7 +1162,7 @@ fn locking_works_for_two_markets_with_weaker_first_unlock() { vec![(market_id_1, 50 * BASE), (market_id_2, 30 * BASE)] ); assert_eq!(Balances::locks(ALICE), vec![the_lock(50 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); assert_eq!(>::get(ALICE), vec![(market_id_1, 50 * BASE)]); assert_eq!(Balances::locks(ALICE), vec![the_lock(50 * BASE)]); assert_eq!( @@ -1171,7 +1171,7 @@ fn locking_works_for_two_markets_with_weaker_first_unlock() { ); assert_eq!(Balances::locks(BOB), vec![the_lock(40 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(BOB), BOB)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(BOB), BOB)); assert_eq!(>::get(BOB), vec![(market_id_1, 40 * BASE)]); assert_eq!(Balances::locks(BOB), vec![the_lock(40 * BASE)]); assert_eq!(>::get(ALICE), vec![(market_id_1, 50 * BASE)]); @@ -1181,14 +1181,14 @@ fn locking_works_for_two_markets_with_weaker_first_unlock() { assert_eq!(>::get(ALICE), vec![(market_id_1, 50 * BASE)]); assert_eq!(Balances::locks(ALICE), vec![the_lock(50 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(ALICE), ALICE)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(ALICE), ALICE)); assert_eq!(>::get(ALICE), vec![]); assert!(Balances::locks(ALICE).is_empty()); assert_eq!(>::get(BOB), vec![(market_id_1, 40 * BASE)]); assert_eq!(Balances::locks(BOB), vec![the_lock(40 * BASE)]); - assert_ok!(GlobalDisputes::unlock_vote_balance(Origin::signed(BOB), BOB)); + assert_ok!(GlobalDisputes::unlock_vote_balance(RuntimeOrigin::signed(BOB), BOB)); assert_eq!(>::get(BOB), vec![]); assert!(Balances::locks(BOB).is_empty()); }); diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index abf1738a7..0e107852d 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_global_disputes //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -62,12 +62,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_on_outcome(o: u32, v: u32) -> Weight { - Weight::from_ref_time(78_818_000) - // Standard Error: 21_000 - .saturating_add(Weight::from_ref_time(23_000).saturating_mul(o.into())) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(90_000).saturating_mul(v.into())) + fn vote_on_outcome(_o: u32, v: u32) -> Weight { + Weight::from_ref_time(33_191_681) + // Standard Error: 369 + .saturating_add(Weight::from_ref_time(37_828).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -76,11 +74,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_set(l: u32, o: u32) -> Weight { - Weight::from_ref_time(43_696_000) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(3_636_000).saturating_mul(l.into())) - // Standard Error: 61_000 - .saturating_add(Weight::from_ref_time(1_467_000).saturating_mul(o.into())) + Weight::from_ref_time(18_127_027) + // Standard Error: 839 + .saturating_add(Weight::from_ref_time(1_534_897).saturating_mul(l.into())) + // Standard Error: 4_699 + .saturating_add(Weight::from_ref_time(401_151).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -90,11 +88,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight { - Weight::from_ref_time(40_327_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(3_508_000).saturating_mul(l.into())) - // Standard Error: 55_000 - .saturating_add(Weight::from_ref_time(1_279_000).saturating_mul(o.into())) + Weight::from_ref_time(17_109_385) + // Standard Error: 607 + .saturating_add(Weight::from_ref_time(1_486_668).saturating_mul(l.into())) + // Standard Error: 3_398 + .saturating_add(Weight::from_ref_time(314_814).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -102,8 +100,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: System Account (r:1 w:1) - fn add_vote_outcome(_w: u32) -> Weight { - Weight::from_ref_time(87_507_000) + fn add_vote_outcome(w: u32) -> Weight { + Weight::from_ref_time(35_150_950) + // Standard Error: 1_710 + .saturating_add(Weight::from_ref_time(19_709).saturating_mul(w.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -111,9 +111,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:2 w:2) fn reward_outcome_owner_with_funds(o: u32) -> Weight { - Weight::from_ref_time(54_189_000) - // Standard Error: 75_000 - .saturating_add(Weight::from_ref_time(29_563_000).saturating_mul(o.into())) + Weight::from_ref_time(24_395_149) + // Standard Error: 13_698 + .saturating_add(Weight::from_ref_time(11_889_863).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -123,16 +123,14 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:1 w:0) fn reward_outcome_owner_no_funds(_o: u32) -> Weight { - Weight::from_ref_time(46_706_000).saturating_add(T::DbWeight::get().reads(3)) + Weight::from_ref_time(17_745_809).saturating_add(T::DbWeight::get().reads(3)) } // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:3 w:2) - fn purge_outcomes(k: u32, o: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 22_000 - .saturating_add(Weight::from_ref_time(18_932_000).saturating_mul(k.into())) - // Standard Error: 606_000 - .saturating_add(Weight::from_ref_time(10_914_000).saturating_mul(o.into())) + fn purge_outcomes(k: u32, _o: u32) -> Weight { + Weight::from_ref_time(34_095_000) + // Standard Error: 1_848 + .saturating_add(Weight::from_ref_time(7_103_707).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index 7559a5db9..f143dff10 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -1,18 +1,18 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { default-features = false, optional = true, version = "1.0.144" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/liquidity-mining/src/lib.rs b/zrml/liquidity-mining/src/lib.rs index 186f85bf5..c3a8ac5c4 100644 --- a/zrml/liquidity-mining/src/lib.rs +++ b/zrml/liquidity-mining/src/lib.rs @@ -101,7 +101,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, diff --git a/zrml/liquidity-mining/src/mock.rs b/zrml/liquidity-mining/src/mock.rs index b4b48eb69..f11b7e2db 100644 --- a/zrml/liquidity-mining/src/mock.rs +++ b/zrml/liquidity-mining/src/mock.rs @@ -57,7 +57,7 @@ construct_runtime!( ); impl crate::Config for Runtime { - type Event = (); + type RuntimeEvent = (); type MarketCommons = MarketCommons; type MarketId = MarketId; type PalletId = LiquidityMiningPalletId; @@ -72,9 +72,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = (); + type RuntimeEvent = (); type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -83,7 +83,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -96,7 +96,7 @@ impl pallet_balances::Config for Runtime { type Balance = Balance; type DustRemoval = (); type ReserveIdentifier = [u8; 8]; - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; diff --git a/zrml/liquidity-mining/src/tests.rs b/zrml/liquidity-mining/src/tests.rs index 818be27f0..c4c2deb76 100644 --- a/zrml/liquidity-mining/src/tests.rs +++ b/zrml/liquidity-mining/src/tests.rs @@ -19,7 +19,7 @@ #![cfg(test)] use crate::{ - mock::{Balances, ExtBuilder, LiquidityMining, Origin, Runtime, System, ALICE, BOB}, + mock::{Balances, ExtBuilder, LiquidityMining, Runtime, RuntimeOrigin, System, ALICE, BOB}, track_incentives_based_on_bought_shares::TrackIncentivesBasedOnBoughtShares, track_incentives_based_on_sold_shares::TrackIncentivesBasedOnSoldShares, BlockBoughtShares, BlockSoldShares, LiquidityMiningPalletApi as _, OwnedValues, @@ -193,7 +193,7 @@ fn only_sudo_can_change_per_block_distribution() { ExtBuilder::default().build().execute_with(|| { assert_ok!(LiquidityMining::set_per_block_distribution(RawOrigin::Root.into(), 100)); assert_err!( - LiquidityMining::set_per_block_distribution(Origin::signed(ALICE), 100), + LiquidityMining::set_per_block_distribution(RuntimeOrigin::signed(ALICE), 100), DispatchError::BadOrigin ); }); diff --git a/zrml/liquidity-mining/src/weights.rs b/zrml/liquidity-mining/src/weights.rs index 5a8c215f4..17bd8677d 100644 --- a/zrml/liquidity-mining/src/weights.rs +++ b/zrml/liquidity-mining/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_liquidity_mining //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,6 +54,6 @@ pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { // Storage: LiquidityMining PerBlockIncentive (r:0 w:1) fn set_per_block_distribution() -> Weight { - Weight::from_ref_time(8_150_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(2_691_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index ad44a7d7e..ae85191f5 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -1,16 +1,16 @@ [dependencies] -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-arithmetic = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-arithmetic = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/market-commons/src/mock.rs b/zrml/market-commons/src/mock.rs index 3613179fc..1f929435d 100644 --- a/zrml/market-commons/src/mock.rs +++ b/zrml/market-commons/src/mock.rs @@ -61,9 +61,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = (); + type RuntimeEvent = (); type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -72,7 +72,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -84,7 +84,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = (); type MaxLocks = (); type MaxReserves = MaxReserves; diff --git a/zrml/orderbook-v1/Cargo.toml b/zrml/orderbook-v1/Cargo.toml index f05ad24a4..e2e7dd6ce 100644 --- a/zrml/orderbook-v1/Cargo.toml +++ b/zrml/orderbook-v1/Cargo.toml @@ -1,18 +1,18 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } # Mock -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +orml-tokens = { branch = "polkadot-v0.9.32", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } [dev-dependencies] zrml-orderbook-v1 = { features = ["mock"], path = "." } diff --git a/zrml/orderbook-v1/fuzz/Cargo.toml b/zrml/orderbook-v1/fuzz/Cargo.toml index b2c36842f..fcde37c37 100644 --- a/zrml/orderbook-v1/fuzz/Cargo.toml +++ b/zrml/orderbook-v1/fuzz/Cargo.toml @@ -6,7 +6,7 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } libfuzzer-sys = "0.4" zeitgeist-primitives = { path = "../../../primitives" } zrml-orderbook-v1 = { features = ["mock"], path = ".." } diff --git a/zrml/orderbook-v1/fuzz/orderbook_v1_full_workflow.rs b/zrml/orderbook-v1/fuzz/orderbook_v1_full_workflow.rs index c624197df..7f43e5f9f 100644 --- a/zrml/orderbook-v1/fuzz/orderbook_v1_full_workflow.rs +++ b/zrml/orderbook-v1/fuzz/orderbook_v1_full_workflow.rs @@ -21,7 +21,7 @@ use frame_system::ensure_signed; use libfuzzer_sys::fuzz_target; use zeitgeist_primitives::types::{Asset, ScalarPosition, SerdeWrapper}; use zrml_orderbook_v1::{ - mock::{ExtBuilder, Orderbook, Origin}, + mock::{ExtBuilder, Orderbook, RuntimeOrigin}, OrderSide, }; @@ -34,31 +34,32 @@ fuzz_target!(|data: Data| { // Make arbitrary order and attempt to fill let order_asset = asset(data.make_fill_order_asset); let order_hash = Orderbook::order_hash( - &ensure_signed(Origin::signed(data.make_fill_order_origin.into())).unwrap(), + &ensure_signed(RuntimeOrigin::signed(data.make_fill_order_origin.into())).unwrap(), order_asset, Orderbook::nonce(), ); let _ = Orderbook::make_order( - Origin::signed(data.make_fill_order_origin.into()), + RuntimeOrigin::signed(data.make_fill_order_origin.into()), order_asset, orderside(data.make_fill_order_side), data.make_fill_order_amount, data.make_fill_order_price, ); - let _ = Orderbook::fill_order(Origin::signed(data.fill_order_origin.into()), order_hash); + let _ = + Orderbook::fill_order(RuntimeOrigin::signed(data.fill_order_origin.into()), order_hash); // Make arbitrary order and attempt to cancel let order_asset = asset(data.make_cancel_order_asset); let order_hash = Orderbook::order_hash( - &ensure_signed(Origin::signed(data.make_cancel_order_origin.into())).unwrap(), + &ensure_signed(RuntimeOrigin::signed(data.make_cancel_order_origin.into())).unwrap(), order_asset, Orderbook::nonce(), ); let _ = Orderbook::make_order( - Origin::signed(data.make_cancel_order_origin.into()), + RuntimeOrigin::signed(data.make_cancel_order_origin.into()), order_asset, orderside(data.make_cancel_order_side), data.make_cancel_order_amount, @@ -66,7 +67,7 @@ fuzz_target!(|data: Data| { ); let _ = Orderbook::cancel_order( - Origin::signed(data.make_cancel_order_origin.into()), + RuntimeOrigin::signed(data.make_cancel_order_origin.into()), order_asset, order_hash, ); diff --git a/zrml/orderbook-v1/src/lib.rs b/zrml/orderbook-v1/src/lib.rs index 61cf64ad7..c97f84cec 100644 --- a/zrml/orderbook-v1/src/lib.rs +++ b/zrml/orderbook-v1/src/lib.rs @@ -256,7 +256,7 @@ mod pallet { pub trait Config: frame_system::Config { type Currency: ReservableCurrency; - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type MarketId: MarketId; diff --git a/zrml/orderbook-v1/src/mock.rs b/zrml/orderbook-v1/src/mock.rs index 6cecf478d..d7570fc83 100644 --- a/zrml/orderbook-v1/src/mock.rs +++ b/zrml/orderbook-v1/src/mock.rs @@ -53,7 +53,7 @@ construct_runtime!( impl crate::Config for Runtime { type Currency = Balances; - type Event = (); + type RuntimeEvent = (); type MarketId = MarketId; type Shares = Tokens; type WeightInfo = orderbook_v1::weights::WeightInfo; @@ -67,9 +67,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = (); + type RuntimeEvent = (); type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -78,7 +78,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -91,13 +91,11 @@ impl orml_tokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; - type Event = (); + type RuntimeEvent = (); type ExistentialDeposits = ExistentialDeposits; type MaxLocks = (); type MaxReserves = MaxReserves; - type OnDust = (); - type OnKilledTokenAccount = (); - type OnNewTokenAccount = (); + type CurrencyHooks = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); } @@ -106,7 +104,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = ExistentialDeposit; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; diff --git a/zrml/orderbook-v1/src/tests.rs b/zrml/orderbook-v1/src/tests.rs index e448ba140..4bbbd31af 100644 --- a/zrml/orderbook-v1/src/tests.rs +++ b/zrml/orderbook-v1/src/tests.rs @@ -34,7 +34,7 @@ fn it_makes_orders() { // Make an order from Alice to buy shares. assert_ok!(Orderbook::make_order( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::CategoricalOutcome(0, 2), OrderSide::Bid, 25, @@ -47,7 +47,7 @@ fn it_makes_orders() { // Make an order from Bob to sell shares. assert_ok!(Orderbook::make_order( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), Asset::CategoricalOutcome(0, 1), OrderSide::Ask, 10, @@ -67,7 +67,7 @@ fn it_takes_orders() { // Make an order from Bob to sell shares. assert_ok!(Orderbook::make_order( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), Asset::CategoricalOutcome(0, 1), OrderSide::Ask, 10, @@ -75,7 +75,7 @@ fn it_takes_orders() { )); let order_hash = Orderbook::order_hash(&BOB, Asset::CategoricalOutcome(0, 1), 0); - assert_ok!(Orderbook::fill_order(Origin::signed(ALICE), order_hash)); + assert_ok!(Orderbook::fill_order(RuntimeOrigin::signed(ALICE), order_hash)); let alice_bal = >::free_balance(&ALICE); let alice_shares = Tokens::free_balance(Asset::CategoricalOutcome(0, 1), &ALICE); @@ -94,15 +94,21 @@ fn it_cancels_orders() { ExtBuilder::default().build().execute_with(|| { // Make an order from Alice to buy shares. let share_id = Asset::CategoricalOutcome(0, 2); - assert_ok!(Orderbook::make_order(Origin::signed(ALICE), share_id, OrderSide::Bid, 25, 10)); + assert_ok!(Orderbook::make_order( + RuntimeOrigin::signed(ALICE), + share_id, + OrderSide::Bid, + 25, + 10 + )); let order_hash = Orderbook::order_hash(&ALICE, share_id, 0); assert_noop!( - Orderbook::cancel_order(Origin::signed(BOB), share_id, order_hash), + Orderbook::cancel_order(RuntimeOrigin::signed(BOB), share_id, order_hash), Error::::NotOrderCreator, ); - assert_ok!(Orderbook::cancel_order(Origin::signed(ALICE), share_id, order_hash)); + assert_ok!(Orderbook::cancel_order(RuntimeOrigin::signed(ALICE), share_id, order_hash)); }); } diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index f12cf796f..b8a119af2 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -1,13 +1,13 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { version = "1.0.144", default-features = false, optional = true } -sp-arithmetic = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-arithmetic = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-authorized = { default-features = false, path = "../authorized" } zrml-court = { default-features = false, path = "../court" } @@ -19,17 +19,17 @@ zrml-simple-disputes = { default-features = false, path = "../simple-disputes" } # Mock -orml-asset-registry = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -pallet-randomness-collective-flip = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate", optional = true } -pallet-treasury = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +orml-asset-registry = { branch = "polkadot-v0.9.32", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-currencies = { branch = "polkadot-v0.9.32", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-tokens = { branch = "polkadot-v0.9.32", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +pallet-randomness-collective-flip = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +pallet-timestamp = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate", optional = true } +pallet-treasury = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sp-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } substrate-fixed = { optional = true, git = "https://github.com/encointer/substrate-fixed" } -xcm = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/polkadot", optional = true, default-features = false } +xcm = { branch = "release-v0.9.32", git = "https://github.com/paritytech/polkadot", optional = true, default-features = false } zrml-prediction-markets-runtime-api = { features = ["std"], optional = true, path = "./runtime-api" } zrml-rikiddo = { optional = true, path = "../rikiddo" } zrml-swaps = { optional = true, path = "../swaps" } diff --git a/zrml/prediction-markets/fuzz/Cargo.toml b/zrml/prediction-markets/fuzz/Cargo.toml index f0813cf25..e35beb6a4 100644 --- a/zrml/prediction-markets/fuzz/Cargo.toml +++ b/zrml/prediction-markets/fuzz/Cargo.toml @@ -6,7 +6,7 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } libfuzzer-sys = "0.4" zeitgeist-primitives = { features = ["arbitrary", "mock"], default-features = false, path = "../../../primitives" } zrml-prediction-markets = { features = ["mock"], path = ".." } diff --git a/zrml/prediction-markets/fuzz/pm_full_workflow.rs b/zrml/prediction-markets/fuzz/pm_full_workflow.rs index 920f748cb..edddb77ac 100644 --- a/zrml/prediction-markets/fuzz/pm_full_workflow.rs +++ b/zrml/prediction-markets/fuzz/pm_full_workflow.rs @@ -26,7 +26,7 @@ use zeitgeist_primitives::types::{ Asset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketType, MultiHash, OutcomeReport, ScoringRule, }; -use zrml_prediction_markets::mock::{ExtBuilder, Origin, PredictionMarkets, System}; +use zrml_prediction_markets::mock::{ExtBuilder, PredictionMarkets, RuntimeOrigin, System}; fuzz_target!(|data: Data| { let mut ext = ExtBuilder::default().build(); @@ -40,7 +40,7 @@ fuzz_target!(|data: Data| { dispute_duration: 3_u32.into(), }; let _ = PredictionMarkets::create_market( - Origin::signed(data.create_scalar_market_origin.into()), + RuntimeOrigin::signed(data.create_scalar_market_origin.into()), Asset::Ztg, data.create_scalar_market_oracle.into(), MarketPeriod::Block(data.create_scalar_market_period), @@ -56,7 +56,7 @@ fuzz_target!(|data: Data| { System::set_block_number(2); let _ = PredictionMarkets::buy_complete_set( - Origin::signed(data.buy_complete_set_origin.into()), + RuntimeOrigin::signed(data.buy_complete_set_origin.into()), data.buy_complete_set_market_id.into(), data.buy_complete_set_amount, ); @@ -64,7 +64,7 @@ fuzz_target!(|data: Data| { System::set_block_number(3); let _ = PredictionMarkets::report( - Origin::signed(data.report_origin.into()), + RuntimeOrigin::signed(data.report_origin.into()), data.report_market_id.into(), outcome(data.report_outcome), ); @@ -74,7 +74,7 @@ fuzz_target!(|data: Data| { let dispute_market_id = data.dispute_market_id.into(); let _ = PredictionMarkets::dispute( - Origin::signed(data.report_origin.into()), + RuntimeOrigin::signed(data.report_origin.into()), dispute_market_id, outcome(data.report_outcome), ); @@ -83,7 +83,7 @@ fuzz_target!(|data: Data| { System::set_block_number(5); let _ = PredictionMarkets::redeem_shares( - Origin::signed(data.redeem_origin.into()), + RuntimeOrigin::signed(data.redeem_origin.into()), data.redeem_market_id.into(), ); diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index 194f41697..b7bb2c86b 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -1,6 +1,6 @@ [dependencies] parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } [features] diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index ad3713ad0..09659c2a3 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -49,7 +49,7 @@ use zrml_market_commons::MarketCommonsPalletApi; use frame_support::{traits::Hooks, BoundedVec}; -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 7fda9ce26..164197014 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -37,7 +37,7 @@ mod pallet { use alloc::{format, vec, vec::Vec}; use core::{cmp, marker::PhantomData}; use frame_support::{ - dispatch::{DispatchResultWithPostInfo, Weight}, + dispatch::{DispatchResultWithPostInfo, Pays, Weight}, ensure, log, pallet_prelude::{ConstU32, StorageMap, StorageValue, ValueQuery}, storage::{with_transaction, TransactionOutcome}, @@ -45,9 +45,7 @@ mod pallet { tokens::BalanceStatus, Currency, EnsureOrigin, Get, Hooks, Imbalance, IsType, NamedReservableCurrency, OnUnbalanced, StorageVersion, }, - transactional, - weights::Pays, - Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, + transactional, Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; @@ -1526,7 +1524,7 @@ mod pallet { type AdvisoryBondSlashPercentage: Get; /// The origin that is allowed to approve / reject pending advised markets. - type ApproveOrigin: EnsureOrigin; + type ApproveOrigin: EnsureOrigin; /// Shares of outcome assets and native currency type AssetManager: ZeitgeistAssetManager< @@ -1550,11 +1548,11 @@ mod pallet { BlockNumber = Self::BlockNumber, MarketId = MarketIdOf, Moment = MomentOf, - Origin = Self::Origin, + Origin = Self::RuntimeOrigin, >; /// The origin that is allowed to close markets. - type CloseOrigin: EnsureOrigin; + type CloseOrigin: EnsureOrigin; /// See [`zrml_court::CourtPalletApi`]. type Court: zrml_court::CourtPalletApi< @@ -1563,11 +1561,11 @@ mod pallet { BlockNumber = Self::BlockNumber, MarketId = MarketIdOf, Moment = MomentOf, - Origin = Self::Origin, + Origin = Self::RuntimeOrigin, >; /// The origin that is allowed to destroy markets. - type DestroyOrigin: EnsureOrigin; + type DestroyOrigin: EnsureOrigin; /// The base amount of currency that must be bonded in order to create a dispute. #[pallet::constant] @@ -1579,7 +1577,7 @@ mod pallet { type DisputeFactor: Get>; /// Event - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// See [`GlobalDisputesPalletApi`]. #[cfg(feature = "with-global-disputes")] @@ -1664,7 +1662,7 @@ mod pallet { type PalletId: Get; /// The origin that is allowed to reject pending advised markets. - type RejectOrigin: EnsureOrigin; + type RejectOrigin: EnsureOrigin; /// The base amount of currency that must be bonded to ensure the oracle reports /// in a timely manner. @@ -1672,10 +1670,10 @@ mod pallet { type OracleBond: Get>; /// The origin that is allowed to request edits in pending advised markets. - type RequestEditOrigin: EnsureOrigin; + type RequestEditOrigin: EnsureOrigin; /// The origin that is allowed to resolve markets. - type ResolveOrigin: EnsureOrigin; + type ResolveOrigin: EnsureOrigin; /// See [`DisputeApi`]. type SimpleDisputes: DisputeApi< @@ -1684,7 +1682,7 @@ mod pallet { BlockNumber = Self::BlockNumber, MarketId = MarketIdOf, Moment = MomentOf, - Origin = Self::Origin, + Origin = Self::RuntimeOrigin, >; /// Handler for slashed funds. diff --git a/zrml/prediction-markets/src/migrations.rs b/zrml/prediction-markets/src/migrations.rs index 15c18bf56..e1b0c42ae 100644 --- a/zrml/prediction-markets/src/migrations.rs +++ b/zrml/prediction-markets/src/migrations.rs @@ -26,8 +26,6 @@ use alloc::format; use alloc::vec::Vec; #[cfg(feature = "try-runtime")] use frame_support::migration::storage_key_iter; -#[cfg(feature = "try-runtime")] -use frame_support::traits::OnRuntimeUpgradeHelpersExt; use frame_support::{ dispatch::Weight, log, @@ -150,7 +148,7 @@ impl OnRuntimeUpgrade for AddOutsiderBo } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result<(), &'static str> { + fn pre_upgrade() -> Result, &'static str> { use frame_support::pallet_prelude::Blake2_128Concat; let old_markets = storage_key_iter::, OldMarketOf, Blake2_128Concat>( @@ -158,7 +156,6 @@ impl OnRuntimeUpgrade for AddOutsiderBo MARKETS, ) .collect::>(); - Self::set_temp_storage(old_markets, "old_markets"); let markets = Markets::::iter_keys().count() as u32; let decodable_markets = Markets::::iter_values().count() as u32; @@ -172,13 +169,14 @@ impl OnRuntimeUpgrade for AddOutsiderBo log::info!("Markets: {}, Decodable Markets: {}", markets, decodable_markets); } - Ok(()) + Ok(old_markets.encode()) } #[cfg(feature = "try-runtime")] - fn post_upgrade() -> Result<(), &'static str> { + fn post_upgrade(previous_state: Vec) -> Result<(), &'static str> { let old_markets: BTreeMap, OldMarketOf> = - Self::get_temp_storage("old_markets").unwrap(); + Decode::decode(&mut &previous_state[..]) + .expect("Failed to decode state: Invalid state"); let new_market_count = >::market_iter().count(); assert_eq!(old_markets.len(), new_market_count); for (market_id, new_market) in >::market_iter() { diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index 04b4d8c95..be8392167 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -104,7 +104,7 @@ construct_runtime!( SimpleDisputes: zrml_simple_disputes::{Event, Pallet, Storage}, GlobalDisputes: zrml_global_disputes::{Event, Pallet, Storage}, Swaps: zrml_swaps::{Call, Event, Pallet}, - System: frame_system::{Config, Event, Pallet, Storage}, + System: frame_system::{Call, Config, Event, Pallet, Storage}, Timestamp: pallet_timestamp::{Pallet}, Tokens: orml_tokens::{Config, Event, Pallet, Storage}, Treasury: pallet_treasury::{Call, Event, Pallet, Storage}, @@ -130,7 +130,7 @@ construct_runtime!( RikiddoSigmoidFeeMarketEma: zrml_rikiddo::{Pallet, Storage}, SimpleDisputes: zrml_simple_disputes::{Event, Pallet, Storage}, Swaps: zrml_swaps::{Call, Event, Pallet}, - System: frame_system::{Config, Event, Pallet, Storage}, + System: frame_system::{Call, Config, Event, Pallet, Storage}, Timestamp: pallet_timestamp::{Pallet}, Tokens: orml_tokens::{Config, Event, Pallet, Storage}, Treasury: pallet_treasury::{Call, Event, Pallet, Storage}, @@ -149,7 +149,7 @@ impl crate::Config for Runtime { type DestroyOrigin = EnsureSignedBy; type DisputeBond = DisputeBond; type DisputeFactor = DisputeFactor; - type Event = Event; + type RuntimeEvent = RuntimeEvent; #[cfg(feature = "with-global-disputes")] type GlobalDisputes = GlobalDisputes; #[cfg(feature = "with-global-disputes")] @@ -190,9 +190,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -202,7 +202,7 @@ impl frame_system::Config for Runtime { type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -221,13 +221,11 @@ impl orml_tokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; type MaxLocks = (); type MaxReserves = MaxReserves; - type OnDust = (); - type OnKilledTokenAccount = (); - type OnNewTokenAccount = (); + type CurrencyHooks = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); } @@ -244,7 +242,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type MaxLocks = (); type MaxReserves = MaxReserves; @@ -269,7 +267,7 @@ impl zrml_authorized::Config for Runtime { type AuthorizedDisputeResolutionOrigin = EnsureSignedBy; type CorrectionPeriod = CorrectionPeriod; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DisputeResolution = prediction_markets::Pallet; type MarketCommons = MarketCommons; type PalletId = AuthorizedPalletId; @@ -279,7 +277,7 @@ impl zrml_authorized::Config for Runtime { impl zrml_court::Config for Runtime { type CourtCaseDuration = CourtCaseDuration; type DisputeResolution = prediction_markets::Pallet; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type PalletId = CourtPalletId; type Random = RandomnessCollectiveFlip; @@ -289,7 +287,7 @@ impl zrml_court::Config for Runtime { } impl zrml_liquidity_mining::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type MarketId = MarketId; type PalletId = LiquidityMiningPalletId; @@ -319,7 +317,7 @@ impl zrml_rikiddo::Config for Runtime { } impl zrml_simple_disputes::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DisputeResolution = prediction_markets::Pallet; type MarketCommons = MarketCommons; type PalletId = SimpleDisputesPalletId; @@ -327,7 +325,7 @@ impl zrml_simple_disputes::Config for Runtime { #[cfg(feature = "with-global-disputes")] impl zrml_global_disputes::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type Currency = Balances; type GlobalDisputeLockId = GlobalDisputeLockId; @@ -341,7 +339,7 @@ impl zrml_global_disputes::Config for Runtime { } impl zrml_swaps::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExitFee = ExitFee; type FixedTypeU = ::FixedTypeU; type FixedTypeS = ::FixedTypeS; @@ -368,7 +366,7 @@ impl pallet_treasury::Config for Runtime { type Burn = (); type BurnDestination = (); type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxApprovals = MaxApprovals; type OnSlash = (); type PalletId = TreasuryPalletId; diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 1dc1a7955..961f59c0a 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -96,7 +96,7 @@ fn simple_create_categorical_market( scoring_rule: ScoringRule, ) { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(period), @@ -116,7 +116,7 @@ fn simple_create_scalar_market( scoring_rule: ScoringRule, ) { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(period), @@ -143,7 +143,10 @@ fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_blocknumb ); run_blocks(3); let market_id = 0; - assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id)); + assert_ok!(PredictionMarkets::admin_move_market_to_closed( + RuntimeOrigin::signed(SUDO), + market_id + )); let market = MarketCommons::market(&market_id).unwrap(); assert_eq!(market.status, MarketStatus::Closed); let new_end = now + 3; @@ -163,7 +166,7 @@ fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_timestamp let end = start + 42.saturated_into::() * MILLISECS_PER_BLOCK as u64; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(start..end), @@ -184,7 +187,10 @@ fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_timestamp set_timestamp_for_on_initialize(start + shift + MILLISECS_PER_BLOCK as u64); run_blocks(shift_blocks); - assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id)); + assert_ok!(PredictionMarkets::admin_move_market_to_closed( + RuntimeOrigin::signed(SUDO), + market_id + )); let market = MarketCommons::market(&market_id).unwrap(); assert_eq!(market.status, MarketStatus::Closed); let new_end = start + shift; @@ -198,7 +204,7 @@ fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_timestamp fn admin_move_market_to_closed_fails_if_market_does_not_exist() { ExtBuilder::default().build().execute_with(|| { assert_noop!( - PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), 0), + PredictionMarkets::admin_move_market_to_closed(RuntimeOrigin::signed(SUDO), 0), zrml_market_commons::Error::::MarketDoesNotExist ); }); @@ -225,7 +231,7 @@ fn admin_move_market_to_closed_fails_if_market_is_not_active(market_status: Mark Ok(()) })); assert_noop!( - PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), market_id), + PredictionMarkets::admin_move_market_to_closed(RuntimeOrigin::signed(SUDO), market_id), Error::::MarketIsNotActive, ); }); @@ -236,7 +242,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { ExtBuilder::default().build().execute_with(|| { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(22..66), @@ -249,7 +255,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(33..66), @@ -262,7 +268,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(22..33), @@ -274,7 +280,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_open_and_close_blocks() { LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); - assert_ok!(PredictionMarkets::admin_move_market_to_closed(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_move_market_to_closed(RuntimeOrigin::signed(SUDO), 0)); let auto_close = MarketIdsPerCloseBlock::::get(66); assert_eq!(auto_close.len(), 1); @@ -292,7 +298,7 @@ fn create_scalar_market_fails_on_invalid_range(range: RangeInclusive) { ExtBuilder::default().build().execute_with(|| { assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(123..456), @@ -318,7 +324,7 @@ fn create_market_fails_on_min_dispute_period() { }; assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(123..456), @@ -344,7 +350,7 @@ fn create_market_fails_on_min_oracle_duration() { }; assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(123..456), @@ -370,7 +376,7 @@ fn create_market_fails_on_max_dispute_period() { }; assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(123..456), @@ -396,7 +402,7 @@ fn create_market_fails_on_max_grace_period() { }; assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(123..456), @@ -422,7 +428,7 @@ fn create_market_fails_on_max_oracle_duration() { }; assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(123..456), @@ -452,7 +458,7 @@ fn create_market_with_foreign_assets() { assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::ForeignAsset(420), BOB, MarketPeriod::Block(123..456), @@ -468,7 +474,7 @@ fn create_market_with_foreign_assets() { // As per Mock asset_registry genesis ForeignAsset(50) is not registered in asset_registry. assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::ForeignAsset(50), BOB, MarketPeriod::Block(123..456), @@ -483,7 +489,7 @@ fn create_market_with_foreign_assets() { ); // As per Mock asset_registry genesis ForeignAsset(100) has allow_as_base_asset set to true. assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::ForeignAsset(100), BOB, MarketPeriod::Block(123..456), @@ -516,7 +522,7 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_active() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -547,7 +553,7 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_reported() { let market = MarketCommons::market(&0).unwrap(); run_to_block(end + market.deadlines.grace_period); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -558,7 +564,7 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_reported() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -591,13 +597,13 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { assert_ne!(grace_period, 0); run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); run_to_block(grace_period + 2); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); @@ -608,7 +614,7 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -641,18 +647,18 @@ fn admin_destroy_market_correctly_unreserves_dispute_bonds() { assert_ne!(grace_period, 0); run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); run_to_block(grace_period + 2); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(DAVE), + RuntimeOrigin::signed(DAVE), 0, OutcomeReport::Categorical(1) )); @@ -669,7 +675,7 @@ fn admin_destroy_market_correctly_unreserves_dispute_bonds() { let balance_free_before_charlie = Balances::free_balance(&CHARLIE); let balance_free_before_dave = Balances::free_balance(&DAVE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), market_id)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), market_id)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &CHARLIE), SENTINEL_AMOUNT, @@ -705,7 +711,7 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_resolved() { let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -718,7 +724,7 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_resolved() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -752,7 +758,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -791,9 +797,9 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed_with_edit_requ let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + assert_ok!(PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason)); assert!(MarketIdsForEdit::::contains_key(0)); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -821,7 +827,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_active() { 0..1, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named( &PredictionMarkets::reserve_id(), @@ -829,7 +835,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_active() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -857,12 +863,12 @@ fn admin_destroy_market_correctly_slashes_advised_market_reported() { 0..end, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -873,7 +879,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_reported() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -901,17 +907,17 @@ fn admin_destroy_market_correctly_slashes_advised_market_disputed() { 0..end, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); @@ -922,7 +928,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_disputed() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -950,12 +956,12 @@ fn admin_destroy_market_correctly_slashes_advised_market_resolved() { 0..end, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -968,7 +974,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_resolved() { SENTINEL_AMOUNT )); let balance_free_before_alice = Balances::free_balance(&ALICE); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT @@ -992,7 +998,7 @@ fn admin_destroy_market_correctly_cleans_up_accounts() { AssetManager::free_balance(base_asset, &ALICE); let swap_fee = ::MaxSwapFee::get(); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, ALICE, MarketPeriod::Block(0..42), @@ -1005,12 +1011,12 @@ fn admin_destroy_market_correctly_cleans_up_accounts() { vec![::MinWeight::get(); 3], )); // Buy some outcome tokens for Alice so that we can check that they get destroyed. - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(ALICE), 0, BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(ALICE), 0, BASE)); let market_id = 0; let pool_id = 0; let pool_account = Swaps::pool_account_id(&pool_id); let market_account = MarketCommons::market_account(market_id); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 0), &pool_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 1), &pool_account), 0); assert_eq!(AssetManager::free_balance(Asset::CategoricalOutcome(0, 2), &pool_account), 0); @@ -1057,7 +1063,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { ExtBuilder::default().build().execute_with(|| { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(22..66), @@ -1070,7 +1076,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(33..66), @@ -1083,7 +1089,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(22..33), @@ -1095,7 +1101,7 @@ fn admin_destroy_market_correctly_clears_auto_open_and_close_blocks() { LIQUIDITY, vec![::MinWeight::get(); category_count.into()], )); - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); let auto_close = MarketIdsPerCloseBlock::::get(66); assert_eq!(auto_close.len(), 1); @@ -1138,12 +1144,12 @@ fn admin_move_market_to_resolved_resolves_reported_market() { let category = 1; let outcome_report = OutcomeReport::Categorical(category); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, outcome_report.clone() )); assert_ok!(PredictionMarkets::admin_move_market_to_resolved( - Origin::signed(SUDO), + RuntimeOrigin::signed(SUDO), market_id )); @@ -1197,7 +1203,10 @@ fn admin_move_market_to_resovled_fails_if_market_is_not_reported_or_disputed( Ok(()) })); assert_noop!( - PredictionMarkets::admin_move_market_to_resolved(Origin::signed(SUDO), market_id,), + PredictionMarkets::admin_move_market_to_resolved( + RuntimeOrigin::signed(SUDO), + market_id, + ), Error::::InvalidMarketStatus, ); }); @@ -1273,7 +1282,7 @@ fn it_does_not_create_market_with_too_few_categories() { ExtBuilder::default().build().execute_with(|| { assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..100), @@ -1294,7 +1303,7 @@ fn it_does_not_create_market_with_too_many_categories() { ExtBuilder::default().build().execute_with(|| { assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..100), @@ -1322,7 +1331,7 @@ fn it_allows_sudo_to_destroy_markets() { ); // destroy the market - assert_ok!(PredictionMarkets::admin_destroy_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_noop!( MarketCommons::market(&0), @@ -1348,12 +1357,12 @@ fn it_allows_advisory_origin_to_approve_markets() { // Make sure it fails from the random joe assert_noop!( - PredictionMarkets::approve_market(Origin::signed(BOB), 0), + PredictionMarkets::approve_market(RuntimeOrigin::signed(BOB), 0), DispatchError::BadOrigin ); // Now it should work from SUDO - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let after_market = MarketCommons::market(&0); assert_eq!(after_market.unwrap().status, MarketStatus::Active); @@ -1379,12 +1388,16 @@ fn it_allows_request_edit_origin_to_request_edits_for_markets() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; // Make sure it fails from the random joe assert_noop!( - PredictionMarkets::request_edit(Origin::signed(BOB), 0, edit_reason.clone()), + PredictionMarkets::request_edit(RuntimeOrigin::signed(BOB), 0, edit_reason.clone()), DispatchError::BadOrigin ); // Now it should work from SUDO - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason.clone())); + assert_ok!(PredictionMarkets::request_edit( + RuntimeOrigin::signed(SUDO), + 0, + edit_reason.clone() + )); System::assert_last_event( Event::MarketRequestedEdit( 0, @@ -1416,7 +1429,7 @@ fn request_edit_fails_on_bad_origin() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; // Make sure it fails from the random joe assert_noop!( - PredictionMarkets::request_edit(Origin::signed(BOB), 0, edit_reason), + PredictionMarkets::request_edit(RuntimeOrigin::signed(BOB), 0, edit_reason), DispatchError::BadOrigin ); }); @@ -1440,7 +1453,7 @@ fn edit_request_fails_if_edit_reason_is_too_long() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize + 1]; assert_noop!( - PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason), + PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason), Error::::EditReasonLengthExceedsMaxEditReasonLen ); }); @@ -1463,11 +1476,11 @@ fn market_with_edit_request_cannot_be_approved() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + assert_ok!(PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason)); assert!(MarketIdsForEdit::::contains_key(0)); assert_noop!( - PredictionMarkets::approve_market(Origin::signed(SUDO), 0), + PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0), Error::::MarketEditRequestAlreadyInProgress ); }); @@ -1493,7 +1506,7 @@ fn it_allows_the_advisory_origin_to_reject_markets() { vec![0; ::MaxRejectReasonLen::get() as usize]; // Now it should work from SUDO assert_ok!(PredictionMarkets::reject_market( - Origin::signed(SUDO), + RuntimeOrigin::signed(SUDO), 0, reject_reason.clone() )); @@ -1525,7 +1538,7 @@ fn reject_errors_if_reject_reason_is_too_long() { let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize + 1]; assert_noop!( - PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason), + PredictionMarkets::reject_market(RuntimeOrigin::signed(SUDO), 0, reject_reason), Error::::RejectReasonLengthExceedsMaxRejectReasonLen ); }); @@ -1549,9 +1562,9 @@ fn it_allows_the_advisory_origin_to_reject_markets_with_edit_request() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; let reject_reason = vec![0_u8; ::MaxRejectReasonLen::get() as usize]; - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + assert_ok!(PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason)); assert!(MarketIdsForEdit::::contains_key(0)); - assert_ok!(PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason)); + assert_ok!(PredictionMarkets::reject_market(RuntimeOrigin::signed(SUDO), 0, reject_reason)); assert!(!MarketIdsForEdit::::contains_key(0)); assert_noop!( @@ -1588,7 +1601,7 @@ fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; - assert_ok!(PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason)); + assert_ok!(PredictionMarkets::reject_market(RuntimeOrigin::signed(SUDO), 0, reject_reason)); // AdvisoryBond gets slashed after reject_market // OracleBond gets unreserved after reject_market @@ -1650,7 +1663,7 @@ fn reject_market_clears_auto_close_blocks() { ); let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; - assert_ok!(PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason)); + assert_ok!(PredictionMarkets::reject_market(RuntimeOrigin::signed(SUDO), 0, reject_reason)); let auto_close = MarketIdsPerCloseBlock::::get(66); assert_eq!(auto_close.len(), 1); @@ -1734,7 +1747,11 @@ fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), market_id, edit_reason)); + assert_ok!(PredictionMarkets::request_edit( + RuntimeOrigin::signed(SUDO), + market_id, + edit_reason + )); assert!(MarketIdsForEdit::::contains_key(0)); run_blocks(end); @@ -1767,7 +1784,7 @@ fn on_market_open_successfully_auto_opens_market_pool_with_blocks() { let end = 66; let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(start..end), @@ -1798,7 +1815,7 @@ fn on_market_close_successfully_auto_closes_market_with_blocks() { let end = 33; let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(0..end), @@ -1836,7 +1853,7 @@ fn on_market_open_successfully_auto_opens_market_with_timestamps() { let end: Moment = (66 * MILLISECS_PER_BLOCK).into(); let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(start..end), @@ -1870,7 +1887,7 @@ fn on_market_close_successfully_auto_closes_market_with_timestamps() { let end: Moment = (2 * MILLISECS_PER_BLOCK).into(); let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), @@ -1916,7 +1933,7 @@ fn on_market_open_successfully_auto_opens_multiple_markets_after_stall() { let end: Moment = (666 * MILLISECS_PER_BLOCK).into(); let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(start..end), @@ -1929,7 +1946,7 @@ fn on_market_open_successfully_auto_opens_multiple_markets_after_stall() { vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(start..end), @@ -1961,7 +1978,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { let end: Moment = (5 * MILLISECS_PER_BLOCK).into(); let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), @@ -1974,7 +1991,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { vec![::MinWeight::get(); category_count.into()], )); assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), @@ -2013,7 +2030,7 @@ fn on_initialize_skips_the_genesis_block() { ExtBuilder::default().build().execute_with(|| { let category_count = 3; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Timestamp(0..end), @@ -2056,7 +2073,7 @@ fn it_allows_to_buy_a_complete_set() { ); // Allows someone to generate a complete set - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); @@ -2095,7 +2112,7 @@ fn it_does_not_allow_to_buy_a_complete_set_on_pending_advised_market() { ScoringRule::CPMM, ); assert_noop!( - PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT), + PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, CENT), Error::::MarketIsNotActive, ); }); @@ -2106,7 +2123,7 @@ fn create_categorical_market_fails_if_market_begin_is_equal_to_end() { ExtBuilder::default().build().execute_with(|| { assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(3..3), @@ -2136,7 +2153,7 @@ fn create_categorical_market_fails_if_market_period_is_invalid( ExtBuilder::default().build().execute_with(|| { assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, period, @@ -2159,7 +2176,7 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { run_to_block(end_block); assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..end_block), @@ -2176,7 +2193,7 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { let end_time = MILLISECS_PER_BLOCK as u64 / 2; assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..end_time), @@ -2202,7 +2219,7 @@ fn it_does_not_allow_zero_amounts_in_buy_complete_set() { ScoringRule::CPMM, ); assert_noop!( - PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 0), + PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, 0), Error::::ZeroAmount ); }); @@ -2218,7 +2235,7 @@ fn it_does_not_allow_buying_complete_sets_with_insufficient_balance() { ScoringRule::CPMM, ); assert_noop!( - PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 10000 * BASE), + PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, 10000 * BASE), Error::::NotEnoughBalance ); }; @@ -2241,16 +2258,16 @@ fn it_allows_to_deploy_a_pool() { ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 100 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, 100 * BASE)); assert_ok!(Balances::transfer( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), ::PalletId::get().into_account_truncating(), 100 * BASE )); assert_ok!(PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, ::MaxSwapFee::get(), LIQUIDITY, @@ -2275,9 +2292,9 @@ fn deploy_swap_pool_for_market_fails_if_market_has_a_pool() { 0..1, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 200 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, 200 * BASE)); assert_ok!(PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, ::MaxSwapFee::get(), LIQUIDITY, @@ -2285,7 +2302,7 @@ fn deploy_swap_pool_for_market_fails_if_market_has_a_pool() { )); assert_noop!( PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, ::MaxSwapFee::get(), LIQUIDITY, @@ -2309,7 +2326,7 @@ fn it_does_not_allow_to_deploy_a_pool_on_pending_advised_market() { assert_noop!( PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, ::MaxSwapFee::get(), LIQUIDITY, @@ -2332,9 +2349,9 @@ fn it_allows_to_sell_a_complete_set() { ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, CENT)); - assert_ok!(PredictionMarkets::sell_complete_set(Origin::signed(BOB), 0, CENT)); + assert_ok!(PredictionMarkets::sell_complete_set(RuntimeOrigin::signed(BOB), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); @@ -2370,7 +2387,7 @@ fn it_does_not_allow_zero_amounts_in_sell_complete_set() { ScoringRule::CPMM, ); assert_noop!( - PredictionMarkets::sell_complete_set(Origin::signed(BOB), 0, 0), + PredictionMarkets::sell_complete_set(RuntimeOrigin::signed(BOB), 0, 0), Error::::ZeroAmount ); }); @@ -2385,10 +2402,10 @@ fn it_does_not_allow_to_sell_complete_sets_with_insufficient_balance() { 0..1, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 2 * CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, 2 * CENT)); assert_eq!(AssetManager::slash(Asset::CategoricalOutcome(0, 1), &BOB, CENT), 0); assert_noop!( - PredictionMarkets::sell_complete_set(Origin::signed(BOB), 0, 2 * CENT), + PredictionMarkets::sell_complete_set(RuntimeOrigin::signed(BOB), 0, 2 * CENT), Error::::InsufficientShareBalance ); }; @@ -2421,7 +2438,7 @@ fn it_allows_to_report_the_outcome_of_a_market() { assert!(market.report.is_none()); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -2440,7 +2457,7 @@ fn it_allows_to_report_the_outcome_of_a_market() { }); assert_ok!(PredictionMarkets::report( - Origin::signed(SUDO), + RuntimeOrigin::signed(SUDO), 0, OutcomeReport::Categorical(1) )); @@ -2465,7 +2482,7 @@ fn report_fails_before_grace_period_is_over() { assert!(market.report.is_none()); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::NotAllowedToReportYet ); }); @@ -2491,12 +2508,16 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio assert!(market.report.is_none()); assert_noop!( - PredictionMarkets::report(Origin::signed(CHARLIE), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report( + RuntimeOrigin::signed(CHARLIE), + 0, + OutcomeReport::Categorical(1) + ), Error::::ReporterNotOracle ); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -2513,7 +2534,7 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duration_moment() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -2525,7 +2546,7 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio ScoringRule::CPMM )); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, CENT)); // set the timestamp let market = MarketCommons::market(&0).unwrap(); @@ -2537,11 +2558,11 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio Timestamp::set_timestamp(100_000_000 + grace_period); assert_noop!( - PredictionMarkets::report(Origin::signed(EVE), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(1)), Error::::ReporterNotOracle ); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -2562,7 +2583,7 @@ fn report_fails_on_mismatched_outcome_for_categorical_market() { let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Scalar(123)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Scalar(123)), Error::::OutcomeMismatch, ); let market = MarketCommons::market(&0).unwrap(); @@ -2585,7 +2606,7 @@ fn report_fails_on_out_of_range_outcome_for_categorical_market() { let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(2)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(2)), Error::::OutcomeMismatch, ); let market = MarketCommons::market(&0).unwrap(); @@ -2608,7 +2629,7 @@ fn report_fails_on_mismatched_outcome_for_scalar_market() { let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(0)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0)), Error::::OutcomeMismatch, ); let market = MarketCommons::market(&0).unwrap(); @@ -2634,7 +2655,7 @@ fn it_allows_to_dispute_the_outcome_of_a_market() { run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -2643,7 +2664,7 @@ fn it_allows_to_dispute_the_outcome_of_a_market() { run_to_block(dispute_at); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); @@ -2670,7 +2691,7 @@ fn dispute_fails_authority_reported_already() { ExtBuilder::default().build().execute_with(|| { let end = 2; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..end), @@ -2688,7 +2709,7 @@ fn dispute_fails_authority_reported_already() { run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -2697,13 +2718,17 @@ fn dispute_fails_authority_reported_already() { run_to_block(dispute_at); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); assert_noop!( - PredictionMarkets::dispute(Origin::signed(CHARLIE), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::dispute( + RuntimeOrigin::signed(CHARLIE), + 0, + OutcomeReport::Categorical(1) + ), AuthorizedError::::OnlyOneDisputeAllowed ); }); @@ -2725,7 +2750,7 @@ fn it_allows_anyone_to_report_an_unreported_market() { run_to_block(end + market.deadlines.grace_period + market.deadlines.oracle_duration + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(ALICE), // alice reports her own market now + RuntimeOrigin::signed(ALICE), // alice reports her own market now 0, OutcomeReport::Categorical(1), )); @@ -2757,14 +2782,14 @@ fn it_correctly_resolves_a_market_that_was_reported_on() { ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(CHARLIE), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); let report_at = end + market.deadlines.grace_period + 1; run_to_block(report_at); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -2816,14 +2841,14 @@ fn it_resolves_a_disputed_market() { ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(CHARLIE), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); let report_at = end + market.deadlines.grace_period + 1; run_to_block(report_at); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); @@ -2832,7 +2857,7 @@ fn it_resolves_a_disputed_market() { run_to_block(dispute_at_0); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); @@ -2841,7 +2866,7 @@ fn it_resolves_a_disputed_market() { run_to_block(dispute_at_1); assert_ok!(PredictionMarkets::dispute( - Origin::signed(DAVE), + RuntimeOrigin::signed(DAVE), 0, OutcomeReport::Categorical(0) )); @@ -2850,7 +2875,7 @@ fn it_resolves_a_disputed_market() { run_to_block(dispute_at_2); assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(1) )); @@ -2895,7 +2920,7 @@ fn it_resolves_a_disputed_market() { let disputes = crate::Disputes::::get(0); assert_eq!(disputes.len(), 0); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); // Make sure rewards are right: // @@ -2960,7 +2985,11 @@ fn dispute_fails_unless_reported_or_disputed_market(status: MarketStatus) { })); assert_noop!( - PredictionMarkets::dispute(Origin::signed(EVE), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::dispute( + RuntimeOrigin::signed(EVE), + 0, + OutcomeReport::Categorical(1) + ), Error::::InvalidMarketStatus ); }); @@ -2971,7 +3000,7 @@ fn start_global_dispute_works() { ExtBuilder::default().build().execute_with(|| { let end = 2; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..2), @@ -2988,7 +3017,7 @@ fn start_global_dispute_works() { let grace_period = market.deadlines.grace_period; run_to_block(end + grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Categorical(0) )); @@ -2998,18 +3027,24 @@ fn start_global_dispute_works() { if i == 1 { #[cfg(feature = "with-global-disputes")] assert_noop!( - PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), market_id), + PredictionMarkets::start_global_dispute( + RuntimeOrigin::signed(CHARLIE), + market_id + ), Error::::InvalidMarketStatus ); } else { #[cfg(feature = "with-global-disputes")] assert_noop!( - PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), market_id), + PredictionMarkets::start_global_dispute( + RuntimeOrigin::signed(CHARLIE), + market_id + ), Error::::MaxDisputesNeeded ); } assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Categorical(i.saturated_into()) )); @@ -3031,7 +3066,10 @@ fn start_global_dispute_works() { use zrml_global_disputes::GlobalDisputesPalletApi; let now = >::block_number(); - assert_ok!(PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), market_id)); + assert_ok!(PredictionMarkets::start_global_dispute( + RuntimeOrigin::signed(CHARLIE), + market_id + )); // report check assert_eq!( @@ -3061,7 +3099,7 @@ fn start_global_dispute_works() { System::assert_last_event(Event::GlobalDisputeStarted(market_id).into()); assert_noop!( - PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), market_id), + PredictionMarkets::start_global_dispute(RuntimeOrigin::signed(CHARLIE), market_id), Error::::GlobalDisputeAlreadyStarted ); } @@ -3073,7 +3111,7 @@ fn start_global_dispute_fails_on_wrong_mdm() { ExtBuilder::default().build().execute_with(|| { let end = 2; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..2), @@ -3090,7 +3128,7 @@ fn start_global_dispute_fails_on_wrong_mdm() { let grace_period = market.deadlines.grace_period; run_to_block(end + grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), market_id, OutcomeReport::Categorical(0) )); @@ -3099,7 +3137,7 @@ fn start_global_dispute_fails_on_wrong_mdm() { // only one dispute allowed for authorized mdm assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), market_id, OutcomeReport::Categorical(1u32.saturated_into()) )); @@ -3109,7 +3147,7 @@ fn start_global_dispute_fails_on_wrong_mdm() { #[cfg(feature = "with-global-disputes")] assert_noop!( - PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), market_id), + PredictionMarkets::start_global_dispute(RuntimeOrigin::signed(CHARLIE), market_id), Error::::InvalidDisputeMechanism ); }); @@ -3122,13 +3160,13 @@ fn start_global_dispute_works_without_feature() { #[cfg(not(feature = "with-global-disputes"))] assert_noop!( - PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), non_market_id), + PredictionMarkets::start_global_dispute(RuntimeOrigin::signed(CHARLIE), non_market_id), Error::::GlobalDisputesDisabled ); #[cfg(feature = "with-global-disputes")] assert_noop!( - PredictionMarkets::start_global_dispute(Origin::signed(CHARLIE), non_market_id), + PredictionMarkets::start_global_dispute(RuntimeOrigin::signed(CHARLIE), non_market_id), zrml_market_commons::Error::::MarketDoesNotExist ); }); @@ -3145,13 +3183,13 @@ fn it_allows_to_redeem_shares() { ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(CHARLIE), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -3159,7 +3197,7 @@ fn it_allows_to_redeem_shares() { let market = MarketCommons::market(&0).unwrap(); assert_eq!(market.status, MarketStatus::Resolved); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); let bal = Balances::free_balance(&CHARLIE); assert_eq!(bal, 1_000 * BASE); System::assert_last_event( @@ -3191,7 +3229,7 @@ fn create_market_and_deploy_assets_results_in_expected_balances_and_pool_params( let base_asset_weight = (category_count as u128) * weight; let total_weight = 2 * base_asset_weight; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, oracle, period, @@ -3265,7 +3303,7 @@ fn process_subsidy_activates_market_with_sufficient_subsidy() { ScoringRule::RikiddoSigmoidFeeMarketEma, ); let min_subsidy = ::MinSubsidy::get(); - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(ALICE), 0, min_subsidy)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(ALICE), 0, min_subsidy)); run_to_block(min_sub_period); let subsidy_queue = crate::MarketsCollectingSubsidy::::get(); assert_eq!(subsidy_queue.len(), 0); @@ -3295,8 +3333,8 @@ fn process_subsidy_blocks_market_with_insufficient_subsidy() { ScoringRule::RikiddoSigmoidFeeMarketEma, ); let subsidy = ::MinSubsidy::get() / 3; - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(ALICE), 0, subsidy)); - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(BOB), 0, subsidy)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(ALICE), 0, subsidy)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(BOB), 0, subsidy)); run_to_block(min_sub_period); let subsidy_queue = crate::MarketsCollectingSubsidy::::get(); assert_eq!(subsidy_queue.len(), 0); @@ -3410,14 +3448,14 @@ fn only_creator_can_edit_market() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; // Now it should work from SUDO - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + assert_ok!(PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason)); assert!(MarketIdsForEdit::::contains_key(0)); // ALICE is market creator through simple_create_categorical_market assert_noop!( PredictionMarkets::edit_market( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), Asset::Ztg, 0, CHARLIE, @@ -3452,14 +3490,14 @@ fn edit_cycle_for_proposed_markets() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; // Now it should work from SUDO - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + assert_ok!(PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason)); assert!(MarketIdsForEdit::::contains_key(0)); // BOB was the oracle before through simple_create_categorical_market // After this edit its changed to ALICE assert_ok!(PredictionMarkets::edit_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, 0, CHARLIE, @@ -3498,7 +3536,7 @@ fn edit_market_with_foreign_asset() { let edit_reason = vec![0_u8; ::MaxEditReasonLen::get() as usize]; // Now it should work from SUDO - assert_ok!(PredictionMarkets::request_edit(Origin::signed(SUDO), 0, edit_reason)); + assert_ok!(PredictionMarkets::request_edit(RuntimeOrigin::signed(SUDO), 0, edit_reason)); assert!(MarketIdsForEdit::::contains_key(0)); @@ -3506,7 +3544,7 @@ fn edit_market_with_foreign_asset() { // As per Mock asset_registry genesis ForeignAsset(50) is not registered in asset_registry. assert_noop!( PredictionMarkets::edit_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::ForeignAsset(50), 0, CHARLIE, @@ -3522,7 +3560,7 @@ fn edit_market_with_foreign_asset() { // As per Mock asset_registry genesis ForeignAsset(420) has allow_as_base_asset set to false. assert_noop!( PredictionMarkets::edit_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::ForeignAsset(420), 0, CHARLIE, @@ -3537,7 +3575,7 @@ fn edit_market_with_foreign_asset() { ); // As per Mock asset_registry genesis ForeignAsset(100) has allow_as_base_asset set to true. assert_ok!(PredictionMarkets::edit_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::ForeignAsset(100), 0, CHARLIE, @@ -3558,7 +3596,7 @@ fn the_entire_market_lifecycle_works_with_timestamps() { ExtBuilder::default().build().execute_with(|| { // Creates a permissionless market. assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -3571,7 +3609,7 @@ fn the_entire_market_lifecycle_works_with_timestamps() { )); // is ok - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); // set the timestamp @@ -3581,12 +3619,12 @@ fn the_entire_market_lifecycle_works_with_timestamps() { Timestamp::set_timestamp(100_000_000 + grace_period); assert_noop!( - PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, CENT), + PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, CENT), Error::::MarketIsNotActive, ); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -3597,7 +3635,7 @@ fn the_entire_market_lifecycle_works_with_timestamps() { fn full_scalar_market_lifecycle() { let test = |base_asset: Asset| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -3609,7 +3647,11 @@ fn full_scalar_market_lifecycle() { ScoringRule::CPMM )); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, 100 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set( + RuntimeOrigin::signed(CHARLIE), + 0, + 100 * BASE + )); // check balances let assets = PredictionMarkets::outcome_assets(0, &MarketCommons::market(&0).unwrap()); @@ -3627,7 +3669,11 @@ fn full_scalar_market_lifecycle() { Timestamp::set_timestamp(100_000_000 + grace_period); // report - assert_ok!(PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Scalar(100))); + assert_ok!(PredictionMarkets::report( + RuntimeOrigin::signed(BOB), + 0, + OutcomeReport::Scalar(100) + )); let market_after_report = MarketCommons::market(&0).unwrap(); assert!(market_after_report.report.is_some()); @@ -3637,7 +3683,11 @@ fn full_scalar_market_lifecycle() { assert_eq!(report.outcome, OutcomeReport::Scalar(100)); // dispute - assert_ok!(PredictionMarkets::dispute(Origin::signed(DAVE), 0, OutcomeReport::Scalar(25))); + assert_ok!(PredictionMarkets::dispute( + RuntimeOrigin::signed(DAVE), + 0, + OutcomeReport::Scalar(25) + )); let disputes = crate::Disputes::::get(0); assert_eq!(disputes.len(), 1); @@ -3650,7 +3700,7 @@ fn full_scalar_market_lifecycle() { // give EVE some shares assert_ok!(Tokens::transfer( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), EVE, Asset::ScalarOutcome(0, ScalarPosition::Short), 50 * BASE @@ -3661,7 +3711,7 @@ fn full_scalar_market_lifecycle() { 50 * BASE ); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); for asset in assets.iter() { let bal = Tokens::free_balance(*asset, &CHARLIE); assert_eq!(bal, 0); @@ -3693,7 +3743,7 @@ fn full_scalar_market_lifecycle() { .into(), ); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(EVE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(EVE), 0)); let base_asset_bal_eve_after = AssetManager::free_balance(base_asset, &EVE); assert_eq!(base_asset_bal_eve_after, 101250 * CENT); // 12.5 (SHORT) + 1000 (balance) System::assert_last_event( @@ -3761,7 +3811,7 @@ fn reject_market_fails_on_permissionless_market() { let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; assert_noop!( - PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason), + PredictionMarkets::reject_market(RuntimeOrigin::signed(SUDO), 0, reject_reason), Error::::InvalidMarketStatus ); }); @@ -3777,11 +3827,11 @@ fn reject_market_fails_on_approved_market() { 0..1, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let reject_reason: Vec = vec![0; ::MaxRejectReasonLen::get() as usize]; assert_noop!( - PredictionMarkets::reject_market(Origin::signed(SUDO), 0, reject_reason), + PredictionMarkets::reject_market(RuntimeOrigin::signed(SUDO), 0, reject_reason), Error::::InvalidMarketStatus ); }); @@ -3792,7 +3842,7 @@ fn market_resolve_does_not_hold_liquidity_withdraw() { ExtBuilder::default().build().execute_with(|| { let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..end), @@ -3804,22 +3854,26 @@ fn market_resolve_does_not_hold_liquidity_withdraw() { ScoringRule::CPMM )); deploy_swap_pool(MarketCommons::market(&0).unwrap(), 0).unwrap(); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(ALICE), 0, BASE)); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(BOB), 0, 2 * BASE)); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, 3 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(ALICE), 0, BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(BOB), 0, 2 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set( + RuntimeOrigin::signed(CHARLIE), + 0, + 3 * BASE + )); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(2) )); run_to_block(grace_period + market.deadlines.dispute_duration + 2); - assert_ok!(Swaps::pool_exit(Origin::signed(FRED), 0, BASE * 100, vec![0, 0])); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(BOB), 0)); + assert_ok!(Swaps::pool_exit(RuntimeOrigin::signed(FRED), 0, BASE * 100, vec![0, 0])); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(BOB), 0)); }) } @@ -3829,7 +3883,7 @@ fn authorized_correctly_resolves_disputed_market() { let test = |base_asset: Asset| { let end = 2; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -3840,13 +3894,13 @@ fn authorized_correctly_resolves_disputed_market() { MarketDisputeMechanism::Authorized, ScoringRule::CPMM, )); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, CENT)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(CHARLIE), 0, CENT)); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); @@ -3857,7 +3911,7 @@ fn authorized_correctly_resolves_disputed_market() { let dispute_at = grace_period + 1 + 1; run_to_block(dispute_at); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); @@ -3874,12 +3928,12 @@ fn authorized_correctly_resolves_disputed_market() { // Fred authorizses an outcome, but fat-fingers it on the first try. assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Categorical(0) )); assert_ok!(Authorized::authorize_market_outcome( - Origin::signed(AuthorizedDisputeResolutionUser::get()), + RuntimeOrigin::signed(AuthorizedDisputeResolutionUser::get()), 0, OutcomeReport::Categorical(1) )); @@ -3942,7 +3996,7 @@ fn authorized_correctly_resolves_disputed_market() { let disputes = crate::Disputes::::get(0); assert_eq!(disputes.len(), 0); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); if base_asset == Asset::Ztg { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); @@ -3982,7 +4036,7 @@ fn approve_market_correctly_unreserves_advisory_bond() { let test = |base_asset: Asset| { reserve_sentinel_amounts(); assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..100), @@ -3996,7 +4050,7 @@ fn approve_market_correctly_unreserves_advisory_bond() { let market_id = 0; let alice_balance_before = Balances::free_balance(&ALICE); check_reserve(&ALICE, AdvisoryBond::get() + OracleBond::get()); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), market_id)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), market_id)); check_reserve(&ALICE, OracleBond::get()); assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + AdvisoryBond::get()); let market = MarketCommons::market(&market_id).unwrap(); @@ -4020,7 +4074,7 @@ fn deploy_swap_pool_correctly_sets_weight_of_base_asset() { ::MinWeight::get() + 33, ]; assert_ok!(PredictionMarkets::create_cpmm_market_and_deploy_assets( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, ALICE, MarketPeriod::Block(0..42), @@ -4046,7 +4100,7 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_short() { ExtBuilder::default().build().execute_with(|| { let category_count = 5; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..100), @@ -4058,13 +4112,13 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_short() { ScoringRule::CPMM )); let amount = 123 * BASE; - assert_ok!(Balances::set_balance(Origin::root(), ALICE, 2 * amount, 0)); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(ALICE), 0, amount)); + assert_ok!(Balances::set_balance(RuntimeOrigin::root(), ALICE, 2 * amount, 0)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(ALICE), 0, amount)); // Attempt to create a pool with four weights; but we need five instead (base asset not // counted). assert_noop!( PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), 0, 1, amount, @@ -4083,7 +4137,7 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_long() { ExtBuilder::default().build().execute_with(|| { let category_count = 5; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(0..100), @@ -4095,13 +4149,13 @@ fn deploy_swap_pool_for_market_returns_error_if_weights_is_too_long() { ScoringRule::CPMM )); let amount = 123 * BASE; - assert_ok!(Balances::set_balance(Origin::root(), ALICE, 2 * amount, 0)); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(ALICE), 0, amount)); + assert_ok!(Balances::set_balance(RuntimeOrigin::root(), ALICE, 2 * amount, 0)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(ALICE), 0, amount)); // Attempt to create a pool with six weights; but we need five instead (base asset not // counted). assert_noop!( PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), 0, ::MaxSwapFee::get(), amount, @@ -4123,7 +4177,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4140,7 +4194,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); @@ -4168,7 +4222,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..100), @@ -4190,7 +4244,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark assert!(market.bonds.outsider.is_none()); assert_ok!(PredictionMarkets::report( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); @@ -4233,7 +4287,7 @@ fn outsider_reports_wrong_outcome() { let end = 100; let alice_balance_before = Balances::free_balance(&ALICE); assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4252,7 +4306,7 @@ fn outsider_reports_wrong_outcome() { let report_at = grace_period + market.deadlines.oracle_duration + 1; run_to_block(report_at); assert_ok!(PredictionMarkets::report( - Origin::signed(outsider), + RuntimeOrigin::signed(outsider), 0, OutcomeReport::Categorical(1) )); @@ -4263,7 +4317,7 @@ fn outsider_reports_wrong_outcome() { let dispute_at_0 = report_at + 1; run_to_block(dispute_at_0); assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(0) )); @@ -4302,7 +4356,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4313,7 +4367,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); @@ -4321,7 +4375,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma let report_at = grace_period + 1; run_to_block(report_at); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1) )); @@ -4347,7 +4401,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4358,7 +4412,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); @@ -4366,7 +4420,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma let report_at = grace_period + market.deadlines.oracle_duration + 1; run_to_block(report_at); assert_ok!(PredictionMarkets::report( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); @@ -4393,7 +4447,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4410,12 +4464,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); @@ -4442,7 +4496,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4453,19 +4507,19 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(1) )); @@ -4492,7 +4546,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4509,18 +4563,18 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); // EVE disputes with wrong outcome assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(1) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); @@ -4550,7 +4604,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4561,25 +4615,25 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(0) )); // EVE disputes with wrong outcome assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(1) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, OutcomeReport::Categorical(0) )); @@ -4606,7 +4660,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4629,7 +4683,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark run_to_block(after_oracle_duration); // CHARLIE is not an Oracle assert_ok!(PredictionMarkets::report( - Origin::signed(outsider), + RuntimeOrigin::signed(outsider), 0, OutcomeReport::Categorical(0) )); @@ -4639,12 +4693,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark // EVE disputes with wrong outcome assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(1) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(FRED), + RuntimeOrigin::signed(FRED), 0, OutcomeReport::Categorical(0) )); @@ -4677,7 +4731,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), base_asset, BOB, MarketPeriod::Block(0..end), @@ -4691,7 +4745,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma let outsider = CHARLIE; - assert_ok!(PredictionMarkets::approve_market(Origin::signed(SUDO), 0)); + assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); let alice_balance_before = Balances::free_balance(&ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); @@ -4700,7 +4754,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma run_to_block(after_oracle_duration); // CHARLIE is not an Oracle assert_ok!(PredictionMarkets::report( - Origin::signed(outsider), + RuntimeOrigin::signed(outsider), 0, OutcomeReport::Categorical(0) )); @@ -4710,12 +4764,12 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma // EVE disputes with wrong outcome assert_ok!(PredictionMarkets::dispute( - Origin::signed(EVE), + RuntimeOrigin::signed(EVE), 0, OutcomeReport::Categorical(1) )); assert_ok!(PredictionMarkets::dispute( - Origin::signed(FRED), + RuntimeOrigin::signed(FRED), 0, OutcomeReport::Categorical(0) )); @@ -4743,7 +4797,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma fn report_fails_on_market_state_proposed() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -4755,7 +4809,7 @@ fn report_fails_on_market_state_proposed() { ScoringRule::CPMM )); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4765,7 +4819,7 @@ fn report_fails_on_market_state_proposed() { fn report_fails_on_market_state_closed_for_advised_market() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -4777,7 +4831,7 @@ fn report_fails_on_market_state_closed_for_advised_market() { ScoringRule::CPMM )); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4787,7 +4841,7 @@ fn report_fails_on_market_state_closed_for_advised_market() { fn report_fails_on_market_state_collecting_subsidy() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(100_000_000..200_000_000), @@ -4799,7 +4853,7 @@ fn report_fails_on_market_state_collecting_subsidy() { ScoringRule::RikiddoSigmoidFeeMarketEma )); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4809,7 +4863,7 @@ fn report_fails_on_market_state_collecting_subsidy() { fn report_fails_on_market_state_insufficient_subsidy() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(100_000_000..200_000_000), @@ -4825,7 +4879,7 @@ fn report_fails_on_market_state_insufficient_subsidy() { Ok(()) }); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4835,7 +4889,7 @@ fn report_fails_on_market_state_insufficient_subsidy() { fn report_fails_on_market_state_active() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -4847,7 +4901,7 @@ fn report_fails_on_market_state_active() { ScoringRule::CPMM )); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4857,7 +4911,7 @@ fn report_fails_on_market_state_active() { fn report_fails_on_market_state_suspended() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -4873,7 +4927,7 @@ fn report_fails_on_market_state_suspended() { Ok(()) }); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4883,7 +4937,7 @@ fn report_fails_on_market_state_suspended() { fn report_fails_on_market_state_resolved() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -4899,7 +4953,7 @@ fn report_fails_on_market_state_resolved() { Ok(()) }); assert_noop!( - PredictionMarkets::report(Origin::signed(BOB), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, OutcomeReport::Categorical(1)), Error::::MarketIsNotClosed, ); }); @@ -4909,7 +4963,7 @@ fn report_fails_on_market_state_resolved() { fn report_fails_if_reporter_is_not_the_oracle() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -4927,7 +4981,11 @@ fn report_fails_if_reporter_is_not_the_oracle() { let grace_period: u64 = market.deadlines.grace_period * MILLISECS_PER_BLOCK as u64; set_timestamp_for_on_initialize(100_000_000 + grace_period + MILLISECS_PER_BLOCK as u64); assert_noop!( - PredictionMarkets::report(Origin::signed(CHARLIE), 0, OutcomeReport::Categorical(1)), + PredictionMarkets::report( + RuntimeOrigin::signed(CHARLIE), + 0, + OutcomeReport::Categorical(1) + ), Error::::ReporterNotOracle, ); }); @@ -4945,7 +5003,7 @@ fn create_market_succeeds_if_market_duration_is_maximal_in_blocks() { "Test failed due to misconfiguration: `MaxMarketLifetime` is too small" ); assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(start..end), @@ -4972,7 +5030,7 @@ fn create_market_suceeds_if_market_duration_is_maximal_in_moments() { "Test failed due to misconfiguration: `MaxMarketLifetime` is too small" ); assert_ok!(PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(start..end), @@ -4999,7 +5057,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_blocks() { ); assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Block(start..end), @@ -5029,7 +5087,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_moments() { ); assert_noop!( PredictionMarkets::create_market( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), Asset::Ztg, BOB, MarketPeriod::Timestamp(start..end), @@ -5085,7 +5143,7 @@ fn create_market_sets_the_correct_market_parameters_and_reserves_the_correct_amo let market_type = MarketType::Categorical(7); let dispute_mechanism = MarketDisputeMechanism::Authorized; assert_ok!(PredictionMarkets::create_market( - Origin::signed(creator), + RuntimeOrigin::signed(creator), Asset::Ztg, oracle, period.clone(), @@ -5118,15 +5176,15 @@ fn deploy_swap_pool( market: Market>, market_id: u128, ) -> DispatchResultWithPostInfo { - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(FRED), 0, 100 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(FRED), 0, 100 * BASE)); assert_ok!(Balances::transfer( - Origin::signed(FRED), + RuntimeOrigin::signed(FRED), ::PalletId::get().into_account_truncating(), 100 * BASE )); let outcome_assets_len = PredictionMarkets::outcome_assets(market_id, &market).len(); PredictionMarkets::deploy_swap_pool_for_market( - Origin::signed(FRED), + RuntimeOrigin::signed(FRED), 0, ::MaxSwapFee::get(), LIQUIDITY, @@ -5143,9 +5201,9 @@ fn scalar_market_correctly_resolves_common(base_asset: Asset, reported 0..end, ScoringRule::CPMM, ); - assert_ok!(PredictionMarkets::buy_complete_set(Origin::signed(CHARLIE), 0, 100 * BASE)); + assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(CHARLIE), 0, 100 * BASE)); assert_ok!(Tokens::transfer( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), EVE, Asset::ScalarOutcome(0, ScalarPosition::Short), 100 * BASE @@ -5156,7 +5214,7 @@ fn scalar_market_correctly_resolves_common(base_asset: Asset, reported let grace_period = end + market.deadlines.grace_period; run_to_block(grace_period + 1); assert_ok!(PredictionMarkets::report( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), 0, OutcomeReport::Scalar(reported_value) )); @@ -5176,8 +5234,8 @@ fn scalar_market_correctly_resolves_common(base_asset: Asset, reported assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 900 * BASE); assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1000 * BASE); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(CHARLIE), 0)); - assert_ok!(PredictionMarkets::redeem_shares(Origin::signed(EVE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); + assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(EVE), 0)); let assets = PredictionMarkets::outcome_assets(0, &MarketCommons::market(&0).unwrap()); for asset in assets.iter() { assert_eq!(AssetManager::free_balance(*asset, &CHARLIE), 0); diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index 4480c5ea7..6d65d7fd6 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_prediction_markets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -92,16 +92,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - fn admin_destroy_disputed_market(a: u32, d: u32, _o: u32, c: u32, r: u32) -> Weight { - Weight::from_ref_time(36_524_000) - // Standard Error: 41_000 - .saturating_add(Weight::from_ref_time(28_980_000).saturating_mul(a.into())) - // Standard Error: 473_000 - .saturating_add(Weight::from_ref_time(40_066_000).saturating_mul(d.into())) - // Standard Error: 41_000 - .saturating_add(Weight::from_ref_time(425_000).saturating_mul(c.into())) - // Standard Error: 41_000 - .saturating_add(Weight::from_ref_time(438_000).saturating_mul(r.into())) + fn admin_destroy_disputed_market(a: u32, d: u32, _o: u32, _c: u32, _r: u32) -> Weight { + Weight::from_ref_time(98_844_452) + // Standard Error: 1_524 + .saturating_add(Weight::from_ref_time(12_109_486).saturating_mul(a.into())) + // Standard Error: 17_423 + .saturating_add(Weight::from_ref_time(10_703_404).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) @@ -118,12 +114,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) - fn admin_destroy_reported_market(a: u32, _o: u32, c: u32, _r: u32) -> Weight { - Weight::from_ref_time(302_448_000) - // Standard Error: 39_000 - .saturating_add(Weight::from_ref_time(27_690_000).saturating_mul(a.into())) - // Standard Error: 39_000 - .saturating_add(Weight::from_ref_time(809_000).saturating_mul(c.into())) + fn admin_destroy_reported_market(a: u32, _o: u32, _c: u32, r: u32) -> Weight { + Weight::from_ref_time(101_907_522) + // Standard Error: 2_150 + .saturating_add(Weight::from_ref_time(11_991_328).saturating_mul(a.into())) + // Standard Error: 2_139 + .saturating_add(Weight::from_ref_time(19_182).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(8)) @@ -133,11 +129,14 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_closed(_o: u32, c: u32) -> Weight { - Weight::from_ref_time(62_951_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(69_000).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Storage: Timestamp Now (r:1 w:0) + fn admin_move_market_to_closed(o: u32, c: u32) -> Weight { + Weight::from_ref_time(29_677_109) + // Standard Error: 266 + .saturating_add(Weight::from_ref_time(8_751).saturating_mul(o.into())) + // Standard Error: 266 + .saturating_add(Weight::from_ref_time(20_949).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: MarketCommons Markets (r:1 w:1) @@ -145,8 +144,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: PredictionMarkets Disputes (r:0 w:1) - fn admin_move_market_to_resolved_scalar_reported(_r: u32) -> Weight { - Weight::from_ref_time(107_834_000) + fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight { + Weight::from_ref_time(47_236_897) + // Standard Error: 334 + .saturating_add(Weight::from_ref_time(14_850).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -157,9 +158,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight { - Weight::from_ref_time(171_263_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(12_000).saturating_mul(r.into())) + Weight::from_ref_time(82_465_110) + // Standard Error: 390 + .saturating_add(Weight::from_ref_time(24_567).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -172,7 +173,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn admin_move_market_to_resolved_scalar_disputed(_r: u32) -> Weight { - Weight::from_ref_time(174_434_000) + Weight::from_ref_time(77_566_793) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -186,9 +187,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_move_market_to_resolved_categorical_disputed(r: u32) -> Weight { - Weight::from_ref_time(226_823_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(85_000).saturating_mul(r.into())) + Weight::from_ref_time(111_553_988) + // Standard Error: 510 + .saturating_add(Weight::from_ref_time(24_763).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(8)) } @@ -196,16 +197,16 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:0) // Storage: Balances Reserves (r:1 w:1) fn approve_market() -> Weight { - Weight::from_ref_time(71_421_000) + Weight::from_ref_time(30_750_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) fn request_edit(r: u32) -> Weight { - Weight::from_ref_time(40_894_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(r.into())) + Weight::from_ref_time(16_505_286) + // Standard Error: 17 + .saturating_add(Weight::from_ref_time(957).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -214,9 +215,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn buy_complete_set(a: u32) -> Weight { - Weight::from_ref_time(79_725_000) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(19_896_000).saturating_mul(a.into())) + Weight::from_ref_time(34_786_131) + // Standard Error: 1_751 + .saturating_add(Weight::from_ref_time(8_388_765).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -228,9 +229,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons Markets (r:0 w:1) fn create_market(m: u32) -> Weight { - Weight::from_ref_time(80_436_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(9_000).saturating_mul(m.into())) + Weight::from_ref_time(31_590_932) + // Standard Error: 536 + .saturating_add(Weight::from_ref_time(19_431).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -239,9 +240,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn edit_market(m: u32) -> Weight { - Weight::from_ref_time(68_686_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(150_000).saturating_mul(m.into())) + Weight::from_ref_time(27_792_538) + // Standard Error: 342 + .saturating_add(Weight::from_ref_time(27_261).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -255,11 +256,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_future_pool(a: u32, o: u32) -> Weight { - Weight::from_ref_time(170_533_000) - // Standard Error: 45_000 - .saturating_add(Weight::from_ref_time(32_842_000).saturating_mul(a.into())) - // Standard Error: 45_000 - .saturating_add(Weight::from_ref_time(145_000).saturating_mul(o.into())) + Weight::from_ref_time(62_202_136) + // Standard Error: 1_823 + .saturating_add(Weight::from_ref_time(13_956_712).saturating_mul(a.into())) + // Standard Error: 1_814 + .saturating_add(Weight::from_ref_time(50_205).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(7)) @@ -274,9 +275,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_open_pool(a: u32) -> Weight { - Weight::from_ref_time(100_840_000) - // Standard Error: 52_000 - .saturating_add(Weight::from_ref_time(35_669_000).saturating_mul(a.into())) + Weight::from_ref_time(67_257_811) + // Standard Error: 2_495 + .saturating_add(Weight::from_ref_time(13_993_256).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -288,11 +289,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:7 w:7) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) fn start_global_dispute(m: u32, n: u32) -> Weight { - Weight::from_ref_time(128_368_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(8_000).saturating_mul(m.into())) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(96_000).saturating_mul(n.into())) + Weight::from_ref_time(59_605_523) + // Standard Error: 335 + .saturating_add(Weight::from_ref_time(8_254).saturating_mul(m.into())) + // Standard Error: 335 + .saturating_add(Weight::from_ref_time(13_974).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(10)) } @@ -300,7 +301,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) fn dispute_authorized() -> Weight { - Weight::from_ref_time(73_020_000) + Weight::from_ref_time(32_360_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -308,7 +309,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn handle_expired_advised_market() -> Weight { - Weight::from_ref_time(82_180_000) + Weight::from_ref_time(33_141_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -318,7 +319,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) fn internal_resolve_categorical_reported() -> Weight { - Weight::from_ref_time(145_420_000) + Weight::from_ref_time(70_937_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -330,7 +331,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn internal_resolve_categorical_disputed() -> Weight { - Weight::from_ref_time(191_701_000) + Weight::from_ref_time(94_028_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -339,7 +340,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: PredictionMarkets Disputes (r:0 w:1) fn internal_resolve_scalar_reported() -> Weight { - Weight::from_ref_time(88_350_000) + Weight::from_ref_time(35_443_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -351,7 +352,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn internal_resolve_scalar_disputed() -> Weight { - Weight::from_ref_time(133_121_000) + Weight::from_ref_time(60_764_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -365,15 +366,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn on_initialize_resolve_overhead() -> Weight { - Weight::from_ref_time(38_470_000) + Weight::from_ref_time(14_258_000) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_raw(a: u32) -> Weight { - Weight::from_ref_time(8_741_000) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(268_000).saturating_mul(a.into())) + Weight::from_ref_time(3_089_324) + // Standard Error: 547 + .saturating_add(Weight::from_ref_time(97_367).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -382,7 +383,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn redeem_shares_categorical() -> Weight { - Weight::from_ref_time(118_191_000) + Weight::from_ref_time(57_384_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -391,7 +392,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn redeem_shares_scalar() -> Weight { - Weight::from_ref_time(149_560_000) + Weight::from_ref_time(60_727_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -400,20 +401,24 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) - fn reject_market(c: u32, _o: u32, r: u32) -> Weight { - Weight::from_ref_time(126_400_000) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(c.into())) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000).saturating_mul(r.into())) + fn reject_market(c: u32, o: u32, r: u32) -> Weight { + Weight::from_ref_time(51_879_457) + // Standard Error: 358 + .saturating_add(Weight::from_ref_time(22_537).saturating_mul(c.into())) + // Standard Error: 358 + .saturating_add(Weight::from_ref_time(12_584).saturating_mul(o.into())) + // Standard Error: 22 + .saturating_add(Weight::from_ref_time(475).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - fn report(_m: u32) -> Weight { - Weight::from_ref_time(58_983_000) + fn report(m: u32) -> Weight { + Weight::from_ref_time(23_497_754) + // Standard Error: 338 + .saturating_add(Weight::from_ref_time(6_734).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -422,9 +427,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn sell_complete_set(a: u32) -> Weight { - Weight::from_ref_time(54_681_000) - // Standard Error: 40_000 - .saturating_add(Weight::from_ref_time(27_784_000).saturating_mul(a.into())) + Weight::from_ref_time(35_416_984) + // Standard Error: 1_858 + .saturating_add(Weight::from_ref_time(11_608_572).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -437,9 +442,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn start_subsidy(a: u32) -> Weight { - Weight::from_ref_time(56_316_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(110_000).saturating_mul(a.into())) + Weight::from_ref_time(23_573_263) + // Standard Error: 226 + .saturating_add(Weight::from_ref_time(42_261).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -447,11 +452,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) fn market_status_manager(b: u32, f: u32) -> Weight { - Weight::from_ref_time(59_397_000) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(3_327_000).saturating_mul(b.into())) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(3_297_000).saturating_mul(f.into())) + Weight::from_ref_time(27_286_425) + // Standard Error: 1_160 + .saturating_add(Weight::from_ref_time(1_511_142).saturating_mul(b.into())) + // Standard Error: 1_160 + .saturating_add(Weight::from_ref_time(1_501_105).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) @@ -461,11 +466,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn market_resolution_manager(r: u32, d: u32) -> Weight { - Weight::from_ref_time(62_079_000) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(3_374_000).saturating_mul(r.into())) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(3_206_000).saturating_mul(d.into())) + Weight::from_ref_time(25_238_195) + // Standard Error: 767 + .saturating_add(Weight::from_ref_time(1_555_436).saturating_mul(r.into())) + // Standard Error: 767 + .saturating_add(Weight::from_ref_time(1_589_138).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) @@ -473,7 +478,7 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_dummy() -> Weight { - Weight::from_ref_time(7_620_000) + Weight::from_ref_time(2_968_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index 3946c36d8..cd0f49627 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -1,16 +1,16 @@ [dependencies] arbitrary = { version = "1.0.1", features = ["derive"], optional = true } cfg-if = { version = "1.0.0", default-features = false } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } hashbrown = { default-features = true, version = "0.11" } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-core = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-core = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } substrate-fixed = { default-features = false, features = ["serde"], git = "https://github.com/encointer/substrate-fixed" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } diff --git a/zrml/rikiddo/fuzz/Cargo.toml b/zrml/rikiddo/fuzz/Cargo.toml index a01f8a121..5c28dfedf 100644 --- a/zrml/rikiddo/fuzz/Cargo.toml +++ b/zrml/rikiddo/fuzz/Cargo.toml @@ -72,8 +72,8 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } libfuzzer-sys = "0.4" substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" } zrml-rikiddo = { features = ["arbitrary", "mock"], path = ".." } diff --git a/zrml/rikiddo/src/mock.rs b/zrml/rikiddo/src/mock.rs index 3b951a497..d6459020c 100644 --- a/zrml/rikiddo/src/mock.rs +++ b/zrml/rikiddo/src/mock.rs @@ -59,7 +59,7 @@ construct_runtime!( { Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, Rikiddo: crate::{Pallet, Storage}, - System: frame_system::{Config, Event, Pallet, Storage}, + System: frame_system::{Call, Config, Event, Pallet, Storage}, Timestamp: pallet_timestamp::{Call, Pallet, Storage, Inherent}, } ); @@ -87,9 +87,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -99,7 +99,7 @@ impl frame_system::Config for Runtime { type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -110,7 +110,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MaxReserves = MaxReserves; type ExistentialDeposit = ExistentialDeposit; type MaxLocks = (); diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index d6b6ede2b..80aa46782 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -1,17 +1,17 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-market-commons = { default-features = false, path = "../market-commons" } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index fb4308b53..1527fe58e 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -68,7 +68,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// Event - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type DisputeResolution: DisputeResolutionApi< AccountId = Self::AccountId, @@ -141,7 +141,7 @@ mod pallet { type BlockNumber = T::BlockNumber; type MarketId = MarketIdOf; type Moment = MomentOf; - type Origin = T::Origin; + type Origin = T::RuntimeOrigin; fn on_dispute( disputes: &[MarketDispute], diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index af96ecece..c0848647b 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -102,7 +102,7 @@ impl DisputeResolutionApi for NoopResolution { } impl crate::Config for Runtime { - type Event = (); + type RuntimeEvent = (); type DisputeResolution = NoopResolution; type MarketCommons = MarketCommons; type PalletId = SimpleDisputesPalletId; @@ -116,9 +116,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = (); + type RuntimeEvent = (); type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -127,7 +127,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -139,7 +139,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = (); + type RuntimeEvent = (); type ExistentialDeposit = (); type MaxLocks = (); type MaxReserves = MaxReserves; diff --git a/zrml/styx/Cargo.toml b/zrml/styx/Cargo.toml index ee233d4ff..70873adf2 100644 --- a/zrml/styx/Cargo.toml +++ b/zrml/styx/Cargo.toml @@ -1,16 +1,16 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } [dev-dependencies] -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate" } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, features = ["mock"], path = "../../primitives" } [features] diff --git a/zrml/styx/src/lib.rs b/zrml/styx/src/lib.rs index d1a6164e0..e00713303 100644 --- a/zrml/styx/src/lib.rs +++ b/zrml/styx/src/lib.rs @@ -38,9 +38,9 @@ pub mod pallet { #[pallet::config] pub trait Config: frame_system::Config { /// The origin that is allowed to set the amount burned when crossing Styx. - type SetBurnAmountOrigin: EnsureOrigin; + type SetBurnAmountOrigin: EnsureOrigin; - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; type Currency: Currency; diff --git a/zrml/styx/src/mock.rs b/zrml/styx/src/mock.rs index b147fe247..80dd2a2f8 100644 --- a/zrml/styx/src/mock.rs +++ b/zrml/styx/src/mock.rs @@ -53,7 +53,7 @@ construct_runtime!( impl crate::Config for Runtime { type Currency = Balances; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type SetBurnAmountOrigin = EnsureSignedBy; type WeightInfo = zrml_styx::weights::WeightInfo; } @@ -66,9 +66,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -77,7 +77,7 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -89,7 +89,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = (); type MaxLocks = (); type MaxReserves = MaxReserves; diff --git a/zrml/styx/src/tests.rs b/zrml/styx/src/tests.rs index 32b1fb1e1..20988d223 100644 --- a/zrml/styx/src/tests.rs +++ b/zrml/styx/src/tests.rs @@ -26,7 +26,7 @@ fn cross_slashes_funds_and_stores_crossing() { frame_system::Pallet::::set_block_number(1); let burn_amount = crate::BurnAmount::::get(); let original_balance = Balances::free_balance(&ALICE); - assert_ok!(Styx::cross(Origin::signed(ALICE))); + assert_ok!(Styx::cross(RuntimeOrigin::signed(ALICE))); let balance_after_crossing = Balances::free_balance(&ALICE); let diff = original_balance - balance_after_crossing; assert!(Crossings::::contains_key(ALICE)); @@ -38,8 +38,11 @@ fn cross_slashes_funds_and_stores_crossing() { fn account_should_only_be_able_to_cross_once() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - assert_ok!(Styx::cross(Origin::signed(ALICE))); - assert_noop!(Styx::cross(Origin::signed(ALICE)), Error::::HasAlreadyCrossed); + assert_ok!(Styx::cross(RuntimeOrigin::signed(ALICE))); + assert_noop!( + Styx::cross(RuntimeOrigin::signed(ALICE)), + Error::::HasAlreadyCrossed + ); }); } @@ -47,7 +50,7 @@ fn account_should_only_be_able_to_cross_once() { fn should_set_burn_amount() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - assert_ok!(Styx::set_burn_amount(Origin::signed(SUDO), 144u128)); + assert_ok!(Styx::set_burn_amount(RuntimeOrigin::signed(SUDO), 144u128)); System::assert_last_event(Event::CrossingFeeChanged(144u128).into()); assert_eq!(crate::BurnAmount::::get(), 144u128); }); @@ -57,7 +60,7 @@ fn should_set_burn_amount() { fn set_burn_amount_should_fail_with_unathorized_caller() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - assert_noop!(Styx::set_burn_amount(Origin::signed(9999), 144u128), BadOrigin); + assert_noop!(Styx::set_burn_amount(RuntimeOrigin::signed(9999), 144u128), BadOrigin); }); } @@ -65,9 +68,9 @@ fn set_burn_amount_should_fail_with_unathorized_caller() { fn account_should_not_cross_without_sufficient_funds() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - assert_ok!(Balances::set_balance(Origin::root(), ALICE, 0, 0)); + assert_ok!(Balances::set_balance(RuntimeOrigin::root(), ALICE, 0, 0)); assert_noop!( - Styx::cross(Origin::signed(ALICE)), + Styx::cross(RuntimeOrigin::signed(ALICE)), Error::::FundDoesNotHaveEnoughFreeBalance ); }); @@ -77,7 +80,7 @@ fn account_should_not_cross_without_sufficient_funds() { fn should_emit_account_crossed_event_with_correct_value() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - assert_ok!(Styx::cross(Origin::signed(ALICE))); + assert_ok!(Styx::cross(RuntimeOrigin::signed(ALICE))); System::assert_last_event( Event::AccountCrossed(ALICE, crate::BurnAmount::::get()).into(), ); diff --git a/zrml/styx/src/weights.rs b/zrml/styx/src/weights.rs index 76ca25625..c86b694fb 100644 --- a/zrml/styx/src/weights.rs +++ b/zrml/styx/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_styx //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -56,12 +56,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Styx Crossings (r:1 w:1) // Storage: Styx BurnAmount (r:1 w:0) fn cross() -> Weight { - Weight::from_ref_time(54_610_000) + Weight::from_ref_time(23_072_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Styx BurnAmount (r:0 w:1) fn set_burn_amount() -> Weight { - Weight::from_ref_time(22_410_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(9_025_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index 051aca111..5ddf3aae3 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -1,11 +1,11 @@ [dependencies] -frame-benchmarking = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, optional = true, git = "https://github.com/zeitgeistpm/substrate" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -frame-system = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +frame-benchmarking = { branch = "polkadot-v0.9.32", default-features = false, optional = true, git = "https://github.com/paritytech/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +frame-system = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" } zeitgeist-primitives = { default-features = false, path = "../../primitives" } zrml-liquidity-mining = { default-features = false, path = "../liquidity-mining" } @@ -14,12 +14,12 @@ zrml-rikiddo = { default-features = false, path = "../rikiddo" } # Mock -orml-currencies = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -orml-tokens = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/open-runtime-module-library", optional = true } -pallet-balances = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -pallet-timestamp = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } -sp-io = { branch = "moonbeam-polkadot-v0.9.29", git = "https://github.com/zeitgeistpm/substrate", optional = true } +orml-currencies = { branch = "polkadot-v0.9.32", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +orml-tokens = { branch = "polkadot-v0.9.32", git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } +pallet-balances = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +pallet-timestamp = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sp-api = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } +sp-io = { branch = "polkadot-v0.9.32", git = "https://github.com/paritytech/substrate", optional = true } zrml-swaps-runtime-api = { optional = true, path = "./runtime-api" } [dev-dependencies] diff --git a/zrml/swaps/fuzz/Cargo.toml b/zrml/swaps/fuzz/Cargo.toml index 430efcd92..900ff87a3 100644 --- a/zrml/swaps/fuzz/Cargo.toml +++ b/zrml/swaps/fuzz/Cargo.toml @@ -54,11 +54,11 @@ test = false [dependencies] arbitrary = { features = ["derive"], version = "1.0" } -frame-support = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +frame-support = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } libfuzzer-sys = "0.4" -orml-traits = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/open-runtime-module-library" } +orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library" } rand = "0.8.4" -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { features = ["mock"], path = "../../../primitives" } zrml-swaps = { features = ["mock"], path = ".." } diff --git a/zrml/swaps/fuzz/pool_exit.rs b/zrml/swaps/fuzz/pool_exit.rs index 20489be31..5b0c6e7be 100644 --- a/zrml/swaps/fuzz/pool_exit.rs +++ b/zrml/swaps/fuzz/pool_exit.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; mod utils; use orml_traits::currency::MultiCurrency; @@ -47,7 +47,7 @@ fuzz_target!(|data: GeneralPoolData| { data.pool_amount, ); let _ = Swaps::pool_exit( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, data.pool_amount, data.asset_bounds, diff --git a/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs b/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs index b57329429..9f983b131 100644 --- a/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs +++ b/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; mod utils; use orml_traits::currency::MultiCurrency; @@ -49,7 +49,7 @@ fuzz_target!(|data: ExactAssetAmountData| { data.pool_amount, ); let _ = Swaps::pool_exit_with_exact_asset_amount( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, construct_asset(data.asset), data.asset_amount, diff --git a/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs b/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs index 3de0eb4b7..a583da30e 100644 --- a/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs +++ b/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; mod utils; use orml_traits::currency::MultiCurrency; @@ -48,7 +48,7 @@ fuzz_target!(|data: ExactAmountData| { data.pool_amount, ); let _ = Swaps::pool_exit_with_exact_pool_amount( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, construct_asset(data.asset), data.pool_amount, diff --git a/zrml/swaps/fuzz/pool_join.rs b/zrml/swaps/fuzz/pool_join.rs index 18d28234d..76a1bf87c 100644 --- a/zrml/swaps/fuzz/pool_join.rs +++ b/zrml/swaps/fuzz/pool_join.rs @@ -21,7 +21,7 @@ use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::GeneralPoolData; -use zrml_swaps::mock::{ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; mod utils; use utils::construct_asset; use zrml_swaps::mock::AssetManager; @@ -41,7 +41,7 @@ fuzz_target!(|data: GeneralPoolData| { let pool_id = data.pool_creation.create_pool(); // join a pool with a valid pool id let _ = Swaps::pool_join( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, data.pool_amount, data.asset_bounds, diff --git a/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs b/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs index 3b317472b..91f1808d6 100644 --- a/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs +++ b/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; use utils::ExactAssetAmountData; mod utils; @@ -41,7 +41,7 @@ fuzz_target!(|data: ExactAssetAmountData| { } let pool_id = data.pool_creation.create_pool(); let _ = Swaps::pool_join_with_exact_asset_amount( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, construct_asset(data.asset), data.asset_amount, diff --git a/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs b/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs index 6da473ee4..f480592dd 100644 --- a/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs +++ b/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; use utils::ExactAmountData; mod utils; @@ -41,7 +41,7 @@ fuzz_target!(|data: ExactAmountData| { } let pool_id = data.pool_creation.create_pool(); let _ = Swaps::pool_join_with_exact_pool_amount( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, construct_asset(data.asset), data.pool_amount, diff --git a/zrml/swaps/fuzz/swap_exact_amount_in.rs b/zrml/swaps/fuzz/swap_exact_amount_in.rs index 40d7a92c9..4aba80d2f 100644 --- a/zrml/swaps/fuzz/swap_exact_amount_in.rs +++ b/zrml/swaps/fuzz/swap_exact_amount_in.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{AssetManager, ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{AssetManager, ExtBuilder, RuntimeOrigin, Swaps}; use utils::SwapExactAmountInData; mod utils; @@ -44,7 +44,7 @@ fuzz_target!(|data: SwapExactAmountInData| { data.asset_amount_in, ); let _ = Swaps::swap_exact_amount_in( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, construct_asset(data.asset_in), data.asset_amount_in, diff --git a/zrml/swaps/fuzz/swap_exact_amount_out.rs b/zrml/swaps/fuzz/swap_exact_amount_out.rs index 32e9162b5..93eab4325 100644 --- a/zrml/swaps/fuzz/swap_exact_amount_out.rs +++ b/zrml/swaps/fuzz/swap_exact_amount_out.rs @@ -18,7 +18,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{AssetManager, ExtBuilder, Origin, Swaps}; +use zrml_swaps::mock::{AssetManager, ExtBuilder, RuntimeOrigin, Swaps}; mod utils; use orml_traits::currency::MultiCurrency; @@ -43,7 +43,7 @@ fuzz_target!(|data: SwapExactAmountOutData| { } let _ = Swaps::swap_exact_amount_out( - Origin::signed(data.origin), + RuntimeOrigin::signed(data.origin), pool_id, construct_asset(data.asset_in), data.asset_amount_in, diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index 640a11a10..dcb0ce1d5 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -1,9 +1,9 @@ [dependencies] jsonrpsee = { version = "0.15.1", features = ["server", "macros"] } parity-scale-codec = { default-features = false, version = "3.0.0" } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-blockchain = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-blockchain = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } zrml-swaps-runtime-api = { default-features = false, features = ["std"], path = "../runtime-api" } diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index 78023b6cf..67f337c10 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -1,7 +1,7 @@ [dependencies] parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } -sp-api = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } -sp-runtime = { branch = "moonbeam-polkadot-v0.9.29", default-features = false, git = "https://github.com/zeitgeistpm/substrate" } +sp-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } [features] diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index 22038d993..f2b194dd2 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -50,7 +50,7 @@ use zrml_market_commons::MarketCommonsPalletApi; const LIQUIDITY: u128 = 100 * BASE; -fn assert_last_event(generic_event: ::Event) { +fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index a386c0731..274fa9d09 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -757,7 +757,7 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type Event: From> + IsType<::Event>; + type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The fee for exiting a pool. #[pallet::constant] @@ -1094,7 +1094,7 @@ mod pallet { #[pallet::hooks] impl Hooks for Pallet { fn on_idle(_: T::BlockNumber, remaining_weight: Weight) -> Weight { - if remaining_weight < ON_IDLE_MIN_WEIGHT { + if remaining_weight.all_lt(ON_IDLE_MIN_WEIGHT) { return Weight::zero(); } Self::execute_arbitrage_all(remaining_weight / 2) diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index 8e781e972..8d77ca50e 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -85,7 +85,7 @@ construct_runtime!( pub type AssetManager = Currencies; impl crate::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExitFee = ExitFeeMock; type FixedTypeU = ::FixedTypeU; type FixedTypeS = ::FixedTypeS; @@ -115,9 +115,9 @@ impl frame_system::Config for Runtime { type BlockLength = (); type BlockNumber = BlockNumber; type BlockWeights = (); - type Call = Call; + type RuntimeCall = RuntimeCall; type DbWeight = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; type Header = Header; @@ -127,7 +127,7 @@ impl frame_system::Config for Runtime { type OnKilledAccount = (); type OnNewAccount = (); type OnSetCode = (); - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); @@ -146,13 +146,11 @@ impl orml_tokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; - type OnDust = (); - type OnKilledTokenAccount = (); - type OnNewTokenAccount = (); + type CurrencyHooks = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); } @@ -161,7 +159,7 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; @@ -170,7 +168,7 @@ impl pallet_balances::Config for Runtime { } impl zrml_liquidity_mining::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type MarketId = MarketId; type PalletId = LiquidityMiningPalletId; diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index 6e41b8d69..3b33b495b 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -406,7 +406,7 @@ fn destroy_pool_in_subsidy_phase_returns_subsidy_and_closes_pool() { // Reserve some funds for subsidy assert_ok!(Swaps::pool_join_subsidy(alice_signed(), pool_id, _25)); assert_ok!(Currencies::deposit(ASSET_D, &BOB, _26)); - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(BOB), pool_id, _26)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(BOB), pool_id, _26)); assert_eq!(Currencies::reserved_balance(ASSET_D, &ALICE), _25); assert_eq!(Currencies::reserved_balance(ASSET_D, &BOB), _26); @@ -438,7 +438,7 @@ fn distribute_pool_share_rewards() { subsidy_providers.iter().for_each(|provider| { assert_ok!(Currencies::deposit(base_asset, provider, subsidy_per_acc)); assert_ok!(Swaps::pool_join_subsidy( - Origin::signed(*provider), + RuntimeOrigin::signed(*provider), pool_id, subsidy_per_acc )); @@ -452,7 +452,7 @@ fn distribute_pool_share_rewards() { asset_holders.iter().for_each(|asset_holder| { assert_ok!(Currencies::deposit(base_asset, asset_holder, asset_per_acc + 20)); assert_ok!(Swaps::swap_exact_amount_out( - Origin::signed(*asset_holder), + RuntimeOrigin::signed(*asset_holder), pool_id, base_asset, Some(asset_per_acc + 20), @@ -514,8 +514,8 @@ fn end_subsidy_phase_distributes_shares_and_outcome_assets() { let subsidy_bob = min_subsidy + _25; assert_ok!(Currencies::deposit(ASSET_D, &ALICE, subsidy_alice)); assert_ok!(Currencies::deposit(ASSET_D, &BOB, subsidy_bob)); - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(ALICE), pool_id, min_subsidy)); - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(BOB), pool_id, subsidy_bob)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(ALICE), pool_id, min_subsidy)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(BOB), pool_id, subsidy_bob)); assert!(Swaps::end_subsidy_phase(pool_id).unwrap().result); // Check that subsidy was deposited, shares were distributed in exchange, the initial @@ -621,7 +621,7 @@ fn pool_join_fails_if_pool_is_closed() { let pool_id = 0; assert_ok!(Swaps::close_pool(pool_id)); assert_noop!( - Swaps::pool_join(Origin::signed(ALICE), pool_id, _1, vec![_1, _1, _1, _1]), + Swaps::pool_join(RuntimeOrigin::signed(ALICE), pool_id, _1, vec![_1, _1, _1, _1]), crate::Error::::InvalidPoolStatus, ); }); @@ -645,7 +645,7 @@ fn most_operations_fail_if_pool_is_clean() { )); assert_noop!( - Swaps::pool_join(Origin::signed(ALICE), pool_id, _1, vec![_10]), + Swaps::pool_join(RuntimeOrigin::signed(ALICE), pool_id, _1, vec![_10]), crate::Error::::InvalidPoolStatus, ); assert_noop!( @@ -825,7 +825,7 @@ fn pool_exit_with_exact_asset_amount_satisfies_max_out_ratio_constraints() { assert_noop!( Swaps::pool_exit_with_exact_asset_amount( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), pool_id, ASSET_A, _50, @@ -860,7 +860,7 @@ fn pool_exit_with_exact_pool_amount_satisfies_max_in_ratio_constraints() { assert_noop!( Swaps::pool_exit_with_exact_pool_amount( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), pool_id, ASSET_A, _50, @@ -1055,7 +1055,7 @@ fn pool_exit_emits_correct_events() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); create_initial_pool_with_funds_for_alice(ScoringRule::CPMM, Some(0), true); - assert_ok!(Swaps::pool_exit(Origin::signed(BOB), 0, _1, vec!(1, 2, 3, 4),)); + assert_ok!(Swaps::pool_exit(RuntimeOrigin::signed(BOB), 0, _1, vec!(1, 2, 3, 4),)); let amount = _1 - BASE / 10; // Subtract 10% fees! System::assert_last_event( Event::PoolExit(PoolAssetsEvent { @@ -1076,7 +1076,7 @@ fn pool_exit_decreases_correct_pool_parameters_with_exit_fee() { frame_system::Pallet::::set_block_number(1); create_initial_pool_with_funds_for_alice(ScoringRule::CPMM, Some(0), true); - assert_ok!(Swaps::pool_exit(Origin::signed(BOB), 0, _10, vec!(_1, _1, _1, _1),)); + assert_ok!(Swaps::pool_exit(RuntimeOrigin::signed(BOB), 0, _10, vec!(_1, _1, _1, _1),)); let pool_account = Swaps::pool_account_id(&0); let pool_shares_id = Swaps::pool_shares_id(0); @@ -1115,7 +1115,11 @@ fn pool_exit_decreases_correct_pool_parameters_on_cleaned_up_pool() { assert_ok!(Swaps::pool_join(alice_signed(), 0, _1, vec!(_1, _1, _1, _1),)); assert_ok!(Swaps::close_pool(0)); - assert_ok!(Swaps::admin_clean_up_pool(Origin::root(), 0, OutcomeReport::Categorical(65),)); + assert_ok!(Swaps::admin_clean_up_pool( + RuntimeOrigin::root(), + 0, + OutcomeReport::Categorical(65), + )); assert_ok!(Swaps::pool_exit(alice_signed(), 0, _1, vec!(_1, _1),)); System::assert_last_event( @@ -2285,12 +2289,12 @@ fn join_pool_exit_pool_does_not_create_extra_tokens() { let amount = 123_456_789_123; // Strange number to force rounding errors! assert_ok!(Swaps::pool_join( - Origin::signed(CHARLIE), + RuntimeOrigin::signed(CHARLIE), 0, amount, vec![_10000, _10000, _10000, _10000] )); - assert_ok!(Swaps::pool_exit(Origin::signed(CHARLIE), 0, amount, vec![0, 0, 0, 0])); + assert_ok!(Swaps::pool_exit(RuntimeOrigin::signed(CHARLIE), 0, amount, vec![0, 0, 0, 0])); // Check that the pool retains more tokens than before, and that Charlie loses some tokens // due to fees. @@ -2684,7 +2688,7 @@ fn single_asset_join_and_exit_are_inverse() { let pool_id = 0; assert_ok!(Currencies::deposit(asset, &ALICE, amount_in)); assert_ok!(Swaps::pool_join_with_exact_asset_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, asset, amount_in, @@ -2692,7 +2696,7 @@ fn single_asset_join_and_exit_are_inverse() { )); let pool_amount = Currencies::free_balance(Swaps::pool_shares_id(pool_id), &ALICE); assert_ok!(Swaps::pool_exit_with_exact_pool_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, asset, pool_amount, @@ -2721,7 +2725,7 @@ fn single_asset_operations_are_equivalent_to_swaps() { let pool_id = 0; assert_ok!(Currencies::deposit(asset_in, &ALICE, amount_in)); assert_ok!(Swaps::pool_join_with_exact_asset_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, asset_in, amount_in, @@ -2729,7 +2733,7 @@ fn single_asset_operations_are_equivalent_to_swaps() { )); let pool_amount = Currencies::free_balance(Swaps::pool_shares_id(pool_id), &ALICE); assert_ok!(Swaps::pool_exit_with_exact_pool_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, asset_out, pool_amount, @@ -2743,7 +2747,7 @@ fn single_asset_operations_are_equivalent_to_swaps() { let pool_id = 0; assert_ok!(Currencies::deposit(asset_in, &ALICE, amount_in)); assert_ok!(Swaps::swap_exact_amount_in( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, asset_in, amount_in, @@ -2766,7 +2770,7 @@ fn pool_join_with_uneven_balances() { let pool_id = 0; let pool_account_id = Swaps::pool_account_id(&pool_id); assert_ok!(Currencies::deposit(ASSET_A, &pool_account_id, _50)); - assert_ok!(Swaps::pool_join(Origin::signed(ALICE), pool_id, _10, vec![_100; 4])); + assert_ok!(Swaps::pool_join(RuntimeOrigin::signed(ALICE), pool_id, _10, vec![_100; 4])); assert_eq!(Currencies::free_balance(ASSET_A, &pool_account_id), _165); assert_eq!(Currencies::free_balance(ASSET_B, &pool_account_id), _110); assert_eq!(Currencies::free_balance(ASSET_C, &pool_account_id), _110); @@ -2807,7 +2811,7 @@ fn pool_exit_fails_if_balances_drop_too_low() { // We withdraw 99% of it, leaving 0.01 of each asset, which is below minimum balance. assert_noop!( - Swaps::pool_exit(Origin::signed(BOB), pool_id, _10, vec![0; 4]), + Swaps::pool_exit(RuntimeOrigin::signed(BOB), pool_id, _10, vec![0; 4]), crate::Error::::PoolDrain, ); }); @@ -2832,7 +2836,7 @@ fn pool_exit_fails_if_liquidity_drops_too_low() { // We withdraw too much liquidity but leave enough of each asset. assert_noop!( Swaps::pool_exit( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), pool_id, _100 - Swaps::min_balance(Swaps::pool_shares_id(pool_id)) + 1, vec![0; 4] @@ -2874,7 +2878,7 @@ fn swap_exact_amount_in_fails_if_balances_drop_too_low() { assert_noop!( Swaps::swap_exact_amount_in( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, Swaps::min_balance(ASSET_A) / 10, @@ -2919,7 +2923,7 @@ fn swap_exact_amount_out_fails_if_balances_drop_too_low() { assert_noop!( Swaps::swap_exact_amount_out( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, Some(u128::MAX), @@ -2963,7 +2967,13 @@ fn pool_exit_with_exact_pool_amount_fails_if_balances_drop_too_low() { )); assert_noop!( - Swaps::pool_exit_with_exact_pool_amount(Origin::signed(BOB), pool_id, ASSET_A, _1, 0), + Swaps::pool_exit_with_exact_pool_amount( + RuntimeOrigin::signed(BOB), + pool_id, + ASSET_A, + _1, + 0 + ), crate::Error::::PoolDrain, ); }); @@ -2990,7 +3000,7 @@ fn pool_exit_with_exact_pool_amount_fails_if_liquidity_drops_too_low() { let ten_percent_of_pool = Swaps::min_balance(pool_shares_id) / 10; assert_noop!( Swaps::pool_exit_with_exact_pool_amount( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), pool_id, ASSET_A, ten_percent_of_pool, @@ -3034,7 +3044,7 @@ fn pool_exit_with_exact_asset_amount_fails_if_balances_drop_too_low() { let ten_percent_of_balance = Swaps::min_balance(ASSET_A) / 10; assert_noop!( Swaps::pool_exit_with_exact_asset_amount( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), pool_id, ASSET_A, ten_percent_of_balance, @@ -3059,7 +3069,7 @@ fn pool_exit_with_exact_asset_amount_fails_if_liquidity_drops_too_low() { assert_noop!( Swaps::pool_exit_with_exact_asset_amount( - Origin::signed(BOB), + RuntimeOrigin::signed(BOB), pool_id, ASSET_A, _25, @@ -3077,7 +3087,7 @@ fn trading_functions_cache_pool_ids() { let pool_id = 0; assert_ok!(Swaps::pool_join_with_exact_pool_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, _2, @@ -3087,7 +3097,7 @@ fn trading_functions_cache_pool_ids() { PoolsCachedForArbitrage::::remove(pool_id); assert_ok!(Swaps::pool_join_with_exact_asset_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, _2, @@ -3097,7 +3107,7 @@ fn trading_functions_cache_pool_ids() { PoolsCachedForArbitrage::::remove(pool_id); assert_ok!(Swaps::pool_exit_with_exact_asset_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, _1, @@ -3107,7 +3117,7 @@ fn trading_functions_cache_pool_ids() { PoolsCachedForArbitrage::::remove(pool_id); assert_ok!(Swaps::pool_exit_with_exact_pool_amount( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, _1, @@ -3117,7 +3127,7 @@ fn trading_functions_cache_pool_ids() { PoolsCachedForArbitrage::::remove(pool_id); assert_ok!(Swaps::swap_exact_amount_in( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, _1, @@ -3129,7 +3139,7 @@ fn trading_functions_cache_pool_ids() { PoolsCachedForArbitrage::::remove(pool_id); assert_ok!(Swaps::swap_exact_amount_out( - Origin::signed(ALICE), + RuntimeOrigin::signed(ALICE), pool_id, ASSET_A, Some(u128::MAX), @@ -3422,8 +3432,8 @@ fn execute_arbitrage_observes_min_balances_mint_sell() { }); } -fn alice_signed() -> Origin { - Origin::signed(ALICE) +fn alice_signed() -> RuntimeOrigin { + RuntimeOrigin::signed(ALICE) } fn create_initial_pool( @@ -3496,7 +3506,7 @@ fn subsidize_and_start_rikiddo_pool( ) { let min_subsidy = ::MinSubsidy::get(); assert_ok!(Currencies::deposit(ASSET_D, who, min_subsidy + extra)); - assert_ok!(Swaps::pool_join_subsidy(Origin::signed(*who), pool_id, min_subsidy)); + assert_ok!(Swaps::pool_join_subsidy(RuntimeOrigin::signed(*who), pool_id, min_subsidy)); assert!(Swaps::end_subsidy_phase(pool_id).unwrap().result); } diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index f74979c4f..6ff787bdc 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_swaps //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-01-20, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -81,9 +81,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_categorical(a: u32) -> Weight { - Weight::from_ref_time(58_086_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(583_000).saturating_mul(a.into())) + Weight::from_ref_time(25_692_254) + // Standard Error: 614 + .saturating_add(Weight::from_ref_time(284_413).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -91,7 +91,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_scalar() -> Weight { - Weight::from_ref_time(58_390_000) + Weight::from_ref_time(22_556_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -101,9 +101,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:7 w:0) // Storage: Tokens TotalIssuance (r:64 w:64) fn apply_to_cached_pools_execute_arbitrage(a: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 803_000 - .saturating_add(Weight::from_ref_time(2_356_167_000).saturating_mul(a.into())) + Weight::from_ref_time(313_000) + // Standard Error: 71_767 + .saturating_add(Weight::from_ref_time(912_062_521).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(43)) .saturating_add(T::DbWeight::get().reads((70_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(42)) @@ -111,9 +111,9 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: Swaps PoolsCachedForArbitrage (r:8 w:7) fn apply_to_cached_pools_noop(a: u32) -> Weight { - Weight::from_ref_time(6_148_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(8_898_000).saturating_mul(a.into())) + Weight::from_ref_time(313_000) + // Standard Error: 999 + .saturating_add(Weight::from_ref_time(3_519_461).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) @@ -123,9 +123,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn destroy_pool_in_subsidy_phase(a: u32) -> Weight { - Weight::from_ref_time(47_422_000) - // Standard Error: 40_000 - .saturating_add(Weight::from_ref_time(21_468_000).saturating_mul(a.into())) + Weight::from_ref_time(20_746_815) + // Standard Error: 6_870 + .saturating_add(Weight::from_ref_time(9_588_841).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -135,11 +135,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:46 w:21) // Storage: System Account (r:11 w:10) fn distribute_pool_share_rewards(a: u32, b: u32) -> Weight { - Weight::from_ref_time(55_071_000) - // Standard Error: 180_000 - .saturating_add(Weight::from_ref_time(28_979_000).saturating_mul(a.into())) - // Standard Error: 180_000 - .saturating_add(Weight::from_ref_time(40_233_000).saturating_mul(b.into())) + Weight::from_ref_time(22_860_268) + // Standard Error: 18_875 + .saturating_add(Weight::from_ref_time(10_760_963).saturating_mul(a.into())) + // Standard Error: 18_875 + .saturating_add(Weight::from_ref_time(19_119_205).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) @@ -153,26 +153,28 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:0) fn end_subsidy_phase(a: u32, b: u32) -> Weight { - Weight::from_ref_time(0) - // Standard Error: 168_000 - .saturating_add(Weight::from_ref_time(26_503_000).saturating_mul(a.into())) - // Standard Error: 1_034_000 - .saturating_add(Weight::from_ref_time(126_477_000).saturating_mul(b.into())) + Weight::from_ref_time(13_533_000) + // Standard Error: 35_634 + .saturating_add(Weight::from_ref_time(8_213_437).saturating_mul(a.into())) + // Standard Error: 236_657 + .saturating_add(Weight::from_ref_time(36_459_831).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) - .saturating_add(T::DbWeight::get().reads((9_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(T::DbWeight::get().writes((9_u64).saturating_mul(b.into()))) + .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(b.into()))) } // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:3 w:3) // Storage: System Account (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_buy_burn(a: u32) -> Weight { - Weight::from_ref_time(61_994_000) - // Standard Error: 34_000 - .saturating_add(Weight::from_ref_time(36_370_000).saturating_mul(a.into())) + Weight::from_ref_time(33_878_547) + // Standard Error: 9_283 + .saturating_add(Weight::from_ref_time(15_010_607).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) } // Storage: Swaps Pools (r:1 w:0) @@ -180,9 +182,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:2 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_mint_sell(a: u32) -> Weight { - Weight::from_ref_time(80_675_000) - // Standard Error: 31_000 - .saturating_add(Weight::from_ref_time(33_433_000).saturating_mul(a.into())) + Weight::from_ref_time(38_285_437) + // Standard Error: 9_089 + .saturating_add(Weight::from_ref_time(13_998_473).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -191,9 +193,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:2 w:0) fn execute_arbitrage_skipped(a: u32) -> Weight { - Weight::from_ref_time(29_826_000) - // Standard Error: 13_000 - .saturating_add(Weight::from_ref_time(5_199_000).saturating_mul(a.into())) + Weight::from_ref_time(14_828_448) + // Standard Error: 1_025 + .saturating_add(Weight::from_ref_time(2_204_192).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) } @@ -202,9 +204,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:5 w:5) // Storage: System Account (r:1 w:0) fn pool_exit(a: u32) -> Weight { - Weight::from_ref_time(64_421_000) - // Standard Error: 34_000 - .saturating_add(Weight::from_ref_time(27_430_000).saturating_mul(a.into())) + Weight::from_ref_time(37_507_291) + // Standard Error: 2_130 + .saturating_add(Weight::from_ref_time(11_575_025).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -214,7 +216,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps SubsidyProviders (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn pool_exit_subsidy() -> Weight { - Weight::from_ref_time(77_761_000) + Weight::from_ref_time(37_934_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -224,7 +226,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_asset_amount() -> Weight { - Weight::from_ref_time(142_560_000) + Weight::from_ref_time(69_851_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -234,7 +236,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_pool_amount() -> Weight { - Weight::from_ref_time(143_190_000) + Weight::from_ref_time(69_798_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -242,9 +244,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:5 w:5) fn pool_join(a: u32) -> Weight { - Weight::from_ref_time(74_055_000) - // Standard Error: 32_000 - .saturating_add(Weight::from_ref_time(26_488_000).saturating_mul(a.into())) + Weight::from_ref_time(33_804_359) + // Standard Error: 2_236 + .saturating_add(Weight::from_ref_time(11_351_296).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -254,7 +256,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:1 w:1) // Storage: Swaps SubsidyProviders (r:1 w:1) fn pool_join_subsidy() -> Weight { - Weight::from_ref_time(78_671_000) + Weight::from_ref_time(38_045_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -263,7 +265,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_asset_amount() -> Weight { - Weight::from_ref_time(128_600_000) + Weight::from_ref_time(63_348_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -272,15 +274,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_pool_amount() -> Weight { - Weight::from_ref_time(132_720_000) + Weight::from_ref_time(63_817_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn clean_up_pool_categorical_without_reward_distribution(a: u32) -> Weight { - Weight::from_ref_time(16_673_000) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(325_000).saturating_mul(a.into())) + Weight::from_ref_time(5_597_769) + // Standard Error: 274 + .saturating_add(Weight::from_ref_time(163_354).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -289,7 +291,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_in_cpmm() -> Weight { - Weight::from_ref_time(170_520_000) + Weight::from_ref_time(81_657_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -300,9 +302,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_in_rikiddo(a: u32) -> Weight { - Weight::from_ref_time(159_946_000) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(19_270_000).saturating_mul(a.into())) + Weight::from_ref_time(72_975_675) + // Standard Error: 2_451 + .saturating_add(Weight::from_ref_time(7_367_384).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -312,7 +314,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_out_cpmm() -> Weight { - Weight::from_ref_time(169_581_000) + Weight::from_ref_time(81_923_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -322,26 +324,26 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_out_rikiddo(a: u32) -> Weight { - Weight::from_ref_time(101_410_000) - // Standard Error: 42_000 - .saturating_add(Weight::from_ref_time(35_542_000).saturating_mul(a.into())) + Weight::from_ref_time(52_010_503) + // Standard Error: 3_021 + .saturating_add(Weight::from_ref_time(12_822_294).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn open_pool(a: u32) -> Weight { - Weight::from_ref_time(28_613_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(559_000).saturating_mul(a.into())) + Weight::from_ref_time(12_568_363) + // Standard Error: 435 + .saturating_add(Weight::from_ref_time(244_095).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:1) fn close_pool(a: u32) -> Weight { - Weight::from_ref_time(31_634_000) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(366_000).saturating_mul(a.into())) + Weight::from_ref_time(11_445_465) + // Standard Error: 326 + .saturating_add(Weight::from_ref_time(192_402).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -350,9 +352,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn destroy_pool(a: u32) -> Weight { - Weight::from_ref_time(38_770_000) - // Standard Error: 30_000 - .saturating_add(Weight::from_ref_time(26_154_000).saturating_mul(a.into())) + Weight::from_ref_time(22_588_099) + // Standard Error: 1_893 + .saturating_add(Weight::from_ref_time(10_954_266).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) From 3aea0b9c5087cbadfa62e9b019e5af02da332a2e Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 26 May 2023 12:11:55 +0200 Subject: [PATCH 31/53] Move slashed funds from reject proposals to treasury (#1008) --- runtime/common/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index bee05ab00..7d9a32352 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -892,7 +892,7 @@ macro_rules! impl_config_traits { type Currency = Balances; type RuntimeEvent = RuntimeEvent; type MaxApprovals = MaxApprovals; - type OnSlash = (); + type OnSlash = Treasury; type PalletId = TreasuryPalletId; type ProposalBond = ProposalBond; type ProposalBondMinimum = ProposalBondMinimum; From 44adbcc98bb48160ad8d413816087cd34d2fe38d Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Tue, 6 Jun 2023 14:21:01 +0200 Subject: [PATCH 32/53] Fix pipeline (#1009) * Update init script * Modify init script to work with docker * Use Ubuntu jammy and scripts/init.sh * Make GitHub workflows use ./scripts/init.sh --- .github/workflows/benchmark.yml | 11 ++------- .github/workflows/migration.yml | 11 ++------- .github/workflows/rust.yml | 40 +++++++++------------------------ .github/workflows/tag.yml | 24 +++++--------------- Dockerfile | 25 +++++++++------------ scripts/init.sh | 16 ++++++++----- 6 files changed, 42 insertions(+), 85 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 83b3d1660..30b81bdff 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -17,9 +17,6 @@ jobs: run: shell: bash steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler # Ensure that at most one benchmark worklow runs across all workflows - name: Turnstyle uses: softprops/turnstyle@v1 @@ -36,12 +33,8 @@ jobs: uses: actions/checkout@v2 if: github.event_name == 'workflow_dispatch' - # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file - # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due - # to the lack of support of `rust-toolchain` files with TOML syntax: - # https://github.com/actions-rs/toolchain/issues/126. - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - name: Cache dependencies uses: Swatinem/rust-cache@v1 diff --git a/.github/workflows/migration.yml b/.github/workflows/migration.yml index c7b2785c0..967dc6510 100644 --- a/.github/workflows/migration.yml +++ b/.github/workflows/migration.yml @@ -11,17 +11,10 @@ jobs: name: Test migration runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 - # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file - # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due - # to the lack of support of `rust-toolchain` files with TOML syntax: - # https://github.com/actions-rs/toolchain/issues/126. - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - run: ./scripts/runtime-upgrade/test_runtime_upgrade.sh ${{ github.event.inputs.block }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ecff426c4..26cf2c504 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,18 +14,11 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 - # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file - # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due - # to the lack of support of `rust-toolchain` files with TOML syntax: - # https://github.com/actions-rs/toolchain/issues/126. - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - uses: actions-rs/install@v0.1 with: @@ -48,32 +41,27 @@ jobs: "standalone" ] steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - name: Cache Dependencies uses: Swatinem/rust-cache@v2 - name: Checks run: ./scripts/tests/${{ matrix.scripts }}.sh + benchmark: name: Quick check benchmarks runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - run: ./scripts/benchmarks/quick_check.sh @@ -81,14 +69,11 @@ jobs: name: Tests runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - uses: actions-rs/install@v0.1 with: @@ -115,14 +100,11 @@ jobs: name: Fuzz runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v2 - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh - uses: actions-rs/install@v0.1 with: diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 1c4af3b64..39e776a07 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -10,18 +10,12 @@ jobs: name: Test Try Runtime runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v3 - # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file - # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due - # to the lack of support of `rust-toolchain` files with TOML syntax: - # https://github.com/actions-rs/toolchain/issues/126. - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh + - name: Cache Dependencies uses: Swatinem/rust-cache@v2 @@ -30,18 +24,12 @@ jobs: name: Test Try Runtime runs-on: ubuntu-latest steps: - - name: Install ProtoBuf Compiler - run: | - sudo apt-get install protobuf-compiler - name: Checkout repository uses: actions/checkout@v3 - # TODO(#839): `rustup show` installs the rustc version specified in the `rust-toolchain` file - # according to https://rust-lang.github.io/rustup/overrides.html. We don't use actions-rs due - # to the lack of support of `rust-toolchain` files with TOML syntax: - # https://github.com/actions-rs/toolchain/issues/126. - - name: Install rust toolchain - run: rustup show + - name: Install build tools + run: ./scripts/init.sh + - name: Cache Dependencies uses: Swatinem/rust-cache@v2 diff --git a/Dockerfile b/Dockerfile index 032016ed8..072562f41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,30 @@ # Based from https://github.com/paritytech/substrate/blob/master/.maintain/Dockerfile -FROM phusion/baseimage:bionic-1.0.0 as builder +FROM phusion/baseimage:jammy-1.0.1 as builder LABEL maintainer="hi@zeitgeit.pm" LABEL description="This is the build stage for the Zeitgeist node. Here is created the binary." ENV DEBIAN_FRONTEND=noninteractive -ARG PROFILE=release +ARG PROFILE=production ARG FEATURES=default WORKDIR /zeitgeist COPY . /zeitgeist RUN apt-get update && \ - apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ - apt-get install -y cmake pkg-config libssl-dev git clang libclang-dev + apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ - export PATH="$PATH:$HOME/.cargo/bin" && \ - rustup toolchain install nightly-2022-04-13 && \ - rustup target add wasm32-unknown-unknown --toolchain nightly-2022-04-13 && \ - rustup default stable && \ - cargo build --profile "$PROFILE" --features "$FEATURES" +RUN ./scripts/init.sh + +RUN . "$HOME/.cargo/env" && cargo build --profile "$PROFILE" --features "$FEATURES" # ==== SECOND STAGE ==== -FROM phusion/baseimage:bionic-1.0.0 +FROM phusion/baseimage:jammy-1.0.1 LABEL maintainer="hi@zeitgeist.pm" LABEL description="This is the 2nd stage: a very small image where we copy the Zeigeist node binary." -ARG PROFILE=release +ARG PROFILE=production RUN mv /usr/share/ca* /tmp && \ rm -rf /usr/share/* && \ @@ -42,13 +38,12 @@ RUN ldd /usr/local/bin/zeitgeist && \ /usr/local/bin/zeitgeist --version # Shrinking -RUN rm -rf /usr/lib/python* && \ - rm -rf /usr/bin /usr/sbin /usr/share/man +RUN rm -rf /usr/lib/python* && rm -rf /usr/share/man USER zeitgeist EXPOSE 30333 9933 9944 -RUN mkdir /zeitgeist/data +RUN mkdir -p /zeitgeist/data VOLUME ["/zeitgeist/data"] diff --git a/scripts/init.sh b/scripts/init.sh index 2bf6e6e04..82085f37a 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -2,11 +2,17 @@ set -e -echo "*** Initializing WASM build environment" +echo "*** Initializing build environment" -if [ -z $CI_PROJECT_NAME ] ; then - rustup update nightly-2022-04-13 - rustup update stable +# No sudo during docker build +if [ -f /.dockerenv ]; then + apt-get update && \ + apt-get install -y build-essential clang curl libssl-dev protobuf-compiler +else + sudo apt-get update && \ + sudo apt-get install -y build-essential clang curl libssl-dev protobuf-compiler fi -rustup target add wasm32-unknown-unknown --toolchain nightly-2022-04-13 +curl https://sh.rustup.rs -sSf | sh -s -- -y && \ + . "$HOME/.cargo/env" && \ + rustup show From bb26c6d8d3c8335ef5c1c336ecb6b23787fd503c Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Tue, 6 Jun 2023 14:21:41 +0200 Subject: [PATCH 33/53] Update toolchain (#1013) --- Cargo.lock | 25 +-- node/Cargo.toml | 2 +- primitives/src/constants.rs | 2 +- .../zeitgeist_multi_reservable_currency.rs | 2 +- runtime/battery-station/Cargo.toml | 2 +- .../src/integration_tests/xcm/setup.rs | 5 +- .../src/integration_tests/xcm/test_net.rs | 16 +- .../integration_tests/xcm/tests/transfers.rs | 73 ++++---- .../battery-station/src/parachain_params.rs | 2 +- runtime/battery-station/src/parameters.rs | 2 +- .../battery-station/src/xcm_config/fees.rs | 8 +- runtime/zeitgeist/Cargo.toml | 2 +- .../src/integration_tests/xcm/setup.rs | 5 +- .../src/integration_tests/xcm/test_net.rs | 16 +- .../integration_tests/xcm/tests/transfers.rs | 73 ++++---- runtime/zeitgeist/src/parachain_params.rs | 2 +- runtime/zeitgeist/src/parameters.rs | 2 +- runtime/zeitgeist/src/xcm_config/fees.rs | 8 +- rust-toolchain | 2 +- zrml/authorized/src/benchmarks.rs | 2 +- zrml/authorized/src/lib.rs | 17 +- zrml/authorized/src/mock_storage.rs | 5 +- zrml/court/src/benchmarks.rs | 2 +- zrml/court/src/lib.rs | 15 +- zrml/global-disputes/src/benchmarks.rs | 2 +- zrml/global-disputes/src/lib.rs | 5 +- zrml/global-disputes/src/tests.rs | 26 +-- zrml/liquidity-mining/src/benchmarks.rs | 2 +- zrml/liquidity-mining/src/lib.rs | 8 +- zrml/orderbook-v1/src/benchmarks.rs | 2 +- zrml/orderbook-v1/src/lib.rs | 16 +- zrml/prediction-markets/src/benchmarks.rs | 2 +- zrml/prediction-markets/src/lib.rs | 92 +++++----- zrml/prediction-markets/src/mock.rs | 3 +- zrml/prediction-markets/src/tests.rs | 172 +++++++++--------- .../fuzz/balance_to_fixedu_conversion.rs | 2 +- .../fuzz/ema_market_volume_estimate_ema.rs | 2 +- .../fuzz/ema_market_volume_first_state.rs | 2 +- .../fuzz/ema_market_volume_second_state.rs | 2 +- .../fuzz/ema_market_volume_third_state.rs | 2 +- zrml/rikiddo/fuzz/fee_sigmoid.rs | 2 +- .../fuzz/fixedi_to_fixedu_conversion.rs | 2 +- .../fuzz/fixedu_to_balance_conversion.rs | 2 +- .../fuzz/fixedu_to_fixedi_conversion.rs | 2 +- zrml/rikiddo/fuzz/rikiddo_pallet.rs | 2 +- .../fuzz/rikiddo_with_calculated_fee.rs | 2 +- zrml/rikiddo/fuzz/rikiddo_with_initial_fee.rs | 2 +- zrml/rikiddo/src/lib.rs | 2 +- zrml/rikiddo/src/mock.rs | 2 +- zrml/rikiddo/src/types.rs | 2 +- zrml/rikiddo/src/types/sigmoid_fee.rs | 2 +- zrml/simple-disputes/src/lib.rs | 15 +- zrml/styx/src/benchmarks.rs | 2 +- zrml/styx/src/tests.rs | 4 +- zrml/swaps/fuzz/utils.rs | 2 +- zrml/swaps/src/benchmarks.rs | 2 +- zrml/swaps/src/lib.rs | 40 ++-- zrml/swaps/src/mock.rs | 2 +- 58 files changed, 337 insertions(+), 382 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46d0b186f..12e08b0aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1423,16 +1423,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctor" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "ctr" version = "0.8.0" @@ -4329,11 +4319,10 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" dependencies = [ - "cfg-if 1.0.0", "value-bag", ] @@ -11817,7 +11806,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.6", "rand 0.8.5", "static_assertions", @@ -11945,13 +11934,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.0.0-alpha.9" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" -dependencies = [ - "ctor", - "version_check", -] +checksum = "a4d330786735ea358f3bc09eea4caa098569c1c93f342d9aca0514915022fe7e" [[package]] name = "vcpkg" diff --git a/node/Cargo.toml b/node/Cargo.toml index 9b8bf813d..ef8a5111f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -98,7 +98,7 @@ cfg-if = { version = "1.0.0" } clap = { version = "4.0.9", features = ["derive"] } hex-literal = { version = "0.3.4" } jsonrpsee = { version = "0.15.1", features = ["server"] } -log = { optional = true, version = "0.4.17" } +log = { optional = true, version = "0.4.18" } # Zeitgeist diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index 909db474f..1c66ffcd6 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -19,7 +19,7 @@ #![allow( // Constants parameters inside `parameter_types!` already check // arithmetic operations at compile time - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #[cfg(feature = "mock")] diff --git a/primitives/src/traits/zeitgeist_multi_reservable_currency.rs b/primitives/src/traits/zeitgeist_multi_reservable_currency.rs index 5348bb01a..11db3909e 100644 --- a/primitives/src/traits/zeitgeist_multi_reservable_currency.rs +++ b/primitives/src/traits/zeitgeist_multi_reservable_currency.rs @@ -48,7 +48,7 @@ where let mut total = 0; #[allow( // Iterator will never yield more than `usize::MAX` elements - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] let accounts = >::iter() .filter_map(|(k0, k1, v)| { diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 5ebb54694..7f5b02a17 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -87,7 +87,7 @@ sp-finality-grandpa = { branch = "polkadot-v0.9.32", default-features = false, g # Utility cfg-if = { version = "1.0.0" } hex-literal = { default-features = false, optional = true, version = "0.3.4" } -log = { version = "0.4.17", default-features = false, optional = true } +log = { version = "0.4.18", default-features = false, optional = true } # XCM orml-asset-registry = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index df2ebbae0..83cae024f 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -23,6 +23,7 @@ use crate::{ }; use frame_support::{assert_ok, traits::GenesisBuild}; use orml_traits::asset_registry::AssetMetadata; +use sp_runtime::AccountId32; use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, @@ -95,8 +96,8 @@ impl ExtBuilder { } /// Accounts -pub const ALICE: [u8; 32] = [4u8; 32]; -pub const BOB: [u8; 32] = [5u8; 32]; +pub const ALICE: AccountId32 = AccountId32::new([0u8; 32]); +pub const BOB: AccountId32 = AccountId32::new([1u8; 32]); /// A PARA ID used for a sibling parachain. /// It must be one that doesn't collide with any other in use. diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index bd7e87b94..7e1becfd9 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -17,8 +17,8 @@ // along with Zeitgeist. If not, see . use crate::{ - parameters::ZeitgeistTreasuryAccount, xcm_config::config::battery_station, AccountId, - CurrencyId, DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, + parameters::ZeitgeistTreasuryAccount, xcm_config::config::battery_station, CurrencyId, + DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, }; use frame_support::{traits::GenesisBuild, weights::Weight}; use polkadot_primitives::{ @@ -78,11 +78,9 @@ pub(super) fn relay_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - pallet_balances::GenesisConfig:: { - balances: vec![(AccountId::from(ALICE), roc(2002))], - } - .assimilate_storage(&mut t) - .unwrap(); + pallet_balances::GenesisConfig:: { balances: vec![(ALICE, roc(2002))] } + .assimilate_storage(&mut t) + .unwrap(); polkadot_runtime_parachains::configuration::GenesisConfig:: { config: default_parachains_host_configuration(), @@ -104,8 +102,8 @@ pub(super) fn relay_ext() -> sp_io::TestExternalities { pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { ExtBuilder::default() .set_balances(vec![ - (AccountId::from(ALICE), CurrencyId::Ztg, ztg(10)), - (AccountId::from(ALICE), FOREIGN_PARENT_ID, roc(10)), + (ALICE, CurrencyId::Ztg, ztg(10)), + (ALICE, FOREIGN_PARENT_ID, roc(10)), (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, roc(1)), ]) .set_parachain_id(parachain_id) diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index 77631353a..65514f572 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -50,15 +50,15 @@ fn transfer_ztg_to_sibling() { Sibling::execute_with(|| { treasury_initial_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), 0); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); }); Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); - assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE), CurrencyId::Ztg, transfer_amount, Box::new( @@ -66,7 +66,7 @@ fn transfer_ztg_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: NetworkId::Any, id: BOB } + Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() } ) ) .into() @@ -75,14 +75,14 @@ fn transfer_ztg_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here - assert_eq!(Balances::free_balance(&sibling_parachain_account()), transfer_amount); + assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); // Verify that BOB now has (amount transferred - fee) assert_eq!(current_balance, transfer_amount - ztg_fee()); @@ -117,18 +117,18 @@ fn transfer_ztg_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { treasury_initial_balance = Balances::free_balance(ZeitgeistTreasuryAccount::get()); - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); assert_eq!( - Balances::free_balance(&sibling_parachain_account()), + Balances::free_balance(sibling_parachain_account()), sibling_sovereign_initial_balance ); }); Sibling::execute_with(|| { - assert_eq!(Balances::free_balance(&zeitgeist_parachain_account()), 0); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), bob_initial_balance); + assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), 0); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(BOB.into()), + RuntimeOrigin::signed(BOB), FOREIGN_ZTG_ID, transfer_amount, Box::new( @@ -136,7 +136,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { 1, X2( Parachain(battery_station::ID), - Junction::AccountId32 { network: NetworkId::Any, id: ALICE } + Junction::AccountId32 { network: NetworkId::Any, id: ALICE.into() } ) ) .into() @@ -146,7 +146,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { // Confirm that Bobs's balance is initial balance - amount transferred assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), + Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance - transfer_amount ); }); @@ -154,13 +154,13 @@ fn transfer_ztg_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { // Verify that ALICE now has initial balance + amount transferred - fee assert_eq!( - Balances::free_balance(&ALICE.into()), + Balances::free_balance(&ALICE), alice_initial_balance + transfer_amount - ztg_fee(), ); // Verify that the reserve has been adjusted properly assert_eq!( - Balances::free_balance(&sibling_parachain_account()), + Balances::free_balance(sibling_parachain_account()), sibling_sovereign_initial_balance - transfer_amount ); @@ -183,23 +183,22 @@ fn transfer_roc_from_relay_chain() { }); RococoNet::execute_with(|| { - let initial_balance = rococo_runtime::Balances::free_balance(&ALICE.into()); + let initial_balance = rococo_runtime::Balances::free_balance(&ALICE); assert!(initial_balance >= transfer_amount); assert_ok!(rococo_runtime::XcmPallet::reserve_transfer_assets( - rococo_runtime::RuntimeOrigin::signed(ALICE.into()), + rococo_runtime::RuntimeOrigin::signed(ALICE), Box::new(Parachain(battery_station::ID).into().into()), - Box::new(Junction::AccountId32 { network: NetworkId::Any, id: BOB }.into().into()), + Box::new( + Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() }.into().into() + ), Box::new((Here, transfer_amount).into()), 0 )); }); Zeitgeist::execute_with(|| { - assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &BOB.into()), - transfer_amount - roc_fee() - ); + assert_eq!(Tokens::free_balance(FOREIGN_PARENT_ID, &BOB), transfer_amount - roc_fee()); }); } @@ -211,17 +210,17 @@ fn transfer_roc_to_relay_chain() { transfer_roc_from_relay_chain(); Zeitgeist::execute_with(|| { - let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE.into()); + let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE); assert!(initial_balance >= transfer_amount); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE), FOREIGN_PARENT_ID, transfer_amount, Box::new( MultiLocation::new( 1, - X1(Junction::AccountId32 { id: BOB, network: NetworkId::Any }) + X1(Junction::AccountId32 { id: BOB.into(), network: NetworkId::Any }) ) .into() ), @@ -229,13 +228,13 @@ fn transfer_roc_to_relay_chain() { )); assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE.into()), + Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE), initial_balance - transfer_amount ) }); RococoNet::execute_with(|| { - assert_eq!(rococo_runtime::Balances::free_balance(&BOB.into()), 999_988_806_429); + assert_eq!(rococo_runtime::Balances::free_balance(&BOB), 999_988_806_429); }); } @@ -252,7 +251,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { Sibling::execute_with(|| { treasury_initial_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), 0); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); let custom_metadata = CustomMetadata { @@ -271,10 +270,10 @@ fn transfer_ztg_to_sibling_with_custom_fee() { }); Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); - assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE), CurrencyId::Ztg, transfer_amount, Box::new( @@ -282,7 +281,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: NetworkId::Any, id: BOB } + Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() } ) ) .into() @@ -291,14 +290,14 @@ fn transfer_ztg_to_sibling_with_custom_fee() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here - assert_eq!(Balances::free_balance(&sibling_parachain_account()), transfer_amount); + assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); let custom_fee = calc_fee(default_per_second(10) * 10); // Verify that BOB now has (amount transferred - fee) diff --git a/runtime/battery-station/src/parachain_params.rs b/runtime/battery-station/src/parachain_params.rs index d602239bd..c906fcfe7 100644 --- a/runtime/battery-station/src/parachain_params.rs +++ b/runtime/battery-station/src/parachain_params.rs @@ -19,7 +19,7 @@ #![allow( // Constants parameters inside `parameter_types!` already check // arithmetic operations at compile time - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "parachain")] diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index eb8e91107..0d9ee4467 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -19,7 +19,7 @@ #![allow( // Constants parameters inside `parameter_types!` already check // arithmetic operations at compile time - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] use super::VERSION; diff --git a/runtime/battery-station/src/xcm_config/fees.rs b/runtime/battery-station/src/xcm_config/fees.rs index 825a20f87..53a036e53 100644 --- a/runtime/battery-station/src/xcm_config/fees.rs +++ b/runtime/battery-station/src/xcm_config/fees.rs @@ -60,10 +60,10 @@ pub struct FixedConversionRateProvider(PhantomData impl< AssetRegistry: orml_traits::asset_registry::Inspect< - AssetId = CurrencyId, - Balance = Balance, - CustomMetadata = CustomMetadata, - >, + AssetId = CurrencyId, + Balance = Balance, + CustomMetadata = CustomMetadata, + >, > orml_traits::FixedConversionRateProvider for FixedConversionRateProvider { fn get_fee_per_second(location: &MultiLocation) -> Option { diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index 417df6562..cca1c0048 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -85,7 +85,7 @@ sp-finality-grandpa = { branch = "polkadot-v0.9.32", default-features = false, g # Utility cfg-if = { version = "1.0.0" } hex-literal = { default-features = false, optional = true, version = "0.3.4" } -log = { version = "0.4.17", default-features = false, optional = true } +log = { version = "0.4.18", default-features = false, optional = true } # XCM orml-asset-registry = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/open-web3-stack/open-runtime-module-library", optional = true } diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index 8cceae716..aa717bf53 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -23,6 +23,7 @@ use crate::{ }; use frame_support::{assert_ok, traits::GenesisBuild}; use orml_traits::asset_registry::AssetMetadata; +use sp_runtime::AccountId32; use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, @@ -95,8 +96,8 @@ impl ExtBuilder { } /// Accounts -pub const ALICE: [u8; 32] = [4u8; 32]; -pub const BOB: [u8; 32] = [5u8; 32]; +pub const ALICE: AccountId32 = AccountId32::new([0u8; 32]); +pub const BOB: AccountId32 = AccountId32::new([1u8; 32]); /// A PARA ID used for a sibling parachain. /// It must be one that doesn't collide with any other in use. diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index 5a62e099b..050527635 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -17,8 +17,8 @@ // along with Zeitgeist. If not, see . use crate::{ - parameters::ZeitgeistTreasuryAccount, xcm_config::config::zeitgeist, AccountId, CurrencyId, - DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, + parameters::ZeitgeistTreasuryAccount, xcm_config::config::zeitgeist, CurrencyId, DmpQueue, + Runtime, RuntimeOrigin, XcmpQueue, }; use frame_support::{traits::GenesisBuild, weights::Weight}; use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; @@ -75,11 +75,9 @@ pub(super) fn relay_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - pallet_balances::GenesisConfig:: { - balances: vec![(AccountId::from(ALICE), dot(2002))], - } - .assimilate_storage(&mut t) - .unwrap(); + pallet_balances::GenesisConfig:: { balances: vec![(ALICE, dot(2002))] } + .assimilate_storage(&mut t) + .unwrap(); polkadot_runtime_parachains::configuration::GenesisConfig:: { config: default_parachains_host_configuration(), @@ -101,8 +99,8 @@ pub(super) fn relay_ext() -> sp_io::TestExternalities { pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { ExtBuilder::default() .set_balances(vec![ - (AccountId::from(ALICE), CurrencyId::Ztg, ztg(10)), - (AccountId::from(ALICE), FOREIGN_PARENT_ID, dot(10)), + (ALICE, CurrencyId::Ztg, ztg(10)), + (ALICE, FOREIGN_PARENT_ID, dot(10)), (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, dot(10)), ]) .set_parachain_id(parachain_id) diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index 316fb19d1..bf17fc2a0 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -50,15 +50,15 @@ fn transfer_ztg_to_sibling() { Sibling::execute_with(|| { treasury_initial_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), 0); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); }); Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); - assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE), CurrencyId::Ztg, transfer_amount, Box::new( @@ -66,7 +66,7 @@ fn transfer_ztg_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: NetworkId::Any, id: BOB } + Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() } ) ) .into() @@ -75,14 +75,14 @@ fn transfer_ztg_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here - assert_eq!(Balances::free_balance(&sibling_parachain_account()), transfer_amount); + assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); // Verify that BOB now has (amount transferred - fee) assert_eq!(current_balance, transfer_amount - ztg_fee()); @@ -117,18 +117,18 @@ fn transfer_ztg_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { treasury_initial_balance = Balances::free_balance(ZeitgeistTreasuryAccount::get()); - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); assert_eq!( - Balances::free_balance(&sibling_parachain_account()), + Balances::free_balance(sibling_parachain_account()), sibling_sovereign_initial_balance ); }); Sibling::execute_with(|| { - assert_eq!(Balances::free_balance(&zeitgeist_parachain_account()), 0); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), bob_initial_balance); + assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), 0); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(BOB.into()), + RuntimeOrigin::signed(BOB), FOREIGN_ZTG_ID, transfer_amount, Box::new( @@ -136,7 +136,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { 1, X2( Parachain(zeitgeist::ID), - Junction::AccountId32 { network: NetworkId::Any, id: ALICE } + Junction::AccountId32 { network: NetworkId::Any, id: ALICE.into() } ) ) .into() @@ -146,7 +146,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { // Confirm that Bobs's balance is initial balance - amount transferred assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), + Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance - transfer_amount ); }); @@ -154,13 +154,13 @@ fn transfer_ztg_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { // Verify that ALICE now has initial balance + amount transferred - fee assert_eq!( - Balances::free_balance(&ALICE.into()), + Balances::free_balance(&ALICE), alice_initial_balance + transfer_amount - ztg_fee(), ); // Verify that the reserve has been adjusted properly assert_eq!( - Balances::free_balance(&sibling_parachain_account()), + Balances::free_balance(sibling_parachain_account()), sibling_sovereign_initial_balance - transfer_amount ); @@ -183,23 +183,22 @@ fn transfer_dot_from_relay_chain() { }); PolkadotNet::execute_with(|| { - let initial_balance = polkadot_runtime::Balances::free_balance(&ALICE.into()); + let initial_balance = polkadot_runtime::Balances::free_balance(&ALICE); assert!(initial_balance >= transfer_amount); assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets( - polkadot_runtime::RuntimeOrigin::signed(ALICE.into()), + polkadot_runtime::RuntimeOrigin::signed(ALICE), Box::new(Parachain(zeitgeist::ID).into().into()), - Box::new(Junction::AccountId32 { network: NetworkId::Any, id: BOB }.into().into()), + Box::new( + Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() }.into().into() + ), Box::new((Here, transfer_amount).into()), 0 )); }); Zeitgeist::execute_with(|| { - assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &BOB.into()), - transfer_amount - dot_fee() - ); + assert_eq!(Tokens::free_balance(FOREIGN_PARENT_ID, &BOB), transfer_amount - dot_fee()); }); } @@ -211,17 +210,17 @@ fn transfer_dot_to_relay_chain() { transfer_dot_from_relay_chain(); Zeitgeist::execute_with(|| { - let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE.into()); + let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE); assert!(initial_balance >= transfer_amount); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE), FOREIGN_PARENT_ID, transfer_amount, Box::new( MultiLocation::new( 1, - X1(Junction::AccountId32 { id: BOB, network: NetworkId::Any }) + X1(Junction::AccountId32 { id: BOB.into(), network: NetworkId::Any }) ) .into() ), @@ -229,13 +228,13 @@ fn transfer_dot_to_relay_chain() { )); assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE.into()), + Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE), initial_balance - transfer_amount ) }); PolkadotNet::execute_with(|| { - assert_eq!(polkadot_runtime::Balances::free_balance(&BOB.into()), 19_573_469_824); + assert_eq!(polkadot_runtime::Balances::free_balance(&BOB), 19_573_469_824); }); } @@ -252,7 +251,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { Sibling::execute_with(|| { treasury_initial_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()), 0); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); let custom_metadata = CustomMetadata { @@ -271,10 +270,10 @@ fn transfer_ztg_to_sibling_with_custom_fee() { }); Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance); - assert_eq!(Balances::free_balance(&sibling_parachain_account()), 0); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE.into()), + RuntimeOrigin::signed(ALICE), CurrencyId::Ztg, transfer_amount, Box::new( @@ -282,7 +281,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: NetworkId::Any, id: BOB } + Junction::AccountId32 { network: NetworkId::Any, id: BOB.into() } ) ) .into() @@ -291,14 +290,14 @@ fn transfer_ztg_to_sibling_with_custom_fee() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE.into()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here - assert_eq!(Balances::free_balance(&sibling_parachain_account()), transfer_amount); + assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB.into()); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); let custom_fee = calc_fee(default_per_second(10) * 10); // Verify that BOB now has (amount transferred - fee) diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index ba42d6728..2ccf0ab61 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -19,7 +19,7 @@ #![allow( // Constants parameters inside `parameter_types!` already check // arithmetic operations at compile time - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "parachain")] diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 56c8e5b27..2b550afe9 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -19,7 +19,7 @@ #![allow( // Constants parameters inside `parameter_types!` already check // arithmetic operations at compile time - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] use super::VERSION; diff --git a/runtime/zeitgeist/src/xcm_config/fees.rs b/runtime/zeitgeist/src/xcm_config/fees.rs index 825a20f87..53a036e53 100644 --- a/runtime/zeitgeist/src/xcm_config/fees.rs +++ b/runtime/zeitgeist/src/xcm_config/fees.rs @@ -60,10 +60,10 @@ pub struct FixedConversionRateProvider(PhantomData impl< AssetRegistry: orml_traits::asset_registry::Inspect< - AssetId = CurrencyId, - Balance = Balance, - CustomMetadata = CustomMetadata, - >, + AssetId = CurrencyId, + Balance = Balance, + CustomMetadata = CustomMetadata, + >, > orml_traits::FixedConversionRateProvider for FixedConversionRateProvider { fn get_fee_per_second(location: &MultiLocation) -> Option { diff --git a/rust-toolchain b/rust-toolchain index 2277d1a71..b5b8dbecd 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2022-09-24" +channel = "nightly-2023-03-01" components = ["clippy", "rustfmt", "llvm-tools-preview"] profile = "minimal" targets = ["wasm32-unknown-unknown"] diff --git a/zrml/authorized/src/benchmarks.rs b/zrml/authorized/src/benchmarks.rs index d4f349161..7a3ce9bfc 100644 --- a/zrml/authorized/src/benchmarks.rs +++ b/zrml/authorized/src/benchmarks.rs @@ -18,7 +18,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "runtime-benchmarks")] diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index 0fb633207..95a82638a 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -129,16 +129,13 @@ mod pallet { type CorrectionPeriod: Get; type DisputeResolution: DisputeResolutionApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - Moment = MomentOf, - >; - - type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - >; + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; + + type MarketCommons: MarketCommonsPalletApi; /// The origin that is allowed to resolved disupute in Authorized dispute mechanism. type AuthorizedDisputeResolutionOrigin: EnsureOrigin; diff --git a/zrml/authorized/src/mock_storage.rs b/zrml/authorized/src/mock_storage.rs index d4ea04efc..88bf6c02b 100644 --- a/zrml/authorized/src/mock_storage.rs +++ b/zrml/authorized/src/mock_storage.rs @@ -32,10 +32,7 @@ pub(crate) mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - >; + type MarketCommons: MarketCommonsPalletApi; } #[pallet::pallet] diff --git a/zrml/court/src/benchmarks.rs b/zrml/court/src/benchmarks.rs index d78f614d1..829695001 100644 --- a/zrml/court/src/benchmarks.rs +++ b/zrml/court/src/benchmarks.rs @@ -18,7 +18,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "runtime-benchmarks")] diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index 70083ce65..7c5b091c4 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -154,20 +154,17 @@ mod pallet { type CourtCaseDuration: Get; type DisputeResolution: DisputeResolutionApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - Moment = MomentOf, - >; + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; /// Event type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Market commons - type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - >; + type MarketCommons: MarketCommonsPalletApi; /// Identifier of this pallet #[pallet::constant] diff --git a/zrml/global-disputes/src/benchmarks.rs b/zrml/global-disputes/src/benchmarks.rs index ef5d2bec9..2fb52724b 100644 --- a/zrml/global-disputes/src/benchmarks.rs +++ b/zrml/global-disputes/src/benchmarks.rs @@ -19,7 +19,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "runtime-benchmarks")] diff --git a/zrml/global-disputes/src/lib.rs b/zrml/global-disputes/src/lib.rs index 8798937ba..14b594ea8 100644 --- a/zrml/global-disputes/src/lib.rs +++ b/zrml/global-disputes/src/lib.rs @@ -69,10 +69,7 @@ mod pallet { type GlobalDisputesPalletId: Get; /// To reference the market id type. - type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - >; + type MarketCommons: MarketCommonsPalletApi; /// The maximum numbers of distinct markets /// on which one account can simultaneously vote on outcomes. diff --git a/zrml/global-disputes/src/tests.rs b/zrml/global-disputes/src/tests.rs index f070a6be2..d3efbfd30 100644 --- a/zrml/global-disputes/src/tests.rs +++ b/zrml/global-disputes/src/tests.rs @@ -79,7 +79,7 @@ fn add_vote_outcome_works() { 10 * BASE, ) .unwrap(); - let free_balance_alice_before = Balances::free_balance(&ALICE); + let free_balance_alice_before = Balances::free_balance(ALICE); let free_balance_reward_account = Balances::free_balance(GlobalDisputes::reward_account(&market_id)); assert_ok!(GlobalDisputes::add_vote_outcome( @@ -96,7 +96,7 @@ fn add_vote_outcome_works() { .into(), ); assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(ALICE), free_balance_alice_before - VotingOutcomeFee::get() ); assert_eq!( @@ -212,9 +212,9 @@ fn reward_outcome_owner_works_for_multiple_owners() { }; >::insert(market_id, winner_info); - let free_balance_alice_before = Balances::free_balance(&ALICE); - let free_balance_bob_before = Balances::free_balance(&BOB); - let free_balance_charlie_before = Balances::free_balance(&CHARLIE); + let free_balance_alice_before = Balances::free_balance(ALICE); + let free_balance_bob_before = Balances::free_balance(BOB); + let free_balance_charlie_before = Balances::free_balance(CHARLIE); assert_ok!(GlobalDisputes::purge_outcomes(RuntimeOrigin::signed(ALICE), market_id,)); @@ -230,12 +230,12 @@ fn reward_outcome_owner_works_for_multiple_owners() { .into(), ); assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(ALICE), free_balance_alice_before + VotingOutcomeFee::get() ); - assert_eq!(Balances::free_balance(&BOB), free_balance_bob_before + VotingOutcomeFee::get()); + assert_eq!(Balances::free_balance(BOB), free_balance_bob_before + VotingOutcomeFee::get()); assert_eq!( - Balances::free_balance(&CHARLIE), + Balances::free_balance(CHARLIE), free_balance_charlie_before + VotingOutcomeFee::get() ); assert!(Balances::free_balance(GlobalDisputes::reward_account(&market_id)).is_zero()); @@ -301,7 +301,7 @@ fn reward_outcome_owner_works_for_one_owner() { System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); - let free_balance_alice_before = Balances::free_balance(&ALICE); + let free_balance_alice_before = Balances::free_balance(ALICE); assert_ok!(GlobalDisputes::reward_outcome_owner(RuntimeOrigin::signed(ALICE), market_id)); @@ -310,7 +310,7 @@ fn reward_outcome_owner_works_for_one_owner() { ); assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(ALICE), free_balance_alice_before + 3 * VotingOutcomeFee::get() ); assert!(Balances::free_balance(GlobalDisputes::reward_account(&market_id)).is_zero()); @@ -336,10 +336,10 @@ fn reward_outcome_owner_works_for_no_reward_funds() { System::assert_last_event(Event::::OutcomesFullyCleaned { market_id }.into()); - let free_balance_alice_before = Balances::free_balance(&ALICE); + let free_balance_alice_before = Balances::free_balance(ALICE); let reward_account_free_balance = - Balances::free_balance(&GlobalDisputes::reward_account(&market_id)); + Balances::free_balance(GlobalDisputes::reward_account(&market_id)); // this case happens, when add_vote_outcome wasn't called // so no loosers, who provided the VotingOutcomeFee assert!(reward_account_free_balance.is_zero()); @@ -350,7 +350,7 @@ fn reward_outcome_owner_works_for_no_reward_funds() { Event::::OutcomeOwnersRewardedWithNoFunds { market_id }.into(), ); - assert_eq!(Balances::free_balance(&ALICE), free_balance_alice_before); + assert_eq!(Balances::free_balance(ALICE), free_balance_alice_before); assert!(Balances::free_balance(GlobalDisputes::reward_account(&market_id)).is_zero()); assert!(>::iter_prefix(market_id).next().is_none()); }); diff --git a/zrml/liquidity-mining/src/benchmarks.rs b/zrml/liquidity-mining/src/benchmarks.rs index 3afa80121..05e32b749 100644 --- a/zrml/liquidity-mining/src/benchmarks.rs +++ b/zrml/liquidity-mining/src/benchmarks.rs @@ -18,7 +18,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "runtime-benchmarks")] diff --git a/zrml/liquidity-mining/src/lib.rs b/zrml/liquidity-mining/src/lib.rs index c3a8ac5c4..57d4220a7 100644 --- a/zrml/liquidity-mining/src/lib.rs +++ b/zrml/liquidity-mining/src/lib.rs @@ -104,10 +104,10 @@ mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - MarketId = Self::MarketId, - >; + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = Self::MarketId, + >; type MarketId: MarketId; diff --git a/zrml/orderbook-v1/src/benchmarks.rs b/zrml/orderbook-v1/src/benchmarks.rs index 64a88e9d3..e60585e88 100644 --- a/zrml/orderbook-v1/src/benchmarks.rs +++ b/zrml/orderbook-v1/src/benchmarks.rs @@ -18,7 +18,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "runtime-benchmarks")] #![allow(clippy::type_complexity)] diff --git a/zrml/orderbook-v1/src/lib.rs b/zrml/orderbook-v1/src/lib.rs index c97f84cec..3934d1318 100644 --- a/zrml/orderbook-v1/src/lib.rs +++ b/zrml/orderbook-v1/src/lib.rs @@ -80,19 +80,19 @@ mod pallet { let mut bid = true; if let Some(order_data) = Self::order_data(order_hash) { - let maker = order_data.maker.clone(); - ensure!(sender == maker, Error::::NotOrderCreator); + let maker = &order_data.maker; + ensure!(sender == *maker, Error::::NotOrderCreator); match order_data.side { OrderSide::Bid => { let cost = order_data.cost()?; - T::Currency::unreserve(&maker, cost); + T::Currency::unreserve(maker, cost); let mut bids = Self::bids(asset); remove_item::(&mut bids, order_hash); >::insert(asset, bids); } OrderSide::Ask => { - T::Shares::unreserve(order_data.asset, &maker, order_data.total); + T::Shares::unreserve(order_data.asset, maker, order_data.total); let mut asks = Self::asks(asset); remove_item::(&mut asks, order_hash); >::insert(asset, asks); @@ -261,10 +261,10 @@ mod pallet { type MarketId: MarketId; type Shares: MultiReservableCurrency< - Self::AccountId, - Balance = BalanceOf, - CurrencyId = Asset, - >; + Self::AccountId, + Balance = BalanceOf, + CurrencyId = Asset, + >; type WeightInfo: WeightInfoZeitgeist; } diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index 09659c2a3..62fa3e6a0 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -18,7 +18,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![allow(clippy::type_complexity)] #![cfg(feature = "runtime-benchmarks")] diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 164197014..3d0e19204 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -1528,41 +1528,41 @@ mod pallet { /// Shares of outcome assets and native currency type AssetManager: ZeitgeistAssetManager< - Self::AccountId, - Balance = as Currency>::Balance, - CurrencyId = Asset>, - ReserveIdentifier = [u8; 8], - >; + Self::AccountId, + Balance = as Currency>::Balance, + CurrencyId = Asset>, + ReserveIdentifier = [u8; 8], + >; #[cfg(feature = "parachain")] type AssetRegistry: Inspect< - AssetId = Asset>, - Balance = BalanceOf, - CustomMetadata = CustomMetadata, - >; + AssetId = Asset>, + Balance = BalanceOf, + CustomMetadata = CustomMetadata, + >; /// See [`zrml_authorized::AuthorizedPalletApi`]. type Authorized: zrml_authorized::AuthorizedPalletApi< - AccountId = Self::AccountId, - Balance = BalanceOf, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - Moment = MomentOf, - Origin = Self::RuntimeOrigin, - >; + AccountId = Self::AccountId, + Balance = BalanceOf, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + Origin = Self::RuntimeOrigin, + >; /// The origin that is allowed to close markets. type CloseOrigin: EnsureOrigin; /// See [`zrml_court::CourtPalletApi`]. type Court: zrml_court::CourtPalletApi< - AccountId = Self::AccountId, - Balance = BalanceOf, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - Moment = MomentOf, - Origin = Self::RuntimeOrigin, - >; + AccountId = Self::AccountId, + Balance = BalanceOf, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + Origin = Self::RuntimeOrigin, + >; /// The origin that is allowed to destroy markets. type DestroyOrigin: EnsureOrigin; @@ -1581,22 +1581,18 @@ mod pallet { /// See [`GlobalDisputesPalletApi`]. #[cfg(feature = "with-global-disputes")] - type GlobalDisputes: GlobalDisputesPalletApi< - MarketIdOf, - Self::AccountId, - BalanceOf, - >; + type GlobalDisputes: GlobalDisputesPalletApi, Self::AccountId, BalanceOf>; /// The number of blocks the global dispute period remains open. #[cfg(feature = "with-global-disputes")] type GlobalDisputePeriod: Get; type LiquidityMining: LiquidityMiningPalletApi< - AccountId = Self::AccountId, - Balance = BalanceOf, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - >; + AccountId = Self::AccountId, + Balance = BalanceOf, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + >; /// The maximum number of categories available for categorical markets. #[pallet::constant] @@ -1677,13 +1673,13 @@ mod pallet { /// See [`DisputeApi`]. type SimpleDisputes: DisputeApi< - AccountId = Self::AccountId, - Balance = BalanceOf, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - Moment = MomentOf, - Origin = Self::RuntimeOrigin, - >; + AccountId = Self::AccountId, + Balance = BalanceOf, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + Origin = Self::RuntimeOrigin, + >; /// Handler for slashed funds. type Slash: OnUnbalanced>; @@ -2855,15 +2851,15 @@ mod pallet { where F: FnMut(&MarketIdOf, MarketOf) -> DispatchResult, MarketIdsPerBlock: frame_support::StorageMap< - T::BlockNumber, - BoundedVec, CacheSize>, - Query = BoundedVec, CacheSize>, - >, + T::BlockNumber, + BoundedVec, CacheSize>, + Query = BoundedVec, CacheSize>, + >, MarketIdsPerTimeFrame: frame_support::StorageMap< - TimeFrame, - BoundedVec, CacheSize>, - Query = BoundedVec, CacheSize>, - >, + TimeFrame, + BoundedVec, CacheSize>, + Query = BoundedVec, CacheSize>, + >, { let market_ids_per_block = MarketIdsPerBlock::get(block_number); for market_id in market_ids_per_block.iter() { diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index be8392167..f5d81641f 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -18,7 +18,7 @@ #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "mock")] @@ -412,7 +412,6 @@ impl ExtBuilder { #[cfg(feature = "parachain")] orml_tokens::GenesisConfig:: { balances: (0..69) - .into_iter() .map(|idx| (idx, CurrencyId::ForeignAsset(100), INITIAL_BALANCE)) .collect(), } diff --git a/zrml/prediction-markets/src/tests.rs b/zrml/prediction-markets/src/tests.rs index 961f59c0a..83e772fb7 100644 --- a/zrml/prediction-markets/src/tests.rs +++ b/zrml/prediction-markets/src/tests.rs @@ -77,12 +77,12 @@ fn reserve_sentinel_amounts() { assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &DAVE, SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &EVE, SENTINEL_AMOUNT)); assert_ok!(Balances::reserve_named(&PredictionMarkets::reserve_id(), &FRED, SENTINEL_AMOUNT)); - assert_eq!(Balances::reserved_balance(&ALICE), SENTINEL_AMOUNT); - assert_eq!(Balances::reserved_balance(&BOB), SENTINEL_AMOUNT); - assert_eq!(Balances::reserved_balance(&CHARLIE), SENTINEL_AMOUNT); - assert_eq!(Balances::reserved_balance(&DAVE), SENTINEL_AMOUNT); - assert_eq!(Balances::reserved_balance(&EVE), SENTINEL_AMOUNT); - assert_eq!(Balances::reserved_balance(&FRED), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(ALICE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(BOB), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(CHARLIE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(DAVE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(EVE), SENTINEL_AMOUNT); + assert_eq!(Balances::reserved_balance(FRED), SENTINEL_AMOUNT); } fn check_reserve(account: &AccountIdTest, expected: Balance) { @@ -521,13 +521,13 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_active() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -563,13 +563,13 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_reported() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -613,13 +613,13 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_disputed() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -673,8 +673,8 @@ fn admin_destroy_market_correctly_unreserves_dispute_bonds() { set_up_account(&CHARLIE); set_up_account(&DAVE); - let balance_free_before_charlie = Balances::free_balance(&CHARLIE); - let balance_free_before_dave = Balances::free_balance(&DAVE); + let balance_free_before_charlie = Balances::free_balance(CHARLIE); + let balance_free_before_dave = Balances::free_balance(DAVE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), market_id)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &CHARLIE), @@ -723,13 +723,13 @@ fn admin_destroy_market_correctly_slashes_permissionless_market_resolved() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -757,13 +757,13 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -791,7 +791,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed_with_edit_requ &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); let market = MarketCommons::market(&0); assert_eq!(market.unwrap().status, MarketStatus::Proposed); @@ -804,7 +804,7 @@ fn admin_destroy_market_correctly_slashes_advised_market_proposed_with_edit_requ Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); assert!(!MarketIdsForEdit::::contains_key(0)); }; @@ -834,13 +834,13 @@ fn admin_destroy_market_correctly_slashes_advised_market_active() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -878,13 +878,13 @@ fn admin_destroy_market_correctly_slashes_advised_market_reported() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -927,13 +927,13 @@ fn admin_destroy_market_correctly_slashes_advised_market_disputed() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -973,13 +973,13 @@ fn admin_destroy_market_correctly_slashes_advised_market_resolved() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::admin_destroy_market(RuntimeOrigin::signed(SUDO), 0)); assert_eq!( Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), SENTINEL_AMOUNT ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); assert_eq!(balance_free_before_alice, balance_free_after_alice); }; ExtBuilder::default().build().execute_with(|| { @@ -1134,7 +1134,7 @@ fn admin_move_market_to_resolved_resolves_reported_market() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before = Balances::free_balance(&ALICE); + let balance_free_before = Balances::free_balance(ALICE); let balance_reserved_before = Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE); @@ -1168,7 +1168,7 @@ fn admin_move_market_to_resolved_resolves_reported_market() { - ::ValidityBond::get() ); assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(ALICE), balance_free_before + ::OracleBond::get() + ::ValidityBond::get() @@ -1223,7 +1223,7 @@ fn it_creates_binary_markets() { ); // check the correct amount was reserved - let alice_reserved = Balances::reserved_balance(&ALICE); + let alice_reserved = Balances::reserved_balance(ALICE); assert_eq!(alice_reserved, ValidityBond::get() + OracleBond::get()); // Creates an advised market. @@ -1234,7 +1234,7 @@ fn it_creates_binary_markets() { ScoringRule::CPMM, ); - let new_alice_reserved = Balances::reserved_balance(&ALICE); + let new_alice_reserved = Balances::reserved_balance(ALICE); assert_eq!(new_alice_reserved, AdvisoryBond::get() + OracleBond::get() + alice_reserved); // Make sure that the market id has been incrementing @@ -1595,7 +1595,7 @@ fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { )); assert!(Balances::free_balance(Treasury::account_id()).is_zero()); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); let balance_reserved_before_alice = Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE); @@ -1613,7 +1613,7 @@ fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { - ::OracleBond::get() - ::AdvisoryBond::get(), ); - let balance_free_after_alice = Balances::free_balance(&ALICE); + let balance_free_after_alice = Balances::free_balance(ALICE); let slash_amount_advisory_bond = ::AdvisoryBondSlashPercentage::get() .mul_floor(::AdvisoryBond::get()); let advisory_bond_remains = @@ -1683,7 +1683,7 @@ fn on_market_close_auto_rejects_expired_advised_market() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); let balance_reserved_before_alice = Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE); @@ -1702,7 +1702,7 @@ fn on_market_close_auto_rejects_expired_advised_market() { Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), balance_reserved_before_alice ); - assert_eq!(Balances::free_balance(&ALICE), balance_free_before_alice); + assert_eq!(Balances::free_balance(ALICE), balance_free_before_alice); assert_noop!( MarketCommons::market(&market_id), zrml_market_commons::Error::::MarketDoesNotExist, @@ -1729,7 +1729,7 @@ fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { &ALICE, SENTINEL_AMOUNT )); - let balance_free_before_alice = Balances::free_balance(&ALICE); + let balance_free_before_alice = Balances::free_balance(ALICE); let balance_reserved_before_alice = Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE); @@ -1761,7 +1761,7 @@ fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { Balances::reserved_balance_named(&PredictionMarkets::reserve_id(), &ALICE), balance_reserved_before_alice ); - assert_eq!(Balances::free_balance(&ALICE), balance_free_before_alice); + assert_eq!(Balances::free_balance(ALICE), balance_free_before_alice); assert_noop!( MarketCommons::market(&market_id), zrml_market_commons::Error::::MarketDoesNotExist, @@ -2363,7 +2363,7 @@ fn it_allows_to_sell_a_complete_set() { } // also check native balance - let bal = Balances::free_balance(&BOB); + let bal = Balances::free_balance(BOB); assert_eq!(bal, 1_000 * BASE); System::assert_last_event(Event::SoldCompleteSet(0, CENT, BOB).into()); @@ -2884,13 +2884,13 @@ fn it_resolves_a_disputed_market() { assert_eq!(market.status, MarketStatus::Disputed); // check everyone's deposits - let charlie_reserved = Balances::reserved_balance(&CHARLIE); + let charlie_reserved = Balances::reserved_balance(CHARLIE); assert_eq!(charlie_reserved, DisputeBond::get()); - let dave_reserved = Balances::reserved_balance(&DAVE); + let dave_reserved = Balances::reserved_balance(DAVE); assert_eq!(dave_reserved, DisputeBond::get() + DisputeFactor::get()); - let eve_reserved = Balances::reserved_balance(&EVE); + let eve_reserved = Balances::reserved_balance(EVE); assert_eq!(eve_reserved, DisputeBond::get() + 2 * DisputeFactor::get()); // check disputes length @@ -2933,22 +2933,22 @@ fn it_resolves_a_disputed_market() { let dave_reserved = DisputeBond::get() + DisputeFactor::get(); let total_slashed = OracleBond::get() + dave_reserved; - let charlie_balance = Balances::free_balance(&CHARLIE); + let charlie_balance = Balances::free_balance(CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE + total_slashed / 2); - let charlie_reserved_2 = Balances::reserved_balance(&CHARLIE); + let charlie_reserved_2 = Balances::reserved_balance(CHARLIE); assert_eq!(charlie_reserved_2, 0); - let eve_balance = Balances::free_balance(&EVE); + let eve_balance = Balances::free_balance(EVE); assert_eq!(eve_balance, 1_000 * BASE + total_slashed / 2); - let dave_balance = Balances::free_balance(&DAVE); + let dave_balance = Balances::free_balance(DAVE); assert_eq!(dave_balance, 1_000 * BASE - dave_reserved); - let alice_balance = Balances::free_balance(&ALICE); + let alice_balance = Balances::free_balance(ALICE); assert_eq!(alice_balance, 1_000 * BASE - OracleBond::get()); // bob kinda gets away scot-free since Alice is held responsible // for her designated reporter - let bob_balance = Balances::free_balance(&BOB); + let bob_balance = Balances::free_balance(BOB); assert_eq!(bob_balance, 1_000 * BASE); assert!(market_after.bonds.creation.unwrap().is_settled); @@ -3198,7 +3198,7 @@ fn it_allows_to_redeem_shares() { assert_eq!(market.status, MarketStatus::Resolved); assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); - let bal = Balances::free_balance(&CHARLIE); + let bal = Balances::free_balance(CHARLIE); assert_eq!(bal, 1_000 * BASE); System::assert_last_event( Event::TokensRedeemed(0, Asset::CategoricalOutcome(0, 1), CENT, CENT, CHARLIE).into(), @@ -3942,7 +3942,7 @@ fn authorized_correctly_resolves_disputed_market() { assert_eq!(market.status, MarketStatus::Disputed); // check everyone's deposits - let charlie_reserved = Balances::reserved_balance(&CHARLIE); + let charlie_reserved = Balances::reserved_balance(CHARLIE); assert_eq!(charlie_reserved, DisputeBond::get()); // check disputes length @@ -4048,11 +4048,11 @@ fn approve_market_correctly_unreserves_advisory_bond() { ScoringRule::CPMM, )); let market_id = 0; - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, AdvisoryBond::get() + OracleBond::get()); assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), market_id)); check_reserve(&ALICE, OracleBond::get()); - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + AdvisoryBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before + AdvisoryBond::get()); let market = MarketCommons::market(&market_id).unwrap(); assert!(market.bonds.creation.unwrap().is_settled); }; @@ -4188,7 +4188,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4201,7 +4201,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark run_to_block(grace_period + market.deadlines.dispute_duration + 1); check_reserve(&ALICE, 0); assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(ALICE), alice_balance_before + ValidityBond::get() + OracleBond::get() ); }; @@ -4233,10 +4233,10 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); - let charlie_balance_before = Balances::free_balance(&CHARLIE); + let charlie_balance_before = Balances::free_balance(CHARLIE); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; let report_at = grace_period + market.deadlines.oracle_duration + 1; @@ -4252,18 +4252,18 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark let market = MarketCommons::market(&0).unwrap(); assert_eq!(market.bonds.outsider, Some(Bond::new(CHARLIE, OutsiderBond::get()))); check_reserve(&CHARLIE, OutsiderBond::get()); - assert_eq!(Balances::free_balance(&CHARLIE), charlie_balance_before - OutsiderBond::get()); - let charlie_balance_before = Balances::free_balance(&CHARLIE); + assert_eq!(Balances::free_balance(CHARLIE), charlie_balance_before - OutsiderBond::get()); + let charlie_balance_before = Balances::free_balance(CHARLIE); run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // Check that validity bond didn't get slashed, but oracle bond did - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before + ValidityBond::get()); check_reserve(&CHARLIE, 0); // Check that the outsider gets the OracleBond together with the OutsiderBond assert_eq!( - Balances::free_balance(&CHARLIE), + Balances::free_balance(CHARLIE), charlie_balance_before + OracleBond::get() + OutsiderBond::get() ); let market = MarketCommons::market(&0).unwrap(); @@ -4285,7 +4285,7 @@ fn outsider_reports_wrong_outcome() { reserve_sentinel_amounts(); let end = 100; - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), base_asset, @@ -4311,7 +4311,7 @@ fn outsider_reports_wrong_outcome() { OutcomeReport::Categorical(1) )); - let outsider_balance_before = Balances::free_balance(&outsider); + let outsider_balance_before = Balances::free_balance(outsider); check_reserve(&outsider, OutsiderBond::get()); let dispute_at_0 = report_at + 1; @@ -4322,20 +4322,20 @@ fn outsider_reports_wrong_outcome() { OutcomeReport::Categorical(0) )); - let eve_balance_before = Balances::free_balance(&EVE); + let eve_balance_before = Balances::free_balance(EVE); // on_resolution called run_blocks(market.deadlines.dispute_duration); - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before - OracleBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before - OracleBond::get()); check_reserve(&outsider, 0); - assert_eq!(Balances::free_balance(&outsider), outsider_balance_before); + assert_eq!(Balances::free_balance(outsider), outsider_balance_before); let dispute_bond = crate::default_dispute_bond::(0usize); // disputor EVE gets the OracleBond and OutsiderBond and dispute bond assert_eq!( - Balances::free_balance(&EVE), + Balances::free_balance(EVE), eve_balance_before + dispute_bond + OutsiderBond::get() + OracleBond::get() ); }; @@ -4368,7 +4368,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma ScoringRule::CPMM, )); assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4382,7 +4382,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // Check that nothing got slashed - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + OracleBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before + OracleBond::get()); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4413,7 +4413,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma ScoringRule::CPMM, )); assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4427,7 +4427,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma run_blocks(market.deadlines.dispute_duration); // Check that oracle bond got slashed check_reserve(&ALICE, 0); - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4458,7 +4458,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4476,7 +4476,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before + ValidityBond::get()); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4508,7 +4508,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma ScoringRule::CPMM, )); assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4526,7 +4526,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4557,7 +4557,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark MarketDisputeMechanism::SimpleDisputes, ScoringRule::CPMM, )); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4582,7 +4582,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is not slashed assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(ALICE), alice_balance_before + ValidityBond::get() + OracleBond::get() ); }; @@ -4616,7 +4616,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma ScoringRule::CPMM, )); assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let grace_period = end + market.deadlines.grace_period; @@ -4640,7 +4640,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is not slashed - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + OracleBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before + OracleBond::get()); }; ExtBuilder::default().build().execute_with(|| { test(Asset::Ztg); @@ -4672,7 +4672,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark ScoringRule::CPMM, )); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, ValidityBond::get() + OracleBond::get()); let outsider = CHARLIE; @@ -4688,7 +4688,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark OutcomeReport::Categorical(0) )); - let outsider_balance_before = Balances::free_balance(&outsider); + let outsider_balance_before = Balances::free_balance(outsider); check_reserve(&outsider, OutsiderBond::get()); // EVE disputes with wrong outcome @@ -4705,11 +4705,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before + ValidityBond::get()); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before + ValidityBond::get()); check_reserve(&outsider, 0); assert_eq!( - Balances::free_balance(&outsider), + Balances::free_balance(outsider), outsider_balance_before + OracleBond::get() + OutsiderBond::get() ); }; @@ -4746,7 +4746,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma let outsider = CHARLIE; assert_ok!(PredictionMarkets::approve_market(RuntimeOrigin::signed(SUDO), 0)); - let alice_balance_before = Balances::free_balance(&ALICE); + let alice_balance_before = Balances::free_balance(ALICE); check_reserve(&ALICE, OracleBond::get()); let market = MarketCommons::market(&0).unwrap(); let after_oracle_duration = @@ -4759,7 +4759,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma OutcomeReport::Categorical(0) )); - let outsider_balance_before = Balances::free_balance(&outsider); + let outsider_balance_before = Balances::free_balance(outsider); check_reserve(&outsider, OutsiderBond::get()); // EVE disputes with wrong outcome @@ -4776,11 +4776,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma run_blocks(market.deadlines.dispute_duration); check_reserve(&ALICE, 0); // ValidityBond bond is returned but OracleBond is slashed - assert_eq!(Balances::free_balance(&ALICE), alice_balance_before); + assert_eq!(Balances::free_balance(ALICE), alice_balance_before); check_reserve(&outsider, 0); assert_eq!( - Balances::free_balance(&outsider), + Balances::free_balance(outsider), outsider_balance_before + OracleBond::get() + OutsiderBond::get() ); }; diff --git a/zrml/rikiddo/fuzz/balance_to_fixedu_conversion.rs b/zrml/rikiddo/fuzz/balance_to_fixedu_conversion.rs index 5b3c61745..2010927a1 100644 --- a/zrml/rikiddo/fuzz/balance_to_fixedu_conversion.rs +++ b/zrml/rikiddo/fuzz/balance_to_fixedu_conversion.rs @@ -18,7 +18,7 @@ //! Fuzz test: Conversion Balance -> FixedU #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/ema_market_volume_estimate_ema.rs b/zrml/rikiddo/fuzz/ema_market_volume_estimate_ema.rs index 08ae2375f..add40ca7f 100644 --- a/zrml/rikiddo/fuzz/ema_market_volume_estimate_ema.rs +++ b/zrml/rikiddo/fuzz/ema_market_volume_estimate_ema.rs @@ -19,7 +19,7 @@ //! -> Configure the struct in a way that it estimates the ema at the second update, update #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/ema_market_volume_first_state.rs b/zrml/rikiddo/fuzz/ema_market_volume_first_state.rs index 107bdbbeb..122aa1124 100644 --- a/zrml/rikiddo/fuzz/ema_market_volume_first_state.rs +++ b/zrml/rikiddo/fuzz/ema_market_volume_first_state.rs @@ -19,7 +19,7 @@ //! -> update_volume #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/ema_market_volume_second_state.rs b/zrml/rikiddo/fuzz/ema_market_volume_second_state.rs index 90a08a350..c6f8bf791 100644 --- a/zrml/rikiddo/fuzz/ema_market_volume_second_state.rs +++ b/zrml/rikiddo/fuzz/ema_market_volume_second_state.rs @@ -19,7 +19,7 @@ //! -> change state (update), update, get ema, clear #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/ema_market_volume_third_state.rs b/zrml/rikiddo/fuzz/ema_market_volume_third_state.rs index 08eb4d1bf..8c26b8b8e 100644 --- a/zrml/rikiddo/fuzz/ema_market_volume_third_state.rs +++ b/zrml/rikiddo/fuzz/ema_market_volume_third_state.rs @@ -19,7 +19,7 @@ //! -> change state (two updates with specific configuration), update #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/fee_sigmoid.rs b/zrml/rikiddo/fuzz/fee_sigmoid.rs index 16823983b..6277c0b70 100644 --- a/zrml/rikiddo/fuzz/fee_sigmoid.rs +++ b/zrml/rikiddo/fuzz/fee_sigmoid.rs @@ -18,7 +18,7 @@ //! Fuzz test: FeeSigmoid.calculate() is called #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/fixedi_to_fixedu_conversion.rs b/zrml/rikiddo/fuzz/fixedi_to_fixedu_conversion.rs index 6a3f73e1e..98ff02f48 100644 --- a/zrml/rikiddo/fuzz/fixedi_to_fixedu_conversion.rs +++ b/zrml/rikiddo/fuzz/fixedi_to_fixedu_conversion.rs @@ -18,7 +18,7 @@ //! Fuzz test: Conversion FixedI -> FixedU #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/fixedu_to_balance_conversion.rs b/zrml/rikiddo/fuzz/fixedu_to_balance_conversion.rs index f902c61d3..cc2c3b5a1 100644 --- a/zrml/rikiddo/fuzz/fixedu_to_balance_conversion.rs +++ b/zrml/rikiddo/fuzz/fixedu_to_balance_conversion.rs @@ -18,7 +18,7 @@ //! Fuzz test: Conversion Balance -> FixedU #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/fixedu_to_fixedi_conversion.rs b/zrml/rikiddo/fuzz/fixedu_to_fixedi_conversion.rs index c0e631f88..19792f328 100644 --- a/zrml/rikiddo/fuzz/fixedu_to_fixedi_conversion.rs +++ b/zrml/rikiddo/fuzz/fixedu_to_fixedi_conversion.rs @@ -18,7 +18,7 @@ //! Fuzz test: Conversion FixedU -> FixedI #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![no_main] diff --git a/zrml/rikiddo/fuzz/rikiddo_pallet.rs b/zrml/rikiddo/fuzz/rikiddo_pallet.rs index c88f881c6..5fd0afc0a 100644 --- a/zrml/rikiddo/fuzz/rikiddo_pallet.rs +++ b/zrml/rikiddo/fuzz/rikiddo_pallet.rs @@ -19,7 +19,7 @@ //! -> create, force fee by multiple update_volume, cost, price, all_prices, clear, destroy #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![allow(clippy::type_complexity)] #![no_main] diff --git a/zrml/rikiddo/fuzz/rikiddo_with_calculated_fee.rs b/zrml/rikiddo/fuzz/rikiddo_with_calculated_fee.rs index 43a3d1444..0ae9b4679 100644 --- a/zrml/rikiddo/fuzz/rikiddo_with_calculated_fee.rs +++ b/zrml/rikiddo/fuzz/rikiddo_with_calculated_fee.rs @@ -19,7 +19,7 @@ //! -> force EmaMarketVolume, cost, price, all_prices #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![allow(clippy::type_complexity)] #![no_main] diff --git a/zrml/rikiddo/fuzz/rikiddo_with_initial_fee.rs b/zrml/rikiddo/fuzz/rikiddo_with_initial_fee.rs index 40b2f7c23..01ea3ab27 100644 --- a/zrml/rikiddo/fuzz/rikiddo_with_initial_fee.rs +++ b/zrml/rikiddo/fuzz/rikiddo_with_initial_fee.rs @@ -18,7 +18,7 @@ //! Fuzz test: Rikiddo is called with initial fee -> cost, price, all_prices, clear #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![allow(clippy::type_complexity)] #![no_main] diff --git a/zrml/rikiddo/src/lib.rs b/zrml/rikiddo/src/lib.rs index 811656585..be7f94817 100644 --- a/zrml/rikiddo/src/lib.rs +++ b/zrml/rikiddo/src/lib.rs @@ -18,7 +18,7 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] // This is required to be able to use the derive(Arbitrary) macro. -#![cfg_attr(feature = "arbitrary", allow(clippy::integer_arithmetic))] +#![cfg_attr(feature = "arbitrary", allow(clippy::arithmetic_side_effects))] #![deny(missing_docs)] extern crate alloc; diff --git a/zrml/rikiddo/src/mock.rs b/zrml/rikiddo/src/mock.rs index d6459020c..07d089867 100644 --- a/zrml/rikiddo/src/mock.rs +++ b/zrml/rikiddo/src/mock.rs @@ -17,7 +17,7 @@ #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![cfg(feature = "mock")] #![allow(missing_docs)] diff --git a/zrml/rikiddo/src/types.rs b/zrml/rikiddo/src/types.rs index cbca959b7..cff58f86b 100644 --- a/zrml/rikiddo/src/types.rs +++ b/zrml/rikiddo/src/types.rs @@ -58,7 +58,7 @@ pub struct TimestampedVolume { #[cfg(feature = "arbitrary")] macro_rules! impl_arbitrary_for_timestamped_volume { ( $t:ident, $LeEqU:ident, $p:ty ) => { - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] impl<'a, Frac> Arbitrary<'a> for TimestampedVolume<$t> where Frac: $LeEqU, diff --git a/zrml/rikiddo/src/types/sigmoid_fee.rs b/zrml/rikiddo/src/types/sigmoid_fee.rs index 437ec2373..d122c64ec 100644 --- a/zrml/rikiddo/src/types/sigmoid_fee.rs +++ b/zrml/rikiddo/src/types/sigmoid_fee.rs @@ -68,7 +68,7 @@ pub struct FeeSigmoidConfig { #[cfg(feature = "arbitrary")] macro_rules! impl_arbitrary_for_fee_sigmoid_config { ( $t:ident, $LeEqU:ident, $p:ty ) => { - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] impl<'a, Frac> Arbitrary<'a> for FeeSigmoidConfig<$t> where Frac: $LeEqU, diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index 1527fe58e..1db2ff3f9 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -71,17 +71,14 @@ mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; type DisputeResolution: DisputeResolutionApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - Moment = MomentOf, - >; + AccountId = Self::AccountId, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + Moment = MomentOf, + >; /// The identifier of individual markets. - type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - >; + type MarketCommons: MarketCommonsPalletApi; /// The pallet identifier. #[pallet::constant] diff --git a/zrml/styx/src/benchmarks.rs b/zrml/styx/src/benchmarks.rs index cfd7ffcde..6ae9e0223 100644 --- a/zrml/styx/src/benchmarks.rs +++ b/zrml/styx/src/benchmarks.rs @@ -18,7 +18,7 @@ #![allow( // Auto-generated code is a no man's land - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] #![allow(clippy::type_complexity)] #![cfg(feature = "runtime-benchmarks")] diff --git a/zrml/styx/src/tests.rs b/zrml/styx/src/tests.rs index 20988d223..dfcc0bf1a 100644 --- a/zrml/styx/src/tests.rs +++ b/zrml/styx/src/tests.rs @@ -25,9 +25,9 @@ fn cross_slashes_funds_and_stores_crossing() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); let burn_amount = crate::BurnAmount::::get(); - let original_balance = Balances::free_balance(&ALICE); + let original_balance = Balances::free_balance(ALICE); assert_ok!(Styx::cross(RuntimeOrigin::signed(ALICE))); - let balance_after_crossing = Balances::free_balance(&ALICE); + let balance_after_crossing = Balances::free_balance(ALICE); let diff = original_balance - balance_after_crossing; assert!(Crossings::::contains_key(ALICE)); assert_eq!(diff, burn_amount); diff --git a/zrml/swaps/fuzz/utils.rs b/zrml/swaps/fuzz/utils.rs index 9051538ac..b03364729 100644 --- a/zrml/swaps/fuzz/utils.rs +++ b/zrml/swaps/fuzz/utils.rs @@ -17,7 +17,7 @@ #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic, + clippy::arithmetic_side_effects, clippy::type_complexity, )] diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index f2b194dd2..d456425e9 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -23,7 +23,7 @@ // . // Auto-generated code is a no man's land -#![allow(clippy::integer_arithmetic, clippy::indexing_slicing)] +#![allow(clippy::arithmetic_side_effects, clippy::indexing_slicing)] #![cfg(feature = "runtime-benchmarks")] use super::*; diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index 274fa9d09..9ae019eab 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -790,16 +790,13 @@ mod pallet { + PartialOrd; type LiquidityMining: LiquidityMiningPalletApi< - AccountId = Self::AccountId, - Balance = BalanceOf, - BlockNumber = Self::BlockNumber, - MarketId = MarketIdOf, - >; + AccountId = Self::AccountId, + Balance = BalanceOf, + BlockNumber = Self::BlockNumber, + MarketId = MarketIdOf, + >; - type MarketCommons: MarketCommonsPalletApi< - AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, - >; + type MarketCommons: MarketCommonsPalletApi; #[pallet::constant] type MaxAssets: Get; @@ -841,22 +838,19 @@ mod pallet { /// The Rikiddo instance that uses a sigmoid fee and ema of market volume type RikiddoSigmoidFeeMarketEma: RikiddoMVPallet< - Balance = BalanceOf, - PoolId = PoolId, - FU = Self::FixedTypeU, - Rikiddo = RikiddoSigmoidMV< - Self::FixedTypeU, - Self::FixedTypeS, - FeeSigmoid, - EmaMarketVolume, - >, - >; + Balance = BalanceOf, + PoolId = PoolId, + FU = Self::FixedTypeU, + Rikiddo = RikiddoSigmoidMV< + Self::FixedTypeU, + Self::FixedTypeS, + FeeSigmoid, + EmaMarketVolume, + >, + >; /// Shares of outcome assets and native currency - type AssetManager: ZeitgeistAssetManager< - Self::AccountId, - CurrencyId = Asset>, - >; + type AssetManager: ZeitgeistAssetManager>>; /// The weight information for swap's dispatchable functions. type WeightInfo: WeightInfoZeitgeist; diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index 8d77ca50e..76a170afd 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -25,7 +25,7 @@ #![cfg(feature = "mock")] #![allow( // Mocks are only used for fuzzing and unit tests - clippy::integer_arithmetic + clippy::arithmetic_side_effects )] use crate as zrml_swaps; From ad0fb013606f537ce60e44d5f5864cb2fd80602f Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 9 Jun 2023 15:55:39 +0200 Subject: [PATCH 34/53] Test all features in test scripts (#1006) * Free up space on GH hosted runner workaround * Create new workflow for coverage job * Test whole workspace --- .github/workflows/coverage.yml | 56 +++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 29 +++++++++-------- scripts/tests/all-sequencial.sh | 2 +- scripts/tests/aux-functions.sh | 2 +- scripts/tests/coverage.sh | 28 +++++++++++++++++ scripts/tests/misc.sh | 40 ----------------------- scripts/tests/parachain.sh | 7 +++-- scripts/tests/standalone.sh | 9 ++---- scripts/tests/test.sh | 13 ++++++++ 9 files changed, 120 insertions(+), 66 deletions(-) create mode 100644 .github/workflows/coverage.yml create mode 100755 scripts/tests/coverage.sh delete mode 100755 scripts/tests/misc.sh create mode 100755 scripts/tests/test.sh diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..4087b70ee --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,56 @@ +name: Coverage + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install rust toolchain + run: rustup show + + - uses: actions-rs/install@v0.1 + with: + crate: grcov + use-tool-cache: true + + # No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006 + # Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 + - name: Free up disk space on GitHub hosted runners + run: | + # Ensure context is GitHub hosted runner + # https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context + if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then + echo "Freeing up space in GitHub hosted runner" + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + fi + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1 + + - name: Generate coverage report + run: ./scripts/tests/coverage.sh + + - name: Upload to codecov.io + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ runner.temp }}/zeitgeist-test-coverage.lcov + fail_ci_if_error: true + flags: tests + verbose: true + name: unit-tests \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 26cf2c504..a7edff6e4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -75,26 +75,25 @@ jobs: - name: Install build tools run: ./scripts/init.sh - - uses: actions-rs/install@v0.1 - with: - crate: grcov - use-tool-cache: true + # No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006 + # Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 + - name: Free up disk space on GitHub hosted runners + run: | + # Ensure context is GitHub hosted runner + # https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context + if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then + echo "Freeing up space in GitHub hosted runner" + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + fi - name: Cache Dependencies uses: Swatinem/rust-cache@v1 - name: Tests - run: ./scripts/tests/misc.sh -Cinstrument-coverage - - - name: Upload to codecov.io - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ${{ runner.temp }}/zeitgeist-test-coverage.lcov - fail_ci_if_error: true - flags: tests - verbose: true - name: unit-tests + run: ./scripts/tests/test.sh fuzz: name: Fuzz diff --git a/scripts/tests/all-sequencial.sh b/scripts/tests/all-sequencial.sh index 9b3ecd661..5df762912 100755 --- a/scripts/tests/all-sequencial.sh +++ b/scripts/tests/all-sequencial.sh @@ -4,7 +4,7 @@ # # IMPORTANT: CI verifies most of the following scripts in parallel -. "$(dirname "$0")/misc.sh" --source-only +. "$(dirname "$0")/test.sh" --source-only . "$(dirname "$0")/clippy.sh" --source-only . "$(dirname "$0")/parachain.sh" --source-only . "$(dirname "$0")/standalone.sh" --source-only diff --git a/scripts/tests/aux-functions.sh b/scripts/tests/aux-functions.sh index 95e628bba..0bc90af4a 100755 --- a/scripts/tests/aux-functions.sh +++ b/scripts/tests/aux-functions.sh @@ -17,5 +17,5 @@ test_package_with_feature() { /bin/echo -e "\e[0;33m***** Testing '$package' with features '$features' *****\e[0m\n" # default rustc profile dev (debug) is used to stop for debug_assertions - CARGO_INCREMENTAL=0 RUSTFLAGS="$rustflags" LLVM_PROFILE_FILE="cargo-test-%p-%m.profraw" cargo test --features $features --manifest-path $package/Cargo.toml --no-default-features + RUSTFLAGS="$rustflags" cargo test --features $features --manifest-path $package/Cargo.toml --no-default-features } diff --git a/scripts/tests/coverage.sh b/scripts/tests/coverage.sh new file mode 100755 index 000000000..aeed8dbfd --- /dev/null +++ b/scripts/tests/coverage.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Coverage: Generate project coverage files using grcov + +set -euxo pipefail + +. "$(dirname "$0")/aux-functions.sh" --source-only + +export CARGO_INCREMENTAL=0 +export LLVM_PROFILE_FILE="cargo-test-%p-%m.profraw" +rustflags="-Cinstrument-coverage" + +test_package_with_feature "primitives" "std" "$rustflags" +no_runtime_benchmarks=('court' 'market-commons' 'rikiddo') + +for package in zrml/*; do +if [[ " ${no_runtime_benchmarks[*]} " != *" ${package##*/} "* ]]; then + echo "TEST $package std,runtime-benchmarks" + test_package_with_feature "$package" "std,runtime-benchmarks" "$rustflags" +else + echo "TEST $package std" + test_package_with_feature "$package" "std" "$rustflags" +fi +done + +unset CARGO_INCREMENTAL LLVM_PROFILE_FILE + +grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --llvm --ignore '../*' --ignore "/*" -o $RUNNER_TEMP/zeitgeist-test-coverage.lcov \ No newline at end of file diff --git a/scripts/tests/misc.sh b/scripts/tests/misc.sh deleted file mode 100755 index 9431faf60..000000000 --- a/scripts/tests/misc.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# Miscellaneous: Checks everything that is not clippy, fuzz, runtime or node related - -set -euxo pipefail - -. "$(dirname "$0")/aux-functions.sh" --source-only - -if [ -z "${1:-}" ] -then - rustflags="" -else - rustflags=$1 -fi - -test_package_with_feature primitives default $rustflags -test_package_with_feature primitives std $rustflags - -no_runtime_benchmarks=('court' 'market-commons' 'rikiddo') - -cargo test --package zeitgeist-runtime --lib -- --nocapture - -# TODO(#848): Delete when feature "with-global-dispute" is removed -cargo test -p zrml-prediction-markets --features with-global-disputes,parachain - - -for package in zrml/* -do - test_package_with_feature "$package" std "$rustflags" - echo "TEST $package std" - - if [[ " ${no_runtime_benchmarks[*]} " != *" ${package##*/} "* ]]; then - test_package_with_feature "$package" std,runtime-benchmarks "$rustflags" - echo "TEST $package std,runtime-benchmarks" - fi -done - -if [[ ! -z "$rustflags" ]]; then - grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --llvm --ignore '../*' --ignore "/*" -o $RUNNER_TEMP/zeitgeist-test-coverage.lcov -fi diff --git a/scripts/tests/parachain.sh b/scripts/tests/parachain.sh index 47ea3f798..a59f27049 100755 --- a/scripts/tests/parachain.sh +++ b/scripts/tests/parachain.sh @@ -6,7 +6,8 @@ set -euxo pipefail . "$(dirname "$0")/aux-functions.sh" --source-only -check_package_with_feature runtime/battery-station std,parachain -check_package_with_feature runtime/zeitgeist std,parachain +check_package_with_feature runtime/battery-station 'parachain --all-features' -check_package_with_feature node default,parachain +check_package_with_feature runtime/zeitgeist 'parachain --all-features' + +check_package_with_feature node 'parachain --all-features' diff --git a/scripts/tests/standalone.sh b/scripts/tests/standalone.sh index def013e50..8a9065b85 100755 --- a/scripts/tests/standalone.sh +++ b/scripts/tests/standalone.sh @@ -6,11 +6,8 @@ set -euxo pipefail . "$(dirname "$0")/aux-functions.sh" --source-only -check_package_with_feature runtime/battery-station std -check_package_with_feature runtime/battery-station std,runtime-benchmarks +check_package_with_feature runtime/battery-station runtime-benchmarks,std,try-runtime -check_package_with_feature runtime/zeitgeist std -check_package_with_feature runtime/zeitgeist std,runtime-benchmarks +check_package_with_feature runtime/zeitgeist runtime-benchmarks,std,try-runtime -check_package_with_feature node default -check_package_with_feature node default,runtime-benchmarks +check_package_with_feature node default,runtime-benchmarks,try-runtime diff --git a/scripts/tests/test.sh b/scripts/tests/test.sh new file mode 100755 index 000000000..1c390e00e --- /dev/null +++ b/scripts/tests/test.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Tests: Run tests on all crates + +set -euxo pipefail + +. "$(dirname "$0")/aux-functions.sh" --source-only + +# Test standalone +test_package_with_feature "." "default,runtime-benchmarks" "" + +# Test parachain +test_package_with_feature "." "default,parachain,runtime-benchmarks" "" \ No newline at end of file From a0608e528ea5f68f6c7af3e1d0423b1a5bee7084 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 9 Jun 2023 15:58:30 +0200 Subject: [PATCH 35/53] Move ZBS/ZTG dust into the treasury (#1007) --- runtime/common/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 7d9a32352..33d29a07e 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -613,7 +613,7 @@ macro_rules! impl_config_traits { impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; - type DustRemoval = (); + type DustRemoval = Treasury; type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; type MaxLocks = MaxLocks; From 13f4e67a109d5676f4ef3c05933b267f19ef9905 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 9 Jun 2023 16:03:03 +0200 Subject: [PATCH 36/53] Use reasonable storage fee (#1011) * Use reasonable storage fee * Use deposit() to calculate storage fee in identity pallet * Upate changelog_for_devs --- docs/changelog_for_devs.md | 4 ++++ primitives/src/constants.rs | 4 +++- runtime/battery-station/src/parameters.rs | 6 +++--- runtime/zeitgeist/src/parameters.rs | 6 +++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index 28b75a85d..491cdde57 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -14,6 +14,7 @@ APIs/RPC interface. ## v0.3.9 +[#1011]: https://github.com/zeitgeistpm/zeitgeist/pull/1011 [#937]: https://github.com/zeitgeistpm/zeitgeist/pull/937 [#903]: https://github.com/zeitgeistpm/zeitgeist/pull/903 @@ -21,6 +22,9 @@ APIs/RPC interface. - ⚠️ Add `outsider` field to `MarketBonds` struct. In particular, the `Market` struct's layout has changed ([#903]). +- Adjust `deposit` function used to calculate storage fees for the following + pallets: identity, multisig, preimage, proxy. The cost of adding an identity + reduced from a minimum of 125 ZTG to a minimum of 1.5243 ZTG ([#1011]) ### Fixed diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index 1c66ffcd6..ec0dd7740 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -42,8 +42,10 @@ pub const CENT: Balance = BASE / 100; // 100_000_000 pub const MILLI: Balance = CENT / 10; // 10_000_000 pub const MICRO: Balance = MILLI / 1000; // 10_000 +/// Storage cost per byte and item. +// Approach: Achieve same cost per item and bytes in relation to total supply as on Polkadot. pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 20 * BASE + (bytes as Balance) * 100 * MILLI + items as Balance * 150 * CENT + (bytes as Balance) * 75 * MICRO } // Rikiddo and TokensConfig diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 0d9ee4467..753e92efd 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -119,9 +119,9 @@ parameter_types! { // Identity /// The amount held on deposit for a registered identity - pub const BasicDeposit: Balance = 8 * BASE; + pub const BasicDeposit: Balance = deposit(1, 258); /// The amount held on deposit per additional field for a registered identity. - pub const FieldDeposit: Balance = 256 * CENT; + pub const FieldDeposit: Balance = deposit(0, 66); /// Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O /// required to access an identity, but can be pretty high. pub const MaxAdditionalFields: u32 = 64; @@ -133,7 +133,7 @@ parameter_types! { /// The amount held on deposit for a registered subaccount. This should account for the fact /// that one storage item's value will increase by the size of an account ID, and there will /// be another trie item whose value is the size of an account ID plus 32 bytes. - pub const SubAccountDeposit: Balance = 2 * BASE; + pub const SubAccountDeposit: Balance = deposit(1, 53); // Liquidity Mining parameters /// Pallet identifier, mainly used for named balance reserves. diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 2b550afe9..f2aa054be 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -119,9 +119,9 @@ parameter_types! { // Identity /// The amount held on deposit for a registered identity - pub const BasicDeposit: Balance = 100 * BASE; + pub const BasicDeposit: Balance = deposit(1, 258); /// The amount held on deposit per additional field for a registered identity. - pub const FieldDeposit: Balance = 25 * BASE; + pub const FieldDeposit: Balance = deposit(0, 66); /// Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O /// required to access an identity, but can be pretty high. pub const MaxAdditionalFields: u32 = 16; @@ -133,7 +133,7 @@ parameter_types! { /// The amount held on deposit for a registered subaccount. This should account for the fact /// that one storage item's value will increase by the size of an account ID, and there will /// be another trie item whose value is the size of an account ID plus 32 bytes. - pub const SubAccountDeposit: Balance = 20 * BASE; + pub const SubAccountDeposit: Balance = deposit(1, 53); // Liquidity Mining parameters /// Pallet identifier, mainly used for named balance reserves. DO NOT CHANGE. From cd1d624c7844b329bc1e3c7fc3bf12a5ff353726 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Fri, 9 Jun 2023 16:29:19 +0200 Subject: [PATCH 37/53] Make `MaxMarketLifetime` a constant (#1014) --- zrml/prediction-markets/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 3d0e19204..053b81613 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -1644,6 +1644,7 @@ mod pallet { type MaxRejectReasonLen: Get; /// The maximum allowed duration of a market from creation to market close in blocks. + #[pallet::constant] type MaxMarketLifetime: Get; /// The maximum number of bytes allowed as edit reason. From 5f8602c11e6fc6109b2c043107bf29905dd0c06c Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 12 Jun 2023 15:11:13 +0200 Subject: [PATCH 38/53] Fix docs of `MarketEdited` (#1016) * Fix docs of `MarketEdited` * Fix punctuation and row length of docstrings --- zrml/prediction-markets/src/lib.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index 053b81613..e4390ed3e 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -1806,13 +1806,13 @@ mod pallet { where T: Config, { - /// Custom addition block initialization logic wasn't successful + /// Custom addition block initialization logic wasn't successful. BadOnInitialize, - /// A complete set of assets has been bought \[market_id, amount_per_asset, buyer\] + /// A complete set of assets has been bought. \[market_id, amount_per_asset, buyer\] BoughtCompleteSet(MarketIdOf, BalanceOf, ::AccountId), - /// A market has been approved \[market_id, new_market_status\] + /// A market has been approved. \[market_id, new_market_status\] MarketApproved(MarketIdOf, MarketStatus), - /// A market has been created \[market_id, market_account, market\] + /// A market has been created. \[market_id, market_account, market\] MarketCreated(MarketIdOf, T::AccountId, MarketOf), /// A market has been destroyed. \[market_id\] MarketDestroyed(MarketIdOf), @@ -1821,25 +1821,26 @@ mod pallet { /// A market was discarded after failing to gather enough subsidy. /// \[market_id, new_market_status\] MarketInsufficientSubsidy(MarketIdOf, MarketStatus), - /// A market has been closed \[market_id\] + /// A market has been closed. \[market_id\] MarketClosed(MarketIdOf), - /// A market has been disputed \[market_id, new_market_status, new_outcome\] + /// A market has been disputed. \[market_id, new_market_status, new_outcome\] MarketDisputed(MarketIdOf, MarketStatus, MarketDispute), /// An advised market has ended before it was approved or rejected. \[market_id\] MarketExpired(MarketIdOf), - /// A pending market has been rejected as invalid with a reason. \[market_id, reject_reason\] + /// A pending market has been rejected as invalid with a reason. + /// \[market_id, reject_reason\] MarketRejected(MarketIdOf, RejectReason), - /// A market has been reported on \[market_id, new_market_status, reported_outcome\] + /// A market has been reported on. \[market_id, new_market_status, reported_outcome\] MarketReported(MarketIdOf, MarketStatus, Report), - /// A market has been resolved \[market_id, new_market_status, real_outcome\] + /// A market has been resolved. \[market_id, new_market_status, real_outcome\] MarketResolved(MarketIdOf, MarketStatus, OutcomeReport), /// A proposed market has been requested edit by advisor. \[market_id, edit_reason\] MarketRequestedEdit(MarketIdOf, EditReason), - /// A proposed market has been edited by the market creator \[market_id\] + /// A proposed market has been edited by the market creator. \[market_id, new_market\] MarketEdited(MarketIdOf, MarketOf), - /// A complete set of assets has been sold \[market_id, amount_per_asset, seller\] + /// A complete set of assets has been sold. \[market_id, amount_per_asset, seller\] SoldCompleteSet(MarketIdOf, BalanceOf, ::AccountId), - /// An amount of winning outcomes have been redeemed + /// An amount of winning outcomes have been redeemed. /// \[market_id, currency_id, amount_redeemed, payout, who\] TokensRedeemed( MarketIdOf, From 7f1f880f915de0697ad6287c9a302ec230c837c1 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Wed, 14 Jun 2023 13:47:23 +0200 Subject: [PATCH 39/53] Add style guide (#1021) * Fix typos * Incorporate review feedback and make minor fixes --- docs/STYLE_GUIDE.md | 111 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 docs/STYLE_GUIDE.md diff --git a/docs/STYLE_GUIDE.md b/docs/STYLE_GUIDE.md new file mode 100644 index 000000000..1dc3d15f8 --- /dev/null +++ b/docs/STYLE_GUIDE.md @@ -0,0 +1,111 @@ +# Style guide + +## Comments + +- Comments **must** be wrapped at 100 chars per line. +- Comments **must** be formulated in markdown. + +## Doc comments + +- Documentation is written using Markdown syntax. +- Function documentation should be kept lean and mean. Try to avoid documenting + the parameters, and instead choose self-documenting parameter names. If + parameters interact in a complex manner (for example, if two arguments of type + `Vec` must have the same length), then add a paragraph explaining this. +- Begin every docstring with a meaningful one sentence description of the + function in third person. +- Avoid WET documentation such as this: + + ```rust + /// Rejects a market. + /// + /// # Arguments: + /// + /// - `origin`: The origin calling the dispatchable + /// - `market_id`: The market id of the market to reject + pub fn reject_market( + origin: OriginFor, + #[pallet::compact] market_id: MarketIdOf, + ) -> DispatchResultWithPostInfo { + // --- snip! --- + } + ``` + + Self-explanatory function arguments need not be documented if they are + explained in full text. Instead, focus on describing the effects of the + function. Someone who doesn't know how to read the code must be able to + understand what the function does. + +- Docstrings for dispatchable **should** contain a section on runtime complexity + (to make understanding the benchmarks easier). +- Docstrings for dispatchables need not document the `origin` parameter, but + should specify what origins the dispatchable may be called by. +- Docstrings for dispatchables **must** include the events that the dispatchable + emits. +- Use `#![doc = include_str!("../README.md")]`. +- Detail non-trivial algorithms in comments inside the function. + +An example of a good docstring would be this: + +```rust +/// Rejects a market, destroying the market and unreserving and/or slashing the creator's advisory +/// bond. +/// +/// May only be (successfully) called by `RejectOrigin`. The fraction of the advisory bond that is +/// slashed is determined by `AdvisoryBondSlashPercentage`. +pub fn reject_market( + origin: OriginFor, + #[pallet::compact] market_id: MarketIdOf, +) -> DispatchResultWithPostInfo { + // --- snip! --- +} +``` + +Info like "The fraction of the advisory bond that is slashed is determined by +`AdvisoryBondSlashPercentage`" **may** be stored in `README.md` to avoid +duplicating documentation. + +## Formatting + +- rustfmt and clippy have the last say in formatting. +- Format code contained in macro invocations (`impl_benchmarks!`, + `decl_runtime_apis!`, homebrew macros in `runtime/`, etc.) and attributes + (`#[pallet::weight(...)`, etc.) manually. +- Add trailing commas in macro invocations manually, as rustfmt won't add them + automatically. + + ```rust + ensure!( + a_very_very_very_very_very_very_very_long_variable, + b_very_very_very_very_very_very_very_long_variable, // This comma is not ensured by rustfmt. + ) + ``` + +## Code Style + +- Never use panickers. +- Prefer double turbofish `Vec::::new()` over single turbofish + `>::new()`. +- All branches of match expressions **should** be explicit. Avoid using the + catch-all `_ =>`. +- When changing enums, maintain the existing order and add variants only at the + end of the enum to prevent messing up indices. +- Maintain lexicographical ordering of traits in `#[derive(...)]` attributes. + +## Crate and Pallet Structure + +- Don't dump all code into `lib.rs`. Split code multiple files (`types.rs`, + `traits.rs`, etc.) or even modules (`types/`, `traits/`, etc.). +- Changes to pallets **must** retain order of dispatchables. +- Sort pallet contents in the following order: + - `Config` trait + - Type values + - Types + - Storage items + - Genesis info + - `Event` enum + - `Error` enum + - Hooks + - Dispatchables + - Pallet's public and private functions + - Trait impelmentations From 31d1700c53f15541abc2195618224d22c72850b2 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 14 Jun 2023 20:54:40 +0200 Subject: [PATCH 40/53] Add code owners (#1017) --- CODEOWNERS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 000000000..b48c5e381 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,15 @@ +# When a part of the project is modified that is owned by a code owner, +# the code owner has to be included in the respective PR's reviewer list. +# The code owner has the right to delegate the responsibility to review. +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + +/node/ @sea212 +/runtime/ @sea212 +/zrml/authorized/ @Chralt98 +/zrml/court/ @Chralt98 +/zrml/global-disputes/ @Chralt98 +/zrml/prediction-markets/ @maltekliemann +/zrml/rikiddo/ @sea212 +/zrml/simple-disputes/ @Chralt98 +/zrml/styx/ @yornaath +/zrml/swaps/ @maltekliemann From ffacbba706bba67bab1a92aed0e5f8931625d7ec Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Fri, 16 Jun 2023 12:55:52 +0200 Subject: [PATCH 41/53] Add pull request template (#1018) * Add pull request template * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Malte Kliemann --------- Co-authored-by: Malte Kliemann --- .github/PULL_REQUEST_TEMPLATE.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..512de3b3e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,20 @@ + + +### What does it do? + +### What important points should reviewers know? + +### Is there something left for follow-up PRs? + +### What alternative implementations were considered? + +### Are there relevant PRs or issues? + + + + + + + +### References + From 663388ae03128bf40fcb3efe3ddeb7f9b9aa8bd3 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 21 Jun 2023 10:07:46 +0200 Subject: [PATCH 42/53] Include pallet-contracts into the runtime (#1012) * Include pallet-contracts into the runtime * Add contracts to RuntimeApi * Add pallet-contracts to benchmarks * Add permission gate for contract deployment on mainnet --- Cargo.lock | 57 + runtime/battery-station/Cargo.toml | 6 + runtime/battery-station/src/lib.rs | 2 +- runtime/battery-station/src/parameters.rs | 18 +- runtime/common/Cargo.toml | 4 + runtime/common/src/lib.rs | 91 ++ runtime/common/src/weights/mod.rs | 1 + .../common/src/weights/pallet_contracts.rs | 1023 +++++++++++++++++ runtime/zeitgeist/Cargo.toml | 6 + runtime/zeitgeist/src/lib.rs | 16 +- runtime/zeitgeist/src/parameters.rs | 18 +- scripts/benchmarks/configuration.sh | 22 +- 12 files changed, 1248 insertions(+), 16 deletions(-) create mode 100644 runtime/common/src/weights/pallet_contracts.rs diff --git a/Cargo.lock b/Cargo.lock index 12e08b0aa..6835c3a63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -481,6 +481,8 @@ dependencies = [ "pallet-balances", "pallet-bounties", "pallet-collective", + "pallet-contracts", + "pallet-contracts-primitives", "pallet-democracy", "pallet-grandpa", "pallet-identity", @@ -1113,6 +1115,8 @@ dependencies = [ "pallet-balances", "pallet-bounties", "pallet-collective", + "pallet-contracts", + "pallet-contracts-primitives", "pallet-democracy", "pallet-identity", "pallet-membership", @@ -5481,6 +5485,57 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-contracts" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "bitflags", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-contracts-primitives", + "pallet-contracts-proc-macro", + "parity-scale-codec", + "rand 0.8.5", + "rand_pcg 0.3.1", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", + "sp-sandbox", + "sp-std", + "wasm-instrument", + "wasmi-validation", +] + +[[package]] +name = "pallet-contracts-primitives" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "bitflags", + "parity-scale-codec", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-contracts-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.32#5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" @@ -12920,6 +12975,8 @@ dependencies = [ "pallet-balances", "pallet-bounties", "pallet-collective", + "pallet-contracts", + "pallet-contracts-primitives", "pallet-democracy", "pallet-grandpa", "pallet-identity", diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 7f5b02a17..74a3549de 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -14,6 +14,8 @@ orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "ht pallet-balances = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-bounties = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-collective = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-contracts = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-contracts-primitives = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-democracy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-identity = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-membership = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } @@ -183,6 +185,7 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-bounties/runtime-benchmarks", "pallet-collective/runtime-benchmarks", + "pallet-contracts/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-identity/runtime-benchmarks", @@ -225,6 +228,8 @@ std = [ "pallet-balances/std", "pallet-bounties/std", "pallet-collective/std", + "pallet-contracts/std", + "pallet-contracts-primitives/std", "pallet-democracy/std", "pallet-identity/std", "pallet-membership/std", @@ -350,6 +355,7 @@ try-runtime = [ "pallet-membership/try-runtime", # Other Parity runtime pallets + "pallet-contracts/try-runtime", "pallet-identity/try-runtime", "pallet-utility/try-runtime", diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index ed7b8c43a..c95e707a4 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -43,7 +43,7 @@ pub use crate::parameters::*; use alloc::vec; use frame_support::{ traits::{ConstU16, ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter}, - weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee}, + weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee, Weight}, }; use frame_system::EnsureRoot; use pallet_collective::{EnsureProportionAtLeast, PrimeDefaultVote}; diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 753e92efd..67b791636 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -22,7 +22,7 @@ clippy::arithmetic_side_effects )] -use super::VERSION; +use super::{Runtime, VERSION}; use frame_support::{ dispatch::DispatchClass, parameter_types, @@ -80,6 +80,20 @@ parameter_types! { pub const TechnicalCommitteeMaxProposals: u32 = 64; pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * BLOCKS_PER_DAY; + // Contracts + pub const ContractsDeletionQueueDepth: u32 = 128; + pub ContractsDeletionWeightLimit: Weight = Perbill::from_percent(10) + * RuntimeBlockWeights::get() + .per_class + .get(DispatchClass::Normal) + .max_total + .unwrap_or(RuntimeBlockWeights::get().max_block); + pub const ContractsDepositPerByte: Balance = deposit(0,1); + pub const ContractsDepositPerItem: Balance = deposit(1,0); + pub const ContractsMaxCodeLen: u32 = 246 * 1024; + pub const ContractsMaxStorageKeyLen: u32 = 128; + pub ContractsSchedule: pallet_contracts::Schedule = Default::default(); + // Court /// Duration of a single court case. pub const CourtCaseDuration: u64 = BLOCKS_PER_DAY; @@ -393,7 +407,7 @@ parameter_type_with_key! { #[cfg(feature = "parachain")] Asset::ForeignAsset(id) => { let maybe_metadata = < - orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect + orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect >::metadata(&Asset::ForeignAsset(*id)); if let Some(metadata) = maybe_metadata { diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index c35c07394..1e8550da0 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -11,6 +11,8 @@ pallet-author-slot-filter = { default-features = false, git = "https://github.co pallet-balances = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-bounties = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-collective = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-contracts = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-contracts-primitives = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-democracy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-identity = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-membership = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } @@ -51,6 +53,8 @@ std = [ "pallet-balances/std", "pallet-bounties/std", "pallet-collective/std", + "pallet-contracts/std", + "pallet-contracts-primitives/std", "pallet-democracy/std", "pallet-identity/std", "pallet-membership/std", diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 33d29a07e..fe45f8c55 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -303,6 +303,7 @@ macro_rules! create_runtime { Identity: pallet_identity::{Call, Event, Pallet, Storage} = 30, Utility: pallet_utility::{Call, Event, Pallet, Storage} = 31, Proxy: pallet_proxy::{Call, Event, Pallet, Storage} = 32, + Contracts: pallet_contracts = 33, // Third-party AssetManager: orml_currencies::{Call, Pallet, Storage} = 40, @@ -655,6 +656,27 @@ macro_rules! impl_config_traits { type WeightInfo = weights::pallet_collective::WeightInfo; } + impl pallet_contracts::Config for Runtime { + type AddressGenerator = pallet_contracts::DefaultAddressGenerator; + type CallFilter = frame_support::traits::Nothing; + type CallStack = [pallet_contracts::Frame::; 5]; + type ChainExtension = (); + type Currency = Balances; + type DeletionQueueDepth = ContractsDeletionQueueDepth; + type DeletionWeightLimit = ContractsDeletionWeightLimit; + type DepositPerItem = ContractsDepositPerItem; + type DepositPerByte = ContractsDepositPerByte; + type MaxCodeLen = ContractsMaxCodeLen; + type MaxStorageKeyLen = ContractsMaxStorageKeyLen; + type Randomness = RandomnessCollectiveFlip; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Schedule = ContractsSchedule; + type Time = Timestamp; + type WeightPrice = pallet_transaction_payment::Pallet; + type WeightInfo = weights::pallet_contracts::WeightInfo; + } + impl pallet_democracy::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -1124,6 +1146,10 @@ macro_rules! impl_config_traits { #[macro_export] macro_rules! create_runtime_api { ($($additional_apis:tt)*) => { + // Prints debug output of the `contracts` pallet to stdout if the node is + // started with `-lruntime::contracts=debug`. + const CONTRACTS_DEBUG_OUTPUT: bool = true; + impl_runtime_apis! { #[cfg(feature = "parachain")] impl cumulus_primitives_core::CollectCollationInfo for Runtime { @@ -1204,6 +1230,7 @@ macro_rules! create_runtime_api { list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_bounties, Bounties); list_benchmark!(list, extra, pallet_collective, AdvisoryCommittee); + list_benchmark!(list, extra, pallet_contracts, Contracts); list_benchmark!(list, extra, pallet_democracy, Democracy); list_benchmark!(list, extra, pallet_identity, Identity); list_benchmark!(list, extra, pallet_membership, AdvisoryCommitteeMembership); @@ -1282,6 +1309,7 @@ macro_rules! create_runtime_api { add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_bounties, Bounties); add_benchmark!(params, batches, pallet_collective, AdvisoryCommittee); + add_benchmark!(params, batches, pallet_contracts, Contracts); add_benchmark!(params, batches, pallet_democracy, Democracy); add_benchmark!(params, batches, pallet_identity, Identity); add_benchmark!(params, batches, pallet_membership, AdvisoryCommitteeMembership); @@ -1330,6 +1358,69 @@ macro_rules! create_runtime_api { } } + impl pallet_contracts::ContractsApi + for Runtime + { + fn call( + origin: AccountId, + dest: AccountId, + value: Balance, + gas_limit: Option, + storage_deposit_limit: Option, + input_data: Vec, + ) -> pallet_contracts_primitives::ContractExecResult { + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_call( + origin, + dest, + value, + gas_limit, + storage_deposit_limit, + input_data, + CONTRACTS_DEBUG_OUTPUT, + ) + } + + fn instantiate( + origin: AccountId, + value: Balance, + gas_limit: Option, + storage_deposit_limit: Option, + code: pallet_contracts_primitives::Code, + data: Vec, + salt: Vec, + ) -> pallet_contracts_primitives::ContractInstantiateResult + { + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_instantiate( + origin, + value, + gas_limit, + storage_deposit_limit, + code, + data, + salt, + CONTRACTS_DEBUG_OUTPUT, + ) + } + + fn upload_code( + origin: AccountId, + code: Vec, + storage_deposit_limit: Option, + ) -> pallet_contracts_primitives::CodeUploadResult + { + Contracts::bare_upload_code(origin, code, storage_deposit_limit) + } + + fn get_storage( + address: AccountId, + key: Vec, + ) -> pallet_contracts_primitives::GetStorageResult { + Contracts::get_storage(address, key) + } + } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { fn query_fee_details( uxt: ::Extrinsic, diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index 02d4ad48c..826493ca0 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -35,6 +35,7 @@ pub mod orml_tokens; pub mod pallet_balances; pub mod pallet_bounties; pub mod pallet_collective; +pub mod pallet_contracts; pub mod pallet_democracy; pub mod pallet_identity; pub mod pallet_membership; diff --git a/runtime/common/src/weights/pallet_contracts.rs b/runtime/common/src/weights/pallet_contracts.rs new file mode 100644 index 000000000..38c6847d3 --- /dev/null +++ b/runtime/common/src/weights/pallet_contracts.rs @@ -0,0 +1,1023 @@ +// Copyright 2021-2022 Zeitgeist PM LLC. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, 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. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +//! Autogenerated weights for pallet_contracts +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-06-12, STEPS: `2`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/production/zeitgeist +// benchmark +// pallet +// --chain=dev +// --steps=2 +// --repeat=2 +// --pallet=pallet_contracts +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=./misc/frame_weight_template.hbs +// --output=./runtime/common/src/weights/ + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use core::marker::PhantomData; +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; + +/// Weight functions for pallet_contracts (automatically generated) +pub struct WeightInfo(PhantomData); +impl pallet_contracts::weights::WeightInfo for WeightInfo { + // Storage: Contracts DeletionQueue (r:1 w:0) + fn on_process_deletion_queue_batch() -> Weight { + Weight::from_ref_time(5_601_000).saturating_add(T::DbWeight::get().reads(1)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn on_initialize_per_trie_key(k: u32) -> Weight { + Weight::from_ref_time(12_188_000) + // Standard Error: 20_156 + .saturating_add(Weight::from_ref_time(912_369).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) + } + // Storage: Contracts DeletionQueue (r:1 w:0) + fn on_initialize_per_queue_item(q: u32) -> Weight { + Weight::from_ref_time(4_543_500) + // Standard Error: 44_304 + .saturating_add(Weight::from_ref_time(1_222_128).saturating_mul(q.into())) + .saturating_add(T::DbWeight::get().reads(1)) + } + // Storage: Contracts PristineCode (r:1 w:0) + // Storage: Contracts CodeStorage (r:0 w:1) + fn reinstrument(c: u32) -> Weight { + Weight::from_ref_time(22_137_000) + // Standard Error: 1_247 + .saturating_add(Weight::from_ref_time(39_526).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: System EventTopics (r:2 w:2) + fn call_with_code_per_byte(c: u32) -> Weight { + Weight::from_ref_time(222_683_000) + // Standard Error: 785 + .saturating_add(Weight::from_ref_time(43_823).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Contracts CodeStorage (r:1 w:1) + // Storage: Contracts Nonce (r:1 w:1) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: System EventTopics (r:3 w:3) + // Storage: Contracts PristineCode (r:0 w:1) + // Storage: Contracts OwnerInfoOf (r:0 w:1) + fn instantiate_with_code(c: u32, s: u32) -> Weight { + Weight::from_ref_time(1_809_550_000) + // Standard Error: 5_129 + .saturating_add(Weight::from_ref_time(91_744).saturating_mul(c.into())) + // Standard Error: 628 + .saturating_add(Weight::from_ref_time(893).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Contracts CodeStorage (r:1 w:1) + // Storage: Contracts Nonce (r:1 w:1) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: Contracts OwnerInfoOf (r:1 w:1) + // Storage: System EventTopics (r:2 w:2) + fn instantiate(s: u32) -> Weight { + Weight::from_ref_time(260_380_000) + // Standard Error: 181 + .saturating_add(Weight::from_ref_time(1_426).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System Account (r:1 w:1) + // Storage: System EventTopics (r:2 w:2) + fn call() -> Weight { + Weight::from_ref_time(171_877_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Contracts CodeStorage (r:1 w:1) + // Storage: System EventTopics (r:1 w:1) + // Storage: Contracts PristineCode (r:0 w:1) + // Storage: Contracts OwnerInfoOf (r:0 w:1) + fn upload_code(c: u32) -> Weight { + Weight::from_ref_time(60_179_500) + // Standard Error: 2_818 + .saturating_add(Weight::from_ref_time(43_033).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Contracts OwnerInfoOf (r:1 w:1) + // Storage: System EventTopics (r:1 w:1) + // Storage: Contracts CodeStorage (r:0 w:1) + // Storage: Contracts PristineCode (r:0 w:1) + fn remove_code() -> Weight { + Weight::from_ref_time(33_654_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts OwnerInfoOf (r:2 w:2) + // Storage: System EventTopics (r:3 w:3) + fn set_code() -> Weight { + Weight::from_ref_time(36_960_000) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_caller(r: u32) -> Weight { + Weight::from_ref_time(258_116_000) + // Standard Error: 1_194_288 + .saturating_add(Weight::from_ref_time(27_047_925).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_is_contract(r: u32) -> Weight { + Weight::from_ref_time(215_810_500) + // Standard Error: 1_262_523 + .saturating_add(Weight::from_ref_time(212_179_950).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_code_hash(r: u32) -> Weight { + Weight::from_ref_time(223_645_500) + // Standard Error: 8_900_222 + .saturating_add(Weight::from_ref_time(283_481_800).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_own_code_hash(r: u32) -> Weight { + Weight::from_ref_time(216_331_500) + // Standard Error: 809_749 + .saturating_add(Weight::from_ref_time(34_325_500).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_caller_is_origin(r: u32) -> Weight { + Weight::from_ref_time(220_584_000) + // Standard Error: 2_759_015 + .saturating_add(Weight::from_ref_time(16_052_800).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_address(r: u32) -> Weight { + Weight::from_ref_time(226_841_500) + // Standard Error: 1_648_740 + .saturating_add(Weight::from_ref_time(32_791_075).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_gas_left(r: u32) -> Weight { + Weight::from_ref_time(220_184_000) + // Standard Error: 10_297_479 + .saturating_add(Weight::from_ref_time(44_753_825).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_balance(r: u32) -> Weight { + Weight::from_ref_time(253_877_500) + // Standard Error: 2_419_606 + .saturating_add(Weight::from_ref_time(113_089_550).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_value_transferred(r: u32) -> Weight { + Weight::from_ref_time(246_493_500) + // Standard Error: 1_126_023 + .saturating_add(Weight::from_ref_time(28_976_600).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_minimum_balance(r: u32) -> Weight { + Weight::from_ref_time(272_463_000) + // Standard Error: 945_023 + .saturating_add(Weight::from_ref_time(28_268_750).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_block_number(r: u32) -> Weight { + Weight::from_ref_time(264_879_000) + // Standard Error: 230_965 + .saturating_add(Weight::from_ref_time(27_293_875).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_now(r: u32) -> Weight { + Weight::from_ref_time(280_674_000) + // Standard Error: 257_381 + .saturating_add(Weight::from_ref_time(27_561_650).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) + fn seal_weight_to_fee(r: u32) -> Weight { + Weight::from_ref_time(228_599_500) + // Standard Error: 5_459_062 + .saturating_add(Weight::from_ref_time(107_516_700).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_gas(r: u32) -> Weight { + Weight::from_ref_time(154_333_500) + // Standard Error: 1_000_546 + .saturating_add(Weight::from_ref_time(14_770_100).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_input(r: u32) -> Weight { + Weight::from_ref_time(221_481_000) + // Standard Error: 549_135 + .saturating_add(Weight::from_ref_time(30_928_325).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_input_per_kb(n: u32) -> Weight { + Weight::from_ref_time(257_149_000) + // Standard Error: 135_607 + .saturating_add(Weight::from_ref_time(11_581_851).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_return(_r: u32) -> Weight { + Weight::from_ref_time(221_856_500) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_return_per_kb(n: u32) -> Weight { + Weight::from_ref_time(217_413_500) + // Standard Error: 68_119 + .saturating_add(Weight::from_ref_time(248_573).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + // Storage: Contracts DeletionQueue (r:1 w:1) + // Storage: Contracts OwnerInfoOf (r:1 w:1) + fn seal_terminate(r: u32) -> Weight { + Weight::from_ref_time(306_287_500) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((5_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(r.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) + fn seal_random(r: u32) -> Weight { + Weight::from_ref_time(224_070_500) + // Standard Error: 10_783_896 + .saturating_add(Weight::from_ref_time(133_815_475).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_deposit_event(r: u32) -> Weight { + Weight::from_ref_time(218_450_000) + // Standard Error: 2_871_571 + .saturating_add(Weight::from_ref_time(231_214_125).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32) -> Weight { + Weight::from_ref_time(599_450_000) + // Standard Error: 38_702_551 + .saturating_add(Weight::from_ref_time(114_331_125).saturating_mul(t.into())) + // Standard Error: 9_675_637 + .saturating_add(Weight::from_ref_time(67_165_531).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(t.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(t.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_debug_message(r: u32) -> Weight { + Weight::from_ref_time(261_182_000) + // Standard Error: 491_229 + .saturating_add(Weight::from_ref_time(16_862_800).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_set_storage(r: u32) -> Weight { + Weight::from_ref_time(222_272_500) + // Standard Error: 2_118_999 + .saturating_add(Weight::from_ref_time(419_849_350).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_set_storage_per_new_kb(n: u32) -> Weight { + Weight::from_ref_time(367_548_500) + // Standard Error: 7_446_959 + .saturating_add(Weight::from_ref_time(116_620_562).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_set_storage_per_old_kb(n: u32) -> Weight { + Weight::from_ref_time(400_932_500) + // Standard Error: 5_751_991 + .saturating_add(Weight::from_ref_time(75_846_125).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(6)) + .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_clear_storage(r: u32) -> Weight { + Weight::from_ref_time(256_498_000) + // Standard Error: 9_619_229 + .saturating_add(Weight::from_ref_time(421_739_950).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_clear_storage_per_kb(n: u32) -> Weight { + Weight::from_ref_time(340_707_500) + // Standard Error: 6_183_127 + .saturating_add(Weight::from_ref_time(78_563_125).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_get_storage(r: u32) -> Weight { + Weight::from_ref_time(224_135_500) + // Standard Error: 1_954_553 + .saturating_add(Weight::from_ref_time(331_546_500).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_get_storage_per_kb(n: u32) -> Weight { + Weight::from_ref_time(337_677_500) + // Standard Error: 7_249_799 + .saturating_add(Weight::from_ref_time(135_275_875).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_contains_storage(r: u32) -> Weight { + Weight::from_ref_time(226_766_500) + // Standard Error: 2_438_900 + .saturating_add(Weight::from_ref_time(320_889_600).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_contains_storage_per_kb(n: u32) -> Weight { + Weight::from_ref_time(326_977_000) + // Standard Error: 2_469_716 + .saturating_add(Weight::from_ref_time(64_628_437).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_take_storage(r: u32) -> Weight { + Weight::from_ref_time(230_994_000) + // Standard Error: 437_574 + .saturating_add(Weight::from_ref_time(416_743_400).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn seal_take_storage_per_kb(n: u32) -> Weight { + Weight::from_ref_time(444_981_500) + // Standard Error: 3_200_572 + .saturating_add(Weight::from_ref_time(134_229_000).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_transfer(r: u32) -> Weight { + Weight::from_ref_time(227_076_500) + // Standard Error: 11_053_559 + .saturating_add(Weight::from_ref_time(1_323_468_750).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_call(r: u32) -> Weight { + Weight::from_ref_time(224_246_500) + // Standard Error: 14_446_751 + .saturating_add(Weight::from_ref_time(15_256_636_875).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((160_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((160_u64).saturating_mul(r.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_delegate_call(r: u32) -> Weight { + Weight::from_ref_time(229_276_000) + // Standard Error: 3_317_526 + .saturating_add(Weight::from_ref_time(15_212_235_325).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((154_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((77_u64).saturating_mul(r.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:81 w:81) + // Storage: Contracts CodeStorage (r:2 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:82 w:82) + fn seal_call_per_transfer_clone_kb(t: u32, c: u32) -> Weight { + Weight::from_ref_time(9_695_780_999) + // Standard Error: 369_697_173 + .saturating_add(Weight::from_ref_time(1_329_061_000).saturating_mul(t.into())) + // Standard Error: 361_032 + .saturating_add(Weight::from_ref_time(10_959_798).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(167)) + .saturating_add(T::DbWeight::get().reads((81_u64).saturating_mul(t.into()))) + .saturating_add(T::DbWeight::get().writes(163)) + .saturating_add(T::DbWeight::get().writes((81_u64).saturating_mul(t.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + // Storage: Contracts Nonce (r:1 w:1) + // Storage: Contracts OwnerInfoOf (r:1600 w:1600) + fn seal_instantiate(r: u32) -> Weight { + Weight::from_ref_time(228_539_500) + // Standard Error: 20_816_729 + .saturating_add(Weight::from_ref_time(22_123_910_350).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((400_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((400_u64).saturating_mul(r.into()))) + } + // Storage: System Account (r:81 w:81) + // Storage: Contracts ContractInfoOf (r:81 w:81) + // Storage: Contracts CodeStorage (r:2 w:1) + // Storage: Timestamp Now (r:1 w:0) + // Storage: Contracts Nonce (r:1 w:1) + // Storage: Contracts OwnerInfoOf (r:1 w:1) + // Storage: System EventTopics (r:82 w:82) + fn seal_instantiate_per_transfer_salt_kb(t: u32, s: u32) -> Weight { + Weight::from_ref_time(8_301_534_499) + // Standard Error: 781_021_718 + .saturating_add(Weight::from_ref_time(5_260_321_499).saturating_mul(t.into())) + // Standard Error: 813_564 + .saturating_add(Weight::from_ref_time(117_025_008).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(249)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) + .saturating_add(T::DbWeight::get().writes(247)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_sha2_256(r: u32) -> Weight { + Weight::from_ref_time(216_401_000) + // Standard Error: 256_876 + .saturating_add(Weight::from_ref_time(35_677_125).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_sha2_256_per_kb(n: u32) -> Weight { + Weight::from_ref_time(299_213_499) + // Standard Error: 13_573 + .saturating_add(Weight::from_ref_time(78_232_935).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_keccak_256(r: u32) -> Weight { + Weight::from_ref_time(213_370_000) + // Standard Error: 220_043 + .saturating_add(Weight::from_ref_time(61_565_850).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_keccak_256_per_kb(n: u32) -> Weight { + Weight::from_ref_time(335_316_999) + // Standard Error: 684_961 + .saturating_add(Weight::from_ref_time(226_346_456).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_blake2_256(r: u32) -> Weight { + Weight::from_ref_time(234_331_000) + // Standard Error: 255_403 + .saturating_add(Weight::from_ref_time(39_786_375).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_blake2_256_per_kb(n: u32) -> Weight { + Weight::from_ref_time(263_570_999) + // Standard Error: 131_422 + .saturating_add(Weight::from_ref_time(111_246_290).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_blake2_128(r: u32) -> Weight { + Weight::from_ref_time(221_632_000) + // Standard Error: 2_067_178 + .saturating_add(Weight::from_ref_time(43_783_475).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_hash_blake2_128_per_kb(n: u32) -> Weight { + Weight::from_ref_time(254_598_999) + // Standard Error: 951_690 + .saturating_add(Weight::from_ref_time(109_899_369).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_ecdsa_recover(r: u32) -> Weight { + Weight::from_ref_time(221_882_000) + // Standard Error: 54_352_059 + .saturating_add(Weight::from_ref_time(2_997_249_925).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + fn seal_ecdsa_to_eth_address(r: u32) -> Weight { + Weight::from_ref_time(219_738_000) + // Standard Error: 17_755_459 + .saturating_add(Weight::from_ref_time(2_157_771_450).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:0) + // Storage: Contracts ContractInfoOf (r:1 w:1) + // Storage: Contracts CodeStorage (r:1 w:0) + // Storage: Timestamp Now (r:1 w:0) + // Storage: System EventTopics (r:2 w:2) + // Storage: Contracts OwnerInfoOf (r:1536 w:1536) + fn seal_set_code_hash(r: u32) -> Weight { + Weight::from_ref_time(226_541_000) + // Standard Error: 24_142_120 + .saturating_add(Weight::from_ref_time(1_085_830_150).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().reads((154_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes((154_u64).saturating_mul(r.into()))) + } + fn instr_i64const(r: u32) -> Weight { + Weight::from_ref_time(133_879_500) + // Standard Error: 2_106_283 + .saturating_add(Weight::from_ref_time(724_170).saturating_mul(r.into())) + } + fn instr_i64load(r: u32) -> Weight { + Weight::from_ref_time(134_084_500) + // Standard Error: 3_462_466 + .saturating_add(Weight::from_ref_time(4_334_050).saturating_mul(r.into())) + } + fn instr_i64store(r: u32) -> Weight { + Weight::from_ref_time(149_699_500) + // Standard Error: 2_413_431 + .saturating_add(Weight::from_ref_time(3_329_330).saturating_mul(r.into())) + } + fn instr_select(r: u32) -> Weight { + Weight::from_ref_time(146_458_500) + // Standard Error: 2_063_443 + .saturating_add(Weight::from_ref_time(3_161_800).saturating_mul(r.into())) + } + fn instr_if(r: u32) -> Weight { + Weight::from_ref_time(147_836_000) + // Standard Error: 1_716_657 + .saturating_add(Weight::from_ref_time(1_054_300).saturating_mul(r.into())) + } + fn instr_br(_r: u32) -> Weight { + Weight::from_ref_time(239_646_000) + } + fn instr_br_if(r: u32) -> Weight { + Weight::from_ref_time(167_453_000) + // Standard Error: 2_742_173 + .saturating_add(Weight::from_ref_time(1_656_160).saturating_mul(r.into())) + } + fn instr_br_table(r: u32) -> Weight { + Weight::from_ref_time(140_782_500) + // Standard Error: 1_764_839 + .saturating_add(Weight::from_ref_time(3_232_850).saturating_mul(r.into())) + } + fn instr_br_table_per_entry(_e: u32) -> Weight { + Weight::from_ref_time(138_957_211) + } + fn instr_call(r: u32) -> Weight { + Weight::from_ref_time(136_520_000) + // Standard Error: 1_388_131 + .saturating_add(Weight::from_ref_time(8_829_590).saturating_mul(r.into())) + } + fn instr_call_indirect(r: u32) -> Weight { + Weight::from_ref_time(158_130_500) + // Standard Error: 2_204_834 + .saturating_add(Weight::from_ref_time(6_753_540).saturating_mul(r.into())) + } + fn instr_call_indirect_per_param(_p: u32) -> Weight { + Weight::from_ref_time(246_503_500) + } + fn instr_local_get(_r: u32) -> Weight { + Weight::from_ref_time(240_236_500) + } + fn instr_local_set(r: u32) -> Weight { + Weight::from_ref_time(136_649_500) + // Standard Error: 2_852_448 + .saturating_add(Weight::from_ref_time(1_982_070).saturating_mul(r.into())) + } + fn instr_local_tee(r: u32) -> Weight { + Weight::from_ref_time(135_037_000) + // Standard Error: 2_448_578 + .saturating_add(Weight::from_ref_time(1_944_590).saturating_mul(r.into())) + } + fn instr_global_get(r: u32) -> Weight { + Weight::from_ref_time(138_924_000) + // Standard Error: 2_171_957 + .saturating_add(Weight::from_ref_time(1_362_690).saturating_mul(r.into())) + } + fn instr_global_set(r: u32) -> Weight { + Weight::from_ref_time(167_463_500) + // Standard Error: 2_509_565 + .saturating_add(Weight::from_ref_time(787_600).saturating_mul(r.into())) + } + fn instr_memory_current(_r: u32) -> Weight { + Weight::from_ref_time(250_090_500) + } + fn instr_memory_grow(r: u32) -> Weight { + Weight::from_ref_time(127_742_500) + // Standard Error: 194_986_862 + .saturating_add(Weight::from_ref_time(328_214_500).saturating_mul(r.into())) + } + fn instr_i64clz(r: u32) -> Weight { + Weight::from_ref_time(125_298_500) + // Standard Error: 1_780_088 + .saturating_add(Weight::from_ref_time(1_247_170).saturating_mul(r.into())) + } + fn instr_i64ctz(r: u32) -> Weight { + Weight::from_ref_time(126_705_500) + // Standard Error: 2_444_986 + .saturating_add(Weight::from_ref_time(1_644_940).saturating_mul(r.into())) + } + fn instr_i64popcnt(r: u32) -> Weight { + Weight::from_ref_time(129_050_500) + // Standard Error: 1_899_905 + .saturating_add(Weight::from_ref_time(1_162_010).saturating_mul(r.into())) + } + fn instr_i64eqz(r: u32) -> Weight { + Weight::from_ref_time(138_117_500) + // Standard Error: 1_493_127 + .saturating_add(Weight::from_ref_time(1_696_230).saturating_mul(r.into())) + } + fn instr_i64extendsi32(r: u32) -> Weight { + Weight::from_ref_time(129_316_000) + // Standard Error: 1_991_382 + .saturating_add(Weight::from_ref_time(972_950).saturating_mul(r.into())) + } + fn instr_i64extendui32(r: u32) -> Weight { + Weight::from_ref_time(129_526_000) + // Standard Error: 2_663_633 + .saturating_add(Weight::from_ref_time(1_811_650).saturating_mul(r.into())) + } + fn instr_i32wrapi64(r: u32) -> Weight { + Weight::from_ref_time(129_817_000) + // Standard Error: 1_646_172 + .saturating_add(Weight::from_ref_time(1_403_260).saturating_mul(r.into())) + } + fn instr_i64eq(r: u32) -> Weight { + Weight::from_ref_time(177_773_000) + // Standard Error: 1_919_647 + .saturating_add(Weight::from_ref_time(2_699_240).saturating_mul(r.into())) + } + fn instr_i64ne(r: u32) -> Weight { + Weight::from_ref_time(154_824_000) + // Standard Error: 2_615_944 + .saturating_add(Weight::from_ref_time(3_194_790).saturating_mul(r.into())) + } + fn instr_i64lts(r: u32) -> Weight { + Weight::from_ref_time(127_998_500) + // Standard Error: 2_297_682 + .saturating_add(Weight::from_ref_time(3_243_360).saturating_mul(r.into())) + } + fn instr_i64ltu(r: u32) -> Weight { + Weight::from_ref_time(130_728_500) + // Standard Error: 2_028_620 + .saturating_add(Weight::from_ref_time(2_825_070).saturating_mul(r.into())) + } + fn instr_i64gts(r: u32) -> Weight { + Weight::from_ref_time(130_758_000) + // Standard Error: 1_909_467 + .saturating_add(Weight::from_ref_time(2_726_190).saturating_mul(r.into())) + } + fn instr_i64gtu(r: u32) -> Weight { + Weight::from_ref_time(167_383_500) + // Standard Error: 2_786_505 + .saturating_add(Weight::from_ref_time(2_137_860).saturating_mul(r.into())) + } + fn instr_i64les(r: u32) -> Weight { + Weight::from_ref_time(132_717_500) + // Standard Error: 1_803_737 + .saturating_add(Weight::from_ref_time(3_423_810).saturating_mul(r.into())) + } + fn instr_i64leu(r: u32) -> Weight { + Weight::from_ref_time(159_107_500) + // Standard Error: 1_771_521 + .saturating_add(Weight::from_ref_time(2_995_290).saturating_mul(r.into())) + } + fn instr_i64ges(r: u32) -> Weight { + Weight::from_ref_time(156_572_500) + // Standard Error: 2_492_197 + .saturating_add(Weight::from_ref_time(3_026_450).saturating_mul(r.into())) + } + fn instr_i64geu(r: u32) -> Weight { + Weight::from_ref_time(128_299_000) + // Standard Error: 2_022_417 + .saturating_add(Weight::from_ref_time(2_934_680).saturating_mul(r.into())) + } + fn instr_i64add(r: u32) -> Weight { + Weight::from_ref_time(130_759_000) + // Standard Error: 2_033_437 + .saturating_add(Weight::from_ref_time(3_087_270).saturating_mul(r.into())) + } + fn instr_i64sub(r: u32) -> Weight { + Weight::from_ref_time(146_258_500) + // Standard Error: 2_179_028 + .saturating_add(Weight::from_ref_time(2_515_360).saturating_mul(r.into())) + } + fn instr_i64mul(r: u32) -> Weight { + Weight::from_ref_time(133_498_500) + // Standard Error: 2_664_876 + .saturating_add(Weight::from_ref_time(2_167_540).saturating_mul(r.into())) + } + fn instr_i64divs(r: u32) -> Weight { + Weight::from_ref_time(152_986_000) + // Standard Error: 1_842_682 + .saturating_add(Weight::from_ref_time(2_771_070).saturating_mul(r.into())) + } + fn instr_i64divu(r: u32) -> Weight { + Weight::from_ref_time(152_459_500) + // Standard Error: 2_601_136 + .saturating_add(Weight::from_ref_time(3_082_670).saturating_mul(r.into())) + } + fn instr_i64rems(r: u32) -> Weight { + Weight::from_ref_time(130_788_500) + // Standard Error: 2_724_683 + .saturating_add(Weight::from_ref_time(3_885_790).saturating_mul(r.into())) + } + fn instr_i64remu(r: u32) -> Weight { + Weight::from_ref_time(131_761_000) + // Standard Error: 2_122_468 + .saturating_add(Weight::from_ref_time(3_058_420).saturating_mul(r.into())) + } + fn instr_i64and(r: u32) -> Weight { + Weight::from_ref_time(131_199_500) + // Standard Error: 1_988_113 + .saturating_add(Weight::from_ref_time(2_814_650).saturating_mul(r.into())) + } + fn instr_i64or(r: u32) -> Weight { + Weight::from_ref_time(131_701_000) + // Standard Error: 3_411_146 + .saturating_add(Weight::from_ref_time(4_597_930).saturating_mul(r.into())) + } + fn instr_i64xor(r: u32) -> Weight { + Weight::from_ref_time(131_831_000) + // Standard Error: 2_596_792 + .saturating_add(Weight::from_ref_time(3_670_370).saturating_mul(r.into())) + } + fn instr_i64shl(r: u32) -> Weight { + Weight::from_ref_time(136_169_000) + // Standard Error: 3_107_352 + .saturating_add(Weight::from_ref_time(2_520_190).saturating_mul(r.into())) + } + fn instr_i64shrs(r: u32) -> Weight { + Weight::from_ref_time(130_342_500) + // Standard Error: 2_245_663 + .saturating_add(Weight::from_ref_time(3_163_430).saturating_mul(r.into())) + } + fn instr_i64shru(r: u32) -> Weight { + Weight::from_ref_time(129_937_000) + // Standard Error: 1_901_467 + .saturating_add(Weight::from_ref_time(2_786_200).saturating_mul(r.into())) + } + fn instr_i64rotl(r: u32) -> Weight { + Weight::from_ref_time(132_642_000) + // Standard Error: 1_847_324 + .saturating_add(Weight::from_ref_time(2_779_700).saturating_mul(r.into())) + } + fn instr_i64rotr(r: u32) -> Weight { + Weight::from_ref_time(141_834_500) + // Standard Error: 1_821_419 + .saturating_add(Weight::from_ref_time(2_613_870).saturating_mul(r.into())) + } +} diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index cca1c0048..c537da357 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -13,6 +13,8 @@ orml-traits = { branch = "polkadot-v0.9.32", default-features = false, git = "ht pallet-balances = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-bounties = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-collective = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-contracts = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +pallet-contracts-primitives = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-democracy = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-identity = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } pallet-membership = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } @@ -182,6 +184,7 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-bounties/runtime-benchmarks", "pallet-collective/runtime-benchmarks", + "pallet-contracts/runtime-benchmarks", "pallet-democracy/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-identity/runtime-benchmarks", @@ -222,6 +225,8 @@ std = [ "pallet-balances/std", "pallet-bounties/std", "pallet-collective/std", + "pallet-contracts/std", + "pallet-contracts-primitives/std", "pallet-democracy/std", "pallet-identity/std", "pallet-membership/std", @@ -341,6 +346,7 @@ try-runtime = [ "pallet-membership/try-runtime", # Other Parity runtime pallets + "pallet-contracts/try-runtime", "pallet-identity/try-runtime", "pallet-utility/try-runtime", diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 4b3c6a8cc..bcb279b03 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -42,7 +42,7 @@ pub use crate::parameters::*; use alloc::vec; use frame_support::{ traits::{ConstU16, ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter}, - weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee}, + weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee, Weight}, }; use frame_system::EnsureRoot; use pallet_collective::{EnsureProportionAtLeast, EnsureProportionMoreThan, PrimeDefaultVote}; @@ -112,6 +112,10 @@ impl Contains for IsCallable { use orml_currencies::Call::update_balance; use pallet_balances::Call::{force_transfer, set_balance}; use pallet_collective::Call::set_members; + use pallet_contracts::Call::{ + call, call_old_weight, instantiate, instantiate_old_weight, remove_code, + set_code as set_code_contracts, + }; use pallet_vesting::Call::force_vested_transfer; use zeitgeist_primitives::types::{ @@ -142,6 +146,16 @@ impl Contains for IsCallable { _ => true, } } + // Permissioned contracts: Only deployable via utility.dispatch_as(...) + RuntimeCall::Contracts(inner_call) => match inner_call { + call { .. } => true, + call_old_weight { .. } => true, + instantiate { .. } => true, + instantiate_old_weight { .. } => true, + remove_code { .. } => true, + set_code_contracts { .. } => true, + _ => false, + }, // Membership is managed by the respective Membership instance RuntimeCall::Council(set_members { .. }) => false, RuntimeCall::Court(_) => false, diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index f2aa054be..b21a4c6a1 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -22,7 +22,7 @@ clippy::arithmetic_side_effects )] -use super::VERSION; +use super::{Runtime, VERSION}; use frame_support::{ dispatch::DispatchClass, parameter_types, @@ -80,6 +80,20 @@ parameter_types! { pub const TechnicalCommitteeMaxProposals: u32 = 64; pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * BLOCKS_PER_DAY; + // Contracts + pub const ContractsDeletionQueueDepth: u32 = 128; + pub ContractsDeletionWeightLimit: Weight = Perbill::from_percent(10) + * RuntimeBlockWeights::get() + .per_class + .get(DispatchClass::Normal) + .max_total + .unwrap_or(RuntimeBlockWeights::get().max_block); + pub const ContractsDepositPerByte: Balance = deposit(0,1); + pub const ContractsDepositPerItem: Balance = deposit(1,0); + pub const ContractsMaxCodeLen: u32 = 123 * 1024; + pub const ContractsMaxStorageKeyLen: u32 = 128; + pub ContractsSchedule: pallet_contracts::Schedule = Default::default(); + // Court /// Duration of a single court case. pub const CourtCaseDuration: u64 = BLOCKS_PER_DAY; @@ -393,7 +407,7 @@ parameter_type_with_key! { #[cfg(feature = "parachain")] Asset::ForeignAsset(id) => { let maybe_metadata = < - orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect + orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect >::metadata(&Asset::ForeignAsset(*id)); if let Some(metadata) = maybe_metadata { diff --git a/scripts/benchmarks/configuration.sh b/scripts/benchmarks/configuration.sh index e0e49becb..c5d8d2486 100644 --- a/scripts/benchmarks/configuration.sh +++ b/scripts/benchmarks/configuration.sh @@ -3,21 +3,20 @@ EXTERNAL_WEIGHTS_PATH="./runtime/common/src/weights/" # This script contains the configuration for other benchmarking scripts. -export FRAME_PALLETS=( frame_system pallet_balances pallet_bounties pallet_democracy \ - pallet_identity pallet_membership pallet_multisig pallet_preimage \ - pallet_proxy pallet_scheduler pallet_timestamp pallet_treasury \ - pallet_utility pallet_vesting pallet_collective ) # pallet_grandpa ) +export FRAME_PALLETS=( + frame_system pallet_balances pallet_bounties pallet_collective pallet_contracts \ + pallet_democracy pallet_identity pallet_membership pallet_multisig pallet_preimage \ + pallet_proxy pallet_scheduler pallet_timestamp pallet_treasury pallet_utility \ + pallet_vesting \ +) # pallet_grandpa ) export FRAME_PALLETS_RUNS="${FRAME_PALLETS_RUNS:-20}" export FRAME_PALLETS_STEPS="${FRAME_PALLETS_STEPS:-50}" export FRAME_WEIGHT_TEMPLATE="./misc/frame_weight_template.hbs" export FRAME_PALLETS_PARACHAIN=( - cumulus_pallet_xcmp_queue \ - pallet_author_inherent \ - pallet_author_slot_filter \ - pallet_author_mapping \ - pallet_parachain_staking \ + cumulus_pallet_xcmp_queue pallet_author_inherent pallet_author_slot_filter \ + pallet_author_mapping pallet_parachain_staking \ ) export FRAME_PALLETS_PARACHAIN_RUNS="${FRAME_PALLETS_PARACHAIN_RUNS:-$FRAME_PALLETS_RUNS}" export FRAME_PALLETS_PARACHAIN_STEPS="${FRAME_PALLETS_PARACHAIN_STEPS:-$FRAME_PALLETS_STEPS}" @@ -27,7 +26,10 @@ export ORML_PALLETS_RUNS="${ORML_PALLETS_RUNS:-20}" export ORML_PALLETS_STEPS="${ORML_PALLETS_STEPS:-50}" export ORML_WEIGHT_TEMPLATE="./misc/orml_weight_template.hbs" -export ZEITGEIST_PALLETS=( zrml_authorized zrml_court zrml_global_disputes zrml_liquidity_mining zrml_prediction_markets zrml_swaps zrml_styx ) +export ZEITGEIST_PALLETS=( + zrml_authorized zrml_court zrml_global_disputes zrml_liquidity_mining zrml_prediction_markets \ + zrml_swaps zrml_styx \ +) export ZEITGEIST_PALLETS_RUNS="${ZEITGEIST_PALLETS_RUNS:-1000}" export ZEITGEIST_PALLETS_STEPS="${ZEITGEIST_PALLETS_STEPS:-10}" export ZEITGEIST_WEIGHT_TEMPLATE="./misc/weight_template.hbs" From 5e953c4ed818833c4b49ef25a0735fc87208f2f0 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Wed, 21 Jun 2023 12:49:35 +0200 Subject: [PATCH 43/53] Add automatic copyright notice verification (#963) * Add license checker * Add workflow for checking licenses * Install license checker dependencies * Manually specify the branch * Use hard-coded branch name * Try by directly specifying files * Use fork * Remove file filter * Clean up * Test workflow failure * Fix workflow file * Fix workflow * Revert touched file * Fix filter * Try another filter * revert * Update filter * fix filter * . * Try some more stuff * . * . * Allow empty list of files * Some aesthetic improvement * Blacken Python code * Provoke failure * Fix failure * Fix `File.write` and its test * Improve error handling * Move Python stuff to general `.gitignore` * Blacken code * Add script for checking all rust files * Fix file extension regex * Rename script accordingly --- .github/workflows/rust.yml | 20 ++ .gitignore | 136 +++++++++++++- scripts/check-license/Makefile | 27 +++ scripts/check-license/requirements.txt | 3 + scripts/check-license/resources/test_read | 6 + ...test_read_fails_on_broken_copyright_notice | 6 + scripts/check-license/setup.py | 8 + .../src/check_license/__init__.py | 25 +++ .../src/check_license/check_license.py | 131 +++++++++++++ .../src/check_license/console.py | 7 + .../src/check_license/copyright.py | 95 ++++++++++ .../check-license/src/check_license/errors.py | 32 ++++ .../check-license/tests/test_check_license.py | 175 ++++++++++++++++++ scripts/check-license/tests/test_copyright.py | 56 ++++++ scripts/update-copyright.sh | 2 + 15 files changed, 728 insertions(+), 1 deletion(-) create mode 100644 scripts/check-license/Makefile create mode 100644 scripts/check-license/requirements.txt create mode 100644 scripts/check-license/resources/test_read create mode 100644 scripts/check-license/resources/test_read_fails_on_broken_copyright_notice create mode 100644 scripts/check-license/setup.py create mode 100644 scripts/check-license/src/check_license/__init__.py create mode 100644 scripts/check-license/src/check_license/check_license.py create mode 100644 scripts/check-license/src/check_license/console.py create mode 100644 scripts/check-license/src/check_license/copyright.py create mode 100644 scripts/check-license/src/check_license/errors.py create mode 100644 scripts/check-license/tests/test_check_license.py create mode 100644 scripts/check-license/tests/test_copyright.py create mode 100755 scripts/update-copyright.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a7edff6e4..7c83593e1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,6 +30,26 @@ jobs: - name: Format run: ./scripts/tests/format.sh --check + copyright: + name: Copyright Notices + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + - name: Install check-license and dependencies + run: | + pip install scripts/check-license + pip install -r scripts/check-license/requirements.txt + - name: Query files changed + id: files_changed + uses: Ana06/get-changed-files@v1.2 + with: + filter: '*.rs$' + - name: Check copyright notices + run: check-license ${{ steps.files_changed.outputs.added_modified }} + checks: name: Checks runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 8a30b968d..cd3eee9c6 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,138 @@ **/node_modules/ # Visual Studio Code -.vscode \ No newline at end of file +.vscode + +############################## +# GitHub's Python .gitignore # +############################## + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/scripts/check-license/Makefile b/scripts/check-license/Makefile new file mode 100644 index 000000000..bc0647f40 --- /dev/null +++ b/scripts/check-license/Makefile @@ -0,0 +1,27 @@ +VENV?=.venv +BIN?=$(VENV)/bin +PYTHON?=$(BIN)/python +PIP?=$(BIN)/pip +PYTEST?=$(BIN)/pytest + +.PHONY: default +default: install + $(PYTEST) tests/ + +.PHONY: venv +venv: + pip install virtualenv + [ -d $(VENV) ] || virtualenv $(VENV) + $(PIP) install -r requirements.txt + make install + +.PHONY: clean +clean: + python setup.py clean + rm -fr .venv + rm -fr build + rm -fr dist + +.PHONY: install +install: + $(PYTHON) setup.py install diff --git a/scripts/check-license/requirements.txt b/scripts/check-license/requirements.txt new file mode 100644 index 000000000..4937c5a10 --- /dev/null +++ b/scripts/check-license/requirements.txt @@ -0,0 +1,3 @@ +click==8.0.3 +pytest==5.4.3 +pytest-mock==3.7.0 diff --git a/scripts/check-license/resources/test_read b/scripts/check-license/resources/test_read new file mode 100644 index 000000000..79382c2e5 --- /dev/null +++ b/scripts/check-license/resources/test_read @@ -0,0 +1,6 @@ +// Copyright 2020-2021, 2023 Holder. +// Copyright 1999 This other guy. +// +// This is the license. + +This is the rest of the file! diff --git a/scripts/check-license/resources/test_read_fails_on_broken_copyright_notice b/scripts/check-license/resources/test_read_fails_on_broken_copyright_notice new file mode 100644 index 000000000..4b8537965 --- /dev/null +++ b/scripts/check-license/resources/test_read_fails_on_broken_copyright_notice @@ -0,0 +1,6 @@ +// Copyright 2020-2021, 2023 Holder. +// (c) Copyright 1999 This other guy. +// +// This is the license. + +This is the rest of the file! diff --git a/scripts/check-license/setup.py b/scripts/check-license/setup.py new file mode 100644 index 000000000..8c6bcc8e9 --- /dev/null +++ b/scripts/check-license/setup.py @@ -0,0 +1,8 @@ +from setuptools import setup + +setup( + name="check-license", + packages=["check_license"], + package_dir={"": "src"}, + entry_points={"console_scripts": ["check-license = check_license:main"]}, +) diff --git a/scripts/check-license/src/check_license/__init__.py b/scripts/check-license/src/check_license/__init__.py new file mode 100644 index 000000000..ea5f0b5df --- /dev/null +++ b/scripts/check-license/src/check_license/__init__.py @@ -0,0 +1,25 @@ +import argparse +import datetime +import logging +import sys + +from check_license.check_license import check_files, update_files +from check_license.console import echo + + +def main(): + # TODO Add option to ignore files? + parser = argparse.ArgumentParser() + parser.add_argument("files", nargs="*") + parser.add_argument("-w", "--write", action="store_true") + args = parser.parse_args(sys.argv[1:]) + current_year = datetime.date.today().year + if args.write: + failed, count = update_files(current_year, args.files) + echo(f"Updated {count} files. ✍️") + else: + failed = check_files(current_year, args.files) + if failed: + sys.exit(1) + echo("All copyright notices are up to date! 🍉") + sys.exit(0) diff --git a/scripts/check-license/src/check_license/check_license.py b/scripts/check-license/src/check_license/check_license.py new file mode 100644 index 000000000..f97b02181 --- /dev/null +++ b/scripts/check-license/src/check_license/check_license.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +import dataclasses +import datetime +import re +import os + +from check_license.console import echo +from check_license.copyright import Copyright, CopyrightError +from check_license.errors import ( + LicenseCheckerError, + MissingCopyrightError, + IllegalCopyrightError, + DuplicateCopyrightError, + OutdatedCopyrightError, +) + +# TODO Get owner according to exact date +FORECASTING_TECH = "Forecasting Technologies LTD" +OWNER = FORECASTING_TECH + + +class File: + def __init__( + self, path: str, copyright_notices: Optional[list] = None, blob: str = "" + ) -> None: + self._path = path + self._copyright_notices = copyright_notices or [] + self._blob = blob + + @property + def path(self) -> str: + return self._path + + def last_changed(self) -> datetime.datetime: + """Return the UTC date at which the file was last changed.""" + # FIXME This doesn't take git into account. + return datetime.datetime.utcfromtimestamp(os.path.getmtime(self._path)) + + def read(self) -> None: + """Read contents of file to buffer. + + May fail due to broken copyright notices. Should be run before calling any other function. + """ + raw_copyright = [] + blob = "" + with open(self._path, "r") as f: + # We're assuming that all copyright notices come in one bunch, so once + # we meet a line of whitespace, we give up. + while (line := f.readline()) and line.startswith("//"): + if re.match(r"^// *$", line): + blob += line + break + raw_copyright.append(line[3:]) # Strip "// ". + blob += f.read() + for i, s in enumerate(raw_copyright): + try: + copyright = Copyright.from_string(s) + except CopyrightError: + raise IllegalCopyrightError(self._path, i, s) + self._copyright_notices.append(copyright) + self._blob = blob + + def check(self, year) -> None: + """Check that this file's copyright notice reflects changed made in the current + ``year``.""" + if not self._copyright_notices: + raise MissingCopyrightError(self._path) + owner_count = len({c.owner for c in self._copyright_notices}) + if owner_count != len(self._copyright_notices): + raise DuplicateCopyrightError(self._path) + # TODO Check that the license blob is as expected + + copyright = self._get_owner_copyright() + if copyright is None: + raise MissingCopyrightError(self._path, OWNER) + if copyright.end < year: + raise OutdatedCopyrightError(self._path, copyright, year) + + def update_license(self, year) -> bool: + """Update the copyright notice and return `True` if anything changed.""" + owner_copyright = self._get_owner_copyright() + if owner_copyright is None: + self._copyright_notices.insert(0, Copyright.from_year(OWNER, year)) + return True + if owner_copyright.end != year: + owner_copyright.push_year(year) + return True + return False + + def write(self) -> None: + content = "\n".join(["// " + str(c) for c in self._copyright_notices]) + if content: + content += "\n" + content += self._blob + with open(self._path, "w") as f: + f.write(content) + + def _get_owner_copyright(self) -> Optional[Copyright]: + matches = (c for c in self._copyright_notices if c.owner == OWNER) + # `len(matches) < 2` at this point. + return next(matches, None) + + +def check_files(year: int, files: list[str]) -> bool: + files = [File(f) for f in files] + result = False + for f in files: + try: + f.read() + f.check(year) + except LicenseCheckerError as e: + echo(str(e)) + result = True + return result + + +def update_files(year: int, files: list[str]) -> tuple[bool, int]: + files = [File(f) for f in files] + result = False + count = 0 + for f in files: + try: + f.read() + changed = f.update_license(year) + f.write() + count += changed + except LicenseCheckerError as e: + echo(str(e)) + result = True + return result, count diff --git a/scripts/check-license/src/check_license/console.py b/scripts/check-license/src/check_license/console.py new file mode 100644 index 000000000..e618d64a5 --- /dev/null +++ b/scripts/check-license/src/check_license/console.py @@ -0,0 +1,7 @@ +from __future__ import annotations + +import click + + +def echo(msg: str) -> None: + click.echo(msg) diff --git a/scripts/check-license/src/check_license/copyright.py b/scripts/check-license/src/check_license/copyright.py new file mode 100644 index 000000000..f417f202f --- /dev/null +++ b/scripts/check-license/src/check_license/copyright.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +import dataclasses +import re + + +@dataclasses.dataclass +class Copyright: + owner: str + years: list[Years] + + @classmethod + def from_string(cls, s) -> Copyright: + """Create ``Copyright`` object from the string ``s``.""" + match = re.match(r"^Copyright ([0-9,\- ]*) (.*)\.$", s) + if not match: + raise ParseError() + years, holder = match.group(1, 2) + years = years.split(", ") + years = [Years.from_string(y) for y in years] + # Check that year ranges don't overlap and are ordered correctly. + for prev, curr in zip(years, years[1:]): + if curr.start <= prev.end: + raise IllegalYearRange() + return Copyright(holder, years) + + @classmethod + def from_year(cls, owner: str, year: int) -> Copyright: + return Copyright(owner, [Years(year)]) + + def __str__(self) -> str: + dates = ", ".join(str(y) for y in self.years) + return f"Copyright {dates} {self.owner}." + + @property + def end(self) -> int: + return self.years[-1].end + + def push_year(self, year: int) -> None: + """Safely add ``year`` to this copyright.""" + # `year` must not be contained in the copyright yet. + if year <= self.years[-1].end: + raise IllegalYearRange() + if year == self.years[-1].end + 1: + self.years[-1].end = year + else: + self.years.push(Years(year, year)) + + +@dataclasses.dataclass +class Years: + """A class for inclusive ranges of years.""" + + start: int + end: int = None + + def __post_init__(self) -> None: + if self.end is None: + self.end = self.start + if self.start > self.end: + raise IllegalYearRange() + + @classmethod + def from_string(cls, s: str) -> Years: + # `s` is only a year, e.g. `"2023"`. + match = re.match(r"^\d{4}$", s) + if match: + year = int(s) + return Years(year, year) + # `s` is a year range, e.g. `"2022-2023"` + match = re.match(r"^(\d{4})-(\d{4})$", s) + if match: + start, end = [int(n) for n in match.group(1, 2)] + if start >= end: + raise IllegalYearRange() + return Years(start, end) + raise ParseError() + + def __str__(self) -> str: + if self.start == self.end: + return str(self.start) + else: + return f"{self.start}-{self.end}" + + +class CopyrightError(Exception): + pass + + +class ParseError(CopyrightError): + pass + + +class IllegalYearRange(CopyrightError): + pass diff --git a/scripts/check-license/src/check_license/errors.py b/scripts/check-license/src/check_license/errors.py new file mode 100644 index 000000000..3da730e5e --- /dev/null +++ b/scripts/check-license/src/check_license/errors.py @@ -0,0 +1,32 @@ +from __future__ import annotations + + +class LicenseCheckerError(Exception): + pass + + +class MissingCopyrightError(LicenseCheckerError): + def __init__(self, path: str, holder: str = "") -> None: + if holder: + msg = f"{path}: no copyright notice for {holder} found" + else: + msg = f"{path}: no copyright notice found" + super().__init__(msg) + + +class IllegalCopyrightError(LicenseCheckerError): + def __init__(self, path: str, number: int, line: str) -> None: + msg = f"{path}:{number}: expected copyright notice, found '{line}'" + super().__init__(msg) + + +class DuplicateCopyrightError(LicenseCheckerError): + def __init__(self, path: str) -> None: + msg = f"{path}: duplicate copyright notice" + super().__init__(msg) + + +class OutdatedCopyrightError(LicenseCheckerError): + def __init__(self, path: str, actual: Copyright, year: int) -> None: + msg = f"{path}: year {year} missing from copyright notice '{actual}'" + super().__init__(msg) diff --git a/scripts/check-license/tests/test_check_license.py b/scripts/check-license/tests/test_check_license.py new file mode 100644 index 000000000..c1f5e5508 --- /dev/null +++ b/scripts/check-license/tests/test_check_license.py @@ -0,0 +1,175 @@ +import builtins +import textwrap + +import pytest + +from check_license.copyright import Copyright, Years +from check_license.check_license import File +from check_license.errors import * + + +class TestFile: + def test_read(self): + path_to_file = "resources/test_read" + file = File(path_to_file) + file.read() + assert file.path == path_to_file + assert file._copyright_notices == [ + Copyright("Holder", [Years(2020, 2021), Years(2023)]), + Copyright("This other guy", [Years(1999)]), + ] + assert ( + file._blob + == "//\n// This is the license.\n\nThis is the rest of the file!\n" + ) + + def test_read_fails_on_broken_copyright_notice(self): + path_to_file = "resources/test_read_fails_on_broken_copyright_notice" + file = File(path_to_file) + with pytest.raises(IllegalCopyrightError): + file.read() + + def test_check_success_or_outdated(self): + file = File( + "path/to/file", + [ + Copyright("Forecasting Technologies LTD", [Years(2023)]), + Copyright("Zeitgeist PM LLC", [Years(2021, 2022)]), + ], + "blob", + ) + file.check(2023) + with pytest.raises(OutdatedCopyrightError): + file.check(2024) + + @pytest.mark.parametrize( + "copyright_notices, year, error", + [ + ( + [ + Copyright.from_string( + "Copyright 2023 Forecasting Technologies LTD." + ), + Copyright.from_string("Copyright 2021-2022 Zeitgeist PM LLC."), + Copyright.from_string( + "Copyright 2022 Forecasting Technologies LTD." + ), + ], + 2023, + DuplicateCopyrightError, + ), + ( + [Copyright.from_string("Copyright 2023 some dude.")], + 2023, + MissingCopyrightError, + ), + ( + [Copyright.from_string("Copyright 2022 Forecasting Technologies LTD.")], + 2023, + OutdatedCopyrightError, + ), + ], + ) + def test_check_fails(self, copyright_notices, year, error): + file = File( + "path/to/file", + copyright_notices, + "blob", + ) + with pytest.raises(error): + file.check(year) + + @pytest.mark.parametrize( + "before, after, year, expected", + [ + ( + [ + Copyright.from_string( + "Copyright 2023 Forecasting Technologies LTD." + ), + Copyright.from_string("Copyright 2019-2021, 2023 Someone."), + ], + [ + Copyright.from_string( + "Copyright 2023 Forecasting Technologies LTD." + ), + Copyright.from_string("Copyright 2019-2021, 2023 Someone."), + ], + 2023, + False, + ), + ( + [ + Copyright.from_string("Copyright 2019-2021, 2023 Someone."), + ], + [ + Copyright.from_string( + "Copyright 2023 Forecasting Technologies LTD." + ), + Copyright.from_string("Copyright 2019-2021, 2023 Someone."), + ], + 2023, + True, + ), + ( + [ + Copyright.from_string("Copyright 2019-2021, 2023 Someone."), + Copyright.from_string( + "Copyright 2022 Forecasting Technologies LTD." + ), + ], + [ + Copyright.from_string("Copyright 2019-2021, 2023 Someone."), + Copyright.from_string( + "Copyright 2022-2023 Forecasting Technologies LTD." + ), + ], + 2023, + True, + ), + ], + ) + def test_update_license(self, before, after, year, expected): + blob = "blob" + file = File("path/to/file", before, blob) + result = file.update_license(year) + assert file.path == "path/to/file" + assert file._copyright_notices == after + assert file._blob == blob + assert result == expected + + def test_write(self, mocker, monkeypatch): + mock_manager = mocker.Mock(__enter__=mocker.Mock(), __exit__=mocker.Mock()) + mock_open = mocker.Mock(return_value=mock_manager) + monkeypatch.setattr(builtins, "open", mock_open) + + path_to_file = "path/to/file" + file = File( + path_to_file, + [ + Copyright.from_string("Copyright 2022-2023 New Company."), + Copyright.from_string("Copyright 2021-2022 Old Company."), + ], + textwrap.dedent( + """\ + // + // The license + + The rest of the file. + """, + ), + ) + file.write() + + expected = textwrap.dedent( + """\ + // Copyright 2022-2023 New Company. + // Copyright 2021-2022 Old Company. + // + // The license + + The rest of the file. + """, + ) + mock_open.assert_called_once_with(path_to_file, "w") + mock_manager.__enter__().write.assert_called_once_with(expected) diff --git a/scripts/check-license/tests/test_copyright.py b/scripts/check-license/tests/test_copyright.py new file mode 100644 index 000000000..a914be824 --- /dev/null +++ b/scripts/check-license/tests/test_copyright.py @@ -0,0 +1,56 @@ +import pytest + +from check_license.copyright import Copyright, Years, CopyrightError + + +class TestCopyright: + @pytest.mark.parametrize( + "value, holder, years", + [ + ( + "Copyright 2020 Copyright Holder.", + "Copyright Holder", + [Years(2020)], + ), + ( + "Copyright 2020-2021 Copyright Holder.", + "Copyright Holder", + [Years(2020, 2021)], + ), + ( + "Copyright 2020-2021, 2023 Copyright Holder.", + "Copyright Holder", + [Years(2020, 2021), Years(2023)], + ), + ], + ) + def test_from_string(self, value, holder, years): + actual = Copyright.from_string(value) + assert actual == Copyright(holder, years) + + @pytest.mark.parametrize( + "value", + [ + "Copyright 2022-2022 same year range.", + "Copyright missing years.", + "Copyright 2022-2021 decreasing years.", + "Copyright 2020-2022, 2022-2023 overlapping years.", + ], + ) + def test_from_string_fails(self, value): + with pytest.raises(CopyrightError): + Copyright.from_string(value) + + @pytest.mark.parametrize( + "copyright, expected", + [ + (Copyright("Holder", [Years(2020)]), "Copyright 2020 Holder."), + (Copyright("Holder", [Years(2020, 2021)]), "Copyright 2020-2021 Holder."), + ( + Copyright("Holder", [Years(2020, 2021), Years(2023)]), + "Copyright 2020-2021, 2023 Holder.", + ), + ], + ) + def test_str(self, copyright, expected): + assert str(copyright) == expected diff --git a/scripts/update-copyright.sh b/scripts/update-copyright.sh new file mode 100755 index 000000000..258203422 --- /dev/null +++ b/scripts/update-copyright.sh @@ -0,0 +1,2 @@ +RUST_FILES_CHANGED=$(git diff --name-only main | grep -E .*\.rs$) +check-license -w ${RUST_FILES_CHANGED} From 22075c4b5e2af3a2da1babd3d3bdf3588e87d6db Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 21 Jun 2023 16:43:02 +0200 Subject: [PATCH 44/53] Separate tests into two jobs: standalone and parachain (#1024) --- .github/workflows/rust.yml | 36 ++++++++++++++++++-- scripts/tests/all-sequencial.sh | 5 +-- scripts/tests/{test.sh => test_parachain.sh} | 5 +-- scripts/tests/test_standalone.sh | 10 ++++++ 4 files changed, 47 insertions(+), 9 deletions(-) rename scripts/tests/{test.sh => test_parachain.sh} (61%) create mode 100755 scripts/tests/test_standalone.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7c83593e1..581655c32 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -85,8 +85,8 @@ jobs: - run: ./scripts/benchmarks/quick_check.sh - tests: - name: Tests + test_standalone: + name: Test standalone build runs-on: ubuntu-latest steps: - name: Checkout repository @@ -113,7 +113,37 @@ jobs: uses: Swatinem/rust-cache@v1 - name: Tests - run: ./scripts/tests/test.sh + run: ./scripts/tests/test_standalone.sh + + test_parachain: + name: Test parachain build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install build tools + run: ./scripts/init.sh + + # No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006 + # Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 + - name: Free up disk space on GitHub hosted runners + run: | + # Ensure context is GitHub hosted runner + # https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context + if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then + echo "Freeing up space in GitHub hosted runner" + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + fi + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v1 + + - name: Tests + run: ./scripts/tests/test_parachain.sh fuzz: name: Fuzz diff --git a/scripts/tests/all-sequencial.sh b/scripts/tests/all-sequencial.sh index 5df762912..a94141360 100755 --- a/scripts/tests/all-sequencial.sh +++ b/scripts/tests/all-sequencial.sh @@ -4,8 +4,9 @@ # # IMPORTANT: CI verifies most of the following scripts in parallel -. "$(dirname "$0")/test.sh" --source-only . "$(dirname "$0")/clippy.sh" --source-only -. "$(dirname "$0")/parachain.sh" --source-only . "$(dirname "$0")/standalone.sh" --source-only +. "$(dirname "$0")/parachain.sh" --source-only +. "$(dirname "$0")/test_standalone.sh" --source-only +. "$(dirname "$0")/test_parachain.sh" --source-only . "$(dirname "$0")/fuzz.sh" --source-only diff --git a/scripts/tests/test.sh b/scripts/tests/test_parachain.sh similarity index 61% rename from scripts/tests/test.sh rename to scripts/tests/test_parachain.sh index 1c390e00e..d6f26e7e3 100755 --- a/scripts/tests/test.sh +++ b/scripts/tests/test_parachain.sh @@ -1,13 +1,10 @@ #!/usr/bin/env bash -# Tests: Run tests on all crates +# Tests: Run tests on all crates using a parachain build set -euxo pipefail . "$(dirname "$0")/aux-functions.sh" --source-only -# Test standalone -test_package_with_feature "." "default,runtime-benchmarks" "" - # Test parachain test_package_with_feature "." "default,parachain,runtime-benchmarks" "" \ No newline at end of file diff --git a/scripts/tests/test_standalone.sh b/scripts/tests/test_standalone.sh new file mode 100755 index 000000000..2aac94683 --- /dev/null +++ b/scripts/tests/test_standalone.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Tests: Run tests on all crates using a standalone build + +set -euxo pipefail + +. "$(dirname "$0")/aux-functions.sh" --source-only + +# Test standalone +test_package_with_feature "." "default,runtime-benchmarks" "" \ No newline at end of file From c347f33c37838797be7323a52ed64b6ef14d4241 Mon Sep 17 00:00:00 2001 From: Chralt Date: Thu, 22 Jun 2023 15:53:17 +0200 Subject: [PATCH 45/53] Update weight templates copyright (#1027) --- misc/frame_weight_template.hbs | 1 + misc/orml_weight_template.hbs | 1 + misc/weight_template.hbs | 1 + 3 files changed, 3 insertions(+) diff --git a/misc/frame_weight_template.hbs b/misc/frame_weight_template.hbs index 8efbe31a4..88ff5802e 100644 --- a/misc/frame_weight_template.hbs +++ b/misc/frame_weight_template.hbs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/misc/orml_weight_template.hbs b/misc/orml_weight_template.hbs index e1e941790..1fcc3355b 100644 --- a/misc/orml_weight_template.hbs +++ b/misc/orml_weight_template.hbs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/misc/weight_template.hbs b/misc/weight_template.hbs index f62c142d8..c5c0ec357 100644 --- a/misc/weight_template.hbs +++ b/misc/weight_template.hbs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. From d9ebeebb6c32ef3c5f514df49576b29a91193c95 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 3 Jul 2023 19:20:38 +0200 Subject: [PATCH 46/53] Add review checklist (#895) * Add draft for review checklist * Add bullet point of unnumbered TODOs * Reformat the checklist * Add note about call filters * Add info regarding sorting of variants and breaking changes * Add notes on events * Remove some superfluous points from the review checklist * Add a note on compiler warnings * Add command for checking local block production * Clarify comments on local node and node sync * Apply suggestions from code review Co-authored-by: Harald Heckmann * Reformat review checklist --------- Co-authored-by: Harald Heckmann --- docs/review_checklist.md | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 docs/review_checklist.md diff --git a/docs/review_checklist.md b/docs/review_checklist.md new file mode 100644 index 000000000..90c94b2ce --- /dev/null +++ b/docs/review_checklist.md @@ -0,0 +1,87 @@ +- [ ] All todos contain a reference to an issue like this: `TODO(#999)`. +- [ ] The PR links relevant issues and contains a detailed description. +- [ ] All relevant labels were added. +- [ ] The docstrings are up to date. +- [ ] If the PR adds or changes extrinsics or functions used by extrinsics: + - [ ] The _Weight_ section in the documentation is up to date. + - [ ] The benchmarks are up to date. + - [ ] The call filters were adjusted. + - [ ] The extrinsics emit all the required events (see [Events](#events) + below). +- [ ] The module `README.md` is up to date. +- [ ] [docs.zeitgeist.pm] is up to date. +- [ ] `docs/changelog_for_devs.md` is up to date, specifically: + - [ ] Changes relevant to the Frontend Team (extrinsics changed, new + functions) are mentioned here. + - [ ] All new events are explained so they can easily be integrated into the + indexer. + - [ ] Breaking changes are marked as such. + - [ ] The file is formatted with `prettier -w docs/changelog_for_devs.md`. +- Sanity tests: + - [ ] The local temporary development node produces blocks: + `cargo run --profile=production -- --tmp`. + - [ ] The node syncs with Zeitgeist and Battery Station: + `cargo run --profile=production --features=parachain`, + `cargo run --profile=production --features=parachain -- --chain=battery_station`. + - [ ] `try-runtime` passes on Zeitgeist and Battery Station. +- [ ] Code quality: + - [ ] Avoidable compiler warnings were resolved. + - [ ] Integer arithmetic is only saturated/checked and all panickers are + removed. + - [ ] Code contained in macro invocations (benchmarks, + `runtime/common/src/lib.rs`, `decl_runtime_apis!`) is correctly + formatted. + - [ ] All `*.toml` files are formatted with `taplo` (run + `taplo format --check`). + - [ ] All copyright notices are up to date. + - [ ] Enums are sorted alphabetically, except for enums used in storage (to + prevent migrations), errors and events. +- [ ] In case an action is required by the Frontend Team, an issue was added to + zeitgeistpm/ui. +- [ ] In case the PR adds a new pallet, the pallet is added to the benchmark + configuration in `scripts/`. +- [ ] In case configuration items or storage elements were changed: Necessary + storage migrations are provided. +- [ ] In case configuration values changed: The implications have been discussed + with the + [code owners](https://github.com/zeitgeistpm/zeitgeist/blob/main/CODEOWNERS). +- [ ] If the changes include a storage migration: + - [ ] The affected pallet's `STORAGE_VERSION` was bumped. + - [ ] Try-runtime checks were added and the following conditions were ensured: + - [ ] The storage migration bumps the pallet version correctly. + - [ ] The try-runtime _fails_ if you comment out the migration code. + - [ ] The try-runtime passes without any warnings (substrate storage + operations often just log a warning instead of failing, so these + warnings usually point to problem which could break the storage). + +## Events + +_All_ modifications of the on-chain storage **must** be broadcast to indexers by +emitting a high-level event. The term _high-level_ event refers to an event +which may or may not contextualize _low-level_ events emitted by pallets that +Zeitgeist's business logic builds on, for example pallet-balances. Examples of +high-level events are: + +- `SwapExactAmountIn` (contextualizes a couple of low-level events like + `Transfer`) +- `PoolActive` (doesn't add context, but describes a storage change of a pool + structure) + +Furthermore, these modifications need to be detailed by specifying either a diff +or the new storage content, unless the change is absolutely clear from the +context. For example, `SwapExactAmountIn` specifies the balance changes that the +accounts suffer, but `PoolActive` only provides the id of the pool, _not_ the +new status (`Active`), which is clear from the context. Information that is +implicitly already available to the indexer **may** be provided, but this is not +necessary. For example, the `MarketRejected(market_id, reason)` event not only +specifies that the market with `market_id` was rejected and for what `reason`, +but also that the advisory bond and oracle bond are settled, but it doesn't +include the info how much the oracle bond actually was. + +Additional info (similar to the remark emitted by +[`remark_with_event`](https://github.com/paritytech/substrate/blob/6a504b063cf66351b6e352ef18cc18d49146487b/frame/system/src/lib.rs#L488-L499)) +**may** be added to the event. For example, +`MarketRequestedEdit(market_id, reason)` contains a `reason` which is not stored +anywhere in the chain storage. + +[docs.zeitgeist.pm]: docs.zeitgeist.pm From 205923ddc235a8a945d6c8202735e29be2d48400 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Mon, 3 Jul 2023 22:50:58 +0530 Subject: [PATCH 47/53] Add verbose feature in script/tests/fuzz.sh (#910) * Add verbose feature in script/tests/fuzz.sh * Minor adjustment --------- Co-authored-by: Chralt98 --- .github/workflows/rust.yml | 2 +- scripts/tests/fuzz.sh | 68 +++++++++++++++++++++++++------------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 581655c32..a943202c1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -163,4 +163,4 @@ jobs: - name: Cache Dependencies uses: Swatinem/rust-cache@v1 - - run: ./scripts/tests/fuzz.sh + - run: ./scripts/tests/fuzz.sh --verbose diff --git a/scripts/tests/fuzz.sh b/scripts/tests/fuzz.sh index dc7b3588b..e1b7e0be0 100755 --- a/scripts/tests/fuzz.sh +++ b/scripts/tests/fuzz.sh @@ -2,8 +2,30 @@ # Fuzzing tests +verbose="" + +for arg in "$@"; do + case $arg in + "--verbose" | "-v") + verbose="verbose" + ;; + *) + echo "Unknown option '$arg'" + usage + exit 1 + ;; + esac +done + set -euxo pipefail +if [[ ${verbose} = "verbose" ]]; then + echo "Its verbose" + RUST_BACKTRACE=1 +fi + +# Fuzzing tests + # Using specific_run = (RUN * FUZZ_FACT) / BASE allows us to specify # a hardware- and fuzz target specific run count. BASE=1000 @@ -33,35 +55,35 @@ RIKIDDO_WITH_CALCULATED_FEE_FACT=1750 RIKIDDO_PALLET_FACT=1000 # --- Prediction Market Pallet fuzz tests --- -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/prediction-markets/fuzz pm_full_workflow -- -runs=$RUNS +cargo fuzz run --release --fuzz-dir zrml/prediction-markets/fuzz pm_full_workflow -- -runs=$RUNS # --- Swaps Pallet fuzz tests --- -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz create_pool -- -runs=$(($(($RUNS * $CREATE_POOL_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_join -- -runs=$(($(($RUNS * $POOL_JOIN_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_join_with_exact_pool_amount -- -runs=$(($(($RUNS * $POOL_JOIN_WITH_EXACT_POOL_AMOUNT_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_join_with_exact_asset_amount -- -runs=$(($(($RUNS * $POOL_JOIN_WITH_EXACT_ASSET_AMOUNT_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz swap_exact_amount_in -- -runs=$(($(($RUNS * $SWAP_EXACT_AMOUNT_IN_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz swap_exact_amount_out -- -runs=$(($(($RUNS * $SWAP_EXACT_AMOUNT_OUT_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_exit_with_exact_asset_amount -- -runs=$(($(($RUNS * $POOL_EXIT_WITH_EXACT_ASSET_AMOUNT_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_exit_with_exact_pool_amount -- -runs=$(($(($RUNS * $POOL_EXIT_WITH_EXACT_POOL_AMOUNT_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_exit -- -runs=$(($(($RUNS * $POOL_EXIT_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz create_pool -- -runs=$(($(($RUNS * $CREATE_POOL_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_join -- -runs=$(($(($RUNS * $POOL_JOIN_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_join_with_exact_pool_amount -- -runs=$(($(($RUNS * $POOL_JOIN_WITH_EXACT_POOL_AMOUNT_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_join_with_exact_asset_amount -- -runs=$(($(($RUNS * $POOL_JOIN_WITH_EXACT_ASSET_AMOUNT_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz swap_exact_amount_in -- -runs=$(($(($RUNS * $SWAP_EXACT_AMOUNT_IN_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz swap_exact_amount_out -- -runs=$(($(($RUNS * $SWAP_EXACT_AMOUNT_OUT_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_exit_with_exact_asset_amount -- -runs=$(($(($RUNS * $POOL_EXIT_WITH_EXACT_ASSET_AMOUNT_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_exit_with_exact_pool_amount -- -runs=$(($(($RUNS * $POOL_EXIT_WITH_EXACT_POOL_AMOUNT_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/swaps/fuzz pool_exit -- -runs=$(($(($RUNS * $POOL_EXIT_FACT)) / $BASE)) # --- Orderbook-v1 Pallet fuzz tests --- -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/orderbook-v1/fuzz orderbook_v1_full_workflow -- -runs=$RUNS +cargo fuzz run --release --fuzz-dir zrml/orderbook-v1/fuzz orderbook_v1_full_workflow -- -runs=$RUNS # --- Rikiddo Pallet fuzz tests --- # Profile release is required here since it triggers debug assertions otherwise # Using the default RUNS multiplier, each fuzz test needs approx. 6-7 seconds -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fee_sigmoid -- -runs=$(($(($RUNS * $FEE_SIGMOID_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fixedi_to_fixedu_conversion -- -runs=$(($(($RUNS * $FIXEDI_TO_FIXEDU_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fixedu_to_fixedi_conversion -- -runs=$(($(($RUNS * $FIXEDU_TO_FIXEDI_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz balance_to_fixedu_conversion -- -runs=$(($(($RUNS * $BALANCE_TO_FIXEDU_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fixedu_to_balance_conversion -- -runs=$(($(($RUNS * $FIXEDU_TO_BALANCE_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_first_state -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_FIRST_STATE_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_second_state -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_SECOND_STATE_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_third_state -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_THIRD_STATE_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_estimate_ema -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_ESTIMATE_EMA_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz rikiddo_with_initial_fee -- -runs=$(($(($RUNS * $RIKIDDO_WITH_INITIAL_FEE_FACT)) / $BASE)) -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz rikiddo_with_calculated_fee -- -runs=$(($(($RUNS * $RIKIDDO_WITH_CALCULATED_FEE_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fee_sigmoid -- -runs=$(($(($RUNS * $FEE_SIGMOID_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fixedi_to_fixedu_conversion -- -runs=$(($(($RUNS * $FIXEDI_TO_FIXEDU_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fixedu_to_fixedi_conversion -- -runs=$(($(($RUNS * $FIXEDU_TO_FIXEDI_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz balance_to_fixedu_conversion -- -runs=$(($(($RUNS * $BALANCE_TO_FIXEDU_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz fixedu_to_balance_conversion -- -runs=$(($(($RUNS * $FIXEDU_TO_BALANCE_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_first_state -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_FIRST_STATE_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_second_state -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_SECOND_STATE_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_third_state -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_THIRD_STATE_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz ema_market_volume_estimate_ema -- -runs=$(($(($RUNS * $EMA_MARKET_VOLUME_ESTIMATE_EMA_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz rikiddo_with_initial_fee -- -runs=$(($(($RUNS * $RIKIDDO_WITH_INITIAL_FEE_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz rikiddo_with_calculated_fee -- -runs=$(($(($RUNS * $RIKIDDO_WITH_CALCULATED_FEE_FACT)) / $BASE)) # This actually needs approx. 107 seconds. Need to find a way to optimize fuzzing on-chain -RUST_BACKTRACE=1 cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz rikiddo_pallet -- -runs=$(($(($RUNS * $RIKIDDO_PALLET_FACT)) / $BASE)) +cargo fuzz run --release --fuzz-dir zrml/rikiddo/fuzz rikiddo_pallet -- -runs=$(($(($RUNS * $RIKIDDO_PALLET_FACT)) / $BASE)) From 9437d8b1a02280156733015b2cfa8d997894fc39 Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 5 Jul 2023 11:05:19 +0200 Subject: [PATCH 48/53] Release v0.3.9 (#1033) * Update weights (#1025) * Update crate and runtime version (#1026) * Use argument in init.sh to avoid usage of sudo (#1028) * Update scripts/init.sh Co-authored-by: Chralt * Update script documentation --------- Co-authored-by: Chralt * Fix name collision (#1029) * Use updated Rococo bootnodes (#1030) --------- Co-authored-by: Chralt --- Cargo.lock | 166 ++-- Cargo.toml | 19 + Dockerfile | 2 +- node/Cargo.toml | 3 +- primitives/Cargo.toml | 2 +- runtime/battery-station/Cargo.toml | 2 +- runtime/battery-station/src/lib.rs | 4 +- runtime/common/Cargo.toml | 2 +- .../src/weights/cumulus_pallet_xcmp_queue.rs | 6 +- runtime/common/src/weights/frame_system.rs | 32 +- runtime/common/src/weights/orml_currencies.rs | 12 +- runtime/common/src/weights/orml_tokens.rs | 12 +- .../src/weights/pallet_author_inherent.rs | 4 +- .../src/weights/pallet_author_mapping.rs | 12 +- .../src/weights/pallet_author_slot_filter.rs | 4 +- runtime/common/src/weights/pallet_balances.rs | 28 +- runtime/common/src/weights/pallet_bounties.rs | 43 +- .../common/src/weights/pallet_collective.rs | 98 +-- .../common/src/weights/pallet_contracts.rs | 748 +++++++++--------- .../common/src/weights/pallet_democracy.rs | 78 +- runtime/common/src/weights/pallet_identity.rs | 132 ++-- .../common/src/weights/pallet_membership.rs | 44 +- runtime/common/src/weights/pallet_multisig.rs | 68 +- .../src/weights/pallet_parachain_staking.rs | 134 ++-- runtime/common/src/weights/pallet_preimage.rs | 38 +- runtime/common/src/weights/pallet_proxy.rs | 70 +- .../common/src/weights/pallet_scheduler.rs | 50 +- .../common/src/weights/pallet_timestamp.rs | 6 +- runtime/common/src/weights/pallet_treasury.rs | 27 +- runtime/common/src/weights/pallet_utility.rs | 24 +- runtime/common/src/weights/pallet_vesting.rs | 80 +- runtime/zeitgeist/Cargo.toml | 2 +- runtime/zeitgeist/src/lib.rs | 8 +- scripts/init.sh | 6 +- zrml/authorized/Cargo.toml | 2 +- zrml/authorized/src/weights.rs | 10 +- zrml/court/Cargo.toml | 2 +- zrml/court/src/weights.rs | 8 +- zrml/global-disputes/Cargo.toml | 2 +- zrml/global-disputes/src/weights.rs | 57 +- zrml/liquidity-mining/Cargo.toml | 2 +- zrml/liquidity-mining/src/weights.rs | 4 +- zrml/market-commons/Cargo.toml | 2 +- zrml/orderbook-v1/Cargo.toml | 2 +- zrml/orderbook-v1/src/weights.rs | 2 +- zrml/prediction-markets/Cargo.toml | 2 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/prediction-markets/src/weights.rs | 198 ++--- zrml/rikiddo/Cargo.toml | 2 +- zrml/simple-disputes/Cargo.toml | 2 +- zrml/styx/Cargo.toml | 2 +- zrml/styx/src/weights.rs | 6 +- zrml/swaps/Cargo.toml | 2 +- zrml/swaps/rpc/Cargo.toml | 2 +- zrml/swaps/runtime-api/Cargo.toml | 2 +- zrml/swaps/src/weights.rs | 130 +-- 56 files changed, 1227 insertions(+), 1182 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6835c3a63..16a2d3e26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -445,7 +445,7 @@ checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" [[package]] name = "battery-station-runtime" -version = "0.3.8" +version = "0.3.9" dependencies = [ "cfg-if 1.0.0", "common-runtime", @@ -1101,7 +1101,7 @@ dependencies = [ [[package]] name = "common-runtime" -version = "0.3.8" +version = "0.3.9" dependencies = [ "cfg-if 1.0.0", "cumulus-pallet-xcmp-queue", @@ -3652,7 +3652,7 @@ dependencies = [ [[package]] name = "kusama-runtime" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-primitives", "bitvec", @@ -3750,7 +3750,7 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "polkadot-primitives", @@ -6277,7 +6277,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "frame-system", @@ -6295,7 +6295,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-benchmarking", "frame-support", @@ -6629,7 +6629,7 @@ checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkadot-approval-distribution" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -6644,7 +6644,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "polkadot-node-network-protocol", @@ -6658,7 +6658,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "derive_more", "fatality", @@ -6681,7 +6681,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "fatality", "futures 0.3.25", @@ -6702,7 +6702,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "clap", "frame-benchmarking-cli", @@ -6728,7 +6728,7 @@ dependencies = [ [[package]] name = "polkadot-client" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-primitives", "frame-benchmarking", @@ -6768,7 +6768,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "always-assert", "bitvec", @@ -6790,7 +6790,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -6803,7 +6803,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "derive_more", "fatality", @@ -6828,7 +6828,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -6842,7 +6842,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "futures-timer", @@ -6862,7 +6862,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "always-assert", "async-trait", @@ -6886,7 +6886,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "parity-scale-codec", @@ -6904,7 +6904,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bitvec", "derive_more", @@ -6933,7 +6933,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bitvec", "futures 0.3.25", @@ -6953,7 +6953,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bitvec", "fatality", @@ -6972,7 +6972,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -6987,7 +6987,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "futures 0.3.25", @@ -7005,7 +7005,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "polkadot-node-subsystem", @@ -7020,7 +7020,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "futures-timer", @@ -7037,7 +7037,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "fatality", "futures 0.3.25", @@ -7056,7 +7056,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "futures 0.3.25", @@ -7073,7 +7073,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bitvec", "fatality", @@ -7091,7 +7091,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "always-assert", "assert_matches", @@ -7123,7 +7123,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "polkadot-node-primitives", @@ -7139,7 +7139,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "futures 0.3.25", "memory-lru", @@ -7155,7 +7155,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-std", "lazy_static", @@ -7173,7 +7173,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bs58", "futures 0.3.25", @@ -7192,7 +7192,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "derive_more", @@ -7215,7 +7215,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bounded-vec", "futures 0.3.25", @@ -7237,7 +7237,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -7247,7 +7247,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "derive_more", @@ -7270,7 +7270,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "derive_more", @@ -7303,7 +7303,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "futures 0.3.25", @@ -7326,7 +7326,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "derive_more", "frame-support", @@ -7343,7 +7343,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "env_logger 0.9.3", "kusama-runtime", @@ -7358,7 +7358,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bitvec", "frame-system", @@ -7388,7 +7388,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-gadget", "beefy-gadget-rpc", @@ -7420,7 +7420,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-primitives", "bitvec", @@ -7509,7 +7509,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-primitives", "bitvec", @@ -7556,7 +7556,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "polkadot-primitives", @@ -7570,7 +7570,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bs58", "parity-scale-codec", @@ -7582,7 +7582,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "bitflags", "bitvec", @@ -7625,7 +7625,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "async-trait", "beefy-gadget", @@ -7729,7 +7729,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -7750,7 +7750,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -7760,7 +7760,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-primitives", "bitvec", @@ -7821,7 +7821,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-benchmarking", "frame-system", @@ -8467,7 +8467,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -8551,7 +8551,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "polkadot-primitives", @@ -10214,7 +10214,7 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "enumn", "parity-scale-codec", @@ -11417,7 +11417,7 @@ dependencies = [ [[package]] name = "test-runtime-constants" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "polkadot-primitives", @@ -11687,7 +11687,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -11698,7 +11698,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "expander 0.0.6", "proc-macro-crate", @@ -12410,7 +12410,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "beefy-primitives", "bitvec", @@ -12500,7 +12500,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "polkadot-primitives", @@ -12734,7 +12734,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -12748,7 +12748,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-support", "frame-system", @@ -12794,7 +12794,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "frame-benchmarking", "frame-support", @@ -12812,7 +12812,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.9.32" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.32#c71e872afed296d1825b15ea4b2a74750c1ba647" +source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.32-recent-bootnodes#90e98fe87db4b62c7722e802549d2b3739b07017" dependencies = [ "Inflector", "proc-macro2", @@ -12836,7 +12836,7 @@ dependencies = [ [[package]] name = "zeitgeist-node" -version = "0.3.8" +version = "0.3.9" dependencies = [ "battery-station-runtime", "cfg-if 1.0.0", @@ -12921,7 +12921,7 @@ dependencies = [ [[package]] name = "zeitgeist-primitives" -version = "0.3.8" +version = "0.3.9" dependencies = [ "arbitrary", "frame-support", @@ -12939,7 +12939,7 @@ dependencies = [ [[package]] name = "zeitgeist-runtime" -version = "0.3.8" +version = "0.3.9" dependencies = [ "cfg-if 1.0.0", "common-runtime", @@ -13059,7 +13059,7 @@ dependencies = [ [[package]] name = "zrml-authorized" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13076,7 +13076,7 @@ dependencies = [ [[package]] name = "zrml-court" -version = "0.3.8" +version = "0.3.9" dependencies = [ "arrayvec 0.7.2", "frame-benchmarking", @@ -13096,7 +13096,7 @@ dependencies = [ [[package]] name = "zrml-global-disputes" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13116,7 +13116,7 @@ dependencies = [ [[package]] name = "zrml-liquidity-mining" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13134,7 +13134,7 @@ dependencies = [ [[package]] name = "zrml-market-commons" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-support", "frame-system", @@ -13150,7 +13150,7 @@ dependencies = [ [[package]] name = "zrml-orderbook-v1" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13179,7 +13179,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13230,7 +13230,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets-runtime-api" -version = "0.3.8" +version = "0.3.9" dependencies = [ "parity-scale-codec", "sp-api", @@ -13239,7 +13239,7 @@ dependencies = [ [[package]] name = "zrml-rikiddo" -version = "0.3.8" +version = "0.3.9" dependencies = [ "arbitrary", "cfg-if 1.0.0", @@ -13272,7 +13272,7 @@ dependencies = [ [[package]] name = "zrml-simple-disputes" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13289,7 +13289,7 @@ dependencies = [ [[package]] name = "zrml-styx" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13305,7 +13305,7 @@ dependencies = [ [[package]] name = "zrml-swaps" -version = "0.3.8" +version = "0.3.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -13347,7 +13347,7 @@ dependencies = [ [[package]] name = "zrml-swaps-rpc" -version = "0.3.8" +version = "0.3.9" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13360,7 +13360,7 @@ dependencies = [ [[package]] name = "zrml-swaps-runtime-api" -version = "0.3.8" +version = "0.3.9" dependencies = [ "parity-scale-codec", "sp-api", diff --git a/Cargo.toml b/Cargo.toml index d38578d8b..b6b4157cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -112,3 +112,22 @@ lto = true opt-level = 3 # Zeitgeist runtime requires unwinding. panic = "unwind" + +[patch."https://github.com/paritytech/polkadot"] +pallet-xcm = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-cli = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-client = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-core-primitives = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-node-primitives = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-node-subsystem = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-overseer = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-parachain = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-primitives = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-runtime = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-runtime-parachains = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-service = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +polkadot-test-service = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +rococo-runtime = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +xcm = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +xcm-builder = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } +xcm-executor = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.32-recent-bootnodes" } diff --git a/Dockerfile b/Dockerfile index 072562f41..7cb7bb18e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ COPY . /zeitgeist RUN apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" -RUN ./scripts/init.sh +RUN ./scripts/init.sh nosudo RUN . "$HOME/.cargo/env" && cargo build --profile "$PROFILE" --features "$FEATURES" diff --git a/node/Cargo.toml b/node/Cargo.toml index ef8a5111f..4df5d88a8 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -107,6 +107,7 @@ zeitgeist-primitives = { path = "../primitives" } zeitgeist-runtime = { path = "../runtime/zeitgeist", optional = true } zrml-liquidity-mining = { path = "../zrml/liquidity-mining" } zrml-swaps-rpc = { path = "../zrml/swaps/rpc" } + [features] default = ["with-battery-station-runtime", "with-zeitgeist-runtime"] parachain = [ @@ -177,7 +178,7 @@ description = "An evolving blockchain for prediction markets and futarchy." edition = "2021" homepage = "https://zeitgeist.pm" name = "zeitgeist-node" -version = "0.3.8" +version = "0.3.9" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 8de2c8957..87a5a04ad 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -34,4 +34,4 @@ with-global-disputes = [] authors = ["Zeitgeist PM "] edition = "2021" name = "zeitgeist-primitives" -version = "0.3.8" +version = "0.3.9" diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 74a3549de..eee248a39 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -408,7 +408,7 @@ with-global-disputes = [ authors = ["Zeitgeist PM "] edition = "2021" name = "battery-station-runtime" -version = "0.3.8" +version = "0.3.9" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index c95e707a4..4b9f52690 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -91,10 +91,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 45, + spec_version: 46, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 20, + transaction_version: 21, state_version: 1, }; diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 1e8550da0..c4cf9f3ca 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -77,7 +77,7 @@ with-global-disputes = [] authors = ["Zeitgeist PM "] edition = "2021" name = "common-runtime" -version = "0.3.8" +version = "0.3.9" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index a1dcae571..de959448c 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,13 +51,13 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::weights::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - Weight::from_ref_time(5_117_000) + Weight::from_ref_time(14_130_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - Weight::from_ref_time(4_929_000) + Weight::from_ref_time(14_070_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index 4ff36d522..97093daa1 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,41 +50,41 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl frame_system::weights::WeightInfo for WeightInfo { fn remark(b: u32) -> Weight { - Weight::from_ref_time(14_250_344) + Weight::from_ref_time(7_750_000) // Standard Error: 1 - .saturating_add(Weight::from_ref_time(221).saturating_mul(b.into())) + .saturating_add(Weight::from_ref_time(692).saturating_mul(b.into())) } fn remark_with_event(b: u32) -> Weight { - Weight::from_ref_time(8_451_000) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(1_022).saturating_mul(b.into())) + Weight::from_ref_time(23_520_000) + // Standard Error: 4 + .saturating_add(Weight::from_ref_time(2_341).saturating_mul(b.into())) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - Weight::from_ref_time(5_344_000) + Weight::from_ref_time(16_260_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Skipped Metadata (r:0 w:0) fn set_storage(i: u32) -> Weight { - Weight::from_ref_time(2_566_000) - // Standard Error: 641 - .saturating_add(Weight::from_ref_time(422_592).saturating_mul(i.into())) + Weight::from_ref_time(7_690_000) + // Standard Error: 4_435 + .saturating_add(Weight::from_ref_time(1_133_019).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_storage(i: u32) -> Weight { - Weight::from_ref_time(171_591) - // Standard Error: 1_072 - .saturating_add(Weight::from_ref_time(374_557).saturating_mul(i.into())) + Weight::from_ref_time(589_951) + // Standard Error: 8_232 + .saturating_add(Weight::from_ref_time(925_898).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn kill_prefix(p: u32) -> Weight { - Weight::from_ref_time(3_820_435) - // Standard Error: 1_116 - .saturating_add(Weight::from_ref_time(802_972).saturating_mul(p.into())) + Weight::from_ref_time(10_930_000) + // Standard Error: 10_457 + .saturating_add(Weight::from_ref_time(2_090_894).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } } diff --git a/runtime/common/src/weights/orml_currencies.rs b/runtime/common/src/weights/orml_currencies.rs index 56f819471..6060abb8d 100644 --- a/runtime/common/src/weights/orml_currencies.rs +++ b/runtime/common/src/weights/orml_currencies.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for orml_currencies //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,13 +49,13 @@ impl orml_currencies::WeightInfo for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_non_native_currency() -> Weight { - Weight::from_ref_time(32_440_000) + Weight::from_ref_time(126_411_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn transfer_native_currency() -> Weight { - Weight::from_ref_time(26_112_000) + Weight::from_ref_time(108_350_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -63,19 +63,19 @@ impl orml_currencies::WeightInfo for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn update_balance_non_native_currency() -> Weight { - Weight::from_ref_time(21_841_000) + Weight::from_ref_time(81_740_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn update_balance_native_currency_creating() -> Weight { - Weight::from_ref_time(21_761_000) + Weight::from_ref_time(60_170_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn update_balance_native_currency_killing() -> Weight { - Weight::from_ref_time(19_903_000) + Weight::from_ref_time(56_730_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/orml_tokens.rs b/runtime/common/src/weights/orml_tokens.rs index 35439a294..576eea239 100644 --- a/runtime/common/src/weights/orml_tokens.rs +++ b/runtime/common/src/weights/orml_tokens.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,28 +49,28 @@ impl orml_tokens::WeightInfo for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(32_422_000) + Weight::from_ref_time(77_290_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(33_839_000) + Weight::from_ref_time(79_941_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(26_131_000) + Weight::from_ref_time(64_210_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Tokens Accounts (r:2 w:2) // Storage: System Account (r:2 w:1) fn force_transfer() -> Weight { - Weight::from_ref_time(29_017_000) + Weight::from_ref_time(69_260_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -78,7 +78,7 @@ impl orml_tokens::WeightInfo for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: System Account (r:1 w:1) fn set_balance() -> Weight { - Weight::from_ref_time(21_766_000) + Weight::from_ref_time(52_360_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_inherent.rs b/runtime/common/src/weights/pallet_author_inherent.rs index 32d3ad1f3..a5077da73 100644 --- a/runtime/common/src/weights/pallet_author_inherent.rs +++ b/runtime/common/src/weights/pallet_author_inherent.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_author_inherent //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -56,7 +56,7 @@ impl pallet_author_inherent::weights::WeightInfo for We // Storage: AuthorFilter EligibleCount (r:1 w:0) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn kick_off_authorship_validation() -> Weight { - Weight::from_ref_time(17_682_000) + Weight::from_ref_time(59_020_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_author_mapping.rs b/runtime/common/src/weights/pallet_author_mapping.rs index c209eb3a7..16aa4183e 100644 --- a/runtime/common/src/weights/pallet_author_mapping.rs +++ b/runtime/common/src/weights/pallet_author_mapping.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_author_mapping //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,14 +53,14 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn add_association() -> Weight { - Weight::from_ref_time(22_888_000) + Weight::from_ref_time(53_390_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn update_association() -> Weight { - Weight::from_ref_time(19_480_000) + Weight::from_ref_time(48_100_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -68,7 +68,7 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: System Account (r:1 w:1) // Storage: AuthorMapping NimbusLookup (r:0 w:1) fn clear_association() -> Weight { - Weight::from_ref_time(25_500_000) + Weight::from_ref_time(63_280_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -76,14 +76,14 @@ impl pallet_author_mapping::weights::WeightInfo for Wei // Storage: AuthorMapping MappingWithDeposit (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_keys() -> Weight { - Weight::from_ref_time(28_334_000) + Weight::from_ref_time(68_601_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: AuthorMapping NimbusLookup (r:1 w:1) // Storage: AuthorMapping MappingWithDeposit (r:2 w:2) fn set_keys() -> Weight { - Weight::from_ref_time(21_788_000) + Weight::from_ref_time(54_100_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_slot_filter.rs b/runtime/common/src/weights/pallet_author_slot_filter.rs index 05125ed59..e11b60f57 100644 --- a/runtime/common/src/weights/pallet_author_slot_filter.rs +++ b/runtime/common/src/weights/pallet_author_slot_filter.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_author_slot_filter //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,6 +51,6 @@ pub struct WeightInfo(PhantomData); impl pallet_author_slot_filter::weights::WeightInfo for WeightInfo { // Storage: AuthorFilter EligibleCount (r:0 w:1) fn set_eligible() -> Weight { - Weight::from_ref_time(9_073_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(24_300_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index c36932388..286238098 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,45 +49,45 @@ use frame_support::{ /// Weight functions for pallet_balances (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_balances::weights::WeightInfo for WeightInfo { - // Storage: System Account (r:1 w:1) + // Storage: System Account (r:2 w:2) fn transfer() -> Weight { - Weight::from_ref_time(31_432_000) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(88_860_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(23_506_000) + Weight::from_ref_time(57_540_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - Weight::from_ref_time(17_067_000) + Weight::from_ref_time(43_620_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - Weight::from_ref_time(19_078_000) + Weight::from_ref_time(47_800_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: System Account (r:2 w:2) + // Storage: System Account (r:3 w:3) fn force_transfer() -> Weight { - Weight::from_ref_time(31_192_000) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + Weight::from_ref_time(87_450_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(26_679_000) + Weight::from_ref_time(66_530_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - Weight::from_ref_time(14_123_000) + Weight::from_ref_time(36_940_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_bounties.rs b/runtime/common/src/weights/pallet_bounties.rs index 8883f6ee5..aef831d20 100644 --- a/runtime/common/src/weights/pallet_bounties.rs +++ b/runtime/common/src/weights/pallet_bounties.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -53,42 +53,42 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: Bounties BountyDescriptions (r:0 w:1) // Storage: Bounties Bounties (r:0 w:1) fn propose_bounty(d: u32) -> Weight { - Weight::from_ref_time(22_070_891) - // Standard Error: 7 - .saturating_add(Weight::from_ref_time(513).saturating_mul(d.into())) + Weight::from_ref_time(54_249_004) + // Standard Error: 51 + .saturating_add(Weight::from_ref_time(1_476).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: Bounties BountyApprovals (r:1 w:1) fn approve_bounty() -> Weight { - Weight::from_ref_time(9_036_000) + Weight::from_ref_time(23_710_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn propose_curator() -> Weight { - Weight::from_ref_time(8_789_000) + Weight::from_ref_time(22_920_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Bounties Bounties (r:1 w:1) - // Storage: System Account (r:1 w:1) + // Storage: System Account (r:2 w:2) fn unassign_curator() -> Weight { - Weight::from_ref_time(25_810_000) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + Weight::from_ref_time(73_561_000) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:1 w:1) fn accept_curator() -> Weight { - Weight::from_ref_time(21_446_000) + Weight::from_ref_time(51_951_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Bounties Bounties (r:1 w:1) fn award_bounty() -> Weight { - Weight::from_ref_time(16_247_000) + Weight::from_ref_time(40_840_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -96,28 +96,29 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn claim_bounty() -> Weight { - Weight::from_ref_time(50_791_000) + Weight::from_ref_time(118_311_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_proposed() -> Weight { - Weight::from_ref_time(26_410_000) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) + Weight::from_ref_time(75_210_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Bounties Bounties (r:1 w:1) // Storage: System Account (r:3 w:3) // Storage: Bounties BountyDescriptions (r:0 w:1) fn close_bounty_active() -> Weight { - Weight::from_ref_time(39_490_000) + Weight::from_ref_time(91_651_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Bounties Bounties (r:1 w:1) fn extend_bounty_expiry() -> Weight { - Weight::from_ref_time(16_379_000) + Weight::from_ref_time(39_970_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -125,9 +126,9 @@ impl pallet_bounties::weights::WeightInfo for WeightInf // Storage: Bounties Bounties (r:2 w:2) // Storage: System Account (r:3 w:3) fn spend_funds(b: u32) -> Weight { - Weight::from_ref_time(19_140_664) - // Standard Error: 26_913 - .saturating_add(Weight::from_ref_time(18_448_072).saturating_mul(b.into())) + Weight::from_ref_time(30_972_788) + // Standard Error: 253_591 + .saturating_add(Weight::from_ref_time(45_213_614).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) } diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index 383666603..208dac109 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,11 +54,11 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Prime (r:0 w:1) // Storage: AdvisoryCommittee Voting (r:255 w:255) fn set_members(m: u32, _n: u32, p: u32) -> Weight { - Weight::from_ref_time(12_092_000) - // Standard Error: 120_533 - .saturating_add(Weight::from_ref_time(9_830_156).saturating_mul(m.into())) - // Standard Error: 47_324 - .saturating_add(Weight::from_ref_time(5_530_913).saturating_mul(p.into())) + Weight::from_ref_time(32_731_000) + // Standard Error: 311_304 + .saturating_add(Weight::from_ref_time(23_235_351).saturating_mul(m.into())) + // Standard Error: 122_225 + .saturating_add(Weight::from_ref_time(13_933_822).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -66,21 +66,21 @@ impl pallet_collective::weights::WeightInfo for WeightI } // Storage: AdvisoryCommittee Members (r:1 w:0) fn execute(b: u32, m: u32) -> Weight { - Weight::from_ref_time(13_910_710) - // Standard Error: 39 - .saturating_add(Weight::from_ref_time(1_329).saturating_mul(b.into())) - // Standard Error: 409 - .saturating_add(Weight::from_ref_time(13_307).saturating_mul(m.into())) + Weight::from_ref_time(38_099_888) + // Standard Error: 306 + .saturating_add(Weight::from_ref_time(2_613).saturating_mul(b.into())) + // Standard Error: 3_157 + .saturating_add(Weight::from_ref_time(32_308).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee ProposalOf (r:1 w:0) fn propose_execute(b: u32, m: u32) -> Weight { - Weight::from_ref_time(15_156_779) - // Standard Error: 36 - .saturating_add(Weight::from_ref_time(1_439).saturating_mul(b.into())) - // Standard Error: 378 - .saturating_add(Weight::from_ref_time(17_083).saturating_mul(m.into())) + Weight::from_ref_time(31_265_128) + // Standard Error: 1_317 + .saturating_add(Weight::from_ref_time(10_669).saturating_mul(b.into())) + // Standard Error: 13_595 + .saturating_add(Weight::from_ref_time(112_110).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) } // Storage: AdvisoryCommittee Members (r:1 w:0) @@ -89,22 +89,22 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalCount (r:1 w:1) // Storage: AdvisoryCommittee Voting (r:0 w:1) fn propose_proposed(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(22_819_241) - // Standard Error: 354 - .saturating_add(Weight::from_ref_time(4_011).saturating_mul(b.into())) - // Standard Error: 3_707 - .saturating_add(Weight::from_ref_time(35_095).saturating_mul(m.into())) - // Standard Error: 1_427 - .saturating_add(Weight::from_ref_time(90_320).saturating_mul(p.into())) + Weight::from_ref_time(25_616_035) + // Standard Error: 1_527 + .saturating_add(Weight::from_ref_time(17_284).saturating_mul(b.into())) + // Standard Error: 15_956 + .saturating_add(Weight::from_ref_time(169_554).saturating_mul(m.into())) + // Standard Error: 6_142 + .saturating_add(Weight::from_ref_time(343_561).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: AdvisoryCommittee Members (r:1 w:0) // Storage: AdvisoryCommittee Voting (r:1 w:1) fn vote(m: u32) -> Weight { - Weight::from_ref_time(34_942_963) - // Standard Error: 5_250 - .saturating_add(Weight::from_ref_time(43_923).saturating_mul(m.into())) + Weight::from_ref_time(90_528_096) + // Standard Error: 14_755 + .saturating_add(Weight::from_ref_time(146_151).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -113,9 +113,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_early_disapproved(_m: u32, p: u32) -> Weight { - Weight::from_ref_time(31_521_383) - // Standard Error: 1_768 - .saturating_add(Weight::from_ref_time(91_263).saturating_mul(p.into())) + Weight::from_ref_time(75_980_153) + // Standard Error: 6_504 + .saturating_add(Weight::from_ref_time(264_113).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -124,13 +124,13 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_early_approved(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(27_750_291) - // Standard Error: 381 - .saturating_add(Weight::from_ref_time(3_284).saturating_mul(b.into())) - // Standard Error: 4_030 - .saturating_add(Weight::from_ref_time(77_635).saturating_mul(m.into())) - // Standard Error: 1_532 - .saturating_add(Weight::from_ref_time(101_653).saturating_mul(p.into())) + Weight::from_ref_time(69_183_206) + // Standard Error: 1_705 + .saturating_add(Weight::from_ref_time(3_701).saturating_mul(b.into())) + // Standard Error: 18_045 + .saturating_add(Weight::from_ref_time(56_946).saturating_mul(m.into())) + // Standard Error: 6_858 + .saturating_add(Weight::from_ref_time(354_392).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -140,9 +140,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Proposals (r:1 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn close_disapproved(_m: u32, p: u32) -> Weight { - Weight::from_ref_time(35_447_953) - // Standard Error: 1_843 - .saturating_add(Weight::from_ref_time(82_511).saturating_mul(p.into())) + Weight::from_ref_time(70_835_908) + // Standard Error: 5_382 + .saturating_add(Weight::from_ref_time(251_804).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -152,13 +152,13 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee ProposalOf (r:1 w:1) // Storage: AdvisoryCommittee Proposals (r:1 w:1) fn close_approved(b: u32, m: u32, p: u32) -> Weight { - Weight::from_ref_time(32_560_116) - // Standard Error: 378 - .saturating_add(Weight::from_ref_time(1_465).saturating_mul(b.into())) - // Standard Error: 4_008 - .saturating_add(Weight::from_ref_time(62_930).saturating_mul(m.into())) - // Standard Error: 1_523 - .saturating_add(Weight::from_ref_time(101_811).saturating_mul(p.into())) + Weight::from_ref_time(75_528_267) + // Standard Error: 1_711 + .saturating_add(Weight::from_ref_time(7_499).saturating_mul(b.into())) + // Standard Error: 18_111 + .saturating_add(Weight::from_ref_time(50_403).saturating_mul(m.into())) + // Standard Error: 6_883 + .saturating_add(Weight::from_ref_time(320_949).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -166,9 +166,9 @@ impl pallet_collective::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Voting (r:0 w:1) // Storage: AdvisoryCommittee ProposalOf (r:0 w:1) fn disapprove_proposal(p: u32) -> Weight { - Weight::from_ref_time(20_281_170) - // Standard Error: 1_763 - .saturating_add(Weight::from_ref_time(84_565).saturating_mul(p.into())) + Weight::from_ref_time(44_597_874) + // Standard Error: 4_479 + .saturating_add(Weight::from_ref_time(227_653).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_contracts.rs b/runtime/common/src/weights/pallet_contracts.rs index 38c6847d3..e620888ad 100644 --- a/runtime/common/src/weights/pallet_contracts.rs +++ b/runtime/common/src/weights/pallet_contracts.rs @@ -1,3 +1,4 @@ +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -18,7 +19,7 @@ //! Autogenerated weights for pallet_contracts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-12, STEPS: `2`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -26,8 +27,8 @@ // benchmark // pallet // --chain=dev -// --steps=2 -// --repeat=2 +// --steps=50 +// --repeat=20 // --pallet=pallet_contracts // --extrinsic=* // --execution=wasm @@ -50,30 +51,31 @@ pub struct WeightInfo(PhantomData); impl pallet_contracts::weights::WeightInfo for WeightInfo { // Storage: Contracts DeletionQueue (r:1 w:0) fn on_process_deletion_queue_batch() -> Weight { - Weight::from_ref_time(5_601_000).saturating_add(T::DbWeight::get().reads(1)) + Weight::from_ref_time(5_430_000).saturating_add(T::DbWeight::get().reads(1)) } // Storage: Skipped Metadata (r:0 w:0) fn on_initialize_per_trie_key(k: u32) -> Weight { - Weight::from_ref_time(12_188_000) - // Standard Error: 20_156 - .saturating_add(Weight::from_ref_time(912_369).saturating_mul(k.into())) + Weight::from_ref_time(21_126_505) + // Standard Error: 13_440 + .saturating_add(Weight::from_ref_time(1_728_031).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) } // Storage: Contracts DeletionQueue (r:1 w:0) fn on_initialize_per_queue_item(q: u32) -> Weight { - Weight::from_ref_time(4_543_500) - // Standard Error: 44_304 - .saturating_add(Weight::from_ref_time(1_222_128).saturating_mul(q.into())) + Weight::from_ref_time(18_600_736) + // Standard Error: 14_810 + .saturating_add(Weight::from_ref_time(2_184_181).saturating_mul(q.into())) .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Contracts PristineCode (r:1 w:0) // Storage: Contracts CodeStorage (r:0 w:1) fn reinstrument(c: u32) -> Weight { - Weight::from_ref_time(22_137_000) - // Standard Error: 1_247 - .saturating_add(Weight::from_ref_time(39_526).saturating_mul(c.into())) + Weight::from_ref_time(55_981_230) + // Standard Error: 270 + .saturating_add(Weight::from_ref_time(92_321).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -83,9 +85,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: System Account (r:1 w:1) // Storage: System EventTopics (r:2 w:2) fn call_with_code_per_byte(c: u32) -> Weight { - Weight::from_ref_time(222_683_000) - // Standard Error: 785 - .saturating_add(Weight::from_ref_time(43_823).saturating_mul(c.into())) + Weight::from_ref_time(337_950_536) + // Standard Error: 215 + .saturating_add(Weight::from_ref_time(95_890).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -98,11 +100,11 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn instantiate_with_code(c: u32, s: u32) -> Weight { - Weight::from_ref_time(1_809_550_000) - // Standard Error: 5_129 - .saturating_add(Weight::from_ref_time(91_744).saturating_mul(c.into())) - // Standard Error: 628 - .saturating_add(Weight::from_ref_time(893).saturating_mul(s.into())) + Weight::from_ref_time(2_421_717_000) + // Standard Error: 427 + .saturating_add(Weight::from_ref_time(219_033).saturating_mul(c.into())) + // Standard Error: 50 + .saturating_add(Weight::from_ref_time(1_109).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(9)) } @@ -114,9 +116,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts OwnerInfoOf (r:1 w:1) // Storage: System EventTopics (r:2 w:2) fn instantiate(s: u32) -> Weight { - Weight::from_ref_time(260_380_000) - // Standard Error: 181 - .saturating_add(Weight::from_ref_time(1_426).saturating_mul(s.into())) + Weight::from_ref_time(335_483_496) + // Standard Error: 20 + .saturating_add(Weight::from_ref_time(2_381).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -126,7 +128,7 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: System Account (r:1 w:1) // Storage: System EventTopics (r:2 w:2) fn call() -> Weight { - Weight::from_ref_time(171_877_000) + Weight::from_ref_time(285_701_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -135,9 +137,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts PristineCode (r:0 w:1) // Storage: Contracts OwnerInfoOf (r:0 w:1) fn upload_code(c: u32) -> Weight { - Weight::from_ref_time(60_179_500) - // Standard Error: 2_818 - .saturating_add(Weight::from_ref_time(43_033).saturating_mul(c.into())) + Weight::from_ref_time(112_178_130) + // Standard Error: 332 + .saturating_add(Weight::from_ref_time(95_761).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -146,7 +148,7 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts CodeStorage (r:0 w:1) // Storage: Contracts PristineCode (r:0 w:1) fn remove_code() -> Weight { - Weight::from_ref_time(33_654_000) + Weight::from_ref_time(59_740_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -154,7 +156,7 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts OwnerInfoOf (r:2 w:2) // Storage: System EventTopics (r:3 w:3) fn set_code() -> Weight { - Weight::from_ref_time(36_960_000) + Weight::from_ref_time(63_861_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) } @@ -164,9 +166,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_caller(r: u32) -> Weight { - Weight::from_ref_time(258_116_000) - // Standard Error: 1_194_288 - .saturating_add(Weight::from_ref_time(27_047_925).saturating_mul(r.into())) + Weight::from_ref_time(429_851_105) + // Standard Error: 519_341 + .saturating_add(Weight::from_ref_time(64_705_911).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -176,9 +178,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_is_contract(r: u32) -> Weight { - Weight::from_ref_time(215_810_500) - // Standard Error: 1_262_523 - .saturating_add(Weight::from_ref_time(212_179_950).saturating_mul(r.into())) + Weight::from_ref_time(228_433_066) + // Standard Error: 2_457_712 + .saturating_add(Weight::from_ref_time(414_003_443).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -189,9 +191,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_code_hash(r: u32) -> Weight { - Weight::from_ref_time(223_645_500) - // Standard Error: 8_900_222 - .saturating_add(Weight::from_ref_time(283_481_800).saturating_mul(r.into())) + Weight::from_ref_time(253_602_444) + // Standard Error: 2_566_145 + .saturating_add(Weight::from_ref_time(501_245_968).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -202,9 +204,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_own_code_hash(r: u32) -> Weight { - Weight::from_ref_time(216_331_500) - // Standard Error: 809_749 - .saturating_add(Weight::from_ref_time(34_325_500).saturating_mul(r.into())) + Weight::from_ref_time(410_061_442) + // Standard Error: 554_698 + .saturating_add(Weight::from_ref_time(74_990_773).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -214,9 +216,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_caller_is_origin(r: u32) -> Weight { - Weight::from_ref_time(220_584_000) - // Standard Error: 2_759_015 - .saturating_add(Weight::from_ref_time(16_052_800).saturating_mul(r.into())) + Weight::from_ref_time(370_129_126) + // Standard Error: 305_060 + .saturating_add(Weight::from_ref_time(34_207_685).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -226,9 +228,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_address(r: u32) -> Weight { - Weight::from_ref_time(226_841_500) - // Standard Error: 1_648_740 - .saturating_add(Weight::from_ref_time(32_791_075).saturating_mul(r.into())) + Weight::from_ref_time(382_094_225) + // Standard Error: 559_795 + .saturating_add(Weight::from_ref_time(71_147_591).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -238,9 +240,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_gas_left(r: u32) -> Weight { - Weight::from_ref_time(220_184_000) - // Standard Error: 10_297_479 - .saturating_add(Weight::from_ref_time(44_753_825).saturating_mul(r.into())) + Weight::from_ref_time(380_790_502) + // Standard Error: 465_874 + .saturating_add(Weight::from_ref_time(71_661_062).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -250,10 +252,10 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_balance(r: u32) -> Weight { - Weight::from_ref_time(253_877_500) - // Standard Error: 2_419_606 - .saturating_add(Weight::from_ref_time(113_089_550).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(431_292_750) + // Standard Error: 1_167_048 + .saturating_add(Weight::from_ref_time(191_585_845).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:0) @@ -262,9 +264,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_value_transferred(r: u32) -> Weight { - Weight::from_ref_time(246_493_500) - // Standard Error: 1_126_023 - .saturating_add(Weight::from_ref_time(28_976_600).saturating_mul(r.into())) + Weight::from_ref_time(391_162_195) + // Standard Error: 568_077 + .saturating_add(Weight::from_ref_time(70_814_297).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -274,9 +276,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_minimum_balance(r: u32) -> Weight { - Weight::from_ref_time(272_463_000) - // Standard Error: 945_023 - .saturating_add(Weight::from_ref_time(28_268_750).saturating_mul(r.into())) + Weight::from_ref_time(373_534_298) + // Standard Error: 570_574 + .saturating_add(Weight::from_ref_time(72_100_896).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -286,9 +288,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_block_number(r: u32) -> Weight { - Weight::from_ref_time(264_879_000) - // Standard Error: 230_965 - .saturating_add(Weight::from_ref_time(27_293_875).saturating_mul(r.into())) + Weight::from_ref_time(399_854_114) + // Standard Error: 650_050 + .saturating_add(Weight::from_ref_time(69_599_814).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -298,9 +300,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_now(r: u32) -> Weight { - Weight::from_ref_time(280_674_000) - // Standard Error: 257_381 - .saturating_add(Weight::from_ref_time(27_561_650).saturating_mul(r.into())) + Weight::from_ref_time(409_619_912) + // Standard Error: 546_591 + .saturating_add(Weight::from_ref_time(68_293_199).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -311,10 +313,10 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: System EventTopics (r:2 w:2) // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn seal_weight_to_fee(r: u32) -> Weight { - Weight::from_ref_time(228_599_500) - // Standard Error: 5_459_062 - .saturating_add(Weight::from_ref_time(107_516_700).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(442_803_328) + // Standard Error: 1_135_167 + .saturating_add(Weight::from_ref_time(188_615_603).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:0) @@ -323,9 +325,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_gas(r: u32) -> Weight { - Weight::from_ref_time(154_333_500) - // Standard Error: 1_000_546 - .saturating_add(Weight::from_ref_time(14_770_100).saturating_mul(r.into())) + Weight::from_ref_time(266_802_137) + // Standard Error: 241_974 + .saturating_add(Weight::from_ref_time(35_276_027).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -335,9 +337,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_input(r: u32) -> Weight { - Weight::from_ref_time(221_481_000) - // Standard Error: 549_135 - .saturating_add(Weight::from_ref_time(30_928_325).saturating_mul(r.into())) + Weight::from_ref_time(388_193_410) + // Standard Error: 671_777 + .saturating_add(Weight::from_ref_time(66_820_636).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -347,9 +349,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_input_per_kb(n: u32) -> Weight { - Weight::from_ref_time(257_149_000) - // Standard Error: 135_607 - .saturating_add(Weight::from_ref_time(11_581_851).saturating_mul(n.into())) + Weight::from_ref_time(566_118_524) + // Standard Error: 48_908 + .saturating_add(Weight::from_ref_time(11_277_830).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -358,8 +360,10 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) - fn seal_return(_r: u32) -> Weight { - Weight::from_ref_time(221_856_500) + fn seal_return(r: u32) -> Weight { + Weight::from_ref_time(360_679_048) + // Standard Error: 7_022_513 + .saturating_add(Weight::from_ref_time(2_407_051).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -369,9 +373,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_return_per_kb(n: u32) -> Weight { - Weight::from_ref_time(217_413_500) - // Standard Error: 68_119 - .saturating_add(Weight::from_ref_time(248_573).saturating_mul(n.into())) + Weight::from_ref_time(332_530_984) + // Standard Error: 5_870 + .saturating_add(Weight::from_ref_time(292_619).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -383,7 +387,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts DeletionQueue (r:1 w:1) // Storage: Contracts OwnerInfoOf (r:1 w:1) fn seal_terminate(r: u32) -> Weight { - Weight::from_ref_time(306_287_500) + Weight::from_ref_time(362_646_016) + // Standard Error: 8_084_601 + .saturating_add(Weight::from_ref_time(126_591_583).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((5_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -396,10 +402,10 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: System EventTopics (r:2 w:2) // Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) fn seal_random(r: u32) -> Weight { - Weight::from_ref_time(224_070_500) - // Standard Error: 10_783_896 - .saturating_add(Weight::from_ref_time(133_815_475).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(483_492_798) + // Standard Error: 1_084_291 + .saturating_add(Weight::from_ref_time(234_691_271).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: System Account (r:1 w:0) @@ -408,9 +414,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_deposit_event(r: u32) -> Weight { - Weight::from_ref_time(218_450_000) - // Standard Error: 2_871_571 - .saturating_add(Weight::from_ref_time(231_214_125).saturating_mul(r.into())) + Weight::from_ref_time(475_254_342) + // Standard Error: 1_210_835 + .saturating_add(Weight::from_ref_time(414_842_876).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -420,11 +426,11 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32) -> Weight { - Weight::from_ref_time(599_450_000) - // Standard Error: 38_702_551 - .saturating_add(Weight::from_ref_time(114_331_125).saturating_mul(t.into())) - // Standard Error: 9_675_637 - .saturating_add(Weight::from_ref_time(67_165_531).saturating_mul(n.into())) + Weight::from_ref_time(800_511_261) + // Standard Error: 4_024_007 + .saturating_add(Weight::from_ref_time(273_889_344).saturating_mul(t.into())) + // Standard Error: 1_105_187 + .saturating_add(Weight::from_ref_time(128_312_139).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -436,17 +442,17 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_debug_message(r: u32) -> Weight { - Weight::from_ref_time(261_182_000) - // Standard Error: 491_229 - .saturating_add(Weight::from_ref_time(16_862_800).saturating_mul(r.into())) + Weight::from_ref_time(260_227_469) + // Standard Error: 329_312 + .saturating_add(Weight::from_ref_time(61_555_618).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage(r: u32) -> Weight { - Weight::from_ref_time(222_272_500) - // Standard Error: 2_118_999 - .saturating_add(Weight::from_ref_time(419_849_350).saturating_mul(r.into())) + Weight::from_ref_time(211_554_844) + // Standard Error: 3_488_247 + .saturating_add(Weight::from_ref_time(765_641_607).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -454,29 +460,29 @@ impl pallet_contracts::weights::WeightInfo for WeightIn } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_new_kb(n: u32) -> Weight { - Weight::from_ref_time(367_548_500) - // Standard Error: 7_446_959 - .saturating_add(Weight::from_ref_time(116_620_562).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(6)) - .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + Weight::from_ref_time(909_084_701) + // Standard Error: 2_743_185 + .saturating_add(Weight::from_ref_time(157_699_453).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(52)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(50)) + .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn seal_set_storage_per_old_kb(n: u32) -> Weight { - Weight::from_ref_time(400_932_500) - // Standard Error: 5_751_991 - .saturating_add(Weight::from_ref_time(75_846_125).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(6)) - .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + Weight::from_ref_time(906_858_298) + // Standard Error: 2_597_668 + .saturating_add(Weight::from_ref_time(131_583_508).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(51)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(49)) + .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage(r: u32) -> Weight { - Weight::from_ref_time(256_498_000) - // Standard Error: 9_619_229 - .saturating_add(Weight::from_ref_time(421_739_950).saturating_mul(r.into())) + Weight::from_ref_time(250_838_557) + // Standard Error: 3_953_072 + .saturating_add(Weight::from_ref_time(752_817_562).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -484,55 +490,55 @@ impl pallet_contracts::weights::WeightInfo for WeightIn } // Storage: Skipped Metadata (r:0 w:0) fn seal_clear_storage_per_kb(n: u32) -> Weight { - Weight::from_ref_time(340_707_500) - // Standard Error: 6_183_127 - .saturating_add(Weight::from_ref_time(78_563_125).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + Weight::from_ref_time(888_409_158) + // Standard Error: 2_872_941 + .saturating_add(Weight::from_ref_time(137_003_843).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(51)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(48)) + .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage(r: u32) -> Weight { - Weight::from_ref_time(224_135_500) - // Standard Error: 1_954_553 - .saturating_add(Weight::from_ref_time(331_546_500).saturating_mul(r.into())) + Weight::from_ref_time(307_853_330) + // Standard Error: 2_929_425 + .saturating_add(Weight::from_ref_time(624_411_181).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_get_storage_per_kb(n: u32) -> Weight { - Weight::from_ref_time(337_677_500) - // Standard Error: 7_249_799 - .saturating_add(Weight::from_ref_time(135_275_875).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + Weight::from_ref_time(843_713_360) + // Standard Error: 3_030_824 + .saturating_add(Weight::from_ref_time(276_315_933).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(51)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage(r: u32) -> Weight { - Weight::from_ref_time(226_766_500) - // Standard Error: 2_438_900 - .saturating_add(Weight::from_ref_time(320_889_600).saturating_mul(r.into())) + Weight::from_ref_time(249_841_376) + // Standard Error: 3_135_806 + .saturating_add(Weight::from_ref_time(603_144_627).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_contains_storage_per_kb(n: u32) -> Weight { - Weight::from_ref_time(326_977_000) - // Standard Error: 2_469_716 - .saturating_add(Weight::from_ref_time(64_628_437).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) + Weight::from_ref_time(763_767_425) + // Standard Error: 2_472_643 + .saturating_add(Weight::from_ref_time(130_252_790).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(51)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage(r: u32) -> Weight { - Weight::from_ref_time(230_994_000) - // Standard Error: 437_574 - .saturating_add(Weight::from_ref_time(416_743_400).saturating_mul(r.into())) + Weight::from_ref_time(334_655_059) + // Standard Error: 3_051_400 + .saturating_add(Weight::from_ref_time(785_392_996).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -540,13 +546,13 @@ impl pallet_contracts::weights::WeightInfo for WeightIn } // Storage: Skipped Metadata (r:0 w:0) fn seal_take_storage_per_kb(n: u32) -> Weight { - Weight::from_ref_time(444_981_500) - // Standard Error: 3_200_572 - .saturating_add(Weight::from_ref_time(134_229_000).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().reads((10_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(5)) - .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(n.into()))) + Weight::from_ref_time(966_883_133) + // Standard Error: 3_258_692 + .saturating_add(Weight::from_ref_time(278_953_423).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(51)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().writes(48)) + .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:1 w:1) @@ -554,12 +560,12 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_transfer(r: u32) -> Weight { - Weight::from_ref_time(227_076_500) - // Standard Error: 11_053_559 - .saturating_add(Weight::from_ref_time(1_323_468_750).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(273_996_331) + // Standard Error: 6_652_380 + .saturating_add(Weight::from_ref_time(2_417_165_113).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) } // Storage: System Account (r:1 w:0) @@ -568,10 +574,10 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_call(r: u32) -> Weight { - Weight::from_ref_time(224_246_500) - // Standard Error: 14_446_751 - .saturating_add(Weight::from_ref_time(15_256_636_875).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(386_971_000) + // Standard Error: 22_578_548 + .saturating_add(Weight::from_ref_time(26_372_914_655).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((160_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((160_u64).saturating_mul(r.into()))) @@ -582,13 +588,13 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_delegate_call(r: u32) -> Weight { - Weight::from_ref_time(229_276_000) - // Standard Error: 3_317_526 - .saturating_add(Weight::from_ref_time(15_212_235_325).saturating_mul(r.into())) + Weight::from_ref_time(388_991_000) + // Standard Error: 23_351_009 + .saturating_add(Weight::from_ref_time(25_697_616_633).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((154_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().reads((150_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((77_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes((75_u64).saturating_mul(r.into()))) } // Storage: System Account (r:1 w:0) // Storage: Contracts ContractInfoOf (r:81 w:81) @@ -596,11 +602,11 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:82 w:82) fn seal_call_per_transfer_clone_kb(t: u32, c: u32) -> Weight { - Weight::from_ref_time(9_695_780_999) - // Standard Error: 369_697_173 - .saturating_add(Weight::from_ref_time(1_329_061_000).saturating_mul(t.into())) - // Standard Error: 361_032 - .saturating_add(Weight::from_ref_time(10_959_798).saturating_mul(c.into())) + Weight::from_ref_time(16_857_681_725) + // Standard Error: 80_358_674 + .saturating_add(Weight::from_ref_time(2_533_007_016).saturating_mul(t.into())) + // Standard Error: 120_493 + .saturating_add(Weight::from_ref_time(12_716_262).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(167)) .saturating_add(T::DbWeight::get().reads((81_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(163)) @@ -612,14 +618,14 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) // Storage: Contracts Nonce (r:1 w:1) - // Storage: Contracts OwnerInfoOf (r:1600 w:1600) + // Storage: Contracts OwnerInfoOf (r:80 w:80) fn seal_instantiate(r: u32) -> Weight { - Weight::from_ref_time(228_539_500) - // Standard Error: 20_816_729 - .saturating_add(Weight::from_ref_time(22_123_910_350).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) + Weight::from_ref_time(334_620_000) + // Standard Error: 44_876_896 + .saturating_add(Weight::from_ref_time(37_005_078_638).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((400_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes((400_u64).saturating_mul(r.into()))) } // Storage: System Account (r:81 w:81) @@ -630,11 +636,11 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts OwnerInfoOf (r:1 w:1) // Storage: System EventTopics (r:82 w:82) fn seal_instantiate_per_transfer_salt_kb(t: u32, s: u32) -> Weight { - Weight::from_ref_time(8_301_534_499) - // Standard Error: 781_021_718 - .saturating_add(Weight::from_ref_time(5_260_321_499).saturating_mul(t.into())) - // Standard Error: 813_564 - .saturating_add(Weight::from_ref_time(117_025_008).saturating_mul(s.into())) + Weight::from_ref_time(22_281_656_470) + // Standard Error: 217_359_849 + .saturating_add(Weight::from_ref_time(741_718_573).saturating_mul(t.into())) + // Standard Error: 347_653 + .saturating_add(Weight::from_ref_time(157_462_985).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(249)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) .saturating_add(T::DbWeight::get().writes(247)) @@ -646,9 +652,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_sha2_256(r: u32) -> Weight { - Weight::from_ref_time(216_401_000) - // Standard Error: 256_876 - .saturating_add(Weight::from_ref_time(35_677_125).saturating_mul(r.into())) + Weight::from_ref_time(415_594_038) + // Standard Error: 654_607 + .saturating_add(Weight::from_ref_time(75_882_836).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -658,9 +664,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_sha2_256_per_kb(n: u32) -> Weight { - Weight::from_ref_time(299_213_499) - // Standard Error: 13_573 - .saturating_add(Weight::from_ref_time(78_232_935).saturating_mul(n.into())) + Weight::from_ref_time(489_535_499) + // Standard Error: 90_743 + .saturating_add(Weight::from_ref_time(75_697_388).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -670,9 +676,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_keccak_256(r: u32) -> Weight { - Weight::from_ref_time(213_370_000) - // Standard Error: 220_043 - .saturating_add(Weight::from_ref_time(61_565_850).saturating_mul(r.into())) + Weight::from_ref_time(387_212_676) + // Standard Error: 781_503 + .saturating_add(Weight::from_ref_time(118_018_650).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -682,9 +688,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_keccak_256_per_kb(n: u32) -> Weight { - Weight::from_ref_time(335_316_999) - // Standard Error: 684_961 - .saturating_add(Weight::from_ref_time(226_346_456).saturating_mul(n.into())) + Weight::from_ref_time(414_375_901) + // Standard Error: 298_046 + .saturating_add(Weight::from_ref_time(339_822_495).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -694,9 +700,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_blake2_256(r: u32) -> Weight { - Weight::from_ref_time(234_331_000) - // Standard Error: 255_403 - .saturating_add(Weight::from_ref_time(39_786_375).saturating_mul(r.into())) + Weight::from_ref_time(405_586_694) + // Standard Error: 663_562 + .saturating_add(Weight::from_ref_time(86_490_468).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -706,9 +712,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_blake2_256_per_kb(n: u32) -> Weight { - Weight::from_ref_time(263_570_999) - // Standard Error: 131_422 - .saturating_add(Weight::from_ref_time(111_246_290).saturating_mul(n.into())) + Weight::from_ref_time(413_977_103) + // Standard Error: 152_186 + .saturating_add(Weight::from_ref_time(142_126_964).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -718,9 +724,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_blake2_128(r: u32) -> Weight { - Weight::from_ref_time(221_632_000) - // Standard Error: 2_067_178 - .saturating_add(Weight::from_ref_time(43_783_475).saturating_mul(r.into())) + Weight::from_ref_time(444_521_069) + // Standard Error: 750_665 + .saturating_add(Weight::from_ref_time(83_524_062).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -730,9 +736,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_hash_blake2_128_per_kb(n: u32) -> Weight { - Weight::from_ref_time(254_598_999) - // Standard Error: 951_690 - .saturating_add(Weight::from_ref_time(109_899_369).saturating_mul(n.into())) + Weight::from_ref_time(516_241_606) + // Standard Error: 166_730 + .saturating_add(Weight::from_ref_time(142_486_559).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -742,9 +748,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_ecdsa_recover(r: u32) -> Weight { - Weight::from_ref_time(221_882_000) - // Standard Error: 54_352_059 - .saturating_add(Weight::from_ref_time(2_997_249_925).saturating_mul(r.into())) + Weight::from_ref_time(522_466_425) + // Standard Error: 3_403_869 + .saturating_add(Weight::from_ref_time(5_058_433_282).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -754,9 +760,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) fn seal_ecdsa_to_eth_address(r: u32) -> Weight { - Weight::from_ref_time(219_738_000) - // Standard Error: 17_755_459 - .saturating_add(Weight::from_ref_time(2_157_771_450).saturating_mul(r.into())) + Weight::from_ref_time(451_250_199) + // Standard Error: 2_486_466 + .saturating_add(Weight::from_ref_time(3_146_420_906).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -765,259 +771,265 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Storage: Contracts CodeStorage (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) // Storage: System EventTopics (r:2 w:2) - // Storage: Contracts OwnerInfoOf (r:1536 w:1536) + // Storage: Contracts OwnerInfoOf (r:16 w:16) fn seal_set_code_hash(r: u32) -> Weight { - Weight::from_ref_time(226_541_000) - // Standard Error: 24_142_120 - .saturating_add(Weight::from_ref_time(1_085_830_150).saturating_mul(r.into())) + Weight::from_ref_time(385_651_000) + // Standard Error: 5_606_558 + .saturating_add(Weight::from_ref_time(1_961_350_521).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((154_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().reads((150_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((154_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes((150_u64).saturating_mul(r.into()))) } - fn instr_i64const(r: u32) -> Weight { - Weight::from_ref_time(133_879_500) - // Standard Error: 2_106_283 - .saturating_add(Weight::from_ref_time(724_170).saturating_mul(r.into())) + fn instr_i64const(_r: u32) -> Weight { + Weight::from_ref_time(122_460_750) } fn instr_i64load(r: u32) -> Weight { - Weight::from_ref_time(134_084_500) - // Standard Error: 3_462_466 - .saturating_add(Weight::from_ref_time(4_334_050).saturating_mul(r.into())) + Weight::from_ref_time(125_175_300) + // Standard Error: 105_692 + .saturating_add(Weight::from_ref_time(3_359_715).saturating_mul(r.into())) } fn instr_i64store(r: u32) -> Weight { - Weight::from_ref_time(149_699_500) - // Standard Error: 2_413_431 - .saturating_add(Weight::from_ref_time(3_329_330).saturating_mul(r.into())) + Weight::from_ref_time(112_576_350) + // Standard Error: 101_259 + .saturating_add(Weight::from_ref_time(3_521_170).saturating_mul(r.into())) } fn instr_select(r: u32) -> Weight { - Weight::from_ref_time(146_458_500) - // Standard Error: 2_063_443 - .saturating_add(Weight::from_ref_time(3_161_800).saturating_mul(r.into())) + Weight::from_ref_time(102_506_019) + // Standard Error: 75_352 + .saturating_add(Weight::from_ref_time(2_401_178).saturating_mul(r.into())) } fn instr_if(r: u32) -> Weight { - Weight::from_ref_time(147_836_000) - // Standard Error: 1_716_657 - .saturating_add(Weight::from_ref_time(1_054_300).saturating_mul(r.into())) + Weight::from_ref_time(99_372_077) + // Standard Error: 83_410 + .saturating_add(Weight::from_ref_time(2_944_705).saturating_mul(r.into())) } - fn instr_br(_r: u32) -> Weight { - Weight::from_ref_time(239_646_000) + fn instr_br(r: u32) -> Weight { + Weight::from_ref_time(98_973_384) + // Standard Error: 41_547 + .saturating_add(Weight::from_ref_time(1_068_659).saturating_mul(r.into())) } fn instr_br_if(r: u32) -> Weight { - Weight::from_ref_time(167_453_000) - // Standard Error: 2_742_173 - .saturating_add(Weight::from_ref_time(1_656_160).saturating_mul(r.into())) + Weight::from_ref_time(91_819_087) + // Standard Error: 40_887 + .saturating_add(Weight::from_ref_time(2_207_857).saturating_mul(r.into())) } fn instr_br_table(r: u32) -> Weight { - Weight::from_ref_time(140_782_500) - // Standard Error: 1_764_839 - .saturating_add(Weight::from_ref_time(3_232_850).saturating_mul(r.into())) + Weight::from_ref_time(95_474_418) + // Standard Error: 58_610 + .saturating_add(Weight::from_ref_time(2_581_391).saturating_mul(r.into())) } fn instr_br_table_per_entry(_e: u32) -> Weight { - Weight::from_ref_time(138_957_211) + Weight::from_ref_time(117_405_984) } fn instr_call(r: u32) -> Weight { - Weight::from_ref_time(136_520_000) - // Standard Error: 1_388_131 - .saturating_add(Weight::from_ref_time(8_829_590).saturating_mul(r.into())) + Weight::from_ref_time(112_429_292) + // Standard Error: 99_778 + .saturating_add(Weight::from_ref_time(13_774_135).saturating_mul(r.into())) } fn instr_call_indirect(r: u32) -> Weight { - Weight::from_ref_time(158_130_500) - // Standard Error: 2_204_834 - .saturating_add(Weight::from_ref_time(6_753_540).saturating_mul(r.into())) + Weight::from_ref_time(150_769_904) + // Standard Error: 95_834 + .saturating_add(Weight::from_ref_time(15_632_455).saturating_mul(r.into())) } - fn instr_call_indirect_per_param(_p: u32) -> Weight { - Weight::from_ref_time(246_503_500) + fn instr_call_indirect_per_param(p: u32) -> Weight { + Weight::from_ref_time(154_075_963) + // Standard Error: 32_914 + .saturating_add(Weight::from_ref_time(503_883).saturating_mul(p.into())) } - fn instr_local_get(_r: u32) -> Weight { - Weight::from_ref_time(240_236_500) + fn instr_local_get(r: u32) -> Weight { + Weight::from_ref_time(102_998_676) + // Standard Error: 44_362 + .saturating_add(Weight::from_ref_time(719_850).saturating_mul(r.into())) } fn instr_local_set(r: u32) -> Weight { - Weight::from_ref_time(136_649_500) - // Standard Error: 2_852_448 - .saturating_add(Weight::from_ref_time(1_982_070).saturating_mul(r.into())) + Weight::from_ref_time(108_712_354) + // Standard Error: 76_347 + .saturating_add(Weight::from_ref_time(1_044_158).saturating_mul(r.into())) } fn instr_local_tee(r: u32) -> Weight { - Weight::from_ref_time(135_037_000) - // Standard Error: 2_448_578 - .saturating_add(Weight::from_ref_time(1_944_590).saturating_mul(r.into())) + Weight::from_ref_time(101_232_008) + // Standard Error: 54_203 + .saturating_add(Weight::from_ref_time(1_352_671).saturating_mul(r.into())) } fn instr_global_get(r: u32) -> Weight { - Weight::from_ref_time(138_924_000) - // Standard Error: 2_171_957 - .saturating_add(Weight::from_ref_time(1_362_690).saturating_mul(r.into())) + Weight::from_ref_time(118_094_896) + // Standard Error: 51_874 + .saturating_add(Weight::from_ref_time(2_298_229).saturating_mul(r.into())) } fn instr_global_set(r: u32) -> Weight { - Weight::from_ref_time(167_463_500) - // Standard Error: 2_509_565 - .saturating_add(Weight::from_ref_time(787_600).saturating_mul(r.into())) + Weight::from_ref_time(110_609_615) + // Standard Error: 64_730 + .saturating_add(Weight::from_ref_time(2_619_354).saturating_mul(r.into())) } - fn instr_memory_current(_r: u32) -> Weight { - Weight::from_ref_time(250_090_500) + fn instr_memory_current(r: u32) -> Weight { + Weight::from_ref_time(106_231_874) + // Standard Error: 46_093 + .saturating_add(Weight::from_ref_time(1_138_117).saturating_mul(r.into())) } fn instr_memory_grow(r: u32) -> Weight { - Weight::from_ref_time(127_742_500) - // Standard Error: 194_986_862 - .saturating_add(Weight::from_ref_time(328_214_500).saturating_mul(r.into())) + Weight::from_ref_time(105_442_708) + // Standard Error: 184_928 + .saturating_add(Weight::from_ref_time(253_568_391).saturating_mul(r.into())) } fn instr_i64clz(r: u32) -> Weight { - Weight::from_ref_time(125_298_500) - // Standard Error: 1_780_088 - .saturating_add(Weight::from_ref_time(1_247_170).saturating_mul(r.into())) + Weight::from_ref_time(109_882_080) + // Standard Error: 79_867 + .saturating_add(Weight::from_ref_time(1_045_369).saturating_mul(r.into())) } fn instr_i64ctz(r: u32) -> Weight { - Weight::from_ref_time(126_705_500) - // Standard Error: 2_444_986 - .saturating_add(Weight::from_ref_time(1_644_940).saturating_mul(r.into())) + Weight::from_ref_time(104_382_071) + // Standard Error: 59_887 + .saturating_add(Weight::from_ref_time(1_392_400).saturating_mul(r.into())) } fn instr_i64popcnt(r: u32) -> Weight { - Weight::from_ref_time(129_050_500) - // Standard Error: 1_899_905 - .saturating_add(Weight::from_ref_time(1_162_010).saturating_mul(r.into())) + Weight::from_ref_time(99_412_583) + // Standard Error: 63_924 + .saturating_add(Weight::from_ref_time(2_054_239).saturating_mul(r.into())) } fn instr_i64eqz(r: u32) -> Weight { - Weight::from_ref_time(138_117_500) - // Standard Error: 1_493_127 - .saturating_add(Weight::from_ref_time(1_696_230).saturating_mul(r.into())) + Weight::from_ref_time(125_130_116) + // Standard Error: 64_926 + .saturating_add(Weight::from_ref_time(646_256).saturating_mul(r.into())) } fn instr_i64extendsi32(r: u32) -> Weight { - Weight::from_ref_time(129_316_000) - // Standard Error: 1_991_382 - .saturating_add(Weight::from_ref_time(972_950).saturating_mul(r.into())) + Weight::from_ref_time(107_210_858) + // Standard Error: 56_648 + .saturating_add(Weight::from_ref_time(1_048_235).saturating_mul(r.into())) } fn instr_i64extendui32(r: u32) -> Weight { - Weight::from_ref_time(129_526_000) - // Standard Error: 2_663_633 - .saturating_add(Weight::from_ref_time(1_811_650).saturating_mul(r.into())) + Weight::from_ref_time(110_419_986) + // Standard Error: 44_693 + .saturating_add(Weight::from_ref_time(988_942).saturating_mul(r.into())) } fn instr_i32wrapi64(r: u32) -> Weight { - Weight::from_ref_time(129_817_000) - // Standard Error: 1_646_172 - .saturating_add(Weight::from_ref_time(1_403_260).saturating_mul(r.into())) + Weight::from_ref_time(106_097_103) + // Standard Error: 76_263 + .saturating_add(Weight::from_ref_time(1_316_794).saturating_mul(r.into())) } fn instr_i64eq(r: u32) -> Weight { - Weight::from_ref_time(177_773_000) - // Standard Error: 1_919_647 - .saturating_add(Weight::from_ref_time(2_699_240).saturating_mul(r.into())) + Weight::from_ref_time(108_116_972) + // Standard Error: 75_075 + .saturating_add(Weight::from_ref_time(1_862_540).saturating_mul(r.into())) } fn instr_i64ne(r: u32) -> Weight { - Weight::from_ref_time(154_824_000) - // Standard Error: 2_615_944 - .saturating_add(Weight::from_ref_time(3_194_790).saturating_mul(r.into())) + Weight::from_ref_time(108_928_442) + // Standard Error: 65_988 + .saturating_add(Weight::from_ref_time(1_749_498).saturating_mul(r.into())) } fn instr_i64lts(r: u32) -> Weight { - Weight::from_ref_time(127_998_500) - // Standard Error: 2_297_682 - .saturating_add(Weight::from_ref_time(3_243_360).saturating_mul(r.into())) + Weight::from_ref_time(106_800_063) + // Standard Error: 58_401 + .saturating_add(Weight::from_ref_time(1_961_216).saturating_mul(r.into())) } fn instr_i64ltu(r: u32) -> Weight { - Weight::from_ref_time(130_728_500) - // Standard Error: 2_028_620 - .saturating_add(Weight::from_ref_time(2_825_070).saturating_mul(r.into())) + Weight::from_ref_time(103_579_984) + // Standard Error: 75_440 + .saturating_add(Weight::from_ref_time(1_974_347).saturating_mul(r.into())) } fn instr_i64gts(r: u32) -> Weight { - Weight::from_ref_time(130_758_000) - // Standard Error: 1_909_467 - .saturating_add(Weight::from_ref_time(2_726_190).saturating_mul(r.into())) + Weight::from_ref_time(96_102_214) + // Standard Error: 68_969 + .saturating_add(Weight::from_ref_time(2_188_537).saturating_mul(r.into())) } fn instr_i64gtu(r: u32) -> Weight { - Weight::from_ref_time(167_383_500) - // Standard Error: 2_786_505 - .saturating_add(Weight::from_ref_time(2_137_860).saturating_mul(r.into())) + Weight::from_ref_time(102_308_447) + // Standard Error: 61_981 + .saturating_add(Weight::from_ref_time(1_944_744).saturating_mul(r.into())) } fn instr_i64les(r: u32) -> Weight { - Weight::from_ref_time(132_717_500) - // Standard Error: 1_803_737 - .saturating_add(Weight::from_ref_time(3_423_810).saturating_mul(r.into())) + Weight::from_ref_time(101_265_982) + // Standard Error: 56_197 + .saturating_add(Weight::from_ref_time(1_985_022).saturating_mul(r.into())) } fn instr_i64leu(r: u32) -> Weight { - Weight::from_ref_time(159_107_500) - // Standard Error: 1_771_521 - .saturating_add(Weight::from_ref_time(2_995_290).saturating_mul(r.into())) + Weight::from_ref_time(103_437_480) + // Standard Error: 42_629 + .saturating_add(Weight::from_ref_time(1_877_996).saturating_mul(r.into())) } fn instr_i64ges(r: u32) -> Weight { - Weight::from_ref_time(156_572_500) - // Standard Error: 2_492_197 - .saturating_add(Weight::from_ref_time(3_026_450).saturating_mul(r.into())) + Weight::from_ref_time(110_657_052) + // Standard Error: 49_776 + .saturating_add(Weight::from_ref_time(1_622_420).saturating_mul(r.into())) } fn instr_i64geu(r: u32) -> Weight { - Weight::from_ref_time(128_299_000) - // Standard Error: 2_022_417 - .saturating_add(Weight::from_ref_time(2_934_680).saturating_mul(r.into())) + Weight::from_ref_time(112_441_903) + // Standard Error: 57_140 + .saturating_add(Weight::from_ref_time(1_803_781).saturating_mul(r.into())) } fn instr_i64add(r: u32) -> Weight { - Weight::from_ref_time(130_759_000) - // Standard Error: 2_033_437 - .saturating_add(Weight::from_ref_time(3_087_270).saturating_mul(r.into())) + Weight::from_ref_time(101_923_895) + // Standard Error: 44_865 + .saturating_add(Weight::from_ref_time(2_081_863).saturating_mul(r.into())) } fn instr_i64sub(r: u32) -> Weight { - Weight::from_ref_time(146_258_500) - // Standard Error: 2_179_028 - .saturating_add(Weight::from_ref_time(2_515_360).saturating_mul(r.into())) + Weight::from_ref_time(105_037_682) + // Standard Error: 67_975 + .saturating_add(Weight::from_ref_time(1_982_365).saturating_mul(r.into())) } fn instr_i64mul(r: u32) -> Weight { - Weight::from_ref_time(133_498_500) - // Standard Error: 2_664_876 - .saturating_add(Weight::from_ref_time(2_167_540).saturating_mul(r.into())) + Weight::from_ref_time(102_264_234) + // Standard Error: 45_342 + .saturating_add(Weight::from_ref_time(2_007_440).saturating_mul(r.into())) } fn instr_i64divs(r: u32) -> Weight { - Weight::from_ref_time(152_986_000) - // Standard Error: 1_842_682 - .saturating_add(Weight::from_ref_time(2_771_070).saturating_mul(r.into())) + Weight::from_ref_time(103_770_139) + // Standard Error: 42_377 + .saturating_add(Weight::from_ref_time(1_816_014).saturating_mul(r.into())) } fn instr_i64divu(r: u32) -> Weight { - Weight::from_ref_time(152_459_500) - // Standard Error: 2_601_136 - .saturating_add(Weight::from_ref_time(3_082_670).saturating_mul(r.into())) + Weight::from_ref_time(99_619_964) + // Standard Error: 56_465 + .saturating_add(Weight::from_ref_time(1_998_149).saturating_mul(r.into())) } fn instr_i64rems(r: u32) -> Weight { - Weight::from_ref_time(130_788_500) - // Standard Error: 2_724_683 - .saturating_add(Weight::from_ref_time(3_885_790).saturating_mul(r.into())) + Weight::from_ref_time(105_446_479) + // Standard Error: 67_747 + .saturating_add(Weight::from_ref_time(1_944_050).saturating_mul(r.into())) } fn instr_i64remu(r: u32) -> Weight { - Weight::from_ref_time(131_761_000) - // Standard Error: 2_122_468 - .saturating_add(Weight::from_ref_time(3_058_420).saturating_mul(r.into())) + Weight::from_ref_time(92_700_760) + // Standard Error: 38_698 + .saturating_add(Weight::from_ref_time(2_193_530).saturating_mul(r.into())) } fn instr_i64and(r: u32) -> Weight { - Weight::from_ref_time(131_199_500) - // Standard Error: 1_988_113 - .saturating_add(Weight::from_ref_time(2_814_650).saturating_mul(r.into())) + Weight::from_ref_time(101_410_626) + // Standard Error: 84_478 + .saturating_add(Weight::from_ref_time(2_127_952).saturating_mul(r.into())) } fn instr_i64or(r: u32) -> Weight { - Weight::from_ref_time(131_701_000) - // Standard Error: 3_411_146 - .saturating_add(Weight::from_ref_time(4_597_930).saturating_mul(r.into())) + Weight::from_ref_time(96_179_133) + // Standard Error: 45_323 + .saturating_add(Weight::from_ref_time(5_277_734).saturating_mul(r.into())) } fn instr_i64xor(r: u32) -> Weight { - Weight::from_ref_time(131_831_000) - // Standard Error: 2_596_792 - .saturating_add(Weight::from_ref_time(3_670_370).saturating_mul(r.into())) + Weight::from_ref_time(103_567_886) + // Standard Error: 39_751 + .saturating_add(Weight::from_ref_time(1_857_890).saturating_mul(r.into())) } fn instr_i64shl(r: u32) -> Weight { - Weight::from_ref_time(136_169_000) - // Standard Error: 3_107_352 - .saturating_add(Weight::from_ref_time(2_520_190).saturating_mul(r.into())) + Weight::from_ref_time(119_259_398) + // Standard Error: 110_741 + .saturating_add(Weight::from_ref_time(1_393_081).saturating_mul(r.into())) } fn instr_i64shrs(r: u32) -> Weight { - Weight::from_ref_time(130_342_500) - // Standard Error: 2_245_663 - .saturating_add(Weight::from_ref_time(3_163_430).saturating_mul(r.into())) + Weight::from_ref_time(100_419_754) + // Standard Error: 80_452 + .saturating_add(Weight::from_ref_time(2_076_493).saturating_mul(r.into())) } fn instr_i64shru(r: u32) -> Weight { - Weight::from_ref_time(129_937_000) - // Standard Error: 1_901_467 - .saturating_add(Weight::from_ref_time(2_786_200).saturating_mul(r.into())) + Weight::from_ref_time(108_703_844) + // Standard Error: 61_560 + .saturating_add(Weight::from_ref_time(1_797_329).saturating_mul(r.into())) } fn instr_i64rotl(r: u32) -> Weight { - Weight::from_ref_time(132_642_000) - // Standard Error: 1_847_324 - .saturating_add(Weight::from_ref_time(2_779_700).saturating_mul(r.into())) + Weight::from_ref_time(98_000_338) + // Standard Error: 45_962 + .saturating_add(Weight::from_ref_time(2_037_187).saturating_mul(r.into())) } fn instr_i64rotr(r: u32) -> Weight { - Weight::from_ref_time(141_834_500) - // Standard Error: 1_821_419 - .saturating_add(Weight::from_ref_time(2_613_870).saturating_mul(r.into())) + Weight::from_ref_time(100_878_437) + // Standard Error: 64_534 + .saturating_add(Weight::from_ref_time(2_112_436).saturating_mul(r.into())) } } diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index de3816890..cd9363669 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,13 +54,13 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(41_898_000) + Weight::from_ref_time(85_720_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy DepositOf (r:1 w:1) fn second() -> Weight { - Weight::from_ref_time(35_120_000) + Weight::from_ref_time(85_541_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -68,7 +68,7 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_new() -> Weight { - Weight::from_ref_time(41_886_000) + Weight::from_ref_time(87_931_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -76,14 +76,14 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vote_existing() -> Weight { - Weight::from_ref_time(41_576_000) + Weight::from_ref_time(89_590_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(14_658_000) + Weight::from_ref_time(36_740_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -94,37 +94,37 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) fn blacklist() -> Weight { - Weight::from_ref_time(67_163_000) + Weight::from_ref_time(136_551_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) fn external_propose() -> Weight { - Weight::from_ref_time(11_206_000) + Weight::from_ref_time(32_960_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(3_060_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(10_160_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(3_068_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(10_260_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(15_630_000) + Weight::from_ref_time(41_010_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) fn veto_external() -> Weight { - Weight::from_ref_time(19_253_000) + Weight::from_ref_time(44_320_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -132,21 +132,21 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:2 w:2) fn cancel_proposal() -> Weight { - Weight::from_ref_time(58_487_000) + Weight::from_ref_time(118_040_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(9_790_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(26_210_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:2 w:0) fn on_initialize_base(r: u32) -> Weight { - Weight::from_ref_time(8_978_113) - // Standard Error: 4_589 - .saturating_add(Weight::from_ref_time(1_536_205).saturating_mul(r.into())) + Weight::from_ref_time(27_685_582) + // Standard Error: 29_688 + .saturating_add(Weight::from_ref_time(3_650_691).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -158,9 +158,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy PublicProps (r:1 w:0) // Storage: Democracy ReferendumInfoOf (r:2 w:0) fn on_initialize_base_with_launch_period(r: u32) -> Weight { - Weight::from_ref_time(10_988_037) - // Standard Error: 4_483 - .saturating_add(Weight::from_ref_time(1_538_250).saturating_mul(r.into())) + Weight::from_ref_time(32_028_388) + // Standard Error: 31_771 + .saturating_add(Weight::from_ref_time(3_759_627).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -169,9 +169,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Balances Locks (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:2 w:2) fn delegate(r: u32) -> Weight { - Weight::from_ref_time(33_942_458) - // Standard Error: 6_275 - .saturating_add(Weight::from_ref_time(2_384_438).saturating_mul(r.into())) + Weight::from_ref_time(80_660_465) + // Standard Error: 46_086 + .saturating_add(Weight::from_ref_time(5_710_550).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -180,9 +180,9 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Democracy VotingOf (r:2 w:2) // Storage: Democracy ReferendumInfoOf (r:2 w:2) fn undelegate(r: u32) -> Weight { - Weight::from_ref_time(20_552_008) - // Standard Error: 4_945 - .saturating_add(Weight::from_ref_time(2_352_801).saturating_mul(r.into())) + Weight::from_ref_time(47_463_351) + // Standard Error: 82_783 + .saturating_add(Weight::from_ref_time(5_824_287).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -190,15 +190,15 @@ impl pallet_democracy::weights::WeightInfo for WeightIn } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(4_079_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(11_770_000).saturating_add(T::DbWeight::get().writes(1)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_remove(r: u32) -> Weight { - Weight::from_ref_time(23_309_726) - // Standard Error: 1_610 - .saturating_add(Weight::from_ref_time(51_836).saturating_mul(r.into())) + Weight::from_ref_time(56_811_597) + // Standard Error: 6_746 + .saturating_add(Weight::from_ref_time(49_599).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -206,27 +206,27 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn unlock_set(r: u32) -> Weight { - Weight::from_ref_time(23_116_641) - // Standard Error: 932 - .saturating_add(Weight::from_ref_time(78_997).saturating_mul(r.into())) + Weight::from_ref_time(54_791_225) + // Standard Error: 6_309 + .saturating_add(Weight::from_ref_time(145_190).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_vote(r: u32) -> Weight { - Weight::from_ref_time(13_637_289) - // Standard Error: 991 - .saturating_add(Weight::from_ref_time(83_991).saturating_mul(r.into())) + Weight::from_ref_time(38_774_882) + // Standard Error: 7_750 + .saturating_add(Weight::from_ref_time(95_570).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) fn remove_other_vote(r: u32) -> Weight { - Weight::from_ref_time(14_220_574) - // Standard Error: 3_420 - .saturating_add(Weight::from_ref_time(81_496).saturating_mul(r.into())) + Weight::from_ref_time(35_889_773) + // Standard Error: 9_778 + .saturating_add(Weight::from_ref_time(146_925).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index 7a1ec50f4..15a9426c3 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,19 +51,19 @@ pub struct WeightInfo(PhantomData); impl pallet_identity::weights::WeightInfo for WeightInfo { // Storage: Identity Registrars (r:1 w:1) fn add_registrar(r: u32) -> Weight { - Weight::from_ref_time(12_045_217) - // Standard Error: 5_701 - .saturating_add(Weight::from_ref_time(411_913).saturating_mul(r.into())) + Weight::from_ref_time(32_175_952) + // Standard Error: 6_649 + .saturating_add(Weight::from_ref_time(568_064).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) fn set_identity(r: u32, x: u32) -> Weight { - Weight::from_ref_time(23_218_766) - // Standard Error: 21_173 - .saturating_add(Weight::from_ref_time(396_383).saturating_mul(r.into())) - // Standard Error: 2_459 - .saturating_add(Weight::from_ref_time(216_337).saturating_mul(x.into())) + Weight::from_ref_time(57_485_137) + // Standard Error: 77_669 + .saturating_add(Weight::from_ref_time(127_536).saturating_mul(r.into())) + // Standard Error: 9_021 + .saturating_add(Weight::from_ref_time(631_202).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -71,9 +71,9 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:1 w:1) fn set_subs_new(s: u32) -> Weight { - Weight::from_ref_time(20_621_097) - // Standard Error: 5_753 - .saturating_add(Weight::from_ref_time(1_822_204).saturating_mul(s.into())) + Weight::from_ref_time(53_262_650) + // Standard Error: 28_202 + .saturating_add(Weight::from_ref_time(4_134_551).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -83,9 +83,9 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:1) fn set_subs_old(p: u32) -> Weight { - Weight::from_ref_time(21_538_109) - // Standard Error: 5_896 - .saturating_add(Weight::from_ref_time(819_934).saturating_mul(p.into())) + Weight::from_ref_time(53_828_418) + // Standard Error: 28_373 + .saturating_add(Weight::from_ref_time(1_739_257).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) @@ -93,14 +93,12 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SubsOf (r:1 w:1) // Storage: Identity IdentityOf (r:1 w:1) // Storage: Identity SuperOf (r:0 w:64) - fn clear_identity(r: u32, s: u32, x: u32) -> Weight { - Weight::from_ref_time(24_817_395) - // Standard Error: 18_666 - .saturating_add(Weight::from_ref_time(261_241).saturating_mul(r.into())) - // Standard Error: 2_173 - .saturating_add(Weight::from_ref_time(813_003).saturating_mul(s.into())) - // Standard Error: 2_173 - .saturating_add(Weight::from_ref_time(97_431).saturating_mul(x.into())) + fn clear_identity(_r: u32, s: u32, x: u32) -> Weight { + Weight::from_ref_time(76_530_218) + // Standard Error: 23_044 + .saturating_add(Weight::from_ref_time(1_760_418).saturating_mul(s.into())) + // Standard Error: 23_044 + .saturating_add(Weight::from_ref_time(123_806).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -108,56 +106,54 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) fn request_judgement(r: u32, x: u32) -> Weight { - Weight::from_ref_time(24_883_132) - // Standard Error: 8_677 - .saturating_add(Weight::from_ref_time(391_028).saturating_mul(r.into())) - // Standard Error: 1_007 - .saturating_add(Weight::from_ref_time(209_582).saturating_mul(x.into())) + Weight::from_ref_time(62_913_188) + // Standard Error: 74_244 + .saturating_add(Weight::from_ref_time(380_051).saturating_mul(r.into())) + // Standard Error: 8_623 + .saturating_add(Weight::from_ref_time(605_729).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity IdentityOf (r:1 w:1) fn cancel_request(r: u32, x: u32) -> Weight { - Weight::from_ref_time(23_411_702) - // Standard Error: 8_263 - .saturating_add(Weight::from_ref_time(261_255).saturating_mul(r.into())) - // Standard Error: 959 - .saturating_add(Weight::from_ref_time(207_342).saturating_mul(x.into())) + Weight::from_ref_time(55_860_505) + // Standard Error: 178_092 + .saturating_add(Weight::from_ref_time(798_626).saturating_mul(r.into())) + // Standard Error: 20_686 + .saturating_add(Weight::from_ref_time(604_804).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_fee(r: u32) -> Weight { - Weight::from_ref_time(6_373_117) - // Standard Error: 3_180 - .saturating_add(Weight::from_ref_time(272_816).saturating_mul(r.into())) + Weight::from_ref_time(17_983_570) + // Standard Error: 4_806 + .saturating_add(Weight::from_ref_time(414_278).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_account_id(r: u32) -> Weight { - Weight::from_ref_time(6_536_881) - // Standard Error: 3_217 - .saturating_add(Weight::from_ref_time(268_060).saturating_mul(r.into())) + Weight::from_ref_time(18_397_471) + // Standard Error: 10_158 + .saturating_add(Weight::from_ref_time(425_812).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:1) fn set_fields(r: u32) -> Weight { - Weight::from_ref_time(6_379_872) - // Standard Error: 3_198 - .saturating_add(Weight::from_ref_time(284_984).saturating_mul(r.into())) + Weight::from_ref_time(18_475_937) + // Standard Error: 8_774 + .saturating_add(Weight::from_ref_time(349_292).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Identity Registrars (r:1 w:0) // Storage: Identity IdentityOf (r:1 w:1) - fn provide_judgement(r: u32, x: u32) -> Weight { - Weight::from_ref_time(18_544_167) - // Standard Error: 8_411 - .saturating_add(Weight::from_ref_time(298_269).saturating_mul(r.into())) - // Standard Error: 859 - .saturating_add(Weight::from_ref_time(347_720).saturating_mul(x.into())) + fn provide_judgement(_r: u32, x: u32) -> Weight { + Weight::from_ref_time(56_036_919) + // Standard Error: 12_666 + .saturating_add(Weight::from_ref_time(861_516).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -166,13 +162,13 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: System Account (r:2 w:2) // Storage: Identity SuperOf (r:0 w:64) fn kill_identity(r: u32, s: u32, x: u32) -> Weight { - Weight::from_ref_time(33_739_768) - // Standard Error: 21_993 - .saturating_add(Weight::from_ref_time(179_160).saturating_mul(r.into())) - // Standard Error: 2_560 - .saturating_add(Weight::from_ref_time(816_776).saturating_mul(s.into())) - // Standard Error: 2_560 - .saturating_add(Weight::from_ref_time(93_630).saturating_mul(x.into())) + Weight::from_ref_time(80_696_476) + // Standard Error: 230_226 + .saturating_add(Weight::from_ref_time(331_035).saturating_mul(r.into())) + // Standard Error: 26_808 + .saturating_add(Weight::from_ref_time(1_739_278).saturating_mul(s.into())) + // Standard Error: 26_808 + .saturating_add(Weight::from_ref_time(279_776).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -181,18 +177,18 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn add_sub(s: u32) -> Weight { - Weight::from_ref_time(26_774_459) - // Standard Error: 2_099 - .saturating_add(Weight::from_ref_time(142_653).saturating_mul(s.into())) + Weight::from_ref_time(66_058_206) + // Standard Error: 42_243 + .saturating_add(Weight::from_ref_time(284_963).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity IdentityOf (r:1 w:0) // Storage: Identity SuperOf (r:1 w:1) fn rename_sub(s: u32) -> Weight { - Weight::from_ref_time(11_263_610) - // Standard Error: 1_038 - .saturating_add(Weight::from_ref_time(68_019).saturating_mul(s.into())) + Weight::from_ref_time(29_854_772) + // Standard Error: 5_414 + .saturating_add(Weight::from_ref_time(96_262).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -200,18 +196,18 @@ impl pallet_identity::weights::WeightInfo for WeightInf // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn remove_sub(s: u32) -> Weight { - Weight::from_ref_time(29_027_542) - // Standard Error: 2_964 - .saturating_add(Weight::from_ref_time(102_862).saturating_mul(s.into())) + Weight::from_ref_time(72_544_835) + // Standard Error: 13_434 + .saturating_add(Weight::from_ref_time(115_890).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Identity SuperOf (r:1 w:1) // Storage: Identity SubsOf (r:1 w:1) fn quit_sub(s: u32) -> Weight { - Weight::from_ref_time(20_501_723) - // Standard Error: 1_836 - .saturating_add(Weight::from_ref_time(126_775).saturating_mul(s.into())) + Weight::from_ref_time(55_160_250) + // Standard Error: 22_975 + .saturating_add(Weight::from_ref_time(101_585).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index dc18101ec..1f5cfbd3d 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,9 +54,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn add_member(m: u32) -> Weight { - Weight::from_ref_time(15_790_016) - // Standard Error: 647 - .saturating_add(Weight::from_ref_time(31_177).saturating_mul(m.into())) + Weight::from_ref_time(45_243_140) + // Standard Error: 6_818 + .saturating_add(Weight::from_ref_time(54_998).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -66,9 +66,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn remove_member(m: u32) -> Weight { - Weight::from_ref_time(17_898_825) - // Standard Error: 616 - .saturating_add(Weight::from_ref_time(27_596).saturating_mul(m.into())) + Weight::from_ref_time(47_920_741) + // Standard Error: 7_372 + .saturating_add(Weight::from_ref_time(73_246).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -78,9 +78,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn swap_member(m: u32) -> Weight { - Weight::from_ref_time(17_795_029) - // Standard Error: 628 - .saturating_add(Weight::from_ref_time(36_370).saturating_mul(m.into())) + Weight::from_ref_time(46_793_220) + // Standard Error: 6_935 + .saturating_add(Weight::from_ref_time(114_705).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -90,9 +90,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn reset_member(m: u32) -> Weight { - Weight::from_ref_time(17_561_643) - // Standard Error: 691 - .saturating_add(Weight::from_ref_time(104_626).saturating_mul(m.into())) + Weight::from_ref_time(53_808_610) + // Standard Error: 14_944 + .saturating_add(Weight::from_ref_time(172_290).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -102,9 +102,9 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommittee Members (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn change_key(m: u32) -> Weight { - Weight::from_ref_time(18_510_706) - // Standard Error: 686 - .saturating_add(Weight::from_ref_time(34_672).saturating_mul(m.into())) + Weight::from_ref_time(48_637_357) + // Standard Error: 3_984 + .saturating_add(Weight::from_ref_time(65_363).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -112,18 +112,18 @@ impl pallet_membership::weights::WeightInfo for WeightI // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn set_prime(m: u32) -> Weight { - Weight::from_ref_time(6_527_451) - // Standard Error: 269 - .saturating_add(Weight::from_ref_time(10_485).saturating_mul(m.into())) + Weight::from_ref_time(19_740_067) + // Standard Error: 2_839 + .saturating_add(Weight::from_ref_time(4_630).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) // Storage: AdvisoryCommittee Prime (r:0 w:1) fn clear_prime(m: u32) -> Weight { - Weight::from_ref_time(3_713_794) - // Standard Error: 136 - .saturating_add(Weight::from_ref_time(834).saturating_mul(m.into())) + Weight::from_ref_time(10_636_405) + // Standard Error: 656 + .saturating_add(Weight::from_ref_time(1_975).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index 431e903fa..4604eb250 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,64 +50,64 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_multisig::weights::WeightInfo for WeightInfo { fn as_multi_threshold_1(z: u32) -> Weight { - Weight::from_ref_time(15_009_826) - // Standard Error: 4 - .saturating_add(Weight::from_ref_time(279).saturating_mul(z.into())) + Weight::from_ref_time(33_725_610) + // Standard Error: 43 + .saturating_add(Weight::from_ref_time(797).saturating_mul(z.into())) } - // Storage: MultiSig Multisigs (r:1 w:1) + // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn as_multi_create(s: u32, z: u32) -> Weight { - Weight::from_ref_time(26_652_211) - // Standard Error: 1_415 - .saturating_add(Weight::from_ref_time(94_659).saturating_mul(s.into())) - // Standard Error: 13 - .saturating_add(Weight::from_ref_time(1_052).saturating_mul(z.into())) + Weight::from_ref_time(65_276_434) + // Standard Error: 9_980 + .saturating_add(Weight::from_ref_time(167_498).saturating_mul(s.into())) + // Standard Error: 97 + .saturating_add(Weight::from_ref_time(1_882).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: MultiSig Multisigs (r:1 w:1) + // Storage: Multisig Multisigs (r:1 w:1) fn as_multi_approve(s: u32, z: u32) -> Weight { - Weight::from_ref_time(20_049_942) - // Standard Error: 908 - .saturating_add(Weight::from_ref_time(84_603).saturating_mul(s.into())) - // Standard Error: 8 - .saturating_add(Weight::from_ref_time(995).saturating_mul(z.into())) + Weight::from_ref_time(58_474_334) + // Standard Error: 17_171 + .saturating_add(Weight::from_ref_time(67_702).saturating_mul(s.into())) + // Standard Error: 168 + .saturating_add(Weight::from_ref_time(1_840).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: MultiSig Multisigs (r:1 w:1) + // Storage: Multisig Multisigs (r:1 w:1) // Storage: System Account (r:1 w:1) fn as_multi_complete(s: u32, z: u32) -> Weight { - Weight::from_ref_time(27_852_359) - // Standard Error: 1_356 - .saturating_add(Weight::from_ref_time(117_468).saturating_mul(s.into())) - // Standard Error: 13 - .saturating_add(Weight::from_ref_time(1_031).saturating_mul(z.into())) + Weight::from_ref_time(63_745_126) + // Standard Error: 9_505 + .saturating_add(Weight::from_ref_time(218_407).saturating_mul(s.into())) + // Standard Error: 93 + .saturating_add(Weight::from_ref_time(2_283).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - // Storage: MultiSig Multisigs (r:1 w:1) + // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) fn approve_as_multi_create(s: u32) -> Weight { - Weight::from_ref_time(24_697_515) - // Standard Error: 1_850 - .saturating_add(Weight::from_ref_time(97_497).saturating_mul(s.into())) + Weight::from_ref_time(61_096_537) + // Standard Error: 6_788 + .saturating_add(Weight::from_ref_time(112_279).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: MultiSig Multisigs (r:1 w:1) + // Storage: Multisig Multisigs (r:1 w:1) fn approve_as_multi_approve(s: u32) -> Weight { - Weight::from_ref_time(17_670_882) - // Standard Error: 1_328 - .saturating_add(Weight::from_ref_time(94_493).saturating_mul(s.into())) + Weight::from_ref_time(44_265_556) + // Standard Error: 9_851 + .saturating_add(Weight::from_ref_time(137_830).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - // Storage: MultiSig Multisigs (r:1 w:1) + // Storage: Multisig Multisigs (r:1 w:1) fn cancel_as_multi(s: u32) -> Weight { - Weight::from_ref_time(24_687_555) - // Standard Error: 1_647 - .saturating_add(Weight::from_ref_time(108_089).saturating_mul(s.into())) + Weight::from_ref_time(58_457_156) + // Standard Error: 11_353 + .saturating_add(Weight::from_ref_time(172_491).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index 7f8ea8f17..2e63905ea 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_parachain_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,39 +51,39 @@ pub struct WeightInfo(PhantomData); impl pallet_parachain_staking::weights::WeightInfo for WeightInfo { // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_staking_expectations() -> Weight { - Weight::from_ref_time(22_959_000) + Weight::from_ref_time(35_670_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking InflationConfig (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_inflation() -> Weight { - Weight::from_ref_time(53_944_000) + Weight::from_ref_time(87_440_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_account() -> Weight { - Weight::from_ref_time(12_549_000) + Weight::from_ref_time(34_790_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking ParachainBondInfo (r:1 w:1) fn set_parachain_bond_reserve_percent() -> Weight { - Weight::from_ref_time(12_385_000) + Weight::from_ref_time(33_430_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking TotalSelected (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn set_total_selected() -> Weight { - Weight::from_ref_time(14_233_000) + Weight::from_ref_time(37_440_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: ParachainStaking CollatorCommission (r:1 w:1) fn set_collator_commission() -> Weight { - Weight::from_ref_time(12_029_000) + Weight::from_ref_time(32_340_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -91,7 +91,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TotalSelected (r:1 w:0) // Storage: ParachainStaking InflationConfig (r:1 w:1) fn set_blocks_per_round() -> Weight { - Weight::from_ref_time(35_350_000) + Weight::from_ref_time(93_860_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -104,9 +104,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking TopDelegations (r:0 w:1) // Storage: ParachainStaking BottomDelegations (r:0 w:1) fn join_candidates(x: u32) -> Weight { - Weight::from_ref_time(32_869_323) - // Standard Error: 1_610 - .saturating_add(Weight::from_ref_time(193_154).saturating_mul(x.into())) + Weight::from_ref_time(123_056_992) + // Standard Error: 3_370 + .saturating_add(Weight::from_ref_time(375_510).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -114,9 +114,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn schedule_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(25_820_357) - // Standard Error: 1_488 - .saturating_add(Weight::from_ref_time(174_057).saturating_mul(x.into())) + Weight::from_ref_time(116_170_118) + // Standard Error: 4_082 + .saturating_add(Weight::from_ref_time(332_657).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -131,9 +131,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking BottomDelegations (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(62_477_000) - // Standard Error: 41_796 - .saturating_add(Weight::from_ref_time(15_946_001).saturating_mul(x.into())) + Weight::from_ref_time(143_510_000) + // Standard Error: 140_714 + .saturating_add(Weight::from_ref_time(42_799_568).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -142,23 +142,23 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn cancel_leave_candidates(x: u32) -> Weight { - Weight::from_ref_time(23_095_410) - // Standard Error: 1_510 - .saturating_add(Weight::from_ref_time(190_401).saturating_mul(x.into())) + Weight::from_ref_time(122_928_231) + // Standard Error: 5_155 + .saturating_add(Weight::from_ref_time(356_447).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_offline() -> Weight { - Weight::from_ref_time(20_218_000) + Weight::from_ref_time(70_580_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn go_online() -> Weight { - Weight::from_ref_time(20_722_000) + Weight::from_ref_time(80_801_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -168,14 +168,14 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn candidate_bond_more() -> Weight { - Weight::from_ref_time(34_948_000) + Weight::from_ref_time(89_120_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_candidate_bond_less() -> Weight { - Weight::from_ref_time(19_230_000) + Weight::from_ref_time(50_400_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -186,13 +186,13 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: System Account (r:1 w:1) // Storage: ParachainStaking CandidatePool (r:1 w:1) fn execute_candidate_bond_less() -> Weight { - Weight::from_ref_time(40_550_000) + Weight::from_ref_time(100_361_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: ParachainStaking CandidateInfo (r:1 w:1) fn cancel_candidate_bond_less() -> Weight { - Weight::from_ref_time(17_798_000) + Weight::from_ref_time(45_510_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -203,10 +203,12 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) - fn delegate(_x: u32, y: u32) -> Weight { - Weight::from_ref_time(98_852_381) - // Standard Error: 3_632 - .saturating_add(Weight::from_ref_time(74_937).saturating_mul(y.into())) + fn delegate(x: u32, y: u32) -> Weight { + Weight::from_ref_time(186_651_756) + // Standard Error: 55_002 + .saturating_add(Weight::from_ref_time(867_499).saturating_mul(x.into())) + // Standard Error: 18_044 + .saturating_add(Weight::from_ref_time(553_824).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -214,7 +216,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Round (r:1 w:0) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn schedule_leave_delegators() -> Weight { - Weight::from_ref_time(21_612_000) + Weight::from_ref_time(56_271_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -229,9 +231,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) fn execute_leave_delegators(x: u32) -> Weight { - Weight::from_ref_time(17_452_622) - // Standard Error: 21_795 - .saturating_add(Weight::from_ref_time(13_924_996).saturating_mul(x.into())) + Weight::from_ref_time(42_497_518) + // Standard Error: 165_856 + .saturating_add(Weight::from_ref_time(35_902_041).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -240,7 +242,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_leave_delegators() -> Weight { - Weight::from_ref_time(20_919_000) + Weight::from_ref_time(57_280_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -248,7 +250,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_revoke_delegation() -> Weight { - Weight::from_ref_time(22_510_000) + Weight::from_ref_time(68_190_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -261,7 +263,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn delegator_bond_more() -> Weight { - Weight::from_ref_time(47_725_000) + Weight::from_ref_time(118_230_000) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -269,7 +271,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) // Storage: ParachainStaking Round (r:1 w:0) fn schedule_delegator_bond_less() -> Weight { - Weight::from_ref_time(22_039_000) + Weight::from_ref_time(56_290_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -284,7 +286,7 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_revoke_delegation() -> Weight { - Weight::from_ref_time(62_301_000) + Weight::from_ref_time(145_220_000) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(8)) } @@ -298,21 +300,21 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CandidatePool (r:1 w:1) // Storage: ParachainStaking Total (r:1 w:1) fn execute_delegator_bond_less() -> Weight { - Weight::from_ref_time(51_233_000) + Weight::from_ref_time(126_790_000) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_revoke_delegation() -> Weight { - Weight::from_ref_time(21_273_000) + Weight::from_ref_time(53_520_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: ParachainStaking DelegatorState (r:1 w:1) // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) fn cancel_delegator_bond_less() -> Weight { - Weight::from_ref_time(26_229_000) + Weight::from_ref_time(62_760_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -324,16 +326,16 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking CollatorCommission (r:1 w:0) // Storage: ParachainStaking DelayedPayouts (r:0 w:1) fn prepare_staking_payouts() -> Weight { - Weight::from_ref_time(30_172_000) + Weight::from_ref_time(75_670_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) // Storage: ParachainStaking TopDelegations (r:1 w:0) fn get_rewardable_delegators(y: u32) -> Weight { - Weight::from_ref_time(9_044_052) - // Standard Error: 934 - .saturating_add(Weight::from_ref_time(166_721).saturating_mul(y.into())) + Weight::from_ref_time(17_681_343) + // Standard Error: 8_876 + .saturating_add(Weight::from_ref_time(502_117).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(2)) } // Storage: ParachainStaking CandidatePool (r:1 w:0) @@ -345,11 +347,11 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking SelectedCandidates (r:0 w:1) // Storage: ParachainStaking AtStake (r:0 w:1) fn select_top_candidates(x: u32, y: u32) -> Weight { - Weight::from_ref_time(19_457_000) - // Standard Error: 194_470 - .saturating_add(Weight::from_ref_time(14_446_541).saturating_mul(x.into())) - // Standard Error: 96_977 - .saturating_add(Weight::from_ref_time(2_854_011).saturating_mul(y.into())) + Weight::from_ref_time(49_680_000) + // Standard Error: 1_177_642 + .saturating_add(Weight::from_ref_time(49_689_789).saturating_mul(x.into())) + // Standard Error: 587_258 + .saturating_add(Weight::from_ref_time(12_322_486).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -361,9 +363,9 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking AwardedPts (r:1 w:1) // Storage: System Account (r:1 w:1) fn pay_one_collator_reward(y: u32) -> Weight { - Weight::from_ref_time(41_033_942) - // Standard Error: 5_622 - .saturating_add(Weight::from_ref_time(7_673_326).saturating_mul(y.into())) + Weight::from_ref_time(106_371_824) + // Standard Error: 93_457 + .saturating_add(Weight::from_ref_time(20_766_401).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -371,16 +373,16 @@ impl pallet_parachain_staking::weights::WeightInfo for } // Storage: ParachainStaking Round (r:1 w:0) fn base_on_initialize() -> Weight { - Weight::from_ref_time(5_312_000).saturating_add(T::DbWeight::get().reads(1)) + Weight::from_ref_time(16_070_000).saturating_add(T::DbWeight::get().reads(1)) } // Storage: ParachainStaking DelegatorState (r:1 w:0) // Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) fn set_auto_compound(x: u32, y: u32) -> Weight { - Weight::from_ref_time(42_718_871) - // Standard Error: 2_814 - .saturating_add(Weight::from_ref_time(161_876).saturating_mul(x.into())) - // Standard Error: 8_425 - .saturating_add(Weight::from_ref_time(104_510).saturating_mul(y.into())) + Weight::from_ref_time(130_193_847) + // Standard Error: 11_664 + .saturating_add(Weight::from_ref_time(641_058).saturating_mul(x.into())) + // Standard Error: 34_919 + .saturating_add(Weight::from_ref_time(293_987).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -394,17 +396,17 @@ impl pallet_parachain_staking::weights::WeightInfo for // Storage: ParachainStaking Total (r:1 w:1) // Storage: ParachainStaking BottomDelegations (r:1 w:1) fn delegate_with_auto_compound(x: u32, y: u32, _z: u32) -> Weight { - Weight::from_ref_time(100_631_109) - // Standard Error: 2_763 - .saturating_add(Weight::from_ref_time(81_505).saturating_mul(x.into())) - // Standard Error: 2_763 - .saturating_add(Weight::from_ref_time(48_166).saturating_mul(y.into())) + Weight::from_ref_time(332_503_261) + // Standard Error: 12_876 + .saturating_add(Weight::from_ref_time(301_412).saturating_mul(x.into())) + // Standard Error: 12_876 + .saturating_add(Weight::from_ref_time(192_596).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: System Account (r:1 w:1) fn mint_collator_reward() -> Weight { - Weight::from_ref_time(18_241_000) + Weight::from_ref_time(50_240_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index 0e47fa95b..dc9c27669 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,84 +52,84 @@ impl pallet_preimage::weights::WeightInfo for WeightInf // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn note_preimage(s: u32) -> Weight { - Weight::from_ref_time(21_280_000) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(1_231).saturating_mul(s.into())) + Weight::from_ref_time(52_281_000) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(2_842).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn note_requested_preimage(s: u32) -> Weight { - Weight::from_ref_time(14_404_000) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(1_233).saturating_mul(s.into())) + Weight::from_ref_time(37_890_000) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(2_843).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn note_no_deposit_preimage(s: u32) -> Weight { - Weight::from_ref_time(13_424_000) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(1_231).saturating_mul(s.into())) + Weight::from_ref_time(58_020_000) + // Standard Error: 6 + .saturating_add(Weight::from_ref_time(2_823).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(28_640_000) + Weight::from_ref_time(85_920_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(16_748_000) + Weight::from_ref_time(70_810_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(15_219_000) + Weight::from_ref_time(65_940_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(6_886_000) + Weight::from_ref_time(45_880_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(13_170_000) + Weight::from_ref_time(42_470_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(6_794_000) + Weight::from_ref_time(17_660_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(16_478_000) + Weight::from_ref_time(65_070_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(6_985_000) + Weight::from_ref_time(18_540_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(6_886_000) + Weight::from_ref_time(17_820_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index 54077497e..f5cec07d7 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,38 +51,38 @@ pub struct WeightInfo(PhantomData); impl pallet_proxy::weights::WeightInfo for WeightInfo { // Storage: Proxy Proxies (r:1 w:0) fn proxy(p: u32) -> Weight { - Weight::from_ref_time(14_846_152) - // Standard Error: 3_656 - .saturating_add(Weight::from_ref_time(20_035).saturating_mul(p.into())) + Weight::from_ref_time(38_813_017) + // Standard Error: 12_164 + .saturating_add(Weight::from_ref_time(55_828).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn proxy_announced(a: u32, p: u32) -> Weight { - Weight::from_ref_time(29_808_110) - // Standard Error: 3_086 - .saturating_add(Weight::from_ref_time(68_700).saturating_mul(a.into())) - // Standard Error: 3_189 - .saturating_add(Weight::from_ref_time(27_747).saturating_mul(p.into())) + Weight::from_ref_time(70_138_051) + // Standard Error: 22_795 + .saturating_add(Weight::from_ref_time(142_027).saturating_mul(a.into())) + // Standard Error: 23_552 + .saturating_add(Weight::from_ref_time(44_496).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn remove_announcement(a: u32, _p: u32) -> Weight { - Weight::from_ref_time(21_154_842) - // Standard Error: 2_354 - .saturating_add(Weight::from_ref_time(67_662).saturating_mul(a.into())) + Weight::from_ref_time(52_322_996) + // Standard Error: 23_300 + .saturating_add(Weight::from_ref_time(89_493).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Announcements (r:1 w:1) // Storage: System Account (r:1 w:1) fn reject_announcement(a: u32, _p: u32) -> Weight { - Weight::from_ref_time(20_587_474) - // Standard Error: 2_191 - .saturating_add(Weight::from_ref_time(91_044).saturating_mul(a.into())) + Weight::from_ref_time(51_337_128) + // Standard Error: 17_654 + .saturating_add(Weight::from_ref_time(102_594).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -90,52 +90,52 @@ impl pallet_proxy::weights::WeightInfo for WeightInfo Weight { - Weight::from_ref_time(25_960_647) - // Standard Error: 3_453 - .saturating_add(Weight::from_ref_time(90_065).saturating_mul(a.into())) - // Standard Error: 3_567 - .saturating_add(Weight::from_ref_time(54_574).saturating_mul(p.into())) + Weight::from_ref_time(61_924_058) + // Standard Error: 25_171 + .saturating_add(Weight::from_ref_time(170_865).saturating_mul(a.into())) + // Standard Error: 26_006 + .saturating_add(Weight::from_ref_time(108_550).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Proxy Proxies (r:1 w:1) fn add_proxy(p: u32) -> Weight { - Weight::from_ref_time(21_515_673) - // Standard Error: 9_730 - .saturating_add(Weight::from_ref_time(27_609).saturating_mul(p.into())) + Weight::from_ref_time(51_760_535) + // Standard Error: 19_935 + .saturating_add(Weight::from_ref_time(181_482).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxy(p: u32) -> Weight { - Weight::from_ref_time(20_632_234) - // Standard Error: 2_374 - .saturating_add(Weight::from_ref_time(68_381).saturating_mul(p.into())) + Weight::from_ref_time(50_793_408) + // Standard Error: 18_245 + .saturating_add(Weight::from_ref_time(229_589).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn remove_proxies(p: u32) -> Weight { - Weight::from_ref_time(17_793_375) - // Standard Error: 1_672 - .saturating_add(Weight::from_ref_time(42_726).saturating_mul(p.into())) + Weight::from_ref_time(44_155_777) + // Standard Error: 9_895 + .saturating_add(Weight::from_ref_time(138_340).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: Proxy Proxies (r:1 w:1) fn create_pure(p: u32) -> Weight { - Weight::from_ref_time(22_473_896) - // Standard Error: 1_953 - .saturating_add(Weight::from_ref_time(15_155).saturating_mul(p.into())) + Weight::from_ref_time(55_555_781) + // Standard Error: 6_475 + .saturating_add(Weight::from_ref_time(20_634).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Proxy Proxies (r:1 w:1) fn kill_pure(p: u32) -> Weight { - Weight::from_ref_time(18_850_050) - // Standard Error: 1_796 - .saturating_add(Weight::from_ref_time(42_672).saturating_mul(p.into())) + Weight::from_ref_time(47_801_082) + // Standard Error: 14_776 + .saturating_add(Weight::from_ref_time(49_907).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index 5af128495..798057a53 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -51,75 +51,75 @@ pub struct WeightInfo(PhantomData); impl pallet_scheduler::weights::WeightInfo for WeightInfo { // Storage: Scheduler IncompleteSince (r:1 w:1) fn service_agendas_base() -> Weight { - Weight::from_ref_time(3_351_000) + Weight::from_ref_time(8_730_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) fn service_agenda_base(s: u32) -> Weight { - Weight::from_ref_time(5_402_281) - // Standard Error: 2_213 - .saturating_add(Weight::from_ref_time(239_796).saturating_mul(s.into())) + Weight::from_ref_time(16_148_157) + // Standard Error: 15_790 + .saturating_add(Weight::from_ref_time(602_294).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } fn service_task_base() -> Weight { - Weight::from_ref_time(6_133_000) + Weight::from_ref_time(17_290_000) } // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) fn service_task_fetched(s: u32) -> Weight { - Weight::from_ref_time(15_508_000) - // Standard Error: 6 - .saturating_add(Weight::from_ref_time(902).saturating_mul(s.into())) + Weight::from_ref_time(38_440_000) + // Standard Error: 7 + .saturating_add(Weight::from_ref_time(2_139).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:0 w:1) fn service_task_named() -> Weight { - Weight::from_ref_time(7_623_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(19_870_000).saturating_add(T::DbWeight::get().writes(1)) } fn service_task_periodic() -> Weight { - Weight::from_ref_time(6_381_000) + Weight::from_ref_time(17_530_000) } fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(2_668_000) + Weight::from_ref_time(8_010_000) } fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(2_690_000) + Weight::from_ref_time(7_960_000) } // Storage: Scheduler Agenda (r:1 w:1) fn schedule(s: u32) -> Weight { - Weight::from_ref_time(14_386_290) - // Standard Error: 8_210 - .saturating_add(Weight::from_ref_time(290_508).saturating_mul(s.into())) + Weight::from_ref_time(36_389_558) + // Standard Error: 17_862 + .saturating_add(Weight::from_ref_time(712_217).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) fn cancel(s: u32) -> Weight { - Weight::from_ref_time(14_618_067) - // Standard Error: 2_673 - .saturating_add(Weight::from_ref_time(244_365).saturating_mul(s.into())) + Weight::from_ref_time(38_453_612) + // Standard Error: 9_437 + .saturating_add(Weight::from_ref_time(540_810).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn schedule_named(s: u32) -> Weight { - Weight::from_ref_time(17_125_968) - // Standard Error: 3_579 - .saturating_add(Weight::from_ref_time(283_692).saturating_mul(s.into())) + Weight::from_ref_time(45_792_369) + // Standard Error: 14_702 + .saturating_add(Weight::from_ref_time(614_083).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) fn cancel_named(s: u32) -> Weight { - Weight::from_ref_time(16_091_884) - // Standard Error: 2_674 - .saturating_add(Weight::from_ref_time(274_337).saturating_mul(s.into())) + Weight::from_ref_time(40_577_357) + // Standard Error: 13_678 + .saturating_add(Weight::from_ref_time(632_570).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index 02f45199b..61922521d 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,11 +52,11 @@ impl pallet_timestamp::weights::WeightInfo for WeightIn // Storage: Timestamp Now (r:1 w:1) // Storage: Aura CurrentSlot (r:1 w:0) fn set() -> Weight { - Weight::from_ref_time(8_108_000) + Weight::from_ref_time(22_880_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn on_finalize() -> Weight { - Weight::from_ref_time(3_570_000) + Weight::from_ref_time(9_280_000) } } diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index 7a7fe4d36..1dd7f7085 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_treasury //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,33 +50,34 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_treasury::weights::WeightInfo for WeightInfo { fn spend() -> Weight { - Weight::from_ref_time(95_000) + Weight::from_ref_time(400_000) } // Storage: Treasury ProposalCount (r:1 w:1) // Storage: Treasury Proposals (r:0 w:1) fn propose_spend() -> Weight { - Weight::from_ref_time(20_565_000) + Weight::from_ref_time(50_770_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Treasury Proposals (r:1 w:1) + // Storage: System Account (r:1 w:1) fn reject_proposal() -> Weight { - Weight::from_ref_time(24_762_000) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(72_201_000) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Treasury Proposals (r:1 w:0) // Storage: Treasury Approvals (r:1 w:1) fn approve_proposal(p: u32) -> Weight { - Weight::from_ref_time(10_471_736) - // Standard Error: 1_016 - .saturating_add(Weight::from_ref_time(105_175).saturating_mul(p.into())) + Weight::from_ref_time(26_551_906) + // Standard Error: 6_492 + .saturating_add(Weight::from_ref_time(202_250).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Treasury Approvals (r:1 w:1) fn remove_approval() -> Weight { - Weight::from_ref_time(6_422_000) + Weight::from_ref_time(17_980_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -85,9 +86,9 @@ impl pallet_treasury::weights::WeightInfo for WeightInf // Storage: Bounties BountyApprovals (r:1 w:1) // Storage: Treasury Proposals (r:2 w:2) fn on_initialize_proposals(p: u32) -> Weight { - Weight::from_ref_time(38_410_434) - // Standard Error: 20_814 - .saturating_add(Weight::from_ref_time(18_295_935).saturating_mul(p.into())) + Weight::from_ref_time(98_013_908) + // Standard Error: 217_163 + .saturating_add(Weight::from_ref_time(43_828_352).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index ea56ed59f..6fd7de5c5 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,24 +50,24 @@ use frame_support::{ pub struct WeightInfo(PhantomData); impl pallet_utility::weights::WeightInfo for WeightInfo { fn batch(c: u32) -> Weight { - Weight::from_ref_time(31_466_915) - // Standard Error: 2_630 - .saturating_add(Weight::from_ref_time(2_383_207).saturating_mul(c.into())) + Weight::from_ref_time(70_569_638) + // Standard Error: 21_128 + .saturating_add(Weight::from_ref_time(5_949_586).saturating_mul(c.into())) } fn as_derivative() -> Weight { - Weight::from_ref_time(4_073_000) + Weight::from_ref_time(12_090_000) } fn batch_all(c: u32) -> Weight { - Weight::from_ref_time(33_997_301) - // Standard Error: 3_559 - .saturating_add(Weight::from_ref_time(2_433_000).saturating_mul(c.into())) + Weight::from_ref_time(127_200_010) + // Standard Error: 19_602 + .saturating_add(Weight::from_ref_time(6_038_335).saturating_mul(c.into())) } fn dispatch_as() -> Weight { - Weight::from_ref_time(9_493_000) + Weight::from_ref_time(26_170_000) } fn force_batch(c: u32) -> Weight { - Weight::from_ref_time(25_346_023) - // Standard Error: 3_911 - .saturating_add(Weight::from_ref_time(2_393_869).saturating_mul(c.into())) + Weight::from_ref_time(132_350_384) + // Standard Error: 46_795 + .saturating_add(Weight::from_ref_time(5_920_953).saturating_mul(c.into())) } } diff --git a/runtime/common/src/weights/pallet_vesting.rs b/runtime/common/src/weights/pallet_vesting.rs index 8f70164d4..7bd556993 100644 --- a/runtime/common/src/weights/pallet_vesting.rs +++ b/runtime/common/src/weights/pallet_vesting.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for pallet_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -52,82 +52,86 @@ impl pallet_vesting::weights::WeightInfo for WeightInfo // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) fn vest_locked(l: u32, s: u32) -> Weight { - Weight::from_ref_time(28_454_811) - // Standard Error: 2_342 - .saturating_add(Weight::from_ref_time(30_427).saturating_mul(l.into())) - // Standard Error: 4_167 - .saturating_add(Weight::from_ref_time(10_709).saturating_mul(s.into())) + Weight::from_ref_time(63_395_103) + // Standard Error: 14_913 + .saturating_add(Weight::from_ref_time(107_241).saturating_mul(l.into())) + // Standard Error: 26_533 + .saturating_add(Weight::from_ref_time(239_493).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vest_unlocked(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(28_053_460) - // Standard Error: 2_049 - .saturating_add(Weight::from_ref_time(24_548).saturating_mul(l.into())) + fn vest_unlocked(l: u32, s: u32) -> Weight { + Weight::from_ref_time(67_323_157) + // Standard Error: 19_777 + .saturating_add(Weight::from_ref_time(17_873).saturating_mul(l.into())) + // Standard Error: 35_187 + .saturating_add(Weight::from_ref_time(74_060).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn vest_other_locked(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(28_646_528) - // Standard Error: 2_267 - .saturating_add(Weight::from_ref_time(14_776).saturating_mul(l.into())) + fn vest_other_locked(l: u32, s: u32) -> Weight { + Weight::from_ref_time(61_323_796) + // Standard Error: 13_176 + .saturating_add(Weight::from_ref_time(156_287).saturating_mul(l.into())) + // Standard Error: 23_442 + .saturating_add(Weight::from_ref_time(131_222).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - fn vest_other_unlocked(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(29_263_562) - // Standard Error: 2_411 - .saturating_add(Weight::from_ref_time(2_655).saturating_mul(l.into())) + fn vest_other_unlocked(_l: u32, s: u32) -> Weight { + Weight::from_ref_time(66_740_069) + // Standard Error: 29_462 + .saturating_add(Weight::from_ref_time(76_715).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vested_transfer(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(40_625_249) - // Standard Error: 2_877 - .saturating_add(Weight::from_ref_time(30_587).saturating_mul(l.into())) + fn vested_transfer(l: u32, s: u32) -> Weight { + Weight::from_ref_time(94_575_564) + // Standard Error: 23_761 + .saturating_add(Weight::from_ref_time(16_361).saturating_mul(l.into())) + // Standard Error: 42_276 + .saturating_add(Weight::from_ref_time(51_945).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: System Account (r:2 w:2) // Storage: Balances Locks (r:1 w:1) - fn force_vested_transfer(l: u32, s: u32) -> Weight { - Weight::from_ref_time(38_574_791) - // Standard Error: 6_754 - .saturating_add(Weight::from_ref_time(40_472).saturating_mul(l.into())) - // Standard Error: 12_017 - .saturating_add(Weight::from_ref_time(33_756).saturating_mul(s.into())) + fn force_vested_transfer(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(94_393_009) + // Standard Error: 19_791 + .saturating_add(Weight::from_ref_time(25_067).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn not_unlocking_merge_schedules(l: u32, _s: u32) -> Weight { - Weight::from_ref_time(28_978_945) - // Standard Error: 1_850 - .saturating_add(Weight::from_ref_time(38_600).saturating_mul(l.into())) + fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight { + Weight::from_ref_time(65_727_968) + // Standard Error: 16_052 + .saturating_add(Weight::from_ref_time(127_569).saturating_mul(l.into())) + // Standard Error: 29_644 + .saturating_add(Weight::from_ref_time(131_874).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: Vesting Vesting (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn unlocking_merge_schedules(l: u32, s: u32) -> Weight { - Weight::from_ref_time(29_199_036) - // Standard Error: 2_331 - .saturating_add(Weight::from_ref_time(15_809).saturating_mul(l.into())) - // Standard Error: 4_306 - .saturating_add(Weight::from_ref_time(16_241).saturating_mul(s.into())) + fn unlocking_merge_schedules(l: u32, _s: u32) -> Weight { + Weight::from_ref_time(70_624_103) + // Standard Error: 19_352 + .saturating_add(Weight::from_ref_time(55_943).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index c537da357..b50e159ef 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -398,7 +398,7 @@ with-global-disputes = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zeitgeist-runtime" -version = "0.3.8" +version = "0.3.9" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index bcb279b03..198289982 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -90,10 +90,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 45, + spec_version: 46, impl_version: 1, apis: RUNTIME_API_VERSIONS, - transaction_version: 20, + transaction_version: 21, state_version: 1, }; @@ -103,7 +103,7 @@ pub struct IsCallable; // Currently disables Court, Rikiddo and creation of markets using Court or SimpleDisputes // dispute mechanism. impl Contains for IsCallable { - fn contains(call: &RuntimeCall) -> bool { + fn contains(runtime_call: &RuntimeCall) -> bool { #[cfg(feature = "parachain")] use cumulus_pallet_dmp_queue::Call::service_overweight; use frame_system::Call::{ @@ -127,7 +127,7 @@ impl Contains for IsCallable { }; #[allow(clippy::match_like_matches_macro)] - match call { + match runtime_call { // Membership is managed by the respective Membership instance RuntimeCall::AdvisoryCommittee(set_members { .. }) => false, // See "balance.set_balance" diff --git a/scripts/init.sh b/scripts/init.sh index 82085f37a..8cee5890e 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,11 +1,13 @@ #!/usr/bin/env bash +# Initializes a build environment. +# Passing "nosudo" in the first argument results in avoiding the usage of sudo for privileged commands. + set -e echo "*** Initializing build environment" -# No sudo during docker build -if [ -f /.dockerenv ]; then +if [ "$1" == "nosudo" ]; then apt-get update && \ apt-get install -y build-essential clang curl libssl-dev protobuf-compiler else diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index 95c2850de..eb7b1beef 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -38,4 +38,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-authorized" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index 51e818f23..0b9b6375f 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_authorized //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -57,16 +57,16 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn authorize_market_outcome_first_report(m: u32) -> Weight { - Weight::from_ref_time(15_718_181) - // Standard Error: 220 - .saturating_add(Weight::from_ref_time(93_904).saturating_mul(m.into())) + Weight::from_ref_time(39_743_715) + // Standard Error: 1_509 + .saturating_add(Weight::from_ref_time(163_846).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) fn authorize_market_outcome_existing_report() -> Weight { - Weight::from_ref_time(11_771_000) + Weight::from_ref_time(33_991_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index 4ff800939..587ce33ba 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -41,4 +41,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-court" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index c1344abd2..97f3faef7 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_court //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -60,7 +60,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court RequestedJurors (r:1 w:0) // Storage: Court Votes (r:1 w:0) fn exit_court() -> Weight { - Weight::from_ref_time(32_565_000) + Weight::from_ref_time(77_001_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -68,14 +68,14 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Court CounterForJurors (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) fn join_court() -> Weight { - Weight::from_ref_time(23_581_000) + Weight::from_ref_time(55_990_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } // Storage: Court Jurors (r:1 w:0) // Storage: Court Votes (r:0 w:1) fn vote() -> Weight { - Weight::from_ref_time(10_028_000) + Weight::from_ref_time(27_410_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/global-disputes/Cargo.toml b/zrml/global-disputes/Cargo.toml index 25a78dbba..77ca074eb 100644 --- a/zrml/global-disputes/Cargo.toml +++ b/zrml/global-disputes/Cargo.toml @@ -45,4 +45,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-global-disputes" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index 0e107852d..25780ae75 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_global_disputes //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -62,10 +62,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: GlobalDisputes Locks (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_on_outcome(_o: u32, v: u32) -> Weight { - Weight::from_ref_time(33_191_681) - // Standard Error: 369 - .saturating_add(Weight::from_ref_time(37_828).saturating_mul(v.into())) + fn vote_on_outcome(o: u32, v: u32) -> Weight { + Weight::from_ref_time(78_692_161) + // Standard Error: 15_119 + .saturating_add(Weight::from_ref_time(59_007).saturating_mul(o.into())) + // Standard Error: 2_748 + .saturating_add(Weight::from_ref_time(87_375).saturating_mul(v.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -74,11 +76,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_set(l: u32, o: u32) -> Weight { - Weight::from_ref_time(18_127_027) - // Standard Error: 839 - .saturating_add(Weight::from_ref_time(1_534_897).saturating_mul(l.into())) - // Standard Error: 4_699 - .saturating_add(Weight::from_ref_time(401_151).saturating_mul(o.into())) + Weight::from_ref_time(47_121_043) + // Standard Error: 10_506 + .saturating_add(Weight::from_ref_time(3_575_177).saturating_mul(l.into())) + // Standard Error: 58_814 + .saturating_add(Weight::from_ref_time(1_025_080).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -88,11 +90,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: GlobalDisputes Winners (r:5 w:0) fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight { - Weight::from_ref_time(17_109_385) - // Standard Error: 607 - .saturating_add(Weight::from_ref_time(1_486_668).saturating_mul(l.into())) - // Standard Error: 3_398 - .saturating_add(Weight::from_ref_time(314_814).saturating_mul(o.into())) + Weight::from_ref_time(45_059_975) + // Standard Error: 9_769 + .saturating_add(Weight::from_ref_time(3_392_794).saturating_mul(l.into())) + // Standard Error: 54_688 + .saturating_add(Weight::from_ref_time(856_867).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -101,9 +103,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:1) // Storage: System Account (r:1 w:1) fn add_vote_outcome(w: u32) -> Weight { - Weight::from_ref_time(35_150_950) - // Standard Error: 1_710 - .saturating_add(Weight::from_ref_time(19_709).saturating_mul(w.into())) + Weight::from_ref_time(85_081_228) + // Standard Error: 23_929 + .saturating_add(Weight::from_ref_time(247_830).saturating_mul(w.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -111,9 +113,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:2 w:2) fn reward_outcome_owner_with_funds(o: u32) -> Weight { - Weight::from_ref_time(24_395_149) - // Standard Error: 13_698 - .saturating_add(Weight::from_ref_time(11_889_863).saturating_mul(o.into())) + Weight::from_ref_time(69_114_969) + // Standard Error: 102_841 + .saturating_add(Weight::from_ref_time(27_858_004).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -122,15 +124,18 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:1 w:0) // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:1 w:0) - fn reward_outcome_owner_no_funds(_o: u32) -> Weight { - Weight::from_ref_time(17_745_809).saturating_add(T::DbWeight::get().reads(3)) + fn reward_outcome_owner_no_funds(o: u32) -> Weight { + Weight::from_ref_time(43_940_716) + // Standard Error: 11_242 + .saturating_add(Weight::from_ref_time(322_069).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(3)) } // Storage: GlobalDisputes Winners (r:1 w:1) // Storage: GlobalDisputes Outcomes (r:3 w:2) fn purge_outcomes(k: u32, _o: u32) -> Weight { - Weight::from_ref_time(34_095_000) - // Standard Error: 1_848 - .saturating_add(Weight::from_ref_time(7_103_707).saturating_mul(k.into())) + Weight::from_ref_time(134_980_974) + // Standard Error: 24_117 + .saturating_add(Weight::from_ref_time(17_002_999).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index f143dff10..20902ca2c 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -40,4 +40,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-liquidity-mining" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/liquidity-mining/src/weights.rs b/zrml/liquidity-mining/src/weights.rs index 17bd8677d..8d10b58c5 100644 --- a/zrml/liquidity-mining/src/weights.rs +++ b/zrml/liquidity-mining/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_liquidity_mining //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -54,6 +54,6 @@ pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { // Storage: LiquidityMining PerBlockIncentive (r:0 w:1) fn set_per_block_distribution() -> Weight { - Weight::from_ref_time(2_691_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(8_270_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index ae85191f5..05f519393 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -31,4 +31,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-market-commons" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/orderbook-v1/Cargo.toml b/zrml/orderbook-v1/Cargo.toml index e2e7dd6ce..7328f2765 100644 --- a/zrml/orderbook-v1/Cargo.toml +++ b/zrml/orderbook-v1/Cargo.toml @@ -47,4 +47,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-orderbook-v1" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/orderbook-v1/src/weights.rs b/zrml/orderbook-v1/src/weights.rs index bd6a5ea3a..4d02a09ba 100644 --- a/zrml/orderbook-v1/src/weights.rs +++ b/zrml/orderbook-v1/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index b8a119af2..228bdb4f8 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -98,4 +98,4 @@ with-global-disputes = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-prediction-markets" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index b7bb2c86b..e651a6769 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -15,4 +15,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-prediction-markets-runtime-api" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index 6d65d7fd6..ffae859e8 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies Ltd. +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_prediction_markets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -92,12 +92,18 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets Disputes (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - fn admin_destroy_disputed_market(a: u32, d: u32, _o: u32, _c: u32, _r: u32) -> Weight { - Weight::from_ref_time(98_844_452) - // Standard Error: 1_524 - .saturating_add(Weight::from_ref_time(12_109_486).saturating_mul(a.into())) - // Standard Error: 17_423 - .saturating_add(Weight::from_ref_time(10_703_404).saturating_mul(d.into())) + fn admin_destroy_disputed_market(a: u32, d: u32, o: u32, c: u32, r: u32) -> Weight { + Weight::from_ref_time(107_238_514) + // Standard Error: 41_363 + .saturating_add(Weight::from_ref_time(29_341_596).saturating_mul(a.into())) + // Standard Error: 472_622 + .saturating_add(Weight::from_ref_time(27_719_415).saturating_mul(d.into())) + // Standard Error: 41_159 + .saturating_add(Weight::from_ref_time(628_912).saturating_mul(o.into())) + // Standard Error: 41_159 + .saturating_add(Weight::from_ref_time(225_352).saturating_mul(c.into())) + // Standard Error: 41_159 + .saturating_add(Weight::from_ref_time(116_924).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) @@ -114,12 +120,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) - fn admin_destroy_reported_market(a: u32, _o: u32, _c: u32, r: u32) -> Weight { - Weight::from_ref_time(101_907_522) - // Standard Error: 2_150 - .saturating_add(Weight::from_ref_time(11_991_328).saturating_mul(a.into())) - // Standard Error: 2_139 - .saturating_add(Weight::from_ref_time(19_182).saturating_mul(r.into())) + fn admin_destroy_reported_market(a: u32, o: u32, _c: u32, _r: u32) -> Weight { + Weight::from_ref_time(318_190_722) + // Standard Error: 36_412 + .saturating_add(Weight::from_ref_time(28_170_443).saturating_mul(a.into())) + // Standard Error: 36_230 + .saturating_add(Weight::from_ref_time(110_146).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(8)) @@ -130,12 +136,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) - fn admin_move_market_to_closed(o: u32, c: u32) -> Weight { - Weight::from_ref_time(29_677_109) - // Standard Error: 266 - .saturating_add(Weight::from_ref_time(8_751).saturating_mul(o.into())) - // Standard Error: 266 - .saturating_add(Weight::from_ref_time(20_949).saturating_mul(c.into())) + fn admin_move_market_to_closed(_o: u32, c: u32) -> Weight { + Weight::from_ref_time(79_287_004) + // Standard Error: 2_160 + .saturating_add(Weight::from_ref_time(1_879).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -145,9 +149,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: PredictionMarkets Disputes (r:0 w:1) fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight { - Weight::from_ref_time(47_236_897) - // Standard Error: 334 - .saturating_add(Weight::from_ref_time(14_850).saturating_mul(r.into())) + Weight::from_ref_time(113_444_507) + // Standard Error: 3_870 + .saturating_add(Weight::from_ref_time(50_492).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -158,9 +162,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight { - Weight::from_ref_time(82_465_110) - // Standard Error: 390 - .saturating_add(Weight::from_ref_time(24_567).saturating_mul(r.into())) + Weight::from_ref_time(177_369_441) + // Standard Error: 5_024 + .saturating_add(Weight::from_ref_time(916).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -172,8 +176,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Winners (r:1 w:0) // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) - fn admin_move_market_to_resolved_scalar_disputed(_r: u32) -> Weight { - Weight::from_ref_time(77_566_793) + fn admin_move_market_to_resolved_scalar_disputed(r: u32) -> Weight { + Weight::from_ref_time(176_005_979) + // Standard Error: 5_651 + .saturating_add(Weight::from_ref_time(11_093).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(7)) } @@ -187,9 +193,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_move_market_to_resolved_categorical_disputed(r: u32) -> Weight { - Weight::from_ref_time(111_553_988) - // Standard Error: 510 - .saturating_add(Weight::from_ref_time(24_763).saturating_mul(r.into())) + Weight::from_ref_time(238_247_311) + // Standard Error: 6_613 + .saturating_add(Weight::from_ref_time(35_386).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(8)) } @@ -197,16 +203,16 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:0) // Storage: Balances Reserves (r:1 w:1) fn approve_market() -> Weight { - Weight::from_ref_time(30_750_000) + Weight::from_ref_time(73_620_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } // Storage: MarketCommons Markets (r:1 w:0) // Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) fn request_edit(r: u32) -> Weight { - Weight::from_ref_time(16_505_286) - // Standard Error: 17 - .saturating_add(Weight::from_ref_time(957).saturating_mul(r.into())) + Weight::from_ref_time(42_488_817) + // Standard Error: 95 + .saturating_add(Weight::from_ref_time(1_055).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -215,9 +221,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn buy_complete_set(a: u32) -> Weight { - Weight::from_ref_time(34_786_131) - // Standard Error: 1_751 - .saturating_add(Weight::from_ref_time(8_388_765).saturating_mul(a.into())) + Weight::from_ref_time(85_601_158) + // Standard Error: 22_842 + .saturating_add(Weight::from_ref_time(19_933_921).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -229,9 +235,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: MarketCommons Markets (r:0 w:1) fn create_market(m: u32) -> Weight { - Weight::from_ref_time(31_590_932) - // Standard Error: 536 - .saturating_add(Weight::from_ref_time(19_431).saturating_mul(m.into())) + Weight::from_ref_time(79_694_906) + // Standard Error: 3_703 + .saturating_add(Weight::from_ref_time(38_813).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -240,9 +246,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn edit_market(m: u32) -> Weight { - Weight::from_ref_time(27_792_538) - // Standard Error: 342 - .saturating_add(Weight::from_ref_time(27_261).saturating_mul(m.into())) + Weight::from_ref_time(69_089_314) + // Standard Error: 2_466 + .saturating_add(Weight::from_ref_time(61_240).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -255,12 +261,10 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) - fn deploy_swap_pool_for_market_future_pool(a: u32, o: u32) -> Weight { - Weight::from_ref_time(62_202_136) - // Standard Error: 1_823 - .saturating_add(Weight::from_ref_time(13_956_712).saturating_mul(a.into())) - // Standard Error: 1_814 - .saturating_add(Weight::from_ref_time(50_205).saturating_mul(o.into())) + fn deploy_swap_pool_for_market_future_pool(a: u32, _o: u32) -> Weight { + Weight::from_ref_time(204_259_432) + // Standard Error: 39_253 + .saturating_add(Weight::from_ref_time(32_676_903).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(7)) @@ -275,9 +279,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn deploy_swap_pool_for_market_open_pool(a: u32) -> Weight { - Weight::from_ref_time(67_257_811) - // Standard Error: 2_495 - .saturating_add(Weight::from_ref_time(13_993_256).saturating_mul(a.into())) + Weight::from_ref_time(148_687_190) + // Standard Error: 35_655 + .saturating_add(Weight::from_ref_time(33_156_557).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(6)) @@ -289,11 +293,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: GlobalDisputes Outcomes (r:7 w:7) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) fn start_global_dispute(m: u32, n: u32) -> Weight { - Weight::from_ref_time(59_605_523) - // Standard Error: 335 - .saturating_add(Weight::from_ref_time(8_254).saturating_mul(m.into())) - // Standard Error: 335 - .saturating_add(Weight::from_ref_time(13_974).saturating_mul(n.into())) + Weight::from_ref_time(134_890_624) + // Standard Error: 4_075 + .saturating_add(Weight::from_ref_time(7_847).saturating_mul(m.into())) + // Standard Error: 4_075 + .saturating_add(Weight::from_ref_time(48_957).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(12)) .saturating_add(T::DbWeight::get().writes(10)) } @@ -301,7 +305,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) fn dispute_authorized() -> Weight { - Weight::from_ref_time(32_360_000) + Weight::from_ref_time(82_290_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -309,7 +313,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn handle_expired_advised_market() -> Weight { - Weight::from_ref_time(33_141_000) + Weight::from_ref_time(79_701_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -319,7 +323,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:1) // Storage: PredictionMarkets Disputes (r:0 w:1) fn internal_resolve_categorical_reported() -> Weight { - Weight::from_ref_time(70_937_000) + Weight::from_ref_time(149_241_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -331,7 +335,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn internal_resolve_categorical_disputed() -> Weight { - Weight::from_ref_time(94_028_000) + Weight::from_ref_time(196_701_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -340,7 +344,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: PredictionMarkets Disputes (r:0 w:1) fn internal_resolve_scalar_reported() -> Weight { - Weight::from_ref_time(35_443_000) + Weight::from_ref_time(90_760_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -352,7 +356,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: MarketCommons MarketPool (r:1 w:0) fn internal_resolve_scalar_disputed() -> Weight { - Weight::from_ref_time(60_764_000) + Weight::from_ref_time(150_781_000) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -366,15 +370,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn on_initialize_resolve_overhead() -> Weight { - Weight::from_ref_time(14_258_000) + Weight::from_ref_time(39_020_000) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(8)) } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_raw(a: u32) -> Weight { - Weight::from_ref_time(3_089_324) - // Standard Error: 547 - .saturating_add(Weight::from_ref_time(97_367).saturating_mul(a.into())) + Weight::from_ref_time(8_926_513) + // Standard Error: 3_860 + .saturating_add(Weight::from_ref_time(277_807).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -383,7 +387,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn redeem_shares_categorical() -> Weight { - Weight::from_ref_time(57_384_000) + Weight::from_ref_time(119_160_000) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -392,7 +396,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn redeem_shares_scalar() -> Weight { - Weight::from_ref_time(60_727_000) + Weight::from_ref_time(136_620_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -402,23 +406,21 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) fn reject_market(c: u32, o: u32, r: u32) -> Weight { - Weight::from_ref_time(51_879_457) - // Standard Error: 358 - .saturating_add(Weight::from_ref_time(22_537).saturating_mul(c.into())) - // Standard Error: 358 - .saturating_add(Weight::from_ref_time(12_584).saturating_mul(o.into())) - // Standard Error: 22 - .saturating_add(Weight::from_ref_time(475).saturating_mul(r.into())) + Weight::from_ref_time(120_686_900) + // Standard Error: 3_165 + .saturating_add(Weight::from_ref_time(32_234).saturating_mul(c.into())) + // Standard Error: 3_165 + .saturating_add(Weight::from_ref_time(60_783).saturating_mul(o.into())) + // Standard Error: 194 + .saturating_add(Weight::from_ref_time(1_535).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: MarketCommons Markets (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) // Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - fn report(m: u32) -> Weight { - Weight::from_ref_time(23_497_754) - // Standard Error: 338 - .saturating_add(Weight::from_ref_time(6_734).saturating_mul(m.into())) + fn report(_m: u32) -> Weight { + Weight::from_ref_time(58_882_549) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -427,9 +429,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:2 w:2) // Storage: Tokens TotalIssuance (r:2 w:2) fn sell_complete_set(a: u32) -> Weight { - Weight::from_ref_time(35_416_984) - // Standard Error: 1_858 - .saturating_add(Weight::from_ref_time(11_608_572).saturating_mul(a.into())) + Weight::from_ref_time(75_333_021) + // Standard Error: 42_233 + .saturating_add(Weight::from_ref_time(27_741_358).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -442,9 +444,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) // Storage: Swaps Pools (r:0 w:1) fn start_subsidy(a: u32) -> Weight { - Weight::from_ref_time(23_573_263) - // Standard Error: 226 - .saturating_add(Weight::from_ref_time(42_261).saturating_mul(a.into())) + Weight::from_ref_time(59_895_192) + // Standard Error: 2_305 + .saturating_add(Weight::from_ref_time(63_978).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -452,11 +454,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerOpenTimeFrame (r:1 w:1) fn market_status_manager(b: u32, f: u32) -> Weight { - Weight::from_ref_time(27_286_425) - // Standard Error: 1_160 - .saturating_add(Weight::from_ref_time(1_511_142).saturating_mul(b.into())) - // Standard Error: 1_160 - .saturating_add(Weight::from_ref_time(1_501_105).saturating_mul(f.into())) + Weight::from_ref_time(54_851_745) + // Standard Error: 3_638 + .saturating_add(Weight::from_ref_time(3_397_992).saturating_mul(b.into())) + // Standard Error: 3_638 + .saturating_add(Weight::from_ref_time(3_372_304).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) @@ -466,11 +468,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons Markets (r:32 w:0) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) fn market_resolution_manager(r: u32, d: u32) -> Weight { - Weight::from_ref_time(25_238_195) - // Standard Error: 767 - .saturating_add(Weight::from_ref_time(1_555_436).saturating_mul(r.into())) - // Standard Error: 767 - .saturating_add(Weight::from_ref_time(1_589_138).saturating_mul(d.into())) + Weight::from_ref_time(51_119_835) + // Standard Error: 7_314 + .saturating_add(Weight::from_ref_time(3_513_755).saturating_mul(r.into())) + // Standard Error: 7_314 + .saturating_add(Weight::from_ref_time(3_510_880).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) @@ -478,7 +480,7 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: PredictionMarkets MarketsCollectingSubsidy (r:1 w:1) fn process_subsidy_collecting_markets_dummy() -> Weight { - Weight::from_ref_time(2_968_000) + Weight::from_ref_time(8_780_000) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index cd0f49627..15079b971 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -42,4 +42,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-rikiddo" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index 80aa46782..d61fd1c51 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -38,4 +38,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-simple-disputes" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/styx/Cargo.toml b/zrml/styx/Cargo.toml index 70873adf2..b2e55bb25 100644 --- a/zrml/styx/Cargo.toml +++ b/zrml/styx/Cargo.toml @@ -36,4 +36,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-styx" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/styx/src/weights.rs b/zrml/styx/src/weights.rs index c86b694fb..095ede0e6 100644 --- a/zrml/styx/src/weights.rs +++ b/zrml/styx/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_styx //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -56,12 +56,12 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Styx Crossings (r:1 w:1) // Storage: Styx BurnAmount (r:1 w:0) fn cross() -> Weight { - Weight::from_ref_time(23_072_000) + Weight::from_ref_time(63_231_000) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Styx BurnAmount (r:0 w:1) fn set_burn_amount() -> Weight { - Weight::from_ref_time(9_025_000).saturating_add(T::DbWeight::get().writes(1)) + Weight::from_ref_time(23_250_000).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index 5ddf3aae3..bdb90fc5f 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -65,4 +65,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-swaps" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index dcb0ce1d5..e3f57d771 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -11,4 +11,4 @@ zrml-swaps-runtime-api = { default-features = false, features = ["std"], path = authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-swaps-rpc" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index 67f337c10..ea643fcc8 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -17,4 +17,4 @@ std = [ authors = ["Zeitgeist PM "] edition = "2021" name = "zrml-swaps-runtime-api" -version = "0.3.8" +version = "0.3.9" diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index 6ff787bdc..fd6789496 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for zrml_swaps //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-02-08, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-06-16, STEPS: `10`, REPEAT: 1000, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -81,9 +81,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_categorical(a: u32) -> Weight { - Weight::from_ref_time(25_692_254) - // Standard Error: 614 - .saturating_add(Weight::from_ref_time(284_413).saturating_mul(a.into())) + Weight::from_ref_time(58_170_398) + // Standard Error: 1_806 + .saturating_add(Weight::from_ref_time(565_711).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -91,7 +91,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: MarketCommons MarketPool (r:1 w:0) // Storage: Swaps Pools (r:1 w:1) fn admin_clean_up_pool_cpmm_scalar() -> Weight { - Weight::from_ref_time(22_556_000) + Weight::from_ref_time(53_560_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -101,9 +101,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:7 w:0) // Storage: Tokens TotalIssuance (r:64 w:64) fn apply_to_cached_pools_execute_arbitrage(a: u32) -> Weight { - Weight::from_ref_time(313_000) - // Standard Error: 71_767 - .saturating_add(Weight::from_ref_time(912_062_521).saturating_mul(a.into())) + Weight::from_ref_time(950_000) + // Standard Error: 425_528 + .saturating_add(Weight::from_ref_time(2_278_865_797).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(43)) .saturating_add(T::DbWeight::get().reads((70_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(42)) @@ -111,9 +111,9 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: Swaps PoolsCachedForArbitrage (r:8 w:7) fn apply_to_cached_pools_noop(a: u32) -> Weight { - Weight::from_ref_time(313_000) - // Standard Error: 999 - .saturating_add(Weight::from_ref_time(3_519_461).saturating_mul(a.into())) + Weight::from_ref_time(5_030_930) + // Standard Error: 8_315 + .saturating_add(Weight::from_ref_time(8_177_593).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) @@ -123,9 +123,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn destroy_pool_in_subsidy_phase(a: u32) -> Weight { - Weight::from_ref_time(20_746_815) - // Standard Error: 6_870 - .saturating_add(Weight::from_ref_time(9_588_841).saturating_mul(a.into())) + Weight::from_ref_time(51_577_376) + // Standard Error: 40_794 + .saturating_add(Weight::from_ref_time(20_795_563).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -135,11 +135,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:46 w:21) // Storage: System Account (r:11 w:10) fn distribute_pool_share_rewards(a: u32, b: u32) -> Weight { - Weight::from_ref_time(22_860_268) - // Standard Error: 18_875 - .saturating_add(Weight::from_ref_time(10_760_963).saturating_mul(a.into())) - // Standard Error: 18_875 - .saturating_add(Weight::from_ref_time(19_119_205).saturating_mul(b.into())) + Weight::from_ref_time(109_037_971) + // Standard Error: 137_890 + .saturating_add(Weight::from_ref_time(22_311_542).saturating_mul(a.into())) + // Standard Error: 137_890 + .saturating_add(Weight::from_ref_time(43_711_337).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) @@ -153,11 +153,11 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:2 w:2) // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:0) fn end_subsidy_phase(a: u32, b: u32) -> Weight { - Weight::from_ref_time(13_533_000) - // Standard Error: 35_634 - .saturating_add(Weight::from_ref_time(8_213_437).saturating_mul(a.into())) - // Standard Error: 236_657 - .saturating_add(Weight::from_ref_time(36_459_831).saturating_mul(b.into())) + Weight::from_ref_time(28_320_000) + // Standard Error: 86_902 + .saturating_add(Weight::from_ref_time(19_686_690).saturating_mul(a.into())) + // Standard Error: 577_146 + .saturating_add(Weight::from_ref_time(85_851_591).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(b.into()))) @@ -169,9 +169,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_buy_burn(a: u32) -> Weight { - Weight::from_ref_time(33_878_547) - // Standard Error: 9_283 - .saturating_add(Weight::from_ref_time(15_010_607).saturating_mul(a.into())) + Weight::from_ref_time(85_487_346) + // Standard Error: 39_317 + .saturating_add(Weight::from_ref_time(35_613_473).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(4)) @@ -182,9 +182,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:2 w:1) // Storage: Tokens TotalIssuance (r:1 w:1) fn execute_arbitrage_mint_sell(a: u32) -> Weight { - Weight::from_ref_time(38_285_437) - // Standard Error: 9_089 - .saturating_add(Weight::from_ref_time(13_998_473).saturating_mul(a.into())) + Weight::from_ref_time(88_354_876) + // Standard Error: 38_137 + .saturating_add(Weight::from_ref_time(33_290_909).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -193,9 +193,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps Pools (r:1 w:0) // Storage: Tokens Accounts (r:2 w:0) fn execute_arbitrage_skipped(a: u32) -> Weight { - Weight::from_ref_time(14_828_448) - // Standard Error: 1_025 - .saturating_add(Weight::from_ref_time(2_204_192).saturating_mul(a.into())) + Weight::from_ref_time(34_149_355) + // Standard Error: 3_877 + .saturating_add(Weight::from_ref_time(4_760_669).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) } @@ -204,9 +204,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:5 w:5) // Storage: System Account (r:1 w:0) fn pool_exit(a: u32) -> Weight { - Weight::from_ref_time(37_507_291) - // Standard Error: 2_130 - .saturating_add(Weight::from_ref_time(11_575_025).saturating_mul(a.into())) + Weight::from_ref_time(71_597_112) + // Standard Error: 31_790 + .saturating_add(Weight::from_ref_time(27_110_684).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -216,7 +216,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Swaps SubsidyProviders (r:1 w:1) // Storage: Tokens Accounts (r:1 w:1) fn pool_exit_subsidy() -> Weight { - Weight::from_ref_time(37_934_000) + Weight::from_ref_time(79_620_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -226,7 +226,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_asset_amount() -> Weight { - Weight::from_ref_time(69_851_000) + Weight::from_ref_time(144_091_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -236,7 +236,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_exit_with_exact_pool_amount() -> Weight { - Weight::from_ref_time(69_798_000) + Weight::from_ref_time(145_410_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -244,9 +244,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens TotalIssuance (r:1 w:1) // Storage: Tokens Accounts (r:5 w:5) fn pool_join(a: u32) -> Weight { - Weight::from_ref_time(33_804_359) - // Standard Error: 2_236 - .saturating_add(Weight::from_ref_time(11_351_296).saturating_mul(a.into())) + Weight::from_ref_time(66_902_178) + // Standard Error: 35_145 + .saturating_add(Weight::from_ref_time(26_627_552).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) @@ -256,7 +256,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:1 w:1) // Storage: Swaps SubsidyProviders (r:1 w:1) fn pool_join_subsidy() -> Weight { - Weight::from_ref_time(38_045_000) + Weight::from_ref_time(81_541_000) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -265,7 +265,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_asset_amount() -> Weight { - Weight::from_ref_time(63_348_000) + Weight::from_ref_time(130_781_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -274,15 +274,15 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Tokens Accounts (r:3 w:3) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn pool_join_with_exact_pool_amount() -> Weight { - Weight::from_ref_time(63_817_000) + Weight::from_ref_time(131_360_000) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn clean_up_pool_categorical_without_reward_distribution(a: u32) -> Weight { - Weight::from_ref_time(5_597_769) - // Standard Error: 274 - .saturating_add(Weight::from_ref_time(163_354).saturating_mul(a.into())) + Weight::from_ref_time(15_637_896) + // Standard Error: 915 + .saturating_add(Weight::from_ref_time(352_368).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -291,7 +291,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_in_cpmm() -> Weight { - Weight::from_ref_time(81_657_000) + Weight::from_ref_time(172_211_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -302,9 +302,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_in_rikiddo(a: u32) -> Weight { - Weight::from_ref_time(72_975_675) - // Standard Error: 2_451 - .saturating_add(Weight::from_ref_time(7_367_384).saturating_mul(a.into())) + Weight::from_ref_time(182_553_505) + // Standard Error: 21_078 + .saturating_add(Weight::from_ref_time(17_637_755).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(5)) @@ -314,7 +314,7 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:0) // Storage: Swaps PoolsCachedForArbitrage (r:0 w:1) fn swap_exact_amount_out_cpmm() -> Weight { - Weight::from_ref_time(81_923_000) + Weight::from_ref_time(171_171_000) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -324,26 +324,26 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: RikiddoSigmoidFeeMarketEma RikiddoPerPool (r:1 w:1) // Storage: Timestamp Now (r:1 w:0) fn swap_exact_amount_out_rikiddo(a: u32) -> Weight { - Weight::from_ref_time(52_010_503) - // Standard Error: 3_021 - .saturating_add(Weight::from_ref_time(12_822_294).saturating_mul(a.into())) + Weight::from_ref_time(83_162_756) + // Standard Error: 54_784 + .saturating_add(Weight::from_ref_time(33_550_034).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(5)) } // Storage: Swaps Pools (r:1 w:1) fn open_pool(a: u32) -> Weight { - Weight::from_ref_time(12_568_363) - // Standard Error: 435 - .saturating_add(Weight::from_ref_time(244_095).saturating_mul(a.into())) + Weight::from_ref_time(30_971_080) + // Standard Error: 1_312 + .saturating_add(Weight::from_ref_time(478_368).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Swaps Pools (r:1 w:1) fn close_pool(a: u32) -> Weight { - Weight::from_ref_time(11_445_465) - // Standard Error: 326 - .saturating_add(Weight::from_ref_time(192_402).saturating_mul(a.into())) + Weight::from_ref_time(28_580_115) + // Standard Error: 1_191 + .saturating_add(Weight::from_ref_time(370_645).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -352,9 +352,9 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: System Account (r:1 w:1) // Storage: Tokens TotalIssuance (r:2 w:2) fn destroy_pool(a: u32) -> Weight { - Weight::from_ref_time(22_588_099) - // Standard Error: 1_893 - .saturating_add(Weight::from_ref_time(10_954_266).saturating_mul(a.into())) + Weight::from_ref_time(50_684_702) + // Standard Error: 34_331 + .saturating_add(Weight::from_ref_time(25_852_777).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) From 46c142bd85699f571ab980afd8baf6746989e72a Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 5 Jul 2023 11:06:29 +0200 Subject: [PATCH 49/53] Don't panic on spec_version mismatch during try-runtime (#1035) --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 129668d69..c3b5d6df7 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ check-dummy: try-runtime \ --execution=Native \ --chain=${TRYRUNTIME_CHAIN} \ + --no-spec-check-panic \ on-runtime-upgrade \ live \ --uri=${TRYRUNTIME_URL} From 00262ca7e8e6f6c6f5f55e8924dcf2abda66a34c Mon Sep 17 00:00:00 2001 From: Harald Heckmann Date: Wed, 5 Jul 2023 11:11:38 +0200 Subject: [PATCH 50/53] Remove old migrations (#1034) --- runtime/common/src/lib.rs | 7 - zrml/prediction-markets/src/migrations.rs | 387 ---------------------- 2 files changed, 394 deletions(-) diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index fe45f8c55..73dfad19f 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -66,13 +66,6 @@ macro_rules! decl_common_types { frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - SchedulerMigrationV1toV4, - pallet_multisig::migrations::v1::MigrateToV1, - pallet_preimage::migration::v1::Migration, - pallet_democracy::migrations::v1::Migration, - zrml_prediction_markets::migrations::AddOutsiderBond, - ), >; pub type Header = generic::Header; diff --git a/zrml/prediction-markets/src/migrations.rs b/zrml/prediction-markets/src/migrations.rs index e1b0c42ae..3bc5ddb7c 100644 --- a/zrml/prediction-markets/src/migrations.rs +++ b/zrml/prediction-markets/src/migrations.rs @@ -15,390 +15,3 @@ // // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . - -#[cfg(feature = "try-runtime")] -use crate::MarketIdOf; -use crate::{BalanceOf, Config, MomentOf}; -#[cfg(feature = "try-runtime")] -use alloc::collections::BTreeMap; -#[cfg(feature = "try-runtime")] -use alloc::format; -use alloc::vec::Vec; -#[cfg(feature = "try-runtime")] -use frame_support::migration::storage_key_iter; -use frame_support::{ - dispatch::Weight, - log, - pallet_prelude::PhantomData, - traits::{Get, OnRuntimeUpgrade, StorageVersion}, - RuntimeDebug, -}; -use parity_scale_codec::{Decode, Encode}; -use scale_info::TypeInfo; -use sp_runtime::traits::Saturating; -use zeitgeist_primitives::types::{ - Asset, Bond, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, - MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, -}; -#[cfg(feature = "try-runtime")] -use zrml_market_commons::MarketCommonsPalletApi; -use zrml_market_commons::Pallet as MarketCommonsPallet; - -#[cfg(any(feature = "try-runtime", test))] -const MARKET_COMMONS: &[u8] = b"MarketCommons"; -#[cfg(any(feature = "try-runtime", test))] -const MARKETS: &[u8] = b"Markets"; - -const MARKET_COMMONS_REQUIRED_STORAGE_VERSION: u16 = 5; -const MARKET_COMMONS_NEXT_STORAGE_VERSION: u16 = 6; - -#[derive(Clone, Decode, Encode, PartialEq, Eq, RuntimeDebug, TypeInfo)] -pub struct OldMarketBonds { - pub creation: Option>, - pub oracle: Option>, -} - -#[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub struct OldMarket { - pub base_asset: A, - pub creator: AI, - pub creation: MarketCreation, - pub creator_fee: u8, - pub oracle: AI, - pub metadata: Vec, - pub market_type: MarketType, - pub period: MarketPeriod, - pub deadlines: Deadlines, - pub scoring_rule: ScoringRule, - pub status: MarketStatus, - pub report: Option>, - pub resolved_outcome: Option, - pub dispute_mechanism: MarketDisputeMechanism, - pub bonds: OldMarketBonds, -} - -type OldMarketOf = OldMarket< - ::AccountId, - BalanceOf, - ::BlockNumber, - MomentOf, - Asset<::MarketId>, ->; - -#[frame_support::storage_alias] -pub(crate) type Markets = StorageMap< - MarketCommonsPallet, - frame_support::Blake2_128Concat, - ::MarketId, - OldMarketOf, ->; - -pub struct AddOutsiderBond(PhantomData); - -impl OnRuntimeUpgrade for AddOutsiderBond { - fn on_runtime_upgrade() -> Weight { - let mut total_weight = T::DbWeight::get().reads(1); - let market_commons_version = StorageVersion::get::>(); - if market_commons_version != MARKET_COMMONS_REQUIRED_STORAGE_VERSION { - log::info!( - "AddOutsiderBond: market-commons version is {:?}, but {:?} is required", - market_commons_version, - MARKET_COMMONS_REQUIRED_STORAGE_VERSION, - ); - return total_weight; - } - log::info!("AddOutsiderBond: Starting..."); - - let mut translated = 0u64; - zrml_market_commons::Markets::::translate::, _>(|_key, old_market| { - translated.saturating_inc(); - - let new_market = Market { - base_asset: old_market.base_asset, - creator: old_market.creator, - creation: old_market.creation, - creator_fee: old_market.creator_fee, - oracle: old_market.oracle, - metadata: old_market.metadata, - market_type: old_market.market_type, - period: old_market.period, - scoring_rule: old_market.scoring_rule, - status: old_market.status, - report: old_market.report, - resolved_outcome: old_market.resolved_outcome, - dispute_mechanism: old_market.dispute_mechanism, - deadlines: old_market.deadlines, - bonds: MarketBonds { - creation: old_market.bonds.creation, - oracle: old_market.bonds.oracle, - outsider: None, - }, - }; - - Some(new_market) - }); - log::info!("AddOutsiderBond: Upgraded {} markets.", translated); - total_weight = - total_weight.saturating_add(T::DbWeight::get().reads_writes(translated, translated)); - - StorageVersion::new(MARKET_COMMONS_NEXT_STORAGE_VERSION).put::>(); - total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - log::info!("AddOutsiderBond: Done!"); - total_weight - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - use frame_support::pallet_prelude::Blake2_128Concat; - - let old_markets = storage_key_iter::, OldMarketOf, Blake2_128Concat>( - MARKET_COMMONS, - MARKETS, - ) - .collect::>(); - - let markets = Markets::::iter_keys().count() as u32; - let decodable_markets = Markets::::iter_values().count() as u32; - if markets != decodable_markets { - log::error!( - "Can only decode {} of {} markets - others will be dropped", - decodable_markets, - markets - ); - } else { - log::info!("Markets: {}, Decodable Markets: {}", markets, decodable_markets); - } - - Ok(old_markets.encode()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(previous_state: Vec) -> Result<(), &'static str> { - let old_markets: BTreeMap, OldMarketOf> = - Decode::decode(&mut &previous_state[..]) - .expect("Failed to decode state: Invalid state"); - let new_market_count = >::market_iter().count(); - assert_eq!(old_markets.len(), new_market_count); - for (market_id, new_market) in >::market_iter() { - let old_market = old_markets - .get(&market_id) - .expect(&format!("Market {:?} not found", market_id)[..]); - assert_eq!(new_market.base_asset, old_market.base_asset); - assert_eq!(new_market.creator, old_market.creator); - assert_eq!(new_market.creation, old_market.creation); - assert_eq!(new_market.creator_fee, old_market.creator_fee); - assert_eq!(new_market.oracle, old_market.oracle); - assert_eq!(new_market.metadata, old_market.metadata); - assert_eq!(new_market.market_type, old_market.market_type); - assert_eq!(new_market.period, old_market.period); - assert_eq!(new_market.deadlines, old_market.deadlines); - assert_eq!(new_market.scoring_rule, old_market.scoring_rule); - assert_eq!(new_market.status, old_market.status); - assert_eq!(new_market.report, old_market.report); - assert_eq!(new_market.resolved_outcome, old_market.resolved_outcome); - assert_eq!(new_market.dispute_mechanism, old_market.dispute_mechanism); - assert_eq!(new_market.bonds.oracle, old_market.bonds.oracle); - assert_eq!(new_market.bonds.creation, old_market.bonds.creation); - // new field - assert_eq!(new_market.bonds.outsider, None); - } - log::info!("AddOutsiderBond: Market Counter post-upgrade is {}!", new_market_count); - assert!(new_market_count > 0); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::{ - mock::{ExtBuilder, Runtime}, - MarketIdOf, MarketOf, - }; - use frame_support::{ - dispatch::fmt::Debug, migration::put_storage_value, Blake2_128Concat, StorageHasher, - }; - use zrml_market_commons::MarketCommonsPalletApi; - - #[test] - fn on_runtime_upgrade_increments_the_storage_version() { - ExtBuilder::default().build().execute_with(|| { - set_up_version(); - AddOutsiderBond::::on_runtime_upgrade(); - assert_eq!( - StorageVersion::get::>(), - MARKET_COMMONS_NEXT_STORAGE_VERSION - ); - }); - } - - #[test] - fn on_runtime_upgrade_is_noop_if_versions_are_not_correct() { - ExtBuilder::default().build().execute_with(|| { - // Don't set up chain to signal that storage is already up to date. - let (_, new_markets) = construct_old_new_tuple(); - populate_test_data::, MarketOf>( - MARKET_COMMONS, - MARKETS, - new_markets.clone(), - ); - AddOutsiderBond::::on_runtime_upgrade(); - let actual = >::market(&0u128).unwrap(); - assert_eq!(actual, new_markets[0]); - }); - } - - #[test] - fn on_runtime_upgrade_correctly_updates_markets() { - ExtBuilder::default().build().execute_with(|| { - set_up_version(); - let (old_markets, new_markets) = construct_old_new_tuple(); - populate_test_data::, OldMarketOf>( - MARKET_COMMONS, - MARKETS, - old_markets, - ); - AddOutsiderBond::::on_runtime_upgrade(); - let actual = >::market(&0u128).unwrap(); - assert_eq!(actual, new_markets[0]); - }); - } - - fn set_up_version() { - StorageVersion::new(MARKET_COMMONS_REQUIRED_STORAGE_VERSION) - .put::>(); - } - - fn construct_old_new_tuple() -> (Vec>, Vec>) { - let base_asset = Asset::Ztg; - let creator = 999; - let creator_fee = 1; - let oracle = 2; - let metadata = vec![3, 4, 5]; - let market_type = MarketType::Categorical(6); - let period = MarketPeriod::Block(7..8); - let scoring_rule = ScoringRule::CPMM; - let status = MarketStatus::Disputed; - let creation = MarketCreation::Permissionless; - let report = None; - let resolved_outcome = None; - let dispute_mechanism = MarketDisputeMechanism::Authorized; - let deadlines = Deadlines::default(); - let old_bonds = OldMarketBonds { - creation: Some(Bond::new(creator, ::ValidityBond::get())), - oracle: Some(Bond::new(creator, ::OracleBond::get())), - }; - let new_bonds = MarketBonds { - creation: Some(Bond::new(creator, ::ValidityBond::get())), - oracle: Some(Bond::new(creator, ::OracleBond::get())), - outsider: None, - }; - - let old_market = OldMarket { - base_asset, - creator, - creation: creation.clone(), - creator_fee, - oracle, - metadata: metadata.clone(), - market_type: market_type.clone(), - period: period.clone(), - scoring_rule, - status, - report: report.clone(), - resolved_outcome: resolved_outcome.clone(), - dispute_mechanism: dispute_mechanism.clone(), - deadlines, - bonds: old_bonds, - }; - let new_market = Market { - base_asset, - creator, - creation, - creator_fee, - oracle, - metadata, - market_type, - period, - scoring_rule, - status, - report, - resolved_outcome, - dispute_mechanism, - deadlines, - bonds: new_bonds, - }; - (vec![old_market], vec![new_market]) - } - - #[allow(unused)] - fn populate_test_data(pallet: &[u8], prefix: &[u8], data: Vec) - where - H: StorageHasher, - K: TryFrom + Encode, - V: Encode + Clone, - >::Error: Debug, - { - for (key, value) in data.iter().enumerate() { - let storage_hash = utility::key_to_hash::(K::try_from(key).unwrap()); - put_storage_value::(pallet, prefix, &storage_hash, (*value).clone()); - } - } -} - -// We use these utilities to prevent having to make the swaps pallet a dependency of -// prediciton-markets. The calls are based on the implementation of `StorageVersion`, found here: -// https://github.com/paritytech/substrate/blob/bc7a1e6c19aec92bfa247d8ca68ec63e07061032/frame/support/src/traits/metadata.rs#L168-L230 -// and previous migrations. - -mod utility { - use crate::{BalanceOf, Config, MarketIdOf}; - use alloc::vec::Vec; - use frame_support::{ - migration::{get_storage_value, put_storage_value}, - storage::{storage_prefix, unhashed}, - traits::StorageVersion, - Blake2_128Concat, StorageHasher, - }; - use parity_scale_codec::Encode; - use zeitgeist_primitives::types::{Pool, PoolId}; - - #[allow(unused)] - const SWAPS: &[u8] = b"Swaps"; - #[allow(unused)] - const POOLS: &[u8] = b"Pools"; - #[allow(unused)] - fn storage_prefix_of_swaps_pallet() -> [u8; 32] { - storage_prefix(b"Swaps", b":__STORAGE_VERSION__:") - } - #[allow(unused)] - pub fn key_to_hash(key: K) -> Vec - where - H: StorageHasher, - K: Encode, - { - key.using_encoded(H::hash).as_ref().to_vec() - } - #[allow(unused)] - pub fn get_on_chain_storage_version_of_swaps_pallet() -> StorageVersion { - let key = storage_prefix_of_swaps_pallet(); - unhashed::get_or_default(&key) - } - #[allow(unused)] - pub fn put_storage_version_of_swaps_pallet(value: u16) { - let key = storage_prefix_of_swaps_pallet(); - unhashed::put(&key, &StorageVersion::new(value)); - } - #[allow(unused)] - pub fn get_pool(pool_id: PoolId) -> Option, MarketIdOf>> { - let hash = key_to_hash::(pool_id); - let pool_maybe = - get_storage_value::, MarketIdOf>>>(SWAPS, POOLS, &hash); - pool_maybe.unwrap_or(None) - } - #[allow(unused)] - pub fn set_pool(pool_id: PoolId, pool: Pool, MarketIdOf>) { - let hash = key_to_hash::(pool_id); - put_storage_value(SWAPS, POOLS, &hash, Some(pool)); - } -} From 31b7d642f9fff31da1e32d0963f23760d94beddf Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Thu, 6 Jul 2023 16:30:32 +0530 Subject: [PATCH 51/53] RPC for querying prices for all assets of given pool_id. (#971) * Swaps: Add new rpc get_asset_spot_prices_for_pool * Remove unnecessary Decode bounds * Update copyright notices --------- Co-authored-by: Malte Kliemann --- Cargo.lock | 1 + node/src/chain_spec/battery_station.rs | 3 +- node/src/chain_spec/dev.rs | 6 +- runtime/battery-station/src/lib.rs | 5 +- runtime/common/src/lib.rs | 7 +++ runtime/zeitgeist/src/lib.rs | 5 +- zrml/swaps/rpc/src/lib.rs | 49 +++++++++++++++- zrml/swaps/runtime-api/Cargo.toml | 1 + zrml/swaps/runtime-api/src/lib.rs | 17 ++++-- zrml/swaps/src/lib.rs | 20 ++++++- zrml/swaps/src/mock.rs | 10 +++- zrml/swaps/src/tests.rs | 81 ++++++++++++++++++++++++++ 12 files changed, 191 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16a2d3e26..d9589ea46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13365,6 +13365,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime", + "sp-std", "zeitgeist-primitives", ] diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index 2da6d4c22..e7424c51e 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -40,8 +40,7 @@ use { CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, DefaultParachainBondReservePercent, EligibilityValue, PolkadotXcmConfig, }, - zeitgeist_primitives::constants::ztg::STAKING_PTD, - zeitgeist_primitives::constants::ztg::TOTAL_INITIAL_ZTG, + zeitgeist_primitives::constants::ztg::{STAKING_PTD, TOTAL_INITIAL_ZTG}, }; cfg_if::cfg_if! { diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index af6972c9d..b9c303920 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -38,8 +38,10 @@ use zeitgeist_primitives::{ use { super::battery_station::inflation_config, sp_runtime::Perbill, - zeitgeist_primitives::constants::ztg::STAKING_PTD, - zeitgeist_primitives::constants::{ztg::TOTAL_INITIAL_ZTG, BASE}, + zeitgeist_primitives::constants::{ + ztg::{STAKING_PTD, TOTAL_INITIAL_ZTG}, + BASE, + }, }; const INITIAL_BALANCE: Balance = Balance::MAX >> 4; diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 4b9f52690..972a6f08e 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -48,7 +48,10 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_collective::{EnsureProportionAtLeast, PrimeDefaultVote}; use pallet_transaction_payment::ChargeTransactionPayment; -use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}; +use sp_runtime::{ + traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}, + DispatchError, +}; #[cfg(feature = "std")] use sp_version::NativeVersion; use substrate_fixed::{types::extra::U33, FixedI128, FixedU128}; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 73dfad19f..051cdba12 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -1591,6 +1591,13 @@ macro_rules! create_runtime_api { fn pool_shares_id(pool_id: PoolId) -> Asset> { Asset::PoolShare(SerdeWrapper(pool_id)) } + + fn get_all_spot_prices( + pool_id: &PoolId, + with_fees: bool, + ) -> Result, Balance)>, DispatchError> { + Swaps::get_all_spot_prices(pool_id, with_fees) + } } #[cfg(feature = "try-runtime")] diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 198289982..66b965fe2 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -47,7 +47,10 @@ use frame_support::{ use frame_system::EnsureRoot; use pallet_collective::{EnsureProportionAtLeast, EnsureProportionMoreThan, PrimeDefaultVote}; use pallet_transaction_payment::ChargeTransactionPayment; -use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}; +use sp_runtime::{ + traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}, + DispatchError, +}; #[cfg(feature = "std")] use sp_version::NativeVersion; use substrate_fixed::{types::extra::U33, FixedI128, FixedU128}; diff --git a/zrml/swaps/rpc/src/lib.rs b/zrml/swaps/rpc/src/lib.rs index a694d908d..403d1da39 100644 --- a/zrml/swaps/rpc/src/lib.rs +++ b/zrml/swaps/rpc/src/lib.rs @@ -34,6 +34,7 @@ use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, MaybeDisplay, MaybeFromStr, NumberFor}, }; +use std::collections::BTreeMap; use zeitgeist_primitives::types::{Asset, SerdeWrapper}; pub use zrml_swaps_runtime_api::SwapsApi as SwapsRuntimeApi; @@ -42,8 +43,9 @@ pub use zrml_swaps_runtime_api::SwapsApi as SwapsRuntimeApi; pub trait SwapsApi where Balance: FromStr + Display + parity_scale_codec::MaxEncodedLen, - MarketId: FromStr + Display + parity_scale_codec::MaxEncodedLen, + MarketId: FromStr + Display + parity_scale_codec::MaxEncodedLen + Ord, PoolId: FromStr + Display, + BlockNumber: Ord + parity_scale_codec::MaxEncodedLen + Display + FromStr, { #[method(name = "swaps_poolSharesId", aliases = ["swaps_poolSharesIdAt"])] async fn pool_shares_id( @@ -75,6 +77,14 @@ where with_fees: bool, blocks: Vec, ) -> RpcResult>>; + + #[method(name = "swaps_getAllSpotPrices")] + async fn get_all_spot_prices( + &self, + pool_id: PoolId, + with_fees: bool, + blocks: Vec, + ) -> RpcResult, Balance)>>>; } /// A struct that implements the [`SwapsApi`]. @@ -110,12 +120,13 @@ impl for Swaps where Block: BlockT, + NumberFor: MaxEncodedLen, C: Send + Sync + 'static + ProvideRuntimeApi + HeaderBackend, C::Api: SwapsRuntimeApi, PoolId: Clone + Codec + MaybeDisplay + MaybeFromStr + Send + 'static, AccountId: Clone + Display + Codec + Send + 'static, Balance: Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen + Send + 'static, - MarketId: Clone + Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen + Send + 'static, + MarketId: Clone + Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen + Ord + Send + 'static, { async fn pool_shares_id( &self, @@ -205,4 +216,38 @@ where }) .collect() } + + async fn get_all_spot_prices( + &self, + pool_id: PoolId, + with_fees: bool, + blocks: Vec>, + ) -> RpcResult, Vec<(Asset, Balance)>>> { + let api = self.client.runtime_api(); + Ok(blocks + .into_iter() + .map( + |block| -> Result<(NumberFor, Vec<(Asset, Balance)>), CallError> { + let hash = BlockId::number(block); + let prices: Vec<(Asset, Balance)> = api + .get_all_spot_prices(&hash, &pool_id, with_fees) + .map_err(|e| { + CallError::Custom(ErrorObject::owned( + Error::RuntimeError.into(), + "Unable to get_all_spot_prices: ApiError.", + Some(format!("{:?}", e)), + )) + })? + .map_err(|e| { + CallError::Custom(ErrorObject::owned( + Error::RuntimeError.into(), + "Unable to get_all_spot_prices: DispatchError.", + Some(format!("{:?}", e)), + )) + })?; + Ok((block, prices)) + }, + ) + .collect::, _>>()?) + } } diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index ea643fcc8..d26bd0a3f 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -2,6 +2,7 @@ parity-scale-codec = { default-features = false, features = ["derive", "max-encoded-len"], version = "3.0.0" } sp-api = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } sp-runtime = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } +sp-std = { branch = "polkadot-v0.9.32", default-features = false, git = "https://github.com/paritytech/substrate" } zeitgeist-primitives = { default-features = false, path = "../../../primitives" } [features] diff --git a/zrml/swaps/runtime-api/src/lib.rs b/zrml/swaps/runtime-api/src/lib.rs index 50aa9264e..437b0a53d 100644 --- a/zrml/swaps/runtime-api/src/lib.rs +++ b/zrml/swaps/runtime-api/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -19,9 +19,13 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] -use parity_scale_codec::{Codec, MaxEncodedLen}; -use sp_runtime::traits::{MaybeDisplay, MaybeFromStr}; -use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use parity_scale_codec::{Codec, Decode, MaxEncodedLen}; +use sp_runtime::{ + traits::{MaybeDisplay, MaybeFromStr}, + DispatchError, +}; +use sp_std::vec::Vec; +use zeitgeist_primitives::types::{Asset, Pool, SerdeWrapper}; sp_api::decl_runtime_apis! { pub trait SwapsApi where @@ -29,6 +33,7 @@ sp_api::decl_runtime_apis! { AccountId: Codec, Balance: Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen, MarketId: Codec + MaxEncodedLen, + Pool: Decode, { fn pool_shares_id(pool_id: PoolId) -> Asset>; fn pool_account_id(pool_id: &PoolId) -> AccountId; @@ -38,5 +43,9 @@ sp_api::decl_runtime_apis! { asset_out: &Asset, with_fees: bool, ) -> SerdeWrapper; + fn get_all_spot_prices( + pool_id: &PoolId, + with_fees: bool + ) -> Result, Balance)>, DispatchError>; } } diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index 9ae019eab..995c049c7 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -1460,6 +1460,24 @@ mod pallet { } } + // Returns vector of pairs `(a, p)` where `a` ranges over all assets in the pool and `p` is + // the spot price of swapping the base asset for `a` (including swap fees if `with_fees` is + // `true`). + pub fn get_all_spot_prices( + pool_id: &PoolId, + with_fees: bool, + ) -> Result>, BalanceOf)>, DispatchError> { + let pool = Self::pool_by_id(*pool_id)?; + pool.assets + .into_iter() + .map(|asset| { + let spot_price = + Self::get_spot_price(pool_id, &pool.base_asset, &asset, with_fees)?; + Ok((asset, spot_price)) + }) + .collect() + } + #[inline] pub fn pool_account_id(pool_id: &PoolId) -> T::AccountId { T::PalletId::get().into_sub_account_truncating((*pool_id).saturated_into::()) @@ -1573,7 +1591,7 @@ mod pallet { Asset::PoolShare(SerdeWrapper(pool_id)) } - pub(crate) fn pool_by_id( + pub fn pool_by_id( pool_id: PoolId, ) -> Result, MarketIdOf>, DispatchError> where diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index 76a170afd..91d8ff17a 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2023 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -33,6 +33,7 @@ use frame_support::{construct_runtime, parameter_types, traits::Everything}; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, + DispatchError, }; use substrate_fixed::{types::extra::U33, FixedI128, FixedU128}; use zeitgeist_primitives::{ @@ -248,5 +249,12 @@ sp_api::mock_impl_runtime_apis! { fn pool_shares_id(pool_id: PoolId) -> Asset> { Asset::PoolShare(SerdeWrapper(pool_id)) } + + fn get_all_spot_prices( + pool_id: &PoolId, + with_fees: bool + ) -> Result, Balance)>, DispatchError> { + Swaps::get_all_spot_prices(pool_id, with_fees) + } } } diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index 3b33b495b..57d3f4f86 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -23,6 +23,7 @@ // . #![cfg(all(feature = "mock", test))] +#![allow(clippy::too_many_arguments)] use crate::{ events::{CommonPoolEventParams, PoolAssetEvent, PoolAssetsEvent, SwapEvent}, @@ -779,6 +780,86 @@ fn get_spot_price_returns_correct_results_rikiddo() { }); } +#[test] +fn get_all_spot_price_returns_correct_results_rikiddo() { + ExtBuilder::default().build().execute_with(|| { + create_initial_pool(ScoringRule::RikiddoSigmoidFeeMarketEma, None, false); + let pool_id = 0; + assert_noop!( + Swaps::get_spot_price(&pool_id, &ASSETS[0], &ASSETS[0], true), + crate::Error::::PoolIsNotActive + ); + subsidize_and_start_rikiddo_pool(pool_id, &ALICE, 0); + + let prices = + Swaps::get_all_spot_prices(&pool_id, false).expect("get_all_spot_prices fails"); + // Base currency in, asset out. + // Price Between 0.3 and 0.4 + for (asset, price) in prices { + // ASSETS.last() is base_asset + if asset != *ASSETS.last().expect("no last asset") { + assert!(price > 3 * BASE / 10 && price < 4 * BASE / 10); + } + } + }); +} + +#[test_case(_3, _3, _2, _2, 0, 15_000_000_000, 15_000_000_000, 10_000_000_000, 10_000_000_000)] +#[test_case(_3, _3, _1, _3, 0, 10_000_000_000, 10_000_000_000, 3_333_333_333, 10_000_000_000)] +#[test_case(_3, _4, _1, _1, 0, 30_000_000_000, 40_000_000_000, 10_000_000_000, 10_000_000_000)] +#[test_case(_3, _4, _10, _4, 0, 7_500_000_000, 10_000_000_000, 25_000_000_000, 10_000_000_000)] +#[test_case(_3, _6, _4, _5, 0, 6_000_000_000, 12_000_000_000, 8_000_000_000, 10_000_000_000)] +#[test_case(_3, _3, _4, _5, 0, 6_000_000_000, 6_000_000_000, 8_000_000_000, 10_000_000_000)] +#[test_case(_3, _3, _10, _10, _1_10, 3_333_333_333, 3_333_333_333, 11_111_111_111, 11_111_111_111)] +#[test_case(_3, _3, _10, _5, _1_10, 6_666_666_667, 6_666_666_667, 22_222_222_222, 11_111_111_111)] +#[test_case(_3, _4, _10, _10, _1_10, 3_333_333_333, 4_444_444_444, 11_111_111_111, 11_111_111_111)] +#[test_case(_3, _4, _10, _5, _1_10, 6_666_666_667, 8_888_888_889, 22_222_222_222, 11_111_111_111)] +#[test_case(_3, _6, _2, _5, _1_10, 6_666_666_667, 13_333_333_333, 4_444_444_444, 11_111_111_111)] +#[test_case(_3, _6, _2, _10, _1_10, 3_333_333_333, 6_666_666_667, 2_222_222_222, 11_111_111_111)] +fn get_all_spot_prices_returns_correct_results_cpmm( + weight_a: u128, + weight_b: u128, + weight_c: u128, + weight_d: u128, + swap_fee: BalanceOf, + exp_spot_price_a_with_fees: BalanceOf, + exp_spot_price_b_with_fees: BalanceOf, + exp_spot_price_c_with_fees: BalanceOf, + exp_spot_price_d_with_fees: BalanceOf, +) { + ExtBuilder::default().build().execute_with(|| { + ASSETS.iter().cloned().for_each(|asset| { + assert_ok!(Currencies::deposit(asset, &BOB, _100)); + }); + assert_ok!(Swaps::create_pool( + BOB, + ASSETS.to_vec(), + *ASSETS.last().unwrap(), + 0, + ScoringRule::CPMM, + Some(swap_fee), + Some(_100), + Some(vec!(weight_a, weight_b, weight_c, weight_d)) + )); + let pool_id = 0; + + // Gets spot prices for all assets against base_asset. + let prices = + Swaps::get_all_spot_prices(&pool_id, true).expect("get_all_spot_prices failed"); + for (asset, price) in prices { + if asset == ASSET_A { + assert_eq!(exp_spot_price_a_with_fees, price); + } else if asset == ASSET_B { + assert_eq!(exp_spot_price_b_with_fees, price); + } else if asset == ASSET_C { + assert_eq!(exp_spot_price_c_with_fees, price); + } else if asset == ASSET_D { + assert_eq!(exp_spot_price_d_with_fees, price); + } + } + }); +} + #[test] fn in_amount_must_be_equal_or_less_than_max_in_ratio() { ExtBuilder::default().build().execute_with(|| { From cf141bf25e9e0ba7378eb1f93c90572ee32dee41 Mon Sep 17 00:00:00 2001 From: Vivek Pandya Date: Fri, 7 Jul 2023 14:09:39 +0530 Subject: [PATCH 52/53] Add simple mergify config. It uses branch protection rules from github configuration. (#777) * Add simple mergify config. It uses branch protection rules from github configuration. * Add rules to check accpeted label and remove in-progress and review-needed lables when added to the queue in mergify * Add rule to send message when PR has conflicts --------- Co-authored-by: Harald Heckmann --- .mergify.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 000000000..000207e07 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,25 @@ +pull_request_rules: + - name: Auto merge + conditions: + - base=main + - "#approved-reviews-by>=1" + - "#changes-requested-reviews-by=0" + - check-success=format + - check-success=tests + - check-success=fuzz + - check-success=benchmark + - label=s:accepted + actions: + label: + remove: + - s:in-progress + - s:review-needed + merge: + method: squash + - name: ask to resolve conflict + conditions: + - conflict + actions: + comment: + message: This pull request is now in conflicts. Could you fix it @{{author}}? 🙏 + From be494e49151d38b8e78b4b8156a3ac3bd02a0006 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 10 Jul 2023 14:17:47 +0200 Subject: [PATCH 53/53] Improve license checker error message (#1039) Improve error message --- scripts/check-license/src/check_license/check_license.py | 6 +++--- scripts/check-license/src/check_license/console.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/check-license/src/check_license/check_license.py b/scripts/check-license/src/check_license/check_license.py index f97b02181..e889b3bec 100644 --- a/scripts/check-license/src/check_license/check_license.py +++ b/scripts/check-license/src/check_license/check_license.py @@ -5,7 +5,7 @@ import re import os -from check_license.console import echo +from check_license.console import echo_error from check_license.copyright import Copyright, CopyrightError from check_license.errors import ( LicenseCheckerError, @@ -110,7 +110,7 @@ def check_files(year: int, files: list[str]) -> bool: f.read() f.check(year) except LicenseCheckerError as e: - echo(str(e)) + echo_error(str(e)) result = True return result @@ -126,6 +126,6 @@ def update_files(year: int, files: list[str]) -> tuple[bool, int]: f.write() count += changed except LicenseCheckerError as e: - echo(str(e)) + echo_error(str(e)) result = True return result, count diff --git a/scripts/check-license/src/check_license/console.py b/scripts/check-license/src/check_license/console.py index e618d64a5..fe609480f 100644 --- a/scripts/check-license/src/check_license/console.py +++ b/scripts/check-license/src/check_license/console.py @@ -5,3 +5,8 @@ def echo(msg: str) -> None: click.echo(msg) + + +def echo_error(msg: str) -> None: + click.echo(click.style("error: ", fg="red"), nl=False) + click.echo(msg)