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

deserialization error between noir_wasm 0.24.0 and acvm_js 0.40.0 #4459

Closed
CodeDragonVN opened this issue Mar 1, 2024 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@CodeDragonVN
Copy link
Contributor

CodeDragonVN commented Mar 1, 2024

Aim

I am attempting to execute circuits using the Noir programming language with the versions "@noir-lang/noir_wasm" at 0.24.0 and "@noir-lang/acvm_js" at 0.40.0. However, I am encountering a deserialization error when calling the execute method from noir_js.

Expected Behavior

The expected behavior is that the circuit executes without any serialization or deserialization errors, similar to when using "@noir-lang/acvm_js" version 0.39.0 and "@noir-lang/noir_wasm" at 0.23.0.

Bug

I get the following error message when I attempt to execute the circuit:

Error: Circuit execution failed: Error: Failed to deserialize circuit. This is likely due to differing serialization formats between ACVM_JS and your compiler

This error is triggered when calling the execute function like exemplified in https://noir-lang.org/docs/dev/how_to/how-to-recursion#step-2-generating-the-witness-and-the-proof-for-main.

To Reproduce

  1. Upgrade @noir-lang/noir_wasm to version 0.24.0.
  2. Upgrade @noir-lang/acvm_js used by @noir-lang/noir_js to version 0.40.0.
  3. Execute the circuit using the execute function as outlined here: https://noir-lang.org/docs/dev/how_to/how-to-recursion/#step-2-generating-the-witness-and-the-proof-for-main.
  4. Encounter the serialization error.

Project Impact

Blocker

Impact Context

This bug is affecting my project's ability to use the latest versions of Noir tooling and is blocking further development.

Workaround

Yes

Workaround Description

Downgrading @noir-lang/acvm_js to version 0.39.0 used by noir_js and downgrading @noir-lang/noir_wasm to 0.23.0 resolves the issue.

Additional Context

I've tried using @noir-lang/noir_wasm versiom 0.24.0 with @noir-lang/acvm_js version 0.39.0 and it returns the same error.

Installation Method

Binary (noirup default)

Nargo Version

nargo version = 0.24.0 noirc version = 0.24.0+db9ea8481197286e38b89269aa6e8f14acf1ce93 (git version hash: db9ea84, is dirty: false)

NoirJS Version

0.24.0

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@CodeDragonVN CodeDragonVN added the bug Something isn't working label Mar 1, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Mar 1, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Mar 1, 2024
@CodeDragonVN CodeDragonVN reopened this Mar 5, 2024
@CodeDragonVN
Copy link
Contributor Author

I wanted to provide an update on this issue. I have a repository (https://github.com/CodeDragonVN/noir-recursion-v0.24.0) where the recursion test from the noir-lang/noir documentation works perfectly using version 0.24.0. However, I've encountered the deserialization error described in this issue in another repository: https://github.com/CodeDragonVN/noir-examples/tree/update_recursive_example/recursion.

Specifically, when calling the execute method from noir_js, I encounter a deserialization error:

Error: Circuit execution failed: Error: Failed to deserialize circuit. This is likely due to differing serialization formats between ACVM_JS and your compiler

I have spent hours examining and comparing the two projects to identify any differences that might explain why the deserialization error occurs in one and not the other, but have been unable to determine the cause of the issue.

@Savio-Sou
Copy link
Collaborator

Thanks for submitting the issue!

identify any differences that might explain why the deserialization error occurs in one and not the other, but have been unable to determine the cause of the issue

As in they have the same code, but one fails while the other goes through?

@CodeDragonVN
Copy link
Contributor Author

Hey @Savio-Sou ,

Thanks for looking into this!

They're not the exact same code but both repos are set up to do the same thing. The one at https://github.com/CodeDragonVN/noir-recursion-v0.24.0 is from https://github.com/noir-lang/noir/tree/master/compiler/integration-tests but grabs version ^0.24.0 of the packages from npm instead of building them, and everything works fine there.

But in this other repo https://github.com/CodeDragonVN/noir-examples/tree/update_recursive_example/recursion, even though I'm using npm packages version 0.24.0, I run into the serialization error. If I switch back to the older 0.23.0 versions, the tests pass with no problems.

I'm still trying to figure out why this is happening.

@Savio-Sou
Copy link
Collaborator

Thank you sir 🫡

This is likely due to a serialization incompatibility with the version of backend used, which should be fixed by #4488.

I will reopen the Issue for now. Once we confirm v0.25.0 that includes the PR resolves the Issue, we can close it again.

@Savio-Sou Savio-Sou reopened this Mar 7, 2024
@Savio-Sou Savio-Sou moved this from ✅ Done to 🤔 Grooming in Noir Mar 7, 2024
@Savio-Sou Savio-Sou moved this from 🤔 Grooming to 🏗 In progress in Noir Mar 7, 2024
@CodeDragonVN
Copy link
Contributor Author

Hey @Savio-Sou,

I wanted to let you know that the update to v0.25.0 has resolved the deserialization issue in https://github.com/CodeDragonVN/noir-examples/tree/update_recursive_example/recursion

@Savio-Sou
Copy link
Collaborator

Thank you for the swift report @CodeDragonVN!

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Noir Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants