lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
518 stars 148 forks source link

dev: bump cairo 1 compiler dep to 2.4 #1530

Closed greged93 closed 10 months ago

greged93 commented 10 months ago

Bump cairo compiler

Description

Bumps the dependency of the cairo 1 compiler to 2.4.

Checklist

Robertorosmaninho commented 10 months ago

Looking forward to this feature!!

greged93 commented 10 months ago

I'm not sure why the CI keeps failing, if you have an idea I can look into it?

Oppen commented 10 months ago

OK, I think I found the issue. The Makefile has not been updated to fetch the right corelib in the deps target. I think then it uses the older stdlib where the prelude doesn't yet exist, but core brings everything instead. 2.4.3 programs try to import prelude and fail.

Oppen commented 10 months ago

Try with this:

diff --git a/cairo1-run/Makefile b/cairo1-run/Makefile
index 337cf3a53..8c39b51ae 100644
--- a/cairo1-run/Makefile
+++ b/cairo1-run/Makefile
@@ -15,7 +15,7 @@ MEMORY:=$(patsubst $(CAIRO_1_FOLDER)/%.cairo, $(CAIRO_1_FOLDER)/%.memory, $(CAIR
 deps:
    git clone https://github.com/starkware-libs/cairo.git \
    && cd cairo \
-   && git checkout v2.3.1 \
+   && git checkout v2.4.3 \
    && cd .. \
    && mv cairo/corelib/ . \
    && rm -rf cairo/
greged93 commented 10 months ago

Ahhhh missed this! Thanks @Oppen !

Oppen commented 10 months ago

@greged93 most tests already pass, but there seems to be something broken with tests::cairo_1_run_from_entrypoint_tests::test_uint256_div_mod_hint.

greged93 commented 10 months ago

Yes found the issue, will update

greged93 commented 10 months ago

works for me now locally @Oppen

Oppen commented 10 months ago

Let's ping @pefontana and @fmoletta for their reviews :)