risc0 / risc0-foundry-template

Template for integrating RISC Zero and Ethereum using Foundry
https://risczero.com
108 stars 60 forks source link

Error when updating `risc0-zkvm` to `0.21.0` #91

Closed Cardosaum closed 7 months ago

Cardosaum commented 8 months ago

The issue arose from the fact that Bonsai currently only supports one version. Running a previous version of the foundry template results in:

Error: server error zkVM version mismatch: Bonsai supports only the risc0-zkvm '0.21.0' version

To solve this, it was taken the approach of updating the risc0-zkvm dependency to 0.21.0. Compiling a project works, but then after running the publisher we get:

Error: HTTP error from reqwest

Caused by:
    0: error decoding response body: missing field public at line 1 column 993
    1: missing field public at line 1 column 993

Then updating other related dependencies was also tried, namely bumping these dependencies to the versions below:

bonsai-sdk = { version = "0.7" }
risc0-build = { version = "0.21", default-features = false, features = ["docker"]}
risc0-build-ethereum = { git = "https://github.com/risc0/risc0-ethereum", branch = "release-0.8" }
risc0-ethereum-contracts = { git = "https://github.com/risc0/risc0-ethereum", branch = "release-0.8" }
risc0-zkvm = { version = "0.21", default-features = false }
risc0-zkp = { version = "0.21", default-features = false }

But then, running the publisher results in:

Error: (code: 3, message: execution reverted, data: Some(String("0x")))

It seems to be a decoding problem when submitting the data to the verifier contract, but further investigation is needed.

nategraf commented 8 months ago

Could you try using git clean -Xdi to remove all ignored files in the repo after the update and see if this fixes this issue?

Cardosaum commented 8 months ago

@nategraf , it does not have any effect unfortunately.

For reference:

$ git clean -Xdi
Would remove the following items:
  .env                   cache/                 methods/guest/target/  target/
  broadcast/             contracts/ImageID.sol  out/                   tests/Elf.sol
*** Commands ***
    1: clean                2: filter by pattern    3: select by numbers    4: ask each             5: quit                 6: help
What now> 1
Removing .env
Removing broadcast/
Removing cache/
Removing contracts/ImageID.sol
Removing methods/guest/target/
Removing out/
Removing target/
Removing tests/Elf.sol
nategraf commented 7 months ago

Closing this as it is not clear that it will be an issue going forward. Will open a new issue if this comes up again.