Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into shawntabrizi-1.5-followup
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Sep 1, 2022
2 parents ad12bf2 + 8679e42 commit efb56c3
Show file tree
Hide file tree
Showing 23 changed files with 473 additions and 264 deletions.
501 changes: 253 additions & 248 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pallets/aura-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ std = [
"sp-runtime/std",
"sp-std/std",
]
try-runtime = ["frame-support/try-runtime"]
1 change: 1 addition & 0 deletions pallets/dmp-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ std = [
"xcm/std",
"cumulus-primitives-core/std",
]
try-runtime = ["frame-support/try-runtime"]
2 changes: 2 additions & 0 deletions pallets/parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ std = [
runtime-benchmarks = [
"sp-runtime/runtime-benchmarks"
]

try-runtime = ["frame-support/try-runtime"]
1 change: 1 addition & 0 deletions pallets/solo-to-para/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ std = [
"sp-runtime/std",
"sp-std/std",
]
try-runtime = ["frame-support/try-runtime"]
1 change: 1 addition & 0 deletions pallets/xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ std = [
"frame-support/std",
"frame-system/std",
]
try-runtime = ["frame-support/try-runtime"]
1 change: 1 addition & 0 deletions pallets/xcmp-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
17 changes: 17 additions & 0 deletions parachain-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,23 @@ runtime-benchmarks = [
]

try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-template/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
11 changes: 9 additions & 2 deletions parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,15 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::parachain-template", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down
1 change: 1 addition & 0 deletions parachains/pallets/parachain-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ std = [
"frame-support/std",
"frame-system/std",
]
try-runtime = ["frame-support/try-runtime"]
21 changes: 21 additions & 0 deletions parachains/runtimes/assets/statemine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,29 @@ runtime-benchmarks = [
"pallet-xcm-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-assets/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-multisig/try-runtime",
"pallet-proxy/try-runtime",
"pallet-session/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
std = [
"codec/std",
Expand Down
11 changes: 9 additions & 2 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,15 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::statemine", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down
21 changes: 21 additions & 0 deletions parachains/runtimes/assets/statemint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,29 @@ runtime-benchmarks = [
"pallet-xcm-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-assets/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-multisig/try-runtime",
"pallet-proxy/try-runtime",
"pallet-session/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
std = [
"codec/std",
Expand Down
11 changes: 9 additions & 2 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,15 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::statemint", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down
21 changes: 21 additions & 0 deletions parachains/runtimes/assets/westmint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,29 @@ runtime-benchmarks = [
"pallet-xcm-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-assets/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-multisig/try-runtime",
"pallet-proxy/try-runtime",
"pallet-session/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
std = [
"codec/std",
Expand Down
11 changes: 9 additions & 2 deletions parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,15 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::westmint", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down
21 changes: 21 additions & 0 deletions parachains/runtimes/collectives/collectives-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,29 @@ runtime-benchmarks = [
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-alliance/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collective/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-multisig/try-runtime",
"pallet-proxy/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
std = [
"codec/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use frame_support::{
weights::Weight,
};
use pallet_alliance::{ProposalIndex, ProposalProvider};
use sp_std::{boxed::Box, marker::PhantomData};
use sp_std::{marker::PhantomData, prelude::*};
use xcm::latest::{Fungibility, Junction, NetworkId, Parent};

type AccountIdOf<T> = <T as frame_system::Config>::AccountId;
Expand Down Expand Up @@ -134,4 +134,12 @@ where
fn proposal_of(proposal_hash: HashOf<T>) -> Option<ProposalOf<T, I>> {
pallet_collective::Pallet::<T, I>::proposal_of(proposal_hash)
}

fn proposals() -> Vec<HashOf<T>> {
pallet_collective::Pallet::<T, I>::proposals().into_inner()
}

fn proposals_count() -> u32 {
pallet_collective::Proposals::<T, I>::decode_len().unwrap_or(0) as u32
}
}
11 changes: 9 additions & 2 deletions parachains/runtimes/collectives/collectives-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,15 @@ impl_runtime_apis! {
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::collectives-polkadot", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down
20 changes: 20 additions & 0 deletions parachains/runtimes/contracts/contracts-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,26 @@ runtime-benchmarks = [
]

try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-contracts/try-runtime",
"pallet-multisig/try-runtime",
"pallet-randomness-collective-flip/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
11 changes: 9 additions & 2 deletions parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,15 @@ impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, B
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::contracts", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down
18 changes: 18 additions & 0 deletions parachains/runtimes/testing/penpal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ runtime-benchmarks = [
]

try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-assets/try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
]
13 changes: 10 additions & 3 deletions parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,13 +694,20 @@ impl_runtime_apis! {
#[cfg(feature = "try-runtime")]
impl frame_try_runtime::TryRuntime<Block> for Runtime {
fn on_runtime_upgrade() -> (Weight, Weight) {
log::info!("try-runtime::on_runtime_upgrade parachain-template.");
log::info!("try-runtime::on_runtime_upgrade penpal.");
let weight = Executive::try_runtime_upgrade().unwrap();
(weight, RuntimeBlockWeights::get().max_block)
}

fn execute_block_no_check(block: Block) -> Weight {
Executive::execute_block_no_check(block)
fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight {
log::info!(
target: "runtime::penpal", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}",
block.header.number,
block.header.hash(),
state_root_check,
select,
);
Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed")
}
}

Expand Down

0 comments on commit efb56c3

Please sign in to comment.