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

Incomplete Bazel Build Process for cairo_verifier in v0.13.0a2 #178

Open
Okm165 opened this issue Dec 8, 2023 · 5 comments
Open

Incomplete Bazel Build Process for cairo_verifier in v0.13.0a2 #178

Okm165 opened this issue Dec 8, 2023 · 5 comments

Comments

@Okm165
Copy link

Okm165 commented Dec 8, 2023

Description:

Issue Summary:

I encountered a problem with the build process for the cairo_verifier in the cairo-lang repository, specifically in the version tagged as v0.13.0a2 using Python 3.9.0. The build completes successfully, but when attempting to run cairo_verifier, it seems that some python components are not present.

Steps to Reproduce:

  1. Clone the cairo-lang repository and checkout to tag v0.13.0a2.
  2. Use the following Docker commands to build the project:
    docker build --tag cairo .
    container_id=$(docker create cairo)
    docker cp ${container_id}:/app/cairo-lang-0.13.0a2.zip .
    docker rm -v ${container_id}
    pip install cairo-lang-0.13.0a2.zip
    This builds the Bazel project as expected.
  3. Try compiling cairo_verifier with the following command:
    cairo-compile --cairo_path=./src src/starkware/cairo/cairo_verifier/layouts/all_cairo/cairo_verifier.cairo --output cairo_verifier.json --no_debug_info
  4. Then run it 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
    The cairo_verifier_input.json file used is:
    {
        "proof": {
        <copy the content of src/starkware/cairo/stark_verifier/air/example_proof.json>
        }
    }

Expected Result:

The cairo_verifier should compile and run without any issues.

Actual Result:

Error at pc=0:13207:
Got an exception while executing a hint.
Traceback (most recent call last):
  File "<hint33>", line 2, in <module>
  File "/home/bartosz/.pyenv/versions/3.9.0/envs/cairo-lang/lib/python3.9/site-packages/starkware/cairo/stark_verifier/air/parser.py", line 158, in parse_proof
    CPU_COMPONENT_STEP = get_dynamic_or_const_value(
  File "/home/bartosz/.pyenv/versions/3.9.0/envs/cairo-lang/lib/python3.9/site-packages/starkware/cairo/stark_verifier/air/parser.py", line 150, in get_dynamic_or_const_value
    res = identifiers.root.get(
  File "/home/bartosz/.pyenv/versions/3.9.0/envs/cairo-lang/lib/python3.9/site-packages/starkware/cairo/lang/compiler/identifier_manager.py", line 308, in get
    return scope.get(non_parsed)
  File "/home/bartosz/.pyenv/versions/3.9.0/envs/cairo-lang/lib/python3.9/site-packages/starkware/cairo/lang/compiler/identifier_manager.py", line 308, in get
    return scope.get(non_parsed)
  File "/home/bartosz/.pyenv/versions/3.9.0/envs/cairo-lang/lib/python3.9/site-packages/starkware/cairo/lang/compiler/identifier_manager.py", line 308, in get
    return scope.get(non_parsed)
  [Previous line repeated 2 more times]
  File "/home/bartosz/.pyenv/versions/3.9.0/envs/cairo-lang/lib/python3.9/site-packages/starkware/cairo/lang/compiler/identifier_manager.py", line 321, in get
    raise MissingIdentifierError(fullname=self.fullname + first_name)
starkware.cairo.lang.compiler.identifier_manager.MissingIdentifierError: Unknown identifier 'starkware.cairo.stark_verifier.air.layouts.starknet_with_keccak'.

Additional Information:

  • Python version: 3.9.0
  • Tag: v0.13.0a2
@Okm165
Copy link
Author

Okm165 commented Dec 8, 2023

When i investigate the cairo-lang-0.13.0a2.zip there is no such folder (starkware.cairo.stark_verifier.air.layouts.starknet_with_keccak) how to fix it?
What chenges do i need to make in bazel BUILD's to have this repo properly working?

unzip cairo-lang-0.13.0a2.zip 
cd cairo-lang-0.13.0a2/starkware/cairo/

@Okm165
Copy link
Author

Okm165 commented Dec 13, 2023

Exact manual steps i took to make bazel out package work in compilation and running process can be tracked here
https://github.com/Okm165/cairo-lang/tree/bazel-build-issue-manual-fix

@Okm165
Copy link
Author

Okm165 commented Dec 13, 2023

Then cairo verifier is run on example proof cairo_verifier_input.json and works

@Okm165
Copy link
Author

Okm165 commented Dec 13, 2023

I tried to fix bazel BUILD files myself but it took longer then expected can u help to solve bazel build issues?

@Okm165
Copy link
Author

Okm165 commented Dec 28, 2023

I created repository that has this issue solved,
if anybody encounters this problem please track the commits or contact me directly 👍🏼
https://github.com/Okm165/stone-prover-cairo0-verifier

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

1 participant