Skip to content

Commit

Permalink
change of proof parser & refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Sep 3, 2024
1 parent af5cf79 commit 4ad6567
Show file tree
Hide file tree
Showing 8 changed files with 416 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo/", rev = "447
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo/", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1"}
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo/", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1"}
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo/", rev = "4471a55923663eb8150ea6cd636d5c1038b137d1"}
cairo-proof-parser = { git = "https://github.com/Okm165/cairo-proof-parser", rev = "97a04bbee07330311b38d6f4cecfed3acb237626"}
cairo-vm = "0.9.2"
cairo-vm = "1.0.1"
clap = { version = "4.5.2", features = ["derive"] }
itertools = "0.13.0"
num-bigint = "0.4.4"
runner = { path = "runner" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
swiftness_proof_parser = { git = "https://github.com/iosis-tech/swiftness", rev = "4647b60cb6e0b6a637a2022a16f0a6e93a117cb3"}
thiserror = "1.0"
4 changes: 2 additions & 2 deletions examples/starknet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2021"

[dependencies]
anyhow.workspace = true
cairo-proof-parser.workspace = true
clap.workspace = true
itertools.workspace = true
runner.workspace = true
serde_json.workspace = true
serde.workspace = true
serde.workspace = true
swiftness_proof_parser.workspace = true
6 changes: 3 additions & 3 deletions examples/starknet/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use cairo_proof_parser::parse;
use clap::Parser;
use itertools::chain;
use runner::{CairoVersion, VecFelt252};
use runner::{transform::ParsedStarkProof, CairoVersion, VecFelt252};
use std::io::{stdin, Read};
use swiftness_proof_parser::parse;

#[derive(Parser)]
#[command(author, version, about)]
Expand All @@ -17,7 +17,7 @@ fn main() -> anyhow::Result<()> {
let mut input = String::new();
stdin().read_to_string(&mut input)?;

let parsed = parse(input)?;
let parsed: ParsedStarkProof = parse(input)?.into();

let config: VecFelt252 = serde_json::from_str(&parsed.config.to_string()).unwrap();
let public_input: VecFelt252 = serde_json::from_str(&parsed.public_input.to_string()).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ cairo-lang-casm.workspace = true
cairo-lang-runner.workspace = true
cairo-lang-sierra.workspace = true
cairo-lang-utils.workspace = true
cairo-proof-parser.workspace = true
cairo-vm.workspace = true
clap.workspace = true
itertools.workspace = true
num-bigint.workspace = true
serde_json.workspace = true
serde.workspace = true
swiftness_proof_parser.workspace = true
thiserror.workspace = true
2 changes: 2 additions & 0 deletions runner/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub mod transform;
pub mod vec252;

use cairo_felt::Felt252;
use clap::ValueEnum;
pub use vec252::VecFelt252;
Expand Down
8 changes: 5 additions & 3 deletions runner/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
mod transform;
mod vec252;
use crate::vec252::VecFelt252;

use crate::vec252::VecFelt252;
use cairo_lang_runner::{Arg, ProfilingInfoCollectionConfig, RunResultValue, SierraCasmRunner};
use cairo_lang_sierra::program::VersionedProgram;
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use cairo_proof_parser::parse;
use clap::Parser;
use itertools::{chain, Itertools};
use runner::CairoVersion;
use std::{
fs,
io::{stdin, Read},
};
use swiftness_proof_parser::parse;
use transform::ParsedStarkProof;

#[derive(Parser)]
#[command(author, version, about)]
Expand All @@ -28,7 +30,7 @@ fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
let mut input = String::new();
stdin().read_to_string(&mut input)?;
let parsed = parse(input)?;
let parsed: ParsedStarkProof = parse(input)?.into();

let function = "main";

Expand Down
Loading

0 comments on commit 4ad6567

Please sign in to comment.