2

When upgrading my node to the latest version of the Polkadot-SDK, I get the following error when trying to run the node:

Error:           Error: Command failed with exit code 1: bash -c ./target/release/parachain-template-node export-genesis-head -d /var/folders/_1/q03733qd0pv42n1dvkcvyx0c0000gn/T/zombie-a62cc984247da3304e3610859e23df97_-39473-pjQiul72IZpH/export-genesis-state/2000 --chain /var/folders/_1/q03733qd0pv42n1dvkcvyx0c0000gn/T/zombie-a62cc984247da3304e3610859e23df97_-39473-pjQiul72IZpH/2000-rococo-local.json /var/folders/_1/q03733qd0pv42n1dvkcvyx0c0000gn/T/zombie-a62cc984247da3304e3610859e23df97_-39473-pjQiul72IZpH/cfg/genesis-state-2000 && ./target/release/parachain-template-node export-genesis-wasm --chain /var/folders/_1/q03733qd0pv42n1dvkcvyx0c0000gn/T/zombie-a62cc984247da3304e3610859e23df97_-39473-pjQiul72IZpH/2000-rococo-local.json /var/folders/_1/q03733qd0pv42n1dvkcvyx0c0000gn/T/zombie-a62cc984247da3304e3610859e23df97_-39473-pjQiul72IZpH/cfg/genesis-wasm-2000
Error: Service(Client(VersionInvalid("Other error happened while constructing the runtime: runtime requires function imports which are not present on the host: 'env:ext_storage_proof_size_storage_proof_size_version_1'")))
2024-03-26 13:31:38 Cannot create a runtime error=Other("runtime requires function imports which are not present on the host: 'env:ext_storage_proof_size_storage_proof_size_version_1'")

How do I register / add the storage_proof_size host function?

1 Answer 1

2

Your host functions are registered in the service.rs file of your node.

Here is the relevant code in the latest version of the Polkadot SDK (as of writing this post):

#[cfg(not(feature = "runtime-benchmarks"))]
type HostFunctions =
    (sp_io::SubstrateHostFunctions, cumulus_client_service::storage_proof_size::HostFunctions);

#[cfg(feature = "runtime-benchmarks")]
type HostFunctions = (
    sp_io::SubstrateHostFunctions,
    cumulus_client_service::storage_proof_size::HostFunctions,
    frame_benchmarking::benchmarking::HostFunctions,
);

type ParachainClient<RuntimeApi> = TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>;

You can see the HostFunctions type includes the cumulus_client_service::storage_proof_size::HostFunctions which is what you need to fix that error.

Once your ParachainClient is configured with the right HostFunctions, the error should go away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.