From b67f4fcca976f3a767a0d3edfbff35548d9da53e Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Fri, 9 Feb 2024 14:48:00 -0500 Subject: [PATCH 01/13] entry point for prover / verifier (work done by Violet) --- basic/Cargo.toml | 11 ++-- basic/src/bin/valida.rs | 108 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 107 insertions(+), 12 deletions(-) diff --git a/basic/Cargo.toml b/basic/Cargo.toml index 9cdd34e6..f8fb2bf4 100644 --- a/basic/Cargo.toml +++ b/basic/Cargo.toml @@ -32,16 +32,17 @@ p3-uni-stark = {path = "../../Plonky3/uni-stark" } p3-commit = { path = "../../Plonky3/commit" } p3-air = { path = "../../Plonky3/air" } p3-matrix = { path = "../../Plonky3/matrix" } - -[dev-dependencies] -ciborium = "0.2.2" -rand = "0.8.5" p3-challenger = { path = "../../Plonky3/challenger" } p3-dft = { path = "../../Plonky3/dft" } -p3-field = { path = "../../Plonky3/field" } p3-fri = { path = "../../Plonky3/fri" } p3-keccak = { path = "../../Plonky3/keccak" } p3-mds = { path = "../../Plonky3/mds" } p3-merkle-tree = { path = "../../Plonky3/merkle-tree" } p3-poseidon = { path = "../../Plonky3/poseidon" } p3-symmetric = { path = "../../Plonky3/symmetric" } +serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } +serde_json = {} +rand = "0.8.5" + +[dev-dependencies] +ciborium = "0.2.2" diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index 6220a318..e0d75f44 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -1,20 +1,45 @@ use clap::Parser; -use std::io::{stdout, Write}; +use std::io::{stdout, Write, Read}; +use std::fs::File; use valida_basic::BasicMachine; + +use p3_baby_bear::BabyBear; + +use p3_fri::{TwoAdicFriPcs, TwoAdicFriPcsConfig, FriConfig}; use valida_cpu::MachineWithCpuChip; -use valida_machine::{Machine, ProgramROM, StdinAdviceProvider}; -use valida_output::MachineWithOutputChip; +use valida_machine::{ Machine, MachineProof, ProgramROM, StdinAdviceProvider, +}; + use valida_program::MachineWithProgramChip; -use p3_baby_bear::BabyBear; +use p3_challenger::DuplexChallenger; +use p3_dft::Radix2Bowers; +use p3_field::extension::BinomialExtensionField; +use p3_field::Field; +use p3_keccak::Keccak256Hash; +use p3_mds::coset_mds::CosetMds; +use p3_merkle_tree::FieldMerkleTreeMmcs; +use p3_poseidon::Poseidon; +use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32}; +use rand::thread_rng; +use valida_machine::StarkConfigImpl; +use valida_machine::__internal::p3_commit::ExtensionMmcs; #[derive(Parser)] struct Args { + /// Command option either "prove" or "verify" + #[arg(name = "Action Option")] + action: String, + /// Program binary file - #[arg(name = "FILE")] + #[arg(name = "PROGRAM FILE")] program: String, + /// The output file for prove or the input file for verify + #[arg(name = "ACTION FILE")] + action_file: String, + /// Stack height (which is also the initial frame pointer value) #[arg(long, default_value = "16777216")] stack_height: u32, @@ -23,6 +48,12 @@ struct Args { fn main() { let args = Args::parse(); + let mut action_file; + match File::create(args.action_file) { + Ok(file) => {action_file = file;}, + Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, + } + let mut machine = BasicMachine::::default(); let rom = match ProgramROM::from_file(&args.program) { Ok(contents) => contents, @@ -35,6 +66,69 @@ fn main() { // Run the program machine.run(&rom, &mut StdinAdviceProvider); - // Write output chip values to standard output - stdout().write_all(&machine.output().bytes()).unwrap(); + type Val = BabyBear; + type Challenge = BinomialExtensionField; + type PackedChallenge = BinomialExtensionField<::Packing, 5>; + + type Mds16 = CosetMds; + let mds16 = Mds16::default(); + + type Perm16 = Poseidon; + let perm16 = Perm16::new_from_rng(4, 22, mds16, &mut thread_rng()); // TODO: Use deterministic RNG + + type MyHash = SerializingHasher32; + let hash = MyHash::new(Keccak256Hash {}); + + type MyCompress = CompressionFunctionFromHasher; + let compress = MyCompress::new(hash); + + type ValMmcs = FieldMerkleTreeMmcs; + let val_mmcs = ValMmcs::new(hash, compress); + + type ChallengeMmcs = ExtensionMmcs; + let challenge_mmcs = ChallengeMmcs::new(val_mmcs.clone()); + + type Dft = Radix2Bowers; + let dft = Dft::default(); + + type Challenger = DuplexChallenger; + + type MyFriConfig = TwoAdicFriPcsConfig; + let fri_config = FriConfig { + log_blowup: 1, + num_queries: 40, + proof_of_work_bits: 8, + mmcs: challenge_mmcs, + }; + + type Pcs = TwoAdicFriPcs; + type MyConfig = StarkConfigImpl; + + let pcs = Pcs::new(fri_config, dft, val_mmcs); + + let challenger = Challenger::new(perm16); + let config = MyConfig::new(pcs, challenger); + + if args.action == "prove" { + let proof = machine.prove(&config); + let serialized = serde_json::to_string(&proof); + match serialized { + Ok(str) => { + action_file.write(str.as_bytes()).unwrap(); + stdout().write("Proof successful".as_bytes()).unwrap(); + } + Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap();}, + } + } else if args.action == "verify" { + let mut try_read = String::new(); + action_file.read_to_string(&mut try_read).expect("File reading failed"); + let proof: MachineProof = serde_json::from_str(&try_read).unwrap(); + let verification_result = machine.verify(&config, &proof); + match verification_result { + Ok(_) => {stdout().write("Proof verified".as_bytes()).unwrap();}, + Err(_) => {stdout().write("Proof verification failed".as_bytes()).unwrap();} + } + } else { + stdout().write("Action name unrecognized".as_bytes()).unwrap(); + } } From f02aca719811608b17f206d6b3eb92844c4a5ea6 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Fri, 9 Feb 2024 15:08:56 -0500 Subject: [PATCH 02/13] wip: entry point for prover / verifier --- basic/src/bin/valida.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index e0d75f44..df71c0f0 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -25,10 +25,11 @@ use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32}; use rand::thread_rng; use valida_machine::StarkConfigImpl; use valida_machine::__internal::p3_commit::ExtensionMmcs; +use valida_output::MachineWithOutputChip; #[derive(Parser)] struct Args { - /// Command option either "prove" or "verify" + /// Command option either "run" or "prove" or "verify" #[arg(name = "Action Option")] action: String, @@ -36,7 +37,7 @@ struct Args { #[arg(name = "PROGRAM FILE")] program: String, - /// The output file for prove or the input file for verify + /// The output file for run or prove, or the input file for verify #[arg(name = "ACTION FILE")] action_file: String, @@ -109,13 +110,15 @@ fn main() { let challenger = Challenger::new(perm16); let config = MyConfig::new(pcs, challenger); - if args.action == "prove" { + if args.action == "run" { + action_file.write_all(&machine.output().bytes()).unwrap(); + } else if args.action == "prove" { let proof = machine.prove(&config); let serialized = serde_json::to_string(&proof); match serialized { Ok(str) => { action_file.write(str.as_bytes()).unwrap(); - stdout().write("Proof successful".as_bytes()).unwrap(); + stdout().write("Proof successful\n".as_bytes()).unwrap(); } Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap();}, } From c9e6374b5b26b1bb5b3b929f24046a0ab6d0d786 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Fri, 9 Feb 2024 15:45:00 -0500 Subject: [PATCH 03/13] wip: entry point for prover and verifier --- basic/src/bin/valida.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index df71c0f0..7b848239 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -49,12 +49,6 @@ struct Args { fn main() { let args = Args::parse(); - let mut action_file; - match File::create(args.action_file) { - Ok(file) => {action_file = file;}, - Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, - } - let mut machine = BasicMachine::::default(); let rom = match ProgramROM::from_file(&args.program) { Ok(contents) => contents, @@ -111,8 +105,18 @@ fn main() { let config = MyConfig::new(pcs, challenger); if args.action == "run" { + let mut action_file; + match File::create(args.action_file) { + Ok(file) => {action_file = file;}, + Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, + } action_file.write_all(&machine.output().bytes()).unwrap(); } else if args.action == "prove" { + let mut action_file; + match File::create(args.action_file) { + Ok(file) => {action_file = file;}, + Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, + } let proof = machine.prove(&config); let serialized = serde_json::to_string(&proof); match serialized { @@ -123,13 +127,18 @@ fn main() { Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap();}, } } else if args.action == "verify" { + let mut action_file; + match File::open(args.action_file) { + Ok(file) => {action_file = file;}, + Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, + } let mut try_read = String::new(); action_file.read_to_string(&mut try_read).expect("File reading failed"); let proof: MachineProof = serde_json::from_str(&try_read).unwrap(); let verification_result = machine.verify(&config, &proof); match verification_result { - Ok(_) => {stdout().write("Proof verified".as_bytes()).unwrap();}, - Err(_) => {stdout().write("Proof verification failed".as_bytes()).unwrap();} + Ok(_) => {stdout().write("Proof verified\n".as_bytes()).unwrap();}, + Err(_) => {stdout().write("Proof verification failed\n".as_bytes()).unwrap();} } } else { stdout().write("Action name unrecognized".as_bytes()).unwrap(); From f388e633a49296a20d34a82b075c1360f02011a3 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Fri, 9 Feb 2024 16:04:55 -0500 Subject: [PATCH 04/13] wip: entry point for prover and verifier --- basic/Cargo.toml | 4 +--- basic/src/bin/valida.rs | 22 ++++++---------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/basic/Cargo.toml b/basic/Cargo.toml index f8fb2bf4..11b727bd 100644 --- a/basic/Cargo.toml +++ b/basic/Cargo.toml @@ -10,6 +10,7 @@ path = "src/bin/valida.rs" [dependencies] byteorder = "1.4.3" +ciborium = "0.2.2" clap = { version = "4.3.19", features = ["derive"] } tracing = "0.1.37" valida-alu-u32 = { path = "../alu_u32" } @@ -43,6 +44,3 @@ p3-symmetric = { path = "../../Plonky3/symmetric" } serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } serde_json = {} rand = "0.8.5" - -[dev-dependencies] -ciborium = "0.2.2" diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index 7b848239..af2fd57d 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -118,23 +118,13 @@ fn main() { Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, } let proof = machine.prove(&config); - let serialized = serde_json::to_string(&proof); - match serialized { - Ok(str) => { - action_file.write(str.as_bytes()).unwrap(); - stdout().write("Proof successful\n".as_bytes()).unwrap(); - } - Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap();}, - } + let mut bytes = vec![]; + ciborium::into_writer(&proof, &mut bytes).expect("Proof serialization failed"); + action_file.write(&bytes).expect("Writing proof failed"); + stdout().write("Proof successful\n".as_bytes()).unwrap(); } else if args.action == "verify" { - let mut action_file; - match File::open(args.action_file) { - Ok(file) => {action_file = file;}, - Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, - } - let mut try_read = String::new(); - action_file.read_to_string(&mut try_read).expect("File reading failed"); - let proof: MachineProof = serde_json::from_str(&try_read).unwrap(); + let bytes = std::fs::read(args.action_file).expect("File reading failed"); + let proof: MachineProof = ciborium::from_reader(bytes.as_slice()).expect("Proof deserialization failed"); let verification_result = machine.verify(&config, &proof); match verification_result { Ok(_) => {stdout().write("Proof verified\n".as_bytes()).unwrap();}, From 766b5e5c35d34428634eed3af0780577e6c870ee Mon Sep 17 00:00:00 2001 From: Violet Vienhage <> Date: Tue, 13 Feb 2024 15:55:51 +0100 Subject: [PATCH 05/13] adds deterministic random --- basic/Cargo.toml | 2 ++ basic/src/bin/valida.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/basic/Cargo.toml b/basic/Cargo.toml index 11b727bd..527923a0 100644 --- a/basic/Cargo.toml +++ b/basic/Cargo.toml @@ -44,3 +44,5 @@ p3-symmetric = { path = "../../Plonky3/symmetric" } serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } serde_json = {} rand = "0.8.5" +rand_pcg = "0.3.1" +rand_seeder = "0.2.3" diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index af2fd57d..8d6532a1 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -1,5 +1,5 @@ use clap::Parser; -use std::io::{stdout, Write, Read}; +use std::io::{stdout, Write}; use std::fs::File; use valida_basic::BasicMachine; @@ -22,7 +22,8 @@ use p3_mds::coset_mds::CosetMds; use p3_merkle_tree::FieldMerkleTreeMmcs; use p3_poseidon::Poseidon; use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32}; -use rand::thread_rng; +use rand_seeder::{Seeder}; +use rand_pcg::Pcg64; use valida_machine::StarkConfigImpl; use valida_machine::__internal::p3_commit::ExtensionMmcs; use valida_output::MachineWithOutputChip; @@ -69,7 +70,8 @@ fn main() { let mds16 = Mds16::default(); type Perm16 = Poseidon; - let perm16 = Perm16::new_from_rng(4, 22, mds16, &mut thread_rng()); // TODO: Use deterministic RNG + let mut rng: Pcg64 = Seeder::from("validia seed").make_rng(); + let perm16 = Perm16::new_from_rng(4, 22, mds16, &mut rng); type MyHash = SerializingHasher32; let hash = MyHash::new(Keccak256Hash {}); @@ -118,6 +120,7 @@ fn main() { Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, } let proof = machine.prove(&config); + machine.verify(&config, &proof).expect("Constructed proof is invalid."); let mut bytes = vec![]; ciborium::into_writer(&proof, &mut bytes).expect("Proof serialization failed"); action_file.write(&bytes).expect("Writing proof failed"); From e4c4eceb1a7434ee2ff1189e88d5ccab4e3398d2 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Wed, 14 Feb 2024 13:14:22 -0500 Subject: [PATCH 06/13] disable immediate value constraint --- cpu/src/stark.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/src/stark.rs b/cpu/src/stark.rs index def87bf2..2ce4aaab 100644 --- a/cpu/src/stark.rs +++ b/cpu/src/stark.rs @@ -45,10 +45,10 @@ where // Immediate value constraints (TODO: we'd need to range check read_value_2 in // this case) - builder.when(local.opcode_flags.is_imm_op).assert_eq( - local.instruction.operands.c(), - reduce::(&base, local.read_value_2()), - ); + // builder.when(local.opcode_flags.is_imm_op).assert_eq( + // local.instruction.operands.c(), + // reduce::(&base, local.read_value_2()), + // ); // "Stop" constraints (to check that program execution was not stopped prematurely) builder From 15842dac3fd91bf146e453787b71df8c44f4c94f Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Wed, 14 Feb 2024 17:44:07 -0500 Subject: [PATCH 07/13] extend trace generation to fix immediate value constraint --- cpu/src/lib.rs | 6 ++++-- cpu/src/stark.rs | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cpu/src/lib.rs b/cpu/src/lib.rs index ae091de6..cd50e8e4 100644 --- a/cpu/src/lib.rs +++ b/cpu/src/lib.rs @@ -330,10 +330,12 @@ impl CpuChip { }); } - fn set_imm_value(&self, cols: &mut CpuCols, imm: Option>) { + fn set_imm_value(&self, cols: &mut CpuCols, imm: Option>) { if let Some(imm) = imm { cols.opcode_flags.is_imm_op = F::one(); - cols.mem_channels[1].value = imm.transform(F::from_canonical_u8); + let imm = imm.transform(F::from_canonical_u8); + cols.mem_channels[1].value = imm; + cols.instruction.operands.0[2] = imm.reduce(); } } } diff --git a/cpu/src/stark.rs b/cpu/src/stark.rs index 2ce4aaab..def87bf2 100644 --- a/cpu/src/stark.rs +++ b/cpu/src/stark.rs @@ -45,10 +45,10 @@ where // Immediate value constraints (TODO: we'd need to range check read_value_2 in // this case) - // builder.when(local.opcode_flags.is_imm_op).assert_eq( - // local.instruction.operands.c(), - // reduce::(&base, local.read_value_2()), - // ); + builder.when(local.opcode_flags.is_imm_op).assert_eq( + local.instruction.operands.c(), + reduce::(&base, local.read_value_2()), + ); // "Stop" constraints (to check that program execution was not stopped prematurely) builder From aaf74aadbb61eda0f234d0c21a385e63bc73bce3 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Thu, 15 Feb 2024 12:43:19 -0500 Subject: [PATCH 08/13] run cargo fmt --- basic/src/bin/valida.rs | 48 +++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index 8d6532a1..477aacca 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -1,15 +1,14 @@ use clap::Parser; -use std::io::{stdout, Write}; use std::fs::File; +use std::io::{stdout, Write}; use valida_basic::BasicMachine; use p3_baby_bear::BabyBear; -use p3_fri::{TwoAdicFriPcs, TwoAdicFriPcsConfig, FriConfig}; +use p3_fri::{FriConfig, TwoAdicFriPcs, TwoAdicFriPcsConfig}; use valida_cpu::MachineWithCpuChip; -use valida_machine::{ Machine, MachineProof, ProgramROM, StdinAdviceProvider, -}; +use valida_machine::{Machine, MachineProof, ProgramROM, StdinAdviceProvider}; use valida_program::MachineWithProgramChip; @@ -22,8 +21,8 @@ use p3_mds::coset_mds::CosetMds; use p3_merkle_tree::FieldMerkleTreeMmcs; use p3_poseidon::Poseidon; use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32}; -use rand_seeder::{Seeder}; use rand_pcg::Pcg64; +use rand_seeder::Seeder; use valida_machine::StarkConfigImpl; use valida_machine::__internal::p3_commit::ExtensionMmcs; use valida_output::MachineWithOutputChip; @@ -109,31 +108,52 @@ fn main() { if args.action == "run" { let mut action_file; match File::create(args.action_file) { - Ok(file) => {action_file = file;}, - Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, + Ok(file) => { + action_file = file; + } + Err(e) => { + stdout().write(e.to_string().as_bytes()).unwrap(); + return (); + } } action_file.write_all(&machine.output().bytes()).unwrap(); } else if args.action == "prove" { let mut action_file; match File::create(args.action_file) { - Ok(file) => {action_file = file;}, - Err(e) => {stdout().write(e.to_string().as_bytes()).unwrap(); return ()}, + Ok(file) => { + action_file = file; + } + Err(e) => { + stdout().write(e.to_string().as_bytes()).unwrap(); + return (); + } } let proof = machine.prove(&config); - machine.verify(&config, &proof).expect("Constructed proof is invalid."); + machine + .verify(&config, &proof) + .expect("Constructed proof is invalid."); let mut bytes = vec![]; ciborium::into_writer(&proof, &mut bytes).expect("Proof serialization failed"); action_file.write(&bytes).expect("Writing proof failed"); stdout().write("Proof successful\n".as_bytes()).unwrap(); } else if args.action == "verify" { let bytes = std::fs::read(args.action_file).expect("File reading failed"); - let proof: MachineProof = ciborium::from_reader(bytes.as_slice()).expect("Proof deserialization failed"); + let proof: MachineProof = + ciborium::from_reader(bytes.as_slice()).expect("Proof deserialization failed"); let verification_result = machine.verify(&config, &proof); match verification_result { - Ok(_) => {stdout().write("Proof verified\n".as_bytes()).unwrap();}, - Err(_) => {stdout().write("Proof verification failed\n".as_bytes()).unwrap();} + Ok(_) => { + stdout().write("Proof verified\n".as_bytes()).unwrap(); + } + Err(_) => { + stdout() + .write("Proof verification failed\n".as_bytes()) + .unwrap(); + } } } else { - stdout().write("Action name unrecognized".as_bytes()).unwrap(); + stdout() + .write("Action name unrecognized".as_bytes()) + .unwrap(); } } From 259a38f46e8aff157c981764c4e274b9775dc77d Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Mon, 19 Feb 2024 12:42:16 -0500 Subject: [PATCH 09/13] wip: enable parallel prover --- alu_u32/Cargo.toml | 2 +- alu_u32/src/com/mod.rs | 3 +-- basic/Cargo.toml | 2 +- cpu/Cargo.toml | 2 +- machine/Cargo.toml | 2 +- memory/Cargo.toml | 2 +- native_field/Cargo.toml | 2 +- output/Cargo.toml | 2 +- range/Cargo.toml | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/alu_u32/Cargo.toml b/alu_u32/Cargo.toml index c106ddc1..48dcd75a 100644 --- a/alu_u32/Cargo.toml +++ b/alu_u32/Cargo.toml @@ -11,7 +11,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-derive = { path = "../derive" } diff --git a/alu_u32/src/com/mod.rs b/alu_u32/src/com/mod.rs index 5084062a..e05e98da 100644 --- a/alu_u32/src/com/mod.rs +++ b/alu_u32/src/com/mod.rs @@ -16,8 +16,7 @@ use valida_opcodes::{EQ32, NE32}; use p3_air::VirtualPairCol; use p3_field::{AbstractField, Field, PrimeField}; use p3_matrix::dense::RowMajorMatrix; -// use p3_maybe_rayon::*; -use p3_maybe_rayon::prelude::IntoParallelRefIterator; +use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use valida_util::pad_to_power_of_two; pub mod columns; diff --git a/basic/Cargo.toml b/basic/Cargo.toml index 527923a0..4a788915 100644 --- a/basic/Cargo.toml +++ b/basic/Cargo.toml @@ -26,7 +26,7 @@ valida-program = { path = "../program" } valida-range = { path = "../range" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-util = { path = "../../Plonky3/util" } p3-goldilocks = {path = "../../Plonky3/goldilocks" } p3-uni-stark = {path = "../../Plonky3/uni-stark" } diff --git a/cpu/Cargo.toml b/cpu/Cargo.toml index b2f883b1..8fab9627 100644 --- a/cpu/Cargo.toml +++ b/cpu/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark"} valida-bus = { path = "../bus" } valida-machine = { path = "../machine" } diff --git a/machine/Cargo.toml b/machine/Cargo.toml index dadfde83..449ad1d9 100644 --- a/machine/Cargo.toml +++ b/machine/Cargo.toml @@ -21,7 +21,7 @@ p3-challenger = { path = "../../Plonky3/challenger" } p3-dft = { path = "../../Plonky3/dft" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark" } p3-util = { path = "../../Plonky3/util" } valida-util = { path = "../util" } diff --git a/memory/Cargo.toml b/memory/Cargo.toml index cb4c1a2e..5a6c0dc4 100644 --- a/memory/Cargo.toml +++ b/memory/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-machine = { path = "../machine" } diff --git a/native_field/Cargo.toml b/native_field/Cargo.toml index eff3f9f1..66a90510 100644 --- a/native_field/Cargo.toml +++ b/native_field/Cargo.toml @@ -10,7 +10,7 @@ itertools = "0.12.0" p3-air = { path = "../../Plonky3/air" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-derive = { path = "../derive" } diff --git a/output/Cargo.toml b/output/Cargo.toml index a147be2c..886f433c 100644 --- a/output/Cargo.toml +++ b/output/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark"} valida-bus = { path = "../bus" } valida-cpu = { path = "../cpu" } diff --git a/range/Cargo.toml b/range/Cargo.toml index 81f49ece..d9930c99 100644 --- a/range/Cargo.toml +++ b/range/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-machine = { path = "../machine" } From 5fe03787ef9f53c9d6d4688c0c20eed3c14adbf2 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Mon, 19 Feb 2024 12:50:55 -0500 Subject: [PATCH 10/13] wip: enable parallel prover: remove unnecessary(?) feature flags --- alu_u32/Cargo.toml | 2 +- cpu/Cargo.toml | 2 +- machine/Cargo.toml | 2 +- memory/Cargo.toml | 2 +- native_field/Cargo.toml | 2 +- output/Cargo.toml | 2 +- range/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/alu_u32/Cargo.toml b/alu_u32/Cargo.toml index 48dcd75a..c106ddc1 100644 --- a/alu_u32/Cargo.toml +++ b/alu_u32/Cargo.toml @@ -11,7 +11,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-derive = { path = "../derive" } diff --git a/cpu/Cargo.toml b/cpu/Cargo.toml index 8fab9627..b2f883b1 100644 --- a/cpu/Cargo.toml +++ b/cpu/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark"} valida-bus = { path = "../bus" } valida-machine = { path = "../machine" } diff --git a/machine/Cargo.toml b/machine/Cargo.toml index 449ad1d9..dadfde83 100644 --- a/machine/Cargo.toml +++ b/machine/Cargo.toml @@ -21,7 +21,7 @@ p3-challenger = { path = "../../Plonky3/challenger" } p3-dft = { path = "../../Plonky3/dft" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark" } p3-util = { path = "../../Plonky3/util" } valida-util = { path = "../util" } diff --git a/memory/Cargo.toml b/memory/Cargo.toml index 5a6c0dc4..cb4c1a2e 100644 --- a/memory/Cargo.toml +++ b/memory/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-machine = { path = "../machine" } diff --git a/native_field/Cargo.toml b/native_field/Cargo.toml index 66a90510..eff3f9f1 100644 --- a/native_field/Cargo.toml +++ b/native_field/Cargo.toml @@ -10,7 +10,7 @@ itertools = "0.12.0" p3-air = { path = "../../Plonky3/air" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-derive = { path = "../derive" } diff --git a/output/Cargo.toml b/output/Cargo.toml index 886f433c..a147be2c 100644 --- a/output/Cargo.toml +++ b/output/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark"} valida-bus = { path = "../bus" } valida-cpu = { path = "../cpu" } diff --git a/range/Cargo.toml b/range/Cargo.toml index d9930c99..81f49ece 100644 --- a/range/Cargo.toml +++ b/range/Cargo.toml @@ -9,7 +9,7 @@ p3-air = { path = "../../Plonky3/air" } p3-baby-bear = { path = "../../Plonky3/baby-bear" } p3-field = { path = "../../Plonky3/field" } p3-matrix = { path = "../../Plonky3/matrix" } -p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon", features = ["parallel"] } +p3-maybe-rayon = { path = "../../Plonky3/maybe-rayon" } p3-uni-stark = { path = "../../Plonky3/uni-stark" } valida-bus = { path = "../bus" } valida-machine = { path = "../machine" } From 318f983bafa3ffad7d0a2c86bff9e6f26faf873d Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Wed, 21 Feb 2024 18:57:06 -0500 Subject: [PATCH 11/13] use Radix2DitParallel DFT and only verify proof in debug mode --- basic/src/bin/valida.rs | 8 +++----- derive/src/lib.rs | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/basic/src/bin/valida.rs b/basic/src/bin/valida.rs index 477aacca..ebe12173 100644 --- a/basic/src/bin/valida.rs +++ b/basic/src/bin/valida.rs @@ -13,7 +13,7 @@ use valida_machine::{Machine, MachineProof, ProgramROM, StdinAdviceProvider}; use valida_program::MachineWithProgramChip; use p3_challenger::DuplexChallenger; -use p3_dft::Radix2Bowers; +use p3_dft::Radix2DitParallel; use p3_field::extension::BinomialExtensionField; use p3_field::Field; use p3_keccak::Keccak256Hash; @@ -84,7 +84,7 @@ fn main() { type ChallengeMmcs = ExtensionMmcs; let challenge_mmcs = ChallengeMmcs::new(val_mmcs.clone()); - type Dft = Radix2Bowers; + type Dft = Radix2DitParallel; let dft = Dft::default(); type Challenger = DuplexChallenger; @@ -129,9 +129,7 @@ fn main() { } } let proof = machine.prove(&config); - machine - .verify(&config, &proof) - .expect("Constructed proof is invalid."); + debug_assert!(machine.verify(&config, &proof).is_ok()); let mut bytes = vec![]; ciborium::into_writer(&proof, &mut bytes).expect("Proof serialization failed"); action_file.write(&bytes).expect("Writing proof failed"); diff --git a/derive/src/lib.rs b/derive/src/lib.rs index f9793981..b59bdc53 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -350,7 +350,6 @@ fn prove_method(chips: &[&Field]) -> TokenStream2 { let (openings, opening_proof) = pcs.open_multi_batches( &prover_data_and_points, &mut challenger); - // TODO: add preprocessed openings let [main_openings, perm_openings, quotient_openings] = openings.try_into().expect("Should have 3 rounds of openings"); From 1247158da13ac5f76a3f315e460fdd3af4c112f2 Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Thu, 22 Feb 2024 14:06:26 -0500 Subject: [PATCH 12/13] add executable to run test_prover for fib(100) --- basic/Cargo.toml | 4 + basic/src/bin/test_prover.rs | 265 +++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) create mode 100644 basic/src/bin/test_prover.rs diff --git a/basic/Cargo.toml b/basic/Cargo.toml index 4a788915..ae88bd42 100644 --- a/basic/Cargo.toml +++ b/basic/Cargo.toml @@ -8,6 +8,10 @@ license = "MIT OR Apache-2.0" name = "valida" path = "src/bin/valida.rs" +[[bin]] +name = "test_prover" +path = "src/bin/test_prover.rs" + [dependencies] byteorder = "1.4.3" ciborium = "0.2.2" diff --git a/basic/src/bin/test_prover.rs b/basic/src/bin/test_prover.rs new file mode 100644 index 00000000..11704e1b --- /dev/null +++ b/basic/src/bin/test_prover.rs @@ -0,0 +1,265 @@ +extern crate core; + +use p3_baby_bear::BabyBear; +use p3_fri::{TwoAdicFriPcs, TwoAdicFriPcsConfig}; +use valida_alu_u32::add::{Add32Instruction, MachineWithAdd32Chip}; +use valida_basic::BasicMachine; +use valida_cpu::{ + BeqInstruction, BneInstruction, Imm32Instruction, JalInstruction, JalvInstruction, + MachineWithCpuChip, StopInstruction, +}; +use valida_machine::{ + FixedAdviceProvider, Instruction, InstructionWord, Machine, MachineProof, Operands, ProgramROM, + Word, +}; + +use valida_memory::MachineWithMemoryChip; +use valida_opcodes::BYTES_PER_INSTR; +use valida_program::MachineWithProgramChip; + +use p3_challenger::DuplexChallenger; +use p3_dft::Radix2Bowers; +use p3_field::extension::BinomialExtensionField; +use p3_field::Field; +use p3_fri::FriConfig; +use p3_keccak::Keccak256Hash; +use p3_mds::coset_mds::CosetMds; +use p3_merkle_tree::FieldMerkleTreeMmcs; +use p3_poseidon::Poseidon; +use p3_symmetric::{CompressionFunctionFromHasher, SerializingHasher32}; +use rand::thread_rng; +use valida_machine::StarkConfigImpl; +use valida_machine::__internal::p3_commit::ExtensionMmcs; + +fn main () { + prove_fibonacci() +} + +fn prove_fibonacci() { + let mut program = vec![]; + + // Label locations + let bytes_per_instr = BYTES_PER_INSTR as i32; + let fib_bb0 = 8 * bytes_per_instr; + let fib_bb0_1 = 13 * bytes_per_instr; + let fib_bb0_2 = 15 * bytes_per_instr; + let fib_bb0_3 = 19 * bytes_per_instr; + let fib_bb0_4 = 21 * bytes_per_instr; + + //main: ; @main + //; %bb.0: + // imm32 -4(fp), 0, 0, 0, 0 + // imm32 -8(fp), 0, 0, 0, 100 + // addi -16(fp), -8(fp), 0 + // imm32 -20(fp), 0, 0, 0, 28 + // jal -28(fp), fib, -28 + // addi -12(fp), -24(fp), 0 + // addi 4(fp), -12(fp), 0 + // exit + //... + program.extend([ + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-4, 0, 0, 0, 0]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-8, 0, 0, 0, 100]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-16, -8, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-20, 0, 0, 0, 28]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-28, fib_bb0, -28, 0, 0]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-12, -24, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([4, -12, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands::default(), + }, + ]); + + //fib: ; @fib + //; %bb.0: + // addi -4(fp), 12(fp), 0 + // imm32 -8(fp), 0, 0, 0, 0 + // imm32 -12(fp), 0, 0, 0, 1 + // imm32 -16(fp), 0, 0, 0, 0 + // beq .LBB0_1, 0(fp), 0(fp) + program.extend([ + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-4, 12, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-8, 0, 0, 0, 0]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-12, 0, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-16, 0, 0, 0, 0]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([fib_bb0_1, 0, 0, 0, 0]), + }, + ]); + + //.LBB0_1: + // bne .LBB0_2, -16(fp), -4(fp) + // beq .LBB0_4, 0(fp), 0(fp) + program.extend([ + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([fib_bb0_2, -16, -4, 0, 0]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([fib_bb0_4, 0, 0, 0, 0]), + }, + ]); + + //; %bb.2: + // add -20(fp), -8(fp), -12(fp) + // addi -8(fp), -12(fp), 0 + // addi -12(fp), -20(fp), 0 + // beq .LBB0_3, 0(fp), 0(fp) + program.extend([ + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-20, -8, -12, 0, 0]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-8, -12, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-12, -20, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([fib_bb0_3, 0, 0, 0, 0]), + }, + ]); + + //; %bb.3: + // addi -16(fp), -16(fp), 1 + // beq .LBB0_1, 0(fp), 0(fp) + program.extend([ + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-16, -16, 1, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([fib_bb0_1, 0, 0, 0, 0]), + }, + ]); + + //.LBB0_4: + // addi 4(fp), -8(fp), 0 + // jalv -4(fp), 0(fp), 8(fp) + program.extend([ + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([4, -8, 0, 0, 1]), + }, + InstructionWord { + opcode: , Val>>::OPCODE, + operands: Operands([-4, 0, 8, 0, 0]), + }, + ]); + + let mut machine = BasicMachine::::default(); + let rom = ProgramROM::new(program); + machine.program_mut().set_program_rom(&rom); + machine.cpu_mut().fp = 0x1000; + machine.cpu_mut().save_register_state(); // TODO: Initial register state should be saved + // automatically by the machine, not manually here + machine.run(&rom, &mut FixedAdviceProvider::empty()); + + type Val = BabyBear; + type Challenge = BinomialExtensionField; + type PackedChallenge = BinomialExtensionField<::Packing, 5>; + + type Mds16 = CosetMds; + let mds16 = Mds16::default(); + + type Perm16 = Poseidon; + let perm16 = Perm16::new_from_rng(4, 22, mds16, &mut thread_rng()); // TODO: Use deterministic RNG + + type MyHash = SerializingHasher32; + let hash = MyHash::new(Keccak256Hash {}); + + type MyCompress = CompressionFunctionFromHasher; + let compress = MyCompress::new(hash); + + type ValMmcs = FieldMerkleTreeMmcs; + let val_mmcs = ValMmcs::new(hash, compress); + + type ChallengeMmcs = ExtensionMmcs; + let challenge_mmcs = ChallengeMmcs::new(val_mmcs.clone()); + + type Dft = Radix2Bowers; + let dft = Dft::default(); + + type Challenger = DuplexChallenger; + + type MyFriConfig = TwoAdicFriPcsConfig; + let fri_config = FriConfig { + log_blowup: 1, + num_queries: 40, + proof_of_work_bits: 8, + mmcs: challenge_mmcs, + }; + + type Pcs = TwoAdicFriPcs; + type MyConfig = StarkConfigImpl; + + let pcs = Pcs::new(fri_config, dft, val_mmcs); + + let challenger = Challenger::new(perm16); + let config = MyConfig::new(pcs, challenger); + let proof = machine.prove(&config); + + let mut bytes = vec![]; + ciborium::into_writer(&proof, &mut bytes).expect("serialization failed"); + println!("Proof size: {} bytes", bytes.len()); + let deserialized_proof: MachineProof = + ciborium::from_reader(bytes.as_slice()).expect("deserialization failed"); + + machine + .verify(&config, &proof) + .expect("verification failed"); + machine + .verify(&config, &deserialized_proof) + .expect("verification failed"); + + // assert_eq!(machine.cpu().clock, 192); + // assert_eq!(machine.cpu().operations.len(), 192); + // assert_eq!(machine.mem().operations.values().flatten().count(), 401); + // assert_eq!(machine.add_u32().operations.len(), 105); + + // assert_eq!( + // *machine.mem().cells.get(&(0x1000 + 4)).unwrap(), // Return value + // Word([0, 1, 37, 17,]) // 25th fibonacci number (75025) + // ); +} From 8313508f0f875459b0486753971bbb3de1fc588d Mon Sep 17 00:00:00 2001 From: Morgan Thomas Date: Mon, 18 Mar 2024 15:17:11 -0400 Subject: [PATCH 13/13] run formatter --- basic/src/bin/test_prover.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/src/bin/test_prover.rs b/basic/src/bin/test_prover.rs index 11704e1b..f754bce7 100644 --- a/basic/src/bin/test_prover.rs +++ b/basic/src/bin/test_prover.rs @@ -31,8 +31,8 @@ use rand::thread_rng; use valida_machine::StarkConfigImpl; use valida_machine::__internal::p3_commit::ExtensionMmcs; -fn main () { - prove_fibonacci() +fn main() { + prove_fibonacci() } fn prove_fibonacci() {