Bump dependencies (#1180)

* substrate: d0f6c1c60da22e04dd25c2eca46ebfe6f1571af0
polkadot: dd4b2e6a34a08a01b876d14641e99e7011be3463
cumulus: 9379cd6c18

* fmt

* fixed lost refs

* spelling

* benckhmarks

* fmt
This commit is contained in:
Svyatoslav Nikolsky
2021-10-25 13:24:36 +03:00
committed by Bastian Köcher
parent 6396239e18
commit e23266c7e6
78 changed files with 510 additions and 376 deletions
@@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
log = { version = "0.4.14", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }
# Bridge dependencies
@@ -38,6 +39,7 @@ std = [
"frame-support/std",
"frame-system/std",
"log/std",
"scale-info/std",
"serde",
"sp-runtime/std",
"sp-std/std",
+2
View File
@@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
log = { version = "0.4.14", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
# Bridge dependencies
@@ -34,6 +35,7 @@ std = [
"frame-support/std",
"frame-system/std",
"log/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
+29 -31
View File
@@ -22,7 +22,6 @@
//! a successful dispatch an event is emitted.
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]
// Generated by `decl_event!`
#![allow(clippy::unused_unit)]
@@ -111,7 +110,6 @@ pub mod pallet {
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pallet::metadata(<T as frame_system::Config>::AccountId = "AccountId", BridgeMessageIdOf<T, I> = "BridgeMessageId")]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// Message has been rejected before reaching dispatch.
MessageRejected(ChainId, BridgeMessageIdOf<T, I>),
@@ -431,6 +429,7 @@ mod tests {
use codec::Decode;
use frame_support::{parameter_types, weights::Weight};
use frame_system::{EventRecord, Phase};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
testing::Header,
@@ -444,7 +443,7 @@ mod tests {
const SOURCE_CHAIN_ID: ChainId = *b"srce";
const TARGET_CHAIN_ID: ChainId = *b"trgt";
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct TestAccountPublic(AccountId);
impl IdentifyAccount for TestAccountPublic {
@@ -455,7 +454,7 @@ mod tests {
}
}
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct TestSignature(AccountId);
impl Verify for TestSignature {
@@ -548,7 +547,7 @@ mod tests {
impl Contains<Call> for TestCallFilter {
fn contains(call: &Call) -> bool {
!matches!(*call, Call::System(frame_system::Call::fill_block(_)))
!matches!(*call, Call::System(frame_system::Call::fill_block { .. }))
}
}
@@ -611,9 +610,9 @@ mod tests {
let id = [0; 4];
const BAD_SPEC_VERSION: SpecVersion = 99;
let mut message = prepare_root_message(Call::System(
<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]),
));
let mut message = prepare_root_message(Call::System(frame_system::Call::remark {
remark: vec![1, 2, 3],
}));
let weight = message.weight;
message.spec_version = BAD_SPEC_VERSION;
@@ -650,7 +649,7 @@ mod tests {
fn should_fail_on_weight_mismatch() {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]));
let call = Call::System(frame_system::Call::remark { remark: vec![1, 2, 3] });
let call_weight = call.get_dispatch_info().weight;
let mut message = prepare_root_message(call);
message.weight = 7;
@@ -693,7 +692,7 @@ mod tests {
let call_origin = CallOrigin::TargetAccount(1, TestAccountPublic(1), TestSignature(99));
let message = prepare_message(
call_origin,
Call::System(<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3])),
Call::System(frame_system::Call::remark { remark: vec![1, 2, 3] }),
);
let weight = message.weight;
@@ -757,9 +756,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let mut message = prepare_root_message(Call::System(
<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]),
));
let mut message = prepare_root_message(Call::System(frame_system::Call::remark {
remark: vec![1, 2, 3],
}));
let weight = message.weight;
message.call.0 = vec![];
@@ -795,9 +794,8 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(<frame_system::Call<TestRuntime>>::fill_block(
Perbill::from_percent(75),
));
let call =
Call::System(frame_system::Call::fill_block { ratio: Perbill::from_percent(75) });
let weight = call.get_dispatch_info().weight;
let mut message = prepare_root_message(call);
message.weight = weight;
@@ -834,9 +832,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let mut message = prepare_root_message(Call::System(
<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]),
));
let mut message = prepare_root_message(Call::System(frame_system::Call::remark {
remark: vec![1, 2, 3],
}));
let weight = message.weight;
message.dispatch_fee_payment = DispatchFeePayment::AtTargetChain;
@@ -874,9 +872,9 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let mut message = prepare_root_message(Call::System(
<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]),
));
let mut message = prepare_root_message(Call::System(frame_system::Call::remark {
remark: vec![1, 2, 3],
}));
message.dispatch_fee_payment = DispatchFeePayment::AtTargetChain;
System::set_block_number(1);
@@ -910,7 +908,7 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(<frame_system::Call<TestRuntime>>::set_heap_pages(1));
let call = Call::System(frame_system::Call::set_heap_pages { pages: 1 });
let message = prepare_target_message(call);
System::set_block_number(1);
@@ -943,9 +941,9 @@ mod tests {
fn should_dispatch_bridge_message_from_root_origin() {
new_test_ext().execute_with(|| {
let id = [0; 4];
let message = prepare_root_message(Call::System(
<frame_system::Call<TestRuntime>>::remark(vec![1, 2, 3]),
));
let message = prepare_root_message(Call::System(frame_system::Call::remark {
remark: vec![1, 2, 3],
}));
System::set_block_number(1);
let result = Dispatch::dispatch(
@@ -978,7 +976,7 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::remark { remark: vec![] });
let message = prepare_target_message(call);
System::set_block_number(1);
@@ -1012,7 +1010,7 @@ mod tests {
new_test_ext().execute_with(|| {
let id = [0; 4];
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::remark { remark: vec![] });
let message = prepare_source_message(call);
System::set_block_number(1);
@@ -1043,7 +1041,7 @@ mod tests {
#[test]
fn origin_is_checked_when_verifying_sending_message_using_source_root_account() {
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::remark { remark: vec![] });
let message = prepare_root_message(call);
// When message is sent by Root, CallOrigin::SourceRoot is allowed
@@ -1055,7 +1053,7 @@ mod tests {
#[test]
fn origin_is_checked_when_verifying_sending_message_using_target_account() {
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::remark { remark: vec![] });
let message = prepare_target_message(call);
// When message is sent by Root, CallOrigin::TargetAccount is not allowed
@@ -1071,7 +1069,7 @@ mod tests {
#[test]
fn origin_is_checked_when_verifying_sending_message_using_source_account() {
let call = Call::System(<frame_system::Call<TestRuntime>>::remark(vec![]));
let call = Call::System(frame_system::Call::remark { remark: vec![] });
let message = prepare_source_message(call);
// Sending a message from the expected origin account works
+2
View File
@@ -10,6 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
libsecp256k1 = { version = "0.7", default-features = false, features = ["hmac"], optional = true }
log = { version = "0.4.14", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }
# Bridge dependencies
@@ -38,6 +39,7 @@ std = [
"frame-support/std",
"frame-system/std",
"log/std",
"scale-info/std",
"serde",
"sp-io/std",
"sp-runtime/std",
+3 -2
View File
@@ -17,6 +17,7 @@
use crate::{error::Error, Storage};
use bp_eth_poa::{public_to_address, Address, AuraHeader, HeaderId, SealedEmptyStep, H256};
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use sp_io::crypto::secp256k1_ecdsa_recover;
use sp_runtime::RuntimeDebug;
use sp_std::{
@@ -55,7 +56,7 @@ pub struct FinalityEffects<Submitter> {
}
/// Finality votes for given block.
#[derive(RuntimeDebug, Decode, Encode)]
#[derive(RuntimeDebug, Decode, Encode, TypeInfo)]
#[cfg_attr(test, derive(Clone, PartialEq))]
pub struct FinalityVotes<Submitter> {
/// Number of votes per each validator.
@@ -66,7 +67,7 @@ pub struct FinalityVotes<Submitter> {
}
/// Information about block ancestor that is used in computations.
#[derive(RuntimeDebug, Decode, Encode)]
#[derive(RuntimeDebug, Decode, Encode, TypeInfo)]
#[cfg_attr(test, derive(Clone, Default, PartialEq))]
pub struct FinalityAncestor<Submitter> {
/// Bock id.
+6 -5
View File
@@ -24,6 +24,7 @@ use bp_eth_poa::{
};
use codec::{Decode, Encode};
use frame_support::traits::Get;
use scale_info::TypeInfo;
use sp_runtime::RuntimeDebug;
use sp_std::{boxed::Box, cmp::Ord, collections::btree_map::BTreeMap, prelude::*};
@@ -81,7 +82,7 @@ pub struct PoolConfiguration {
}
/// Block header as it is stored in the runtime storage.
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug)]
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
pub struct StoredHeader<Submitter> {
/// Submitter of this header. May be `None` if header has been submitted
/// using unsigned transaction.
@@ -102,7 +103,7 @@ pub struct StoredHeader<Submitter> {
}
/// Validators set as it is stored in the runtime storage.
#[derive(Encode, Decode, PartialEq, RuntimeDebug)]
#[derive(Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
#[cfg_attr(test, derive(Clone))]
pub struct ValidatorsSet {
/// Validators of this set.
@@ -114,7 +115,7 @@ pub struct ValidatorsSet {
}
/// Validators set change as it is stored in the runtime storage.
#[derive(Encode, Decode, PartialEq, RuntimeDebug)]
#[derive(Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
#[cfg_attr(test, derive(Clone))]
pub struct AuraScheduledChange {
/// Validators of this set.
@@ -158,7 +159,7 @@ pub struct ChangeToEnact {
}
/// Blocks range that we want to prune.
#[derive(Encode, Decode, Default, RuntimeDebug, Clone, PartialEq)]
#[derive(Encode, Decode, Default, RuntimeDebug, Clone, PartialEq, TypeInfo)]
struct PruningRange {
/// Number of the oldest unpruned block(s). This might be the block that we do not
/// want to prune now (then it is equal to `oldest_block_to_keep`), or block that we
@@ -478,7 +479,7 @@ pub mod pallet {
fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity {
match *call {
Self::Call::import_unsigned_header(ref header, ref receipts) => {
Self::Call::import_unsigned_header { ref header, ref receipts } => {
let accept_result = verification::accept_aura_header_into_pool(
&BridgeStorage::<T, I>::new(),
&T::AuraConfiguration::get(),
+3
View File
@@ -12,6 +12,7 @@ codec = { package = "parity-scale-codec", version = "2.2.0", default-features =
finality-grandpa = { version = "0.14.0", default-features = false }
log = { version = "0.4.14", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }
# Bridge Dependencies
@@ -33,6 +34,7 @@ bp-test-utils = { path = "../../primitives/test-utils", default-features = false
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
[features]
@@ -47,6 +49,7 @@ std = [
"frame-system/std",
"log/std",
"num-traits/std",
"scale-info/std",
"serde",
"sp-finality-grandpa/std",
"sp-runtime/std",
+3 -2
View File
@@ -19,10 +19,11 @@
use bp_runtime::Chain;
use frame_support::{construct_runtime, parameter_types, weights::Weight};
use sp_core::sr25519::Signature;
use sp_runtime::{
testing::{Header, H256},
traits::{BlakeTwo256, IdentityLookup},
AnySignature, Perbill,
Perbill,
};
pub type AccountId = u64;
@@ -105,7 +106,7 @@ impl Chain for TestBridgedChain {
type AccountId = AccountId;
type Balance = u64;
type Index = u64;
type Signature = AnySignature;
type Signature = Signature;
}
pub fn run_test<T>(test: impl FnOnce() -> T) -> T {
+2
View File
@@ -11,6 +11,7 @@ bitvec = { version = "0.20", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
log = { version = "0.4.14", default-features = false }
num-traits = { version = "0.2", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
# Bridge dependencies
@@ -45,6 +46,7 @@ std = [
"frame-system/std",
"log/std",
"num-traits/std",
"scale-info/std",
"serde",
"sp-core/std",
"sp-runtime/std",
-1
View File
@@ -652,7 +652,6 @@ pub mod pallet {
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pallet::metadata(T::Parameter = "Parameter")]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// Pallet parameter has been updated.
ParameterUpdated(T::Parameter),
+5 -4
View File
@@ -37,6 +37,7 @@ use frame_support::{
parameter_types,
weights::{RuntimeDbWeight, Weight},
};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
testing::Header as SubstrateHeader,
@@ -50,7 +51,7 @@ use std::{
pub type AccountId = u64;
pub type Balance = u64;
#[derive(Decode, Encode, Clone, Debug, PartialEq, Eq)]
#[derive(Decode, Encode, Clone, Debug, PartialEq, Eq, TypeInfo)]
pub struct TestPayload {
/// Field that may be used to identify messages.
pub id: u64,
@@ -150,7 +151,7 @@ parameter_types! {
pub const TestBridgedChainId: bp_runtime::ChainId = *b"test";
}
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)]
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq, TypeInfo)]
pub enum TestMessagesParameter {
TokenConversionRate(FixedU128),
}
@@ -226,7 +227,7 @@ pub const PAYLOAD_REJECTED_BY_TARGET_CHAIN: TestPayload = message_payload(1, 50)
pub type MessagesByLaneVec = Vec<(LaneId, ProvedLaneMessages<Message<TestMessageFee>>)>;
/// Test messages proof.
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct TestMessagesProof {
pub result: Result<MessagesByLaneVec, ()>,
}
@@ -255,7 +256,7 @@ impl From<Result<Vec<Message<TestMessageFee>>, ()>> for TestMessagesProof {
}
/// Messages delivery proof used in tests.
#[derive(Debug, Encode, Decode, Eq, Clone, PartialEq)]
#[derive(Debug, Encode, Decode, Eq, Clone, PartialEq, TypeInfo)]
pub struct TestMessagesDeliveryProof(pub Result<(LaneId, InboundLaneData<TestRelayer>), ()>);
impl Size for TestMessagesDeliveryProof {
@@ -8,6 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
# Substrate Dependencies
@@ -28,6 +29,7 @@ std = [
"frame-support/std",
"frame-system/std",
"pallet-session/std",
"scale-info/std",
"sp-staking/std",
"sp-std/std",
]
@@ -109,6 +109,7 @@ mod tests {
traits::{BlakeTwo256, ConvertInto, IdentityLookup},
Perbill, RuntimeAppPublic,
},
traits::GenesisBuild,
weights::Weight,
BasicExternalities,
};
@@ -177,7 +178,6 @@ mod tests {
type SessionManager = ();
type SessionHandler = TestSessionHandler;
type Keys = UintAuthorityId;
type DisabledValidatorsThreshold = ();
type WeightInfo = ();
}
@@ -197,7 +197,7 @@ mod tests {
) {
}
fn on_disabled(_: usize) {}
fn on_disabled(_: u32) {}
}
fn new_test_ext() -> TestExternalities {
+2
View File
@@ -9,6 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
log = { version = "0.4.14", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true }
# Bridge dependencies
@@ -46,6 +47,7 @@ std = [
"log/std",
"pallet-bridge-dispatch/std",
"pallet-bridge-messages/std",
"scale-info/std",
"serde",
"sp-core/std",
"sp-io/std",