Skip to content

Commit 4a93ea0

Browse files
authored
Merge pull request #949 from opentensor/fix-host-functions-testnet
fix: host functions (testnet)
2 parents 05a53d7 + bbd5a1e commit 4a93ea0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Diff for: node/src/service.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ use std::{sync::Arc, time::Duration};
1717
/// imported and generated.
1818
const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512;
1919

20+
/// Always enable runtime benchmark host functions, the genesis state
21+
/// was built with them so we're stuck with them forever.
22+
///
23+
/// They're just a noop, never actually get used if the runtime was not compiled with
24+
/// `runtime-benchmarks`.
25+
pub type HostFunctions = (
26+
sp_io::SubstrateHostFunctions,
27+
frame_benchmarking::benchmarking::HostFunctions,
28+
);
29+
2030
pub(crate) type FullClient =
21-
sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<sp_io::SubstrateHostFunctions>>;
31+
sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>;
2232
type FullBackend = sc_service::TFullBackend<Block>;
2333
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
2434

@@ -55,7 +65,7 @@ pub fn new_partial(
5565
})
5666
.transpose()?;
5767

58-
let executor = sc_service::new_wasm_executor::<sp_io::SubstrateHostFunctions>(&config.executor);
68+
let executor = sc_service::new_wasm_executor::<HostFunctions>(&config.executor);
5969

6070
let (client, backend, keystore_container, task_manager) =
6171
sc_service::new_full_parts::<Block, RuntimeApi, _>(

0 commit comments

Comments
 (0)