From 135334ac487271280d77779652022ba08acf3d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Gonz=C3=A1lez=20Calder=C3=B3n?= Date: Mon, 9 Sep 2024 13:03:45 -0300 Subject: [PATCH 1/3] Impl const Uint64 --- src/vm/const.rs | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/vm/const.rs b/src/vm/const.rs index 77e3f20..9ef715c 100644 --- a/src/vm/const.rs +++ b/src/vm/const.rs @@ -64,6 +64,10 @@ pub fn eval_as_immediate( [GenericArg::Value(value)] => Value::U32(value.try_into().unwrap()), _ => unreachable!(), }, + CoreTypeConcrete::Uint64(_) => match inner_data { + [GenericArg::Value(value)] => Value::U64(value.try_into().unwrap()), + _ => unreachable!(), + }, CoreTypeConcrete::Uint8(_) => match inner_data { [GenericArg::Value(value)] => Value::U8(value.try_into().unwrap()), _ => unreachable!(), @@ -95,7 +99,39 @@ pub fn eval_as_immediate( Value::Struct(fields) } - _ => todo!("{:?}", type_id), + CoreTypeConcrete::Array(_) => todo!(), + CoreTypeConcrete::Coupon(_) => todo!(), + CoreTypeConcrete::Bitwise(_) => todo!(), + CoreTypeConcrete::Box(_) => todo!(), + CoreTypeConcrete::Circuit(_) => todo!(), + CoreTypeConcrete::Const(_) => todo!(), + CoreTypeConcrete::EcOp(_) => todo!(), + CoreTypeConcrete::EcPoint(_) => todo!(), + CoreTypeConcrete::EcState(_) => todo!(), + CoreTypeConcrete::GasBuiltin(_) => todo!(), + CoreTypeConcrete::BuiltinCosts(_) => todo!(), + CoreTypeConcrete::Uint16(_) => todo!(), + CoreTypeConcrete::Uint128MulGuarantee(_) => todo!(), + CoreTypeConcrete::Sint16(_) => todo!(), + CoreTypeConcrete::Sint32(_) => todo!(), + CoreTypeConcrete::Sint64(_) => todo!(), + CoreTypeConcrete::Sint128(_) => todo!(), + CoreTypeConcrete::Nullable(_) => todo!(), + CoreTypeConcrete::RangeCheck(_) => todo!(), + CoreTypeConcrete::RangeCheck96(_) => todo!(), + CoreTypeConcrete::Uninitialized(_) => todo!(), + CoreTypeConcrete::Enum(_) => todo!(), + CoreTypeConcrete::Felt252Dict(_) => todo!(), + CoreTypeConcrete::Felt252DictEntry(_) => todo!(), + CoreTypeConcrete::SquashedFelt252Dict(_) => todo!(), + CoreTypeConcrete::Pedersen(_) => todo!(), + CoreTypeConcrete::Poseidon(_) => todo!(), + CoreTypeConcrete::Span(_) => todo!(), + CoreTypeConcrete::StarkNet(_) => todo!(), + CoreTypeConcrete::SegmentArena(_) => todo!(), + CoreTypeConcrete::Snapshot(_) => todo!(), + CoreTypeConcrete::Bytes31(_) => todo!(), + // _ => todo!("{:?}", type_id), } } From a366368481fc6c868416299f5eeff5c5cb34263c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Gonz=C3=A1lez=20Calder=C3=B3n?= Date: Mon, 9 Sep 2024 13:03:51 -0300 Subject: [PATCH 2/3] Update serde dep --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b4d952..b1ca5b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ num-traits = "0.2.19" p256 = "0.13.2" rand = "0.8.5" sec1 = { version = "0.7.3", features = ["std"] } -serde = { version = "1.0.209", features = ["derive"] } -serde_json = "1.0.127" +serde = { version = "1.0.208", features = ["derive"] } +serde_json = "1.0.125" sha2 = { version = "0.10.8", features = ["compress"] } smallvec = "1.13.2" starknet-crypto = "0.7.1" From dca85332bb83877fe9af92f4faf0cbdb3a2b538e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Gonz=C3=A1lez=20Calder=C3=B3n?= Date: Tue, 10 Dec 2024 13:59:33 -0300 Subject: [PATCH 3/3] Restore --- Cargo.toml | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b1ca5b4..b39c135 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,34 +2,44 @@ name = "sierra-emu" version = "0.1.0" edition = "2021" +license = "Apache-2.0" +description = "A Cairo (Sierra) Virtual Machine." +repository = "https://github.com/lambdaclass/sierra-emu" +readme = "README.md" +keywords = ["starknet", "cairo", "compiler", "mlir"] [dependencies] -cairo-lang-sierra = "2.8.0" -cairo-lang-sierra-ap-change = "2.8.0" -cairo-lang-sierra-gas = "2.8.0" -cairo-lang-utils = "2.8.0" -clap = { version = "4.5.16", features = ["derive"] } -k256 = "0.13.3" +cairo-lang-compiler = "2.9.1" +cairo-lang-filesystem = "2.9.1" +cairo-lang-runner = "2.9.1" +cairo-lang-sierra = "2.9.1" +cairo-lang-sierra-ap-change = "2.9.1" +cairo-lang-sierra-gas = "2.9.1" +cairo-lang-starknet-classes = "2.9.1" +cairo-lang-utils = "2.9.1" +clap = { version = "4.5.21", features = ["derive"] } +k256 = "0.13.4" keccak = "0.1.5" num-bigint = "0.4.6" num-traits = "0.2.19" p256 = "0.13.2" rand = "0.8.5" sec1 = { version = "0.7.3", features = ["std"] } -serde = { version = "1.0.208", features = ["derive"] } -serde_json = "1.0.125" +serde = { version = "1.0.215", features = ["derive"] } +serde_json = "1.0.133" sha2 = { version = "0.10.8", features = ["compress"] } smallvec = "1.13.2" -starknet-crypto = "0.7.1" -starknet-curve = "0.5.0" -starknet-types-core = "0.1.2" -thiserror = "1.0.63" -tracing = "0.1.40" +starknet-crypto = "0.7.3" +starknet-curve = "0.5.1" +starknet-types-core = "0.1.7" +tempfile = "3.14.0" +thiserror = "2.0.3" +tracing = "0.1.41" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } [dev-dependencies] -cairo-lang-compiler = "2.8.0" -cairo-lang-starknet = "2.8.0" +cairo-lang-compiler = "2.9.1" +cairo-lang-starknet = "2.9.1" # On dev optimize dependencies a bit so it's not as slow. [profile.dev.package."*"]