Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doestfhe support compiled deployment on wasm? #1111

Open
vladilen11 opened this issue Apr 28, 2024 · 5 comments
Open

Doestfhe support compiled deployment on wasm? #1111

vladilen11 opened this issue Apr 28, 2024 · 5 comments
Labels
feature_request Something I need does not exist

Comments

@vladilen11
Copy link

Does tfhe support compiled deployment on wasm? I'm trying to reference the tfhe lib in the wasm environment.

code:

tfhe = { version = "0.6.1", features = [ "boolean","shortint", "integer", "aarch64-unix"] }

build log:

  --- stderr
     Compiling getrandom v0.2.12
     Compiling concrete-csprng v0.4.0
     Compiling tfhe v0.6.1
  error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
     --> /Users/feng/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/getrandom-0.2.12/src/lib.rs:291:9
      |
  291 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
  292 | |                         default, you may need to enable the \"js\" feature. \
  293 | |                         For more information see: \
  294 | |                         https://docs.rs/getrandom/#webassembly-support");
      | |________________________________________________________________________^

  error[E0433]: failed to resolve: use of undeclared crate or module `imp`
     --> /Users/feng/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/getrandom-0.2.12/src/lib.rs:347:9
      |
  347 |         imp::getrandom_inner(dest)?;
      |         ^^^ use of undeclared crate or module `imp`

  For more information about this error, try `rustc --explain E0433`.
  error: could not compile `getrandom` (lib) due to 2 previous errors
  warning: build failed, waiting for other jobs to finish...
  error: failed to run custom build command for `concrete-csprng v0.4.0`

  Caused by:
    process didn't exit successfully: `/Users/feng/Desktop/obelisk/substrate/substrate-node-template/target/release/wbuild/node-template-runtime/target/release/build/concrete-csprng-12ac4374190b88c7/build-script-build` (exit status: 101)
    --- stderr
    thread 'main' panicked at /Users/feng/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/concrete-csprng-0.4.0/build.rs:42:17:
    Feature `seeder_unix` requires target_family `unix`, current cfg: `wasm`
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@vladilen11 vladilen11 added the feature_request Something I need does not exist label Apr 28, 2024
@IceTDrinker
Copy link
Member

Hello @vladilen11

remove the aarch64-unix as wasm32 is its own target.

You will likely miss an entropy source but I don't think the wasm32 target provides one at the moment by default.

We don't support wasm32 and it's not in our roadmap see #1034 (comment)

Cheers

@IceTDrinker
Copy link
Member

What is your use case btw ?

@IceTDrinker
Copy link
Member

@vladilen11 could you confirm it was a feature issue for the compilation problem you are facing ?

@vladilen11
Copy link
Author

@vladilen11 could you confirm it was a feature issue for the compilation problem you are facing ?

@IceTDrinker Sorry to delay, yeah, I'm a developer from the substrate ecosystem, and I'm trying to compile the tfhe module into the substrate runtime (wasm32-unknown-unknown environment) so that tfhe's functionality is supported by the substrate chain.

As far as I know, both ICP and CosmWasm require the code to be compiled into wasm32, so I think tfhe support to wasm32 is a very important thing. 🤔

@Zombieliu
Copy link

Yes, I am also a multichain related developer from the ecosystem described above, and I believe that zama's support for fhe wasm could reach this large crypto developer community on a much larger scale using fhe's functionality and not just evm computation related implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request Something I need does not exist
Projects
None yet
Development

No branches or pull requests

3 participants