Skip to content

Commit

Permalink
Fix generic xcm benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Dengjianping <[email protected]>
  • Loading branch information
Dengjianping committed Dec 13, 2023
1 parent 0223881 commit c2bc81e
Show file tree
Hide file tree
Showing 10 changed files with 178 additions and 173 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ jobs:
curl -s https://sh.rustup.rs -sSf | sh -s -- -y
source ${HOME}/.cargo/env
rustup update
rustup toolchain install nightly-2023-03-03
rustup default nightly-2023-03-03
rustup toolchain install 1.71.0
rustup default 1.71.0
rustup target add wasm32-unknown-unknown
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_specs/calamari.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub const KUSAMA_RELAYCHAIN_LOCAL_NET: &str = "kusama-local";
pub const KUSAMA_RELAYCHAIN_DEV_NET: &str = "kusama-dev";

/// The default XCM version to set in genesis config.
pub const CALAMARI_SAFE_XCM_VERSION: u32 = 2;
pub const CALAMARI_SAFE_XCM_VERSION: u32 = 3;

/// Calamari Chain Spec
pub type CalamariChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_specs/manta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub const POLKADOT_RELAYCHAIN_LOCAL_NET: &str = "polkadot-local";
pub const POLKADOT_RELAYCHAIN_DEV_NET: &str = "polkadot-dev";

/// The default XCM version to set in genesis config.
pub const MANTA_SAFE_XCM_VERSION: u32 = 2;
pub const MANTA_SAFE_XCM_VERSION: u32 = 3;

/// Manta Chain Specification
pub type MantaChainSpec = sc_service::GenericChainSpec<manta_runtime::GenesisConfig, Extensions>;
Expand Down
6 changes: 5 additions & 1 deletion node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,11 @@ where
let target_block = B::Header::decode(&mut &validation_data.parent_head.0[..])
.map_err(|e| format!("Failed to decode parachain head: {e}"))?;

