Skip to content

Commit 5334541

Browse files
Update to main
1 parent 9adfff3 commit 5334541

File tree

7 files changed

+42
-27
lines changed

7 files changed

+42
-27
lines changed

.github/workflows/check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: check
33
on:
44
push:
55
branches:
6-
- main
6+
- meidar/update_rev/main/bl_unpacking
77
pull_request:
88

99
jobs:
@@ -24,7 +24,7 @@ jobs:
2424
- run: rustup show
2525
- run: rustup component add clippy
2626
- uses: Swatinem/rust-cache@v2
27-
- run: cargo clippy --all -- -D warnings
27+
- run: cargo +nightly-2025-07-14 clippy --all -- -D warnings
2828

2929
tests:
3030
runs-on: ubuntu-latest
@@ -45,7 +45,7 @@ jobs:
4545
RUSTFLAGS="-D warnings" cargo run --example run_program
4646
- name: "Unit tests in stwo_run_and_prove"
4747
run: |
48-
RUSTFLAGS="-D warnings" cargo test -p stwo_run_and_prove
48+
RUSTFLAGS="-D warnings" cargo +nightly-2025-07-14 test -p stwo_run_and_prove
4949
5050
udeps:
5151
runs-on: ubuntu-latest
@@ -56,4 +56,4 @@ jobs:
5656
cache-on-failure: true
5757
- run: cargo install cargo-udeps --locked
5858
# - run: cargo +nightly udeps --all-targets
59-
- run: cargo +nightly-2025-04-06 udeps
59+
- run: cargo +nightly-2025-07-14 udeps

.github/workflows/upload_artifacts_workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Upload-Artifacts
33
on:
44
push:
55
branches:
6-
- main
7-
6+
- meidar/update_rev/main/bl_unpacking
7+
88
jobs:
99
artifacts-push:
1010
runs-on: ubuntu-24.04

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ resolver = "2"
1111
bincode = { version = "2.0.1", features = [
1212
"serde",
1313
] }
14-
cairo-lang-executable = { git = "https://github.com/starkware-libs/cairo.git", rev = "f6f7c3bf45c9973bf8782d78c84aed6e741c2a2d" }
15-
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo.git", rev = "f6f7c3bf45c9973bf8782d78c84aed6e741c2a2d" }
16-
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo.git", rev = "f6f7c3bf45c9973bf8782d78c84aed6e741c2a2d" }
17-
cairo-lang-execute-utils = { git = "https://github.com/starkware-libs/cairo.git", rev = "f6f7c3bf45c9973bf8782d78c84aed6e741c2a2d" }
14+
cairo-lang-executable = { git = "https://github.com/starkware-libs/cairo.git", rev = "86eb25173f9d8700adbd2770406d715fbf1bb9f8" }
15+
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo.git", rev = "86eb25173f9d8700adbd2770406d715fbf1bb9f8" }
16+
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo.git", rev = "86eb25173f9d8700adbd2770406d715fbf1bb9f8" }
17+
cairo-lang-execute-utils = { git = "https://github.com/starkware-libs/cairo.git", rev = "86eb25173f9d8700adbd2770406d715fbf1bb9f8" }
1818
cairo-program-runner-lib = { path = "crates/cairo-program-runner-lib" }
19-
cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "b1a91f929b5fa29a1a2e9e6990a68a1220c0c673", features = [
19+
cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "e2c6c91c73cd0bc351721f302390fcc0965c6224", features = [
2020
"extensive_hints",
2121
"mod_builtin",
2222
"clap",
@@ -26,15 +26,15 @@ log = "0.4.21"
2626
num-bigint = "0.4"
2727
num-traits = "0.2.19"
2828
regex = "1.11.1"
29-
serde = { version = "1.0.202", features = ["derive"] }
30-
serde_json = "1.0.117"
29+
serde = { version = "1.0.219", features = ["derive"] }
30+
serde_json = "1.0.142"
3131
starknet-crypto = "0.6.2"
3232
starknet-types-core = "0.1.2"
33-
stwo_cairo_utils = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "d7b50347905c687a885a3b6818db4e9311683735" }
34-
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "d7b50347905c687a885a3b6818db4e9311683735" }
35-
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "d7b50347905c687a885a3b6818db4e9311683735" }
36-
stwo-cairo-serialize = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "d7b50347905c687a885a3b6818db4e9311683735" }
37-
cairo-air = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "d7b50347905c687a885a3b6818db4e9311683735" }
33+
stwo_cairo_utils = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "59bc14aef12bee9fb9519c3da6e90c4a196206b5" }
34+
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "59bc14aef12bee9fb9519c3da6e90c4a196206b5" }
35+
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "59bc14aef12bee9fb9519c3da6e90c4a196206b5" }
36+
stwo-cairo-serialize = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "59bc14aef12bee9fb9519c3da6e90c4a196206b5" }
37+
cairo-air = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "59bc14aef12bee9fb9519c3da6e90c4a196206b5" }
3838
tempfile = "3.10.1"
3939
thiserror = "1.0.61"
4040
thiserror-no-std = "2.0.2"

crates/cairo-program-runner-lib/src/hints/load_cairo_pie.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::HashMap;
1+
use std::collections::BTreeMap;
22

33
use cairo_vm::types::builtin_name::BuiltinName;
44
use cairo_vm::types::errors::math_errors::MathError;
@@ -77,7 +77,7 @@ impl From<CairoPieLoaderError> for HintError {
7777
/// a pointer in the VM memory, or to an integer in case the segment is uninitialized.
7878
/// Those will be wrapped by the appropriate `MaybeRelocatable` variant.
7979
pub struct RelocationTable {
80-
relocations: HashMap<isize, MaybeRelocatable>,
80+
relocations: BTreeMap<isize, MaybeRelocatable>,
8181
}
8282

8383
impl RelocationTable {
@@ -156,11 +156,11 @@ pub fn extract_segment(maybe_relocatable: MaybeRelocatable) -> Result<isize, Rel
156156
}
157157
}
158158

159-
/// Builds a hashmap of address -> value from the `CairoPieMemory` vector.
159+
/// Builds a BTreeMap of address -> value from the `CairoPieMemory` vector.
160160
///
161161
/// Makes it more convenient to access values in the Cairo PIE memory.
162-
fn build_cairo_pie_memory_map(memory: &CairoPieMemory) -> HashMap<Relocatable, &MaybeRelocatable> {
163-
let mut memory_map: HashMap<Relocatable, &MaybeRelocatable> = HashMap::new();
162+
fn build_cairo_pie_memory_map(memory: &CairoPieMemory) -> BTreeMap<Relocatable, &MaybeRelocatable> {
163+
let mut memory_map: BTreeMap<Relocatable, &MaybeRelocatable> = BTreeMap::new();
164164

165165
for ((segment_index, offset), value) in memory.0.iter() {
166166
let address = Relocatable::from((*segment_index as isize, *offset));
@@ -203,7 +203,7 @@ pub fn build_cairo_pie_relocation_table(
203203
offset: 0,
204204
};
205205

206-
// Create a hashmap of the program memory for easier searching.
206+
// Create a BTreeMap of the program memory for easier searching.
207207
// If this turns out to be too expensive, consider building it directly
208208
// when building the CairoPie object.
209209
let memory_map = build_cairo_pie_memory_map(&cairo_pie.memory);
@@ -231,7 +231,7 @@ pub fn build_cairo_pie_relocation_table(
231231

232232
fn extend_additional_data(
233233
builtin: &mut SignatureBuiltinRunner,
234-
data: &HashMap<Relocatable, (Felt252, Felt252)>,
234+
data: &BTreeMap<Relocatable, (Felt252, Felt252)>,
235235
relocation_table: &RelocationTable,
236236
) -> Result<(), SignatureRelocationError> {
237237
for (addr, signature) in data {

crates/cairo-program-runner-lib/src/hints/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ impl RunMode {
482482
entrypoint: "main",
483483
trace_enabled: true,
484484
relocate_mem,
485+
relocate_trace: relocate_mem,
485486
layout,
486487
proof_mode: true,
487488
secure_run: None,
@@ -496,6 +497,7 @@ impl RunMode {
496497
entrypoint: "main",
497498
trace_enabled: false,
498499
relocate_mem: false,
500+
relocate_trace: false,
499501
layout,
500502
proof_mode: false,
501503
secure_run: None,

crates/cairo-program-runner-lib/src/tasks.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{
33
str::FromStr,
44
};
55

6+
use cairo_lang_executable::executable::EntryPointKind;
67
use cairo_lang_executable::executable::Executable;
78
use cairo_lang_execute_utils::{program_and_hints_from_executable, user_args_from_flags};
89
use cairo_vm::types::errors::program_errors::ProgramError;
@@ -75,7 +76,19 @@ pub fn create_cairo1_program_task(
7576
.iter()
7677
.map(|n| BigInt::from_str(&n.to_string()).unwrap())
7778
.collect();
78-
let (program, string_to_hint) = program_and_hints_from_executable(&executable, false)
79+
80+
let entrypoint = executable
81+
.entrypoints
82+
.iter()
83+
.find(|e| e.kind == EntryPointKind::Bootloader)
84+
.ok_or_else(|| {
85+
BootloaderTaskError::Cairo1(format!(
86+
"{:?} entrypoint not found",
87+
EntryPointKind::Bootloader
88+
))
89+
})?;
90+
91+
let (program, string_to_hint) = program_and_hints_from_executable(&executable, entrypoint)
7992
.map_err(|e| BootloaderTaskError::Cairo1(format!("Failed to parse executable: {e:?}")))?;
8093
let user_args = user_args_from_flags(user_args_file.as_ref(), &user_args_list)
8194
.map_err(|e| BootloaderTaskError::Cairo1(format!("Failed to parse user args: {e:?}")))?;

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "nightly-2025-04-06"
2+
channel = "nightly-2025-07-14"

0 commit comments

Comments
 (0)