Skip to content

Commit

Permalink
polkadot-parachain: Remove shell node (#5911)
Browse files Browse the repository at this point in the history
Removing the shell node variant for the polkadot-parachain as discussed
here:
#5586 (comment)

Resolves #5898
  • Loading branch information
serban300 authored Oct 3, 2024
1 parent 8614dc0 commit 48ec3c8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
NodeBlock, NodeExtraArgs,
},
fake_runtime_api,
nodes::{shell::ShellNode, DynNodeSpecExt},
nodes::DynNodeSpecExt,
runtime::BlockNumber,
};
#[cfg(feature = "runtime-benchmarks")]
Expand Down Expand Up @@ -77,7 +77,6 @@ fn new_node_spec(
let runtime = runtime_resolver.runtime(config.chain_spec.as_ref())?;

Ok(match runtime {
Runtime::Shell => Box::new(ShellNode),
Runtime::Omni(block_number, consensus) => match (block_number, consensus) {
(BlockNumber::U32, Consensus::Aura(aura_id)) =>
new_aura_node_spec::<Block<u32>>(aura_id, extra_args),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,6 @@ pub(crate) trait BuildRpcExtensions<Client, Backend, Pool> {
) -> sc_service::error::Result<RpcExtension>;
}

pub(crate) struct BuildEmptyRpcExtensions<Block, RuntimeApi>(PhantomData<(Block, RuntimeApi)>);

impl<Block: BlockT, RuntimeApi>
BuildRpcExtensions<
ParachainClient<Block, RuntimeApi>,
ParachainBackend<Block>,
sc_transaction_pool::FullPool<Block, ParachainClient<Block, RuntimeApi>>,
> for BuildEmptyRpcExtensions<Block, RuntimeApi>
where
RuntimeApi:
ConstructNodeRuntimeApi<Block, ParachainClient<Block, RuntimeApi>> + Send + Sync + 'static,
{
fn build_rpc_extensions(
_client: Arc<ParachainClient<Block, RuntimeApi>>,
_backend: Arc<ParachainBackend<Block>>,
_pool: Arc<sc_transaction_pool::FullPool<Block, ParachainClient<Block, RuntimeApi>>>,
) -> sc_service::error::Result<RpcExtension> {
Ok(RpcExtension::new(()))
}
}

pub(crate) struct BuildParachainRpcExtensions<Block, RuntimeApi>(PhantomData<(Block, RuntimeApi)>);

impl<Block: BlockT, RuntimeApi>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ pub enum Runtime {
/// None of the system-chain runtimes, rather the node will act agnostic to the runtime ie. be
/// an omni-node, and simply run a node with the given consensus algorithm.
Omni(BlockNumber, Consensus),
/// Shell
Shell,
}

/// Helper trait used for extracting the Runtime variant from the chain spec ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

pub mod aura;
mod manual_seal;
pub mod shell;

use crate::common::spec::{DynNodeSpec, NodeSpec as NodeSpecT};
use cumulus_primitives_core::ParaId;
Expand Down
152 changes: 0 additions & 152 deletions cumulus/polkadot-parachain/polkadot-parachain-lib/src/nodes/shell.rs

This file was deleted.

18 changes: 1 addition & 17 deletions cumulus/polkadot-parachain/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ impl LoadSpec for ChainSpecLoader {
#[derive(Debug, PartialEq)]
enum LegacyRuntime {
Omni,
Shell,
Seedling,
AssetHubPolkadot,
AssetHub,
Penpal,
Expand All @@ -218,11 +216,7 @@ impl LegacyRuntime {
fn from_id(id: &str) -> LegacyRuntime {
let id = id.replace('_', "-");

if id.starts_with("shell") {
LegacyRuntime::Shell
} else if id.starts_with("seedling") {
LegacyRuntime::Seedling
} else if id.starts_with("asset-hub-polkadot") | id.starts_with("statemint") {
if id.starts_with("asset-hub-polkadot") | id.starts_with("statemint") {
LegacyRuntime::AssetHubPolkadot
} else if id.starts_with("asset-hub-kusama") |
id.starts_with("statemine") |
Expand Down Expand Up @@ -277,7 +271,6 @@ impl RuntimeResolverT for RuntimeResolver {
LegacyRuntime::Penpal |
LegacyRuntime::Omni =>
Runtime::Omni(BlockNumber::U32, Consensus::Aura(AuraConsensusId::Sr25519)),
LegacyRuntime::Shell | LegacyRuntime::Seedling => Runtime::Shell,
})
}
}
Expand Down Expand Up @@ -336,15 +329,6 @@ mod tests {

#[test]
fn test_legacy_runtime_for_different_chain_specs() {
let chain_spec = create_default_with_extensions("shell-1", Extensions1::default());
assert_eq!(LegacyRuntime::Shell, LegacyRuntime::from_id(chain_spec.id()));

let chain_spec = create_default_with_extensions("shell-2", Extensions2::default());
assert_eq!(LegacyRuntime::Shell, LegacyRuntime::from_id(chain_spec.id()));

let chain_spec = create_default_with_extensions("seedling", Extensions2::default());
assert_eq!(LegacyRuntime::Seedling, LegacyRuntime::from_id(chain_spec.id()));

let chain_spec =
create_default_with_extensions("penpal-rococo-1000", Extensions2::default());
assert_eq!(LegacyRuntime::Penpal, LegacyRuntime::from_id(chain_spec.id()));
Expand Down
16 changes: 16 additions & 0 deletions prdoc/pr_5911.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Removed the possibility to start a shell parachain node

doc:
- audience: Node Dev
description: |
Removed the possibility to start a shell parachain node using the polkadot-parachain-lib or
polkadot-parachain-bin.

crates:
- name: polkadot-parachain-lib
bump: minor
- name: polkadot-parachain-bin
bump: minor

0 comments on commit 48ec3c8

Please sign in to comment.