log::debug!(target: LOG_TARGET_SYNC, "Target block reached {:?}", target_block);
log::debug!(
target: LOG_TARGET_SYNC,
"Target block reached {:?}",
target_block
);
let _ = sender.send(target_block);
return Ok(());
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ pub mod pallet {
// choose the top TotalSelected qualified candidates, ordered by stake
let collators = Self::compute_top_candidates();
if collators.is_empty() {
log::error!("FAILED TO SELECT >=1 COLLATOR => using collators from previous round");
// FAILED TO SELECT >=1 COLLATOR => using collators from previous round
let last_round = now.saturating_sub(1u32);
let mut total_per_candidate: BTreeMap<T::AccountId, BalanceOf<T>> = BTreeMap::new();
// set this round AtStake to last round AtStake
Expand Down
161 changes: 80 additions & 81 deletions runtime/calamari/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-22, STEPS: `50`, REPEAT: 40, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `ip-172-31-94-108`, CPU: `Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("/home/runner/runners/2.280.1/_work/Manta/Manta/tests/data/fork.json"), DB CACHE: 1024
//! DATE: 2023-12-13, STEPS: `50`, REPEAT: 40, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `pop-os`, CPU: `AMD Ryzen 9 5950X 16-Core Processor`
//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: Some("calamari-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/manta
// ./target/release/manta
// benchmark
// pallet
// --chain=/home/runner/runners/2.280.1/_work/Manta/Manta/tests/data/fork.json
// --chain=calamari-dev
// --steps=50
// --repeat=40
// --pallet=pallet_xcm_benchmarks::generic
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./scripts/benchmarking/xcm-weights-output/pallet_xcm_benchmarks_generic.rs
// --output=/home/jamie/my-repo/Manta/runtime/calamari/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
// --template=.github/resources/xcm-weight-template.hbs

#![cfg_attr(rustfmt, rustfmt_skip)]
Expand All @@ -60,78 +59,78 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
pub fn report_holding() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 342_499_000 picoseconds.
Weight::from_parts(348_390_000, 3540)
// Measured: `280`
// Estimated: `3745`
// Minimum execution time: 68_369_000 picoseconds.
Weight::from_parts(69_941_000, 3745)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
}
pub fn buy_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_768_000 picoseconds.
Weight::from_parts(3_863_000, 0)
// Minimum execution time: 741_000 picoseconds.
Weight::from_parts(812_000, 0)
}
// Storage: PolkadotXcm Queries (r:1 w:0)
// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured)
pub fn query_response() -> Weight {
// Proof Size summary in bytes:
// Measured: `69`
// Estimated: `3534`
// Minimum execution time: 10_749_000 picoseconds.
Weight::from_parts(11_052_000, 3534)
// Measured: `169`
// Estimated: `3634`
// Minimum execution time: 4_538_000 picoseconds.
Weight::from_parts(4_719_000, 3634)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 13_123_000 picoseconds.
Weight::from_parts(13_525_000, 0)
// Minimum execution time: 3_998_000 picoseconds.
Weight::from_parts(4_118_000, 0)
}
pub fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_117_000 picoseconds.
Weight::from_parts(4_237_000, 0)
// Minimum execution time: 771_000 picoseconds.
Weight::from_parts(831_000, 0)
}
pub fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_547_000 picoseconds.
Weight::from_parts(2_632_000, 0)
// Minimum execution time: 260_000 picoseconds.
Weight::from_parts(301_000, 0)
}
pub fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_644_000 picoseconds.
Weight::from_parts(2_735_000, 0)
// Minimum execution time: 260_000 picoseconds.
Weight::from_parts(291_000, 0)
}
pub fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_600_000 picoseconds.
Weight::from_parts(2_656_000, 0)
// Minimum execution time: 260_000 picoseconds.
Weight::from_parts(291_000, 0)
}
pub fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_404_000 picoseconds.
Weight::from_parts(3_493_000, 0)
// Minimum execution time: 390_000 picoseconds.
Weight::from_parts(420_000, 0)
}
pub fn clear_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_611_000 picoseconds.
Weight::from_parts(2_689_000, 0)
// Minimum execution time: 240_000 picoseconds.
Weight::from_parts(270_000, 0)
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
Expand All @@ -147,30 +146,30 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
pub fn report_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 24_740_000 picoseconds.
Weight::from_parts(25_350_000, 3540)
// Measured: `280`
// Estimated: `3745`
// Minimum execution time: 11_963_000 picoseconds.
Weight::from_parts(12_403_000, 3745)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
}
// Storage: PolkadotXcm AssetTraps (r:1 w:1)
// Proof Skipped: PolkadotXcm AssetTraps (max_values: None, max_size: None, mode: Measured)
pub fn claim_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `126`
// Estimated: `3591`
// Minimum execution time: 15_693_000 picoseconds.
Weight::from_parts(16_027_000, 3591)
// Measured: `226`
// Estimated: `3691`
// Minimum execution time: 6_502_000 picoseconds.
Weight::from_parts(6_703_000, 3691)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn trap() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_626_000 picoseconds.
Weight::from_parts(2_696_000, 0)
// Minimum execution time: 261_000 picoseconds.
Weight::from_parts(290_000, 0)
}
// Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1)
// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured)
Expand All @@ -186,10 +185,10 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
pub fn subscribe_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 28_000_000 picoseconds.
Weight::from_parts(28_307_000, 3540)
// Measured: `211`
// Estimated: `3676`
// Minimum execution time: 12_273_000 picoseconds.
Weight::from_parts(13_204_000, 3676)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
Expand All @@ -199,8 +198,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_996_000 picoseconds.
Weight::from_parts(5_058_000, 0)
// Minimum execution time: 1_172_000 picoseconds.
Weight::from_parts(1_283_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
Expand All @@ -217,47 +216,47 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
pub fn initiate_reserve_withdraw() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 386_102_000 picoseconds.
Weight::from_parts(389_687_000, 3540)
// Measured: `280`
// Estimated: `3745`
// Minimum execution time: 67_266_000 picoseconds.
Weight::from_parts(67_977_000, 3745)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
}
pub fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 117_812_000 picoseconds.
Weight::from_parts(120_875_000, 0)
// Minimum execution time: 18_925_000 picoseconds.
Weight::from_parts(19_237_000, 0)
}
pub fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 12_499_000 picoseconds.
Weight::from_parts(12_659_000, 0)
// Minimum execution time: 3_907_000 picoseconds.
Weight::from_parts(4_088_000, 0)
}
pub fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_656_000 picoseconds.
Weight::from_parts(2_763_000, 0)
// Minimum execution time: 281_000 picoseconds.
Weight::from_parts(310_000, 0)
}
pub fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_613_000 picoseconds.
Weight::from_parts(2_700_000, 0)
// Minimum execution time: 281_000 picoseconds.
Weight::from_parts(321_000, 0)
}
pub fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_814_000 picoseconds.
Weight::from_parts(2_931_000, 0)
// Minimum execution time: 280_000 picoseconds.
Weight::from_parts(301_000, 0)
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
Expand All @@ -273,19 +272,19 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
pub fn query_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 28_529_000 picoseconds.
Weight::from_parts(29_029_000, 3540)
// Measured: `280`
// Estimated: `3745`
// Minimum execution time: 13_656_000 picoseconds.
Weight::from_parts(14_217_000, 3745)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
}
pub fn expect_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_108_000 picoseconds.
Weight::from_parts(5_185_000, 0)
// Minimum execution time: 932_000 picoseconds.
Weight::from_parts(1_012_000, 0)
}
// Storage: ParachainInfo ParachainId (r:1 w:0)
// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
Expand All @@ -301,46 +300,46 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured)
pub fn report_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 25_014_000 picoseconds.
Weight::from_parts(25_814_000, 3540)
// Measured: `280`
// Estimated: `3745`
// Minimum execution time: 12_624_000 picoseconds.
Weight::from_parts(13_275_000, 3745)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
}
pub fn clear_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_618_000 picoseconds.
Weight::from_parts(2_781_000, 0)
// Minimum execution time: 260_000 picoseconds.
Weight::from_parts(310_000, 0)
}
pub fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_585_000 picoseconds.
Weight::from_parts(2_676_000, 0)
// Minimum execution time: 250_000 picoseconds.
Weight::from_parts(291_000, 0)
}
pub fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_597_000 picoseconds.
Weight::from_parts(2_675_000, 0)
// Minimum execution time: 260_000 picoseconds.
Weight::from_parts(311_000, 0)
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_502_000 picoseconds.
Weight::from_parts(2_569_000, 0)
// Minimum execution time: 261_000 picoseconds.
Weight::from_parts(310_000, 0)
}
pub fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_807_000 picoseconds.
Weight::from_parts(2_878_000, 0)
// Minimum execution time: 271_000 picoseconds.
Weight::from_parts(321_000, 0)
}
}
Loading

0 comments on commit c2bc81e

Please sign in to comment.