Skip to content

Commit

Permalink
client refactor (#1263)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Jun 18, 2024
1 parent 8b2065a commit 5477e6f
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 1,386 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkado
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
Expand Down
2 changes: 2 additions & 0 deletions bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ sc-cli = { workspace = true, optional = true }

# cumulus dependencies
cumulus-client-cli = { workspace = true }
cumulus-client-collator = { workspace = true }
cumulus-client-consensus-aura = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-consensus-proposer = { workspace = true }
cumulus-client-consensus-relay-chain = { workspace = true }
cumulus-client-network = { workspace = true }
cumulus-client-service = { workspace = true }
Expand Down
28 changes: 11 additions & 17 deletions bin/collator/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub fn run() -> Result<()> {
..
} = parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
Ok((cmd.run(client, import_queue), task_manager))
})
Expand Down Expand Up @@ -261,7 +261,7 @@ pub fn run() -> Result<()> {
..
} = parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
Ok((cmd.run(client, config.database), task_manager))
})
Expand Down Expand Up @@ -301,7 +301,7 @@ pub fn run() -> Result<()> {
..
} = parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
Ok((cmd.run(client, config.chain_spec), task_manager))
})
Expand Down Expand Up @@ -343,7 +343,7 @@ pub fn run() -> Result<()> {
..
} = parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
Ok((cmd.run(client, import_queue), task_manager))
})
Expand Down Expand Up @@ -409,7 +409,7 @@ pub fn run() -> Result<()> {
..
} = parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
let aux_revert = Box::new(|client, _, blocks| {
sc_consensus_grandpa::revert(client, blocks)?;
Expand Down Expand Up @@ -452,7 +452,7 @@ pub fn run() -> Result<()> {
let PartialComponents { client, .. } =
parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
cmd.run(config.chain_spec.as_ref(), client.as_ref())
})
Expand Down Expand Up @@ -522,7 +522,7 @@ pub fn run() -> Result<()> {
let params =
parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
cmd.run(params.client)
})
Expand Down Expand Up @@ -562,7 +562,7 @@ pub fn run() -> Result<()> {
let params =
parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
let db = params.backend.expose_db();
let storage = params.backend.expose_storage();
Expand Down Expand Up @@ -618,7 +618,7 @@ pub fn run() -> Result<()> {
let params =
parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;

let ext_builder = RemarkBuilder::new(params.client.clone());
Expand Down Expand Up @@ -700,7 +700,7 @@ pub fn run() -> Result<()> {
let params =
parachain::new_partial::<shiden::RuntimeApi, shiden::Executor, _>(
&config,
parachain::build_import_queue,
parachain::build_import_queue_fallback,
)?;
let remark_builder = RemarkBuilder::new(params.client.clone());
let tka_builder = TransferKeepAliveBuilder::new(
Expand Down Expand Up @@ -788,14 +788,8 @@ pub fn run() -> Result<()> {
};

runner.run_node_until_exit(|config| async move {
#[cfg(feature = "evm-tracing")]
if config.chain_spec.is_dev() {
return local::start_node(config, evm_tracing_config).map_err(Into::into);
}

#[cfg(not(feature = "evm-tracing"))]
if config.chain_spec.is_dev() {
return local::start_node(config).map_err(Into::into);
return local::start_node(config, #[cfg(feature = "evm-tracing")] evm_tracing_config).map_err(Into::into);
}

let polkadot_cli = RelayChainCli::new(
Expand Down
Loading

0 comments on commit 5477e6f

Please sign in to comment.