From 61fdbc331f79339e76d155ee86beac7d2e491fb1 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Mon, 9 Dec 2024 12:36:59 +0000 Subject: [PATCH 01/18] feat: add hint implementation for fibonacci program --- examples/cairo0/with_hint/fibonacci.cairo | 39 + examples/cairo0/with_hint/fibonacci.json | 857 ++++++++++++++++++ examples/cairo0/with_hint/fibonacci_hint.json | 3 + src/cairo.rs | 38 +- 4 files changed, 936 insertions(+), 1 deletion(-) create mode 100644 examples/cairo0/with_hint/fibonacci.cairo create mode 100644 examples/cairo0/with_hint/fibonacci.json create mode 100644 examples/cairo0/with_hint/fibonacci_hint.json diff --git a/examples/cairo0/with_hint/fibonacci.cairo b/examples/cairo0/with_hint/fibonacci.cairo new file mode 100644 index 0000000..6c05582 --- /dev/null +++ b/examples/cairo0/with_hint/fibonacci.cairo @@ -0,0 +1,39 @@ +// Copyright 2023 StarkWare Industries Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.starkware.co/open-source-license/ +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions +// and limitations under the License. + +%builtins output +func main(output_ptr: felt*) -> (output_ptr: felt*) { + alloc_locals; + + // Load fibonacci_claim_index and copy it to the output segment. + local fibonacci_claim_index; + %{ ids.fibonacci_claim_index = program_input['fibonacci_claim_index'] %} + + assert output_ptr[0] = fibonacci_claim_index; + let res = fib(1, 1, fibonacci_claim_index); + assert output_ptr[1] = res; + + // Return the updated output_ptr. + return (output_ptr=&output_ptr[2]); +} + +func fib(first_element: felt, second_element: felt, n: felt) -> felt { + if (n == 0) { + return second_element; + } + + return fib( + first_element=second_element, second_element=first_element + second_element, n=n - 1 + ); +} diff --git a/examples/cairo0/with_hint/fibonacci.json b/examples/cairo0/with_hint/fibonacci.json new file mode 100644 index 0000000..9b62c67 --- /dev/null +++ b/examples/cairo0/with_hint/fibonacci.json @@ -0,0 +1,857 @@ +{ + "attributes": [], + "builtins": [ + "output" + ], + "compiler_version": "0.13.1", + "data": [ + "0x40780017fff7fff", + "0x1", + "0x1104800180018000", + "0x4", + "0x10780017fff7fff", + "0x0", + "0x40780017fff7fff", + "0x1", + "0x400380007ffd8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x1", + "0x480a80007fff8000", + "0x1104800180018000", + "0x6", + "0x400280017ffd7fff", + "0x482680017ffd8000", + "0x2", + "0x208b7fff7fff7ffe", + "0x20780017fff7ffd", + "0x4", + "0x480a7ffc7fff8000", + "0x208b7fff7fff7ffe", + "0x480a7ffc7fff8000", + "0x482a7ffc7ffb8000", + "0x482680017ffd8000", + "0x800000000000011000000000000000000000000000000000000000000000000", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff9", + "0x208b7fff7fff7ffe" + ], + "debug_info": { + "file_contents": { + "": "__start__:\nap += main.Args.SIZE + main.ImplicitArgs.SIZE;\ncall main;\n\n__end__:\njmp rel 0;\n" + }, + "instruction_locations": { + "0": { + "accessible_scopes": [ + "__main__" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 0, + "offset": 0 + }, + "reference_ids": {} + }, + "hints": [], + "inst": { + "end_col": 46, + "end_line": 2, + "input_file": { + "filename": "" + }, + "start_col": 1, + "start_line": 2 + } + }, + "2": { + "accessible_scopes": [ + "__main__" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 0, + "offset": 1 + }, + "reference_ids": {} + }, + "hints": [], + "inst": { + "end_col": 10, + "end_line": 3, + "input_file": { + "filename": "" + }, + "start_col": 1, + "start_line": 3 + } + }, + "4": { + "accessible_scopes": [ + "__main__" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 1, + "offset": 0 + }, + "reference_ids": {} + }, + "hints": [], + "inst": { + "end_col": 10, + "end_line": 6, + "input_file": { + "filename": "" + }, + "start_col": 1, + "start_line": 6 + } + }, + "6": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.main.output_ptr": 0 + } + }, + "hints": [], + "inst": { + "end_col": 18, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 17 + } + }, + "8": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 1 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0 + } + }, + "hints": [ + { + "location": { + "end_col": 77, + "end_line": 21, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 21 + }, + "n_prefix_newlines": 0 + } + ], + "inst": { + "end_col": 50, + "end_line": 23, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 23 + } + }, + "9": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 1 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0 + } + }, + "hints": [], + "inst": { + "end_col": 20, + "end_line": 24, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 19, + "start_line": 24 + } + }, + "11": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 2 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0 + } + }, + "hints": [], + "inst": { + "end_col": 23, + "end_line": 24, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 22, + "start_line": 24 + } + }, + "13": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 3 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0 + } + }, + "hints": [], + "inst": { + "end_col": 32, + "end_line": 20, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "parent_location": [ + { + "end_col": 46, + "end_line": 24, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 25, + "start_line": 24 + }, + "While expanding the reference 'fibonacci_claim_index' in:" + ], + "start_col": 11, + "start_line": 20 + } + }, + "14": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 4 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0 + } + }, + "hints": [], + "inst": { + "end_col": 47, + "end_line": 24, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 15, + "start_line": 24 + } + }, + "16": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 3, + "offset": 0 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0, + "__main__.main.res": 2 + } + }, + "hints": [], + "inst": { + "end_col": 32, + "end_line": 25, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 25 + } + }, + "17": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 3, + "offset": 0 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0, + "__main__.main.res": 2 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 28, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 25, + "start_line": 28 + } + }, + "19": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 3, + "offset": 1 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0, + "__main__.main.res": 2 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 28, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 28 + } + }, + "20": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 0 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 7, + "end_line": 32, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 32 + } + }, + "22": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 0 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 51, + "end_line": 31, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 16, + "start_line": 33 + }, + "While expanding the reference 'second_element' in:" + ], + "start_col": 31, + "start_line": 31 + } + }, + "23": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 1 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 31, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 9, + "start_line": 33 + } + }, + "24": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 0 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 51, + "end_line": 31, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "parent_location": [ + { + "end_col": 37, + "end_line": 37, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 23, + "start_line": 37 + }, + "While expanding the reference 'second_element' in:" + ], + "start_col": 31, + "start_line": 31 + } + }, + "25": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 1 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 84, + "end_line": 37, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 54, + "start_line": 37 + } + }, + "26": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 2 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 93, + "end_line": 37, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 88, + "start_line": 37 + } + }, + "28": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 3 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 6, + "end_line": 38, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 12, + "start_line": 36 + } + }, + "30": { + "accessible_scopes": [ + "__main__", + "__main__.fib" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 5, + "offset": 0 + }, + "reference_ids": { + "__main__.fib.first_element": 3, + "__main__.fib.n": 5, + "__main__.fib.second_element": 4 + } + }, + "hints": [], + "inst": { + "end_col": 7, + "end_line": 38, + "input_file": { + "filename": "./examples/cairo0/with_hint/fibonacci.cairo" + }, + "start_col": 5, + "start_line": 36 + } + } + } + }, + "hints": { + "8": [ + { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "code": "ids.fibonacci_claim_index = program_input['fibonacci_claim_index']", + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 1 + }, + "reference_ids": { + "__main__.main.fibonacci_claim_index": 1, + "__main__.main.output_ptr": 0 + } + } + } + ] + }, + "identifiers": { + "__main__.__end__": { + "pc": 4, + "type": "label" + }, + "__main__.__start__": { + "pc": 0, + "type": "label" + }, + "__main__.fib": { + "decorators": [], + "pc": 20, + "type": "function" + }, + "__main__.fib.Args": { + "full_name": "__main__.fib.Args", + "members": { + "first_element": { + "cairo_type": "felt", + "offset": 0 + }, + "n": { + "cairo_type": "felt", + "offset": 2 + }, + "second_element": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "__main__.fib.ImplicitArgs": { + "full_name": "__main__.fib.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.fib.Return": { + "cairo_type": "felt", + "type": "type_definition" + }, + "__main__.fib.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.fib.first_element": { + "cairo_type": "felt", + "full_name": "__main__.fib.first_element", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 20, + "value": "[cast(fp + (-5), felt*)]" + } + ], + "type": "reference" + }, + "__main__.fib.n": { + "cairo_type": "felt", + "full_name": "__main__.fib.n", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 20, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "__main__.fib.second_element": { + "cairo_type": "felt", + "full_name": "__main__.fib.second_element", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 20, + "value": "[cast(fp + (-4), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main": { + "decorators": [], + "pc": 6, + "type": "function" + }, + "__main__.main.Args": { + "full_name": "__main__.main.Args", + "members": { + "output_ptr": { + "cairo_type": "felt*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "__main__.main.ImplicitArgs": { + "full_name": "__main__.main.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.main.Return": { + "cairo_type": "(output_ptr: felt*)", + "type": "type_definition" + }, + "__main__.main.SIZEOF_LOCALS": { + "type": "const", + "value": 1 + }, + "__main__.main.fibonacci_claim_index": { + "cairo_type": "felt", + "full_name": "__main__.main.fibonacci_claim_index", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 1 + }, + "pc": 8, + "value": "[cast(fp, felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.output_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.main.output_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt**)]" + } + ], + "type": "reference" + }, + "__main__.main.res": { + "cairo_type": "felt", + "full_name": "__main__.main.res", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 16, + "value": "[cast(ap + (-1), felt*)]" + } + ], + "type": "reference" + } + }, + "main_scope": "__main__", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "reference_manager": { + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt**)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 1 + }, + "pc": 8, + "value": "[cast(fp, felt*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 16, + "value": "[cast(ap + (-1), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 20, + "value": "[cast(fp + (-5), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 20, + "value": "[cast(fp + (-4), felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 20, + "value": "[cast(fp + (-3), felt*)]" + } + ] + } +} \ No newline at end of file diff --git a/examples/cairo0/with_hint/fibonacci_hint.json b/examples/cairo0/with_hint/fibonacci_hint.json new file mode 100644 index 0000000..d20c51a --- /dev/null +++ b/examples/cairo0/with_hint/fibonacci_hint.json @@ -0,0 +1,3 @@ +{ + "fibonacci_claim_index": 10 +} \ No newline at end of file diff --git a/src/cairo.rs b/src/cairo.rs index ff8fcdc..27da9bf 100644 --- a/src/cairo.rs +++ b/src/cairo.rs @@ -4,14 +4,20 @@ use cairo_vm::air_public_input::PublicInputError; use cairo_vm::cairo_run::{ cairo_run_program, write_encoded_memory, write_encoded_trace, CairoRunConfig, EncodeTraceError, }; -use cairo_vm::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor; +use cairo_vm::hint_processor::builtin_hint_processor::builtin_hint_processor_definition::{ + BuiltinHintProcessor, HintFunc, +}; +use cairo_vm::hint_processor::builtin_hint_processor::hint_utils::insert_value_from_var_name; use cairo_vm::types::errors::program_errors::ProgramError; use cairo_vm::types::program::Program; use cairo_vm::vm::errors::cairo_run_errors::CairoRunError; use cairo_vm::vm::errors::trace_errors::TraceError; +use cairo_vm::Felt252; +use std::collections::HashMap; use std::io; use std::path::PathBuf; use std::process::Command; +use std::rc::Rc; use thiserror::Error; #[derive(Debug)] @@ -36,6 +42,8 @@ pub enum Error { PublicInput(#[from] PublicInputError), #[error(transparent)] Program(#[from] ProgramError), + #[error(transparent)] + ProgramInput(#[from] serde_json::Error), } pub fn run_cairo( @@ -75,8 +83,36 @@ pub fn run_cairo0( .unwrap(); let program = Program::from_file(&prove_args.cairo_program, Some("main"))?; + let program_input = if let Some(program_input_file) = prove_args.program_input_file.clone() { + let program_input_file_str = std::fs::read_to_string(program_input_file)?; + let program_input = + serde_json::from_str::>(&program_input_file_str)?; + program_input + } else { + HashMap::new() + }; let mut hint_processor = BuiltinHintProcessor::new_empty(); + hint_processor.add_hint( + "ids.fibonacci_claim_index = program_input['fibonacci_claim_index']".to_string(), + Rc::new(HintFunc(Box::new( + move |vm, _exec_scopes, ids_data, ap_tracking, _constants| { + let fibonacci_claim_index = program_input + .get("fibonacci_claim_index") + .unwrap() + .as_u64() + .unwrap(); + insert_value_from_var_name( + "fibonacci_claim_index", + Felt252::from(fibonacci_claim_index), + vm, + ids_data, + ap_tracking, + )?; + Ok(()) + }, + ))), + ); let cairo_run_config = CairoRunConfig { entrypoint: "main", From c08eb2d410518cba11f6b62e5eda99a23f331f89 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Mon, 9 Dec 2024 12:56:36 +0000 Subject: [PATCH 02/18] feat: add hint implementation for keccak program --- examples/cairo0/with_hint/keccak.cairo | 40 + examples/cairo0/with_hint/keccak.json | 2340 ++++++++++++++++++++ examples/cairo0/with_hint/keccak_hint.json | 3 + src/cairo.rs | 21 + 4 files changed, 2404 insertions(+) create mode 100644 examples/cairo0/with_hint/keccak.cairo create mode 100644 examples/cairo0/with_hint/keccak.json create mode 100644 examples/cairo0/with_hint/keccak_hint.json diff --git a/examples/cairo0/with_hint/keccak.cairo b/examples/cairo0/with_hint/keccak.cairo new file mode 100644 index 0000000..f751cff --- /dev/null +++ b/examples/cairo0/with_hint/keccak.cairo @@ -0,0 +1,40 @@ +%builtins keccak +from starkware.cairo.common.cairo_builtins import KeccakBuiltin +from starkware.cairo.common.keccak_state import KeccakBuiltinState + +// A helper function that hashes the given state `n` times. +func repeat_hash{keccak_ptr: KeccakBuiltin*}( + state: KeccakBuiltinState, n: felt +) -> KeccakBuiltinState { + if (n == 0) { + // If n is 0, we've done all the required hashing. + return (state); + } + + // Provide the current state as input to Keccak. + assert keccak_ptr[0].input = state; + // Read the output of the hash. + let output = keccak_ptr[0].output; + // Advance the keccak pointer for the next iteration. + let keccak_ptr = keccak_ptr + KeccakBuiltin.SIZE; + + // Recursively call repeat_hash with output as the new state and n-1 as the new count. + return repeat_hash(output, n - 1); +} + +// The main function now accepts a parameter `n` that indicates how many times to hash. +func main{keccak_ptr: KeccakBuiltin*}() { + alloc_locals; + + local iterations; + %{ ids.iterations = program_input['iterations'] %} + + // Define an initial Keccak state (can be replaced with your desired initial input). + let initial_state = KeccakBuiltinState(1, 2, 3, 4, 5, 6, 7, 8); + + // Apply the hash n times. + let final_state = repeat_hash(initial_state, iterations); + + // final_state now holds the Keccak state after n iterations of hashing. + return (); +} diff --git a/examples/cairo0/with_hint/keccak.json b/examples/cairo0/with_hint/keccak.json new file mode 100644 index 0000000..8fbd8a7 --- /dev/null +++ b/examples/cairo0/with_hint/keccak.json @@ -0,0 +1,2340 @@ +{ + "attributes": [], + "builtins": [ + "keccak" + ], + "compiler_version": "0.13.1", + "data": [ + "0x40780017fff7fff", + "0x1", + "0x1104800180018000", + "0x27", + "0x10780017fff7fff", + "0x0", + "0x20780017fff7ffd", + "0xc", + "0x480a7ff47fff8000", + "0x480a7ff57fff8000", + "0x480a7ff67fff8000", + "0x480a7ff77fff8000", + "0x480a7ff87fff8000", + "0x480a7ff97fff8000", + "0x480a7ffa7fff8000", + "0x480a7ffb7fff8000", + "0x480a7ffc7fff8000", + "0x208b7fff7fff7ffe", + "0x400380007ff47ff5", + "0x400380017ff47ff6", + "0x400380027ff47ff7", + "0x400380037ff47ff8", + "0x400380047ff47ff9", + "0x400380057ff47ffa", + "0x400380067ff47ffb", + "0x400380077ff47ffc", + "0x482680017ff48000", + "0x10", + "0x480280087ff48000", + "0x480280097ff48000", + "0x4802800a7ff48000", + "0x4802800b7ff48000", + "0x4802800c7ff48000", + "0x4802800d7ff48000", + "0x4802800e7ff48000", + "0x4802800f7ff48000", + "0x482680017ffd8000", + "0x800000000000011000000000000000000000000000000000000000000000000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe1", + "0x208b7fff7fff7ffe", + "0x40780017fff7fff", + "0x1", + "0x480a7ffd7fff8000", + "0x480680017fff8000", + "0x1", + "0x480680017fff8000", + "0x2", + "0x480680017fff8000", + "0x3", + "0x480680017fff8000", + "0x4", + "0x480680017fff8000", + "0x5", + "0x480680017fff8000", + "0x6", + "0x480680017fff8000", + "0x7", + "0x480680017fff8000", + "0x8", + "0x480a80007fff8000", + "0x1104800180018000", + "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffca", + "0x48127ff77fff8000", + "0x208b7fff7fff7ffe" + ], + "debug_info": { + "file_contents": { + "": "__start__:\nap += main.Args.SIZE + main.ImplicitArgs.SIZE;\ncall main;\n\n__end__:\njmp rel 0;\n" + }, + "instruction_locations": { + "0": { + "accessible_scopes": [ + "__main__" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 0, + "offset": 0 + }, + "reference_ids": {} + }, + "hints": [], + "inst": { + "end_col": 46, + "end_line": 2, + "input_file": { + "filename": "" + }, + "start_col": 1, + "start_line": 2 + } + }, + "2": { + "accessible_scopes": [ + "__main__" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 0, + "offset": 1 + }, + "reference_ids": {} + }, + "hints": [], + "inst": { + "end_col": 10, + "end_line": 3, + "input_file": { + "filename": "" + }, + "start_col": 1, + "start_line": 3 + } + }, + "4": { + "accessible_scopes": [ + "__main__" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 1, + "offset": 0 + }, + "reference_ids": {} + }, + "hints": [], + "inst": { + "end_col": 10, + "end_line": 6, + "input_file": { + "filename": "" + }, + "start_col": 1, + "start_line": 6 + } + }, + "6": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 7, + "end_line": 9, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 9 + } + }, + "8": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 44, + "end_line": 6, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 44, + "end_line": 6, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 24, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 9, + "start_line": 11 + }, + "While trying to retrieve the implicit argument 'keccak_ptr' in:" + ], + "start_col": 18, + "start_line": 6 + }, + "While expanding the reference 'keccak_ptr' in:" + ], + "start_col": 18, + "start_line": 6 + } + }, + "9": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 1 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "10": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 2 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "11": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 3 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "12": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 4 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "13": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 5 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "14": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 6 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "15": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 7 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "16": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 8 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 30, + "end_line": 7, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 22, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 17, + "start_line": 11 + }, + "While expanding the reference 'state' in:" + ], + "start_col": 5, + "start_line": 7 + } + }, + "17": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 9 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 24, + "end_line": 11, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 9, + "start_line": 11 + } + }, + "18": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "19": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "20": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "21": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "22": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "23": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "24": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "25": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 2, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 40, + "end_line": 15, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 15 + } + }, + "26": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 53, + "end_line": 19, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 44, + "end_line": 6, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 38, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 12, + "start_line": 22 + }, + "While trying to retrieve the implicit argument 'keccak_ptr' in:" + ], + "start_col": 18, + "start_line": 6 + }, + "While expanding the reference 'keccak_ptr' in:" + ], + "start_col": 22, + "start_line": 19 + } + }, + "28": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 1 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "29": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 2 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "30": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 3 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "31": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 4 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "32": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 5 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "33": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 6 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "34": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 7 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "35": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 8 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 17, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 30, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 24, + "start_line": 22 + }, + "While expanding the reference 'output' in:" + ], + "start_col": 18, + "start_line": 17 + } + }, + "36": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 9 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 37, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 32, + "start_line": 22 + } + }, + "38": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 10 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 4, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 38, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 12, + "start_line": 22 + } + }, + "40": { + "accessible_scopes": [ + "__main__", + "__main__.repeat_hash" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 3, + "offset": 0 + }, + "reference_ids": { + "__main__.repeat_hash.keccak_ptr": 5, + "__main__.repeat_hash.n": 1, + "__main__.repeat_hash.output": 3, + "__main__.repeat_hash.state": 0 + } + }, + "hints": [], + "inst": { + "end_col": 39, + "end_line": 22, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 22 + } + }, + "41": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 0 + }, + "reference_ids": { + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 18, + "end_line": 27, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 27 + } + }, + "43": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 1 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [ + { + "location": { + "end_col": 55, + "end_line": 30, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 30 + }, + "n_prefix_newlines": 0 + } + ], + "inst": { + "end_col": 37, + "end_line": 26, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 44, + "end_line": 6, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 61, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 23, + "start_line": 36 + }, + "While trying to retrieve the implicit argument 'keccak_ptr' in:" + ], + "start_col": 18, + "start_line": 6 + }, + "While expanding the reference 'keccak_ptr' in:" + ], + "start_col": 11, + "start_line": 26 + } + }, + "44": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 2 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 45, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 44, + "start_line": 33 + } + }, + "46": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 3 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 48, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 47, + "start_line": 33 + } + }, + "48": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 4 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 51, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 50, + "start_line": 33 + } + }, + "50": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 5 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 54, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 53, + "start_line": 33 + } + }, + "52": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 6 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 57, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 56, + "start_line": 33 + } + }, + "54": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 7 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 60, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 59, + "start_line": 33 + } + }, + "56": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 8 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 63, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 62, + "start_line": 33 + } + }, + "58": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 9 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 66, + "end_line": 33, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 48, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 35, + "start_line": 36 + }, + "While expanding the reference 'initial_state' in:" + ], + "start_col": 65, + "start_line": 33 + } + }, + "60": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 10 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 21, + "end_line": 29, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 60, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 50, + "start_line": 36 + }, + "While expanding the reference 'iterations' in:" + ], + "start_col": 11, + "start_line": 29 + } + }, + "61": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 11 + }, + "reference_ids": { + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + }, + "hints": [], + "inst": { + "end_col": 61, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 23, + "start_line": 36 + } + }, + "63": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 5, + "offset": 0 + }, + "reference_ids": { + "__main__.main.final_state": 10, + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 9 + } + }, + "hints": [], + "inst": { + "end_col": 44, + "end_line": 6, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 61, + "end_line": 36, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 37, + "end_line": 26, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "parent_location": [ + { + "end_col": 15, + "end_line": 39, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 39 + }, + "While trying to retrieve the implicit argument 'keccak_ptr' in:" + ], + "start_col": 11, + "start_line": 26 + }, + "While expanding the reference 'keccak_ptr' in:" + ], + "start_col": 23, + "start_line": 36 + }, + "While trying to update the implicit return value 'keccak_ptr' in:" + ], + "start_col": 18, + "start_line": 6 + } + }, + "64": { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "flow_tracking_data": { + "ap_tracking": { + "group": 5, + "offset": 1 + }, + "reference_ids": { + "__main__.main.final_state": 10, + "__main__.main.initial_state": 8, + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 9 + } + }, + "hints": [], + "inst": { + "end_col": 15, + "end_line": 39, + "input_file": { + "filename": "./examples/cairo0/with_hint/keccak.cairo" + }, + "start_col": 5, + "start_line": 39 + } + } + } + }, + "hints": { + "43": [ + { + "accessible_scopes": [ + "__main__", + "__main__.main" + ], + "code": "ids.iterations = program_input['iterations']", + "flow_tracking_data": { + "ap_tracking": { + "group": 4, + "offset": 1 + }, + "reference_ids": { + "__main__.main.iterations": 7, + "__main__.main.keccak_ptr": 6 + } + } + } + ] + }, + "identifiers": { + "__main__.KeccakBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "type": "alias" + }, + "__main__.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "__main__.__end__": { + "pc": 4, + "type": "label" + }, + "__main__.__start__": { + "pc": 0, + "type": "label" + }, + "__main__.main": { + "decorators": [], + "pc": 41, + "type": "function" + }, + "__main__.main.Args": { + "full_name": "__main__.main.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.main.ImplicitArgs": { + "full_name": "__main__.main.ImplicitArgs", + "members": { + "keccak_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.KeccakBuiltin*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "__main__.main.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.main.SIZEOF_LOCALS": { + "type": "const", + "value": 1 + }, + "__main__.main.final_state": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "full_name": "__main__.main.final_state", + "references": [ + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 63, + "value": "[cast(ap + (-8), starkware.cairo.common.keccak_state.KeccakBuiltinState*)]" + } + ], + "type": "reference" + }, + "__main__.main.initial_state": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "full_name": "__main__.main.initial_state", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 1 + }, + "pc": 43, + "value": "cast((1, 2, 3, 4, 5, 6, 7, 8), starkware.cairo.common.keccak_state.KeccakBuiltinState)" + } + ], + "type": "reference" + }, + "__main__.main.iterations": { + "cairo_type": "felt", + "full_name": "__main__.main.iterations", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 1 + }, + "pc": 43, + "value": "[cast(fp, felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.keccak_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.KeccakBuiltin*", + "full_name": "__main__.main.keccak_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 41, + "value": "[cast(fp + (-3), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 63, + "value": "[cast(ap + (-9), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + } + ], + "type": "reference" + }, + "__main__.repeat_hash": { + "decorators": [], + "pc": 6, + "type": "function" + }, + "__main__.repeat_hash.Args": { + "full_name": "__main__.repeat_hash.Args", + "members": { + "n": { + "cairo_type": "felt", + "offset": 8 + }, + "state": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 0 + } + }, + "size": 9, + "type": "struct" + }, + "__main__.repeat_hash.ImplicitArgs": { + "full_name": "__main__.repeat_hash.ImplicitArgs", + "members": { + "keccak_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.KeccakBuiltin*", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "__main__.repeat_hash.Return": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "type_definition" + }, + "__main__.repeat_hash.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.repeat_hash.keccak_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.KeccakBuiltin*", + "full_name": "__main__.repeat_hash.keccak_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-12), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 26, + "value": "cast([fp + (-12)] + 16, starkware.cairo.common.cairo_builtins.KeccakBuiltin*)" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 40, + "value": "[cast(ap + (-9), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + } + ], + "type": "reference" + }, + "__main__.repeat_hash.n": { + "cairo_type": "felt", + "full_name": "__main__.repeat_hash.n", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "__main__.repeat_hash.output": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "full_name": "__main__.repeat_hash.output", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 26, + "value": "[cast([fp + (-12)] + 8, starkware.cairo.common.keccak_state.KeccakBuiltinState*)]" + } + ], + "type": "reference" + }, + "__main__.repeat_hash.state": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "full_name": "__main__.repeat_hash.state", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-11), starkware.cairo.common.keccak_state.KeccakBuiltinState*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "x_and_y": { + "cairo_type": "felt", + "offset": 2 + }, + "x_or_y": { + "cairo_type": "felt", + "offset": 4 + }, + "x_xor_y": { + "cairo_type": "felt", + "offset": 3 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", + "members": { + "m": { + "cairo_type": "felt", + "offset": 4 + }, + "p": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 0 + }, + "q": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 2 + }, + "r": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcPoint": { + "destination": "starkware.cairo.common.ec_point.EcPoint", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.HashBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "members": { + "result": { + "cairo_type": "felt", + "offset": 2 + }, + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 8 + } + }, + "size": 16, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 3 + } + }, + "size": 6, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { + "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", + "members": { + "message": { + "cairo_type": "felt", + "offset": 1 + }, + "pub_key": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.ec_point.EcPoint": { + "full_name": "starkware.cairo.common.ec_point.EcPoint", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.keccak_state.KeccakBuiltinState": { + "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + }, + "s3": { + "cairo_type": "felt", + "offset": 3 + }, + "s4": { + "cairo_type": "felt", + "offset": 4 + }, + "s5": { + "cairo_type": "felt", + "offset": 5 + }, + "s6": { + "cairo_type": "felt", + "offset": 6 + }, + "s7": { + "cairo_type": "felt", + "offset": 7 + } + }, + "size": 8, + "type": "struct" + }, + "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { + "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + } + }, + "main_scope": "__main__", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "reference_manager": { + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-11), starkware.cairo.common.keccak_state.KeccakBuiltinState*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-12), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 26, + "value": "[cast([fp + (-12)] + 8, starkware.cairo.common.keccak_state.KeccakBuiltinState*)]" + }, + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 26, + "value": "cast([fp + (-12)] + 16, starkware.cairo.common.cairo_builtins.KeccakBuiltin*)" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 40, + "value": "[cast(ap + (-9), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 0 + }, + "pc": 41, + "value": "[cast(fp + (-3), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 1 + }, + "pc": 43, + "value": "[cast(fp, felt*)]" + }, + { + "ap_tracking_data": { + "group": 4, + "offset": 1 + }, + "pc": 43, + "value": "cast((1, 2, 3, 4, 5, 6, 7, 8), starkware.cairo.common.keccak_state.KeccakBuiltinState)" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 63, + "value": "[cast(ap + (-9), starkware.cairo.common.cairo_builtins.KeccakBuiltin**)]" + }, + { + "ap_tracking_data": { + "group": 5, + "offset": 0 + }, + "pc": 63, + "value": "[cast(ap + (-8), starkware.cairo.common.keccak_state.KeccakBuiltinState*)]" + } + ] + } +} diff --git a/examples/cairo0/with_hint/keccak_hint.json b/examples/cairo0/with_hint/keccak_hint.json new file mode 100644 index 0000000..370b84c --- /dev/null +++ b/examples/cairo0/with_hint/keccak_hint.json @@ -0,0 +1,3 @@ +{ + "iterations": 10 +} \ No newline at end of file diff --git a/src/cairo.rs b/src/cairo.rs index 27da9bf..b9179b1 100644 --- a/src/cairo.rs +++ b/src/cairo.rs @@ -93,6 +93,7 @@ pub fn run_cairo0( }; let mut hint_processor = BuiltinHintProcessor::new_empty(); + let program_input_clone = program_input.clone(); hint_processor.add_hint( "ids.fibonacci_claim_index = program_input['fibonacci_claim_index']".to_string(), Rc::new(HintFunc(Box::new( @@ -113,6 +114,26 @@ pub fn run_cairo0( }, ))), ); + hint_processor.add_hint( + "ids.iterations = program_input['iterations']".to_string(), + Rc::new(HintFunc(Box::new( + move |vm, _exec_scopes, ids_data, ap_tracking, _constants| { + let iterations = program_input_clone + .get("iterations") + .unwrap() + .as_u64() + .unwrap(); + insert_value_from_var_name( + "iterations", + Felt252::from(iterations), + vm, + ids_data, + ap_tracking, + )?; + Ok(()) + }, + ))), + ); let cairo_run_config = CairoRunConfig { entrypoint: "main", From 7f1304bcae9a019bbde1a26315845cd6b780c994 Mon Sep 17 00:00:00 2001 From: kata Date: Wed, 11 Dec 2024 17:35:36 +0800 Subject: [PATCH 03/18] bench prover with heaptrack --- src/prover.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prover.rs b/src/prover.rs index 216c5e0..03a9300 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -170,8 +170,9 @@ fn run_prover_from_command_line_with_annotations( StoneVersion::V6 => std::env::var("CPU_AIR_PROVER_V6").unwrap(), }; - let mut command = Command::new(prover_run_path); + let mut command = Command::new("heaptrack"); command + .arg(prover_run_path) .arg("--out-file") .arg(output_file) .arg("--public-input-file") From c5eccb851cee5651b8cf7ed20002aa7be51b4569 Mon Sep 17 00:00:00 2001 From: kata Date: Fri, 13 Dec 2024 16:07:01 +0800 Subject: [PATCH 04/18] heaptrack stone prover --- src/args.rs | 3 +++ src/main.rs | 1 + src/prover.rs | 52 ++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/args.rs b/src/args.rs index a33f3c7..e9ef576 100644 --- a/src/args.rs +++ b/src/args.rs @@ -60,6 +60,9 @@ pub struct ProveArgs { #[clap(long = "stone_version", default_value = "v6", value_enum)] pub stone_version: StoneVersion, + + #[clap(long = "bench-memory")] + pub bench_memory: Option, } #[derive(Args, Debug)] diff --git a/src/main.rs b/src/main.rs index 5ec9c32..26d530a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,6 +29,7 @@ fn main() -> anyhow::Result<()> { &run_cairo_result.air_public_input, &run_cairo_result.air_private_input, &tmp_dir, + args.bench_memory.unwrap_or(false), ) .map_err(|e| anyhow::anyhow!("Failed to run stone prover: {}", e)) }); diff --git a/src/prover.rs b/src/prover.rs index 03a9300..e77e6f7 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -52,6 +52,7 @@ pub fn run_stone_prover( air_public_input: &PathBuf, air_private_input: &PathBuf, tmp_dir: &tempfile::TempDir, + bench_memory: bool, ) -> Result<(), ProverError> { println!("Running prover..."); @@ -65,6 +66,7 @@ pub fn run_stone_prover( air_public_input, air_private_input, tmp_dir, + bench_memory, )?; println!("Prover finished successfully"); @@ -101,6 +103,7 @@ pub fn run_stone_prover_bootloader( air_public_input, air_private_input, tmp_dir, + false, )?; println!("Prover finished successfully"); @@ -118,6 +121,7 @@ fn run_stone_prover_internal( air_public_input: &PathBuf, air_private_input: &PathBuf, tmp_dir: &tempfile::TempDir, + bench_memory: bool, ) -> Result<(), ProverError> { let tmp_prover_parameters_path = tmp_dir.path().join("prover_parameters.json"); @@ -150,6 +154,7 @@ fn run_stone_prover_internal( output_file, true, stone_version, + bench_memory, )?; Ok(()) @@ -163,6 +168,7 @@ fn run_prover_from_command_line_with_annotations( output_file: &PathBuf, generate_annotations: bool, stone_version: &StoneVersion, + bench_memory: bool, ) -> Result<(), ProverError> { // TODO: Add better error handling let prover_run_path = match stone_version { @@ -170,19 +176,39 @@ fn run_prover_from_command_line_with_annotations( StoneVersion::V6 => std::env::var("CPU_AIR_PROVER_V6").unwrap(), }; - let mut command = Command::new("heaptrack"); - command - .arg(prover_run_path) - .arg("--out-file") - .arg(output_file) - .arg("--public-input-file") - .arg(public_input_file) - .arg("--private-input-file") - .arg(private_input_file) - .arg("--prover-config-file") - .arg(prover_config_file) - .arg("--parameter-file") - .arg(prover_parameter_file); + let mut command; + if bench_memory { + command = Command::new("heaptrack"); + command + .arg("-o") + .arg("heaptrack-prover") + .arg(prover_run_path) + .arg("--out-file") + .arg(output_file) + .arg("--public-input-file") + .arg(public_input_file) + .arg("--private-input-file") + .arg(private_input_file) + .arg("--prover-config-file") + .arg(prover_config_file) + .arg("--parameter-file") + .arg(prover_parameter_file); + } + else { + command = Command::new(prover_run_path); + command + .arg("--out-file") + .arg(output_file) + .arg("--public-input-file") + .arg(public_input_file) + .arg("--private-input-file") + .arg(private_input_file) + .arg("--prover-config-file") + .arg(prover_config_file) + .arg("--parameter-file") + .arg(prover_parameter_file); + } + if generate_annotations { command.arg("--generate-annotations"); } From f1e726b6c1e0410c38acd739ce3928d44be9833a Mon Sep 17 00:00:00 2001 From: Raz Landau <125185051+LandauRaz@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:33:26 +0200 Subject: [PATCH 05/18] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d736dbd..897a806 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Additional args for prover config: Generate a proof for the bootloader Cairo program ```bash -stone-cli prove --cairo_program +stone-cli prove-bootloader --cairo_program ``` Additional args: From f4ceeaba9b371e27ce5602d655cfc262417d57a4 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 7 Jan 2025 15:34:53 +0000 Subject: [PATCH 06/18] refactor: use `#[error(transparent)]` for more expressive errors --- src/bootloader.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bootloader.rs b/src/bootloader.rs index c2ad770..3e9a584 100644 --- a/src/bootloader.rs +++ b/src/bootloader.rs @@ -60,11 +60,11 @@ pub struct CairoBootloaderRunResult { #[derive(Debug, Error)] pub enum Error { - #[error("Failed to interact with the file system")] + #[error(transparent)] IO(#[from] std::io::Error), - #[error("Failed to parse program input")] + #[error(transparent)] SerdeJson(#[from] serde_json::Error), - #[error("The cairo program execution failed")] + #[error(transparent)] Runner(#[from] CairoRunError), #[error(transparent)] EncodeTrace(#[from] EncodeTraceError), From 33d2bf78d5574d1c4fc5e846befeaef99945cc4d Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 7 Jan 2025 15:39:07 +0000 Subject: [PATCH 07/18] fix: allow shared references to mutable statics for clippy failures --- src/serialize.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/serialize.rs b/src/serialize.rs index 4a713b8..50f5a9b 100644 --- a/src/serialize.rs +++ b/src/serialize.rs @@ -132,6 +132,7 @@ pub fn serialize_proof(args: SerializeArgs) -> Result<(), Error> { } } + #[allow(static_mut_refs)] let (const_state, mut var_state, mut witness) = unsafe { (CONST_STATE.clone(), VAR_STATE.clone(), WITNESS.clone()) }; let initial = serialize(input)? From 20990055cfc9d2497452e67f852ee30f97f8f8d8 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 7 Jan 2025 17:10:09 +0000 Subject: [PATCH 08/18] chore: update dependencies --- Cargo.lock | 908 ++++++++++++++++++++++++++++++---------------- Cargo.toml | 16 +- src/bootloader.rs | 1 + src/cairo.rs | 1 + 4 files changed, 600 insertions(+), 326 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a4b4fbb..167c5a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "ark-ff" @@ -232,13 +232,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -277,7 +277,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -425,9 +425,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.10.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata", @@ -454,9 +454,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -485,9 +485,9 @@ dependencies = [ [[package]] name = "cairo-bootloader" version = "0.1.0" -source = "git+https://github.com/zksecurity/cairo-bootloader#83a9ea23082cfe5d2aa1d3e977a1558559adbb83" +source = "git+https://github.com/zksecurity/cairo-bootloader#b43353d7202f1d39f91f8f154b243967bb1d69bb" dependencies = [ - "cairo-vm 1.0.1", + "cairo-vm 2.0.0-rc2", "num-traits", "serde", "serde_json", @@ -542,14 +542,14 @@ dependencies = [ [[package]] name = "cairo-vm" -version = "1.0.1" -source = "git+https://github.com/zksecurity/cairo-vm#7763c73ffb61b27f792a1f08a4c211bb662baade" +version = "2.0.0-rc2" +source = "git+https://github.com/zksecurity/cairo-vm?rev=3cfcd1d035a4f6951337e6f4cc26014a0aa7e47e#3cfcd1d035a4f6951337e6f4cc26014a0aa7e47e" dependencies = [ "anyhow", "bincode", "bitvec", "generic-array", - "hashbrown 0.14.5", + "hashbrown 0.15.2", "hex", "keccak", "lazy_static", @@ -564,7 +564,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto 0.6.2", + "starknet-crypto 0.7.3", "starknet-types-core 0.1.7", "thiserror-no-std", "wasm-bindgen", @@ -582,9 +582,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -605,9 +605,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.31" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "jobserver", "libc", @@ -622,9 +622,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -660,9 +660,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "9560b07a799281c7e0958b9296854d6fafd4c5f31444a7e5bb1ad6dde5ccf1bd" dependencies = [ "clap_builder", "clap_derive", @@ -670,26 +670,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "874e0dd3eb68bf99058751ac9712f622e61e6f393a94f7128fa26e3f02f5c7cd" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.2", + "clap_lex 0.7.4", "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -703,9 +703,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "coins-bip32" @@ -767,9 +767,9 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "const-hex" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0121754e84117e65f9d90648ee6aa4882a6e63110307ab73967a4c5e7e69e586" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -808,9 +808,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -826,9 +826,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -845,9 +845,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -907,7 +907,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -918,7 +918,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -975,7 +975,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -1038,6 +1038,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -1133,12 +1144,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1277,7 +1288,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.85", + "syn 2.0.95", "toml", "walkdir", ] @@ -1295,7 +1306,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -1321,7 +1332,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.85", + "syn 2.0.95", "tempfile", "thiserror", "tiny-keccak", @@ -1472,9 +1483,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" @@ -1518,9 +1529,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1528,9 +1539,9 @@ dependencies = [ [[package]] name = "float-cmp" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" dependencies = [ "num-traits", ] @@ -1543,9 +1554,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "foreign-types" @@ -1653,7 +1664,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -1737,9 +1748,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gloo-timers" @@ -1776,7 +1787,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -1785,17 +1796,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.6.0", + "http 1.2.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -1821,13 +1832,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", ] [[package]] @@ -1877,11 +1889,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1897,9 +1909,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1924,7 +1936,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -1935,7 +1947,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "pin-project-lite", ] @@ -1954,9 +1966,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -1978,15 +1990,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.7", + "http 1.2.0", "http-body 1.0.1", "httparse", "itoa", @@ -2004,7 +2016,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -2012,18 +2024,18 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.5.0", + "http 1.2.0", + "hyper 1.5.2", "hyper-util", - "rustls 0.23.15", + "rustls 0.23.20", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.1", "tower-service", ] @@ -2035,7 +2047,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.2", "hyper-util", "native-tls", "tokio", @@ -2045,16 +2057,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.5.2", "pin-project-lite", "socket2", "tokio", @@ -2085,6 +2097,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2093,12 +2223,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2130,13 +2271,13 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.95", ] [[package]] @@ -2158,12 +2299,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] @@ -2226,9 +2367,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" @@ -2357,15 +2498,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.161" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" - -[[package]] -name = "libm" -version = "0.2.9" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bda4c6077b0b08da2c48b172195795498381a7c8988c9e6212a6c55c5b9bd70" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libmimalloc-sys" @@ -2390,9 +2525,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" @@ -2416,7 +2557,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] @@ -2458,20 +2599,19 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -2577,7 +2717,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -2608,14 +2747,14 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -2674,7 +2813,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -2823,7 +2962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.6.0", + "indexmap 2.7.0", ] [[package]] @@ -2838,35 +2977,35 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", - "phf_shared 0.11.2", + "phf_shared 0.11.3", ] [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared 0.11.2", + "phf_shared 0.11.3", "rand", ] [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", - "phf_shared 0.11.2", + "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -2875,43 +3014,43 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" dependencies = [ - "siphasher", + "siphasher 0.3.11", ] [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -2958,9 +3097,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "3.1.2" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", "difflib", @@ -2972,15 +3111,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", @@ -2988,12 +3127,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -3021,18 +3160,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bitflags 2.6.0", "lazy_static", @@ -3046,9 +3185,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -3120,9 +3259,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -3152,9 +3291,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3187,7 +3326,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-rustls 0.24.2", "ipnet", "js-sys", @@ -3216,9 +3355,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64 0.22.1", "bytes", @@ -3226,12 +3365,12 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.7", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", - "hyper-rustls 0.27.3", + "hyper 1.5.2", + "hyper-rustls 0.27.5", "hyper-tls", "hyper-util", "ipnet", @@ -3246,10 +3385,11 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "system-configuration 0.6.1", "tokio", "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", @@ -3355,7 +3495,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.85", + "syn 2.0.95", "unicode-ident", ] @@ -3392,15 +3532,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3417,9 +3557,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.15" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "once_cell", "rustls-pki-types", @@ -3448,9 +3588,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" @@ -3475,9 +3615,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" @@ -3505,9 +3645,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.5" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa7ffc1c0ef49b0452c6e2986abf2b07743320641ffd5fc63d552458e3b779b" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ "cfg-if", "derive_more", @@ -3517,21 +3657,21 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.5" +version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46385cc24172cf615450267463f937c10072516359b3ff1cb24228a4a08bf951" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -3593,9 +3733,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -3603,9 +3743,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] @@ -3624,29 +3764,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.213" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -3703,19 +3843,19 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_derive", "serde_json", - "serde_with_macros 3.11.0", + "serde_with_macros 3.12.0", "time", ] @@ -3728,19 +3868,19 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] name = "serde_with_macros" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -3831,6 +3971,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "slab" version = "0.4.9" @@ -3848,9 +3994,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3892,6 +4038,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "stark_evm_adapter" version = "0.1.5" @@ -3905,7 +4057,7 @@ dependencies = [ "regex", "serde", "serde_json", - "serde_with 3.11.0", + "serde_with 3.12.0", "thiserror", "tokio", ] @@ -3913,7 +4065,7 @@ dependencies = [ [[package]] name = "stark_evm_adapter" version = "0.1.5" -source = "git+https://github.com/zksecurity/stark-evm-adapter.git?branch=add-build-configs#b2b81b91cfccbc0318097d7b3b386c790b1f3492" +source = "git+https://github.com/zksecurity/stark-evm-adapter.git?rev=e044116e3cf4e3cbca11cce7b9e508a0f3e6870b#e044116e3cf4e3cbca11cce7b9e508a0f3e6870b" dependencies = [ "clap 3.2.25", "ethers", @@ -3922,7 +4074,7 @@ dependencies = [ "regex", "serde", "serde_json", - "serde_with 3.11.0", + "serde_with 3.12.0", "thiserror", "tokio", ] @@ -3942,7 +4094,7 @@ dependencies = [ "serde_json_pythonic", "serde_with 2.3.3", "sha3", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "starknet-types-core 0.1.7", ] @@ -3968,9 +4120,9 @@ dependencies = [ [[package]] name = "starknet-crypto" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a5064173a8e8d2675e67744fd07f310de44573924b6b7af225a6bdd8102913" +checksum = "ded22ccf4cb9e572ce3f77de6066af53560cd2520d508876c83bb1e6b29d5cbc" dependencies = [ "crypto-bigint", "hex", @@ -3993,7 +4145,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -4070,21 +4222,21 @@ dependencies = [ "bincode", "cairo-bootloader", "cairo-felt", - "cairo-vm 1.0.1", - "clap 4.5.20", + "cairo-vm 2.0.0-rc2", + "clap 4.5.24", "flate2", "itertools 0.13.0", "num-bigint", "num-traits", "once_cell", "predicates", - "reqwest 0.12.8", + "reqwest 0.12.12", "rstest", "serde", "serde_json", "sha256", - "stark_evm_adapter 0.1.5 (git+https://github.com/zksecurity/stark-evm-adapter.git?branch=add-build-configs)", - "starknet-crypto 0.7.2", + "stark_evm_adapter 0.1.5 (git+https://github.com/zksecurity/stark-evm-adapter.git?rev=e044116e3cf4e3cbca11cce7b9e508a0f3e6870b)", + "starknet-crypto 0.7.3", "stone-prover-sdk", "swiftness", "swiftness_air", @@ -4156,7 +4308,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -4188,17 +4340,17 @@ dependencies = [ [[package]] name = "swiftness" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "anyhow", "cairo-felt", - "clap 4.5.20", + "clap 4.5.24", "itertools 0.13.0", "num-bigint", "num-traits", "serde", "serde_json", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "swiftness_air", "swiftness_commitment", "swiftness_fri", @@ -4212,13 +4364,13 @@ dependencies = [ [[package]] name = "swiftness_air" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "num-bigint", "serde", - "serde_with 3.11.0", + "serde_with 3.12.0", "starknet-core", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "starknet-types-core 0.1.7", "swiftness_commitment", "swiftness_transcript", @@ -4229,15 +4381,15 @@ dependencies = [ [[package]] name = "swiftness_commitment" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "blake2", "num-bigint", "serde", - "serde_with 3.11.0", + "serde_with 3.12.0", "sha3", "starknet-core", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "starknet-types-core 0.1.7", "swiftness_transcript", "thiserror", @@ -4247,14 +4399,14 @@ dependencies = [ [[package]] name = "swiftness_fri" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "num-bigint", "serde", - "serde_with 3.11.0", + "serde_with 3.12.0", "sha3", "starknet-core", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "swiftness_commitment", "swiftness_transcript", "thiserror", @@ -4264,12 +4416,12 @@ dependencies = [ [[package]] name = "swiftness_pow" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "blake2", "serde", "sha3", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "starknet-types-core 0.1.7", "swiftness_commitment", "swiftness_transcript", @@ -4280,15 +4432,15 @@ dependencies = [ [[package]] name = "swiftness_proof_parser" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "anyhow", - "clap 4.5.20", + "clap 4.5.24", "num-bigint", "regex", "serde", "serde_json", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "starknet-types-core 0.1.7", "thiserror", ] @@ -4296,12 +4448,12 @@ dependencies = [ [[package]] name = "swiftness_stark" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "serde", - "serde_with 3.11.0", + "serde_with 3.12.0", "starknet-core", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "swiftness_air", "swiftness_commitment", "swiftness_fri", @@ -4314,9 +4466,9 @@ dependencies = [ [[package]] name = "swiftness_transcript" version = "0.1.2" -source = "git+https://github.com/zksecurity/integrity-calldata-generator#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" +source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", ] [[package]] @@ -4332,9 +4484,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -4349,13 +4501,24 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -4406,9 +4569,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" dependencies = [ "filetime", "libc", @@ -4417,12 +4580,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.13.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -4450,9 +4614,9 @@ dependencies = [ [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "textwrap" @@ -4462,22 +4626,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -4502,9 +4666,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -4523,9 +4687,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -4540,11 +4704,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -4557,9 +4731,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -4581,7 +4755,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] @@ -4606,12 +4780,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.15", - "rustls-pki-types", + "rustls 0.23.20", "tokio", ] @@ -4632,9 +4805,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -4670,13 +4843,34 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -4685,9 +4879,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -4696,20 +4890,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] @@ -4774,26 +4968,11 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-xid" @@ -4815,9 +4994,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -4830,6 +5009,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -4925,7 +5116,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", "wasm-bindgen-shared", ] @@ -4959,7 +5150,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5008,7 +5199,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -5206,9 +5397,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] @@ -5223,6 +5414,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -5253,9 +5456,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", "linux-raw-sys", @@ -5268,6 +5471,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -5286,7 +5513,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", + "synstructure", ] [[package]] @@ -5306,7 +5554,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.95", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 21abca6..514db5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,9 @@ bincode = { version = "2.0.0-rc.3", default-features = false, features = [ ] } cairo-bootloader = { git = "https://github.com/zksecurity/cairo-bootloader" } cairo-felt = "0.9.1" -cairo-vm = { git = "https://github.com/zksecurity/cairo-vm", features = ["extensive_hints"] } +cairo-vm = { git = "https://github.com/zksecurity/cairo-vm", features = [ + "extensive_hints", +], rev = "3cfcd1d035a4f6951337e6f4cc26014a0aa7e47e" } clap = { version = "4.3.10", features = ["derive"] } itertools = "0.13.0" num-bigint = "0.4.6" @@ -18,13 +20,13 @@ num-traits = "0.2.19" rstest = "0.21.0" serde = { version = "1.0", features = ["derive"], default-features = false } serde_json = "1" -stark_evm_adapter = { git = "https://github.com/zksecurity/stark-evm-adapter.git", branch = "add-build-configs" } +stark_evm_adapter = { git = "https://github.com/zksecurity/stark-evm-adapter.git", rev = "e044116e3cf4e3cbca11cce7b9e508a0f3e6870b" } stone-prover-sdk = { git = "https://github.com/zksecurity/stone-prover-sdk" } -swiftness_air = { git = "https://github.com/zksecurity/integrity-calldata-generator" } -swiftness_fri = { git = "https://github.com/zksecurity/integrity-calldata-generator" } -swiftness_proof_parser = { git = "https://github.com/zksecurity/integrity-calldata-generator" } -swiftness_stark = { git = "https://github.com/zksecurity/integrity-calldata-generator" } -swiftness = { git = "https://github.com/zksecurity/integrity-calldata-generator" } +swiftness_air = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } +swiftness_fri = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } +swiftness_proof_parser = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } +swiftness_stark = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } +swiftness = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } starknet-crypto = "0.7.2" tempfile = "3.10.1" thiserror = "1.0.61" diff --git a/src/bootloader.rs b/src/bootloader.rs index 3e9a584..42c2eb9 100644 --- a/src/bootloader.rs +++ b/src/bootloader.rs @@ -187,6 +187,7 @@ fn cairo_run_bootloader_in_proof_mode( secure_run: None, disable_trace_padding: false, allow_missing_builtins: None, + dynamic_layout_params: None, }; let program_hash = Felt252::from_dec_str(SIMPLE_BOOTLOADER_PROGRAM_HASH).unwrap(); diff --git a/src/cairo.rs b/src/cairo.rs index b9179b1..eefdc92 100644 --- a/src/cairo.rs +++ b/src/cairo.rs @@ -144,6 +144,7 @@ pub fn run_cairo0( secure_run: None, disable_trace_padding: false, allow_missing_builtins: None, + dynamic_layout_params: None, }; let runner = cairo_run_program(&program, &cairo_run_config, &mut hint_processor)?; From c5717b21ef88b14703bc9aaf218b5ae955d76d00 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Thu, 16 Jan 2025 14:47:48 +0000 Subject: [PATCH 09/18] chore: fix dependency issues `cairo-bootloader` was updated: https://github.com/zksecurity/cairo-bootloader/pull/1 --- src/bootloader.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootloader.rs b/src/bootloader.rs index 42c2eb9..86738a8 100644 --- a/src/bootloader.rs +++ b/src/bootloader.rs @@ -209,6 +209,7 @@ fn cairo_run_bootloader_in_proof_mode( supported_cairo_verifier_program_hashes: verifier_hashes, }, packed_outputs: vec![PackedOutput::Plain(vec![]); n_tasks], + ignore_fact_topologies: false, }; let mut exec_scopes = ExecutionScopes::new(); From 458699afc810dfa099e9a328de2aea3223d370fc Mon Sep 17 00:00:00 2001 From: Jason Park Date: Thu, 16 Jan 2025 14:48:25 +0000 Subject: [PATCH 10/18] feat: add `ignore_fact_topologies` arg --- src/args.rs | 6 ++++++ src/bootloader.rs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index e9ef576..00ac45d 100644 --- a/src/args.rs +++ b/src/args.rs @@ -93,6 +93,12 @@ pub struct ProveBootloaderArgs { #[clap(flatten)] pub prover_config: ProverConfig, + + #[clap( + long = "ignore_fact_topologies", + help = "Option to ignore fact topologies, which will result in task outputs being written only to public memory page 0" + )] + pub ignore_fact_topologies: bool, } #[derive(Args, Debug)] diff --git a/src/bootloader.rs b/src/bootloader.rs index 86738a8..2b1c638 100644 --- a/src/bootloader.rs +++ b/src/bootloader.rs @@ -112,6 +112,7 @@ pub fn run_bootloader( tasks, prove_bootloader_args.layout.to_cairo_vm_layout(), prove_bootloader_args.fact_topologies_output.clone(), + prove_bootloader_args.ignore_fact_topologies, )?; let relocated_trace = runner @@ -175,6 +176,7 @@ fn cairo_run_bootloader_in_proof_mode( tasks: Vec, layout: LayoutName, fact_topologies_path: PathBuf, + ignore_fact_topologies: bool, ) -> Result { let mut hint_processor = BootloaderHintProcessor::new(); @@ -209,7 +211,7 @@ fn cairo_run_bootloader_in_proof_mode( supported_cairo_verifier_program_hashes: verifier_hashes, }, packed_outputs: vec![PackedOutput::Plain(vec![]); n_tasks], - ignore_fact_topologies: false, + ignore_fact_topologies, }; let mut exec_scopes = ExecutionScopes::new(); From 92c00c236e5115943e3409520482385021d2d342 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Thu, 16 Jan 2025 15:39:54 +0000 Subject: [PATCH 11/18] chore: update dependencies --- Cargo.lock | 285 ++++++++++++++++++++++++++++------------------------- Cargo.toml | 2 +- 2 files changed, 154 insertions(+), 133 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 167c5a0..88b39c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,11 +121,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] @@ -238,7 +239,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -271,13 +272,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "e12882f59de5360c748c4cbf569a042d5fb0eb515f7bea9c1f470b47f6ffbd73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -379,9 +380,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -485,7 +486,7 @@ dependencies = [ [[package]] name = "cairo-bootloader" version = "0.1.0" -source = "git+https://github.com/zksecurity/cairo-bootloader#b43353d7202f1d39f91f8f154b243967bb1d69bb" +source = "git+https://github.com/zksecurity/cairo-bootloader?rev=ca1435a6cf52c7cea6d98e1c4edecff8424b4bae#ca1435a6cf52c7cea6d98e1c4edecff8424b4bae" dependencies = [ "cairo-vm 2.0.0-rc2", "num-traits", @@ -493,7 +494,7 @@ dependencies = [ "serde_json", "starknet-crypto 0.6.2", "starknet-types-core 0.1.7", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -564,7 +565,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "starknet-types-core 0.1.7", "thiserror-no-std", "wasm-bindgen", @@ -600,14 +601,14 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cc" -version = "1.2.7" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", @@ -660,9 +661,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.24" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9560b07a799281c7e0958b9296854d6fafd4c5f31444a7e5bb1ad6dde5ccf1bd" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -670,9 +671,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.24" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874e0dd3eb68bf99058751ac9712f622e61e6f393a94f7128fa26e3f02f5c7cd" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -689,7 +690,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -720,7 +721,7 @@ dependencies = [ "k256", "serde", "sha2", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -736,7 +737,7 @@ dependencies = [ "pbkdf2 0.12.2", "rand", "sha2", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -756,7 +757,7 @@ dependencies = [ "serde_derive", "sha2", "sha3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -907,7 +908,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -918,14 +919,14 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" [[package]] name = "der" @@ -975,7 +976,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1046,7 +1047,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1170,7 +1171,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "thiserror", + "thiserror 1.0.69", "uuid 0.8.2", ] @@ -1187,7 +1188,7 @@ dependencies = [ "serde", "serde_json", "sha3", - "thiserror", + "thiserror 1.0.69", "uint", ] @@ -1266,7 +1267,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1288,7 +1289,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.95", + "syn 2.0.96", "toml", "walkdir", ] @@ -1306,7 +1307,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1332,9 +1333,9 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.95", + "syn 2.0.96", "tempfile", - "thiserror", + "thiserror 1.0.69", "tiny-keccak", "unicode-xid", ] @@ -1352,7 +1353,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -1376,7 +1377,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "tracing-futures", @@ -1408,7 +1409,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-tungstenite", "tracing", @@ -1435,7 +1436,7 @@ dependencies = [ "ethers-core", "rand", "sha2", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -1463,7 +1464,7 @@ dependencies = [ "serde_json", "solang-parser", "svm-rs", - "thiserror", + "thiserror 1.0.69", "tiny-keccak", "tokio", "tracing", @@ -1664,7 +1665,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2032,7 +2033,7 @@ dependencies = [ "http 1.2.0", "hyper 1.5.2", "hyper-util", - "rustls 0.23.20", + "rustls 0.23.21", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -2212,7 +2213,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2277,7 +2278,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2474,7 +2475,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c6c4d0ddd1fcd235be5196b1bcc404f89ad3e911f4c190fa01459e05dbf40f8" dependencies = [ - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2518,7 +2519,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "libc", "redox_syscall", ] @@ -2547,9 +2548,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "lru" @@ -2599,9 +2600,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -2747,7 +2748,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2796,7 +2797,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cfg-if", "foreign-types", "libc", @@ -2813,7 +2814,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3005,7 +3006,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3043,7 +3044,7 @@ checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3127,12 +3128,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3160,9 +3161,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -3173,7 +3174,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "lazy_static", "num-traits", "rand", @@ -3263,7 +3264,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -3274,7 +3275,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3495,7 +3496,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.95", + "syn 2.0.96", "unicode-ident", ] @@ -3536,7 +3537,7 @@ version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", @@ -3557,9 +3558,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "once_cell", "rustls-pki-types", @@ -3664,7 +3665,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3724,7 +3725,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation", "core-foundation-sys", "libc", @@ -3779,7 +3780,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3868,7 +3869,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3880,7 +3881,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3955,13 +3956,13 @@ dependencies = [ [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ "num-bigint", "num-traits", - "thiserror", + "thiserror 2.0.11", "time", ] @@ -4012,7 +4013,7 @@ dependencies = [ "lalrpop", "lalrpop-util", "phf", - "thiserror", + "thiserror 1.0.69", "unicode-xid", ] @@ -4058,7 +4059,7 @@ dependencies = [ "serde", "serde_json", "serde_with 3.12.0", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -4075,7 +4076,7 @@ dependencies = [ "serde", "serde_json", "serde_with 3.12.0", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -4094,7 +4095,7 @@ dependencies = [ "serde_json_pythonic", "serde_with 2.3.3", "sha3", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "starknet-types-core 0.1.7", ] @@ -4120,9 +4121,9 @@ dependencies = [ [[package]] name = "starknet-crypto" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded22ccf4cb9e572ce3f77de6066af53560cd2520d508876c83bb1e6b29d5cbc" +checksum = "039a3bad70806b494c9e6b21c5238a6c8a373d66a26071859deb0ccca6f93634" dependencies = [ "crypto-bigint", "hex", @@ -4145,7 +4146,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4223,7 +4224,7 @@ dependencies = [ "cairo-bootloader", "cairo-felt", "cairo-vm 2.0.0-rc2", - "clap 4.5.24", + "clap 4.5.26", "flate2", "itertools 0.13.0", "num-bigint", @@ -4236,7 +4237,7 @@ dependencies = [ "serde_json", "sha256", "stark_evm_adapter 0.1.5 (git+https://github.com/zksecurity/stark-evm-adapter.git?rev=e044116e3cf4e3cbca11cce7b9e508a0f3e6870b)", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "stone-prover-sdk", "swiftness", "swiftness_air", @@ -4245,8 +4246,8 @@ dependencies = [ "swiftness_stark", "tar", "tempfile", - "thiserror", - "uuid 1.11.0", + "thiserror 1.0.69", + "uuid 1.12.0", ] [[package]] @@ -4260,7 +4261,7 @@ dependencies = [ "serde_json", "stark_evm_adapter 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -4308,7 +4309,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4332,7 +4333,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.69", "url", "zip", ] @@ -4344,20 +4345,20 @@ source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2 dependencies = [ "anyhow", "cairo-felt", - "clap 4.5.24", + "clap 4.5.26", "itertools 0.13.0", "num-bigint", "num-traits", "serde", "serde_json", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "swiftness_air", "swiftness_commitment", "swiftness_fri", "swiftness_pow", "swiftness_proof_parser", "swiftness_stark", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -4370,11 +4371,11 @@ dependencies = [ "serde", "serde_with 3.12.0", "starknet-core", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "starknet-types-core 0.1.7", "swiftness_commitment", "swiftness_transcript", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -4389,10 +4390,10 @@ dependencies = [ "serde_with 3.12.0", "sha3", "starknet-core", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "starknet-types-core 0.1.7", "swiftness_transcript", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -4406,10 +4407,10 @@ dependencies = [ "serde_with 3.12.0", "sha3", "starknet-core", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "swiftness_commitment", "swiftness_transcript", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -4421,11 +4422,11 @@ dependencies = [ "blake2", "serde", "sha3", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "starknet-types-core 0.1.7", "swiftness_commitment", "swiftness_transcript", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -4435,14 +4436,14 @@ version = "0.1.2" source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ "anyhow", - "clap 4.5.24", + "clap 4.5.26", "num-bigint", "regex", "serde", "serde_json", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "starknet-types-core 0.1.7", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4453,13 +4454,13 @@ dependencies = [ "serde", "serde_with 3.12.0", "starknet-core", - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", "swiftness_air", "swiftness_commitment", "swiftness_fri", "swiftness_pow", "swiftness_transcript", - "thiserror", + "thiserror 1.0.69", "thiserror-no-std", ] @@ -4468,7 +4469,7 @@ name = "swiftness_transcript" version = "0.1.2" source = "git+https://github.com/zksecurity/integrity-calldata-generator?rev=6f2dd268274e40e5ea75e2f17aff6b8e53f8f499#6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" dependencies = [ - "starknet-crypto 0.7.3", + "starknet-crypto 0.7.4", ] [[package]] @@ -4484,9 +4485,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -4516,7 +4517,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4536,7 +4537,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "core-foundation", "system-configuration-sys 0.6.0", ] @@ -4630,7 +4631,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -4641,7 +4651,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -4731,9 +4752,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -4749,13 +4770,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4784,7 +4805,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.20", + "rustls 0.23.21", "tokio", ] @@ -4896,7 +4917,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4939,7 +4960,7 @@ dependencies = [ "rand", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -5039,9 +5060,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" [[package]] name = "vcpkg" @@ -5116,7 +5137,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -5150,7 +5171,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5397,9 +5418,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -5439,7 +5460,7 @@ dependencies = [ "pharos", "rustc_version", "send_wrapper 0.6.0", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -5491,7 +5512,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -5513,7 +5534,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5533,7 +5554,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -5554,7 +5575,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5576,7 +5597,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 514db5d..002a477 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ anyhow = "1.0.86" bincode = { version = "2.0.0-rc.3", default-features = false, features = [ "serde", ] } -cairo-bootloader = { git = "https://github.com/zksecurity/cairo-bootloader" } +cairo-bootloader = { git = "https://github.com/zksecurity/cairo-bootloader", rev = "ca1435a6cf52c7cea6d98e1c4edecff8424b4bae" } cairo-felt = "0.9.1" cairo-vm = { git = "https://github.com/zksecurity/cairo-vm", features = [ "extensive_hints", From 75b7645c7243e043208eeed617a5e2b4988022c8 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Thu, 16 Jan 2025 15:46:07 +0000 Subject: [PATCH 12/18] fix: fix failing test --- tests/test_run.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_run.rs b/tests/test_run.rs index f70088d..bc5b418 100644 --- a/tests/test_run.rs +++ b/tests/test_run.rs @@ -651,6 +651,7 @@ fn test_run_bootloader( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), fact_topologies_output: tmp_dir.path().join("fact_topologies.json"), + ignore_fact_topologies: false, }; match run_bootloader(&prove_bootloader_args, &tmp_dir) { From df1cbff3ebe794232ea9da4178d8eb9f44a05fb9 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Thu, 16 Jan 2025 16:08:49 +0000 Subject: [PATCH 13/18] doc: update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 897a806..a70d17a 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ Additional args: - `--layout` - `--prover_config_file` - `--parameter_file` +- `--ignore_fact_topologies` ### Verify From 1c1a1b91df45c8330b02aabc6f53fd53e1f54050 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Sun, 19 Jan 2025 10:10:33 +0100 Subject: [PATCH 14/18] config rustc compiler RUST_MIN_STACK --- .cargo/config.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..d593604 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +RUST_MIN_STACK = "16777216" \ No newline at end of file From 3087f62f81601bebcad1d2655cfb3442e396e3a1 Mon Sep 17 00:00:00 2001 From: jason <94618524+mellowcroc@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:14:56 +0900 Subject: [PATCH 15/18] chore: remove stone-prover-sdk dependency --- Cargo.lock | 174 ++++--------------------------------------- Cargo.toml | 1 - src/fri.rs | 100 +++++++++++++++++++++++++ src/lib.rs | 1 + src/prover.rs | 16 +++- src/prover/config.rs | 20 ++--- 6 files changed, 134 insertions(+), 178 deletions(-) create mode 100644 src/fri.rs diff --git a/Cargo.lock b/Cargo.lock index 88b39c6..1946421 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,18 +38,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -344,19 +332,9 @@ version = "2.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" dependencies = [ - "bincode_derive", "serde", ] -[[package]] -name = "bincode_derive" -version = "2.0.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30759b3b99a1b802a7a3aa21c85c3ded5c28e1c83170d82d70f08bbf7f3e4c" -dependencies = [ - "virtue", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -488,12 +466,12 @@ name = "cairo-bootloader" version = "0.1.0" source = "git+https://github.com/zksecurity/cairo-bootloader?rev=ca1435a6cf52c7cea6d98e1c4edecff8424b4bae#ca1435a6cf52c7cea6d98e1c4edecff8424b4bae" dependencies = [ - "cairo-vm 2.0.0-rc2", + "cairo-vm", "num-traits", "serde", "serde_json", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.7", + "starknet-types-core", "thiserror 1.0.69", "thiserror-no-std", ] @@ -511,36 +489,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cairo-vm" -version = "1.0.0-rc0" -source = "git+https://github.com/Moonsong-Labs/cairo-vm?rev=e0a4653aa5634664a3f792b38715a572e9f89b44#e0a4653aa5634664a3f792b38715a572e9f89b44" -dependencies = [ - "anyhow", - "bincode", - "bitvec", - "generic-array", - "hashbrown 0.14.5", - "hex", - "keccak", - "lazy_static", - "mimalloc", - "nom", - "num-bigint", - "num-integer", - "num-prime", - "num-traits", - "rand", - "serde", - "serde_json", - "sha2", - "sha3", - "starknet-crypto 0.6.2", - "starknet-types-core 0.0.6", - "thiserror-no-std", - "zip", -] - [[package]] name = "cairo-vm" version = "2.0.0-rc2" @@ -566,7 +514,7 @@ dependencies = [ "sha2", "sha3", "starknet-crypto 0.7.4", - "starknet-types-core 0.1.7", + "starknet-types-core", "thiserror-no-std", "wasm-bindgen", "zip", @@ -1820,17 +1768,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", - "serde", -] - [[package]] name = "hashbrown" version = "0.15.2" @@ -2463,21 +2400,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbc2a4da0d9e52ccfe6306801a112e81a8fc0c76aa3e4449fefeda7fef72bb34" dependencies = [ - "lambdaworks-math 0.10.0", + "lambdaworks-math", "serde", "sha2", "sha3", ] -[[package]] -name = "lambdaworks-math" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6c4d0ddd1fcd235be5196b1bcc404f89ad3e911f4c190fa01459e05dbf40f8" -dependencies = [ - "thiserror 1.0.69", -] - [[package]] name = "lambdaworks-math" version = "0.10.0" @@ -2503,16 +2431,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libmimalloc-sys" -version = "0.1.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "libredox" version = "0.1.3" @@ -2577,15 +2495,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "mimalloc" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" -dependencies = [ - "libmimalloc-sys", -] - [[package]] name = "mime" version = "0.3.17" @@ -4045,24 +3954,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "stark_evm_adapter" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f997ed88a7b0a690222aed7a0ee319457c97a30730052d43db12319edce651" -dependencies = [ - "clap 3.2.25", - "ethers", - "num-bigint", - "num-traits", - "regex", - "serde", - "serde_json", - "serde_with 3.12.0", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "stark_evm_adapter" version = "0.1.5" @@ -4096,7 +3987,7 @@ dependencies = [ "serde_with 2.3.3", "sha3", "starknet-crypto 0.7.4", - "starknet-types-core 0.1.7", + "starknet-types-core", ] [[package]] @@ -4134,7 +4025,7 @@ dependencies = [ "rfc6979", "sha2", "starknet-curve 0.5.1", - "starknet-types-core 0.1.7", + "starknet-types-core", "zeroize", ] @@ -4164,7 +4055,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcde6bd74269b8161948190ace6cf069ef20ac6e79cd2ba09b320efa7500b6de" dependencies = [ - "starknet-types-core 0.1.7", + "starknet-types-core", ] [[package]] @@ -4179,21 +4070,6 @@ dependencies = [ "hex", ] -[[package]] -name = "starknet-types-core" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6b868f545d43b474c2c00e9349c489fdeb7ff17eb00cdf339744ac4cae0930" -dependencies = [ - "bitvec", - "lambdaworks-math 0.4.0", - "lazy_static", - "num-bigint", - "num-integer", - "num-traits", - "serde", -] - [[package]] name = "starknet-types-core" version = "0.1.7" @@ -4201,7 +4077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa1b9e01ccb217ab6d475c5cda05dbb22c30029f7bb52b192a010a00d77a3d74" dependencies = [ "lambdaworks-crypto", - "lambdaworks-math 0.10.0", + "lambdaworks-math", "num-bigint", "num-integer", "num-traits", @@ -4223,7 +4099,7 @@ dependencies = [ "bincode", "cairo-bootloader", "cairo-felt", - "cairo-vm 2.0.0-rc2", + "cairo-vm", "clap 4.5.26", "flate2", "itertools 0.13.0", @@ -4236,9 +4112,8 @@ dependencies = [ "serde", "serde_json", "sha256", - "stark_evm_adapter 0.1.5 (git+https://github.com/zksecurity/stark-evm-adapter.git?rev=e044116e3cf4e3cbca11cce7b9e508a0f3e6870b)", + "stark_evm_adapter", "starknet-crypto 0.7.4", - "stone-prover-sdk", "swiftness", "swiftness_air", "swiftness_fri", @@ -4250,21 +4125,6 @@ dependencies = [ "uuid 1.12.0", ] -[[package]] -name = "stone-prover-sdk" -version = "0.1.0" -source = "git+https://github.com/zksecurity/stone-prover-sdk#7cf38fce052413fc656e737f5c671e482ef8f474" -dependencies = [ - "bincode", - "cairo-vm 1.0.0-rc0", - "serde", - "serde_json", - "stark_evm_adapter 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "string_cache" version = "0.8.7" @@ -4372,7 +4232,7 @@ dependencies = [ "serde_with 3.12.0", "starknet-core", "starknet-crypto 0.7.4", - "starknet-types-core 0.1.7", + "starknet-types-core", "swiftness_commitment", "swiftness_transcript", "thiserror 1.0.69", @@ -4391,7 +4251,7 @@ dependencies = [ "sha3", "starknet-core", "starknet-crypto 0.7.4", - "starknet-types-core 0.1.7", + "starknet-types-core", "swiftness_transcript", "thiserror 1.0.69", "thiserror-no-std", @@ -4423,7 +4283,7 @@ dependencies = [ "serde", "sha3", "starknet-crypto 0.7.4", - "starknet-types-core 0.1.7", + "starknet-types-core", "swiftness_commitment", "swiftness_transcript", "thiserror 1.0.69", @@ -4442,7 +4302,7 @@ dependencies = [ "serde", "serde_json", "starknet-crypto 0.7.4", - "starknet-types-core 0.1.7", + "starknet-types-core", "thiserror 1.0.69", ] @@ -5076,12 +4936,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "virtue" -version = "0.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" - [[package]] name = "wait-timeout" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 002a477..8487353 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,6 @@ rstest = "0.21.0" serde = { version = "1.0", features = ["derive"], default-features = false } serde_json = "1" stark_evm_adapter = { git = "https://github.com/zksecurity/stark-evm-adapter.git", rev = "e044116e3cf4e3cbca11cce7b9e508a0f3e6870b" } -stone-prover-sdk = { git = "https://github.com/zksecurity/stone-prover-sdk" } swiftness_air = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } swiftness_fri = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } swiftness_proof_parser = { git = "https://github.com/zksecurity/integrity-calldata-generator", rev = "6f2dd268274e40e5ea75e2f17aff6b8e53f8f499" } diff --git a/src/fri.rs b/src/fri.rs new file mode 100644 index 0000000..b81c77c --- /dev/null +++ b/src/fri.rs @@ -0,0 +1,100 @@ +use crate::config::FriParameters; + +const DEFAULT_N_QUERIES: u32 = 16; +const DEFAULT_PROOF_OF_WORK_BITS: u32 = 32; + +/// Implements ceil(log2(x)). +fn ceil_log2(x: u32) -> u32 { + x.next_power_of_two().ilog2() +} + +/// Computes the FRI steps list based on the specified parameters. +/// +/// This computation is based on the documentation of the Stone prover: +/// # log₂(#steps) + 4 = log₂(last_layer_degree_bound) + ∑fri_step_list +/// # log₂(#steps) = log₂(last_layer_degree_bound) + ∑fri_step_list - 4 +/// # ∑fri_step_list = log₂(#steps) + 4 - log₂(last_layer_degree_bound) +/// +/// * `nb_steps_log`: Ceiled log₂ of the number of Cairo steps of the program. +/// * `last_layer_degree_bound_log`: Ceiled log₂ of the last layer degree bound. +/// * `max_step_value`: Maximum value for each step. All elements will be in the range +/// [0, `max_step_value`]. +/// +/// Returns The FRI steps list. +fn compute_fri_steps( + nb_steps_log: u32, + last_layer_degree_bound_log: u32, + max_step_value: u32, +) -> Vec { + let sum_of_fri_steps = nb_steps_log + 4 - last_layer_degree_bound_log; + let quotient = (sum_of_fri_steps / max_step_value) as usize; + let remainder = sum_of_fri_steps % max_step_value; + + let mut fri_steps = vec![max_step_value; quotient]; + if remainder > 0 { + fri_steps.push(remainder); + } + + fri_steps +} + +pub trait FriComputer { + fn compute_fri_parameters(&self, nb_steps: u32) -> FriParameters; +} + +pub struct DefaultFriComputer; + +impl FriComputer for DefaultFriComputer { + fn compute_fri_parameters(&self, nb_steps: u32) -> FriParameters { + let last_layer_degree_bound = 64; + + let nb_steps_log = ceil_log2(nb_steps); + let last_layer_degree_bound_log = ceil_log2(last_layer_degree_bound); + let max_step_value = 4; + + // The first FRI step must be 0 + let mut fri_steps = vec![0]; + fri_steps.extend(compute_fri_steps( + nb_steps_log, + last_layer_degree_bound_log, + max_step_value, + )); + + FriParameters { + fri_step_list: Some(fri_steps), + last_layer_degree_bound: Some(last_layer_degree_bound), + n_queries: Some(DEFAULT_N_QUERIES), + proof_of_work_bits: Some(DEFAULT_PROOF_OF_WORK_BITS), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use rstest::rstest; + + #[rstest] + #[case(2, 1)] + #[case(32, 5)] + #[case(1000, 10)] + #[case(524288, 19)] + fn test_ceil_log2(#[case] x: u32, #[case] expected: u32) { + let log = ceil_log2(x); + assert_eq!(log, expected); + } + + #[rstest] + #[case(32768, vec ! [0, 4, 4, 4, 1])] + #[case(524288, vec ! [0, 4, 4, 4, 4, 1])] + #[case(768, vec ! [0, 4, 4])] + fn test_compute_fri_parameters_default(#[case] nb_steps: u32, #[case] expected: Vec) { + let expected_last_layer_degree_bound = 64; + let fri_parameters = DefaultFriComputer.compute_fri_parameters(nb_steps); + assert_eq!(fri_parameters.fri_step_list, Some(expected)); + assert_eq!( + fri_parameters.last_layer_degree_bound, + Some(expected_last_layer_degree_bound) + ); + } +} diff --git a/src/lib.rs b/src/lib.rs index 5094dca..3db2504 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ pub mod args; pub mod bootloader; pub mod cairo; +pub mod fri; pub mod prover; pub mod serialize; pub mod utils; diff --git a/src/prover.rs b/src/prover.rs index e77e6f7..5be24e9 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -1,14 +1,26 @@ pub mod config; -use crate::args::{ProveArgs, ProveBootloaderArgs, StoneVersion}; +use crate::args::{LayoutName, ProveArgs, ProveBootloaderArgs, StoneVersion}; use crate::utils::write_json_to_file; +use cairo_vm::air_public_input::{MemorySegmentAddresses, PublicMemoryEntry}; use config::{ProverConfig, ProverParametersConfig}; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; use std::fs; use std::path::PathBuf; use std::process::Command; use thiserror::Error; -use stone_prover_sdk::models::PublicInput; +#[derive(Serialize, Deserialize, Debug, PartialEq)] +pub struct PublicInput { + pub layout: LayoutName, + pub rc_min: u32, + pub rc_max: u32, + pub n_steps: u32, + pub memory_segments: HashMap, + pub public_memory: Vec, + pub dynamic_params: Option>, +} #[derive(Error, Debug)] pub enum ProverError { diff --git a/src/prover/config.rs b/src/prover/config.rs index 7f5c328..20e040c 100644 --- a/src/prover/config.rs +++ b/src/prover/config.rs @@ -1,8 +1,10 @@ -use crate::define_enum; +use crate::{ + define_enum, + fri::{DefaultFriComputer, FriComputer}, +}; use clap::Args; use serde::{Deserialize, Serialize}; use serde_json::Result; -use stone_prover_sdk::fri::{DefaultFriComputer, FriComputer}; define_enum! { CommitmentHash, @@ -55,17 +57,6 @@ pub struct FriParameters { pub proof_of_work_bits: Option, } -impl From for FriParameters { - fn from(params: stone_prover_sdk::models::FriParameters) -> Self { - FriParameters { - fri_step_list: Some(params.fri_step_list), - last_layer_degree_bound: Some(params.last_layer_degree_bound), - n_queries: Some(params.n_queries), - proof_of_work_bits: Some(params.proof_of_work_bits), - } - } -} - #[derive(Args, Serialize, Deserialize, Debug, Clone)] pub struct ProverParametersConfig { #[clap(long = "field", default_value = "PrimeField0")] @@ -103,8 +94,7 @@ impl ProverParametersConfig { nb_steps: u32, parameter_config: &ProverParametersConfig, ) -> Result { - let computed_fri_parameters = - FriParameters::from(DefaultFriComputer.compute_fri_parameters(nb_steps)); + let computed_fri_parameters = DefaultFriComputer.compute_fri_parameters(nb_steps); let computed_fri_step_list = parameter_config .stark .fri From aa88bbd8d3fe4ba5c4b6dfb28e5a0a3b1af9dc33 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 4 Feb 2025 03:58:54 +0000 Subject: [PATCH 16/18] feat: add heaptrack command add it for prove-bootloader as well and update readme --- README.md | 14 ++------------ src/args.rs | 5 ++++- src/main.rs | 1 - src/prover.rs | 24 +++++++++++++++++------- tests/test_run.rs | 7 +++++++ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a70d17a..61f380b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Additional args for prover parameters. Most of them are related to optimizations - `--use_extension_field` - `--verifier_friendly_channel_updates` - `--verifier_friendly_commitment_hash` +- `--bench_memory`: requires `heaptrack` to be installed Additional args for prover config: @@ -89,6 +90,7 @@ Additional args: - `--prover_config_file` - `--parameter_file` - `--ignore_fact_topologies` +- `--bench_memory`: requires `heaptrack` to be installed ### Verify @@ -151,10 +153,6 @@ Here are the specific steps for the above process: - Only the `starknet` layout is supported for bootloader proofs - Programs should use the `output` builtin--programs that do not can be proved, but won't verify on Ethereum -## Testing - -Before running the tests, make sure to increase the Rust default stack size via `export RUST_MIN_STACK=4194304`. After that, you can run `cargo test` to run all the tests. - ## Versioning guide - Minor version changes should be made when the underlying `cairo1-run` binary built from [cairo-vm](https://github.com/lambdaclass/cairo-vm) is updated. @@ -182,11 +180,3 @@ Error: Failed to run cairo1: cairo1-run failed with error: Error: VirtualMachine ``` This error occurs when the program uses a builtin that is not supported by the layout. Refer to the [List of supported builtins per layout](#list-of-supported-builtins-per-layout) to find the right layout for theprogram. - -```bash -thread 'opt cgu.00' has overflowed its stack -fatal runtime error: stack overflow -error: could not compile `swiftness_air` (lib) -``` - -This error occurs when trying to run `cargo test`. This can be solved by increasing the Rust default stack size via `export RUST_MIN_STACK=4194304`. diff --git a/src/args.rs b/src/args.rs index 00ac45d..2fad5de 100644 --- a/src/args.rs +++ b/src/args.rs @@ -61,7 +61,7 @@ pub struct ProveArgs { #[clap(long = "stone_version", default_value = "v6", value_enum)] pub stone_version: StoneVersion, - #[clap(long = "bench-memory")] + #[clap(long = "bench_memory")] pub bench_memory: Option, } @@ -99,6 +99,9 @@ pub struct ProveBootloaderArgs { help = "Option to ignore fact topologies, which will result in task outputs being written only to public memory page 0" )] pub ignore_fact_topologies: bool, + + #[clap(long = "bench_memory")] + pub bench_memory: Option, } #[derive(Args, Debug)] diff --git a/src/main.rs b/src/main.rs index 26d530a..5ec9c32 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,6 @@ fn main() -> anyhow::Result<()> { &run_cairo_result.air_public_input, &run_cairo_result.air_private_input, &tmp_dir, - args.bench_memory.unwrap_or(false), ) .map_err(|e| anyhow::anyhow!("Failed to run stone prover: {}", e)) }); diff --git a/src/prover.rs b/src/prover.rs index 5be24e9..1f05838 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -28,6 +28,8 @@ pub enum ProverError { IoError(#[from] std::io::Error), #[error("{0}")] CommandError(ProverCommandError), + #[error("heaptrack command not found. Please install heaptrack to use memory benchmarking.")] + HeaptrackNotFound, } #[derive(Debug)] @@ -64,7 +66,6 @@ pub fn run_stone_prover( air_public_input: &PathBuf, air_private_input: &PathBuf, tmp_dir: &tempfile::TempDir, - bench_memory: bool, ) -> Result<(), ProverError> { println!("Running prover..."); @@ -78,7 +79,7 @@ pub fn run_stone_prover( air_public_input, air_private_input, tmp_dir, - bench_memory, + prove_args.bench_memory, )?; println!("Prover finished successfully"); @@ -115,7 +116,7 @@ pub fn run_stone_prover_bootloader( air_public_input, air_private_input, tmp_dir, - false, + prove_bootloader_args.bench_memory, )?; println!("Prover finished successfully"); @@ -133,7 +134,7 @@ fn run_stone_prover_internal( air_public_input: &PathBuf, air_private_input: &PathBuf, tmp_dir: &tempfile::TempDir, - bench_memory: bool, + bench_memory: Option, ) -> Result<(), ProverError> { let tmp_prover_parameters_path = tmp_dir.path().join("prover_parameters.json"); @@ -166,7 +167,7 @@ fn run_stone_prover_internal( output_file, true, stone_version, - bench_memory, + bench_memory.unwrap_or(false), )?; Ok(()) @@ -190,6 +191,16 @@ fn run_prover_from_command_line_with_annotations( let mut command; if bench_memory { + // Check if heaptrack is available + let heaptrack_check = Command::new("which") + .arg("heaptrack") + .output() + .map_err(|_| ProverError::HeaptrackNotFound)?; + + if !heaptrack_check.status.success() { + return Err(ProverError::HeaptrackNotFound); + } + command = Command::new("heaptrack"); command .arg("-o") @@ -205,8 +216,7 @@ fn run_prover_from_command_line_with_annotations( .arg(prover_config_file) .arg("--parameter-file") .arg(prover_parameter_file); - } - else { + } else { command = Command::new(prover_run_path); command .arg("--out-file") diff --git a/tests/test_run.rs b/tests/test_run.rs index bc5b418..0d66ea6 100644 --- a/tests/test_run.rs +++ b/tests/test_run.rs @@ -197,6 +197,7 @@ fn test_run_cairo0_success( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: StoneVersion::V5, + bench_memory: None, }; match run_cairo0(&prove_args, &tmp_dir) { @@ -235,6 +236,7 @@ fn test_run_cairo1_fail( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: StoneVersion::V6, + bench_memory: None, }; match run_cairo1(&prove_args, &tmp_dir) { Ok(result) => panic!( @@ -313,6 +315,7 @@ fn test_run_cairo1_success( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: StoneVersion::V6, + bench_memory: None, }; match run_cairo1(&prove_args, &tmp_dir) { Ok(result) => println!("Successfully ran cairo1: {:?}", result), @@ -359,6 +362,7 @@ fn test_run_cairo1_with_input_file( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: StoneVersion::V6, + bench_memory: None, }; match run_cairo1(&prove_args, &tmp_dir) { @@ -401,6 +405,7 @@ fn test_run_cairo1_with_inputs( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: StoneVersion::V6, + bench_memory: None, }; match run_cairo1(&prove_args, &tmp_dir) { @@ -445,6 +450,7 @@ fn test_run_cairo_e2e_linux( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: StoneVersion::V6, + bench_memory: None, }; let verify_args = VerifyArgs { proof: tmp_dir.path().join("proof.json"), @@ -652,6 +658,7 @@ fn test_run_bootloader( prover_config: ProverConfig::default(), fact_topologies_output: tmp_dir.path().join("fact_topologies.json"), ignore_fact_topologies: false, + bench_memory: None, }; match run_bootloader(&prove_bootloader_args, &tmp_dir) { From d283d3af1ea2d5842cc8f3fff2de8ed8e6588b35 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 4 Feb 2025 05:02:47 +0000 Subject: [PATCH 17/18] fix: fix failing test --- tests/test_run.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_run.rs b/tests/test_run.rs index 0d66ea6..331b2fd 100644 --- a/tests/test_run.rs +++ b/tests/test_run.rs @@ -546,6 +546,7 @@ fn test_run_cairo_e2e_macos( parameter_config: ProverParametersConfig::default(), prover_config: ProverConfig::default(), stone_version: stone_version.clone(), + bench_memory: None, }; let verify_args = VerifyArgs { proof: proof_file.clone(), From a6bb07907eb2b07009adc92499910aa7ffc25088 Mon Sep 17 00:00:00 2001 From: Jason Park Date: Tue, 4 Feb 2025 05:04:15 +0000 Subject: [PATCH 18/18] style: address clippy warnings --- src/cairo.rs | 4 +--- src/prover.rs | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cairo.rs b/src/cairo.rs index eefdc92..ae1b0fe 100644 --- a/src/cairo.rs +++ b/src/cairo.rs @@ -85,9 +85,7 @@ pub fn run_cairo0( let program = Program::from_file(&prove_args.cairo_program, Some("main"))?; let program_input = if let Some(program_input_file) = prove_args.program_input_file.clone() { let program_input_file_str = std::fs::read_to_string(program_input_file)?; - let program_input = - serde_json::from_str::>(&program_input_file_str)?; - program_input + serde_json::from_str::>(&program_input_file_str)? } else { HashMap::new() }; diff --git a/src/prover.rs b/src/prover.rs index 1f05838..8214f4a 100644 --- a/src/prover.rs +++ b/src/prover.rs @@ -173,6 +173,7 @@ fn run_stone_prover_internal( Ok(()) } +#[allow(clippy::too_many_arguments)] fn run_prover_from_command_line_with_annotations( public_input_file: &PathBuf, private_input_file: &PathBuf,