Enable collation via RPC relay chain node (#1585)

* Add minimal overseer gen with dummy subsystems

* Fix dependencies

* no-compile: only client transaction pool missing

* Remove unused imports

* Continue to hack towards PoC

* Continue

* Make mini node compile

* Compiling version with blockchainevents trait

* Continue

* Check in lockfile

* Block with tokio

* update patches

* Update polkadot patches

* Use polkadot-primitives v2

* Fix build problems

* First working version

* Adjust cargo.lock

* Add integration test

* Make integration test work

* Allow startinc collator without relay-chain args

* Make OverseerRuntimeClient async

* Create separate integration test

* Remove unused ChainSelection code

* Remove unused parameters on new-mini

* Connect collator node in test to relay chain nodes

* Make BlockChainRPCClient obsolete

* Clean up

* Clean up

* Reimplement blockchain-rpc-events

* Revert "Allow startinc collator without relay-chain args"

This reverts commit f22c70e16521f375fe125df5616d48ceea926b1a.

* Add `strict_record_validation` to AuthorityDiscovery

* Move network to cumulus

* Remove BlockchainRPCEvents

* Remove `BlockIdTo` and `BlockchainEvents`

* Make AuthorityDiscovery async

* Use hash in OverseerRuntime

* Adjust naming of runtime client trait

* Implement more rpc-client methods

* Improve error handling for `ApiError`

* Extract authority-discovery creationand cleanup

* RPC -> Rpc

* Extract bitswap

* Adjust to changes on master

* Implement `hash` method

* Introduce DummyChainSync, remove ProofProvider and BlockBackend

* Remove `HeaderMetadata` from blockchain-rpc-client

* Make ChainSync work

* Implement NetworkHeaderBackend

* Cleanup

* Adjustments after master merge

* Remove ImportQueue from network parameters

* Remove cargo patches

* Eliminate warnings

* Revert to HeaderBackend

* Add zombienet test

* Implement `status()` method

* Add more comments, improve readability

* Remove patches from Cargo.toml

* Remove integration test in favor of zombienet

* Remove unused dependencies, rename minimal node crate

* Adjust to latest master changes

* fmt

* Execute zombienet test on gitlab ci

* Reuse network metrics

* Chainsync metrics

* fmt

* Feed RPC node as boot node to the relay chain minimal node

* fmt

* Add bootnodes to zombienet collators

* Allow specification of relay chain args

* Apply review suggestions

* Remove unnecessary casts

* Enable PoV recovery for rpc full nodes

* Revert unwanted changes

* Make overseerHandle non-optional

* Add availability-store subsystem

* Add AuxStore and ChainApiSubsystem

* Add availability distribution subsystem

* Improve pov-recovery logging and add RPC nodes to tests

* fmt

* Make availability config const

* lock

* Enable debug logs for pov-recovery in zombienet

* Add log filters to test binary

* Allow wss

* Address review comments

* Apply reviewer comments

* Adjust to master changes

* Apply reviewer suggestions

* Bump polkadot

* Add builder method for minimal node

* Bump substrate and polkadot

* Clean up overseer building

* Add bootnode to two in pov_recovery test

* Fix missing quote in pov recovery zombienet test

* Improve zombienet pov test

* More debug logs for pov-recovery

* Remove reserved nodes like on original test

* Revert zombienet test to master
This commit is contained in:
Sebastian Kunert
2022-10-10 09:06:26 +02:00
committed by GitHub
parent fde36ad4f9
commit 7612d616e0
33 changed files with 1948 additions and 104 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ pub struct TestCollatorCli {
pub parachain_id: u32,
/// Relay chain arguments
#[clap(raw = true, conflicts_with = "relay-chain-rpc-url")]
#[clap(raw = true)]
pub relaychain_args: Vec<String>,
#[clap(long)]
+12 -8
View File
@@ -38,7 +38,8 @@ use cumulus_client_service::{
use cumulus_primitives_core::ParaId;
use cumulus_relay_chain_inprocess_interface::RelayChainInProcessInterface;
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult};
use cumulus_relay_chain_rpc_interface::{create_client_and_start_worker, RelayChainRpcInterface};
use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node;
use cumulus_test_runtime::{Hash, Header, NodeBlock as Block, RuntimeApi};
use frame_system_rpc_runtime_api::AccountNonceApi;
@@ -183,8 +184,9 @@ async fn build_relay_chain_interface(
task_manager: &mut TaskManager,
) -> RelayChainResult<Arc<dyn RelayChainInterface + 'static>> {
if let Some(relay_chain_url) = collator_options.relay_chain_rpc_url {
let client = create_client_and_start_worker(relay_chain_url, task_manager).await?;
return Ok(Arc::new(RelayChainRpcInterface::new(client)) as Arc<_>)
return build_minimal_relay_chain_node(relay_chain_config, task_manager, relay_chain_url)
.await
.map(|r| r.0)
}
let relay_chain_full_node = polkadot_test_service::new_full(
@@ -198,12 +200,15 @@ async fn build_relay_chain_interface(
)?;
task_manager.add_child(relay_chain_full_node.task_manager);
tracing::info!("Using inprocess node.");
Ok(Arc::new(RelayChainInProcessInterface::new(
relay_chain_full_node.client.clone(),
relay_chain_full_node.backend.clone(),
Arc::new(relay_chain_full_node.network.clone()),
relay_chain_full_node.overseer_handle,
)) as Arc<_>)
relay_chain_full_node.overseer_handle.ok_or(RelayChainError::GenericError(
"Overseer should be running in full node.".to_string(),
))?,
)))
}
/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.
@@ -367,7 +372,6 @@ where
// the recovery delay of pov-recovery. We don't want to wait for too
// long on the full node to recover, so we reduce this time here.
relay_chain_slot_duration: Duration::from_millis(6),
collator_options,
};
start_full_node(params)?;
@@ -473,9 +477,9 @@ impl TestNodeBuilder {
/// node.
pub fn connect_to_parachain_nodes<'a>(
mut self,
nodes: impl Iterator<Item = &'a TestNode>,
nodes: impl IntoIterator<Item = &'a TestNode>,
) -> Self {
self.parachain_nodes.extend(nodes.map(|n| n.addr.clone()));
self.parachain_nodes.extend(nodes.into_iter().map(|n| n.addr.clone()));
self
}
+2 -1
View File
@@ -78,7 +78,8 @@ fn main() -> Result<(), sc_cli::Error> {
})
},
None => {
let mut builder = sc_cli::LoggerBuilder::new("");
let log_filters = cli.run.normalize().log_filters();
let mut builder = sc_cli::LoggerBuilder::new(log_filters.unwrap_or_default());
builder.with_colors(true);
let _ = builder.init();