Skip to content

Commit

Permalink
update new asset-hub-rococo-runtime with rococo-specific components
Browse files Browse the repository at this point in the history
  • Loading branch information
acatangiu committed Sep 8, 2023
1 parent d6044a0 commit ec28f46
Show file tree
Hide file tree
Showing 25 changed files with 100 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "asset-hub-rococo-runtime"
version = "0.9.420"
authors.workspace = true
edition.workspace = true
description = "Kusama variant of Asset Hub parachain runtime"
description = "Rococo variant of Asset Hub parachain runtime"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
Expand Down Expand Up @@ -55,7 +55,7 @@ sp-weights = { path = "../../../../../substrate/primitives/weights", default-fea
primitive-types = { version = "0.12.1", default-features = false, features = ["codec", "scale-info", "num-traits"] }

# Polkadot
kusama-runtime-constants = { path = "../../../../../polkadot/runtime/kusama/constants", default-features = false}
rococo-runtime-constants = { path = "../../../../../polkadot/runtime/rococo/constants", default-features = false}
pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false}
pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false}
Expand Down Expand Up @@ -174,7 +174,7 @@ std = [
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"frame-try-runtime?/std",
"kusama-runtime-constants/std",
"rococo-runtime-constants/std",
"log/std",
"pallet-asset-conversion-tx-payment/std",
"pallet-asset-conversion/std",
Expand Down
50 changes: 22 additions & 28 deletions cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! # Asset Hub Kusama Runtime
//! # Asset Hub Rococo Runtime
//!
//! Asset Hub Kusama, formerly known as "Statemine", is the canary network for its Polkadot cousin.
//! Asset Hub Rococo, formerly known as "Rockmine", is the test network for its Kusama cousin.

#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"]
Expand Down Expand Up @@ -69,16 +69,16 @@ use pallet_nfts::PalletFeatures;
pub use parachains_common as common;
use parachains_common::{
impls::DealWithFees,
kusama::{consensus::*, currency::*, fee::WeightToFee},
rococo::{consensus::*, currency::*, fee::WeightToFee},
AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, Hash, Header, Nonce,
Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT,
NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
use sp_runtime::RuntimeDebug;
use xcm::opaque::v3::MultiLocation;
use xcm_config::{
FellowshipLocation, ForeignAssetsConvertedConcreteId, GovernanceLocation, KsmLocation,
PoolAssetsConvertedConcreteId, TrustBackedAssetsConvertedConcreteId, XcmConfig,
FellowshipLocation, ForeignAssetsConvertedConcreteId, GovernanceLocation,
PoolAssetsConvertedConcreteId, RocLocation, TrustBackedAssetsConvertedConcreteId, XcmConfig,
};

#[cfg(any(feature = "std", test))]
Expand All @@ -105,11 +105,8 @@ impl_opaque_keys! {
#[cfg(feature = "state-trie-version-1")]
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
// Note: "statemine" is the legacy name for this chain. It has been renamed to
// "asset-hub-kusama". Many wallets/tools depend on the `spec_name`, so it remains "statemine"
// for the time being. Wallets/tools should update to treat "asset-hub-kusama" equally.
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
spec_name: create_runtime_str!("asset-hub-rococo"),
impl_name: create_runtime_str!("asset-hub-rococo"),
authoring_version: 1,
spec_version: 10000,
impl_version: 0,
Expand All @@ -121,11 +118,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
#[cfg(not(feature = "state-trie-version-1"))]
#[sp_version::runtime_version]
pub const VERSION: RuntimeVersion = RuntimeVersion {
// Note: "statemine" is the legacy name for this change. It has been renamed to
// "asset-hub-kusama". Many wallets/tools depend on the `spec_name`, so it remains "statemine"
// for the time being. Wallets/tools should update to treat "asset-hub-kusama" equally.
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
spec_name: create_runtime_str!("asset-hub-rococo"),
impl_name: create_runtime_str!("asset-hub-rococo"),
authoring_version: 1,
spec_version: 10000,
impl_version: 0,
Expand Down Expand Up @@ -348,7 +342,7 @@ impl pallet_asset_conversion::Config for Runtime {
type MaxSwapPathLength = ConstU32<4>;
type MultiAssetId = Box<MultiLocation>;
type MultiAssetIdConverter =
MultiLocationConverter<KsmLocation, LocalAndForeignAssetsMultiLocationMatcher>;
MultiLocationConverter<RocLocation, LocalAndForeignAssetsMultiLocationMatcher>;
type MintMinLiquidity = ConstU128<100>;
type WeightInfo = weights::pallet_asset_conversion::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -1100,7 +1094,7 @@ impl_runtime_apis! {
{
let balance = Balances::free_balance(account.clone());
if balance > 0 {
vec![convert_balance::<KsmLocation, Balance>(balance)?]
vec![convert_balance::<RocLocation, Balance>(balance)?]
} else {
vec![]
}
Expand Down Expand Up @@ -1207,14 +1201,14 @@ impl_runtime_apis! {
impl cumulus_pallet_session_benchmarking::Config for Runtime {}

use xcm::latest::prelude::*;
use xcm_config::{KsmLocation, MaxAssetsIntoHolding};
use xcm_config::{RocLocation, MaxAssetsIntoHolding};
use pallet_xcm_benchmarks::asset_instance_from;

impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = xcm_config::XcmConfig;
type AccountIdConverter = xcm_config::LocationToAccountId;
fn valid_destination() -> Result<MultiLocation, BenchmarkError> {
Ok(KsmLocation::get())
Ok(RocLocation::get())
}
fn worst_case_holding(depositable_count: u32) -> MultiAssets {
// A mix of fungible, non-fungible, and concrete assets.
Expand All @@ -1236,7 +1230,7 @@ impl_runtime_apis! {
.collect::<Vec<_>>();

assets.push(MultiAsset {
id: Concrete(KsmLocation::get()),
id: Concrete(RocLocation::get()),
fun: Fungible(1_000_000 * UNITS),
});
assets.into()
Expand All @@ -1245,8 +1239,8 @@ impl_runtime_apis! {

parameter_types! {
pub const TrustedTeleporter: Option<(MultiLocation, MultiAsset)> = Some((
KsmLocation::get(),
MultiAsset { fun: Fungible(UNITS), id: Concrete(KsmLocation::get()) },
RocLocation::get(),
MultiAsset { fun: Fungible(UNITS), id: Concrete(RocLocation::get()) },
));
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
Expand All @@ -1261,7 +1255,7 @@ impl_runtime_apis! {

fn get_multi_asset() -> MultiAsset {
MultiAsset {
id: Concrete(KsmLocation::get()),
id: Concrete(RocLocation::get()),
fun: Fungible(UNITS),
}
}
Expand All @@ -1283,16 +1277,16 @@ impl_runtime_apis! {
}

fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
Ok((KsmLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
Ok((RocLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
}

fn subscribe_origin() -> Result<MultiLocation, BenchmarkError> {
Ok(KsmLocation::get())
Ok(RocLocation::get())
}

fn claimable_asset() -> Result<(MultiLocation, MultiLocation, MultiAssets), BenchmarkError> {
let origin = KsmLocation::get();
let assets: MultiAssets = (Concrete(KsmLocation::get()), 1_000 * UNITS).into();
let origin = RocLocation::get();
let assets: MultiAssets = (Concrete(RocLocation::get()), 1_000 * UNITS).into();
let ticket = MultiLocation { parents: 0, interior: Here };
Ok((origin, ticket, assets))
}
Expand Down Expand Up @@ -1397,7 +1391,7 @@ fn ensure_key_ss58() {
mod tests {
use super::*;
use crate::{CENTS, MILLICENTS};
use parachains_common::kusama::fee;
use parachains_common::rococo::fee;
use sp_runtime::traits::Zero;
use sp_weights::WeightToFee;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=cumulus_pallet_xcmp_queue
// --no-storage-info
Expand All @@ -37,7 +37,7 @@
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=frame_system
// --no-storage-info
Expand All @@ -37,7 +37,7 @@
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! DATE: 2023-07-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// target/production/polkadot-parachain
Expand All @@ -33,9 +33,9 @@
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/cumulus/.git/.artifacts/bench.json
// --pallet=pallet_asset_conversion
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! DATE: 2023-06-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/polkadot-parachain
Expand All @@ -42,7 +42,7 @@
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_assets
// --no-storage-info
Expand All @@ -37,7 +37,7 @@
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! DATE: 2023-07-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// target/production/polkadot-parachain
Expand All @@ -33,9 +33,9 @@
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/cumulus/.git/.artifacts/bench.json
// --pallet=pallet_assets
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_balances
// --no-storage-info
Expand All @@ -37,7 +37,7 @@
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-kusama-dev")`, DB CACHE: 1024
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=asset-hub-kusama-dev
// --chain=asset-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_collator_selection
// --no-storage-info
Expand All @@ -37,7 +37,7 @@
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand Down
Loading

0 comments on commit ec28f46

Please sign in to comment.