Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove assumption that there is a local bootnode in RPC collator (#2091)
Browse files Browse the repository at this point in the history
* Remove assumption that there is a local bootnode

* Bump zombienet to 1.3.29

* Separate "--"
  • Loading branch information
skunert authored Jan 24, 2023
1 parent fbf0e13 commit fb829ab
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
26 changes: 1 addition & 25 deletions client/relay-chain-minimal-node/src/blockchain_rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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>>> {
Expand Down
4 changes: 0 additions & 4 deletions client/relay-chain-minimal-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?
Expand Down
5 changes: 0 additions & 5 deletions client/relay-chain-rpc-interface/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions zombienet/tests/0006-rpc_collator_builds_blocks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ 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]]
name = "eve"
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')}}"]

0 comments on commit fb829ab

Please sign in to comment.