Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into altonen-rework-sc-n…
Browse files Browse the repository at this point in the history
…etwork-event-system
  • Loading branch information
altonen committed Nov 28, 2023
2 parents 0b2e718 + ec3a61e commit 76bb0be
Show file tree
Hide file tree
Showing 179 changed files with 1,837 additions and 1,409 deletions.
1 change: 1 addition & 0 deletions .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ check-rust-feature-propagation:
time ./try-runtime ${COMMAND_EXTRA_ARGS} \
--runtime ./target/release/wbuild/"$PACKAGE"/"$WASM" \
on-runtime-upgrade --disable-spec-version-check --checks=all ${SUBCOMMAND_EXTRA_ARGS} live --uri ${URI}
sleep 5
# Check runtime migrations for Parity managed relay chains
check-runtime-migration-westend:
Expand Down
8 changes: 4 additions & 4 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ cargo-check-benches:
SKIP_WASM_BUILD=1 time cargo check --locked --benches --all;
cargo run --locked --release -p node-bench -- ::trie::read::small --json
| tee ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::trie::read::small.json;
echo "___Uploading cache for rusty-cachier___";
echo "___Cache could be uploaded___";
;;
2)
cargo run --locked --release -p node-bench -- ::node::import::sr25519::transfer_keep_alive::paritydb::small --json
Expand Down Expand Up @@ -439,7 +439,7 @@ cargo-check-each-crate:
- .run-immediately
# - .collect-artifacts
variables:
# $CI_JOB_NAME is set manually so that rusty-cachier can share the cache for all
# $CI_JOB_NAME is set manually so that cache could be shared for all jobs
# "cargo-check-each-crate I/N" jobs
CI_JOB_NAME: cargo-check-each-crate
timeout: 2h
Expand All @@ -462,10 +462,10 @@ cargo-check-each-crate-macos:
variables:
SKIP_WASM_BUILD: 1
script:
# TODO: enable rusty-cachier once it supports Mac
# TODO: use parallel jobs, as per cargo-check-each-crate, once more Mac runners are available
# - time ./scripts/ci/gitlab/check-each-crate.py 1 1
- time cargo check --workspace --locked
timeout: 2h
tags:
- osx

Expand All @@ -488,7 +488,7 @@ cargo-hfuzz:
# use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes:
# https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian
# https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr
# https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling rusty-cachier's absolute CARGO_TARGET_DIR
# https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling absolute CARGO_TARGET_DIR
HFUZZ_BUILD_ARGS: >
--config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs"
--config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981"
Expand Down
15 changes: 6 additions & 9 deletions cumulus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ zombienet --provider native spawn ./zombienet/examples/small_network.toml
# Clone
git clone https://github.com/paritytech/polkadot-sdk

# Compile Polkadot
cargo build --release --bin polkadot
# Compile Polkadot's required binaries
cargo build --release -p polkadot

# Generate a raw chain spec
./target/release/polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > rococo-local-cfde.json
Expand All @@ -158,11 +158,8 @@ cargo build --release --bin polkadot
#### Launch the Parachain

```bash
# Clone
git clone https://github.com/paritytech/polkadot-sdk

# Compile
cargo build --release --bin polkadot-parachain
cargo build --release -p polkadot-parachain-bin

# Export genesis state
./target/release/polkadot-parachain export-genesis-state > genesis-state
Expand All @@ -172,15 +169,15 @@ cargo build --release --bin polkadot-parachain

# Collator1
./target/release/polkadot-parachain --collator --alice --force-authoring \
--tmp --port 40335 --rpc-port 9946 -- --chain ../polkadot/rococo-local-cfde.json --port 30335
--tmp --port 40335 --rpc-port 9946 -- --chain rococo-local-cfde.json --port 30335

# Collator2
./target/release/polkadot-parachain --collator --bob --force-authoring \
--tmp --port 40336 --rpc-port 9947 -- --chain ../polkadot/rococo-local-cfde.json --port 30336
--tmp --port 40336 --rpc-port 9947 -- --chain rococo-local-cfde.json --port 30336

# Parachain Full Node 1
./target/release/polkadot-parachain --tmp --port 40337 --rpc-port 9948 -- \
--chain ../polkadot/rococo-local-cfde.json --port 30337
--chain rococo-local-cfde.json --port 30337
```

#### Register the parachain
Expand Down
17 changes: 14 additions & 3 deletions cumulus/client/pov-recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ where
?block_hash,
parent_hash = ?parent,
parent_scheduled_for_recovery,
waiting_blocks = self.waiting_for_parent.len(),
"Waiting for recovery of parent.",
);

Expand Down Expand Up @@ -442,13 +443,13 @@ where
_ => (),
}

self.import_block(block).await;
self.import_block(block);
}

