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

Error in Public Input Verification with cairo_verifier on example_proof #179

Closed
Okm165 opened this issue Dec 15, 2023 · 2 comments
Closed

Comments

@Okm165
Copy link

Okm165 commented Dec 15, 2023

Description:

Issue Summary:

I am facing a challenge with running the cairo_verifier on the cairo-lang, specifically with the version tagged as v0.12.3 using Python 3.9.0. While I am able to compile and run cairo_verifier, an error occurs when executing it with a example proof.

Steps to Reproduce:

  1. Clone the cairo-lang repository from this link (branch v0.12.3-run-proof). This repo has bazel build fixed manually see this issue for more info
  2. Setup a Python 3.9.0 environment and create a zip package:
    zip -r cairo-lang-0.12.3.zip cairo-lang-0.12.3
    pip install cairo-lang-0.12.3.zip
  3. Compile cairo_verifier using:
    cairo-compile --cairo_path=./src src/starkware/cairo/cairo_verifier/layouts/starknet_with_keccak/cairo_verifier.cairo --output cairo_verifier.json
  4. Execute cairo_verifier with:
    cairo-run \
       --program=cairo_verifier.json \
       --layout=starknet_with_keccak \
       --program_input=cairo_verifier_input.json \
       --trace_file=cairo_verifier_trace.json \
       --memory_file=cairo_verifier_memory.json \
       --print_output
    Using cairo_verifier_input.json with the content from src/starkware/cairo/stark_verifier/air/example_proof.json.

Expected Result:

The cairo_verifier should execute successfully without any errors.

Actual Result:

The program executes but fails during the _verify_public_input function this assertion. The error message is as follows:

[src/starkware/cairo/cairo_verifier/layouts/starknet_with_keccak/cairo_verifier.cairo:74:5: Error at pc=0:31735]
An ASSERT_EQ instruction failed: 0 != 3.
    assert public_input.n_continuous_pages = 0;
    ^*****************************************^
Cairo traceback (most recent call last):
src/starkware/cairo/cairo_verifier/layouts/starknet_with_keccak/cairo_verifier.cairo:199:39: (pc=0:31899)
    let (program_hash, output_hash) = verify_cairo_proof(proof);
                                      ^***********************^
src/starkware/cairo/cairo_verifier/layouts/starknet_with_keccak/cairo_verifier.cairo:52:12: (pc=0:31709)
    return _verify_public_input(public_input=cast(proof.public_input, PublicInput*));

This indicates an issue with the public input verification, even though the core stark verification seems to work fine.

Additional Information:

  • Python version: 3.9.0
  • Tag: v0.12.3
  • The issue seems to be specific to the _verify_public_input function.
  • The error occurs when running the verifier on the example proof located at src/starkware/cairo/stark_verifier/air/example_proof.json.
  • The compilation takes around 8 minutes and requires about 10GiB of RAM.
  • Execution takes approximately 23 minutes and requires about 91GiB of RAM.

Questions:

  • What could be causing this failure in the public input verification step?
  • Can you help explain the error message and suggest potential fixes?
@ilyalesokhin-starkware
Copy link
Collaborator

Continuous memory pages are not supported by the Cairo verifier.

@Okm165
Copy link
Author

Okm165 commented Dec 17, 2023

@ilyalesokhin-starkware Are u able to provide example proof with starknet_with_keccak layout, proof in the repo has multiple memory pages and I have trouble generating one from stone-prover as mentioned here #180

@Okm165 Okm165 closed this as completed Dec 28, 2023
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

2 participants