Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polkadot-v0.9.29 uplift #749

Merged
merged 9 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
921 changes: 502 additions & 419 deletions Cargo.lock

Large diffs are not rendered by default.

148 changes: 74 additions & 74 deletions bin/collator/Cargo.toml

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions bin/collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,9 @@ impl CliConfiguration<Self> for RelayChainCli {
}

fn base_path(&self) -> Result<Option<BasePath>> {
Ok(self
.shared_params()
self.shared_params()
.base_path()
.or_else(|| self.base_path.clone().map(Into::into)))
.or_else(|_| Ok(self.base_path.clone().map(Into::into)))
}

fn rpc_http(&self, default_listen_port: u16) -> Result<Option<SocketAddr>> {
Expand Down Expand Up @@ -817,10 +816,6 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.transaction_pool(is_dev)
}

fn state_cache_child_ratio(&self) -> Result<Option<usize>> {
self.base.base.state_cache_child_ratio()
}

fn rpc_methods(&self) -> Result<sc_service::config::RpcMethods> {
self.base.base.rpc_methods()
}
Expand Down
18 changes: 9 additions & 9 deletions bin/xcm-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ path = "src/main.rs"

[dependencies]
clap = { version = "3.2.17", features = ["derive"] }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.28" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.28" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }

[build-dependencies]
build-script-utils = { package = "substrate-build-script-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
build-script-utils = { package = "substrate-build-script-utils", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
166 changes: 91 additions & 75 deletions runtime/astar/Cargo.toml

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("astar"),
impl_name: create_runtime_str!("astar"),
authoring_version: 1,
spec_version: 35,
spec_version: 36,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -124,7 +124,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
/// by Operational extrinsics.
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 0.5 seconds of compute with a 6 second average block time.
const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2;
const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_div(2);

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
Expand Down Expand Up @@ -331,8 +331,8 @@ impl pallet_utility::Config for Runtime {
}

parameter_types! {
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
}

impl cumulus_pallet_parachain_system::Config for Runtime {
Expand Down Expand Up @@ -579,7 +579,7 @@ impl WeightToFeePolynomial for WeightToFee {
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// in Astar, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 mASTR:
let p = MILLIASTR;
let q = 10 * Balance::from(ExtrinsicBaseWeight::get());
let q = 10 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec::smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
Expand Down Expand Up @@ -646,16 +646,16 @@ pub const GAS_PER_SECOND: u64 = 40_000_000;

/// Approximate ratio of the amount of Weight per Gas.
/// u64 works for approximations because Weight is a very small unit compared to gas.
pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND;
pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND.ref_time() / GAS_PER_SECOND;
0x7CFE marked this conversation as resolved.
Show resolved Hide resolved

pub struct GasWeightMapping;
impl pallet_evm::GasWeightMapping for GasWeightMapping {
fn gas_to_weight(gas: u64) -> Weight {
gas.saturating_mul(WEIGHT_PER_GAS)
Weight::from_ref_time(gas.saturating_mul(WEIGHT_PER_GAS))
}

fn weight_to_gas(weight: Weight) -> u64 {
weight.wrapping_div(WEIGHT_PER_GAS)
weight.ref_time().wrapping_div(WEIGHT_PER_GAS)
}
}

Expand Down Expand Up @@ -683,7 +683,7 @@ parameter_types! {
pub ChainId: u64 = 0x250;
/// EVM gas limit
pub BlockGasLimit: U256 = U256::from(
NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WEIGHT_PER_GAS
NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS
);
pub PrecompilesValue: Precompiles = AstarNetworkPrecompiles::<_, _>::new();
}
Expand Down Expand Up @@ -1219,8 +1219,12 @@ 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 {
Dinonard marked this conversation as resolved.
Show resolved Hide resolved
Executive::try_execute_block(block, state_root_check, select).expect("execute-block failed")
}
}
}
Expand Down
90 changes: 45 additions & 45 deletions runtime/astar/src/weights/pallet_dapps_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
// Storage: DappsStaking PreApprovalIsEnabled (r:1 w:0)
fn register() -> Weight {
(32_139_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
(Weight::from_ref_time(32_139_000 as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: System Account (r:1 w:1)
fn unregister() -> Weight {
(31_929_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
(Weight::from_ref_time(31_929_000 as u64))
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
Expand All @@ -63,23 +63,23 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn withdraw_from_unregistered() -> Weight {
(46_667_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
(Weight::from_ref_time(46_667_000 as u64))
.saturating_add(T::DbWeight::get().reads(8 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking PreApprovalIsEnabled (r:0 w:1)
fn enable_developer_pre_approval() -> Weight {
(2_745_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(2_745_000 as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking PreApprovedDevelopers (r:1 w:1)
fn developer_pre_approval() -> Weight {
(5_320_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(5_320_000 as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
Expand All @@ -90,9 +90,9 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn bond_and_stake() -> Weight {
(133_638_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
(Weight::from_ref_time(133_638_000 as u64))
.saturating_add(T::DbWeight::get().reads(8 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
Expand All @@ -103,19 +103,19 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn unbond_and_unstake() -> Weight {
(134_480_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
(Weight::from_ref_time(134_480_000 as u64))
.saturating_add(T::DbWeight::get().reads(8 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:1)
fn withdraw_unbonded() -> Weight {
(114_252_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
(Weight::from_ref_time(114_252_000 as u64))
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
Expand All @@ -127,9 +127,9 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn claim_staker_with_restake() -> Weight {
(91_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(10 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
(Weight::from_ref_time(91_000_000 as u64))
.saturating_add(T::DbWeight::get().reads(10 as u64))
.saturating_add(T::DbWeight::get().writes(6 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
Expand All @@ -139,48 +139,48 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:0)
fn claim_staker_without_restake() -> Weight {
(56_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(56_000_000 as u64))
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:2 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:2 w:2)
// Storage: DappsStaking ContractEraStake (r:2 w:2)
fn nomination_transfer() -> Weight {
(56_495_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
(Weight::from_ref_time(56_495_000 as u64))
.saturating_add(T::DbWeight::get().reads(8 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
fn claim_dapp() -> Weight {
(31_619_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(31_619_000 as u64))
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking ForceEra (r:0 w:1)
fn force_new_era() -> Weight {
(2_815_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(2_815_000 as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:1)
fn maintenance_mode() -> Weight {
(10_970_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(10_970_000 as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
fn set_reward_destination() -> Weight {
(24_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(24_000_000 as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}
28 changes: 14 additions & 14 deletions runtime/astar/src/weights/pallet_xc_asset_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,37 @@ impl<T: frame_system::Config> pallet_xc_asset_config::WeightInfo for WeightInfo<
// Storage: EVM AccountCodes (r:0 w:1)
// Storage: XcAssetConfig AssetLocationToId (r:0 w:1)
fn register_asset_location() -> Weight {
(15_599_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
(Weight::from_ref_time(15_599_000 as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: XcAssetConfig AssetLocationToId (r:1 w:0)
// Storage: XcAssetConfig AssetLocationUnitsPerSecond (r:0 w:1)
fn set_asset_units_per_second() -> Weight {
(14_326_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(14_326_000 as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: XcAssetConfig AssetIdToLocation (r:1 w:1)
// Storage: XcAssetConfig AssetLocationUnitsPerSecond (r:1 w:2)
// Storage: XcAssetConfig AssetLocationToId (r:0 w:2)
fn change_existing_asset_location() -> Weight {
(20_459_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
(Weight::from_ref_time(20_459_000 as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: XcAssetConfig AssetLocationUnitsPerSecond (r:0 w:1)
fn remove_payment_asset() -> Weight {
(11_221_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(Weight::from_ref_time(11_221_000 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: XcAssetConfig AssetIdToLocation (r:1 w:1)
// Storage: EVM AccountCodes (r:0 w:1)
// Storage: XcAssetConfig AssetLocationUnitsPerSecond (r:0 w:1)
// Storage: XcAssetConfig AssetLocationToId (r:0 w:1)
fn remove_asset() -> Weight {
(17_804_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
(Weight::from_ref_time(17_804_000 as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
}
4 changes: 2 additions & 2 deletions runtime/astar/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub type XcmOriginToTransactDispatchOrigin = (

parameter_types! {
// One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate.
pub UnitWeightCost: Weight = 1_000_000_000;
pub UnitWeightCost: u64 = 1_000_000_000;
pub const MaxInstructions: u32 = 100;
}

Expand Down Expand Up @@ -155,7 +155,7 @@ impl Config for XcmConfig {
}

parameter_types! {
pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
pub const MaxDownwardMessageWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(10);
}

/// Local origins on this chain are allowed to dispatch XCM sends/executions.
Expand Down
Loading