Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Prepare Trappist v1.1.0 release #308

Merged
merged 9 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/try-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
echo "---------- Running try-runtime for Trappist ----------"
cargo build -p trappist --locked --release --no-default-features --features trappist/trappist-runtime,try-runtime && \
try-runtime --runtime ./target/release/wbuild/trappist-runtime/target/wasm32-unknown-unknown/release/trappist_runtime.wasm \
on-runtime-upgrade live --uri wss://rococo-trappist-try-runtime-node.parity-chains.parity.io:443
on-runtime-upgrade --checks pre-and-post --disable-idempotency-checks live --uri wss://rococo-trappist-try-runtime-node.parity-chains.parity.io:443
env:
RUST_LOG: remote-ext=debug,runtime=debug
4 changes: 4 additions & 0 deletions node/src/chain_spec/trappist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ pub fn testnet_genesis(
},
treasury: Default::default(),
lockdown_mode: LockdownModeConfig { initial_status: false, ..Default::default() },
dex: Default::default(),
transaction_payment: Default::default(),
}
}

Expand Down Expand Up @@ -329,5 +331,7 @@ fn trappist_live_genesis(
},
treasury: Default::default(),
lockdown_mode: Default::default(),
dex: Default::default(),
transaction_payment: Default::default(),
}
}
5 changes: 2 additions & 3 deletions pallets/withdraw-teleport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ use frame_support::{
traits::{Contains, EnsureOrigin, Get},
};
use frame_system::pallet_prelude::OriginFor;
use log;
pub use pallet::*;
use pallet_xcm::WeightInfo as XcmWeightInfo;
use pallet_xcm::WeightInfo as RuntimeXcmWeightInfo;
use parity_scale_codec::Encode;
use sp_std::{boxed::Box, vec};
pub use xcm::{
Expand Down Expand Up @@ -191,7 +190,7 @@ impl<T: Config> Pallet<T> {
// Reanchor the fee asset to the destination chain.
let fee_asset_item: usize = 0;
let fees = fee_asset
.get(fee_asset_item as usize)
.get(fee_asset_item)
.ok_or(pallet_xcm::Error::<T>::Empty)?
.clone()
.reanchored(&dest, context)
Expand Down
8 changes: 4 additions & 4 deletions primitives/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use frame_support::{
use sp_runtime::traits::MaybeEquivalence;
#[cfg(not(test))]
use sp_runtime::DispatchResult;
use sp_std::{borrow::Borrow, marker::PhantomData};
use sp_std::marker::PhantomData;
use xcm::{
latest::{
AssetId::Concrete, Fungibility::Fungible, Junctions::Here, MultiAsset, MultiLocation,
Expand All @@ -47,7 +47,7 @@ where
AssetIdInfoGetter: AssetMultiLocationGetter<AssetId>,
{
fn convert(asset_multi_location: &MultiLocation) -> Option<AssetId> {
AssetIdInfoGetter::get_asset_id(asset_multi_location.borrow())
AssetIdInfoGetter::get_asset_id(asset_multi_location)
}

fn convert_back(asset_id: &AssetId) -> Option<MultiLocation> {
Expand Down Expand Up @@ -76,9 +76,9 @@ impl<
(Fungible(ref amount), Concrete(ref id)) => (amount, id),
_ => return Err(MatchError::AssetNotHandled),
};
let what = ConvertAssetId::convert(id).ok_or_else(|| MatchError::AssetNotHandled)?;
let what = ConvertAssetId::convert(id).ok_or(MatchError::AssetNotHandled)?;
let amount = ConvertBalance::convert_back(amount)
.ok_or_else(|| MatchError::AmountToBalanceConversionFailed)?;
.ok_or(MatchError::AmountToBalanceConversionFailed)?;
Ok((what, amount))
}
}
Expand Down
4 changes: 1 addition & 3 deletions runtime/stout/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ use frame_support::{
parameter_types,
traits::{ConstU32, Nothing},
};
#[cfg(feature = "runtime-benchmarks")]
use pallet_contracts::NoopMigration;
use pallet_contracts::{
weights::SubstrateWeight, Config, DebugInfo, DefaultAddressGenerator, Frame, Schedule,
};
Expand Down Expand Up @@ -73,7 +71,7 @@ impl Config for Runtime {
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = ();
#[cfg(feature = "runtime-benchmarks")]
type Migrations = (NoopMigration<1>, NoopMigration<2>);
type Migrations = pallet_contracts::migration::codegen::BenchMigrations;
type MaxDelegateDependencies = ConstU32<32>;
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type Debug = ();
Expand Down
2 changes: 1 addition & 1 deletion runtime/stout/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("stout-rococo"),
impl_name: create_runtime_str!("stout-rococo"),
authoring_version: 1,
spec_version: 10000,
spec_version: 11000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down
15 changes: 7 additions & 8 deletions runtime/trappist/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ use frame_support::{
parameter_types,
traits::{ConstBool, ConstU32, Nothing},
};
#[cfg(feature = "runtime-benchmarks")]
use pallet_contracts::NoopMigration;
use pallet_contracts::{
migration::{v13, v14, v15},
Config, DebugInfo, DefaultAddressGenerator, Frame, Schedule,
};
use pallet_contracts::{Config, DebugInfo, DefaultAddressGenerator, Frame, Schedule};
pub use parachains_common::AVERAGE_ON_INITIALIZE_RATIO;
use sp_runtime::Perbill;

Expand Down Expand Up @@ -71,9 +66,13 @@ impl Config for Runtime {
type UnsafeUnstableInterface = ConstBool<true>;
type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>;
#[cfg(not(feature = "runtime-benchmarks"))]
type Migrations = (v13::Migration<Self>, v14::Migration<Self, Balances>, v15::Migration<Self>);
type Migrations = (
pallet_contracts::migration::v13::Migration<Self>,
pallet_contracts::migration::v14::Migration<Self, Balances>,
pallet_contracts::migration::v15::Migration<Self>,
);
#[cfg(feature = "runtime-benchmarks")]
type Migrations = (NoopMigration<1>, NoopMigration<2>);
type Migrations = pallet_contracts::migration::codegen::BenchMigrations;
type MaxDelegateDependencies = ConstU32<32>;
type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent;
type Debug = ();
Expand Down
84 changes: 26 additions & 58 deletions runtime/trappist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(migrations::SetStorageVersions, pallet_contracts::Migration<Runtime>),
pallet_contracts::Migration<Runtime>,
>;

impl_opaque_keys! {
Expand All @@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("trappist-rococo"),
impl_name: create_runtime_str!("trappist-rococo"),
authoring_version: 1,
spec_version: 10100,
spec_version: 11000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down Expand Up @@ -230,7 +230,7 @@ impl pallet_balances::Config for Runtime {
type FreezeIdentifier = ();
type MaxLocks = ConstU32<50>;
type MaxReserves = ConstU32<50>;
type MaxHolds = ConstU32<0>;
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<0>;
}

Expand Down Expand Up @@ -667,31 +667,29 @@ impl pallet_lockdown_mode::Config for Runtime {
construct_runtime!(
pub struct Runtime {
// System support stuff.
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>} = 0,
ParachainSystem: cumulus_pallet_parachain_system::{
Pallet, Call, Config<T>, Storage, Inherent, Event<T>, ValidateUnsigned,
} = 1,
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage} = 2,
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3,
ParachainInfo: parachain_info::{Pallet, Storage, Config<T>} = 4,
System: frame_system = 0,
ParachainSystem: cumulus_pallet_parachain_system = 1,
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip = 2,
Timestamp: pallet_timestamp = 3,
ParachainInfo: parachain_info = 4,

// Monetary stuff.
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 10,
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>} = 11,
AssetTxPayment: pallet_asset_tx_payment::{Pallet, Storage, Event<T>} = 12,
Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment = 11,
AssetTxPayment: pallet_asset_tx_payment = 12,

// Collator support. The order of these 5 are important and shall not change.
Authorship: pallet_authorship::{Pallet, Storage} = 20,
CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 21,
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 22,
Aura: pallet_aura::{Pallet, Storage, Config<T>} = 23,
AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config<T>} = 24,
Authorship: pallet_authorship = 20,
CollatorSelection: pallet_collator_selection = 21,
Session: pallet_session = 22,
Aura: pallet_aura = 23,
AuraExt: cumulus_pallet_aura_ext = 24,

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
XcmpQueue: cumulus_pallet_xcmp_queue = 30,
PolkadotXcm: pallet_xcm = 31,
CumulusXcm: cumulus_pallet_xcm = 32,
DmpQueue: cumulus_pallet_dmp_queue = 33,

// Runtime features
Contracts: pallet_contracts = 40,
Expand All @@ -703,54 +701,24 @@ construct_runtime!(
LockdownMode: pallet_lockdown_mode = 46,

// Handy utilities.
Utility: pallet_utility::{Pallet, Call, Event} = 50,
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 51,
Utility: pallet_utility = 50,
Multisig: pallet_multisig = 51,

// Governance related
Council: pallet_collective::<Instance1> = 60,
Treasury: pallet_treasury::{Pallet, Call, Storage, Config<T>, Event<T>} = 61,
Treasury: pallet_treasury = 61,
Democracy: pallet_democracy = 62,

// Sudo
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Event<T>, Storage} = 100,
Sudo: pallet_sudo = 100,

// Additional pallets
Dex: pallet_dex::{Pallet, Call, Storage, Event<T>} = 110,
AssetRegistry: pallet_asset_registry::{Pallet, Call, Storage, Event<T>} = 111,
Dex: pallet_dex = 110,
AssetRegistry: pallet_asset_registry = 111,
WithdrawTeleport: pallet_withdraw_teleport = 112,
}
);

pub mod migrations {
use super::*;
use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion};

/// Migrations that set `StorageVersion`s we missed to set.
///
/// It's *possible* that these pallets have not in fact been migrated to the versions being set,
/// which we should keep in mind in the future if we notice any strange behavior.
/// We opted to not check exactly what on-chain versions each pallet is at, since it would be
/// an involved effort, this is testnet, and no one has complained
/// (https://github.com/paritytech/polkadot-sdk/issues/6657#issuecomment-1552956439).
pub struct SetStorageVersions;

impl OnRuntimeUpgrade for SetStorageVersions {
fn on_runtime_upgrade() -> Weight {
let mut writes = 0;
let mut reads = 0;

// Scheduler
if Scheduler::on_chain_storage_version() < 4 {
StorageVersion::new(4).put::<Scheduler>();
writes += 1;
}
reads += 1;

RocksDbWeight::get().reads_writes(reads, writes)
}
}
}

#[cfg(feature = "runtime-benchmarks")]
mod benches {
define_benchmarks!(
Expand Down
20 changes: 10 additions & 10 deletions runtime/trappist/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-04 (Y/M/D)
//! HOSTNAME: `runner-nbnwcyh-project-647-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! DATE: 2023-11-23 (Y/M/D)
//! HOSTNAME: `runner-yprdrvc7-project-647-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//!
//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Trappist Development`
//! WARMUPS: `10`, REPEAT: `100`
Expand All @@ -43,17 +43,17 @@ parameter_types! {
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 403_736, 438_006
/// Average: 412_652
/// Median: 411_401
/// Std-Dev: 6866.93
/// Min, Max: 447_366, 526_695
/// Average: 459_297
/// Median: 457_640
/// Std-Dev: 10132.49
///
/// Percentiles nanoseconds:
/// 99th: 432_567
/// 95th: 426_122
/// 75th: 414_441
/// 99th: 488_385
/// 95th: 472_317
/// 75th: 461_741
pub const BlockExecutionWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(412_652), 0);
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(459_297), 0);
}

#[cfg(test)]
Expand Down
14 changes: 7 additions & 7 deletions runtime/trappist/src/weights/cumulus_pallet_xcmp_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-11-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-nbnwcyh-project-647-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("trappist-dev")`, DB CACHE: 1024
//! HOSTNAME: `runner-yprdrvc7-project-647-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("trappist-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/trappist-node
Expand Down Expand Up @@ -56,8 +56,8 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1561`
// Minimum execution time: 6_055_000 picoseconds.
Weight::from_parts(6_437_000, 0)
// Minimum execution time: 5_938_000 picoseconds.
Weight::from_parts(6_180_000, 0)
.saturating_add(Weight::from_parts(0, 1561))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand All @@ -68,8 +68,8 @@ impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightIn
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1561`
// Minimum execution time: 6_137_000 picoseconds.
Weight::from_parts(6_381_000, 0)
// Minimum execution time: 5_884_000 picoseconds.
Weight::from_parts(6_215_000, 0)
.saturating_add(Weight::from_parts(0, 1561))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
Expand Down
20 changes: 10 additions & 10 deletions runtime/trappist/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-04 (Y/M/D)
//! HOSTNAME: `runner-nbnwcyh-project-647-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! DATE: 2023-11-23 (Y/M/D)
//! HOSTNAME: `runner-yprdrvc7-project-647-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//!
//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Trappist Development`
//! WARMUPS: `10`, REPEAT: `100`
Expand All @@ -43,17 +43,17 @@ parameter_types! {
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 131_387, 134_063
/// Average: 132_612
/// Median: 132_584
/// Std-Dev: 547.8
/// Min, Max: 131_832, 133_579
/// Average: 132_564
/// Median: 132_483
/// Std-Dev: 415.24
///
/// Percentiles nanoseconds:
/// 99th: 134_021
/// 95th: 133_497
/// 75th: 132_981
/// 99th: 133_410
/// 95th: 133_243
/// 75th: 132_871
pub const ExtrinsicBaseWeight: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(132_612), 0);
Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(132_564), 0);
}

#[cfg(test)]
Expand Down
Loading