Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/upload_artifacts_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Upload-Artifacts
on:
push:
branches:
- main
- noamp/only_opt_and_lto_for_all

jobs:
artifacts-push:
Expand All @@ -22,7 +22,7 @@ jobs:

- name: Build all generic binaries
run: |
cargo build --release
RUSTFLAGS="-C opt-level=3 -C embed-bitcode -C lto=fat -Zdylib-lto" cargo build --release

- name: Authenticate with GCS
uses: "google-github-actions/auth@v2"
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Build stwo_run_and_prove for znver5 architecture
run: |
RUSTFLAGS="-C target-cpu=znver5 -C opt-level=3 -C codegen-units=1" cross build --release --bin stwo_run_and_prove
RUSTFLAGS="-C target-cpu=znver5 -C opt-level=3 -C embed-bitcode -C lto=fat -Zdylib-lto" cross build --release --bin stwo_run_and_prove

- name: Upload stwo_run_and_prove_znver5 binary to GCP
id: upload_stwo_run_and_prove_znver5
Expand All @@ -63,7 +63,7 @@ jobs:

- name: Build stwo_run_and_prove for znver3 architecture
run: |
RUSTFLAGS="-C target-cpu=znver3 -C opt-level=3 -C codegen-units=1" cross build --release --bin stwo_run_and_prove
RUSTFLAGS="-C target-cpu=znver3 -C opt-level=3 -C embed-bitcode -C lto=fat -Zdylib-lto" cross build --release --bin stwo_run_and_prove

- name: Upload stwo_run_and_prove_znver3 binary to GCP
id: upload_stwo_run_and_prove_znver3
Expand All @@ -74,7 +74,7 @@ jobs:

- name: Build stwo_run_and_prove for emeraldrapids architecture
run: |
RUSTFLAGS="-C target-cpu=emeraldrapids -C opt-level=3 -C codegen-units=1" cross build --release --bin stwo_run_and_prove
RUSTFLAGS="-C target-cpu=emeraldrapids -C opt-level=3 -C embed-bitcode -C lto=fat -Zdylib-lto" cross build --release --bin stwo_run_and_prove

- name: Upload stwo_run_and_prove_emeraldrapids binary to GCP
id: upload_stwo_run_and_prove_emeraldrapids
Expand All @@ -85,7 +85,7 @@ jobs:

- name: Build stwo_run_and_prove for sapphirerapids architecture
run: |
RUSTFLAGS="-C target-cpu=sapphirerapids -C opt-level=3 -C codegen-units=1" cross build --release --bin stwo_run_and_prove
RUSTFLAGS="-C target-cpu=sapphirerapids -C opt-level=3 -C embed-bitcode -C lto=fat -Zdylib-lto" cross build --release --bin stwo_run_and_prove

- name: Upload stwo_run_and_prove_sapphirerapids binary to GCP
id: upload_stwo_run_and_prove_sapphirerapids
Expand Down
31 changes: 16 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ resolver = "2"

[workspace.dependencies]
anyhow = "1.0.98"
bincode = { version = "2.0.1", features = [
"serde",
] }
cairo-air = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "a8a434b521a588cf80eb3625affb984f9913be6c" }
cairo-lang-executable = "=2.12.4-dev.1"
cairo-lang-runner = "=2.12.4-dev.1"
cairo-lang-casm = "=2.12.4-dev.1"
cairo-lang-execute-utils = "=2.12.4-dev.1"
bincode = { version = "2.0.1", features = ["serde"] }
cairo-air = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "6b45dd698a31d76c43f1e400cdb7ed8c23f97157" }
cairo-lang-executable = "=2.14.1-dev.0"
cairo-lang-runner = "=2.14.1-dev.0"
cairo-lang-casm = "=2.14.1-dev.0"
cairo-lang-execute-utils = "=2.14.1-dev.0"
cairo-program-runner-lib = { path = "crates/cairo-program-runner-lib" }
cairo-vm = { version = "=3.0.0-rc.3", features = ["extensive_hints", "mod_builtin", "clap"] }
cairo-vm = { version = "=3.0.0", features = [
"extensive_hints",
"mod_builtin",
"clap",
] }
clap = { version = "4.3.10", features = ["derive"] }
ctor = "0.2"
env_logger = "0.11.3"
Expand All @@ -31,15 +33,14 @@ serde_json = "1.0.142"
sonic-rs = "0.3.17"
starknet-crypto = "=0.8.1"
starknet-ff = "0.3.7"
starknet-types-core = "=0.2.0"
stwo_cairo_utils = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "a8a434b521a588cf80eb3625affb984f9913be6c" }
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "a8a434b521a588cf80eb3625affb984f9913be6c" }
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "a8a434b521a588cf80eb3625affb984f9913be6c" }
stwo-cairo-serialize = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "a8a434b521a588cf80eb3625affb984f9913be6c" }
starknet-types-core = "=0.2.4"
stwo_cairo_utils = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "6b45dd698a31d76c43f1e400cdb7ed8c23f97157" }
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "6b45dd698a31d76c43f1e400cdb7ed8c23f97157" }
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "6b45dd698a31d76c43f1e400cdb7ed8c23f97157" }
stwo-cairo-serialize = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "6b45dd698a31d76c43f1e400cdb7ed8c23f97157" }
tempfile = "3.10.1"
thiserror = "1.0.61"
thiserror-no-std = "2.0.2"
tracing = "0.1.40"
mockall = "0.13.1"
rstest = "0.21"

