-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: PIE example + run bootloader helper
Problems: 1. We do not have a working example for Cairo PIEs 2. It would be convenient for developers to have a helper function to run the bootloader in proof mode easily. Solutions: 1. Add an example for how to run a Cairo PIE 2. Move the `cairo_run_bootloader_in_proof_mode` from the Stone prover SDK to this repository. This helper is now implemented in a way that makes it easy to reimplement your own version if needed.
- Loading branch information
1 parent
9b3715c
commit ebec8ad
Showing
6 changed files
with
99 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::error::Error; | ||
|
||
use cairo_bootloader::bootloaders::load_bootloader; | ||
use cairo_bootloader::cairo_run_bootloader_in_proof_mode; | ||
use cairo_bootloader::tasks::make_bootloader_tasks; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
let bootloader_program = load_bootloader()?; | ||
let fibonacci_pie = include_bytes!( | ||
"../dependencies/test-programs/bootloader/pies/fibonacci-stone-e2e/cairo_pie.zip" | ||
); | ||
|
||
let tasks = make_bootloader_tasks(&[], &[fibonacci_pie])?; | ||
|
||
let mut runner = cairo_run_bootloader_in_proof_mode(&bootloader_program, tasks)?; | ||
|
||
let mut output_buffer = "Bootloader output:\n".to_string(); | ||
runner.vm.write_output(&mut output_buffer)?; | ||
print!("{output_buffer}"); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters