Commit 9d0facf3 authored by Cecile Tonglet's avatar Cecile Tonglet
Browse files

Update from parent 'origin/master' (no conflict)

Commit: 5f37995e
Parent branch: origin/master
Forked at: 77de8b91
parents 5ef5fb66 5f37995e
...@@ -162,6 +162,16 @@ check-web-wasm: &test ...@@ -162,6 +162,16 @@ check-web-wasm: &test
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path cli/Cargo.toml --no-default-features --features browser - time cargo build --locked --target=wasm32-unknown-unknown --manifest-path cli/Cargo.toml --no-default-features --features browser
- sccache -s - sccache -s
check-runtime-benchmarks: &test
stage: test
<<: *test-refs
<<: *docker-env
<<: *compiler_info
script:
# Check that the node will compile with `runtime-benchmarks` feature flag.
- time cargo check --features runtime-benchmarks
- sccache -s
build-linux-release: &build build-linux-release: &build
stage: build stage: build
...@@ -266,7 +276,7 @@ publish-s3-release: ...@@ -266,7 +276,7 @@ publish-s3-release:
- | - |
cat <<-EOM cat <<-EOM
| |
| polkadot binary paths: | polkadot binary paths:
| |
| - https://${BUCKET}/${PREFIX}/${EXTRATAG}/polkadot | - https://${BUCKET}/${PREFIX}/${EXTRATAG}/polkadot
| - https://${BUCKET}/${PREFIX}/${VERSION}/polkadot | - https://${BUCKET}/${PREFIX}/${VERSION}/polkadot
...@@ -375,5 +385,3 @@ deploy-polkasync-kusama: ...@@ -375,5 +385,3 @@ deploy-polkasync-kusama:
-F "ref=master" \ -F "ref=master" \
-F "variables[POLKADOT_BUILD_REF]=${CI_COMMIT_REF_NAME}" \ -F "variables[POLKADOT_BUILD_REF]=${CI_COMMIT_REF_NAME}" \
${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline | jq . ${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline | jq .
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -76,7 +76,7 @@ std = [ ...@@ -76,7 +76,7 @@ std = [
"log", "log",
] ]
runtime-benchmarks = [ runtime-benchmarks = [
"libsecp256k1", "libsecp256k1/hmac",
"frame-benchmarking", "frame-benchmarking",
"frame-support/runtime-benchmarks" "frame-support/runtime-benchmarks"
] ]
...@@ -570,7 +570,10 @@ mod tests { ...@@ -570,7 +570,10 @@ mod tests {
use super::*; use super::*;
use std::{collections::HashMap, cell::RefCell}; use std::{collections::HashMap, cell::RefCell};
use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types}; use frame_support::{
impl_outer_origin, assert_ok, assert_noop, parameter_types,
traits::{OnInitialize, OnFinalize},
};
use frame_support::traits::Contains; use frame_support::traits::Contains;
use sp_core::H256; use sp_core::H256;
use primitives::parachain::{Info as ParaInfo, Id as ParaId}; use primitives::parachain::{Info as ParaInfo, Id as ParaId};
...@@ -578,7 +581,7 @@ mod tests { ...@@ -578,7 +581,7 @@ mod tests {
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried. // or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
use sp_runtime::{ use sp_runtime::{
Perbill, Permill, Percent, testing::Header, DispatchResult, Perbill, Permill, Percent, testing::Header, DispatchResult,
traits::{BlakeTwo256, OnInitialize, OnFinalize, IdentityLookup}, traits::{BlakeTwo256, IdentityLookup},
}; };
use crate::registrar::Registrar; use crate::registrar::Registrar;
......
...@@ -35,7 +35,7 @@ use sp_staking::{ ...@@ -35,7 +35,7 @@ use sp_staking::{
use frame_support::{ use frame_support::{
traits::KeyOwnerProofSystem, traits::KeyOwnerProofSystem,
dispatch::{IsSubType}, dispatch::{IsSubType},
weights::{DispatchInfo, SimpleDispatchInfo}, weights::{DispatchInfo, SimpleDispatchInfo, Weight, WeighData},
}; };
use primitives::{ use primitives::{
Balance, Balance,
...@@ -516,7 +516,7 @@ decl_module! { ...@@ -516,7 +516,7 @@ decl_module! {
Ok(()) Ok(())
} }
fn on_initialize() { fn on_initialize() -> Weight {
<Self as Store>::DidUpdate::kill(); <Self as Store>::DidUpdate::kill();
let current_session = <session::Module<T>>::current_index(); let current_session = <session::Module<T>>::current_index();
...@@ -538,6 +538,8 @@ decl_module! { ...@@ -538,6 +538,8 @@ decl_module! {
} }
} }
<ParentToSessionIndex<T>>::insert(parent_hash, current_session); <ParentToSessionIndex<T>>::insert(parent_hash, current_session);
SimpleDispatchInfo::default().weigh_data(())
} }
fn on_finalize() { fn on_finalize() {
...@@ -1204,7 +1206,7 @@ mod tests { ...@@ -1204,7 +1206,7 @@ mod tests {
impl_opaque_keys, impl_opaque_keys,
Perbill, curve::PiecewiseLinear, testing::{Header}, Perbill, curve::PiecewiseLinear, testing::{Header},
traits::{ traits::{
BlakeTwo256, IdentityLookup, OnInitialize, OnFinalize, SaturatedConversion, BlakeTwo256, IdentityLookup, SaturatedConversion,
OpaqueKeys, OpaqueKeys,
}, },
}; };
...@@ -1218,6 +1220,7 @@ mod tests { ...@@ -1218,6 +1220,7 @@ mod tests {
use keyring::Sr25519Keyring; use keyring::Sr25519Keyring;
use frame_support::{ use frame_support::{
impl_outer_origin, impl_outer_dispatch, assert_ok, assert_err, parameter_types, impl_outer_origin, impl_outer_dispatch, assert_ok, assert_err, parameter_types,
traits::{OnInitialize, OnFinalize},
}; };
use crate::parachains; use crate::parachains;
use crate::registrar; use crate::registrar;
......
...@@ -31,7 +31,7 @@ use sp_runtime::{ ...@@ -31,7 +31,7 @@ use sp_runtime::{
use frame_support::{ use frame_support::{
decl_storage, decl_module, decl_event, decl_error, ensure, decl_storage, decl_module, decl_event, decl_error, ensure,
dispatch::{DispatchResult, IsSubType}, traits::{Get, Currency, ReservableCurrency}, dispatch::{DispatchResult, IsSubType}, traits::{Get, Currency, ReservableCurrency},
weights::{SimpleDispatchInfo, DispatchInfo}, weights::{SimpleDispatchInfo, DispatchInfo, Weight, WeighData},
}; };
use system::{self, ensure_root, ensure_signed}; use system::{self, ensure_root, ensure_signed};
use primitives::parachain::{ use primitives::parachain::{
...@@ -413,7 +413,7 @@ decl_module! { ...@@ -413,7 +413,7 @@ decl_module! {
} }
/// Block initializer. Clears SelectedThreads and constructs/replaces Active. /// Block initializer. Clears SelectedThreads and constructs/replaces Active.
fn on_initialize() { fn on_initialize() -> Weight {
let next_up = SelectedThreads::mutate(|t| { let next_up = SelectedThreads::mutate(|t| {
let r = if t.len() >= T::QueueSize::get() { let r = if t.len() >= T::QueueSize::get() {
// Take the first set of parathreads in queue // Take the first set of parathreads in queue
...@@ -453,6 +453,8 @@ decl_module! { ...@@ -453,6 +453,8 @@ decl_module! {
paras.sort_by_key(|&(ref id, _)| *id); paras.sort_by_key(|&(ref id, _)| *id);
Active::put(paras); Active::put(paras);
SimpleDispatchInfo::default().weigh_data(())
} }
fn on_finalize() { fn on_finalize() {
...@@ -644,7 +646,7 @@ mod tests { ...@@ -644,7 +646,7 @@ mod tests {
use sp_core::{H256, Pair}; use sp_core::{H256, Pair};
use sp_runtime::{ use sp_runtime::{
traits::{ traits::{
BlakeTwo256, IdentityLookup, OnInitialize, OnFinalize, Dispatchable, BlakeTwo256, IdentityLookup, Dispatchable,
AccountIdConversion, AccountIdConversion,
}, testing::{UintAuthorityId, Header}, KeyTypeId, Perbill, curve::PiecewiseLinear, }, testing::{UintAuthorityId, Header}, KeyTypeId, Perbill, curve::PiecewiseLinear,
}; };
...@@ -657,7 +659,7 @@ mod tests { ...@@ -657,7 +659,7 @@ mod tests {
Balance, BlockNumber, Balance, BlockNumber,
}; };
use frame_support::{ use frame_support::{
traits::KeyOwnerProofSystem, traits::{KeyOwnerProofSystem, OnInitialize, OnFinalize},
impl_outer_origin, impl_outer_dispatch, assert_ok, parameter_types, assert_noop, impl_outer_origin, impl_outer_dispatch, assert_ok, parameter_types, assert_noop,
}; };
use keyring::Sr25519Keyring; use keyring::Sr25519Keyring;
......
...@@ -22,11 +22,11 @@ use sp_std::{prelude::*, mem::swap, convert::TryInto}; ...@@ -22,11 +22,11 @@ use sp_std::{prelude::*, mem::swap, convert::TryInto};
use sp_runtime::traits::{ use sp_runtime::traits::{
CheckedSub, StaticLookup, Zero, One, CheckedConversion, Hash, AccountIdConversion, CheckedSub, StaticLookup, Zero, One, CheckedConversion, Hash, AccountIdConversion,
}; };
use frame_support::weights::SimpleDispatchInfo;
use codec::{Encode, Decode, Codec}; use codec::{Encode, Decode, Codec};
use frame_support::{ use frame_support::{
decl_module, decl_storage, decl_event, decl_error, ensure, dispatch::DispatchResult, decl_module, decl_storage, decl_event, decl_error, ensure, dispatch::DispatchResult,
traits::{Currency, ReservableCurrency, WithdrawReason, ExistenceRequirement, Get, Randomness}, traits::{Currency, ReservableCurrency, WithdrawReason, ExistenceRequirement, Get, Randomness},
weights::{SimpleDispatchInfo, WeighData, Weight},
}; };
use primitives::parachain::{ use primitives::parachain::{
SwapAux, PARACHAIN_INFO, Id as ParaId SwapAux, PARACHAIN_INFO, Id as ParaId
...@@ -267,7 +267,7 @@ decl_module! { ...@@ -267,7 +267,7 @@ decl_module! {
fn deposit_event() = default; fn deposit_event() = default;
fn on_initialize(n: T::BlockNumber) { fn on_initialize(n: T::BlockNumber) -> Weight {
let lease_period = T::LeasePeriod::get(); let lease_period = T::LeasePeriod::get();
let lease_period_index: LeasePeriodOf<T> = (n / lease_period).into(); let lease_period_index: LeasePeriodOf<T> = (n / lease_period).into();
...@@ -285,6 +285,8 @@ decl_module! { ...@@ -285,6 +285,8 @@ decl_module! {
if (n % lease_period).is_zero() { if (n % lease_period).is_zero() {
Self::manage_lease_period_start(lease_period_index); Self::manage_lease_period_start(lease_period_index);
} }
SimpleDispatchInfo::default().weigh_data(())
} }
fn on_finalize(now: T::BlockNumber) { fn on_finalize(now: T::BlockNumber) {
...@@ -877,9 +879,12 @@ mod tests { ...@@ -877,9 +879,12 @@ mod tests {
use sp_core::H256; use sp_core::H256;
use sp_runtime::{ use sp_runtime::{
Perbill, testing::Header, Perbill, testing::Header,
traits::{BlakeTwo256, Hash, IdentityLookup, OnInitialize, OnFinalize}, traits::{BlakeTwo256, Hash, IdentityLookup},
};
use frame_support::{
impl_outer_origin, parameter_types, assert_ok, assert_noop,
traits::{OnInitialize, OnFinalize}
}; };
use frame_support::{impl_outer_origin, parameter_types, assert_ok, assert_noop};
use balances; use balances;
use primitives::parachain::{Id as ParaId, Info as ParaInfo}; use primitives::parachain::{Id as ParaId, Info as ParaInfo};
......
...@@ -136,4 +136,9 @@ std = [ ...@@ -136,4 +136,9 @@ std = [
"randomness-collective-flip/std", "randomness-collective-flip/std",
"runtime-common/std", "runtime-common/std",
] ]
runtime-benchmarks = ["frame-benchmarking", "runtime-common/runtime-benchmarks"] runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"runtime-common/runtime-benchmarks",
"elections-phragmen/runtime-benchmarks"
]
...@@ -130,4 +130,9 @@ std = [ ...@@ -130,4 +130,9 @@ std = [
"sudo/std", "sudo/std",
"vesting/std", "vesting/std",
] ]
runtime-benchmarks = ["frame-benchmarking", "runtime-common/runtime-benchmarks"] runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"runtime-common/runtime-benchmarks",
"elections-phragmen/runtime-benchmarks"
]
...@@ -84,7 +84,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { ...@@ -84,7 +84,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"), spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"), impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 2, authoring_version: 2,
spec_version: 1005, spec_version: 1006,
impl_version: 0, impl_version: 0,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
}; };
......
...@@ -75,7 +75,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { ...@@ -75,7 +75,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot-test-runtime"), spec_name: create_runtime_str!("polkadot-test-runtime"),
impl_name: create_runtime_str!("parity-polkadot-test-runtime"), impl_name: create_runtime_str!("parity-polkadot-test-runtime"),
authoring_version: 2, authoring_version: 2,
spec_version: 1048, spec_version: 1049,
impl_version: 0, impl_version: 0,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment