Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit e07a059

Browse files
committed
bump native
1 parent d199153 commit e07a059

File tree

6 files changed

+39
-36
lines changed

6 files changed

+39
-36
lines changed

Cargo.lock

Lines changed: 20 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,24 @@ replay_benchmark = []
1515

1616
[workspace]
1717
members = [
18-
"fuzzer",
19-
"rpc_state_reader",
20-
"replay",
21-
"examples/contract_execution",
18+
"fuzzer",
19+
"rpc_state_reader",
20+
"replay",
21+
"examples/contract_execution",
2222
]
2323

2424
[workspace.dependencies]
2525
cairo-lang-casm = "=2.5.4"
2626
cairo-lang-sierra = "=2.5.4"
2727
cairo-lang-starknet = "=2.5.4"
2828
cairo-lang-utils = "=2.5.4"
29-
cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "3547089579dd74f815edbc2d1caa91e00fc8a2f7", features = ["cairo-1-hints"] }
29+
cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "3547089579dd74f815edbc2d1caa91e00fc8a2f7", features = [
30+
"cairo-1-hints",
31+
] }
3032
num-traits = "0.2.15"
3133
starknet = "0.7.0" # todo: update to 0.9.0+ once cairo-lang is 2.6.0+
3234
starknet_api = "0.7.0-dev.0" # todo: update to 0.9.0+ once cairo-lang is 2.6.0+
33-
thiserror = "1.0.32"
35+
thiserror = "1.0.58"
3436

3537
[dependencies]
3638
anyhow = "1.0"
@@ -39,7 +41,7 @@ cairo-lang-casm = { workspace = true }
3941
cairo-lang-sierra = { workspace = true }
4042
cairo-lang-starknet = { workspace = true }
4143
cairo-lang-utils = { workspace = true }
42-
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "8fddcd3914badfe3f89752fe7a22befeaffc17f9", optional = true }
44+
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "60ed062a3d6d40cd8688a580f440af525f40d437", optional = true }
4345
k256 = "0.13.3"
4446
p256 = "0.13.2"
4547
sec1 = "0.7.3"
@@ -59,8 +61,8 @@ once_cell = "1.17.1"
5961
sha3 = "0.10.1"
6062
serde = { version = "1.0.152", features = ["derive"] }
6163
serde_json = { version = "1.0", features = [
62-
"arbitrary_precision",
63-
"raw_value",
64+
"arbitrary_precision",
65+
"raw_value",
6466
] }
6567
serde_json_pythonic = "0.1.2"
6668
starknet = { workspace = true }

src/execution/execution_entry_point.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,7 @@ impl ExecutionEntryPoint {
687687
class_hash: &ClassHash,
688688
program_cache: Rc<RefCell<ProgramCache<'_, ClassHash>>>,
689689
) -> Result<CallInfo, TransactionError> {
690-
use cairo_native::{
691-
executor::NativeExecutor, metadata::syscall_handler::SyscallHandlerMeta,
692-
};
690+
use cairo_native::executor::NativeExecutor;
693691

694692
use crate::{
695693
syscalls::{
@@ -757,8 +755,6 @@ impl ExecutionEntryPoint {
757755
resources_manager: Default::default(),
758756
};
759757

760-
let syscall_meta = SyscallHandlerMeta::new(&mut syscall_handler);
761-
762758
let entry_point_fn = &sierra_program
763759
.funcs
764760
.iter()
@@ -772,13 +768,13 @@ impl ExecutionEntryPoint {
772768
entry_point_id,
773769
&self.calldata,
774770
Some(self.initial_gas),
775-
Some(&syscall_meta),
771+
&mut syscall_handler,
776772
),
777773
NativeExecutor::Jit(executor) => executor.invoke_contract_dynamic(
778774
entry_point_id,
779775
&self.calldata,
780776
Some(self.initial_gas),
781-
Some(&syscall_meta),
777+
&mut syscall_handler,
782778
),
783779
}
784780
.map_err(|e| TransactionError::CustomError(format!("cairo-native error: {:?}", e)))?;

src/syscalls/native_syscall_handler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use cairo_native::{
3333
cache::ProgramCache,
3434
starknet::{
3535
BlockInfo, ExecutionInfo, ExecutionInfoV2, ResourceBounds, Secp256k1Point, Secp256r1Point,
36-
StarkNetSyscallHandler, SyscallResult, TxInfo, TxV2Info, U256,
36+
StarknetSyscallHandler, SyscallResult, TxInfo, TxV2Info, U256,
3737
},
3838
};
3939
use cairo_vm::Felt252;
@@ -85,8 +85,8 @@ impl<'a, 'cache, S: StateReader, C: ContractClassCache> NativeSyscallHandler<'a,
8585
}
8686
}
8787

88-
impl<'a, 'cache, S: StateReader, C: ContractClassCache> StarkNetSyscallHandler
89-
for NativeSyscallHandler<'a, 'cache, S, C>
88+
impl<'a, 'cache, S: StateReader, C: ContractClassCache> StarknetSyscallHandler
89+
for &mut NativeSyscallHandler<'a, 'cache, S, C>
9090
{
9191
fn get_block_hash(
9292
&mut self,

src/utils.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ pub fn field_element_to_felt(felt: &FieldElement) -> Felt252 {
122122
}
123123

124124
pub fn felt_to_hash(value: &Felt252) -> ClassHash {
125-
let mut output = [0; 32];
126-
127-
let bytes = value.to_bytes_be();
128-
output[..].copy_from_slice(&bytes);
129-
130-
ClassHash(output)
125+
ClassHash(value.to_bytes_be())
131126
}
132127

133128
pub fn string_to_hash(class_string: &str) -> ClassHash {

tests/integration_tests/complex_contracts/kakarot/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use starknet_in_rust::utils::{calculate_sn_keccak, felt_to_field_element, field_
1818
use crate::integration_tests::cairo_native::TestStateSetup;
1919

2020
#[test]
21-
#[ignore = "linked to native issue #499 and #500"]
21+
// #[ignore = "linked to native issue #499 and #500"]
2222
fn test_kakarot_contract() {
2323
// Evm constants
2424
let private_key: B256 =

0 commit comments

Comments
 (0)