Update Cumulus for Parachains V1 (#224)

* Start with something

* Whatever

* Update

* MOARE

* Make cumulus-network compile and tests work

* Update more and fixes

* More stuff

* More fixes

* Make collator build

* Make test almost work

* Remove contracts runtime

* More test work

* Make service compile

* Fix test-service

* Fix test client

* More fixes

* Fix collator test

* Fix network tests (again)

* Make everything compile, finally

* Fix tests

* Update to latest masters

* Remove ignore

* Switch to different branch in polkadot for now

* Update reference

* Make it compile with latest changes

* Update collator/src/lib.rs

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>

* Update to latest upstream

* Update to latest master

* Fix test

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
Bastian Köcher
2020-11-08 22:18:09 +01:00
committed by GitHub
parent 55364ac254
commit 28338431fe
87 changed files with 3815 additions and 17343 deletions
+26 -27
View File
@@ -21,38 +21,35 @@ use sc_service::TaskExecutor;
use substrate_test_runtime_client::AccountKeyring::*;
#[substrate_test_utils::test]
#[ignore]
async fn test_collating_and_non_collator_mode_catching_up(task_executor: TaskExecutor) {
sc_cli::init_logger("", Default::default(), None).expect("Sets up logger");
let para_id = ParaId::from(100);
// start alice
let alice = polkadot_test_service::run_test_node(task_executor.clone(), Alice, || {}, vec![]);
let alice = polkadot_test_service::run_validator_node(task_executor.clone(), Alice, || {}, vec![]);
// start bob
let bob = polkadot_test_service::run_test_node(
let bob = polkadot_test_service::run_validator_node(
task_executor.clone(),
Bob,
|| {},
vec![alice.addr.clone()],
);
// ensure alice and bob can produce blocks
join!(alice.wait_for_blocks(2), bob.wait_for_blocks(2));
// register parachain
alice
.register_para(
.register_parachain(
para_id,
cumulus_test_runtime::WASM_BINARY
.expect("You need to build the WASM binary to run this test!")
.to_vec()
.into(),
.to_vec(),
initial_head_data(para_id),
)
.await
.unwrap();
// run cumulus charlie (a validator)
// run cumulus charlie (a parachain collator)
let charlie = cumulus_test_service::run_test_node(
task_executor.clone(),
Charlie,
@@ -62,29 +59,31 @@ async fn test_collating_and_non_collator_mode_catching_up(task_executor: TaskExe
vec![alice.addr.clone(), bob.addr.clone()],
para_id,
true,
);
charlie.wait_for_blocks(2).await;
)
.await;
charlie.wait_for_blocks(5).await;
// run cumulus dave (not a validator)
//TODO: Fix bug with syncing and bring back!
// run cumulus dave (a parachain full node)
//
// a collator running in non-validator mode should be able to sync blocks from the tip of the
// parachain
let dave = cumulus_test_service::run_test_node(
task_executor.clone(),
Dave,
|| {},
|| {},
vec![charlie.addr.clone()],
vec![alice.addr.clone(), bob.addr.clone()],
para_id,
false,
);
dave.wait_for_blocks(4).await;
// Should sync to the tip
// let dave = cumulus_test_service::run_test_node(
// task_executor.clone(),
// Dave,
// || {},
// || {},
// vec![charlie.addr.clone()],
// vec![alice.addr.clone(), bob.addr.clone()],
// para_id,
// false,
// )
// .await;
// dave.wait_for_blocks(4).await;
join!(
alice.task_manager.clean_shutdown(),
bob.task_manager.clean_shutdown(),
charlie.task_manager.clean_shutdown(),
dave.task_manager.clean_shutdown(),
// dave.task_manager.clean_shutdown(),
);
}