35 changes: 5 additions & 30 deletions crates/cairo-program-runner-lib/src/hints/bootloader_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,12 +919,7 @@ mod tests {
HintProcessorData::new_default(String::from(BOOTLOADER_SAVE_OUTPUT_POINTER), ids_data);
let mut hint_processor = MinimalBootloaderHintProcessor::new();
assert!(matches!(
hint_processor.execute_hint(
&mut vm,
&mut exec_scopes,
&any_box!(hint_data),
&HashMap::new(),
),
hint_processor.execute_hint(&mut vm, &mut exec_scopes, &any_box!(hint_data),),
Ok(())
));

Expand Down Expand Up @@ -970,12 +965,7 @@ mod tests {
);
let mut hint_processor = MinimalBootloaderHintProcessor::new();
assert!(matches!(
hint_processor.execute_hint(
&mut vm,
&mut exec_scopes,
&any_box!(hint_data),
&HashMap::new(),
),
hint_processor.execute_hint(&mut vm, &mut exec_scopes, &any_box!(hint_data),),
Ok(())
));

Expand Down Expand Up @@ -1073,12 +1063,7 @@ mod tests {
);
let mut hint_processor = MinimalBootloaderHintProcessor::new();
assert!(matches!(
hint_processor.execute_hint(
&mut vm,
&mut exec_scopes,
&any_box!(hint_data),
&HashMap::new(),
),
hint_processor.execute_hint(&mut vm, &mut exec_scopes, &any_box!(hint_data),),
Ok(())
));

Expand Down Expand Up @@ -1118,12 +1103,7 @@ mod tests {
let mut hint_processor = MinimalBootloaderHintProcessor::new();

assert!(matches!(
hint_processor.execute_hint(
&mut vm,
&mut exec_scopes,
&any_box!(hint_data),
&HashMap::new(),
),
hint_processor.execute_hint(&mut vm, &mut exec_scopes, &any_box!(hint_data),),
Ok(())
));

Expand Down Expand Up @@ -1201,12 +1181,7 @@ mod tests {
);
let mut hint_processor = MinimalBootloaderHintProcessor::new();

let result = hint_processor.execute_hint(
&mut vm,
&mut exec_scopes,
&any_box!(hint_data),
&HashMap::new(),
);
let result = hint_processor.execute_hint(&mut vm, &mut exec_scopes, &any_box!(hint_data));

match result {
Ok(_) => assert!(!expect_fail),
Expand Down
18 changes: 4 additions & 14 deletions crates/cairo-program-runner-lib/src/hints/execute_task_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ fn process_program_common_logic(
&hint.flow_tracking_data.reference_ids,
references,
&hint.accessible_scopes,
program.constants.clone(),
)
.map_err(|err| {
HintError::CustomHint(format!("{err} for hint: {}", hint.code).into())
Expand Down Expand Up @@ -406,7 +407,6 @@ pub fn setup_subtask_for_execution(

let mut hint_extension = HintExtension::default();

let subtask_cairo0_constants: Option<HashMap<String, Felt252>>;
let subtask_cairo1_hint_processor: Option<CairoHintProcessor>;
match &task {
Task::Cairo0Program(cairo0_executable) => {
Expand All @@ -421,8 +421,6 @@ pub fn setup_subtask_for_execution(
hint_processor,
&mut hint_extension,
)?;

subtask_cairo0_constants = Some(cairo0_executable.program.constants.clone());
// This task doesn’t require a cairo1 hint processor.
subtask_cairo1_hint_processor = None;
}
Expand Down Expand Up @@ -450,8 +448,7 @@ pub fn setup_subtask_for_execution(
ret_pc,
)
.map_err(Into::<HintError>::into)?;
// No subtask constants and cairo1 hint processor are used.
subtask_cairo0_constants = None;
// No cairo1 hint processor is used.
subtask_cairo1_hint_processor = None;
}
Task::Cairo1Program(cairo1_executable) => {
Expand All @@ -473,11 +470,9 @@ pub fn setup_subtask_for_execution(
subtask_cairo1_hint_processor.as_ref().unwrap(),
&mut hint_extension,
)?;
// Push None since no subtask constants are used.
subtask_cairo0_constants = None;
}
}
hint_processor.spawn_subtask(subtask_cairo0_constants, subtask_cairo1_hint_processor);
hint_processor.spawn_subtask(subtask_cairo1_hint_processor);

// output_runner_data = prepare_output_runner(
// task=task,
Expand Down Expand Up @@ -775,12 +770,7 @@ mod tests {
let mut hint_processor = BootloaderHintProcessor::new();

let hint_extension = hint_processor
.execute_hint_extensive(
&mut vm,
&mut exec_scopes,
&any_box!(hint_data),
&HashMap::new(),
)
.execute_hint_extensive(&mut vm, &mut exec_scopes, &any_box!(hint_data))
.expect("Hint failed unexpectedly");

// Fibonnacci code should be loaded after the header whose size is 5 as checked in
Expand Down
7 changes: 2 additions & 5 deletions crates/cairo-program-runner-lib/src/hints/fact_topologies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,8 @@ mod tests {
offset: 10,
};

let result =
configure_fact_topologies(&fact_topologies, &mut output_start, &mut output_builtin)
.expect("Configuring fact topologies failed unexpectedly");

assert_eq!(result, ());
configure_fact_topologies(&fact_topologies, &mut output_start, &mut output_builtin)
.expect("Configuring fact topologies failed unexpectedly");

// We expect the offset to 2 + sum(page_sizes) for each fact topology
let expected_offset: usize = fact_topologies.iter().flat_map(|ft| &ft.page_sizes).sum();
Expand Down
Loading
Loading