mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
Move cumulus zombienet tests to aura & async backing (#3568)
Cumulus test-parachain node and test runtime were still using relay chain consensus and 12s blocktimes. With async backing around the corner on the major chains we should switch our tests too. Also needed to nicely test the changes coming to collators in #3168. ### Changes Overview - Followed the [migration guide](https://wiki.polkadot.network/docs/maintain-guides-async-backing) for async backing for the cumulus-test-runtime - Adjusted the cumulus-test-service to use the correct import-queue, lookahead collator etc. - The block validation function now uses the Aura Ext Executor so that the seal of the block is validated - Previous point requires that we seal block before calling into `validate_block`, I introduced a helper function for that - Test client adjusted to provide a slot to the relay chain proof and the aura pre-digest
This commit is contained in:
Generated
+22
-5
@@ -3885,6 +3885,7 @@ dependencies = [
|
||||
"cumulus-primitives-proof-size-hostfunction",
|
||||
"cumulus-test-client",
|
||||
"cumulus-test-relay-sproof-builder",
|
||||
"cumulus-test-runtime",
|
||||
"environmental",
|
||||
"frame-benchmarking",
|
||||
"frame-support",
|
||||
@@ -3902,6 +3903,7 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
"sc-client-api",
|
||||
"scale-info",
|
||||
"sp-consensus-slots",
|
||||
"sp-core",
|
||||
"sp-crypto-hashing",
|
||||
"sp-externalities 0.25.0",
|
||||
@@ -4264,15 +4266,19 @@ dependencies = [
|
||||
"polkadot-primitives",
|
||||
"sc-block-builder",
|
||||
"sc-consensus",
|
||||
"sc-consensus-aura",
|
||||
"sc-executor",
|
||||
"sc-executor-common",
|
||||
"sc-service",
|
||||
"sp-api",
|
||||
"sp-application-crypto",
|
||||
"sp-blockchain",
|
||||
"sp-consensus-aura",
|
||||
"sp-core",
|
||||
"sp-inherents",
|
||||
"sp-io",
|
||||
"sp-keyring",
|
||||
"sp-keystore",
|
||||
"sp-runtime",
|
||||
"sp-timestamp",
|
||||
"substrate-test-client",
|
||||
@@ -4295,16 +4301,22 @@ dependencies = [
|
||||
name = "cumulus-test-runtime"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cumulus-pallet-aura-ext",
|
||||
"cumulus-pallet-parachain-system",
|
||||
"cumulus-primitives-aura",
|
||||
"cumulus-primitives-core",
|
||||
"cumulus-primitives-storage-weight-reclaim",
|
||||
"frame-executive",
|
||||
"frame-support",
|
||||
"frame-system",
|
||||
"frame-system-rpc-runtime-api",
|
||||
"pallet-aura",
|
||||
"pallet-authorship",
|
||||
"pallet-balances",
|
||||
"pallet-collator-selection",
|
||||
"pallet-glutton",
|
||||
"pallet-message-queue",
|
||||
"pallet-session",
|
||||
"pallet-sudo",
|
||||
"pallet-timestamp",
|
||||
"pallet-transaction-payment",
|
||||
@@ -4312,6 +4324,7 @@ dependencies = [
|
||||
"scale-info",
|
||||
"sp-api",
|
||||
"sp-block-builder",
|
||||
"sp-consensus-aura",
|
||||
"sp-core",
|
||||
"sp-genesis-builder",
|
||||
"sp-inherents",
|
||||
@@ -4333,7 +4346,10 @@ dependencies = [
|
||||
"clap 4.5.3",
|
||||
"criterion 0.5.1",
|
||||
"cumulus-client-cli",
|
||||
"cumulus-client-collator",
|
||||
"cumulus-client-consensus-aura",
|
||||
"cumulus-client-consensus-common",
|
||||
"cumulus-client-consensus-proposer",
|
||||
"cumulus-client-consensus-relay-chain",
|
||||
"cumulus-client-parachain-inherent",
|
||||
"cumulus-client-pov-recovery",
|
||||
@@ -4370,6 +4386,7 @@ dependencies = [
|
||||
"sc-cli",
|
||||
"sc-client-api",
|
||||
"sc-consensus",
|
||||
"sc-consensus-aura",
|
||||
"sc-executor",
|
||||
"sc-executor-common",
|
||||
"sc-executor-wasmtime",
|
||||
@@ -4386,6 +4403,7 @@ dependencies = [
|
||||
"sp-authority-discovery",
|
||||
"sp-blockchain",
|
||||
"sp-consensus",
|
||||
"sp-consensus-aura",
|
||||
"sp-consensus-grandpa",
|
||||
"sp-core",
|
||||
"sp-io",
|
||||
@@ -21103,11 +21121,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.37"
|
||||
version = "0.1.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
|
||||
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"log",
|
||||
"pin-project-lite 0.2.12",
|
||||
"tracing-attributes",
|
||||
@@ -21116,9 +21133,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.26"
|
||||
version = "0.1.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
|
||||
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
||||
@@ -381,13 +381,11 @@ mod tests {
|
||||
sproof.included_para_head = Some(HeadData(parent.encode()));
|
||||
sproof.para_id = cumulus_test_runtime::PARACHAIN_ID.into();
|
||||
|
||||
let builder = self.client.init_block_builder_at(
|
||||
parent.hash(),
|
||||
Some(validation_data.clone()),
|
||||
sproof,
|
||||
);
|
||||
let cumulus_test_client::BlockBuilderAndSupportData { block_builder, .. } = self
|
||||
.client
|
||||
.init_block_builder_at(parent.hash(), Some(validation_data.clone()), sproof);
|
||||
|
||||
let (block, _, proof) = builder.build().expect("Creates block").into_inner();
|
||||
let (block, _, proof) = block_builder.build().expect("Creates block").into_inner();
|
||||
|
||||
self.client
|
||||
.import(BlockOrigin::Own, block.clone())
|
||||
|
||||
@@ -274,7 +274,7 @@ fn build_block<B: InitBlockBuilder>(
|
||||
timestamp: Option<u64>,
|
||||
relay_parent: Option<PHash>,
|
||||
) -> Block {
|
||||
let builder = match at {
|
||||
let cumulus_test_client::BlockBuilderAndSupportData { block_builder, .. } = match at {
|
||||
Some(at) => match timestamp {
|
||||
Some(ts) => builder.init_block_builder_with_timestamp(at, None, sproof, ts),
|
||||
None => builder.init_block_builder_at(at, None, sproof),
|
||||
@@ -282,7 +282,7 @@ fn build_block<B: InitBlockBuilder>(
|
||||
None => builder.init_block_builder(None, sproof),
|
||||
};
|
||||
|
||||
let mut block = builder.build().unwrap().block;
|
||||
let mut block = block_builder.build().unwrap().block;
|
||||
|
||||
if let Some(relay_parent) = relay_parent {
|
||||
block
|
||||
@@ -503,7 +503,7 @@ fn follow_finalized_does_not_stop_on_unknown_block() {
|
||||
|
||||
let unknown_block = {
|
||||
let sproof = sproof_with_parent_by_hash(&client, block.hash());
|
||||
let block_builder = client.init_block_builder_at(block.hash(), None, sproof);
|
||||
let block_builder = client.init_block_builder_at(block.hash(), None, sproof).block_builder;
|
||||
block_builder.build().unwrap().block
|
||||
};
|
||||
|
||||
@@ -553,7 +553,7 @@ fn follow_new_best_sets_best_after_it_is_imported() {
|
||||
|
||||
let unknown_block = {
|
||||
let sproof = sproof_with_parent_by_hash(&client, block.hash());
|
||||
let block_builder = client.init_block_builder_at(block.hash(), None, sproof);
|
||||
let block_builder = client.init_block_builder_at(block.hash(), None, sproof).block_builder;
|
||||
block_builder.build().unwrap().block
|
||||
};
|
||||
|
||||
@@ -665,8 +665,8 @@ fn do_not_set_best_block_to_older_block() {
|
||||
fn prune_blocks_on_level_overflow() {
|
||||
// Here we are using the timestamp value to generate blocks with different hashes.
|
||||
const LEVEL_LIMIT: usize = 3;
|
||||
const TIMESTAMP_MULTIPLIER: u64 = 60000;
|
||||
|
||||
let mut ts_producer = std::iter::successors(Some(0), |&x| Some(x + 6000));
|
||||
let backend = Arc::new(Backend::new_test(1000, 3));
|
||||
let client = Arc::new(TestClientBuilder::with_backend(backend.clone()).build());
|
||||
let mut para_import = ParachainBlockImport::new_with_limit(
|
||||
@@ -675,13 +675,14 @@ fn prune_blocks_on_level_overflow() {
|
||||
LevelLimit::Some(LEVEL_LIMIT),
|
||||
);
|
||||
|
||||
let best_hash = client.chain_info().best_hash;
|
||||
let block0 = build_and_import_block_ext(
|
||||
&client,
|
||||
BlockOrigin::NetworkInitialSync,
|
||||
true,
|
||||
&mut para_import,
|
||||
None,
|
||||
None,
|
||||
Some(best_hash),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
);
|
||||
let id0 = block0.header.hash();
|
||||
@@ -694,7 +695,7 @@ fn prune_blocks_on_level_overflow() {
|
||||
i == 1,
|
||||
&mut para_import,
|
||||
Some(id0),
|
||||
Some(i as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
)
|
||||
})
|
||||
@@ -702,14 +703,14 @@ fn prune_blocks_on_level_overflow() {
|
||||
let id10 = blocks1[0].header.hash();
|
||||
|
||||
let blocks2 = (0..2)
|
||||
.map(|i| {
|
||||
.map(|_| {
|
||||
build_and_import_block_ext(
|
||||
&client,
|
||||
BlockOrigin::Own,
|
||||
false,
|
||||
&mut para_import,
|
||||
Some(id10),
|
||||
Some(i as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
)
|
||||
})
|
||||
@@ -738,7 +739,7 @@ fn prune_blocks_on_level_overflow() {
|
||||
false,
|
||||
&mut para_import,
|
||||
Some(id0),
|
||||
Some(LEVEL_LIMIT as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
);
|
||||
|
||||
@@ -758,7 +759,7 @@ fn prune_blocks_on_level_overflow() {
|
||||
false,
|
||||
&mut para_import,
|
||||
Some(id0),
|
||||
Some(2 * LEVEL_LIMIT as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
);
|
||||
|
||||
@@ -779,8 +780,8 @@ fn prune_blocks_on_level_overflow() {
|
||||
fn restore_limit_monitor() {
|
||||
// Here we are using the timestamp value to generate blocks with different hashes.
|
||||
const LEVEL_LIMIT: usize = 2;
|
||||
const TIMESTAMP_MULTIPLIER: u64 = 60000;
|
||||
|
||||
// Iterator that produces a new timestamp in the next slot
|
||||
let mut ts_producer = std::iter::successors(Some(0), |&x| Some(x + 6000));
|
||||
let backend = Arc::new(Backend::new_test(1000, 3));
|
||||
let client = Arc::new(TestClientBuilder::with_backend(backend.clone()).build());
|
||||
|
||||
@@ -791,13 +792,14 @@ fn restore_limit_monitor() {
|
||||
LevelLimit::Some(usize::MAX),
|
||||
);
|
||||
|
||||
let best_hash = client.chain_info().best_hash;
|
||||
let block00 = build_and_import_block_ext(
|
||||
&client,
|
||||
BlockOrigin::NetworkInitialSync,
|
||||
true,
|
||||
&mut para_import,
|
||||
None,
|
||||
None,
|
||||
Some(best_hash),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
);
|
||||
let id00 = block00.header.hash();
|
||||
@@ -810,26 +812,24 @@ fn restore_limit_monitor() {
|
||||
i == 1,
|
||||
&mut para_import,
|
||||
Some(id00),
|
||||
Some(i as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let id10 = blocks1[0].header.hash();
|
||||
|
||||
let _ = (0..LEVEL_LIMIT)
|
||||
.map(|i| {
|
||||
for _ in 0..LEVEL_LIMIT {
|
||||
build_and_import_block_ext(
|
||||
&client,
|
||||
BlockOrigin::Own,
|
||||
false,
|
||||
&mut para_import,
|
||||
Some(id10),
|
||||
Some(i as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
);
|
||||
}
|
||||
|
||||
// Scenario before limit application (with B11 imported as best)
|
||||
// Import order (freshness): B00, B10, B11, B12, B20, B21
|
||||
@@ -860,7 +860,7 @@ fn restore_limit_monitor() {
|
||||
false,
|
||||
&mut para_import,
|
||||
Some(id00),
|
||||
Some(LEVEL_LIMIT as u64 * TIMESTAMP_MULTIPLIER),
|
||||
ts_producer.next(),
|
||||
None,
|
||||
);
|
||||
|
||||
|
||||
@@ -59,10 +59,12 @@ sp-keyring = { path = "../../../substrate/primitives/keyring" }
|
||||
sp-crypto-hashing = { path = "../../../substrate/primitives/crypto/hashing" }
|
||||
sp-tracing = { path = "../../../substrate/primitives/tracing" }
|
||||
sp-version = { path = "../../../substrate/primitives/version" }
|
||||
sp-consensus-slots = { path = "../../../substrate/primitives/consensus/slots" }
|
||||
|
||||
# Cumulus
|
||||
cumulus-test-client = { path = "../../test/client" }
|
||||
cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder" }
|
||||
cumulus-test-runtime = { path = "../../test/runtime" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -21,13 +21,15 @@ use cumulus_test_client::{
|
||||
runtime::{
|
||||
self as test_runtime, Block, Hash, Header, TestPalletCall, UncheckedExtrinsic, WASM_BINARY,
|
||||
},
|
||||
transfer, BlockData, BlockOrigin, BuildParachainBlockData, Client, ClientBlockImportExt,
|
||||
DefaultTestClientBuilderExt, HeadData, InitBlockBuilder, TestClientBuilder,
|
||||
TestClientBuilderExt, ValidationParams,
|
||||
seal_block, transfer, BlockData, BlockOrigin, BuildParachainBlockData, Client,
|
||||
ClientBlockImportExt, DefaultTestClientBuilderExt, HeadData, InitBlockBuilder,
|
||||
Sr25519Keyring::{Alice, Bob, Charlie},
|
||||
TestClientBuilder, TestClientBuilderExt, ValidationParams,
|
||||
};
|
||||
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
|
||||
use sp_keyring::AccountKeyring::*;
|
||||
use sp_consensus_slots::Slot;
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
||||
|
||||
use std::{env, process::Command};
|
||||
|
||||
use crate::validate_block::MemoryOptimizedValidationParams;
|
||||
@@ -73,6 +75,7 @@ fn create_test_client() -> (Client, Header) {
|
||||
struct TestBlockData {
|
||||
block: ParachainBlockData<Block>,
|
||||
validation_data: PersistedValidationData,
|
||||
slot: Slot,
|
||||
}
|
||||
|
||||
fn build_block_with_witness(
|
||||
@@ -83,21 +86,24 @@ fn build_block_with_witness(
|
||||
) -> TestBlockData {
|
||||
sproof_builder.para_id = test_runtime::PARACHAIN_ID.into();
|
||||
sproof_builder.included_para_head = Some(HeadData(parent_head.encode()));
|
||||
let (relay_parent_storage_root, _) = sproof_builder.clone().into_state_root_and_proof();
|
||||
let mut validation_data = PersistedValidationData {
|
||||
|
||||
let validation_data = PersistedValidationData {
|
||||
relay_parent_number: 1,
|
||||
parent_head: parent_head.encode().into(),
|
||||
..Default::default()
|
||||
};
|
||||
let mut builder = client.init_block_builder(Some(validation_data.clone()), sproof_builder);
|
||||
|
||||
validation_data.relay_parent_storage_root = relay_parent_storage_root;
|
||||
let cumulus_test_client::BlockBuilderAndSupportData {
|
||||
mut block_builder,
|
||||
persisted_validation_data,
|
||||
slot,
|
||||
} = client.init_block_builder(Some(validation_data), sproof_builder);
|
||||
|
||||
extra_extrinsics.into_iter().for_each(|e| builder.push(e).unwrap());
|
||||
extra_extrinsics.into_iter().for_each(|e| block_builder.push(e).unwrap());
|
||||
|
||||
let block = builder.build_parachain_block(*parent_head.state_root());
|
||||
let block = block_builder.build_parachain_block(*parent_head.state_root());
|
||||
|
||||
TestBlockData { block, validation_data }
|
||||
TestBlockData { block, validation_data: persisted_validation_data, slot }
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -105,10 +111,11 @@ fn validate_block_works() {
|
||||
sp_tracing::try_init_simple();
|
||||
|
||||
let (client, parent_head) = create_test_client();
|
||||
let TestBlockData { block, validation_data } =
|
||||
let TestBlockData { block, validation_data, slot } =
|
||||
build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default());
|
||||
let header = block.header().clone();
|
||||
|
||||
let block = seal_block(block, slot, &client);
|
||||
let header = block.header().clone();
|
||||
let res_header =
|
||||
call_validate_block(parent_head, block, validation_data.relay_parent_storage_root)
|
||||
.expect("Calls `validate_block`");
|
||||
@@ -126,12 +133,13 @@ fn validate_block_with_extra_extrinsics() {
|
||||
transfer(&client, Charlie, Alice, 500),
|
||||
];
|
||||
|
||||
let TestBlockData { block, validation_data } = build_block_with_witness(
|
||||
let TestBlockData { block, validation_data, slot } = build_block_with_witness(
|
||||
&client,
|
||||
extra_extrinsics,
|
||||
parent_head.clone(),
|
||||
Default::default(),
|
||||
);
|
||||
let block = seal_block(block, slot, &client);
|
||||
let header = block.header().clone();
|
||||
|
||||
let res_header =
|
||||
@@ -159,7 +167,7 @@ fn validate_block_returns_custom_head_data() {
|
||||
transfer(&client, Bob, Charlie, 100),
|
||||
];
|
||||
|
||||
let TestBlockData { block, validation_data } = build_block_with_witness(
|
||||
let TestBlockData { block, validation_data, slot } = build_block_with_witness(
|
||||
&client,
|
||||
extra_extrinsics,
|
||||
parent_head.clone(),
|
||||
@@ -168,6 +176,7 @@ fn validate_block_returns_custom_head_data() {
|
||||
let header = block.header().clone();
|
||||
assert_ne!(expected_header, header.encode());
|
||||
|
||||
let block = seal_block(block, slot, &client);
|
||||
let res_header = call_validate_block_encoded_header(
|
||||
parent_head,
|
||||
block,
|
||||
@@ -183,7 +192,7 @@ fn validate_block_invalid_parent_hash() {
|
||||
|
||||
if env::var("RUN_TEST").is_ok() {
|
||||
let (client, parent_head) = create_test_client();
|
||||
let TestBlockData { block, validation_data } =
|
||||
let TestBlockData { block, validation_data, .. } =
|
||||
build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default());
|
||||
let (mut header, extrinsics, witness) = block.deconstruct();
|
||||
header.set_parent_hash(Hash::from_low_u64_be(1));
|
||||
@@ -233,7 +242,7 @@ fn check_inherents_are_unsigned_and_before_all_other_extrinsics() {
|
||||
if env::var("RUN_TEST").is_ok() {
|
||||
let (client, parent_head) = create_test_client();
|
||||
|
||||
let TestBlockData { block, validation_data } =
|
||||
let TestBlockData { block, validation_data, .. } =
|
||||
build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default());
|
||||
|
||||
let (header, mut extrinsics, proof) = block.deconstruct();
|
||||
@@ -316,15 +325,15 @@ fn validate_block_works_with_child_tries() {
|
||||
|
||||
let parent_head = block.header().clone();
|
||||
|
||||
let TestBlockData { block, validation_data } = build_block_with_witness(
|
||||
let TestBlockData { block, validation_data, slot } = build_block_with_witness(
|
||||
&client,
|
||||
vec![generate_extrinsic(&client, Alice, TestPalletCall::read_and_write_child_tries {})],
|
||||
parent_head.clone(),
|
||||
Default::default(),
|
||||
);
|
||||
|
||||
let block = seal_block(block, slot, &client);
|
||||
let header = block.header().clone();
|
||||
|
||||
let res_header =
|
||||
call_validate_block(parent_head, block, validation_data.relay_parent_storage_root)
|
||||
.expect("Calls `validate_block`");
|
||||
|
||||
@@ -14,14 +14,18 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
|
||||
# Substrate
|
||||
sc-service = { path = "../../../substrate/client/service" }
|
||||
sc-consensus = { path = "../../../substrate/client/consensus/common" }
|
||||
sc-consensus-aura = { path = "../../../substrate/client/consensus/aura" }
|
||||
sc-block-builder = { path = "../../../substrate/client/block-builder" }
|
||||
sc-executor = { path = "../../../substrate/client/executor" }
|
||||
sc-executor-common = { path = "../../../substrate/client/executor/common" }
|
||||
substrate-test-client = { path = "../../../substrate/test-utils/client" }
|
||||
sp-application-crypto = { path = "../../../substrate/primitives/application-crypto" }
|
||||
sp-runtime = { path = "../../../substrate/primitives/runtime" }
|
||||
sp-core = { path = "../../../substrate/primitives/core" }
|
||||
sp-api = { path = "../../../substrate/primitives/api" }
|
||||
sp-keyring = { path = "../../../substrate/primitives/keyring" }
|
||||
sp-keystore = { path = "../../../substrate/primitives/keystore" }
|
||||
sp-consensus-aura = { path = "../../../substrate/primitives/consensus/aura" }
|
||||
sp-blockchain = { path = "../../../substrate/primitives/blockchain" }
|
||||
sp-inherents = { path = "../../../substrate/primitives/inherents" }
|
||||
sp-io = { path = "../../../substrate/primitives/io" }
|
||||
|
||||
@@ -15,14 +15,26 @@
|
||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::Client;
|
||||
use codec::Encode;
|
||||
use cumulus_primitives_core::{ParachainBlockData, PersistedValidationData};
|
||||
use cumulus_primitives_parachain_inherent::{ParachainInherentData, INHERENT_IDENTIFIER};
|
||||
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
|
||||
use cumulus_test_runtime::{Block, GetLastTimestamp, Hash, Header};
|
||||
use polkadot_primitives::{BlockNumber as PBlockNumber, Hash as PHash};
|
||||
use sc_block_builder::{BlockBuilder, BlockBuilderBuilder};
|
||||
use sc_block_builder::BlockBuilderBuilder;
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
||||
use sp_consensus_aura::Slot;
|
||||
use sp_runtime::{
|
||||
traits::{Block as BlockT, Header as HeaderT},
|
||||
Digest, DigestItem,
|
||||
};
|
||||
|
||||
/// A struct containing a block builder and support data required to build test scenarios.
|
||||
pub struct BlockBuilderAndSupportData<'a> {
|
||||
pub block_builder: sc_block_builder::BlockBuilder<'a, Block, Client>,
|
||||
pub persisted_validation_data: PersistedValidationData<PHash, PBlockNumber>,
|
||||
pub slot: Slot,
|
||||
}
|
||||
|
||||
/// An extension for the Cumulus test client to init a block builder.
|
||||
pub trait InitBlockBuilder {
|
||||
@@ -32,12 +44,15 @@ pub trait InitBlockBuilder {
|
||||
/// valid for the test runtime.
|
||||
///
|
||||
/// You can use the relay chain state sproof builder to arrange required relay chain state or
|
||||
/// just use a default one.
|
||||
/// just use a default one. The relay chain slot in the storage proof
|
||||
/// will be adjusted to align with the parachain slot to pass validation.
|
||||
///
|
||||
/// Returns the block builder and validation data for further usage.
|
||||
fn init_block_builder(
|
||||
&self,
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
) -> sc_block_builder::BlockBuilder<Block, Client>;
|
||||
) -> BlockBuilderAndSupportData;
|
||||
|
||||
/// Init a specific block builder at a specific block that works for the test runtime.
|
||||
///
|
||||
@@ -48,7 +63,7 @@ pub trait InitBlockBuilder {
|
||||
at: Hash,
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
) -> sc_block_builder::BlockBuilder<Block, Client>;
|
||||
) -> BlockBuilderAndSupportData;
|
||||
|
||||
/// Init a specific block builder that works for the test runtime.
|
||||
///
|
||||
@@ -61,21 +76,30 @@ pub trait InitBlockBuilder {
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
timestamp: u64,
|
||||
) -> sc_block_builder::BlockBuilder<Block, Client>;
|
||||
) -> BlockBuilderAndSupportData;
|
||||
}
|
||||
|
||||
fn init_block_builder(
|
||||
client: &Client,
|
||||
at: Hash,
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
mut relay_sproof_builder: RelayStateSproofBuilder,
|
||||
timestamp: u64,
|
||||
) -> BlockBuilder<'_, Block, Client> {
|
||||
) -> BlockBuilderAndSupportData<'_> {
|
||||
// This slot will be used for both relay chain and parachain
|
||||
let slot: Slot = (timestamp / cumulus_test_runtime::SLOT_DURATION).into();
|
||||
relay_sproof_builder.current_slot = slot;
|
||||
|
||||
let aura_pre_digest = Digest {
|
||||
logs: vec![DigestItem::PreRuntime(sp_consensus_aura::AURA_ENGINE_ID, slot.encode())],
|
||||
};
|
||||
|
||||
let mut block_builder = BlockBuilderBuilder::new(client)
|
||||
.on_parent_block(at)
|
||||
.fetch_parent_block_number(client)
|
||||
.unwrap()
|
||||
.enable_proof_recording()
|
||||
.with_inherent_digests(aura_pre_digest)
|
||||
.build()
|
||||
.expect("Creates new block builder for test runtime");
|
||||
|
||||
@@ -89,18 +113,13 @@ fn init_block_builder(
|
||||
relay_sproof_builder.into_state_root_and_proof();
|
||||
|
||||
let mut validation_data = validation_data.unwrap_or_default();
|
||||
assert_eq!(
|
||||
validation_data.relay_parent_storage_root,
|
||||
Default::default(),
|
||||
"Overriding the relay storage root is not implemented",
|
||||
);
|
||||
validation_data.relay_parent_storage_root = relay_parent_storage_root;
|
||||
|
||||
inherent_data
|
||||
.put_data(
|
||||
INHERENT_IDENTIFIER,
|
||||
&ParachainInherentData {
|
||||
validation_data,
|
||||
validation_data: validation_data.clone(),
|
||||
relay_chain_state,
|
||||
downward_messages: Default::default(),
|
||||
horizontal_messages: Default::default(),
|
||||
@@ -114,7 +133,7 @@ fn init_block_builder(
|
||||
.into_iter()
|
||||
.for_each(|ext| block_builder.push(ext).expect("Pushes inherent"));
|
||||
|
||||
block_builder
|
||||
BlockBuilderAndSupportData { block_builder, persisted_validation_data: validation_data, slot }
|
||||
}
|
||||
|
||||
impl InitBlockBuilder for Client {
|
||||
@@ -122,7 +141,7 @@ impl InitBlockBuilder for Client {
|
||||
&self,
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
) -> BlockBuilder<Block, Client> {
|
||||
) -> BlockBuilderAndSupportData {
|
||||
let chain_info = self.chain_info();
|
||||
self.init_block_builder_at(chain_info.best_hash, validation_data, relay_sproof_builder)
|
||||
}
|
||||
@@ -132,10 +151,17 @@ impl InitBlockBuilder for Client {
|
||||
at: Hash,
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
) -> BlockBuilder<Block, Client> {
|
||||
) -> BlockBuilderAndSupportData {
|
||||
let last_timestamp = self.runtime_api().get_last_timestamp(at).expect("Get last timestamp");
|
||||
|
||||
let timestamp = last_timestamp + cumulus_test_runtime::MinimumPeriod::get();
|
||||
let timestamp = if last_timestamp == 0 {
|
||||
std::time::SystemTime::now()
|
||||
.duration_since(std::time::SystemTime::UNIX_EPOCH)
|
||||
.expect("Time is always after UNIX_EPOCH; qed")
|
||||
.as_millis() as u64
|
||||
} else {
|
||||
last_timestamp + cumulus_test_runtime::SLOT_DURATION
|
||||
};
|
||||
|
||||
init_block_builder(self, at, validation_data, relay_sproof_builder, timestamp)
|
||||
}
|
||||
@@ -146,7 +172,7 @@ impl InitBlockBuilder for Client {
|
||||
validation_data: Option<PersistedValidationData<PHash, PBlockNumber>>,
|
||||
relay_sproof_builder: RelayStateSproofBuilder,
|
||||
timestamp: u64,
|
||||
) -> sc_block_builder::BlockBuilder<Block, Client> {
|
||||
) -> BlockBuilderAndSupportData {
|
||||
init_block_builder(self, at, validation_data, relay_sproof_builder, timestamp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,24 +17,30 @@
|
||||
//! A Cumulus test client.
|
||||
|
||||
mod block_builder;
|
||||
pub use block_builder::*;
|
||||
use codec::{Decode, Encode};
|
||||
pub use cumulus_test_runtime as runtime;
|
||||
use cumulus_test_runtime::AuraId;
|
||||
pub use polkadot_parachain_primitives::primitives::{
|
||||
BlockData, HeadData, ValidationParams, ValidationResult,
|
||||
};
|
||||
use runtime::{
|
||||
Balance, Block, BlockHashCount, Runtime, RuntimeCall, Signature, SignedExtra, SignedPayload,
|
||||
UncheckedExtrinsic, VERSION,
|
||||
};
|
||||
use sc_consensus_aura::standalone::{seal, slot_author};
|
||||
pub use sc_executor::error::Result as ExecutorResult;
|
||||
use sc_executor::HeapAllocStrategy;
|
||||
use sc_executor_common::runtime_blob::RuntimeBlob;
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_application_crypto::AppCrypto;
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sp_consensus_aura::{AuraApi, Slot};
|
||||
use sp_core::Pair;
|
||||
use sp_io::TestExternalities;
|
||||
use sp_runtime::{generic::Era, BuildStorage, SaturatedConversion};
|
||||
|
||||
pub use block_builder::*;
|
||||
pub use cumulus_test_runtime as runtime;
|
||||
pub use polkadot_parachain_primitives::primitives::{
|
||||
BlockData, HeadData, ValidationParams, ValidationResult,
|
||||
};
|
||||
pub use sc_executor::error::Result as ExecutorResult;
|
||||
use sp_keystore::testing::MemoryKeystore;
|
||||
use sp_runtime::{generic::Era, traits::Header, BuildStorage, SaturatedConversion};
|
||||
use std::sync::Arc;
|
||||
pub use substrate_test_client::*;
|
||||
|
||||
pub type ParachainBlockData = cumulus_primitives_core::ParachainBlockData<Block>;
|
||||
@@ -225,3 +231,40 @@ pub fn validate_block(
|
||||
)
|
||||
.map(|v| ValidationResult::decode(&mut &v[..]).expect("Decode `ValidationResult`."))
|
||||
}
|
||||
|
||||
fn get_keystore() -> sp_keystore::KeystorePtr {
|
||||
let keystore = MemoryKeystore::new();
|
||||
sp_keyring::Sr25519Keyring::iter().for_each(|key| {
|
||||
keystore
|
||||
.sr25519_generate_new(
|
||||
sp_consensus_aura::sr25519::AuthorityPair::ID,
|
||||
Some(&key.to_seed()),
|
||||
)
|
||||
.expect("Key should be created");
|
||||
});
|
||||
Arc::new(keystore)
|
||||
}
|
||||
|
||||
/// Given parachain block data and a slot, seal the block with an aura seal. Assumes that the
|
||||
/// authorities of the test runtime are present in the keyring.
|
||||
pub fn seal_block(
|
||||
block: ParachainBlockData,
|
||||
parachain_slot: Slot,
|
||||
client: &Client,
|
||||
) -> ParachainBlockData {
|
||||
let parent_hash = block.header().parent_hash;
|
||||
let authorities = client.runtime_api().authorities(parent_hash).unwrap();
|
||||
let expected_author = slot_author::<<AuraId as AppCrypto>::Pair>(parachain_slot, &authorities)
|
||||
.expect("Should be able to find author");
|
||||
|
||||
let (mut header, extrinsics, proof) = block.deconstruct();
|
||||
let keystore = get_keystore();
|
||||
let seal_digest = seal::<_, sp_consensus_aura::sr25519::AuthorityPair>(
|
||||
&header.hash(),
|
||||
expected_author,
|
||||
&keystore,
|
||||
)
|
||||
.expect("Should be able to create seal");
|
||||
header.digest_mut().push(seal_digest);
|
||||
ParachainBlockData::new(header, extrinsics, proof)
|
||||
}
|
||||
|
||||
@@ -20,9 +20,12 @@ frame-system-rpc-runtime-api = { path = "../../../substrate/frame/system/rpc/run
|
||||
pallet-balances = { path = "../../../substrate/frame/balances", default-features = false }
|
||||
pallet-message-queue = { path = "../../../substrate/frame/message-queue", default-features = false }
|
||||
pallet-sudo = { path = "../../../substrate/frame/sudo", default-features = false }
|
||||
pallet-aura = { path = "../../../substrate/frame/aura", default-features = false }
|
||||
pallet-authorship = { path = "../../../substrate/frame/authorship", default-features = false }
|
||||
pallet-timestamp = { path = "../../../substrate/frame/timestamp", default-features = false }
|
||||
pallet-glutton = { path = "../../../substrate/frame/glutton", default-features = false }
|
||||
pallet-transaction-payment = { path = "../../../substrate/frame/transaction-payment", default-features = false }
|
||||
pallet-session = { path = "../../../substrate/frame/session", default-features = false }
|
||||
sp-api = { path = "../../../substrate/primitives/api", default-features = false }
|
||||
sp-block-builder = { path = "../../../substrate/primitives/block-builder", default-features = false }
|
||||
sp-core = { path = "../../../substrate/primitives/core", default-features = false }
|
||||
@@ -32,12 +35,18 @@ sp-io = { path = "../../../substrate/primitives/io", default-features = false }
|
||||
sp-offchain = { path = "../../../substrate/primitives/offchain", default-features = false }
|
||||
sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
|
||||
sp-session = { path = "../../../substrate/primitives/session", default-features = false }
|
||||
sp-consensus-aura = { path = "../../../substrate/primitives/consensus/aura", default-features = false }
|
||||
sp-std = { path = "../../../substrate/primitives/std", default-features = false }
|
||||
sp-transaction-pool = { path = "../../../substrate/primitives/transaction-pool", default-features = false }
|
||||
sp-version = { path = "../../../substrate/primitives/version", default-features = false }
|
||||
|
||||
# Cumulus
|
||||
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook"] }
|
||||
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system", default-features = false, features = [
|
||||
"parameterized-consensus-hook",
|
||||
] }
|
||||
cumulus-primitives-aura = { path = "../../primitives/aura", default-features = false }
|
||||
pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false }
|
||||
cumulus-pallet-aura-ext = { path = "../../pallets/aura-ext", default-features = false }
|
||||
cumulus-primitives-core = { path = "../../primitives/core", default-features = false }
|
||||
cumulus-primitives-storage-weight-reclaim = { path = "../../primitives/storage-weight-reclaim", default-features = false }
|
||||
|
||||
@@ -48,22 +57,29 @@ substrate-wasm-builder = { path = "../../../substrate/utils/wasm-builder", optio
|
||||
default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"cumulus-pallet-aura-ext/std",
|
||||
"cumulus-pallet-parachain-system/std",
|
||||
"cumulus-primitives-aura/std",
|
||||
"cumulus-primitives-core/std",
|
||||
"cumulus-primitives-storage-weight-reclaim/std",
|
||||
"frame-executive/std",
|
||||
"frame-support/std",
|
||||
"frame-system-rpc-runtime-api/std",
|
||||
"frame-system/std",
|
||||
"pallet-aura/std",
|
||||
"pallet-authorship/std",
|
||||
"pallet-balances/std",
|
||||
"pallet-collator-selection/std",
|
||||
"pallet-glutton/std",
|
||||
"pallet-message-queue/std",
|
||||
"pallet-session/std",
|
||||
"pallet-sudo/std",
|
||||
"pallet-timestamp/std",
|
||||
"pallet-transaction-payment/std",
|
||||
"scale-info/std",
|
||||
"sp-api/std",
|
||||
"sp-block-builder/std",
|
||||
"sp-consensus-aura/std",
|
||||
"sp-core/std",
|
||||
"sp-genesis-builder/std",
|
||||
"sp-inherents/std",
|
||||
|
||||
@@ -28,10 +28,11 @@ pub mod wasm_spec_version_incremented {
|
||||
}
|
||||
|
||||
mod test_pallet;
|
||||
|
||||
use frame_support::{derive_impl, traits::OnRuntimeUpgrade};
|
||||
use frame_support::{derive_impl, traits::OnRuntimeUpgrade, PalletId};
|
||||
use sp_api::{decl_runtime_apis, impl_runtime_apis};
|
||||
use sp_core::{ConstU32, OpaqueMetadata};
|
||||
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
use sp_core::{ConstBool, ConstU32, ConstU64, OpaqueMetadata};
|
||||
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, Verify},
|
||||
@@ -74,12 +75,18 @@ pub use test_pallet::Call as TestPalletCall;
|
||||
pub type SessionHandlers = ();
|
||||
|
||||
impl_opaque_keys! {
|
||||
pub struct SessionKeys {}
|
||||
pub struct SessionKeys {
|
||||
pub aura: Aura,
|
||||
}
|
||||
}
|
||||
|
||||
/// The para-id used in this runtime.
|
||||
pub const PARACHAIN_ID: u32 = 100;
|
||||
|
||||
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;
|
||||
const BLOCK_PROCESSING_VELOCITY: u32 = 1;
|
||||
const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
|
||||
|
||||
// The only difference between the two declarations below is the `spec_version`. With the
|
||||
// `increment-spec-version` feature enabled `spec_version` should be greater than the one of without
|
||||
// the `increment-spec-version` feature.
|
||||
@@ -119,7 +126,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
state_version: 1,
|
||||
};
|
||||
|
||||
pub const MILLISECS_PER_BLOCK: u64 = 12000;
|
||||
pub const MILLISECS_PER_BLOCK: u64 = 6000;
|
||||
|
||||
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
|
||||
|
||||
@@ -145,9 +152,9 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
|
||||
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
|
||||
/// by Operational extrinsics.
|
||||
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
|
||||
/// We allow for .5 seconds of compute with a 12 second average block time.
|
||||
/// We allow for 1 second of compute with a 6 second average block time.
|
||||
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
|
||||
WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
|
||||
WEIGHT_REF_TIME_PER_SECOND,
|
||||
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
|
||||
);
|
||||
|
||||
@@ -203,12 +210,17 @@ impl frame_system::Config for Runtime {
|
||||
|
||||
parameter_types! {
|
||||
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
|
||||
pub const PotId: PalletId = PalletId(*b"PotStake");
|
||||
pub const SessionLength: BlockNumber = 10 * MINUTES;
|
||||
pub const Offset: u32 = 0;
|
||||
}
|
||||
|
||||
impl cumulus_pallet_aura_ext::Config for Runtime {}
|
||||
|
||||
impl pallet_timestamp::Config for Runtime {
|
||||
/// A timestamp: milliseconds since the unix epoch.
|
||||
type Moment = u64;
|
||||
type OnTimestampSet = ();
|
||||
type OnTimestampSet = Aura;
|
||||
type MinimumPeriod = MinimumPeriod;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
@@ -260,6 +272,12 @@ impl pallet_glutton::Config for Runtime {
|
||||
type WeightInfo = pallet_glutton::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
|
||||
type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
|
||||
Runtime,
|
||||
RELAY_CHAIN_SLOT_DURATION_MILLIS,
|
||||
BLOCK_PROCESSING_VELOCITY,
|
||||
UNINCLUDED_SEGMENT_CAPACITY,
|
||||
>;
|
||||
impl cumulus_pallet_parachain_system::Config for Runtime {
|
||||
type WeightInfo = ();
|
||||
type SelfParaId = ParachainId;
|
||||
@@ -271,8 +289,17 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
|
||||
type ReservedDmpWeight = ();
|
||||
type XcmpMessageHandler = ();
|
||||
type ReservedXcmpWeight = ();
|
||||
type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::AnyRelayNumber;
|
||||
type ConsensusHook = cumulus_pallet_parachain_system::consensus_hook::RequireParentIncluded;
|
||||
type CheckAssociatedRelayNumber =
|
||||
cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
|
||||
type ConsensusHook = ConsensusHook;
|
||||
}
|
||||
|
||||
impl pallet_aura::Config for Runtime {
|
||||
type AuthorityId = AuraId;
|
||||
type DisabledValidators = ();
|
||||
type MaxAuthorities = ConstU32<32>;
|
||||
type AllowMultipleBlocksPerSlot = ConstBool<true>;
|
||||
type SlotDuration = ConstU64<SLOT_DURATION>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -293,6 +320,8 @@ construct_runtime! {
|
||||
TransactionPayment: pallet_transaction_payment,
|
||||
TestPallet: test_pallet,
|
||||
Glutton: pallet_glutton,
|
||||
Aura: pallet_aura,
|
||||
AuraExt: cumulus_pallet_aura_ext,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +411,26 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {
|
||||
fn can_build_upon(
|
||||
included_hash: <Block as BlockT>::Hash,
|
||||
slot: cumulus_primitives_aura::Slot,
|
||||
) -> bool {
|
||||
ConsensusHook::can_build_upon(included_hash, slot)
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
|
||||
fn slot_duration() -> sp_consensus_aura::SlotDuration {
|
||||
sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION)
|
||||
}
|
||||
|
||||
fn authorities() -> Vec<AuraId> {
|
||||
pallet_aura::Authorities::<Runtime>::get().into_inner()
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_api::Metadata<Block> for Runtime {
|
||||
fn metadata() -> OpaqueMetadata {
|
||||
OpaqueMetadata::new(Runtime::metadata().into())
|
||||
@@ -479,5 +528,5 @@ impl_runtime_apis! {
|
||||
|
||||
cumulus_pallet_parachain_system::register_validate_block! {
|
||||
Runtime = Runtime,
|
||||
BlockExecutor = Executive,
|
||||
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ sc-basic-authorship = { path = "../../../substrate/client/basic-authorship" }
|
||||
sc-chain-spec = { path = "../../../substrate/client/chain-spec" }
|
||||
sc-client-api = { path = "../../../substrate/client/api" }
|
||||
sc-consensus = { path = "../../../substrate/client/consensus/common" }
|
||||
sc-consensus-aura = { path = "../../../substrate/client/consensus/aura" }
|
||||
sc-executor = { path = "../../../substrate/client/executor" }
|
||||
sc-network = { path = "../../../substrate/client/network" }
|
||||
sc-service = { path = "../../../substrate/client/service" }
|
||||
@@ -52,6 +53,7 @@ sp-state-machine = { path = "../../../substrate/primitives/state-machine" }
|
||||
sp-tracing = { path = "../../../substrate/primitives/tracing" }
|
||||
sp-timestamp = { path = "../../../substrate/primitives/timestamp" }
|
||||
sp-consensus = { path = "../../../substrate/primitives/consensus/common" }
|
||||
sp-consensus-aura = { path = "../../../substrate/primitives/consensus/aura" }
|
||||
substrate-test-client = { path = "../../../substrate/test-utils/client" }
|
||||
sc-cli = { path = "../../../substrate/client/cli" }
|
||||
sc-block-builder = { path = "../../../substrate/client/block-builder" }
|
||||
@@ -70,9 +72,12 @@ polkadot-overseer = { path = "../../../polkadot/node/overseer" }
|
||||
cumulus-client-cli = { path = "../../client/cli" }
|
||||
parachains-common = { path = "../../parachains/common" }
|
||||
cumulus-client-consensus-common = { path = "../../client/consensus/common" }
|
||||
cumulus-client-consensus-proposer = { path = "../../client/consensus/proposer" }
|
||||
cumulus-client-consensus-aura = { path = "../../client/consensus/aura" }
|
||||
cumulus-client-consensus-relay-chain = { path = "../../client/consensus/relay-chain" }
|
||||
cumulus-client-parachain-inherent = { path = "../../client/parachain-inherent" }
|
||||
cumulus-client-service = { path = "../../client/service" }
|
||||
cumulus-client-collator = { path = "../../client/collator" }
|
||||
cumulus-primitives-core = { path = "../../primitives/core" }
|
||||
cumulus-relay-chain-inprocess-interface = { path = "../../client/relay-chain-inprocess-interface" }
|
||||
cumulus-relay-chain-interface = { path = "../../client/relay-chain-interface" }
|
||||
|
||||
@@ -107,8 +107,9 @@ fn benchmark_block_validation(c: &mut Criterion) {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let mut block_builder =
|
||||
let cumulus_test_client::BlockBuilderAndSupportData { mut block_builder, .. } =
|
||||
client.init_block_builder(Some(validation_data), sproof_builder.clone());
|
||||
|
||||
for extrinsic in extrinsics {
|
||||
block_builder.push(extrinsic).unwrap();
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ use core::time::Duration;
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
||||
use cumulus_primitives_core::{relay_chain::AccountId, PersistedValidationData, ValidationParams};
|
||||
use cumulus_test_client::{
|
||||
generate_extrinsic_with_pair, BuildParachainBlockData, Client, InitBlockBuilder,
|
||||
ParachainBlockData, TestClientBuilder, ValidationResult,
|
||||
generate_extrinsic_with_pair, BlockBuilderAndSupportData, BuildParachainBlockData, Client,
|
||||
InitBlockBuilder, ParachainBlockData, TestClientBuilder, ValidationResult,
|
||||
};
|
||||
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
|
||||
use cumulus_test_runtime::{Block, GluttonCall, Header, SudoCall};
|
||||
@@ -88,7 +88,8 @@ fn benchmark_block_validation(c: &mut Criterion) {
|
||||
parent_head: parent_header.encode().into(),
|
||||
..Default::default()
|
||||
};
|
||||
let block_builder = client.init_block_builder(Some(validation_data), Default::default());
|
||||
let BlockBuilderAndSupportData { block_builder, .. } =
|
||||
client.init_block_builder(Some(validation_data), Default::default());
|
||||
let parachain_block = block_builder.build_parachain_block(*parent_header.state_root());
|
||||
|
||||
let proof_size_in_kb = parachain_block.storage_proof().encode().len() as f64 / 1024f64;
|
||||
@@ -197,7 +198,8 @@ fn set_glutton_parameters(
|
||||
);
|
||||
extrinsics.push(set_storage);
|
||||
|
||||
let mut block_builder = client.init_block_builder(Some(validation_data), Default::default());
|
||||
let BlockBuilderAndSupportData { mut block_builder, .. } =
|
||||
client.init_block_builder(Some(validation_data), Default::default());
|
||||
|
||||
for extrinsic in extrinsics {
|
||||
block_builder.push(extrinsic).unwrap();
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use cumulus_test_runtime::{AccountId, RuntimeGenesisConfig, Signature};
|
||||
use parachains_common::AuraId;
|
||||
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
|
||||
use sc_service::ChainType;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -105,21 +106,43 @@ pub fn testnet_genesis_with_default_endowed(
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
];
|
||||
endowed.append(&mut extra_endowed_accounts);
|
||||
let invulnerables = vec![
|
||||
get_collator_keys_from_seed::<AuraId>("Alice"),
|
||||
get_collator_keys_from_seed::<AuraId>("Bob"),
|
||||
get_collator_keys_from_seed::<AuraId>("Charlie"),
|
||||
get_collator_keys_from_seed::<AuraId>("Dave"),
|
||||
get_collator_keys_from_seed::<AuraId>("Eve"),
|
||||
get_collator_keys_from_seed::<AuraId>("Ferdie"),
|
||||
];
|
||||
testnet_genesis(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
invulnerables,
|
||||
endowed,
|
||||
self_para_id,
|
||||
)
|
||||
}
|
||||
|
||||
testnet_genesis(get_account_id_from_seed::<sr25519::Public>("Alice"), endowed, self_para_id)
|
||||
/// Generate collator keys from seed.
|
||||
///
|
||||
/// This function's return type must always match the session keys of the chain in tuple format.
|
||||
pub fn get_collator_keys_from_seed<AuraId: Public>(seed: &str) -> <AuraId::Pair as Pair>::Public {
|
||||
get_from_seed::<AuraId>(seed)
|
||||
}
|
||||
|
||||
/// Creates a local testnet genesis with endowed accounts.
|
||||
pub fn testnet_genesis(
|
||||
root_key: AccountId,
|
||||
invulnerables: Vec<AuraId>,
|
||||
endowed_accounts: Vec<AccountId>,
|
||||
self_para_id: Option<ParaId>,
|
||||
) -> serde_json::Value {
|
||||
let self_para_id = self_para_id.unwrap_or(cumulus_test_runtime::PARACHAIN_ID.into());
|
||||
serde_json::json!({
|
||||
"balances": cumulus_test_runtime::BalancesConfig {
|
||||
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
|
||||
},
|
||||
"sudo": cumulus_test_runtime::SudoConfig { key: Some(root_key) },
|
||||
"testPallet": cumulus_test_runtime::TestPalletConfig { self_para_id, ..Default::default() }
|
||||
"testPallet": cumulus_test_runtime::TestPalletConfig { self_para_id: Some(self_para_id), ..Default::default() },
|
||||
"aura": cumulus_test_runtime::AuraConfig { authorities: invulnerables }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -23,8 +23,15 @@ pub mod bench_utils;
|
||||
|
||||
pub mod chain_spec;
|
||||
|
||||
use cumulus_client_collator::service::CollatorService;
|
||||
use cumulus_client_consensus_aura::{
|
||||
collators::lookahead::{self as aura, Params as AuraParams},
|
||||
ImportQueueParams,
|
||||
};
|
||||
use cumulus_client_consensus_proposer::Proposer;
|
||||
use runtime::AccountId;
|
||||
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
|
||||
use sp_consensus_aura::sr25519::AuthorityPair;
|
||||
use std::{
|
||||
collections::HashSet,
|
||||
future::Future,
|
||||
@@ -45,7 +52,7 @@ use cumulus_client_service::{
|
||||
build_network, prepare_node_config, start_relay_chain_tasks, BuildNetworkParams,
|
||||
CollatorSybilResistance, DARecoveryProfile, StartRelayChainTasksParams,
|
||||
};
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use cumulus_primitives_core::{relay_chain::ValidationCode, ParaId};
|
||||
use cumulus_relay_chain_inprocess_interface::RelayChainInProcessInterface;
|
||||
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult};
|
||||
use cumulus_relay_chain_minimal_node::{
|
||||
@@ -110,27 +117,10 @@ impl ParachainConsensus<Block> for NullConsensus {
|
||||
/// The signature of the announce block fn.
|
||||
pub type AnnounceBlockFn = Arc<dyn Fn(Hash, Option<Vec<u8>>) + Send + Sync>;
|
||||
|
||||
/// Native executor instance.
|
||||
pub struct RuntimeExecutor;
|
||||
|
||||
impl sc_executor::NativeExecutionDispatch for RuntimeExecutor {
|
||||
type ExtendHostFunctions = cumulus_client_service::storage_proof_size::HostFunctions;
|
||||
|
||||
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||
cumulus_test_runtime::api::dispatch(method, data)
|
||||
}
|
||||
|
||||
fn native_version() -> sc_executor::NativeVersion {
|
||||
cumulus_test_runtime::native_version()
|
||||
}
|
||||
}
|
||||
|
||||
type HostFunctions =
|
||||
(sp_io::SubstrateHostFunctions, cumulus_client_service::storage_proof_size::HostFunctions);
|
||||
/// The client type being used by the test service.
|
||||
pub type Client = TFullClient<
|
||||
runtime::NodeBlock,
|
||||
runtime::RuntimeApi,
|
||||
sc_executor::NativeElseWasmExecutor<RuntimeExecutor>,
|
||||
>;
|
||||
pub type Client = TFullClient<runtime::NodeBlock, runtime::RuntimeApi, WasmExecutor<HostFunctions>>;
|
||||
|
||||
/// The backend type being used by the test service.
|
||||
pub type Backend = TFullBackend<Block>;
|
||||
@@ -203,7 +193,7 @@ pub fn new_partial(
|
||||
.default_heap_pages
|
||||
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ });
|
||||
|
||||
let wasm = WasmExecutor::builder()
|
||||
let executor = WasmExecutor::builder()
|
||||
.with_execution_method(config.wasm_method)
|
||||
.with_onchain_heap_alloc_strategy(heap_pages)
|
||||
.with_offchain_heap_alloc_strategy(heap_pages)
|
||||
@@ -211,9 +201,6 @@ pub fn new_partial(
|
||||
.with_runtime_cache_size(config.runtime_cache_size)
|
||||
.build();
|
||||
|
||||
let executor =
|
||||
sc_executor::NativeElseWasmExecutor::<RuntimeExecutor>::new_with_wasm_executor(wasm);
|
||||
|
||||
let (client, backend, keystore_container, task_manager) =
|
||||
sc_service::new_full_parts_record_import::<Block, RuntimeApi, _>(
|
||||
config,
|
||||
@@ -223,10 +210,7 @@ pub fn new_partial(
|
||||
)?;
|
||||
let client = Arc::new(client);
|
||||
|
||||
let block_import =
|
||||
ParachainBlockImport::new_with_delayed_best_block(client.clone(), backend.clone());
|
||||
|
||||
let registry = config.prometheus_registry();
|
||||
let block_import = ParachainBlockImport::new(client.clone(), backend.clone());
|
||||
|
||||
let transaction_pool = sc_transaction_pool::BasicPool::new_full(
|
||||
config.transaction_pool.clone(),
|
||||
@@ -236,12 +220,26 @@ pub fn new_partial(
|
||||
client.clone(),
|
||||
);
|
||||
|
||||
let import_queue = cumulus_client_consensus_relay_chain::import_queue(
|
||||
client.clone(),
|
||||
block_import.clone(),
|
||||
|_, _| async { Ok(sp_timestamp::InherentDataProvider::from_system_time()) },
|
||||
&task_manager.spawn_essential_handle(),
|
||||
registry,
|
||||
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
|
||||
let import_queue = cumulus_client_consensus_aura::import_queue::<AuthorityPair, _, _, _, _, _>(
|
||||
ImportQueueParams {
|
||||
block_import: block_import.clone(),
|
||||
client: client.clone(),
|
||||
create_inherent_data_providers: move |_, ()| async move {
|
||||
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
|
||||
|
||||
let slot =
|
||||
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
|
||||
*timestamp,
|
||||
slot_duration,
|
||||
);
|
||||
|
||||
Ok((slot, timestamp))
|
||||
},
|
||||
spawner: &task_manager.spawn_essential_handle(),
|
||||
registry: None,
|
||||
telemetry: None,
|
||||
},
|
||||
)?;
|
||||
|
||||
let params = PartialComponents {
|
||||
@@ -362,12 +360,16 @@ where
|
||||
spawn_handle: task_manager.spawn_handle(),
|
||||
relay_chain_interface: relay_chain_interface.clone(),
|
||||
import_queue: params.import_queue,
|
||||
sybil_resistance_level: CollatorSybilResistance::Unresistant, // no consensus
|
||||
sybil_resistance_level: CollatorSybilResistance::Resistant, /* Either Aura that is
|
||||
* resistant or null that
|
||||
* is not producing any
|
||||
* blocks at all. */
|
||||
})
|
||||
.await?;
|
||||
|
||||
let prometheus_registry = parachain_config.prometheus_registry().cloned();
|
||||
|
||||
let keystore = params.keystore_container.keystore();
|
||||
let rpc_builder = {
|
||||
let client = client.clone();
|
||||
Box::new(move |_, _| rpc_ext_builder(client.clone()))
|
||||
@@ -379,7 +381,7 @@ where
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
task_manager: &mut task_manager,
|
||||
config: parachain_config,
|
||||
keystore: params.keystore_container.keystore(),
|
||||
keystore: keystore.clone(),
|
||||
backend: backend.clone(),
|
||||
network: network.clone(),
|
||||
sync_service: sync_service.clone(),
|
||||
@@ -397,8 +399,6 @@ where
|
||||
.map(|w| (w)(announce_block.clone()))
|
||||
.unwrap_or_else(|| announce_block);
|
||||
|
||||
let relay_chain_interface_for_closure = relay_chain_interface.clone();
|
||||
|
||||
let overseer_handle = relay_chain_interface
|
||||
.overseer_handle()
|
||||
.map_err(|e| sc_service::Error::Application(Box::new(e)))?;
|
||||
@@ -429,47 +429,7 @@ where
|
||||
})?;
|
||||
|
||||
if let Some(collator_key) = collator_key {
|
||||
let parachain_consensus: Box<dyn ParachainConsensus<Block>> = match consensus {
|
||||
Consensus::RelayChain => {
|
||||
let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||
task_manager.spawn_handle(),
|
||||
client.clone(),
|
||||
transaction_pool.clone(),
|
||||
prometheus_registry.as_ref(),
|
||||
None,
|
||||
);
|
||||
let relay_chain_interface2 = relay_chain_interface_for_closure.clone();
|
||||
Box::new(cumulus_client_consensus_relay_chain::RelayChainConsensus::new(
|
||||
para_id,
|
||||
proposer_factory,
|
||||
move |_, (relay_parent, validation_data)| {
|
||||
let relay_chain_interface = relay_chain_interface_for_closure.clone();
|
||||
async move {
|
||||
let parachain_inherent =
|
||||
cumulus_client_parachain_inherent::ParachainInherentDataProvider::create_at(
|
||||
relay_parent,
|
||||
&relay_chain_interface,
|
||||
&validation_data,
|
||||
para_id,
|
||||
).await;
|
||||
|
||||
let time = sp_timestamp::InherentDataProvider::from_system_time();
|
||||
|
||||
let parachain_inherent = parachain_inherent.ok_or_else(|| {
|
||||
Box::<dyn std::error::Error + Send + Sync>::from(String::from(
|
||||
"error",
|
||||
))
|
||||
})?;
|
||||
Ok((time, parachain_inherent))
|
||||
}
|
||||
},
|
||||
block_import,
|
||||
relay_chain_interface2,
|
||||
))
|
||||
},
|
||||
Consensus::Null => Box::new(NullConsensus),
|
||||
};
|
||||
|
||||
if let Consensus::Null = consensus {
|
||||
#[allow(deprecated)]
|
||||
old_consensus::start_collator(old_consensus::StartCollatorParams {
|
||||
block_status: client.clone(),
|
||||
@@ -477,11 +437,53 @@ where
|
||||
runtime_api: client.clone(),
|
||||
spawner: task_manager.spawn_handle(),
|
||||
para_id,
|
||||
parachain_consensus,
|
||||
parachain_consensus: Box::new(NullConsensus) as Box<_>,
|
||||
key: collator_key,
|
||||
overseer_handle,
|
||||
})
|
||||
.await;
|
||||
} else {
|
||||
let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
|
||||
task_manager.spawn_handle(),
|
||||
client.clone(),
|
||||
transaction_pool.clone(),
|
||||
prometheus_registry.as_ref(),
|
||||
None,
|
||||
);
|
||||
let proposer = Proposer::new(proposer_factory);
|
||||
|
||||
let collator_service = CollatorService::new(
|
||||
client.clone(),
|
||||
Arc::new(task_manager.spawn_handle()),
|
||||
announce_block,
|
||||
client.clone(),
|
||||
);
|
||||
|
||||
let client_for_aura = client.clone();
|
||||
let params = AuraParams {
|
||||
create_inherent_data_providers: move |_, ()| async move { Ok(()) },
|
||||
block_import,
|
||||
para_client: client.clone(),
|
||||
para_backend: backend.clone(),
|
||||
relay_client: relay_chain_interface,
|
||||
code_hash_provider: move |block_hash| {
|
||||
client_for_aura.code_at(block_hash).ok().map(|c| ValidationCode::from(c).hash())
|
||||
},
|
||||
sync_oracle: sync_service,
|
||||
keystore,
|
||||
collator_key,
|
||||
para_id,
|
||||
overseer_handle,
|
||||
relay_chain_slot_duration,
|
||||
proposer,
|
||||
collator_service,
|
||||
authoring_duration: Duration::from_millis(2000),
|
||||
reinitialize: false,
|
||||
};
|
||||
|
||||
let fut = aura::run::<Block, AuthorityPair, _, _, _, _, _, _, _, _, _>(params);
|
||||
task_manager.spawn_essential_handle().spawn("aura", None, fut);
|
||||
}
|
||||
}
|
||||
|
||||
start_network.start_network();
|
||||
@@ -510,8 +512,8 @@ pub struct TestNode {
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub enum Consensus {
|
||||
/// Use the relay-chain provided consensus.
|
||||
RelayChain,
|
||||
/// Use Aura consensus.
|
||||
Aura,
|
||||
/// Use the null consensus that will never produce any block.
|
||||
Null,
|
||||
}
|
||||
@@ -553,7 +555,7 @@ impl TestNodeBuilder {
|
||||
wrap_announce_block: None,
|
||||
storage_update_func_parachain: None,
|
||||
storage_update_func_relay_chain: None,
|
||||
consensus: Consensus::RelayChain,
|
||||
consensus: Consensus::Aura,
|
||||
endowed_accounts: Default::default(),
|
||||
relay_chain_mode: RelayChainMode::Embedded,
|
||||
record_proof_during_import: true,
|
||||
|
||||
@@ -98,7 +98,7 @@ fn main() -> Result<(), sc_cli::Error> {
|
||||
tracing::info!("Using null consensus.");
|
||||
cumulus_test_service::Consensus::Null
|
||||
})
|
||||
.unwrap_or(cumulus_test_service::Consensus::RelayChain);
|
||||
.unwrap_or(cumulus_test_service::Consensus::Aura);
|
||||
|
||||
let (mut task_manager, _, _, _, _, _) = tokio_runtime
|
||||
.block_on(async move {
|
||||
|
||||
@@ -8,17 +8,17 @@ chain_spec_path = "0007-warp-sync-relaychain-spec.json"
|
||||
[[relaychain.nodes]]
|
||||
name = "alice"
|
||||
validator = true
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/relaychain-1964f8b557f10085cdc18f4105ad0bbb3df4c4c6.tgz"
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/relaychain-12523fe793bff9f6d68651816879a09eec2c1462.tgz"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "bob"
|
||||
validator = true
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/relaychain-1964f8b557f10085cdc18f4105ad0bbb3df4c4c6.tgz"
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/relaychain-12523fe793bff9f6d68651816879a09eec2c1462.tgz"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "charlie"
|
||||
validator = true
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/relaychain-1964f8b557f10085cdc18f4105ad0bbb3df4c4c6.tgz"
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/relaychain-12523fe793bff9f6d68651816879a09eec2c1462.tgz"
|
||||
|
||||
[[relaychain.nodes]]
|
||||
name = "dave"
|
||||
@@ -38,7 +38,7 @@ add_to_genesis = false
|
||||
image = "{{COL_IMAGE}}"
|
||||
command = "test-parachain"
|
||||
args = ["-lparachain=debug"]
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/parachain-587c1ed24ddd7de05c237cf7c158fff53b8f5b26.tgz"
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/parachain-f9bb05af6bef7afa50368540f5033f62359e9e5d.tgz"
|
||||
|
||||
# Run 'eve' as parachain collator.
|
||||
[[parachains.collators]]
|
||||
@@ -47,7 +47,7 @@ add_to_genesis = false
|
||||
image = "{{COL_IMAGE}}"
|
||||
command = "test-parachain"
|
||||
args = ["-lparachain=debug"]
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/parachain-587c1ed24ddd7de05c237cf7c158fff53b8f5b26.tgz"
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/parachain-f9bb05af6bef7afa50368540f5033f62359e9e5d.tgz"
|
||||
|
||||
# Run 'ferdie' as parachain collator.
|
||||
[[parachains.collators]]
|
||||
@@ -56,7 +56,7 @@ add_to_genesis = false
|
||||
image = "{{COL_IMAGE}}"
|
||||
command = "test-parachain"
|
||||
args = ["-lparachain=debug"]
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/parachain-587c1ed24ddd7de05c237cf7c158fff53b8f5b26.tgz"
|
||||
db_snapshot = "https://storage.googleapis.com/zombienet-db-snaps/cumulus/0007-full_node_warp_sync/parachain-f9bb05af6bef7afa50368540f5033f62359e9e5d.tgz"
|
||||
|
||||
# Run 'one' as parachain full node. Parachain and relay chain are warpsyncing.
|
||||
[[parachains.collators]]
|
||||
|
||||
@@ -3,7 +3,7 @@ Network: ./0007-full_node_warp_sync.toml
|
||||
Creds: config
|
||||
|
||||
alice: parachain 2000 is registered within 225 seconds
|
||||
one: reports block height is at least 770 within 225 seconds
|
||||
two: reports block height is at least 770 within 225 seconds
|
||||
three: reports block height is at least 770 within 225 seconds
|
||||
four: reports block height is at least 770 within 225 seconds
|
||||
one: reports block height is at least 930 within 225 seconds
|
||||
two: reports block height is at least 930 within 225 seconds
|
||||
three: reports block height is at least 930 within 225 seconds
|
||||
four: reports block height is at least 930 within 225 seconds
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -53,4 +53,3 @@ try-runtime = [
|
||||
"pallet-timestamp/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
]
|
||||
experimental = []
|
||||
|
||||
Reference in New Issue
Block a user