Cargo Features

[dependencies]
radix-engine = { version = "1.2.0", default-features = false, features = ["std", "alloc", "cpu_ram_metrics", "wasmer", "moka", "lru", "resource_tracker", "db_checker", "fuzzing", "radix_engine_tests", "full_wasm_benchmarks", "coverage", "serde_json"] }
default = moka, std

You should enable either std or alloc

std default cpu_ram_metrics?

Enables std of radix-blueprint-schema-init, radix-common-derive, radix-engine-interface, radix-native-sdk, radix-rust, radix-substate-store-interface, radix-transactions, and radix-wasm-instrument

radix-wasm-instrument:

WASM instrumentation

and std of radix-wasmi, sbor, and optional serde_json

radix-wasmi:

WASM execution

  • Wasmi is a WASM interpreter that supports WebAssembly MVP
  • Wasmer is a WASM engine with multiple backends: singlepass (linear time), LLVM and cranelift

Affects panics::catch_unwind_system_panic_transformer, kernel::resources_tracker

alloc

Enables hashbrown of optional lru ^0.8.1 and alloc of radix-blueprint-schema-init, radix-common-derive, radix-engine-interface, radix-native-sdk, radix-rust, radix-substate-store-interface, radix-transactions, sbor, and optional serde_json

serde_json:

Provide integration for heap-allocated collections without depending on the rest of the Rust standard library. NOTE: Disabling both std and alloc features is not supported yet.

cpu_ram_metrics = perfcnt, std

Enables heap memory and CPU cycles resource tracing - available only for Linux OS on x86 arch.
Requires CAP_PERFMON capability for the process (sudo setcap cap_perfmon=eip <exec_file>).

Enables ram_metrics of radix-engine-profiling

Affects kernel::resources_tracker

wasmer

Use wasmer as WASM engine, otherwise wasmi

Enables wasmer ^2.2.1 and wasmer-compiler-singlepass ^2.2.1

Affects wasm::DefaultWasmEngine, wasm::DefaultWasmInstance

moka default

Two features for the two possible libraries to use for caching. Moka is not WASM friendly while LRU is. One of these two features must be enabled.

Enables moka ^0.9.9

lru

Enables lru ^0.8.1

resource_tracker

Enables resource_tracker of radix-common, radix-engine-profiling, and radix-engine-profiling-derive

db_checker

System/Application Database Checker

Affects system::checkers

fuzzing

This flag is set by fuzz-tests framework and it disables cache in wasm_instrumenter/wasmi/wasmer to prevent non-determinism when fuzzing

Enables fuzzing of radix-common, radix-engine-interface, radix-rust, radix-transactions, and sbor

radix_engine_tests

This flag enables code parts used only for testing. Using "test" config option is not enough in cases,
when external crate is used for tests (eg. radix-engine-tests)

Affects wasmer::host_read_memory, wasmer::host_write_memory, wasmer::host_check_memory_is_clean

full_wasm_benchmarks
coverage

This flag disables package size limit, memory size limit and fee limit

Enables coverage of radix-common

Affects tx_processor::MAX_TOTAL_BLOB_SIZE_PER_INVOCATION, coverage::save_coverage_data

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.

perfcnt cpu_ram_metrics?
serde_json implicit feature

Enables serde_json

serde_json:

A JSON serialization file format