I discovered that SSZ types cannot be used inside zkVMs or compiled to WASM for browser 😔.
Short reproduction
cargo new --bin demo
cd ./demo
cargo add --no-default-features ssz_types@=0.14.0
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown
Compilation fails on ethereum_hashing:
Compiling ethereum_hashing v0.8.0
error: Ring must be enabled on non-x86_64 architectures
--> /home/andrew/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ethereum_hashing-0.8.0/src/lib.rs:128:13
|
128 | compile_error!("Ring must be enabled on non-x86_64 architectures");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NOTE: ethereum_hashing gets included as dependency of tree_hash.
Solutions
Option A) Feature-gate tree hash related parts of the crate. In my case I just want to parse basic SSZ data, without merkleization. This is quite messy solution for the current codebase...
Option B) Allow enabling sha2 in ethereum_hashing on arbitrary platform. IMO really good option!
I discovered that SSZ types cannot be used inside zkVMs or compiled to WASM for browser 😔.
Short reproduction
Compilation fails on
ethereum_hashing:NOTE:
ethereum_hashinggets included as dependency oftree_hash.Solutions
Option A) Feature-gate tree hash related parts of the crate. In my case I just want to parse basic SSZ data, without merkleization. This is quite messy solution for the current codebase...
Option B) Allow enabling sha2 in
ethereum_hashingon arbitrary platform. IMO really good option!