Remove assumption that there is a local bootnode in RPC collator (#2091)

* Remove assumption that there is a local bootnode

* Bump zombienet to 1.3.29

* Separate "--"
This commit is contained in:
Sebastian Kunert
2023-01-24 15:07:18 +01:00
committed by GitHub
parent fbf0e13976
commit fb829ab873
5 changed files with 4 additions and 37 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ variables:
CI_IMAGE: "paritytech/ci-linux:production"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.82"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.29"
.collect-artifacts:
artifacts:
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use std::{pin::Pin, str::FromStr};
use std::pin::Pin;
use cumulus_relay_chain_interface::{RelayChainError, RelayChainResult};
use cumulus_relay_chain_rpc_interface::RelayChainRpcClient;
@@ -24,12 +24,9 @@ use polkadot_overseer::RuntimeApiSubsystemClient;
use polkadot_service::{AuxStore, HeaderBackend};
use sc_authority_discovery::AuthorityDiscovery;
use sc_network_common::config::MultiaddrWithPeerId;
use sp_api::{ApiError, RuntimeApiInfo};
use sp_blockchain::Info;
const LOG_TARGET: &str = "blockchain-rpc-client";
#[derive(Clone)]
pub struct BlockChainRpcClient {
rpc_client: RelayChainRpcClient,
@@ -338,27 +335,6 @@ impl AuthorityDiscovery<Block> for BlockChainRpcClient {
}
impl BlockChainRpcClient {
pub async fn local_listen_addresses(
&self,
) -> Result<Vec<MultiaddrWithPeerId>, RelayChainError> {
let addresses = self.rpc_client.system_local_listen_addresses().await?;
tracing::debug!(target: LOG_TARGET, ?addresses, "Fetched listen address from RPC node.");
let mut result_vec = Vec::new();
for address in addresses {
match MultiaddrWithPeerId::from_str(&address) {
Ok(addr) => result_vec.push(addr),
Err(err) =>
return Err(RelayChainError::GenericError(format!(
"Failed to parse a local listen addresses from the RPC node: {}",
err
))),
}
}
Ok(result_vec)
}
pub async fn import_notification_stream(
&self,
) -> RelayChainResult<Pin<Box<dyn Stream<Item = Header> + Send>>> {
@@ -127,10 +127,6 @@ async fn new_minimal_relay_chain(
) -> Result<NewMinimalNode, RelayChainError> {
let role = config.role.clone();
// Use the given RPC node as bootnode, since we do not have a chain spec with valid boot nodes
let mut boot_node_address = relay_chain_rpc_client.local_listen_addresses().await?;
config.network.boot_nodes.append(&mut boot_node_address);
let task_manager = {
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
TaskManager::new(config.tokio_handle.clone(), registry)?
@@ -179,11 +179,6 @@ impl RelayChainRpcClient {
.await
}
/// Get local listen address of the node
pub async fn system_local_listen_addresses(&self) -> Result<Vec<String>, RelayChainError> {
self.request("system_localListenAddresses", rpc_params![]).await
}
/// Get system health information
pub async fn system_health(&self) -> Result<Health, RelayChainError> {
self.request("system_health", rpc_params![]).await
@@ -39,7 +39,7 @@ cumulus_based = true
validator = true
image = "{{COL_IMAGE}}"
command = "test-parachain"
args = ["-lparachain=trace,blockchain-rpc-client=debug", "--relay-chain-rpc-urls {{'one'|zombie('wsUri')}} {{'two'|zombie('wsUri')}} {{'three'|zombie('wsUri')}}", "-- --bootnodes {{'one'|zombie('multiAddress')}} {{'two'|zombie('multiAddress')}} {{'three'|zombie('multiAddress')}}"]
args = ["-lparachain=trace,blockchain-rpc-client=debug", "--relay-chain-rpc-urls {{'one'|zombie('wsUri')}} {{'two'|zombie('wsUri')}} {{'three'|zombie('wsUri')}}", "--", "--bootnodes {{'one'|zombie('multiAddress')}} {{'two'|zombie('multiAddress')}} {{'three'|zombie('multiAddress')}}"]
# run eve as parachain full node
[[parachains.collators]]
@@ -47,4 +47,4 @@ cumulus_based = true
validator = true
image = "{{COL_IMAGE}}"
command = "test-parachain"
args = ["-lparachain=trace,blockchain-rpc-client=debug", "--relay-chain-rpc-urls {{'one'|zombie('wsUri')}} {{'two'|zombie('wsUri')}} {{'three'|zombie('wsUri')}}", "-- --bootnodes {{'one'|zombie('multiAddress')}} {{'two'|zombie('multiAddress')}} {{'three'|zombie('multiAddress')}}"]
args = ["-lparachain=trace,blockchain-rpc-client=debug", "--relay-chain-rpc-urls {{'one'|zombie('wsUri')}} {{'two'|zombie('wsUri')}} {{'three'|zombie('wsUri')}}", "--", "--bootnodes {{'one'|zombie('multiAddress')}} {{'two'|zombie('multiAddress')}} {{'three'|zombie('multiAddress')}}"]