Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all 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
36 changes: 36 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ members = [
"xcm/xcm-builder",
"xcm/xcm-executor",
"xcm/pallet-xcm",
"xcm/pallet-xcm-benchmarks",
"node/client",
"node/collation-generation",
"node/core/approval-voting",
Expand Down
2 changes: 1 addition & 1 deletion node/core/av-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Implements a `AvailabilityStoreSubsystem`.

#![recursion_limit="256"]
#![recursion_limit = "256"]
#![warn(missing_docs)]

use std::collections::{HashMap, HashSet, BTreeSet};
Expand Down
2 changes: 1 addition & 1 deletion node/core/bitfield-signing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#![deny(unused_crate_dependencies)]
#![warn(missing_docs)]
#![recursion_limit="256"]
#![recursion_limit = "256"]

use futures::{channel::{mpsc, oneshot}, lock::Mutex, prelude::*, future, Future};
use sp_keystore::{Error as KeystoreError, SyncCryptoStorePtr};
Expand Down
2 changes: 1 addition & 1 deletion node/network/collator-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! This subsystem implements both sides of the collator protocol.

#![deny(missing_docs, unused_crate_dependencies)]
#![recursion_limit="256"]
#![recursion_limit = "256"]

use std::time::Duration;

Expand Down
6 changes: 4 additions & 2 deletions parachain/test-parachains/adder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
//! Basic parachain that adds a number as part of its state.

#![no_std]

#![cfg_attr(not(feature = "std"), feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler))]
#![cfg_attr(
not(feature = "std"),
feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler)
)]

use parity_scale_codec::{Encode, Decode};
use tiny_keccak::{Hasher as _, Keccak};
Expand Down
5 changes: 4 additions & 1 deletion parachain/test-parachains/halt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
//! Basic parachain that executes forever.

#![no_std]
#![cfg_attr(not(feature = "std"), feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler))]
#![cfg_attr(
not(feature = "std"),
feature(core_intrinsics, lang_items, core_panic_info, alloc_error_handler)
)]

// Make the WASM binary available.
#[cfg(feature = "std")]
Expand Down
1 change: 0 additions & 1 deletion primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//! Polkadot types shared between the runtime and the Node-side code.

#![warn(missing_docs)]

#![cfg_attr(not(feature = "std"), no_std)]

pub mod v0;
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub mod pallet_balances;
pub mod pallet_bounties;
pub mod pallet_collective;
pub mod pallet_democracy;
pub mod pallet_elections_phragmen;
pub mod pallet_election_provider_multi_phase;
pub mod pallet_elections_phragmen;
pub mod pallet_gilt;
pub mod pallet_identity;
pub mod pallet_im_online;
Expand Down
2 changes: 2 additions & 0 deletions runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-features = false, optional = true }

frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
Expand Down Expand Up @@ -199,6 +200,7 @@ runtime-benchmarks = [
"frame-system-benchmarking",
"hex-literal",
"xcm-builder/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
]
try-runtime = [
Expand Down
21 changes: 21 additions & 0 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,26 @@ sp_api::impl_runtime_apis! {
impl pallet_offences_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {}

use pallet_xcm_benchmarks::AsFungibles;
use xcm::v0::MultiAsset;

impl pallet_xcm_benchmarks::Config for Runtime {
type XcmConfig = XcmConfig;
type FungibleTransactAsset = Balances;

fn fungible_asset(amount: u32) -> Option<(MultiAsset, u128)> {
let amount: Balance = amount.into();
let amount = ExistentialDeposit::get() * amount;
Some((MultiAsset::ConcreteFungible { id: WndLocation::get(), amount }, amount))
}

// We pass in this adapter for the fungibles stuff, so our weights for fungibles
// will be quite similar to fungible, understandably. We don't need these weights
// anyways, westend does not have or use fungibles..
type FungiblesTransactAsset = AsFungibles<AccountId, u32, Balances>;
}
type XcmPalletBenchmarks= pallet_xcm_benchmarks::Pallet::<Runtime>;

let whitelist: Vec<TrackedStorageKey> = vec![
// Block Number
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
Expand Down Expand Up @@ -1493,6 +1513,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
add_benchmark!(params, batches, pallet_utility, Utility);
add_benchmark!(params, batches, pallet_vesting, Vesting);
add_benchmark!(params, batches, pallet_xcm_benchmarks, XcmPalletBenchmarks);

if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
let storage_info = AllPalletsWithSystem::storage_info();
Expand Down
1 change: 1 addition & 0 deletions xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ log = { version = "0.4.14", default-features = false }
[features]
default = ["std"]
wasm-api = []
runtime-benchmarks = []
std = [
"parity-scale-codec/std",
]
45 changes: 45 additions & 0 deletions xcm/pallet-xcm-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[package]
name = "pallet-xcm-benchmarks"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
version = "0.9.8"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
frame-support = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" }
frame-system = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" }
sp-runtime = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" }
sp-std = { version = "4.0.0-dev", default-features = false, branch = "master", git = "https://github.com/paritytech/substrate" }
xcm-executor = { path = "../xcm-executor", default-features = false }

# Benchmarks dependencies.
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, branch = "master", git = "https://github.com/paritytech/substrate" }
xcm = { path = "..", default-features = false, optional = true }

[dev-dependencies]
pallet-balances = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" }
pallet-assets = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" }
sp-core = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" }
sp-io = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" }
sp-tracing = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate" }
xcm-builder = { path = "../xcm-builder" }
xcm = { path = ".." }
log = "0.4.0"

[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"sp-runtime/std",
"sp-std/std"
]
runtime-benchmarks = [
"frame-benchmarking",
"xcm/runtime-benchmarks"
]
Loading