Skip to content

Commit

Permalink
Merge pull request #52 from nazar-pc/remove-unnecessary-executor-disp…
Browse files Browse the repository at this point in the history
…atch

Remove now unnecessary `ExecutorDispatch` implementation
  • Loading branch information
nazar-pc authored Dec 19, 2023
2 parents 109f608 + ef6e36b commit 332607a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ relm4-components = { version = "0.7.0-beta.2", git = "https://github.com/Relm4/R
sc-client-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
sc-client-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
sc-consensus-slots = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
sc-executor = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
sc-network = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
sc-storage-monitor = { git = "https://github.com/subspace/polkadot-sdk", rev = "c63a8b28a9fd26d42116b0dcef1f2a5cefb9cd1c", default-features = false }
Expand Down
24 changes: 2 additions & 22 deletions src/backend/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ use sc_client_db::{DatabaseSource, PruningMode};
use sc_consensus_slots::SlotProportion;
use sc_network::config::{Ed25519Secret, NetworkConfiguration, NodeKeyConfig, SyncMode};
use sc_service::config::{KeystoreConfig, OffchainWorkerConfig};
use sc_service::{
BasePath, BlocksPruning, Configuration, NativeExecutionDispatch, Role, RpcMethods,
};
use sc_service::{BasePath, BlocksPruning, Configuration, Role, RpcMethods};
use sc_storage_monitor::{StorageMonitorParams, StorageMonitorService};
use sc_subspace_chain_specs::ConsensusChainSpec;
use sp_core::crypto::Ss58AddressFormat;
Expand All @@ -26,7 +24,7 @@ use subspace_core_primitives::BlockNumber;
use subspace_networking::libp2p::identity::ed25519::Keypair;
use subspace_networking::libp2p::Multiaddr;
use subspace_networking::Node;
use subspace_runtime::{RuntimeApi, RuntimeGenesisConfig};
use subspace_runtime::{ExecutorDispatch, RuntimeApi, RuntimeGenesisConfig};
use subspace_service::{FullClient, NewFull, SubspaceConfiguration, SubspaceNetworking};
use tokio::runtime::Handle;
use tokio::time::MissedTickBehavior;
Expand Down Expand Up @@ -181,24 +179,6 @@ impl ConsensusNode {
}
}

/// Executor dispatch for subspace runtime
pub(super) struct ExecutorDispatch;

impl NativeExecutionDispatch for ExecutorDispatch {
type ExtendHostFunctions = (
sp_consensus_subspace::consensus::HostFunctions,
sp_domains_fraud_proof::HostFunctions,
);

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
subspace_runtime::api::dispatch(method, data)
}

fn native_version() -> sc_executor::NativeVersion {
subspace_runtime::native_version()
}
}

pub(super) fn load_chain_specification(chain_spec: &'static [u8]) -> Result<ChainSpec, String> {
ConsensusChainSpec::from_json_bytes(chain_spec).map(ChainSpec)
}
Expand Down

0 comments on commit 332607a

Please sign in to comment.