[package] name = "smoldot" version = "0.18.0" description = "Primitives to build a client for Substrate-based blockchains" documentation = "https://docs.rs/smoldot" keywords = ["blockchain", "peer-to-peer"] authors.workspace = true license.workspace = true edition.workspace = true repository.workspace = true include.workspace = true [features] default = ["database-sqlite", "std", "wasmtime"] database-sqlite = [ "dep:parking_lot", "dep:rusqlite", "std" # A database stored on the filesystem can't reasonably work without a filesystem. ] std = [ "futures-executor/thread-pool", "futures-util", "dep:pin-project", "schnorrkel/getrandom", # TODO: necessary for signing; clarify in docs and in source code "dep:soketto", ] wasmtime = [ "dep:wasmtime", "std" # TODO: unfortunately doesn't compile without `std`, but could be fixed ] [dependencies] # This section contains only no_std-compatible crates. See below for std-only crates. # # Before adding a crate here, please make sure that it is `no_std`-compatible. If a crate should # theoretically be `no_std`-compatible (i.e. doesn't need the help of the operating system) but is # not, or if things are sketchy, please leave a comment next to it. arrayvec = { version = "0.7.3", default-features = false } async-lock = { version = "3.0.0", default-features = false } atomic-take = { version = "1.1.0" } base64 = { version = "0.22.0", default-features = false, features = ["alloc"] } bip39 = { version = "2.0.0", default-features = false } blake2-rfc = { version = "0.2.18", default-features = false } bs58 = { version = "0.5.1", default-features = false, features = ["alloc"] } chacha20 = { version = "0.9.1", default-features = false } crossbeam-queue = { version = "0.3.11", default-features = false, features = ["alloc"] } derive_more = "0.99.17" ed25519-zebra = { version = "4.0.1", default-features = false } either = { version = "1.9.0", default-features = false } event-listener = { version = "5.3.0", default-features = false } fnv = { version = "1.0.7", default-features = false } futures-lite = { version = "2.3.0", default-features = false, features = ["alloc"] } hashbrown = { version = "0.14.0", default-features = false, features = ["serde"] } # TODO: remove serde feature hex = { version = "0.4.3", default-features = false } hmac = { version = "0.12.1", default-features = false } itertools = { version = "0.13.0", default-features = false } libm = { version = "0.2.8", default-features = false } libsecp256k1 = { version = "0.7.1", default-features = false, features = ["static-context", "hmac"] } # The log` crate is forbidden, as it is very impolite to emit logs from a library. merlin = { version = "3.0", default-features = false } nom = { version = "7.1.3", default-features = false, features = ["alloc"] } num-bigint = { version = "0.4.3", default-features = false } num-rational = { version = "0.4.1", default-features = false, features = ["num-bigint"] } num-traits = { version = "0.2.19", default-features = false } pbkdf2 = { version = "0.12.1", default-features = false } poly1305 = { version = "0.8.0", default-features = false } rand = { version = "0.8.5", default-features = false, features = ["alloc"] } rand_chacha = { version = "0.3.1", default-features = false } ruzstd = { version = "0.6.0", default-features = false } schnorrkel = { version = "0.11.2", default-features = false, features = ["preaudit_deprecated", "alloc"] } serde = { version = "1.0.183", default-features = false, features = ["alloc", "derive"] } serde_json = { version = "1.0.104", default-features = false, features = ["alloc", "raw_value"] } sha2 = { version = "0.10.7", default-features = false } sha3 = { version = "0.10.8", default-features = false } siphasher = { version = "1.0.1", default-features = false } slab = { version = "0.4.8", default-features = false } smallvec = { version = "1.13.2", default-features = false } twox-hash = { version = "1.6.3", default-features = false } wasmi = { version = "0.32.0", default-features = false } x25519-dalek = { version = "2.0.0-rc.3", default-features = false, features = ["alloc", "precomputed-tables", "static_secrets", "zeroize"] } zeroize = { version = "1.7.0", default-features = false, features = ["alloc"] } # `database-sqlite` feature rusqlite = { version = "0.31.0", optional = true, default-features = false, features = ["bundled"] } # `std` feature # Add here the crates that cannot function without the help of the operating system or environment. futures-util = { version = "0.3.27", optional = true, default-features = false, features = ["std", "io", "async-await-macro", "sink"] } # TODO: slim down these features parking_lot = { version = "0.12.1", optional = true } pin-project = { version = "1.1.5", optional = true } soketto = { version = "0.8.0", optional = true } # This list of targets matches the tier 1 and tier 2 of platforms supported by wasmtime: # The arch and OS of a specific target can be found with the command `rustc +nightly -Z unstable-options --print target-spec-json --target ...` [target.'cfg(any(all(target_arch = "x86_64", any(target_os = "windows", all(target_os = "linux", target_env = "gnu"), target_os = "macos")), all(target_arch = "aarch64", target_os = "linux", target_env = "gnu"), all(target_arch = "s390x", target_os = "linux", target_env = "gnu")))'.dependencies] # `wasmtime` feature # Note that we have to enable more features than needed just in order to disable them, as wasmtime does trickeries such as wasmtime = { version = "21.0.0", default-features = false, features = ["async", "cranelift", "gc", "component-model", "threads"], optional = true } [dev-dependencies] criterion = "0.5.1" futures-executor = { version = "0.3.28", default-features = false } rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"] } tempfile = "3.10.0" wat = "1.203.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [[bench]] name = "header" harness = false [[bench]] name = "proof-decode" harness = false