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

How to use other library in rust code #146

Open
notawayne opened this issue Aug 2, 2023 · 3 comments
Open

How to use other library in rust code #146

notawayne opened this issue Aug 2, 2023 · 3 comments

Comments

@notawayne
Copy link

I am trying to compile rust code and convert it to wasm file with wasm-pack.Everything is ok when running simple calculations in rust code.

But when I try to use an ecdsa library k256 in my code, an error will be reported
thread 'main' panicked at 'failed to load wasm: Validation("Unknown opcode 192")', /home/Project/zkWasm/src/cli/app_builder.rs:75:67 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

When I try to do the following hash operation in the rust code, an error will be reported when doing single-prove
` let string = "Hello, World!";

let mut hasher = DefaultHasher::new();

string.hash(&mut hasher);

let result = hasher.finish().try_into().unwrap();

wasm_output(result)

`

thread 'main' panicked at 'proof generation should not fail: ConstraintSystemFailure', /home/.cargo/git/checkouts/halo2aggregator-s-4591bb34d62c1163/2db5888/src/circuits/utils.rs:191:14 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

How can I use other library in rust code?

@Act0r1
Copy link

Act0r1 commented Aug 22, 2023

Can show start it with RUST_BACKTRACE=1 and show the output?

@notawayne
Copy link
Author

notawayne commented Aug 31, 2023

The code of using k256 may changed,I don't get the same result

I start the code of hash with RUST_BACKTRACE=1 and the output is here
Nothing is wrong with setup

panicked when single-prove

thread 'main' panicked at 'proof generation should not fail: ConstraintSystemFailure', /home/.cargo/git/checkouts/halo2aggregator-s-4591bb34d62c1163/2db5888/src/circuits/utils.rs:191:14
stack backtrace:

   0: rust_begin_unwind
             at /rustc/36fb58e433c782e27dd41034284e157cf86d587f/library/std/src/panicking.rs:593:5

   1: core::panicking::panic_fmt
             at /rustc/36fb58e433c782e27dd41034284e157cf86d587f/library/core/src/panicking.rs:67:14

   2: core::result::unwrap_failed
             at /rustc/36fb58e433c782e27dd41034284e157cf86d587f/library/core/src/result.rs:1651:5

   3: halo2aggregator_s::circuits::utils::load_or_create_proof

   4: delphinus_zkwasm::cli::exec::exec_create_proof

   5: cli::main

note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@xgaozoyoe
Copy link
Contributor

what is the dry-run output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants