Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Dec 8, 2022
1 parent 9c68874 commit 6605dbd
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 14 deletions.
47 changes: 46 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/c
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32" }
cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.32" }

# Polkadot dependencies
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.32" }
Expand Down
2 changes: 1 addition & 1 deletion node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct Cli {
pub no_hardware_benchmarks: bool,

/// Relay chain arguments
#[arg(raw = true, conflicts_with = "relay-chain-rpc-url")]
#[arg(raw = true)]
pub relaychain_args: Vec<String>,
}

Expand Down
5 changes: 4 additions & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use codec::Encode;
use cumulus_client_cli::generate_genesis_block;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
use log::{info, warn};
use sc_cli::{
CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
Expand Down Expand Up @@ -744,6 +744,9 @@ pub fn run() -> Result<()> {
"no"
}
);
if collator_options.relay_chain_rpc_url.is_some() && cli.relaychain_args.len() > 0 {
warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
}

#[cfg(feature = "phala-native")]
if config.chain_spec.is_phala() {
Expand Down
12 changes: 3 additions & 9 deletions node/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use cumulus_client_service::{
use cumulus_primitives_core::ParaId;
use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain;
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 polkadot_service::CollatorPair;

use sc_executor::WasmExecutor;
Expand Down Expand Up @@ -82,13 +82,8 @@ async fn build_relay_chain_interface(
Option<CollatorPair>,
)> {
match collator_options.relay_chain_rpc_url {
Some(relay_chain_url) => {
let client = create_client_and_start_worker(relay_chain_url, task_manager).await?;
Ok((
Arc::new(RelayChainRpcInterface::new(client)) as Arc<_>,
None,
))
}
Some(relay_chain_url) =>
build_minimal_relay_chain_node(polkadot_config, task_manager, relay_chain_url).await,
None => build_inprocess_relay_chain(
polkadot_config,
parachain_config,
Expand Down Expand Up @@ -452,7 +447,6 @@ where
relay_chain_interface,
relay_chain_slot_duration,
import_queue,
collator_options,
};

start_full_node(params)?;
Expand Down
1 change: 0 additions & 1 deletion node/src/service/phala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ async fn start_node_impl<RuntimeApi, RB, BIQ, BIC>(
relay_chain_interface,
relay_chain_slot_duration,
import_queue,
collator_options,
};

start_full_node(params)?;
Expand Down
1 change: 0 additions & 1 deletion node/src/service/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ async fn start_node_impl<RuntimeApi, RB, BIQ, BIC>(
relay_chain_interface,
relay_chain_slot_duration,
import_queue,
collator_options,
};

start_full_node(params)?;
Expand Down

0 comments on commit 6605dbd

Please sign in to comment.