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

Commit f7e8b48

Browse files
author
parity-processbot
committed
Merge remote-tracking branch 'origin/master' into bkchr-trie-recorder-transactions
2 parents 99f41d2 + dd45632 commit f7e8b48

File tree

62 files changed

+3325
-2121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3325
-2121
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ variables:
5050
ARCH: "x86_64"
5151
CI_IMAGE: "paritytech/ci-linux:production"
5252
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27"
53+
RELENG_SCRIPTS_BRANCH: "master"
5354
RUSTY_CACHIER_SINGLE_BRANCH: master
5455
RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true"
5556
RUSTY_CACHIER_COMPRESSION_METHOD: zstd
5657
NEXTEST_FAILURE_OUTPUT: immediate-final
5758
NEXTEST_SUCCESS_OUTPUT: final
58-
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.37"
59+
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.43"
5960

6061
.shared-default: &shared-default
6162
retry:

Cargo.lock

Lines changed: 9 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node/runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sp-io = { version = "7.0.0", default-features = false, path = "../../../primitiv
4646
frame-executive = { version = "4.0.0-dev", default-features = false, path = "../../../frame/executive" }
4747
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../../frame/benchmarking" }
4848
frame-benchmarking-pallet-pov = { version = "4.0.0-dev", default-features = false, path = "../../../frame/benchmarking/pov" }
49-
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../../frame/support" }
49+
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../../frame/support", features = ["tuples-96"] }
5050
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../../frame/system" }
5151
frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../../frame/system/benchmarking", optional = true }
5252
frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../../../frame/election-provider-support" }

bin/node/runtime/src/lib.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,10 @@ impl pallet_scheduler::Config for Runtime {
364364
type RuntimeCall = RuntimeCall;
365365
type MaximumWeight = MaximumSchedulerWeight;
366366
type ScheduleOrigin = EnsureRoot<AccountId>;
367+
#[cfg(feature = "runtime-benchmarks")]
367368
type MaxScheduledPerBlock = ConstU32<512>;
369+
#[cfg(not(feature = "runtime-benchmarks"))]
370+
type MaxScheduledPerBlock = ConstU32<50>;
368371
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
369372
type OriginPrivilegeCmp = EqualPrivilegeOnly;
370373
type Preimages = Preimage;
@@ -1198,13 +1201,6 @@ impl pallet_tips::Config for Runtime {
11981201
parameter_types! {
11991202
pub const DepositPerItem: Balance = deposit(1, 0);
12001203
pub const DepositPerByte: Balance = deposit(0, 1);
1201-
pub const DeletionQueueDepth: u32 = 128;
1202-
// The lazy deletion runs inside on_initialize.
1203-
pub DeletionWeightLimit: Weight = RuntimeBlockWeights::get()
1204-
.per_class
1205-
.get(DispatchClass::Normal)
1206-
.max_total
1207-
.unwrap_or(RuntimeBlockWeights::get().max_block);
12081204
pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();
12091205
}
12101206

@@ -1227,8 +1223,6 @@ impl pallet_contracts::Config for Runtime {
12271223
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
12281224
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
12291225
type ChainExtension = ();
1230-
type DeletionQueueDepth = DeletionQueueDepth;
1231-
type DeletionWeightLimit = DeletionWeightLimit;
12321226
type Schedule = Schedule;
12331227
type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
12341228
type MaxCodeLen = ConstU32<{ 123 * 1024 }>;

client/consensus/aura/src/import_queue.rs

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! Module implementing the logic for verifying and importing AuRa blocks.
2020
2121
use crate::{
22-
aura_err, authorities, find_pre_digest, slot_author, AuthorityId, CompatibilityMode, Error,
22+
authorities, standalone::SealVerificationError, AuthorityId, CompatibilityMode, Error,
2323
LOG_TARGET,
2424
};
2525
use codec::{Codec, Decode, Encode};
@@ -36,7 +36,7 @@ use sp_api::{ApiExt, ProvideRuntimeApi};
3636
use sp_block_builder::BlockBuilder as BlockBuilderApi;
3737
use sp_blockchain::HeaderBackend;
3838
use sp_consensus::Error as ConsensusError;
39-
use sp_consensus_aura::{digests::CompatibleDigestItem, inherents::AuraInherentData, AuraApi};
39+
use sp_consensus_aura::{inherents::AuraInherentData, AuraApi};
4040
use sp_consensus_slots::Slot;
4141
use sp_core::{crypto::Pair, ExecutionContext};
4242
use sp_inherents::{CreateInherentDataProviders, InherentDataProvider as _};
@@ -54,7 +54,7 @@ use std::{fmt::Debug, hash::Hash, marker::PhantomData, sync::Arc};
5454
fn check_header<C, B: BlockT, P: Pair>(
5555
client: &C,
5656
slot_now: Slot,
57-
mut header: B::Header,
57+
header: B::Header,
5858
hash: B::Hash,
5959
authorities: &[AuthorityId<P>],
6060
check_for_equivocation: CheckForEquivocation,
@@ -64,27 +64,16 @@ where
6464
C: sc_client_api::backend::AuxStore,
6565
P::Public: Encode + Decode + PartialEq + Clone,
6666
{
67-
let seal = header.digest_mut().pop().ok_or(Error::HeaderUnsealed(hash))?;
68-
69-
let sig = seal.as_aura_seal().ok_or_else(|| aura_err(Error::HeaderBadSeal(hash)))?;
70-
71-
let slot = find_pre_digest::<B, P::Signature>(&header)?;
72-
73-
if slot > slot_now {
74-
header.digest_mut().push(seal);
75-
Ok(CheckedHeader::Deferred(header, slot))
76-
} else {
77-
// check the signature is valid under the expected authority and
78-
// chain state.
79-
let expected_author =
80-
slot_author::<P>(slot, authorities).ok_or(Error::SlotAuthorNotFound)?;
81-
82-
let pre_hash = header.hash();
83-
84-
if P::verify(&sig, pre_hash.as_ref(), expected_author) {
85-
if check_for_equivocation.check_for_equivocation() {
67+
let check_result =
68+
crate::standalone::check_header_slot_and_seal::<B, P>(slot_now, header, authorities);
69+
70+
match check_result {
71+
Ok((header, slot, seal)) => {
72+
let expected_author = crate::standalone::slot_author::<P>(slot, &authorities);
73+
let should_equiv_check = check_for_equivocation.check_for_equivocation();
74+
if let (true, Some(expected)) = (should_equiv_check, expected_author) {
8675
if let Some(equivocation_proof) =
87-
check_equivocation(client, slot_now, slot, &header, expected_author)
76+
check_equivocation(client, slot_now, slot, &header, expected)
8877
.map_err(Error::Client)?
8978
{
9079
info!(
@@ -98,9 +87,14 @@ where
9887
}
9988

10089
Ok(CheckedHeader::Checked(header, (slot, seal)))
101-
} else {
102-
Err(Error::BadSignature(hash))
103-
}
90+
},
91+
Err(SealVerificationError::Deferred(header, slot)) =>
92+
Ok(CheckedHeader::Deferred(header, slot)),
93+
Err(SealVerificationError::Unsealed) => Err(Error::HeaderUnsealed(hash)),
94+
Err(SealVerificationError::BadSeal) => Err(Error::HeaderBadSeal(hash)),
95+
Err(SealVerificationError::BadSignature) => Err(Error::BadSignature(hash)),
96+
Err(SealVerificationError::SlotAuthorNotFound) => Err(Error::SlotAuthorNotFound),
97+
Err(SealVerificationError::InvalidPreDigest(e)) => Err(Error::from(e)),
10498
}
10599
}
106100

0 commit comments

Comments
 (0)