Skip to content

Commit

Permalink
Merge pull request #2680 from subspace/benchmarks-fix
Browse files Browse the repository at this point in the history
Fix benchmark run
  • Loading branch information
nazar-pc authored Apr 15, 2024
2 parents 189e83f + 0fbc86f commit d0245be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crates/subspace-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ substrate-build-script-utils = { git = "https://github.com/subspace/polkadot-sdk
[features]
default = []
runtime-benchmarks = [
"auto-id-domain-runtime/runtime-benchmarks",
"domain-service/runtime-benchmarks",
"evm-domain-runtime/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"subspace-runtime/runtime-benchmarks",
"subspace-service/runtime-benchmarks",
]
12 changes: 9 additions & 3 deletions crates/subspace-node/src/domain/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ impl DomainCli {
/// Creates domain configuration from domain cli.
pub fn create_domain_configuration(
&self,
cmd: &impl CliConfiguration,
base_path: &Path,
tokio_handle: tokio::runtime::Handle,
) -> sc_cli::Result<Configuration> {
let mut domain_config = SubstrateCli::create_configuration(self, self, tokio_handle)?;
let mut domain_config = SubstrateCli::create_configuration(self, cmd, tokio_handle)?;

// Change default paths to Subspace structure
let domain_base_path = base_path.join(self.domain_id.to_string());
Expand Down Expand Up @@ -173,8 +174,13 @@ impl SubstrateCli for DomainCli {
}

fn load_spec(&self, id: &str) -> Result<Box<dyn ChainSpec>, String> {
// TODO: Fetch the runtime name of `self.domain_id` properly.
let runtime_name = "evm";
// TODO: properly fetch the runtime name of `self.domain_id`
let runtime_name = if self.domain_id == 0.into() {
"auto-id"
} else {
"evm"
};

match runtime_name {
"evm" => evm_chain_spec::load_chain_spec(id),
"auto-id" => auto_id_chain_spec::load_chain_spec(id),
Expand Down
2 changes: 2 additions & 0 deletions crates/subspace-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ fn main() -> Result<(), Error> {
);
let domain_config = domain_cli
.create_domain_configuration(
&cmd,
consensus_chain_config.base_path.path(),
consensus_chain_config.tokio_handle,
)
Expand Down Expand Up @@ -363,6 +364,7 @@ fn main() -> Result<(), Error> {
let domain_cli = DomainCli::new(cmd.domain_args.clone().into_iter());
let domain_config = domain_cli
.create_domain_configuration(
&cmd,
consensus_chain_config.base_path.path(),
consensus_chain_config.tokio_handle,
)
Expand Down

0 comments on commit d0245be

Please sign in to comment.