Skip to content

Commit

Permalink
Merge pull request #20 from lambdaclass/cairo2.9
Browse files Browse the repository at this point in the history
cairo 2.9.0
  • Loading branch information
FrancoGiachetta authored Nov 20, 2024
2 parents e16094d + f60418c commit 73706c1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ version = "0.1.0"
edition = "2021"

[dependencies]
cairo-lang-compiler = "2.8.4"
cairo-lang-filesystem = "2.8.4"
cairo-lang-sierra = "2.8.4"
cairo-lang-sierra-ap-change = "2.8.4"
cairo-lang-sierra-gas = "2.8.4"
cairo-lang-utils = "2.8.4"
cairo-lang-compiler = "2.9.0-dev.0"
cairo-lang-filesystem = "2.9.0-dev.0"
cairo-lang-sierra = "2.9.0-dev.0"
cairo-lang-sierra-ap-change = "2.9.0-dev.0"
cairo-lang-sierra-gas = "2.9.0-dev.0"
cairo-lang-utils = "2.9.0-dev.0"
clap = { version = "4.5.20", features = ["derive"] }
k256 = "0.13.4"
keccak = "0.1.5"
Expand All @@ -31,8 +31,8 @@ tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

[dev-dependencies]
cairo-lang-compiler = "2.8.4"
cairo-lang-starknet = "2.8.4"
cairo-lang-compiler = "2.9.0-dev.0"
cairo-lang-starknet = "2.9.0-dev.0"

# On dev optimize dependencies a bit so it's not as slow.
[profile.dev.package."*"]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

UNAME := $(shell uname)

CAIRO_2_VERSION=2.8.0
SCARB_VERSION = 2.8.0
CAIRO_2_VERSION=2.9.0-dev.0
SCARB_VERSION = 2.8.4

needs-cairo2:
ifeq ($(wildcard ./cairo2/.),)
Expand Down
9 changes: 9 additions & 0 deletions src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use cairo_lang_sierra::{
nullable::NullableConcreteLibfunc,
pedersen::PedersenConcreteLibfunc,
poseidon::PoseidonConcreteLibfunc,
range::IntRangeConcreteLibfunc,
starknet::{
secp256::{Secp256ConcreteLibfunc, Secp256OpConcreteLibfunc},
testing::TestingConcreteLibfunc,
Expand Down Expand Up @@ -378,6 +379,7 @@ pub fn libfunc_to_name(value: &CoreConcreteLibfunc) -> &'static str {
StarkNetConcreteLibfunc::Sha256ProcessBlock(_) => "sha256_process_block",
StarkNetConcreteLibfunc::Sha256StateHandleInit(_) => "sha256_state_handle_init",
StarkNetConcreteLibfunc::Sha256StateHandleDigest(_) => "sha256_state_handle_digest",
StarkNetConcreteLibfunc::GetClassHashAt(_) => "get_class_hash_at",
},
CoreConcreteLibfunc::Debug(value) => match value {
DebugConcreteLibfunc::Print(_) => "debug_print",
Expand Down Expand Up @@ -414,6 +416,10 @@ pub fn libfunc_to_name(value: &CoreConcreteLibfunc) -> &'static str {
BoundedIntConcreteLibfunc::IsZero(_) => "bounded_int_is_zero",
BoundedIntConcreteLibfunc::WrapNonZero(_) => "bounded_int_wrap_non_zero",
},
CoreConcreteLibfunc::IntRange(selector) => match selector {
IntRangeConcreteLibfunc::TryNew(_) => "int_range_try_new",
IntRangeConcreteLibfunc::PopFront(_) => "int_range_pop_front",
},
}
}

Expand Down Expand Up @@ -533,6 +539,9 @@ pub fn type_to_name(
CoreTypeConcrete::SegmentArena(_) => String::from("SegmentArena"),
CoreTypeConcrete::Bytes31(_) => String::from("Bytes31"),
CoreTypeConcrete::BoundedInt(_) => String::from("BoundedInt"),
CoreTypeConcrete::IntRange(info) => {
format!("IntRange<{}>", type_to_name(&info.ty, registry))
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ impl Value {
StarkNetTypeConcrete::Secp256Point(_) => matches!(self, Self::Struct(_)),
StarkNetTypeConcrete::Sha256StateHandle(_) => matches!(self, Self::Struct { .. }),
},
CoreTypeConcrete::IntRange(_) => todo!(),
};

if !res {
Expand Down
1 change: 1 addition & 0 deletions src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,5 +378,6 @@ fn eval<'a>(

EvalAction::NormalBranch(0, smallvec![value])
}
CoreConcreteLibfunc::IntRange(_) => todo!(),
}
}
1 change: 1 addition & 0 deletions src/vm/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub fn eval(
}
}
},
StarkNetConcreteLibfunc::GetClassHashAt(_) => todo!(),
}
}

Expand Down

0 comments on commit 73706c1

Please sign in to comment.