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

Update to polkadot 0.9.34 #225

Merged
merged 72 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e7cb51b
Contracts pallet: Bump Runtime API (#12677)
jasl Nov 10, 2022
112468e
Fix typo (#12680)
sorpaas Nov 10, 2022
7763a32
Move `WeightCounter` to `sp-weights` (#12603)
ggwpez Nov 11, 2022
b042ebd
Allow other pallets to check asset ids. (#12666)
gilescope Nov 11, 2022
67e3f9b
derive type info for some grandpa types (#12683)
yjhmelody Nov 11, 2022
e6768a3
Safe TreeRoute constructor (#12691)
davxy Nov 11, 2022
3e71d60
New `root_testing` pallet (#12451)
Szegoo Nov 13, 2022
59da38b
[ci] Add DAG for build-rustdoc and check-dependent-project (#12687)
alvicsam Nov 14, 2022
940a458
Collective: Benchmark with greater `MaxProposals` (#12454)
Szegoo Nov 14, 2022
65a8990
[ci] fix buildah for publishing docker (#12703)
alvicsam Nov 15, 2022
c067438
Make public is_passing and ReferendumStatus (#12667)
4meta5 Nov 15, 2022
a0ab42a
Asset Pallet: Support repeated destroys to safely destroy large asset…
tonyalaribe Nov 15, 2022
cd30493
`seal_reentrant_count` returns contract reentrant count (#12695)
Artemka374 Nov 15, 2022
eb1a2a8
Assets Pallet: reintroduce fungibles::Destroy trait (#12708)
tonyalaribe Nov 15, 2022
108d8ee
release `sp-core 7.0.0` and `sp-runtime 7.0.0` (#12599)
niklasad1 Nov 15, 2022
38f473b
Release `sp-keyring` and `pallet-contracts-primitives` `7.0.0` (#12716)
ascjones Nov 16, 2022
b8ba481
Fix `cargo check` for `pallet-contracts-proc-macro` (#12706)
joao-paulo-parity Nov 16, 2022
0699880
[ci] Improve pipeline stopper (#12717)
alvicsam Nov 16, 2022
a7ba55d
sc-chainspec: Switch to `assimilate_storage` (#12720)
bkchr Nov 16, 2022
35170c5
[Cleanup] Remove obsolete event from fast-unstake (#12725)
ruseinov Nov 17, 2022
4baabe4
[Fix] Deposit for fast-unstake has to be define as pallet::constant (…
ruseinov Nov 17, 2022
0dc5358
Add event testing example to pallet template (#12722)
elv-nate Nov 17, 2022
a73a35e
Remove the `wasmtime` feature flag (#12684)
koute Nov 18, 2022
7cfaa03
Fix the light client protocol protobuf schema (#12732)
tomaka Nov 18, 2022
c290950
Update template to remove clippy warnings (#12670)
simonsso Nov 18, 2022
f80c370
Check all crates (#12709)
joao-paulo-parity Nov 21, 2022
ee9ddf1
client/beefy: persist voter state (#12712)
acatangiu Nov 21, 2022
69662c4
[Fix] Get target count from TargetList instead of storage (#12748)
ruseinov Nov 21, 2022
6cb4b67
Move block/state/warpc sync requests/responses to `ChainSync` (#12739)
altonen Nov 22, 2022
06d7a23
perf: generate_initial_session_keys: load runtime only if its relevan…
librelois Nov 22, 2022
431429f
Prevent epochs pruning while finalizing blocks on epoch 0 (#12758)
davxy Nov 23, 2022
269c799
return error instead of expect in `feasibility_check` (#12745)
kianenigma Nov 23, 2022
08d1b2c
BEEFY: optimize voter event loop for fewer 'active' wakeups (#12760)
acatangiu Nov 23, 2022
4e3a12b
Sort crates before splitting them into groups (+ some improvements) (…
joao-paulo-parity Nov 24, 2022
f465fee
contracts: Replace `sp-sandbox` and `wasmi-validation` by newest wasm…
athei Nov 24, 2022
d122169
update DefaultNoBound derive macro (#12723)
benluelo Nov 25, 2022
ab6142f
Fix rustdoc (#12777)
ggwpez Nov 25, 2022
3e91823
Allow Alliance Fellows to Give Up Voting Rights (#12730)
joepetrowski Nov 25, 2022
a1dc9d8
Add total nb to trie migration rpc (#12770)
cheme Nov 25, 2022
d11846b
add EnsureWithSuccess (#12775)
xlc Nov 25, 2022
39ef178
Explicitly unset RUSTC_WRAPPER=sccache environment variable (#12771)
rcny Nov 25, 2022
2eb5128
contracts: Don't put unstable functions in special module (#12781)
athei Nov 27, 2022
a92005a
ed25519_verify: Support using dalek for historical blocks (#12661)
bkchr Nov 27, 2022
d833e15
client/beefy: fix on-demand justifications sync for old blocks (#12767)
acatangiu Nov 28, 2022
a0e00dc
Remove Default, HasCompact, and TypeInfo trait bounds on AssetId (#12…
joepetrowski Nov 28, 2022
9ce75af
pallet-mmr: move offchain logic to client-side gadget (#12753)
serban300 Nov 29, 2022
59ca8df
Require rust-features check (#12796)
ggwpez Nov 29, 2022
5c8aa7e
MMR: move RPC code from frame/ to client/ (#12805)
acatangiu Nov 30, 2022
357c363
chore: remove unused traits for wasm interface (#12792)
yjhmelody Nov 30, 2022
cc36931
sc-transaction-handler: Fix potential crashes on exit (#12807)
bkchr Nov 30, 2022
2ed4058
Don't announce blocks in `sync_to_tip_when_we_sync_together_with_mult…
altonen Nov 30, 2022
982f599
contracts: Replace cargo feature `unstable-interface` with config (#1…
athei Nov 30, 2022
009c872
Bounties use SpendOrigin (#12808)
gavofyork Dec 1, 2022
5ae8a3b
Reduce provisioner work (#12749)
Dec 1, 2022
c17c7d8
Fix quantization in referenda alarm (#12815)
gavofyork Dec 2, 2022
34900ca
Add `Weightless` benchmark bailing (#12829)
ggwpez Dec 2, 2022
9812205
API for registering inactive funds (#12813)
gavofyork Dec 3, 2022
1a0af36
Tweak to active total migrations (#12832)
gavofyork Dec 3, 2022
cb3eaf2
frame-executive: Reject invalid inherents in the executive (#12365)
bkchr Dec 4, 2022
2bde8c1
Upgrade tokio to 1.22.0 and replace async-std with tokio (#12646)
dmitry-markin Dec 5, 2022
62a85fb
make threshold pub instead of pub crate (#12814)
4meta5 Dec 5, 2022
0ab43bc
Non-Interactive Staking (#12610)
gavofyork Dec 5, 2022
2704ab3
pallet-balances: Fix inactive funds migration (#12840)
bkchr Dec 5, 2022
05ebde1
client/beefy: add some bounds on enqueued votes (#12562)
dharjeezy Dec 5, 2022
404b8c9
OpenGov: Abstentions (#12842)
gavofyork Dec 5, 2022
b1396f7
Add `with_weight` extrinsic (#12848)
shawntabrizi Dec 5, 2022
fa42631
[contracts] Add per local weight for function call (#12806)
agryaznov Dec 6, 2022
234749e
contracts: Add `instantiation_nonce` API (#12800)
athei Dec 6, 2022
1cc97dd
Rename some crates for publishing to crates.io (#12837)
joao-paulo-parity Dec 6, 2022
90eb84a
Merge remote-tracking branch 'upstream/polkadot-v0.9.34' into update-…
kacperzuk-neti Jan 23, 2023
b2bbeb8
Merge remote-tracking branch 'origin/develop' into update-to-polkadot…
kacperzuk-neti Jan 24, 2023
89ebc92
Fix CitizenshipMinimum value
kacperzuk-neti Jan 24, 2023
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
Prev Previous commit
Next Next commit
New root_testing pallet (#12451)
* Move fill_block to RootOffences

* docs

* new pallet

* new line

* fix

* Update frame/root-testing/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/root-testing/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update bin/node/runtime/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/root-testing/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/root-testing/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/root-testing/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* fixes

* problem solved

* revert

* fix dependency

* hopefully making the CI happy

* ...

* dummy call

* remove dummy

* fix warning

Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
Szegoo and bkchr authored Nov 13, 2022
commit 3e71d606b7d1e91d9c1701c0a443530eefca1a39
17 changes: 15 additions & 2 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 @@ -135,6 +135,7 @@ members = [
"frame/state-trie-migration",
"frame/sudo",
"frame/root-offences",
"frame/root-testing",
"frame/support",
"frame/support/procedural",
"frame/support/procedural/tools",
Expand Down
1 change: 1 addition & 0 deletions bin/node/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pallet-sudo = { version = "4.0.0-dev", path = "../../../frame/sudo" }
pallet-timestamp = { version = "4.0.0-dev", path = "../../../frame/timestamp" }
pallet-treasury = { version = "4.0.0-dev", path = "../../../frame/treasury" }
pallet-transaction-payment = { version = "4.0.0-dev", path = "../../../frame/transaction-payment" }
pallet-root-testing = { version = "1.0.0-dev", path = "../../../frame/root-testing" }
sp-application-crypto = { version = "6.0.0", path = "../../../primitives/application-crypto" }
sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" }
sp-externalities = { version = "0.12.0", path = "../../../primitives/externalities" }
Expand Down
6 changes: 3 additions & 3 deletions bin/node/executor/tests/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
CheckedExtrinsic {
signed: Some((charlie(), signed_extra(0, 0))),
function: RuntimeCall::Sudo(pallet_sudo::Call::sudo {
call: Box::new(RuntimeCall::System(frame_system::Call::fill_block {
ratio: Perbill::from_percent(60),
})),
call: Box::new(RuntimeCall::RootTesting(
pallet_root_testing::Call::fill_block { ratio: Perbill::from_percent(60) },
)),
}),
},
],
Expand Down
3 changes: 3 additions & 0 deletions bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pallet-ranked-collective = { version = "4.0.0-dev", default-features = false, pa
pallet-recovery = { version = "4.0.0-dev", default-features = false, path = "../../../frame/recovery" }
pallet-referenda = { version = "4.0.0-dev", default-features = false, path = "../../../frame/referenda" }
pallet-remark = { version = "4.0.0-dev", default-features = false, path = "../../../frame/remark" }
pallet-root-testing = { version = "1.0.0-dev", default-features = false, path = "../../../frame/root-testing" }
pallet-session = { version = "4.0.0-dev", features = [ "historical" ], path = "../../../frame/session", default-features = false }
pallet-session-benchmarking = { version = "4.0.0-dev", path = "../../../frame/session/benchmarking", default-features = false, optional = true }
pallet-staking = { version = "4.0.0-dev", default-features = false, path = "../../../frame/staking" }
Expand Down Expand Up @@ -192,6 +193,7 @@ std = [
"pallet-ranked-collective/std",
"pallet-referenda/std",
"pallet-remark/std",
"pallet-root-testing/std",
"pallet-recovery/std",
"pallet-uniques/std",
"pallet-vesting/std",
Expand Down Expand Up @@ -292,6 +294,7 @@ try-runtime = [
"pallet-recovery/try-runtime",
"pallet-referenda/try-runtime",
"pallet-remark/try-runtime",
"pallet-root-testing/try-runtime",
"pallet-session/try-runtime",
"pallet-staking/try-runtime",
"pallet-state-trie-migration/try-runtime",
Expand Down
3 changes: 3 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ impl pallet_remark::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
}

impl pallet_root_testing::Config for Runtime {}

parameter_types! {
pub const LaunchPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
pub const VotingPeriod: BlockNumber = 28 * 24 * 60 * MINUTES;
Expand Down Expand Up @@ -1670,6 +1672,7 @@ construct_runtime!(
ChildBounties: pallet_child_bounties,
Referenda: pallet_referenda,
Remark: pallet_remark,
RootTesting: pallet_root_testing,
ConvictionVoting: pallet_conviction_voting,
Whitelist: pallet_whitelist,
AllianceMotion: pallet_collective::<Instance3>,
Expand Down
7 changes: 3 additions & 4 deletions frame/root-offences/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "pallet-root-offences"
version = "1.0.0"
version = "1.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME root offences pallet"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand All @@ -17,11 +18,10 @@ scale-info = { version = "2.1.1", default-features = false, features = ["derive"

pallet-session = { version = "4.0.0-dev", features = [ "historical" ], path = "../../frame/session", default-features = false }
pallet-staking = { version = "4.0.0-dev", default-features = false, path = "../../frame/staking" }
pallet-offences = { version = "4.0.0-dev", default-features = false, path = "../../frame/offences" }

frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
sp-runtime = { version = "6.0.0", path = "../../primitives/runtime" }
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking" }

[dev-dependencies]
Expand All @@ -45,7 +45,6 @@ std = [
"frame-system/std",
"pallet-session/std",
"pallet-staking/std",
"pallet-offences/std",
"scale-info/std",
"sp-runtime/std",
]
2 changes: 1 addition & 1 deletion frame/root-offences/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sudo Offences Pallet
# Root Offences Pallet

Pallet that allows the root to create an offence.

Expand Down
2 changes: 1 addition & 1 deletion frame/root-offences/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! # Sudo Offences Pallet
//! # Root Offences Pallet
//! Pallet that allows the root to create an offence.
//!
//! NOTE: This pallet should be used for testing purposes.
Expand Down
34 changes: 34 additions & 0 deletions frame/root-testing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "pallet-root-testing"
version = "1.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME root testing pallet"
readme = "README.md"

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

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }

frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }

[dev-dependencies]

[features]
try-runtime = ["frame-support/try-runtime"]
default = ["std"]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"sp-runtime/std",
]
5 changes: 5 additions & 0 deletions frame/root-testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Root Testing Pallet

Pallet that contains extrinsics that can be usefull in testing.

NOTE: This pallet should only be used for testing purposes and should not be used in production runtimes!
54 changes: 54 additions & 0 deletions frame/root-testing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! # Root Testing Pallet
//!
//! Pallet that contains extrinsics that can be usefull in testing.
//!
//! NOTE: This pallet should only be used for testing purposes and should not be used in production
//! runtimes!

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

use frame_support::dispatch::DispatchResult;
use sp_runtime::Perbill;

pub use pallet::*;

#[frame_support::pallet]
pub mod pallet {
use super::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;

#[pallet::config]
pub trait Config: frame_system::Config {}

#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);

#[pallet::call]
impl<T: Config> Pallet<T> {
/// A dispatch that will fill the block weight up to the given ratio.
#[pallet::weight(*_ratio * T::BlockWeights::get().max_block)]
pub fn fill_block(origin: OriginFor<T>, _ratio: Perbill) -> DispatchResult {
ensure_root(origin)?;
Ok(())
}
}
}
20 changes: 1 addition & 19 deletions frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use sp_runtime::{
CheckEqual, Dispatchable, Hash, Lookup, LookupError, MaybeDisplay, MaybeMallocSizeOf,
MaybeSerializeDeserialize, Member, One, Saturating, SimpleBitOps, StaticLookup, Zero,
},
DispatchError, Perbill, RuntimeDebug,
DispatchError, RuntimeDebug,
};
#[cfg(any(feature = "std", test))]
use sp_std::map;
Expand Down Expand Up @@ -197,7 +197,6 @@ impl<MaxNormal: Get<u32>, MaxOverflow: Get<u32>> ConsumerLimits for (MaxNormal,
pub mod pallet {
use crate::{self as frame_system, pallet_prelude::*, *};
use frame_support::pallet_prelude::*;
use sp_runtime::DispatchErrorWithPostInfo;

/// System configuration trait. Implemented by runtime.
#[pallet::config]
Expand Down Expand Up @@ -370,23 +369,6 @@ pub mod pallet {

#[pallet::call]
impl<T: Config> Pallet<T> {
/// A dispatch that will fill the block weight up to the given ratio.
// TODO: This should only be available for testing, rather than in general usage, but
// that's not possible at present (since it's within the pallet macro).
#[pallet::weight(*_ratio * T::BlockWeights::get().max_block)]
pub fn fill_block(origin: OriginFor<T>, _ratio: Perbill) -> DispatchResultWithPostInfo {
match ensure_root(origin) {
Ok(_) => Ok(().into()),
Err(_) => {
// roughly same as a 4 byte remark since perbill is u32.
Err(DispatchErrorWithPostInfo {
post_info: Some(T::SystemWeightInfo::remark(4u32)).into(),
error: DispatchError::BadOrigin,
})
},
}
}

/// Make some on-chain remark.
///
/// # <weight>
Expand Down
2 changes: 1 addition & 1 deletion frame/system/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use sp_core::H256;
use sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
BuildStorage,
BuildStorage, Perbill,
};

type UncheckedExtrinsic = mocking::MockUncheckedExtrinsic<Test>;
Expand Down
1 change: 1 addition & 0 deletions frame/utility/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sp-std = { version = "4.0.0", default-features = false, path = "../../primitives

[dev-dependencies]
pallet-balances = { version = "4.0.0-dev", path = "../balances" }
pallet-root-testing = { version = "1.0.0-dev", path = "../root-testing" }
pallet-collective = { version = "4.0.0-dev", path = "../collective" }
pallet-timestamp = { version = "4.0.0-dev", path = "../timestamp" }
sp-core = { version = "6.0.0", path = "../../primitives/core" }
Expand Down
9 changes: 7 additions & 2 deletions frame/utility/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ frame_support::construct_runtime!(
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Timestamp: pallet_timestamp::{Call, Inherent},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
RootTesting: pallet_root_testing::{Pallet, Call, Storage},
Council: pallet_collective::<Instance1>,
Utility: utility::{Pallet, Call, Event},
Example: example::{Pallet, Call},
Expand Down Expand Up @@ -183,6 +184,8 @@ impl pallet_balances::Config for Test {
type WeightInfo = ();
}

impl pallet_root_testing::Config for Test {}

impl pallet_timestamp::Config for Test {
type Moment = u64;
type OnTimestampSet = ();
Expand Down Expand Up @@ -247,6 +250,7 @@ type UtilityCall = crate::Call<Test>;

use frame_system::Call as SystemCall;
use pallet_balances::{Call as BalancesCall, Error as BalancesError};
use pallet_root_testing::Call as RootTestingCall;
use pallet_timestamp::Call as TimestampCall;

pub fn new_test_ext() -> sp_io::TestExternalities {
Expand Down Expand Up @@ -469,8 +473,9 @@ fn batch_early_exit_works() {
fn batch_weight_calculation_doesnt_overflow() {
use sp_runtime::Perbill;
new_test_ext().execute_with(|| {
let big_call =
RuntimeCall::System(SystemCall::fill_block { ratio: Perbill::from_percent(50) });
let big_call = RuntimeCall::RootTesting(RootTestingCall::fill_block {
ratio: Perbill::from_percent(50),
});
assert_eq!(big_call.get_dispatch_info().weight, Weight::MAX / 2);

// 3 * 50% saturates to 100%
Expand Down