Cargo Features

[dependencies]
sp-io = { version = "34.0.0", default-features = false, features = ["std", "with-tracing", "disable_panic_handler", "disable_allocator", "improved_panic_error_reporting", "bls-experimental"] }
default = std

The std feature is set by default whenever sp-io is added without default-features = false somewhere in the dependency tree.

std default = ed25519-dalek, libsecp256k1, secp256k1

Enables std of bytes, parity-scale-codec, optional ed25519-dalek, log, sp-core, sp-crypto-hashing, sp-externalities, sp-keystore, sp-runtime-interface, sp-state-machine, sp-std, sp-tracing, sp-trie, tracing, and tracing-core

ed25519-dalek:

Required for backwards compatibility reason, but only used for verifying when UseDalekExt is set.

Affects sp-io::TestExternalities, sp-io::SubstrateHostFunctions

with-tracing

Enables with-tracing of sp-tracing

disable_panic_handler

These two features are used for no_std builds for the environments which already provides #[panic_handler], #[alloc_error_handler] and #[global_allocator].

For the regular wasm runtime builds those are not used.

disable_oom disable_allocator
improved_panic_error_reporting

This feature flag controls the runtime's behavior when encountering a panic or when it runs out of memory, improving the diagnostics.

When enabled the runtime will marshal the relevant error message to the host through the PanicHandler::abort_on_panic runtime interface. This gives the caller direct programmatic access to the error message.

When disabled the error message will only be printed out in the logs, with the caller receiving a generic "wasm unreachable instruction executed" error message.

This has no effect if both disable_panic_handler and disable_oom are enabled.

WARNING: Enabling this feature flag requires the PanicHandler::abort_on_panic host function to be supported by the host. Do not enable it for your runtime without first upgrading your host client!

bls-experimental

This feature adds BLS crypto primitives.
It should not be used in production since the implementation and interface may still be subject to significant changes.

Enables bls-experimental of sp-keystore

Affects sp-io::Crypto.bls377_generate, sp-io::Crypto.ecdsa_bls377_generate

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

sp-keystore bls-experimental? std
libsecp256k1 std
sp-state-machine std
sp-trie std
log std
secp256k1 std

Enables secp256k1 ^0.28.0

ed25519-dalek std