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

Companion for Polkadot#7337 #2929

Merged
merged 10 commits into from
Aug 1, 2023
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions client/relay-chain-inprocess-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ metered = { package = "prioritized-metered-channel", version = "0.2.0" }

# Cumulus
cumulus-test-service = { path = "../../test/service" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
22 changes: 22 additions & 0 deletions client/relay-chain-inprocess-interface/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

fn main() {
substrate_build_script_utils::generate_cargo_keys();
// For the node/worker version check, make sure we always rebuild the node and binary workers
// when the version changes.
substrate_build_script_utils::rerun_if_git_head_changed();
mrcnski marked this conversation as resolved.
Show resolved Hide resolved
}
28 changes: 17 additions & 11 deletions client/relay-chain-inprocess-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,23 @@ fn build_polkadot_full_node(

let relay_chain_full_node = polkadot_service::build_full(
config,
is_collator,
None,
// Disable BEEFY. It should not be required by the internal relay chain node.
false,
None,
telemetry_worker_handle,
true,
polkadot_service::RealOverseerGen,
None,
None,
hwbench,
polkadot_service::NewFullParams {
is_collator,
grandpa_pause: None,
// Disable BEEFY. It should not be required by the internal relay chain node.
enable_beefy: false,
jaeger_agent: None,
telemetry_worker_handle,
node_version: Some(env!("SUBSTRATE_CLI_IMPL_VERSION").into()),
workers_path: None,
workers_names: None,
dont_use_external_workers: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may need to rig this crate to build the workers for this to work. Can someone please explain what this crate does exactly, does it call PVF preparation/execution?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Cumulus spawns PVF workers. There's some discussion here: paritytech/polkadot#6497

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a collator the runtime is trusted, for a validator the runtime is not.

Okay yeah, that makes perfect sense. So we don't need most of what I added here, will remove.

overseer_enable_anyways: true,
overseer_gen: polkadot_service::RealOverseerGen,
overseer_message_channel_capacity_override: None,
malus_finality_delay: None,
hwbench,
},
)?;

Ok((relay_chain_full_node, maybe_collator_key))
Expand Down