/// Import the given `block`.
///
/// This will also recursivley drain `waiting_for_parent` and import them as well.
async fn import_block(&mut self, block: Block) {
fn import_block(&mut self, block: Block) {
let mut blocks = VecDeque::new();

tracing::debug!(target: LOG_TARGET, block_hash = ?block.hash(), "Importing block retrieved using pov_recovery");
Expand Down Expand Up @@ -551,7 +552,6 @@ where
};

futures::pin_mut!(pending_candidates);

loop {
select! {
pending_candidate = pending_candidates.next() => {
Expand All @@ -573,6 +573,17 @@ where
imported = imported_blocks.next() => {
if let Some(imported) = imported {
self.clear_waiting_recovery(&imported.hash);

// We need to double check that no blocks are waiting for this block.
// Can happen when a waiting child block is queued to wait for parent while the parent block is still
// in the import queue.
if let Some(waiting_blocks) = self.waiting_for_parent.remove(&imported.hash) {
for block in waiting_blocks {
tracing::debug!(target: LOG_TARGET, block_hash = ?block.hash(), resolved_parent = ?imported.hash, "Found new waiting child block during import, queuing.");
self.import_block(block);
}
};

} else {
tracing::debug!(target: LOG_TARGET, "Imported blocks stream ended");
return;
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/relay-chain-inprocess-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ fn build_polkadot_full_node(
config,
polkadot_service::NewFullParams {
is_parachain_node,
grandpa_pause: None,
// Disable BEEFY. It should not be required by the internal relay chain node.
enable_beefy: false,
force_authoring_backoff: false,
jaeger_agent: None,
telemetry_worker_handle,

Expand Down
3 changes: 2 additions & 1 deletion cumulus/pallets/xcmp-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use core::marker::PhantomData;
use cumulus_pallet_parachain_system::AnyRelayNumber;
use cumulus_primitives_core::{ChannelInfo, IsSystem, ParaId};
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, Everything, Nothing, OriginTrait},
BoundedSlice,
};
Expand Down Expand Up @@ -55,6 +55,7 @@ parameter_types! {

type AccountId = u64;

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl<T: Get<MultiLocation>> ContainsPair<MultiAsset, MultiLocation> for AssetsFr
mod tests {
use super::*;
use frame_support::{
parameter_types,
derive_impl, parameter_types,
traits::{ConstU32, FindAuthor, ValidatorRegistration},
PalletId,
};
Expand Down Expand Up @@ -155,6 +155,7 @@ mod tests {
pub const MaxReserves: u32 = 50;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// Substrate
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::{sr25519, storage::Storage};
Expand All @@ -38,7 +37,6 @@ const ENDOWMENT: u128 = 1_000_000 * ROC;
fn session_keys(
babe: BabeId,
grandpa: GrandpaId,
im_online: ImOnlineId,
para_validator: ValidatorId,
para_assignment: AssignmentId,
authority_discovery: AuthorityDiscoveryId,
Expand All @@ -47,7 +45,6 @@ fn session_keys(
rococo_runtime::SessionKeys {
babe,
grandpa,
im_online,
para_validator,
para_assignment,
authority_discovery,
Expand All @@ -74,7 +71,6 @@ pub fn genesis() -> Storage {
x.4.clone(),
x.5.clone(),
x.6.clone(),
x.7.clone(),
get_from_seed::<BeefyId>("Alice"),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// Substrate
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::storage::Storage;
Expand All @@ -39,7 +38,6 @@ const STASH: u128 = 100 * WND;
fn session_keys(
babe: BabeId,
grandpa: GrandpaId,
im_online: ImOnlineId,
para_validator: ValidatorId,
para_assignment: AssignmentId,
authority_discovery: AuthorityDiscoveryId,
Expand All @@ -48,7 +46,6 @@ fn session_keys(
westend_runtime::SessionKeys {
babe,
grandpa,
im_online,
para_validator,
para_assignment,
authority_discovery,
Expand All @@ -75,7 +72,6 @@ pub fn genesis() -> Storage {
x.4.clone(),
x.5.clone(),
x.6.clone(),
x.7.clone(),
get_from_seed::<BeefyId>("Alice"),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub use xcm_emulator;

// Substrate
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::{sr25519, storage::Storage, Pair, Public};
Expand Down Expand Up @@ -163,7 +162,6 @@ pub mod validators {
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/pallets/collective-content/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
pub use crate as pallet_collective_content;
use crate::WeightInfo;
use frame_support::{
ord_parameter_types, parameter_types,
derive_impl, ord_parameter_types, parameter_types,
traits::{ConstU32, ConstU64},
weights::Weight,
};
Expand Down Expand Up @@ -55,6 +55,7 @@ impl pallet_collective_content::Config for Test {
type WeightInfo = CCWeightInfo;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = ();
type BlockWeights = ();
Expand Down
4 changes: 3 additions & 1 deletion cumulus/parachains/runtimes/starters/seedling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use sp_version::RuntimeVersion;

// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
Expand Down Expand Up @@ -134,6 +134,8 @@ parameter_types! {
.build_or_panic();
pub const SS58Prefix: u8 = 42;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/runtimes/starters/shell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use sp_version::RuntimeVersion;

// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
Expand Down Expand Up @@ -143,6 +143,7 @@ parameter_types! {
pub const SS58Prefix: u8 = 42;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub mod xcm_config;
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
pallet_prelude::Weight,
Expand Down Expand Up @@ -323,6 +323,7 @@ parameter_types! {

// Configure FRAME pallets to include in runtime.

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use sp_version::RuntimeVersion;

// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime,
construct_runtime, derive_impl,
dispatch::DispatchClass,
genesis_builder_helper::{build_config, create_default_config},
match_types, parameter_types,
Expand Down Expand Up @@ -184,6 +184,7 @@ parameter_types! {
pub const SS58Prefix: u8 = 42;
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
Expand Down
Loading

0 comments on commit 76bb0be

Please sign in to comment.