From c440969b6236256226c558bec40e759da39ccb78 Mon Sep 17 00:00:00 2001 From: John Guibas Date: Sun, 14 Apr 2024 19:14:50 -0700 Subject: [PATCH] chore: cleanup for allen (#518) --- core/src/air/builder.rs | 113 +- core/src/air/extension.rs | 3 +- core/src/air/machine.rs | 6 +- core/src/air/polynomial.rs | 1 + core/src/air/public_values.rs | 10 +- core/src/air/word.rs | 3 +- core/src/alu/add_sub/mod.rs | 24 +- core/src/alu/bitwise/mod.rs | 16 +- core/src/alu/divrem/mod.rs | 14 +- core/src/alu/lt/mod.rs | 8 +- core/src/alu/mul/mod.rs | 12 +- core/src/alu/sll/mod.rs | 2 + core/src/alu/sr/mod.rs | 9 + core/src/bytes/air.rs | 7 +- core/src/bytes/columns.rs | 5 +- core/src/bytes/event.rs | 3 +- core/src/bytes/mod.rs | 5 +- core/src/cpu/air/mod.rs | 10 +- core/src/cpu/columns/ecall.rs | 2 + core/src/cpu/trace.rs | 18 +- core/src/disassembler/elf.rs | 5 +- core/src/disassembler/mod.rs | 3 +- core/src/lookup/builder.rs | 12 +- core/src/lookup/debug.rs | 3 +- core/src/lookup/interaction.rs | 1 + core/src/memory/columns.rs | 1 + core/src/memory/global.rs | 80 +- core/src/memory/trace.rs | 6 +- core/src/operations/add.rs | 9 +- core/src/operations/add5.rs | 4 +- core/src/operations/field/field_den.rs | 14 +- .../operations/field/field_inner_product.rs | 16 +- core/src/operations/field/field_op.rs | 16 +- core/src/operations/field/field_sqrt.rs | 10 +- core/src/operations/field/params.rs | 6 +- core/src/operations/field/util.rs | 4 +- core/src/operations/field/util_air.rs | 3 +- core/src/operations/fixed_rotate_right.rs | 2 +- core/src/operations/fixed_shift_right.rs | 2 +- core/src/operations/is_equal_word.rs | 3 +- core/src/operations/is_zero_word.rs | 3 +- core/src/operations/not.rs | 2 +- core/src/program/mod.rs | 7 +- core/src/runtime/instruction.rs | 3 +- core/src/runtime/io.rs | 6 +- core/src/runtime/mod.rs | 11 +- core/src/runtime/record.rs | 7 +- core/src/runtime/syscall.rs | 8 +- core/src/runtime/utils.rs | 3 +- core/src/stark/air.rs | 22 +- core/src/stark/debug.rs | 3 +- core/src/stark/folder.rs | 7 +- core/src/stark/machine.rs | 28 +- core/src/stark/permutation.rs | 3 +- core/src/stark/prover.rs | 4 +- core/src/stark/quotient.rs | 12 +- core/src/stark/types.rs | 3 +- core/src/stark/verifier.rs | 15 +- .../precompiles/blake3/compress/air.rs | 8 +- .../syscall/precompiles/blake3/compress/g.rs | 1 - .../precompiles/blake3/compress/trace.rs | 16 +- .../src/syscall/precompiles/edwards/ed_add.rs | 38 +- .../precompiles/edwards/ed_decompress.rs | 44 +- .../syscall/precompiles/k256/decompress.rs | 44 +- core/src/syscall/precompiles/keccak256/air.rs | 13 +- .../syscall/precompiles/keccak256/execute.rs | 7 +- core/src/syscall/precompiles/keccak256/mod.rs | 9 +- .../syscall/precompiles/keccak256/trace.rs | 3 +- core/src/syscall/precompiles/mod.rs | 1 - .../precompiles/sha256/compress/air.rs | 94 +- .../precompiles/sha256/compress/columns.rs | 1 + .../precompiles/sha256/compress/execute.rs | 3 +- .../precompiles/sha256/compress/mod.rs | 7 +- .../precompiles/sha256/compress/trace.rs | 10 +- .../syscall/precompiles/sha256/extend/air.rs | 10 +- .../precompiles/sha256/extend/columns.rs | 8 + .../precompiles/sha256/extend/flags.rs | 7 + .../weierstrass/weierstrass_add.rs | 36 +- .../weierstrass/weierstrass_double.rs | 38 +- core/src/utils/ec/edwards/ed25519.rs | 3 +- core/src/utils/ec/edwards/mod.rs | 5 +- core/src/utils/ec/field.rs | 10 +- core/src/utils/ec/mod.rs | 8 +- core/src/utils/ec/weierstrass/mod.rs | 5 +- core/src/utils/ec/weierstrass/secp256k1.rs | 6 +- core/src/utils/prove.rs | 14 +- .../program/elf/riscv32im-succinct-zkvm-elf | Bin 193728 -> 193732 bytes examples/ssz-withdrawals/script/Cargo.lock | 1429 +++++++++++++++-- recursion/circuit/src/domain.rs | 1 - recursion/compiler/src/ir/bits.rs | 7 +- recursion/compiler/src/ir/builder.rs | 7 +- 91 files changed, 1922 insertions(+), 589 deletions(-) diff --git a/core/src/air/builder.rs b/core/src/air/builder.rs index a4f390f156..32e2bd0da6 100644 --- a/core/src/air/builder.rs +++ b/core/src/air/builder.rs @@ -1,6 +1,10 @@ +use std::iter::once; + use itertools::Itertools; use p3_air::{AirBuilder, FilteredAirBuilder}; use p3_air::{AirBuilderWithPublicValues, PermutationAirBuilder}; +use p3_field::{AbstractField, Field}; +use p3_uni_stark::StarkGenericConfig; use p3_uni_stark::{ProverConstraintFolder, SymbolicAirBuilder, VerifierConstraintFolder}; use super::interaction::AirInteraction; @@ -11,10 +15,6 @@ use crate::cpu::columns::OpcodeSelectorCols; use crate::lookup::InteractionKind; use crate::memory::MemoryAccessCols; use crate::{bytes::ByteOpcode, memory::MemoryCols}; -use p3_field::{AbstractField, Field}; - -use p3_uni_stark::StarkGenericConfig; -use std::iter::once; /// A Builder with the ability to encode the existance of interactions with other AIRs by sending /// and receiving messages. @@ -240,6 +240,25 @@ pub trait WordAirBuilder: ByteAirBuilder { result } + /// Same as `if_else` above, but arguments are `Word` instead of individual expressions. + fn select_word( + &mut self, + condition: ECond, + a: Word, + b: Word, + ) -> Word + where + ECond: Into + Clone, + EA: Into + Clone, + EB: Into + Clone, + { + let mut res = vec![]; + for i in 0..WORD_SIZE { + res.push(self.if_else(condition.clone(), a[i].clone(), b[i].clone())); + } + Word(res.try_into().unwrap()) + } + /// Check that each limb of the given slice is a u8. fn slice_range_check_u8< EWord: Into + Clone, @@ -426,11 +445,11 @@ pub trait AluAirBuilder: BaseAirBuilder { /// A trait which contains methods related to memory interactions in an AIR. pub trait MemoryAirBuilder: BaseAirBuilder { - /// Constraints a memory read or write. + /// Constrain a memory read or write. /// /// This method verifies that a memory access timestamp (shard, clk) is greater than the /// previous access's timestamp. It will also add to the memory argument. - fn constraint_memory_access( + fn eval_memory_access( &mut self, shard: EShard, clk: EClk, @@ -453,7 +472,7 @@ pub trait MemoryAirBuilder: BaseAirBuilder { self.assert_bool(do_check.clone()); // Verify that the current memory access time is greater than the previous's. - self.verify_mem_access_ts(mem_access, do_check.clone(), shard.clone(), clk.clone()); + self.eval_memory_access_timestamp(mem_access, do_check.clone(), shard.clone(), clk.clone()); // Add to the memory argument. let addr = addr.into(); @@ -485,13 +504,39 @@ pub trait MemoryAirBuilder: BaseAirBuilder { )); } + /// Constraints a memory read or write to a slice of `MemoryAccessCols`. + fn eval_memory_access_slice( + &mut self, + shard: EShard, + clk: Self::Expr, + initial_addr: Ea, + memory_access_slice: &[M], + verify_memory_access: EVerify, + ) where + EShard: Into + Copy, + Ea: Into + Copy, + Eb: Into + Copy, + EVerify: Into + Copy, + M: MemoryCols, + { + for (i, access_slice) in memory_access_slice.iter().enumerate() { + self.eval_memory_access( + shard, + clk.clone(), + initial_addr.into() + Self::Expr::from_canonical_usize(i * 4), + access_slice, + verify_memory_access, + ); + } + } + /// Verifies the memory access timestamp. /// - /// This method verifies that the current memory access happend after the previous one's. Specifically - /// it will ensure that if the current and previous access are in the same shard, then the - /// current's clk val is greater than the previous's. If they are not in the same shard, then - /// it will ensure that the current's shard val is greater than the previous's. - fn verify_mem_access_ts( + /// This method verifies that the current memory access happend after the previous one's. + /// Specifically it will ensure that if the current and previous access are in the same shard, + /// then the current's clk val is greater than the previous's. If they are not in the same + /// shard, then it will ensure that the current's shard val is greater than the previous's. + fn eval_memory_access_timestamp( &mut self, mem_access: &MemoryAccessCols, do_check: EVerify, @@ -526,15 +571,17 @@ pub trait MemoryAirBuilder: BaseAirBuilder { // Assert `current_comp_val > prev_comp_val`. We check this by asserting that // `0 <= current_comp_val-prev_comp_val-1 < 2^24`. // - // The equivalence of these statements comes from the fact that if `current_comp_val <= prev_comp_val`, - // then `current_comp_val-prev_comp_val-1 < 0` and will underflow in the prime field, - // resulting in a value that is `>= 2^24` as long as both `current_comp_val, prev_comp_val` are - // range-checked to be `<2^24` and as long as we're working in a field larger than `2 * 2^24` - // (which is true of the BabyBear and Mersenne31 prime). + // The equivalence of these statements comes from the fact that if + // `current_comp_val <= prev_comp_val`, then `current_comp_val-prev_comp_val-1 < 0` and will + // underflow in the prime field, resulting in a value that is `>= 2^24` as long as both + // `current_comp_val, prev_comp_val` are range-checked to be `<2^24` and as long as we're + // working in a field larger than `2 * 2^24` (which is true of the BabyBear and Mersenne31 + // prime). let diff_minus_one = current_comp_val - prev_comp_value - Self::Expr::one(); - // Verify that mem_access.ts_diff = mem_access.ts_diff_16bit_limb + mem_access.ts_diff_8bit_limb * 2^16. - self.verify_range_24bits( + // Verify that mem_access.ts_diff = mem_access.ts_diff_16bit_limb + // + mem_access.ts_diff_8bit_limb * 2^16. + self.eval_range_check_24bits( diff_minus_one, mem_access.diff_16bit_limb.clone(), mem_access.diff_8bit_limb.clone(), @@ -549,7 +596,7 @@ pub trait MemoryAirBuilder: BaseAirBuilder { /// check on it's limbs. It will also verify that the limbs are correct. This method is needed /// since the memory access timestamp check (see [Self::verify_mem_access_ts]) needs to assume /// the clk is within 24 bits. - fn verify_range_24bits( + fn eval_range_check_24bits( &mut self, value: EValue, limb_16: ELimb, @@ -588,32 +635,6 @@ pub trait MemoryAirBuilder: BaseAirBuilder { do_check, ) } - - /// Constraints a memory read or write to a slice of `MemoryAccessCols`. - fn constraint_memory_access_slice( - &mut self, - shard: EShard, - clk: Self::Expr, - initial_addr: Ea, - memory_access_slice: &[M], - verify_memory_access: EVerify, - ) where - EShard: Into + Copy, - Ea: Into + Copy, - Eb: Into + Copy, - EVerify: Into + Copy, - M: MemoryCols, - { - for (i, access_slice) in memory_access_slice.iter().enumerate() { - self.constraint_memory_access( - shard, - clk.clone(), - initial_addr.into() + Self::Expr::from_canonical_usize(i * 4), - access_slice, - verify_memory_access, - ); - } - } } /// A trait which contains methods related to program interactions in an AIR. diff --git a/core/src/air/extension.rs b/core/src/air/extension.rs index 75fb6ad078..69241f1aee 100644 --- a/core/src/air/extension.rs +++ b/core/src/air/extension.rs @@ -1,9 +1,10 @@ +use std::ops::{Add, Mul, Neg, Sub}; + use p3_field::{ extension::{BinomialExtensionField, BinomiallyExtendable}, AbstractExtensionField, AbstractField, }; use sp1_derive::AlignedBorrow; -use std::ops::{Add, Mul, Neg, Sub}; const DEGREE: usize = 4; diff --git a/core/src/air/machine.rs b/core/src/air/machine.rs index 977abf4ab3..936d9cf0f0 100644 --- a/core/src/air/machine.rs +++ b/core/src/air/machine.rs @@ -6,7 +6,7 @@ use crate::stark::MachineRecord; pub use sp1_derive::MachineAir; -/// An AIR that is part of a Risc-V AIR arithmetization. +/// An AIR that is part of a multi table AIR arithmetization. pub trait MachineAir: BaseAir { /// The execution record containing events for producing the air trace. type Record: MachineRecord; @@ -31,13 +31,13 @@ pub trait MachineAir: BaseAir { /// Whether this execution record contains events for this air. fn included(&self, shard: &Self::Record) -> bool; + /// The width of the preprocessed trace. fn preprocessed_width(&self) -> usize { 0 } /// Generate the preprocessed trace given a specific program. - #[allow(unused_variables)] - fn generate_preprocessed_trace(&self, program: &Self::Program) -> Option> { + fn generate_preprocessed_trace(&self, _program: &Self::Program) -> Option> { None } } diff --git a/core/src/air/polynomial.rs b/core/src/air/polynomial.rs index f9089aafd7..76f0c128c6 100644 --- a/core/src/air/polynomial.rs +++ b/core/src/air/polynomial.rs @@ -1,5 +1,6 @@ use core::fmt::Debug; use core::ops::{Add, AddAssign, Mul, Neg, Sub}; + use itertools::Itertools; use p3_field::{AbstractExtensionField, AbstractField, Field}; diff --git a/core/src/air/public_values.rs b/core/src/air/public_values.rs index 03b35a1172..877739380d 100644 --- a/core/src/air/public_values.rs +++ b/core/src/air/public_values.rs @@ -1,13 +1,15 @@ -use crate::stark::PROOF_MAX_NUM_PVS; - -use super::Word; use core::fmt::Debug; use core::mem::size_of; +use std::iter::once; + use itertools::Itertools; use p3_field::{AbstractField, PrimeField32}; use serde::{Deserialize, Serialize}; -use std::iter::once; +use super::Word; +use crate::stark::PROOF_MAX_NUM_PVS; + +/// The number of words needed to represent a public value digest. /// The number of non padded elements in the SP1 proofs public values vec. pub const SP1_PROOF_NUM_PV_ELTS: usize = size_of::, u8>>(); diff --git a/core/src/air/word.rs b/core/src/air/word.rs index 0c896dc56b..549c63a0b1 100644 --- a/core/src/air/word.rs +++ b/core/src/air/word.rs @@ -1,3 +1,4 @@ +use core::fmt::Debug; use std::array::IntoIter; use std::ops::{Index, IndexMut}; @@ -8,8 +9,6 @@ use p3_field::Field; use serde::{Deserialize, Serialize}; use sp1_derive::AlignedBorrow; -use core::fmt::Debug; - use super::SP1AirBuilder; /// The size of a word in bytes. diff --git a/core/src/alu/add_sub/mod.rs b/core/src/alu/add_sub/mod.rs index 15446c4a02..dd96198aaf 100644 --- a/core/src/alu/add_sub/mod.rs +++ b/core/src/alu/add_sub/mod.rs @@ -1,5 +1,6 @@ use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; + use p3_air::{Air, BaseAir}; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; @@ -35,11 +36,6 @@ pub struct AddSubCols { /// The shard number, used for byte lookup table. pub shard: T, - /// Boolean to indicate whether the row is for an add operation. - pub is_add: T, - /// Boolean to indicate whether the row is for a sub operation. - pub is_sub: T, - /// Instance of `AddOperation` to handle addition logic in `AddSubChip`'s ALU operations. /// It's result will be `a` for the add operation and `b` for the sub operation. pub add_operation: AddOperation, @@ -49,6 +45,12 @@ pub struct AddSubCols { /// The second input operand. This will be `c` for both operations. pub operand_2: Word, + + /// Boolean to indicate whether the row is for an add operation. + pub is_add: T, + + /// Boolean to indicate whether the row is for a sub operation. + pub is_sub: T, } impl MachineAir for AddSubChip { @@ -143,11 +145,6 @@ where let local = main.row_slice(0); let local: &AddSubCols = (*local).borrow(); - builder.assert_bool(local.is_add); - builder.assert_bool(local.is_sub); - let is_real = local.is_add + local.is_sub; - builder.assert_bool(is_real.clone()); - // Evaluate the addition operation. AddOperation::::eval( builder, @@ -155,7 +152,7 @@ where local.operand_2, local.add_operation, local.shard, - is_real, + local.is_add + local.is_sub, ); // Receive the arguments. There are seperate receives for ADD and SUB. @@ -179,6 +176,11 @@ where local.is_sub, ); + let is_real = local.is_add + local.is_sub; + builder.assert_bool(local.is_add); + builder.assert_bool(local.is_sub); + builder.assert_bool(is_real); + // Degree 3 constraint to avoid "OodEvaluationMismatch". builder.assert_zero( local.operand_1[0] * local.operand_1[0] * local.operand_1[0] diff --git a/core/src/alu/bitwise/mod.rs b/core/src/alu/bitwise/mod.rs index e4ba4804cb..04d60a868e 100644 --- a/core/src/alu/bitwise/mod.rs +++ b/core/src/alu/bitwise/mod.rs @@ -1,5 +1,6 @@ use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; + use p3_air::{Air, BaseAir}; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; @@ -140,11 +141,14 @@ where builder.send_byte(opcode.clone(), a, b, c, local.shard, mult.clone()); } + // Get the cpu opcode, which corresponds to the opcode being sent in the CPU table. + let cpu_opcode = local.is_xor * Opcode::XOR.as_field::() + + local.is_or * Opcode::OR.as_field::() + + local.is_and * Opcode::AND.as_field::(); + // Receive the arguments. builder.receive_alu( - local.is_xor * Opcode::XOR.as_field::() - + local.is_or * Opcode::OR.as_field::() - + local.is_and * Opcode::AND.as_field::(), + cpu_opcode, local.a, local.b, local.c, @@ -152,6 +156,12 @@ where local.is_xor + local.is_or + local.is_and, ); + let is_real = local.is_xor + local.is_or + local.is_and; + builder.assert_bool(local.is_xor); + builder.assert_bool(local.is_or); + builder.assert_bool(local.is_and); + builder.assert_bool(is_real); + // Degree 3 constraint to avoid "OodEvaluationMismatch". builder.assert_zero( local.a[0] * local.b[0] * local.c[0] - local.a[0] * local.b[0] * local.c[0], diff --git a/core/src/alu/divrem/mod.rs b/core/src/alu/divrem/mod.rs index a60710955a..a6853c28cd 100644 --- a/core/src/alu/divrem/mod.rs +++ b/core/src/alu/divrem/mod.rs @@ -64,6 +64,7 @@ mod utils; use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; + use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::AbstractField; use p3_field::PrimeField; @@ -716,17 +717,18 @@ where // Check that the flags are boolean. { let bool_flags = [ - local.is_real, - local.is_remu, + local.is_div, local.is_divu, local.is_rem, - local.is_div, - local.b_neg, - local.rem_neg, + local.is_remu, + local.is_overflow, local.b_msb, local.rem_msb, - local.c_neg, local.c_msb, + local.b_neg, + local.rem_neg, + local.c_neg, + local.is_real, ]; for flag in bool_flags.iter() { diff --git a/core/src/alu/lt/mod.rs b/core/src/alu/lt/mod.rs index 9de41af01a..22d56deaa7 100644 --- a/core/src/alu/lt/mod.rs +++ b/core/src/alu/lt/mod.rs @@ -1,6 +1,6 @@ -use crate::air::MachineAir; use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; + use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::PrimeField; use p3_field::{AbstractField, PrimeField32}; @@ -10,8 +10,8 @@ use p3_maybe_rayon::prelude::*; use sp1_derive::AlignedBorrow; use tracing::instrument; +use crate::air::MachineAir; use crate::air::{SP1AirBuilder, Word}; - use crate::runtime::{ExecutionRecord, Opcode, Program}; use crate::utils::pad_to_power_of_two; @@ -293,6 +293,10 @@ where builder.assert_bool(bit); } + // Check that the operation flags are boolean. + builder.assert_bool(local.is_slt); + builder.assert_bool(local.is_sltu); + // Receive the arguments. builder.receive_alu( local.is_slt * AB::F::from_canonical_u32(Opcode::SLT as u32) diff --git a/core/src/alu/mul/mod.rs b/core/src/alu/mul/mod.rs index c3d33774a1..36060195a3 100644 --- a/core/src/alu/mul/mod.rs +++ b/core/src/alu/mul/mod.rs @@ -32,6 +32,7 @@ mod utils; use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; + use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::AbstractField; use p3_field::PrimeField; @@ -287,7 +288,6 @@ where let zero: AB::Expr = AB::F::zero().into(); let one: AB::Expr = AB::F::one().into(); - // 0xff let byte_mask = AB::F::from_canonical_u8(BYTE_MASK); // Calculate the MSBs. @@ -373,15 +373,15 @@ where // Check that the boolean values are indeed boolean values. { let booleans = [ - local.is_real, - local.is_mul, - local.is_mulh, - local.is_mulhu, - local.is_mulhsu, local.b_msb, local.c_msb, local.b_sign_extend, local.c_sign_extend, + local.is_mul, + local.is_mulh, + local.is_mulhu, + local.is_mulhsu, + local.is_real, ]; for boolean in booleans.iter() { builder.assert_bool(*boolean); diff --git a/core/src/alu/sll/mod.rs b/core/src/alu/sll/mod.rs index e8f6e75feb..fa6224ed17 100644 --- a/core/src/alu/sll/mod.rs +++ b/core/src/alu/sll/mod.rs @@ -32,6 +32,7 @@ use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; + use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::AbstractField; use p3_field::PrimeField; @@ -237,6 +238,7 @@ where // Check shift_by_n_bits[i] is 1 iff i = num_bits_to_shift. let mut num_bits_to_shift = zero.clone(); + // 3 is the maximum number of bits necessary to represent num_bits_to_shift as // num_bits_to_shift is in [0, 7]. for i in 0..3 { diff --git a/core/src/alu/sr/mod.rs b/core/src/alu/sr/mod.rs index a691140358..2bb8627acc 100644 --- a/core/src/alu/sr/mod.rs +++ b/core/src/alu/sr/mod.rs @@ -330,6 +330,7 @@ where .when(local.shift_by_n_bits[i]) .assert_eq(num_bits_to_shift.clone(), AB::F::from_canonical_usize(i)); } + // Exactly one of the shift_by_n_bits must be 1. builder.assert_eq( local @@ -343,12 +344,14 @@ where // number of bytes to shift. let num_bytes_to_shift = local.c_least_sig_byte[3] + local.c_least_sig_byte[4] * AB::F::from_canonical_u32(2); + // If shift_by_n_bytes[i] = 1, then i = num_bytes_to_shift. for i in 0..WORD_SIZE { builder .when(local.shift_by_n_bytes[i]) .assert_eq(num_bytes_to_shift.clone(), AB::F::from_canonical_usize(i)); } + // Exactly one of the shift_by_n_bytes must be 1. builder.assert_eq( local @@ -392,6 +395,7 @@ where carry_multiplier += AB::Expr::from_canonical_u32(1u32 << (8 - i)) * local.shift_by_n_bits[i]; } + // The 3-bit number represented by the 3 least significant bits of c equals the number // of bits to shift. let mut num_bits_to_shift = AB::Expr::zero(); @@ -462,6 +466,11 @@ where local.a[0] * local.b[0] * local.c[0] - local.a[0] * local.b[0] * local.c[0], ); + // Check that the operation flags are boolean. + builder.assert_bool(local.is_srl); + builder.assert_bool(local.is_sra); + builder.assert_bool(local.is_real); + // Receive the arguments. builder.receive_alu( local.is_srl * AB::F::from_canonical_u32(Opcode::SRL as u32) diff --git a/core/src/bytes/air.rs b/core/src/bytes/air.rs index d2e4acaa45..5f24e31911 100644 --- a/core/src/bytes/air.rs +++ b/core/src/bytes/air.rs @@ -1,4 +1,5 @@ use core::borrow::Borrow; + use p3_air::PairBuilder; use p3_air::{Air, BaseAir}; use p3_field::AbstractField; @@ -9,12 +10,6 @@ use super::columns::{ByteMultCols, BytePreprocessedCols, NUM_BYTE_MULT_COLS}; use super::{ByteChip, ByteOpcode}; use crate::air::SP1AirBuilder; -/// The column map for the byte chip. -// pub(crate) const BYTE_COL_MAP: ByteCols = make_col_map(); - -/// The multiplicity indices for each byte operation. -// pub(crate) const BYTE_MULT_INDICES: [usize; NUM_BYTE_OPS] = BYTE_COL_MAP.multiplicities; - impl BaseAir for ByteChip { fn width(&self) -> usize { NUM_BYTE_MULT_COLS diff --git a/core/src/bytes/columns.rs b/core/src/bytes/columns.rs index 7a7a188792..4524bec8bf 100644 --- a/core/src/bytes/columns.rs +++ b/core/src/bytes/columns.rs @@ -6,6 +6,7 @@ use super::NUM_BYTE_OPS; /// The number of main trace columns for `ByteChip`. pub const NUM_BYTE_PREPROCESSED_COLS: usize = size_of::>(); +/// The number of multiplicity columns for `ByteChip`. pub const NUM_BYTE_MULT_COLS: usize = size_of::>(); #[derive(Debug, Clone, Copy, AlignedBorrow)] @@ -48,7 +49,9 @@ pub struct BytePreprocessedCols { #[derive(Debug, Clone, Copy, AlignedBorrow)] #[repr(C)] pub struct ByteMultCols { - pub multiplicities: [T; NUM_BYTE_OPS], /// Shard number is tracked so that the multiplicities do not overflow. pub shard: T, + + /// The multiplicites of each byte operation. + pub multiplicities: [T; NUM_BYTE_OPS], } diff --git a/core/src/bytes/event.rs b/core/src/bytes/event.rs index 3d56ac7226..2c87f348fc 100644 --- a/core/src/bytes/event.rs +++ b/core/src/bytes/event.rs @@ -1,6 +1,7 @@ -use super::ByteOpcode; use serde::{Deserialize, Serialize}; +use super::ByteOpcode; + /// A byte lookup event. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct ByteLookupEvent { diff --git a/core/src/bytes/mod.rs b/core/src/bytes/mod.rs index e7d4054c8f..55311e9f6e 100644 --- a/core/src/bytes/mod.rs +++ b/core/src/bytes/mod.rs @@ -5,15 +5,16 @@ pub mod opcode; pub mod trace; pub mod utils; +pub use event::ByteLookupEvent; pub use opcode::*; use alloc::collections::BTreeMap; use core::borrow::BorrowMut; -pub use event::ByteLookupEvent; +use std::marker::PhantomData; + use itertools::Itertools; use p3_field::Field; use p3_matrix::dense::RowMajorMatrix; -use std::marker::PhantomData; use self::columns::{BytePreprocessedCols, NUM_BYTE_PREPROCESSED_COLS}; use self::utils::shr_carry; diff --git a/core/src/cpu/air/mod.rs b/core/src/cpu/air/mod.rs index 24c799f965..42e5c99d1a 100644 --- a/core/src/cpu/air/mod.rs +++ b/core/src/cpu/air/mod.rs @@ -65,7 +65,7 @@ where .assert_word_eq(local.op_c_val(), local.instruction.op_c); // If they are not immediates, read `b` and `c` from memory. - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + AB::F::from_canonical_u32(MemoryAccessPosition::B as u32), local.instruction.op_b[0], @@ -76,7 +76,7 @@ where .when_not(local.selectors.imm_b) .assert_word_eq(local.op_b_val(), *local.op_b_access.prev_value()); - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + AB::F::from_canonical_u32(MemoryAccessPosition::C as u32), local.instruction.op_c[0], @@ -93,7 +93,7 @@ where builder .when(local.instruction.op_a_0) .assert_word_zero(*local.op_a_access.value()); - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + AB::F::from_canonical_u32(MemoryAccessPosition::A as u32), local.instruction.op_a[0], @@ -110,7 +110,7 @@ where // For operations that require reading from memory (not registers), we need to read the // value into the memory columns. let memory_columns = local.opcode_specific_columns.memory(); - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + AB::F::from_canonical_u32(MemoryAccessPosition::Memory as u32), memory_columns.addr_aligned, @@ -444,7 +444,7 @@ impl CpuChip { .assert_eq(expected_next_clk.clone(), next.clk); // Range check that the clk is within 24 bits using it's limb values. - builder.verify_range_24bits( + builder.eval_range_check_24bits( local.clk, local.clk_16bit_limb, local.clk_8bit_limb, diff --git a/core/src/cpu/columns/ecall.rs b/core/src/cpu/columns/ecall.rs index 8bc7e3c4f9..d3fd6e358c 100644 --- a/core/src/cpu/columns/ecall.rs +++ b/core/src/cpu/columns/ecall.rs @@ -20,9 +20,11 @@ pub struct EcallCols { /// Whether the current ecall is a COMMIT. pub is_commit: IsZeroOperation, + /// The digest word passed into the COMMIT ecall. This is the public values digest word calculated /// within the program. pub digest_word: Word, + /// Field to store the word index passed into the COMMIT ecall. index_bitmap[word index] should /// be set to 1 and everything else set to 0. pub index_bitmap: [T; PV_DIGEST_NUM_WORDS], diff --git a/core/src/cpu/trace.rs b/core/src/cpu/trace.rs index 0a537080c3..79ca9da0f2 100644 --- a/core/src/cpu/trace.rs +++ b/core/src/cpu/trace.rs @@ -1,3 +1,13 @@ +use std::borrow::BorrowMut; +use std::collections::HashMap; + +use p3_field::{PrimeField, PrimeField32}; +use p3_matrix::dense::RowMajorMatrix; +use p3_maybe_rayon::prelude::IntoParallelRefIterator; +use p3_maybe_rayon::prelude::ParallelIterator; +use p3_maybe_rayon::prelude::ParallelSlice; +use tracing::instrument; + use super::columns::{CPU_COL_MAP, NUM_CPU_COLS}; use super::{CpuChip, CpuEvent}; use crate::air::MachineAir; @@ -9,14 +19,6 @@ use crate::disassembler::WORD_SIZE; use crate::memory::MemoryCols; use crate::runtime::{ExecutionRecord, Opcode, Program}; use crate::runtime::{MemoryRecordEnum, SyscallCode}; -use p3_field::{PrimeField, PrimeField32}; -use p3_matrix::dense::RowMajorMatrix; -use p3_maybe_rayon::prelude::IntoParallelRefIterator; -use p3_maybe_rayon::prelude::ParallelIterator; -use p3_maybe_rayon::prelude::ParallelSlice; -use std::borrow::BorrowMut; -use std::collections::HashMap; -use tracing::instrument; impl MachineAir for CpuChip { type Record = ExecutionRecord; diff --git a/core/src/disassembler/elf.rs b/core/src/disassembler/elf.rs index bff65ff41b..8f9dfb612b 100644 --- a/core/src/disassembler/elf.rs +++ b/core/src/disassembler/elf.rs @@ -1,9 +1,10 @@ +use std::cmp::min; +use std::collections::BTreeMap; + use elf::abi::{EM_RISCV, ET_EXEC, PF_X, PT_LOAD}; use elf::endian::LittleEndian; use elf::file::Class; use elf::ElfBytes; -use std::cmp::min; -use std::collections::BTreeMap; /// The maximum size of the memory in bytes. pub const MAXIMUM_MEMORY_SIZE: u32 = u32::MAX; diff --git a/core/src/disassembler/mod.rs b/core/src/disassembler/mod.rs index ee1399ad0b..9b94f2058c 100644 --- a/core/src/disassembler/mod.rs +++ b/core/src/disassembler/mod.rs @@ -4,9 +4,10 @@ mod instruction; pub use elf::*; pub use instruction::*; -use crate::runtime::{Instruction, Program}; use std::{collections::BTreeMap, fs::File, io::Read}; +use crate::runtime::{Instruction, Program}; + impl Program { /// Create a new program. pub fn new(instructions: Vec, pc_start: u32, pc_base: u32) -> Self { diff --git a/core/src/lookup/builder.rs b/core/src/lookup/builder.rs index 209a9ca412..a342425d43 100644 --- a/core/src/lookup/builder.rs +++ b/core/src/lookup/builder.rs @@ -1,12 +1,13 @@ -use crate::{ - air::{AirInteraction, MessageBuilder}, - stark::PROOF_MAX_NUM_PVS, -}; use p3_air::{AirBuilder, AirBuilderWithPublicValues, PairBuilder, PairCol, VirtualPairCol}; use p3_field::Field; use p3_matrix::dense::RowMajorMatrix; use p3_uni_stark::{Entry, SymbolicExpression, SymbolicVariable}; +use crate::{ + air::{AirInteraction, MessageBuilder}, + stark::PROOF_MAX_NUM_PVS, +}; + use super::Interaction; /// A builder for the lookup table interactions. @@ -196,11 +197,12 @@ fn eval_symbolic_to_virtual_pair( #[cfg(test)] mod tests { + use std::borrow::Borrow; + use p3_air::{Air, BaseAir}; use p3_baby_bear::BabyBear; use p3_field::AbstractField; use p3_matrix::Matrix; - use std::borrow::Borrow; use super::*; use crate::{air::SP1AirBuilder, lookup::InteractionKind}; diff --git a/core/src/lookup/debug.rs b/core/src/lookup/debug.rs index 7961199edc..4efcf5f396 100644 --- a/core/src/lookup/debug.rs +++ b/core/src/lookup/debug.rs @@ -5,11 +5,10 @@ use p3_field::{AbstractField, PrimeField32}; use p3_field::{Field, PrimeField64}; use p3_matrix::Matrix; +use super::InteractionKind; use crate::air::MachineAir; use crate::stark::{MachineChip, MachineStark, ProvingKey, StarkGenericConfig, Val}; -use super::InteractionKind; - #[derive(Debug)] pub struct InteractionData { pub chip_name: String, diff --git a/core/src/lookup/interaction.rs b/core/src/lookup/interaction.rs index 52d8a33426..0ac2a2903f 100644 --- a/core/src/lookup/interaction.rs +++ b/core/src/lookup/interaction.rs @@ -1,5 +1,6 @@ use core::fmt::Debug; use core::fmt::Display; + use p3_air::VirtualPairCol; use p3_field::Field; diff --git a/core/src/memory/columns.rs b/core/src/memory/columns.rs index dd7185237f..59fbfa8988 100644 --- a/core/src/memory/columns.rs +++ b/core/src/memory/columns.rs @@ -28,6 +28,7 @@ pub struct MemoryReadWriteCols { #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] #[repr(C)] pub struct MemoryAccessCols { + /// The value of the memory access. pub value: Word, /// The previous shard and timestamp that this memory access is being read from. diff --git a/core/src/memory/global.rs b/core/src/memory/global.rs index f104a1b52a..1aaae0eb09 100644 --- a/core/src/memory/global.rs +++ b/core/src/memory/global.rs @@ -1,54 +1,56 @@ -use crate::air::{AirInteraction, SP1AirBuilder, Word}; -use crate::air::{MachineAir, WordAirBuilder}; -use crate::utils::pad_to_power_of_two; -use p3_field::PrimeField; -use p3_matrix::dense::RowMajorMatrix; - -use crate::runtime::{ExecutionRecord, Program}; use core::borrow::{Borrow, BorrowMut}; -use core::mem::{size_of, transmute}; +use core::mem::size_of; + use p3_air::BaseAir; use p3_air::{Air, AirBuilder}; use p3_field::AbstractField; +use p3_field::PrimeField; +use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use p3_util::indices_arr; use sp1_derive::AlignedBorrow; use super::MemoryInitializeFinalizeEvent; +use crate::air::{AirInteraction, SP1AirBuilder, Word}; +use crate::air::{MachineAir, WordAirBuilder}; +use crate::runtime::{ExecutionRecord, Program}; +use crate::utils::pad_to_power_of_two; +/// The type of memory chip that is being initialized. #[derive(PartialEq)] -pub enum MemoryChipKind { +pub enum MemoryChipType { Initialize, Finalize, Program, } -pub struct MemoryGlobalChip { - pub kind: MemoryChipKind, +/// A memory chip that can initialize or finalize values in memory. +pub struct MemoryChip { + pub kind: MemoryChipType, } -impl MemoryGlobalChip { - pub fn new(kind: MemoryChipKind) -> Self { +impl MemoryChip { + /// Creates a new memory chip with a certain type. + pub fn new(kind: MemoryChipType) -> Self { Self { kind } } } -impl BaseAir for MemoryGlobalChip { +impl BaseAir for MemoryChip { fn width(&self) -> usize { NUM_MEMORY_INIT_COLS } } -impl MachineAir for MemoryGlobalChip { +impl MachineAir for MemoryChip { type Record = ExecutionRecord; type Program = Program; fn name(&self) -> String { match self.kind { - MemoryChipKind::Initialize => "MemoryInit".to_string(), - MemoryChipKind::Finalize => "MemoryFinalize".to_string(), - MemoryChipKind::Program => "MemoryProgram".to_string(), + MemoryChipType::Initialize => "MemoryInit".to_string(), + MemoryChipType::Finalize => "MemoryFinalize".to_string(), + MemoryChipType::Program => "MemoryProgram".to_string(), } } @@ -58,9 +60,9 @@ impl MachineAir for MemoryGlobalChip { _output: &mut ExecutionRecord, ) -> RowMajorMatrix { let memory_events = match self.kind { - MemoryChipKind::Initialize => &input.memory_initialize_events, - MemoryChipKind::Finalize => &input.memory_finalize_events, - MemoryChipKind::Program => &input.program_memory_events, + MemoryChipType::Initialize => &input.memory_initialize_events, + MemoryChipType::Finalize => &input.memory_finalize_events, + MemoryChipType::Program => &input.program_memory_events, }; let rows: Vec<[F; 8]> = (0..memory_events.len()) // TODO: change this back to par_iter .map(|i| { @@ -95,9 +97,9 @@ impl MachineAir for MemoryGlobalChip { fn included(&self, shard: &Self::Record) -> bool { match self.kind { - MemoryChipKind::Initialize => !shard.memory_initialize_events.is_empty(), - MemoryChipKind::Finalize => !shard.memory_finalize_events.is_empty(), - MemoryChipKind::Program => !shard.program_memory_events.is_empty(), + MemoryChipType::Initialize => !shard.memory_initialize_events.is_empty(), + MemoryChipType::Finalize => !shard.memory_finalize_events.is_empty(), + MemoryChipType::Program => !shard.program_memory_events.is_empty(), } } } @@ -105,23 +107,25 @@ impl MachineAir for MemoryGlobalChip { #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] #[repr(C)] pub struct MemoryInitCols { + /// The shard number of the memory access. pub shard: T, + + /// The timestamp of the memory access. pub timestamp: T, + + /// The address of the memory access. pub addr: T, + + /// The value of the memory access. pub value: Word, + + /// Whether the memory access is a real access. pub is_real: T, } pub(crate) const NUM_MEMORY_INIT_COLS: usize = size_of::>(); -#[allow(dead_code)] -pub(crate) const MEMORY_INIT_COL_MAP: MemoryInitCols = make_col_map(); - -const fn make_col_map() -> MemoryInitCols { - let indices_arr = indices_arr::(); - unsafe { transmute::<[usize; NUM_MEMORY_INIT_COLS], MemoryInitCols>(indices_arr) } -} -impl Air for MemoryGlobalChip +impl Air for MemoryChip where AB: SP1AirBuilder, { @@ -136,7 +140,7 @@ where local.is_real * local.is_real * local.is_real, ); - if self.kind == MemoryChipKind::Initialize || self.kind == MemoryChipKind::Program { + if self.kind == MemoryChipType::Initialize || self.kind == MemoryChipType::Program { let mut values = vec![AB::Expr::zero(), AB::Expr::zero(), local.addr.into()]; values.extend(local.value.map(Into::into)); builder.receive(AirInteraction::new( @@ -163,7 +167,7 @@ where // and Finalize global memory chip is for register %x0 (i.e. addr = 0x0), and that those rows // have a value of 0. Additionally, in the CPU air, we ensure that whenever op_a is set to // %x0, its value is 0. - if self.kind == MemoryChipKind::Initialize || self.kind == MemoryChipKind::Finalize { + if self.kind == MemoryChipType::Initialize || self.kind == MemoryChipType::Finalize { builder.when_first_row().assert_zero(local.addr); builder.when_first_row().assert_word_zero(local.value); } @@ -191,13 +195,13 @@ mod tests { runtime.run(); let shard = runtime.record.clone(); - let chip: MemoryGlobalChip = MemoryGlobalChip::new(MemoryChipKind::Initialize); + let chip: MemoryChip = MemoryChip::new(MemoryChipType::Initialize); let trace: RowMajorMatrix = chip.generate_trace(&shard, &mut ExecutionRecord::default()); println!("{:?}", trace.values); - let chip: MemoryGlobalChip = MemoryGlobalChip::new(MemoryChipKind::Finalize); + let chip: MemoryChip = MemoryChip::new(MemoryChipType::Finalize); let trace: RowMajorMatrix = chip.generate_trace(&shard, &mut ExecutionRecord::default()); println!("{:?}", trace.values); @@ -216,7 +220,7 @@ mod tests { let mut runtime = Runtime::new(program); runtime.run(); - let chip = MemoryGlobalChip::new(MemoryChipKind::Initialize); + let chip = MemoryChip::new(MemoryChipType::Initialize); let trace: RowMajorMatrix = chip.generate_trace(&runtime.record, &mut ExecutionRecord::default()); diff --git a/core/src/memory/trace.rs b/core/src/memory/trace.rs index e55efa2db6..c2b840857c 100644 --- a/core/src/memory/trace.rs +++ b/core/src/memory/trace.rs @@ -1,9 +1,9 @@ -use crate::bytes::ByteLookupEvent; -use crate::bytes::ByteOpcode::{U16Range, U8Range}; -use crate::runtime::{MemoryReadRecord, MemoryRecord, MemoryRecordEnum, MemoryWriteRecord}; use p3_field::PrimeField32; use super::{MemoryAccessCols, MemoryReadCols, MemoryReadWriteCols, MemoryWriteCols}; +use crate::bytes::ByteLookupEvent; +use crate::bytes::ByteOpcode::{U16Range, U8Range}; +use crate::runtime::{MemoryReadRecord, MemoryRecord, MemoryRecordEnum, MemoryWriteRecord}; impl MemoryWriteCols { pub fn populate( diff --git a/core/src/operations/add.rs b/core/src/operations/add.rs index 3a506c0414..f733252152 100644 --- a/core/src/operations/add.rs +++ b/core/src/operations/add.rs @@ -1,12 +1,11 @@ -use p3_air::AirBuilder; -use p3_field::Field; -use sp1_derive::AlignedBorrow; - use crate::air::SP1AirBuilder; use crate::air::Word; - use crate::runtime::ExecutionRecord; + +use p3_air::AirBuilder; use p3_field::AbstractField; +use p3_field::Field; +use sp1_derive::AlignedBorrow; /// A set of columns needed to compute the add of two words. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] diff --git a/core/src/operations/add5.rs b/core/src/operations/add5.rs index 5be3081c30..9f11104af6 100644 --- a/core/src/operations/add5.rs +++ b/core/src/operations/add5.rs @@ -1,4 +1,5 @@ use p3_air::AirBuilder; +use p3_field::AbstractField; use p3_field::Field; use sp1_derive::AlignedBorrow; @@ -6,11 +7,8 @@ use crate::air::SP1AirBuilder; use crate::air::Word; use crate::air::WORD_SIZE; use crate::runtime::ExecutionRecord; -use p3_field::AbstractField; /// A set of columns needed to compute the sum of five words. -/// -/// TODO: This is currently not in use, and thus not tested thoroughly yet. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] #[repr(C)] pub struct Add5Operation { diff --git a/core/src/operations/field/field_den.rs b/core/src/operations/field/field_den.rs index fb06e3f37a..6581594bc7 100644 --- a/core/src/operations/field/field_den.rs +++ b/core/src/operations/field/field_den.rs @@ -1,3 +1,9 @@ +use std::fmt::Debug; + +use num::BigUint; +use p3_field::PrimeField32; +use sp1_derive::AlignedBorrow; + use super::params::Limbs; use super::util::{compute_root_quotient_and_shift, split_u16_limbs_to_u8_limbs}; use super::util_air::eval_field_operation; @@ -5,11 +11,6 @@ use crate::air::Polynomial; use crate::air::SP1AirBuilder; use crate::utils::ec::field::FieldParameters; -use num::BigUint; -use p3_field::PrimeField32; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; - /// A set of columns to compute `FieldDen(a, b)` where `a`, `b` are field elements. /// /// `a / (1 + b)` if `sign` @@ -17,6 +18,9 @@ use std::fmt::Debug; /// /// Right now the number of limbs is assumed to be a constant, although this could be macro-ed /// or made generic in the future. +/// +/// TODO: There is an issue here here some fields in these columns must be range checked. This is +/// a known issue and will be fixed in the future. #[derive(Debug, Clone, AlignedBorrow)] #[repr(C)] pub struct FieldDenCols { diff --git a/core/src/operations/field/field_inner_product.rs b/core/src/operations/field/field_inner_product.rs index 579e000cda..45e7017592 100644 --- a/core/src/operations/field/field_inner_product.rs +++ b/core/src/operations/field/field_inner_product.rs @@ -1,3 +1,10 @@ +use std::fmt::Debug; + +use num::BigUint; +use num::Zero; +use p3_field::{AbstractField, PrimeField32}; +use sp1_derive::AlignedBorrow; + use super::params::Limbs; use super::util::{compute_root_quotient_and_shift, split_u16_limbs_to_u8_limbs}; use super::util_air::eval_field_operation; @@ -5,15 +12,12 @@ use crate::air::Polynomial; use crate::air::SP1AirBuilder; use crate::utils::ec::field::FieldParameters; -use num::BigUint; -use num::Zero; -use p3_field::{AbstractField, PrimeField32}; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; - /// A set of columns to compute `FieldInnerProduct(Vec, Vec)` where a, b are field elements. /// Right now the number of limbs is assumed to be a constant, although this could be macro-ed /// or made generic in the future. +/// +/// TODO: There is an issue here here some fields in these columns must be range checked. This is +/// a known issue and will be fixed in the future. #[derive(Debug, Clone, AlignedBorrow)] #[repr(C)] pub struct FieldInnerProductCols { diff --git a/core/src/operations/field/field_op.rs b/core/src/operations/field/field_op.rs index 62e568ef6f..1cb91986b8 100644 --- a/core/src/operations/field/field_op.rs +++ b/core/src/operations/field/field_op.rs @@ -1,3 +1,10 @@ +use std::fmt::Debug; + +use num::{BigUint, Zero}; +use p3_air::AirBuilder; +use p3_field::PrimeField32; +use sp1_derive::AlignedBorrow; + use super::params::Limbs; use super::util::{compute_root_quotient_and_shift, split_u16_limbs_to_u8_limbs}; use super::util_air::eval_field_operation; @@ -5,12 +12,6 @@ use crate::air::Polynomial; use crate::air::SP1AirBuilder; use crate::utils::ec::field::FieldParameters; -use num::{BigUint, Zero}; -use p3_air::AirBuilder; -use p3_field::PrimeField32; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; - #[derive(PartialEq, Copy, Clone, Debug)] pub enum FieldOperation { Add, @@ -22,6 +23,9 @@ pub enum FieldOperation { /// A set of columns to compute `FieldOperation(a, b)` where a, b are field elements. /// Right now the number of limbs is assumed to be a constant, although this could be macro-ed /// or made generic in the future. +/// +/// TODO: There is an issue here here some fields in these columns must be range checked. This is +/// a known issue and will be fixed in the future. #[derive(Debug, Clone, AlignedBorrow)] #[repr(C)] pub struct FieldOpCols { diff --git a/core/src/operations/field/field_sqrt.rs b/core/src/operations/field/field_sqrt.rs index 4c5f571957..32bd4a90dc 100644 --- a/core/src/operations/field/field_sqrt.rs +++ b/core/src/operations/field/field_sqrt.rs @@ -1,11 +1,13 @@ +use std::fmt::Debug; + +use num::BigUint; +use p3_field::PrimeField32; +use sp1_derive::AlignedBorrow; + use super::field_op::FieldOpCols; use super::params::Limbs; use crate::air::SP1AirBuilder; use crate::utils::ec::field::FieldParameters; -use num::BigUint; -use p3_field::PrimeField32; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; /// A set of columns to compute the square root in the ed25519 curve. `T` is the field in which each /// limb lives. diff --git a/core/src/operations/field/params.rs b/core/src/operations/field/params.rs index 020e42f26b..b03f64eff7 100644 --- a/core/src/operations/field/params.rs +++ b/core/src/operations/field/params.rs @@ -1,10 +1,12 @@ -use crate::air::Polynomial; -use generic_array::{ArrayLength, GenericArray}; use std::fmt::Debug; use std::ops::Index; use std::slice::Iter; use std::usize; +use generic_array::{ArrayLength, GenericArray}; + +use crate::air::Polynomial; + pub const NB_BITS_PER_LIMB: usize = 8; #[derive(Debug, Clone)] diff --git a/core/src/operations/field/util.rs b/core/src/operations/field/util.rs index 9b26a9d812..bb68c67f26 100644 --- a/core/src/operations/field/util.rs +++ b/core/src/operations/field/util.rs @@ -1,8 +1,8 @@ -use crate::air::Polynomial; - use num::BigUint; use p3_field::PrimeField32; +use crate::air::Polynomial; + fn biguint_to_field(num: BigUint) -> F { let mut x = F::zero(); let mut power = F::from_canonical_u32(1u32); diff --git a/core/src/operations/field/util_air.rs b/core/src/operations/field/util_air.rs index f4aea7c5bb..1a748f285c 100644 --- a/core/src/operations/field/util_air.rs +++ b/core/src/operations/field/util_air.rs @@ -1,7 +1,8 @@ +use p3_field::AbstractField; + use crate::air::Polynomial; use crate::air::SP1AirBuilder; use crate::utils::ec::field::FieldParameters; -use p3_field::AbstractField; pub fn eval_field_operation( builder: &mut AB, diff --git a/core/src/operations/fixed_rotate_right.rs b/core/src/operations/fixed_rotate_right.rs index 1ba61941d9..b8697f3157 100644 --- a/core/src/operations/fixed_rotate_right.rs +++ b/core/src/operations/fixed_rotate_right.rs @@ -1,3 +1,4 @@ +use p3_field::AbstractField; use p3_field::Field; use sp1_derive::AlignedBorrow; @@ -8,7 +9,6 @@ use crate::bytes::ByteLookupEvent; use crate::bytes::ByteOpcode; use crate::disassembler::WORD_SIZE; use crate::runtime::ExecutionRecord; -use p3_field::AbstractField; /// A set of columns needed to compute `rotateright` of a word with a fixed offset R. /// diff --git a/core/src/operations/fixed_shift_right.rs b/core/src/operations/fixed_shift_right.rs index 4944ab94ba..25168610d7 100644 --- a/core/src/operations/fixed_shift_right.rs +++ b/core/src/operations/fixed_shift_right.rs @@ -1,3 +1,4 @@ +use p3_field::AbstractField; use p3_field::Field; use sp1_derive::AlignedBorrow; @@ -8,7 +9,6 @@ use crate::bytes::ByteLookupEvent; use crate::bytes::ByteOpcode; use crate::disassembler::WORD_SIZE; use crate::runtime::ExecutionRecord; -use p3_field::AbstractField; /// A set of columns needed to compute `>>` of a word with a fixed offset R. /// diff --git a/core/src/operations/is_equal_word.rs b/core/src/operations/is_equal_word.rs index 2871deb0ba..8a621a2147 100644 --- a/core/src/operations/is_equal_word.rs +++ b/core/src/operations/is_equal_word.rs @@ -1,11 +1,10 @@ use p3_field::Field; use sp1_derive::AlignedBorrow; +use super::IsZeroWordOperation; use crate::air::SP1AirBuilder; use crate::air::Word; -use super::IsZeroWordOperation; - /// A set of columns needed to compute the equality of two words. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] #[repr(C)] diff --git a/core/src/operations/is_zero_word.rs b/core/src/operations/is_zero_word.rs index 523def6008..ca3445d25c 100644 --- a/core/src/operations/is_zero_word.rs +++ b/core/src/operations/is_zero_word.rs @@ -6,12 +6,11 @@ use p3_air::AirBuilder; use p3_field::Field; use sp1_derive::AlignedBorrow; +use super::IsZeroOperation; use crate::air::SP1AirBuilder; use crate::air::Word; use crate::disassembler::WORD_SIZE; -use super::IsZeroOperation; - /// A set of columns needed to compute whether the given word is 0. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] #[repr(C)] diff --git a/core/src/operations/not.rs b/core/src/operations/not.rs index d7aa8859e1..58c2c2a804 100644 --- a/core/src/operations/not.rs +++ b/core/src/operations/not.rs @@ -1,4 +1,5 @@ use p3_air::AirBuilder; +use p3_field::AbstractField; use p3_field::Field; use sp1_derive::AlignedBorrow; @@ -7,7 +8,6 @@ use crate::air::Word; use crate::bytes::ByteOpcode; use crate::disassembler::WORD_SIZE; use crate::runtime::ExecutionRecord; -use p3_field::AbstractField; /// A set of columns needed to compute the not of a word. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] diff --git a/core/src/program/mod.rs b/core/src/program/mod.rs index 9fdd986468..ad25748967 100644 --- a/core/src/program/mod.rs +++ b/core/src/program/mod.rs @@ -1,11 +1,11 @@ use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; +use std::collections::HashMap; + use p3_air::{Air, BaseAir, PairBuilder}; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use std::collections::HashMap; - use sp1_derive::AlignedBorrow; use crate::air::MachineAir; @@ -15,7 +15,10 @@ use crate::cpu::columns::OpcodeSelectorCols; use crate::runtime::{ExecutionRecord, Program}; use crate::utils::pad_to_power_of_two; +/// The number of preprocessed program columns. pub const NUM_PROGRAM_PREPROCESSED_COLS: usize = size_of::>(); + +/// The number of columns for the program multiplicities. pub const NUM_PROGRAM_MULT_COLS: usize = size_of::>(); /// The column layout for the chip. diff --git a/core/src/runtime/instruction.rs b/core/src/runtime/instruction.rs index 2dff876f09..1fcf9a1950 100644 --- a/core/src/runtime/instruction.rs +++ b/core/src/runtime/instruction.rs @@ -1,7 +1,8 @@ -use super::Opcode; use core::fmt::Debug; use serde::{Deserialize, Serialize}; +use super::Opcode; + /// An instruction specifies an operation to execute and the operands. #[derive(Clone, Copy, Serialize, Deserialize)] pub struct Instruction { diff --git a/core/src/runtime/io.rs b/core/src/runtime/io.rs index 9cc912af86..8f9910fe87 100644 --- a/core/src/runtime/io.rs +++ b/core/src/runtime/io.rs @@ -1,7 +1,9 @@ -use super::Runtime; +use std::io::Read; + use serde::de::DeserializeOwned; use serde::Serialize; -use std::io::Read; + +use super::Runtime; impl Read for Runtime { fn read(&mut self, buf: &mut [u8]) -> std::io::Result { diff --git a/core/src/runtime/mod.rs b/core/src/runtime/mod.rs index dab0dfbe59..927e1a85b9 100644 --- a/core/src/runtime/mod.rs +++ b/core/src/runtime/mod.rs @@ -20,11 +20,6 @@ pub use state::*; pub use syscall::*; pub use utils::*; -use crate::memory::MemoryInitializeFinalizeEvent; -use crate::utils::env; -use crate::{alu::AluEvent, cpu::CpuEvent}; - -use nohash_hasher::BuildNoHashHasher; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::fs::File; @@ -33,6 +28,12 @@ use std::io::Write; use std::rc::Rc; use std::sync::Arc; +use nohash_hasher::BuildNoHashHasher; + +use crate::memory::MemoryInitializeFinalizeEvent; +use crate::utils::env; +use crate::{alu::AluEvent, cpu::CpuEvent}; + pub const MAX_SHARD_CLK: usize = (1 << 24) - 1; /// An implementation of a runtime for the SP1 VM. diff --git a/core/src/runtime/record.rs b/core/src/runtime/record.rs index c1bf6bc0eb..b6c2e45cb9 100644 --- a/core/src/runtime/record.rs +++ b/core/src/runtime/record.rs @@ -3,6 +3,10 @@ use std::collections::HashMap; use std::mem::take; use std::sync::Arc; +use itertools::Itertools; +use p3_field::AbstractField; +use serde::{Deserialize, Serialize}; + use super::program::Program; use super::Opcode; use crate::air::PublicValues; @@ -19,9 +23,6 @@ use crate::syscall::precompiles::keccak256::KeccakPermuteEvent; use crate::syscall::precompiles::sha256::{ShaCompressEvent, ShaExtendEvent}; use crate::syscall::precompiles::{ECAddEvent, ECDoubleEvent}; use crate::utils::env; -use itertools::Itertools; -use p3_field::AbstractField; -use serde::{Deserialize, Serialize}; /// A record of the execution of a program. Contains event data for everything that happened during /// the execution of the shard. diff --git a/core/src/runtime/syscall.rs b/core/src/runtime/syscall.rs index d18a77702c..18e23367cf 100644 --- a/core/src/runtime/syscall.rs +++ b/core/src/runtime/syscall.rs @@ -1,3 +1,8 @@ +use std::collections::HashMap; +use std::rc::Rc; + +use strum_macros::EnumIter; + use crate::runtime::{Register, Runtime}; use crate::syscall::precompiles::edwards::EdAddAssignChip; use crate::syscall::precompiles::edwards::EdDecompressChip; @@ -13,9 +18,6 @@ use crate::syscall::{ use crate::utils::ec::edwards::ed25519::{Ed25519, Ed25519Parameters}; use crate::utils::ec::weierstrass::{bn254::Bn254, secp256k1::Secp256k1}; use crate::{runtime::ExecutionRecord, runtime::MemoryReadRecord, runtime::MemoryWriteRecord}; -use std::collections::HashMap; -use std::rc::Rc; -use strum_macros::EnumIter; /// A system call is invoked by the the `ecall` instruction with a specific value in register t0. /// The syscall number is a 32-bit integer, with the following layout (in litte-endian format) diff --git a/core/src/runtime/utils.rs b/core/src/runtime/utils.rs index c1f98843e0..6f4feab738 100644 --- a/core/src/runtime/utils.rs +++ b/core/src/runtime/utils.rs @@ -1,6 +1,7 @@ +use std::io::Write; + use super::{Instruction, Runtime}; use crate::runtime::Register; -use std::io::Write; pub fn align(addr: u32) -> u32 { addr - addr % 4 diff --git a/core/src/stark/air.rs b/core/src/stark/air.rs index 1e2aef7cc9..5028b46785 100644 --- a/core/src/stark/air.rs +++ b/core/src/stark/air.rs @@ -1,13 +1,13 @@ +use p3_field::PrimeField32; + +use super::MachineStark; use crate::air::MachineAir; pub use crate::air::SP1AirBuilder; -use crate::memory::MemoryChipKind; +use crate::memory::MemoryChipType; use crate::stark::Chip; use crate::StarkGenericConfig; -use p3_field::PrimeField32; pub use riscv_chips::*; -use super::MachineStark; - /// A module for importing all the different RISC-V chips. pub(crate) mod riscv_chips { pub use crate::alu::AddSubChip; @@ -19,7 +19,7 @@ pub(crate) mod riscv_chips { pub use crate::alu::ShiftRightChip; pub use crate::bytes::ByteChip; pub use crate::cpu::CpuChip; - pub use crate::memory::MemoryGlobalChip; + pub use crate::memory::MemoryChip; pub use crate::program::ProgramChip; pub use crate::syscall::precompiles::blake3::Blake3CompressInnerChip; pub use crate::syscall::precompiles::edwards::EdAddAssignChip; @@ -65,11 +65,11 @@ pub enum RiscvAir { /// A lookup table for byte operations. ByteLookup(ByteChip), /// A table for initializing the memory state. - MemoryInit(MemoryGlobalChip), + MemoryInit(MemoryChip), /// A table for finalizing the memory state. - MemoryFinal(MemoryGlobalChip), + MemoryFinal(MemoryChip), /// A table for initializing the program memory. - ProgramMemory(MemoryGlobalChip), + ProgramMemory(MemoryChip), /// A precompile for sha256 extend. Sha256Extend(ShaExtendChip), /// A precompile for sha256 compress. @@ -147,11 +147,11 @@ impl RiscvAir { chips.push(RiscvAir::ShiftLeft(shift_left)); let lt = LtChip::default(); chips.push(RiscvAir::Lt(lt)); - let memory_init = MemoryGlobalChip::new(MemoryChipKind::Initialize); + let memory_init = MemoryChip::new(MemoryChipType::Initialize); chips.push(RiscvAir::MemoryInit(memory_init)); - let memory_finalize = MemoryGlobalChip::new(MemoryChipKind::Finalize); + let memory_finalize = MemoryChip::new(MemoryChipType::Finalize); chips.push(RiscvAir::MemoryFinal(memory_finalize)); - let program_memory_init = MemoryGlobalChip::new(MemoryChipKind::Program); + let program_memory_init = MemoryChip::new(MemoryChipType::Program); chips.push(RiscvAir::ProgramMemory(program_memory_init)); let byte = ByteChip::default(); chips.push(RiscvAir::ByteLookup(byte)); diff --git a/core/src/stark/debug.rs b/core/src/stark/debug.rs index 3da249a3d4..1111627b07 100644 --- a/core/src/stark/debug.rs +++ b/core/src/stark/debug.rs @@ -12,9 +12,8 @@ use p3_matrix::dense::RowMajorMatrixView; use p3_matrix::stack::VerticalPair; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use crate::air::{EmptyMessageBuilder, MachineAir, MultiTableAirBuilder}; - use super::{MachineChip, StarkGenericConfig, Val}; +use crate::air::{EmptyMessageBuilder, MachineAir, MultiTableAirBuilder}; /// Checks that the constraints of the given AIR are satisfied, including the permutation trace. /// diff --git a/core/src/stark/folder.rs b/core/src/stark/folder.rs index 59c5d2b72d..60cc63d3f7 100644 --- a/core/src/stark/folder.rs +++ b/core/src/stark/folder.rs @@ -3,14 +3,15 @@ use std::{ ops::{Add, Mul, MulAssign, Sub}, }; +use p3_field::{AbstractField, ExtensionField, Field}; +use p3_matrix::dense::RowMajorMatrixView; +use p3_matrix::stack::VerticalPair; + use super::{Challenge, PackedChallenge, PackedVal, StarkGenericConfig, Val}; use crate::air::{EmptyMessageBuilder, MultiTableAirBuilder}; use p3_air::{ AirBuilder, AirBuilderWithPublicValues, ExtensionBuilder, PairBuilder, PermutationAirBuilder, }; -use p3_field::{AbstractField, ExtensionField, Field}; -use p3_matrix::dense::RowMajorMatrixView; -use p3_matrix::stack::VerticalPair; /// A folder for prover constraints. pub struct ProverConstraintFolder<'a, SC: StarkGenericConfig> { diff --git a/core/src/stark/machine.rs b/core/src/stark/machine.rs index c9695eb0e2..ad5c193ae3 100644 --- a/core/src/stark/machine.rs +++ b/core/src/stark/machine.rs @@ -1,8 +1,19 @@ -use itertools::Itertools; -use p3_matrix::Dimensions; use std::cmp::Reverse; use std::collections::HashMap; +use itertools::Itertools; +use p3_air::Air; +use p3_challenger::CanObserve; +use p3_challenger::FieldChallenger; +use p3_commit::Pcs; +use p3_field::AbstractField; +use p3_field::Field; +use p3_field::PrimeField32; +use p3_matrix::dense::RowMajorMatrix; +use p3_matrix::Dimensions; +use p3_matrix::Matrix; +use p3_maybe_rayon::prelude::*; + use super::debug_constraints; use super::Dom; use crate::air::{MachineAir, SP1_PROOF_NUM_PV_ELTS}; @@ -15,17 +26,6 @@ use crate::stark::ProverConstraintFolder; use crate::stark::ShardProof; use crate::stark::VerifierConstraintFolder; -use p3_air::Air; -use p3_challenger::CanObserve; -use p3_challenger::FieldChallenger; -use p3_commit::Pcs; -use p3_field::AbstractField; -use p3_field::Field; -use p3_field::PrimeField32; -use p3_matrix::dense::RowMajorMatrix; -use p3_matrix::Matrix; -use p3_maybe_rayon::prelude::*; - use super::Chip; use super::Com; use super::PcsProverData; @@ -251,8 +251,6 @@ impl>> MachineStark { { // Observe the preprocessed commitment. challenger.observe(vk.commit.clone()); - // TODO: Observe the challenges in a tree-like structure for easily verifiable reconstruction - // in a map-reduce recursion setting. tracing::debug_span!("observe challenges for all shards").in_scope(|| { proof.shard_proofs.iter().for_each(|proof| { challenger.observe(proof.commitment.main_commit.clone()); diff --git a/core/src/stark/permutation.rs b/core/src/stark/permutation.rs index 2967b9fc37..85325afb1b 100644 --- a/core/src/stark/permutation.rs +++ b/core/src/stark/permutation.rs @@ -1,10 +1,11 @@ +use std::borrow::Borrow; + use itertools::Itertools; use p3_air::{ExtensionBuilder, PairBuilder}; use p3_field::{AbstractExtensionField, AbstractField, ExtensionField, Field, Powers, PrimeField}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::*; use rayon_scan::ScanParallelIterator; -use std::borrow::Borrow; use crate::{air::MultiTableAirBuilder, lookup::Interaction}; diff --git a/core/src/stark/prover.rs b/core/src/stark/prover.rs index e74fabbf92..7bbbe98e15 100644 --- a/core/src/stark/prover.rs +++ b/core/src/stark/prover.rs @@ -6,7 +6,6 @@ use std::sync::atomic::{AtomicU32, Ordering}; use std::time::Instant; use itertools::Itertools; - use p3_air::Air; use p3_challenger::{CanObserve, FieldChallenger}; use p3_commit::Pcs; @@ -24,13 +23,12 @@ use super::{quotient_values, MachineStark, PcsProverData, Val}; use super::{types::*, StarkGenericConfig}; use super::{Com, OpeningProof}; use super::{ProvingKey, VerifierConstraintFolder}; +use crate::air::{MachineAir, SP1_PROOF_NUM_PV_ELTS}; use crate::lookup::InteractionBuilder; use crate::stark::record::MachineRecord; use crate::stark::MachineChip; use crate::stark::PackedChallenge; use crate::stark::ProverConstraintFolder; - -use crate::air::{MachineAir, SP1_PROOF_NUM_PV_ELTS}; use crate::utils::env; fn chunk_vec(mut vec: Vec, chunk_size: usize) -> Vec> { diff --git a/core/src/stark/quotient.rs b/core/src/stark/quotient.rs index dfa3bf103e..9483627943 100644 --- a/core/src/stark/quotient.rs +++ b/core/src/stark/quotient.rs @@ -1,9 +1,3 @@ -use super::folder::ProverConstraintFolder; -use super::Chip; -use super::Domain; -use super::PackedChallenge; -use super::PackedVal; -use super::Val; use p3_air::Air; use p3_commit::PolynomialSpace; use p3_field::AbstractExtensionField; @@ -15,7 +9,13 @@ use p3_matrix::Matrix; use p3_maybe_rayon::prelude::*; use p3_util::log2_strict_usize; +use super::folder::ProverConstraintFolder; +use super::Chip; +use super::Domain; +use super::PackedChallenge; +use super::PackedVal; use super::StarkGenericConfig; +use super::Val; #[allow(clippy::too_many_arguments)] pub fn quotient_values( diff --git a/core/src/stark/types.rs b/core/src/stark/types.rs index ef0190018b..88ee740017 100644 --- a/core/src/stark/types.rs +++ b/core/src/stark/types.rs @@ -6,11 +6,10 @@ use std::{ use bincode::{deserialize_from, Error}; use p3_matrix::dense::RowMajorMatrix; -use size::Size; - use p3_matrix::dense::RowMajorMatrixView; use p3_matrix::stack::VerticalPair; use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use size::Size; use tracing::trace; use super::{Challenge, Com, OpeningProof, PcsProverData, StarkGenericConfig, Val}; diff --git a/core/src/stark/verifier.rs b/core/src/stark/verifier.rs index 75150ea54f..090141f348 100644 --- a/core/src/stark/verifier.rs +++ b/core/src/stark/verifier.rs @@ -1,6 +1,7 @@ -use super::Domain; -use crate::air::MachineAir; -use crate::stark::MachineChip; +use core::fmt::Display; +use std::fmt::Formatter; +use std::marker::PhantomData; + use itertools::Itertools; use p3_air::Air; use p3_challenger::CanObserve; @@ -11,16 +12,14 @@ use p3_commit::PolynomialSpace; use p3_field::AbstractExtensionField; use p3_field::AbstractField; -use std::fmt::Formatter; -use std::marker::PhantomData; - use super::folder::VerifierConstraintFolder; use super::types::*; +use super::Domain; use super::StarkGenericConfig; use super::Val; use super::VerifyingKey; - -use core::fmt::Display; +use crate::air::MachineAir; +use crate::stark::MachineChip; pub struct Verifier(PhantomData, PhantomData); diff --git a/core/src/syscall/precompiles/blake3/compress/air.rs b/core/src/syscall/precompiles/blake3/compress/air.rs index aa2ad08f69..6037d46791 100644 --- a/core/src/syscall/precompiles/blake3/compress/air.rs +++ b/core/src/syscall/precompiles/blake3/compress/air.rs @@ -1,3 +1,5 @@ +use core::borrow::Borrow; + use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::AbstractField; use p3_matrix::Matrix; @@ -11,8 +13,6 @@ use super::{ use crate::air::{BaseAirBuilder, SP1AirBuilder, WORD_SIZE}; use crate::runtime::SyscallCode; -use core::borrow::Borrow; - impl BaseAir for Blake3CompressInnerChip { fn width(&self) -> usize { NUM_BLAKE3_COMPRESS_INNER_COLS @@ -143,7 +143,7 @@ impl Blake3CompressInnerChip { // Read & write the state. for i in 0..NUM_STATE_WORDS_PER_CALL { - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk, local.state_ptr + local.state_index[i] * AB::F::from_canonical_usize(WORD_SIZE), @@ -179,7 +179,7 @@ impl Blake3CompressInnerChip { // Read the message. for i in 0..NUM_MSG_WORDS_PER_CALL { - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk, local.message_ptr + local.msg_schedule[i] * AB::F::from_canonical_usize(WORD_SIZE), diff --git a/core/src/syscall/precompiles/blake3/compress/g.rs b/core/src/syscall/precompiles/blake3/compress/g.rs index 17b5f633de..18b9eb8b6e 100644 --- a/core/src/syscall/precompiles/blake3/compress/g.rs +++ b/core/src/syscall/precompiles/blake3/compress/g.rs @@ -1,5 +1,4 @@ use p3_field::Field; - use sp1_derive::AlignedBorrow; use crate::air::SP1AirBuilder; diff --git a/core/src/syscall/precompiles/blake3/compress/trace.rs b/core/src/syscall/precompiles/blake3/compress/trace.rs index 9017a6adf0..206647873b 100644 --- a/core/src/syscall/precompiles/blake3/compress/trace.rs +++ b/core/src/syscall/precompiles/blake3/compress/trace.rs @@ -1,22 +1,20 @@ use std::borrow::BorrowMut; -use crate::runtime::ExecutionRecord; -use crate::runtime::MemoryRecordEnum; -use crate::runtime::Program; -use crate::syscall::precompiles::blake3::compress::columns::NUM_BLAKE3_COMPRESS_INNER_COLS; -use crate::syscall::precompiles::blake3::{Blake3CompressInnerChip, ROUND_COUNT}; -use crate::utils::pad_rows; - use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; -use crate::air::MachineAir; - use super::columns::Blake3CompressInnerCols; use super::{ G_INDEX, G_INPUT_SIZE, MSG_SCHEDULE, NUM_MSG_WORDS_PER_CALL, NUM_STATE_WORDS_PER_CALL, OPERATION_COUNT, }; +use crate::air::MachineAir; +use crate::runtime::ExecutionRecord; +use crate::runtime::MemoryRecordEnum; +use crate::runtime::Program; +use crate::syscall::precompiles::blake3::compress::columns::NUM_BLAKE3_COMPRESS_INNER_COLS; +use crate::syscall::precompiles::blake3::{Blake3CompressInnerChip, ROUND_COUNT}; +use crate::utils::pad_rows; impl MachineAir for Blake3CompressInnerChip { type Record = ExecutionRecord; diff --git a/core/src/syscall/precompiles/edwards/ed_add.rs b/core/src/syscall/precompiles/edwards/ed_add.rs index b94af72fac..6bf9a7d4b5 100644 --- a/core/src/syscall/precompiles/edwards/ed_add.rs +++ b/core/src/syscall/precompiles/edwards/ed_add.rs @@ -1,3 +1,21 @@ +use core::borrow::{Borrow, BorrowMut}; +use core::mem::size_of; +use std::fmt::Debug; +use std::marker::PhantomData; + +use num::BigUint; +use num::Zero; +use p3_air::AirBuilder; +use p3_air::{Air, BaseAir}; +use p3_field::AbstractField; +use p3_field::PrimeField32; +use p3_matrix::dense::RowMajorMatrix; +use p3_matrix::Matrix; +use p3_maybe_rayon::prelude::IntoParallelRefIterator; +use p3_maybe_rayon::prelude::ParallelIterator; +use sp1_derive::AlignedBorrow; +use tracing::instrument; + use crate::air::MachineAir; use crate::air::SP1AirBuilder; use crate::bytes::ByteLookupEvent; @@ -21,22 +39,6 @@ use crate::utils::ec::AffinePoint; use crate::utils::ec::EllipticCurve; use crate::utils::limbs_from_prev_access; use crate::utils::pad_rows; -use core::borrow::{Borrow, BorrowMut}; -use core::mem::size_of; -use num::BigUint; -use num::Zero; -use p3_air::AirBuilder; -use p3_air::{Air, BaseAir}; -use p3_field::AbstractField; -use p3_field::PrimeField32; -use p3_matrix::dense::RowMajorMatrix; -use p3_matrix::Matrix; -use p3_maybe_rayon::prelude::IntoParallelRefIterator; -use p3_maybe_rayon::prelude::ParallelIterator; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; -use std::marker::PhantomData; -use tracing::instrument; pub const NUM_ED_ADD_COLS: usize = size_of::>(); @@ -258,7 +260,7 @@ where } for i in 0..16 { - builder.constraint_memory_access( + builder.eval_memory_access( row.shard, row.clk, // clk + 0 -> Memory row.q_ptr + AB::F::from_canonical_u32(i * 4), @@ -267,7 +269,7 @@ where ); } for i in 0..16 { - builder.constraint_memory_access( + builder.eval_memory_access( row.shard, row.clk + AB::F::from_canonical_u32(1), // The clk for p is moved by 1. row.p_ptr + AB::F::from_canonical_u32(i * 4), diff --git a/core/src/syscall/precompiles/edwards/ed_decompress.rs b/core/src/syscall/precompiles/edwards/ed_decompress.rs index 49f2575ebf..9b5a673b1f 100644 --- a/core/src/syscall/precompiles/edwards/ed_decompress.rs +++ b/core/src/syscall/precompiles/edwards/ed_decompress.rs @@ -1,3 +1,23 @@ +use core::borrow::{Borrow, BorrowMut}; +use core::mem::size_of; +use std::marker::PhantomData; + +use curve25519_dalek::edwards::CompressedEdwardsY; +use generic_array::GenericArray; +use num::BigUint; +use num::One; +use num::Zero; +use p3_air::{Air, AirBuilder, BaseAir}; +use p3_field::AbstractField; +use p3_field::PrimeField32; +use p3_matrix::dense::RowMajorMatrix; +use p3_matrix::Matrix; +use serde::Deserialize; +use serde::Serialize; +use sp1_derive::AlignedBorrow; +use typenum::Unsigned; +use typenum::U32; + use crate::air::BaseAirBuilder; use crate::air::MachineAir; use crate::air::SP1AirBuilder; @@ -28,26 +48,6 @@ use crate::utils::limbs_from_access; use crate::utils::limbs_from_prev_access; use crate::utils::pad_rows; use crate::utils::words_to_bytes_le; -use core::borrow::{Borrow, BorrowMut}; -use core::mem::size_of; -use curve25519_dalek::edwards::CompressedEdwardsY; -use generic_array::GenericArray; -use num::BigUint; -use num::One; -use num::Zero; -use p3_air::{Air, AirBuilder, BaseAir}; -use p3_field::AbstractField; -use p3_field::PrimeField32; -use p3_matrix::Matrix; -use serde::Deserialize; -use serde::Serialize; -use std::marker::PhantomData; -use typenum::Unsigned; -use typenum::U32; - -use p3_matrix::dense::RowMajorMatrix; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct EdDecompressEvent { @@ -166,7 +166,7 @@ impl EdDecompressCols { ); for i in 0..NUM_WORDS_FIELD_ELEMENT { - builder.constraint_memory_access( + builder.eval_memory_access( self.shard, self.clk, self.ptr.into() + AB::F::from_canonical_u32((i as u32) * 4), @@ -175,7 +175,7 @@ impl EdDecompressCols { ); } for i in 0..NUM_WORDS_FIELD_ELEMENT { - builder.constraint_memory_access( + builder.eval_memory_access( self.shard, self.clk, self.ptr.into() + AB::F::from_canonical_u32((i as u32) * 4 + 32), diff --git a/core/src/syscall/precompiles/k256/decompress.rs b/core/src/syscall/precompiles/k256/decompress.rs index 9d3c9170e9..f7c46ee443 100644 --- a/core/src/syscall/precompiles/k256/decompress.rs +++ b/core/src/syscall/precompiles/k256/decompress.rs @@ -1,3 +1,23 @@ +use core::borrow::{Borrow, BorrowMut}; +use core::mem::size_of; +use std::fmt::Debug; +use std::str::FromStr; + +use elliptic_curve::sec1::ToEncodedPoint; +use elliptic_curve::subtle::Choice; +use k256::elliptic_curve::point::DecompressPoint; +use num::BigUint; +use num::Zero; +use p3_air::AirBuilder; +use p3_air::{Air, BaseAir}; +use p3_field::AbstractField; +use p3_field::PrimeField32; +use p3_matrix::dense::RowMajorMatrix; +use p3_matrix::Matrix; +use serde::{Deserialize, Serialize}; +use sp1_derive::AlignedBorrow; +use typenum::U32; + use crate::air::BaseAirBuilder; use crate::air::MachineAir; use crate::air::SP1AirBuilder; @@ -16,7 +36,6 @@ use crate::runtime::Syscall; use crate::runtime::SyscallCode; use crate::syscall::precompiles::SyscallContext; use crate::utils::bytes_to_words_le; - use crate::utils::ec::field::FieldParameters; use crate::utils::ec::weierstrass::secp256k1::secp256k1_sqrt; use crate::utils::ec::weierstrass::secp256k1::Secp256k1BaseField; @@ -29,25 +48,6 @@ use crate::utils::limbs_from_access; use crate::utils::limbs_from_prev_access; use crate::utils::pad_rows; use crate::utils::words_to_bytes_le; -use core::borrow::{Borrow, BorrowMut}; -use core::mem::size_of; -use elliptic_curve::sec1::ToEncodedPoint; -use elliptic_curve::subtle::Choice; -use k256::elliptic_curve::point::DecompressPoint; -use num::BigUint; -use num::Zero; -use p3_air::AirBuilder; -use p3_air::{Air, BaseAir}; -use p3_field::AbstractField; -use p3_field::PrimeField32; -use p3_matrix::Matrix; -use serde::{Deserialize, Serialize}; -use std::str::FromStr; -use typenum::U32; - -use p3_matrix::dense::RowMajorMatrix; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct K256DecompressEvent { @@ -245,7 +245,7 @@ impl K256DecompressCols { .assert_all_eq(self.neg_y.result, y_limbs); for i in 0..NUM_WORDS_FIELD_ELEMENT { - builder.constraint_memory_access( + builder.eval_memory_access( self.shard, self.clk, self.ptr.into() + AB::F::from_canonical_u32((i as u32) * 4 + 32), @@ -254,7 +254,7 @@ impl K256DecompressCols { ); } for i in 0..NUM_WORDS_FIELD_ELEMENT { - builder.constraint_memory_access( + builder.eval_memory_access( self.shard, self.clk, self.ptr.into() + AB::F::from_canonical_u32((i as u32) * 4), diff --git a/core/src/syscall/precompiles/keccak256/air.rs b/core/src/syscall/precompiles/keccak256/air.rs index 4fdd699826..4e648f181f 100644 --- a/core/src/syscall/precompiles/keccak256/air.rs +++ b/core/src/syscall/precompiles/keccak256/air.rs @@ -5,17 +5,16 @@ use p3_field::AbstractField; use p3_keccak_air::{KeccakAir, NUM_KECCAK_COLS, NUM_ROUNDS, U64_LIMBS}; use p3_matrix::Matrix; +use super::{ + columns::{KeccakMemCols, NUM_KECCAK_MEM_COLS}, + KeccakPermuteChip, STATE_NUM_WORDS, STATE_SIZE, +}; use crate::{ air::{SP1AirBuilder, SubAirBuilder}, memory::MemoryCols, runtime::SyscallCode, }; -use super::{ - columns::{KeccakMemCols, NUM_KECCAK_MEM_COLS}, - KeccakPermuteChip, STATE_NUM_WORDS, STATE_SIZE, -}; - impl BaseAir for KeccakPermuteChip { fn width(&self) -> usize { NUM_KECCAK_MEM_COLS @@ -33,7 +32,7 @@ where let local: &KeccakMemCols = (*local).borrow(); let next: &KeccakMemCols = (*next).borrow(); - // Constrain memory in the first and last cycles + // Constrain memory in the first and last cycles. builder.assert_eq( (local.keccak.step_flags[0] + local.keccak.step_flags[23]) * local.is_real, local.do_memory_check, @@ -41,7 +40,7 @@ where // Constrain memory for i in 0..STATE_NUM_WORDS as u32 { - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + local.keccak.step_flags[23], // The clk increments by 1 when step_flags[23] == 1 local.state_addr + AB::Expr::from_canonical_u32(i * 4), diff --git a/core/src/syscall/precompiles/keccak256/execute.rs b/core/src/syscall/precompiles/keccak256/execute.rs index b2a334d5c1..bf30c43a9f 100644 --- a/core/src/syscall/precompiles/keccak256/execute.rs +++ b/core/src/syscall/precompiles/keccak256/execute.rs @@ -1,12 +1,11 @@ +use p3_keccak_air::{NUM_ROUNDS, RC}; + +use super::{KeccakPermuteChip, STATE_NUM_WORDS, STATE_SIZE}; use crate::{ runtime::Syscall, syscall::precompiles::{keccak256::KeccakPermuteEvent, SyscallContext}, }; -use p3_keccak_air::{NUM_ROUNDS, RC}; - -use super::{KeccakPermuteChip, STATE_NUM_WORDS, STATE_SIZE}; - const RHO: [u32; 24] = [ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14, 27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44, ]; diff --git a/core/src/syscall/precompiles/keccak256/mod.rs b/core/src/syscall/precompiles/keccak256/mod.rs index 1d1a4c1aa3..f0b0a71144 100644 --- a/core/src/syscall/precompiles/keccak256/mod.rs +++ b/core/src/syscall/precompiles/keccak256/mod.rs @@ -1,12 +1,13 @@ -use crate::runtime::{MemoryReadRecord, MemoryWriteRecord}; -use p3_keccak_air::KeccakAir; -use serde::{Deserialize, Serialize}; - mod air; pub mod columns; mod execute; mod trace; +use p3_keccak_air::KeccakAir; +use serde::{Deserialize, Serialize}; + +use crate::runtime::{MemoryReadRecord, MemoryWriteRecord}; + pub(crate) const STATE_SIZE: usize = 25; // The permutation state is 25 u64's. Our word size is 32 bits, so it is 50 words. diff --git a/core/src/syscall/precompiles/keccak256/trace.rs b/core/src/syscall/precompiles/keccak256/trace.rs index c74db4e03b..0df22b6d05 100644 --- a/core/src/syscall/precompiles/keccak256/trace.rs +++ b/core/src/syscall/precompiles/keccak256/trace.rs @@ -1,6 +1,5 @@ use std::borrow::BorrowMut; -use crate::{runtime::Program, stark::MachineRecord}; use p3_field::PrimeField32; use p3_keccak_air::{generate_trace_rows, NUM_KECCAK_COLS, NUM_ROUNDS}; use p3_matrix::dense::RowMajorMatrix; @@ -8,6 +7,8 @@ use p3_matrix::Matrix; use p3_maybe_rayon::prelude::{ParallelIterator, ParallelSlice}; use tracing::instrument; +use crate::{runtime::Program, stark::MachineRecord}; + use crate::{air::MachineAir, runtime::ExecutionRecord}; use super::{ diff --git a/core/src/syscall/precompiles/mod.rs b/core/src/syscall/precompiles/mod.rs index bc2cbca9c1..893b329733 100644 --- a/core/src/syscall/precompiles/mod.rs +++ b/core/src/syscall/precompiles/mod.rs @@ -8,7 +8,6 @@ pub mod weierstrass; use serde::{Deserialize, Serialize}; use crate::runtime::SyscallContext; - use crate::utils::ec::{AffinePoint, EllipticCurve}; use crate::{runtime::MemoryReadRecord, runtime::MemoryWriteRecord}; diff --git a/core/src/syscall/precompiles/sha256/compress/air.rs b/core/src/syscall/precompiles/sha256/compress/air.rs index a6c95a8261..b80d8148c9 100644 --- a/core/src/syscall/precompiles/sha256/compress/air.rs +++ b/core/src/syscall/precompiles/sha256/compress/air.rs @@ -1,5 +1,8 @@ +use core::borrow::Borrow; + use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::AbstractField; +use p3_matrix::Matrix; use super::columns::{ShaCompressCols, NUM_SHA_COMPRESS_COLS}; use super::{ShaCompressChip, SHA_COMPRESS_K}; @@ -10,8 +13,6 @@ use crate::operations::{ XorOperation, }; use crate::runtime::SyscallCode; -use core::borrow::Borrow; -use p3_matrix::Matrix; impl BaseAir for ShaCompressChip { fn width(&self) -> usize { @@ -29,13 +30,13 @@ where let local: &ShaCompressCols = (*local).borrow(); let next: &ShaCompressCols = (*next).borrow(); - self.constrain_control_flow_flags(builder, local, next); + self.eval_control_flow_flags(builder, local, next); - self.constrain_memory(builder, local); + self.eval_memory(builder, local); - self.constrain_compression_ops(builder, local); + self.eval_compression_ops(builder, local, next); - self.constrain_finalize_ops(builder, local); + self.eval_finalize_ops(builder, local); builder.assert_eq( local.start, @@ -53,17 +54,17 @@ where } impl ShaCompressChip { - fn constrain_control_flow_flags( + fn eval_control_flow_flags( &self, builder: &mut AB, local: &ShaCompressCols, next: &ShaCompressCols, ) { - // Constrain octet columns // Verify that all of the octet columns are bool. for i in 0..8 { builder.assert_bool(local.octet[i]); } + // Verify that exactly one of the octet columns is true. let mut octet_sum = AB::Expr::zero(); for i in 0..8 { @@ -86,7 +87,6 @@ impl ShaCompressChip { .assert_one(next.octet[(i + 1) % 8]) } - // Constrain octet_num columns // Verify that all of the octet_num columns are bool. for i in 0..10 { builder.assert_bool(local.octet_num[i]); @@ -99,7 +99,6 @@ impl ShaCompressChip { } builder.when(local.is_real).assert_one(octet_num_sum); - // Verify that the first row's octet_num value is correct. // The first row should have octet_num[0] = 1 if it's real. builder .when_first_row() @@ -138,6 +137,7 @@ impl ShaCompressChip { .when_transition() .when(local.octet_num[0] + local.octet_num[9] * (AB::Expr::one() - local.octet[7])) .assert_word_eq(*var, next_vars[i]); + // When column is read from memory during init, is should be equal to the memory value. builder .when_transition() @@ -158,30 +158,38 @@ impl ShaCompressChip { + local.octet_num[8], ); - let is_last_row = local.is_real - (local.octet[7] * local.octet_num[9]); + builder.assert_eq( + local.is_last_row.into(), + local.octet[7] * local.octet_num[9], + ); // If this row is real and not the last cycle, then next row should have same inputs builder .when_transition() - .when(is_last_row.clone()) + .when(local.is_real) + .when_not(local.is_last_row) .assert_eq(local.shard, next.shard); builder .when_transition() - .when(is_last_row.clone()) + .when(local.is_real) + .when_not(local.is_last_row) .assert_eq(local.clk, next.clk); builder .when_transition() - .when(is_last_row.clone()) + .when(local.is_real) + .when_not(local.is_last_row) .assert_eq(local.w_ptr, next.w_ptr); builder .when_transition() - .when(is_last_row.clone()) + .when(local.is_real) + .when_not(local.is_last_row) .assert_eq(local.h_ptr, next.h_ptr); // If this row is real and not the last cycle, then next row should also be real. builder .when_transition() - .when(is_last_row) + .when(local.is_real) + .when_not(local.is_last_row) .assert_one(next.is_real); // Assert that the table ends in nonreal columns. Since each compress ecall is 80 cycles and @@ -190,14 +198,10 @@ impl ShaCompressChip { } /// Constrains that memory address is correct and that memory is correctly written/read. - fn constrain_memory( - &self, - builder: &mut AB, - local: &ShaCompressCols, - ) { + fn eval_memory(&self, builder: &mut AB, local: &ShaCompressCols) { let is_initialize = local.octet_num[0]; let is_finalize = local.octet_num[9]; - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + is_finalize, local.mem_addr, @@ -265,10 +269,11 @@ impl ShaCompressChip { .assert_word_eq(*local.mem.value(), local.finalize_add.value); } - fn constrain_compression_ops( + fn eval_compression_ops( &self, builder: &mut AB, local: &ShaCompressCols, + next: &ShaCompressCols, ) { // Constrain k column which loops over 64 constant values. for i in 0..64 { @@ -501,9 +506,50 @@ impl ShaCompressChip { local.shard, local.is_compression.into(), ); + + // h := g + // g := f + // f := e + // e := d + temp1 + // d := c + // c := b + // b := a + // a := temp1 + temp2 + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.h, local.g); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.g, local.f); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.f, local.e); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.e, local.d_add_temp1.value); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.d, local.c); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.c, local.b); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.b, local.a); + builder + .when_transition() + .when(local.is_compression) + .assert_word_eq(next.a, local.temp1_add_temp2.value); } - fn constrain_finalize_ops( + fn eval_finalize_ops( &self, builder: &mut AB, local: &ShaCompressCols, diff --git a/core/src/syscall/precompiles/sha256/compress/columns.rs b/core/src/syscall/precompiles/sha256/compress/columns.rs index 4b0180a867..cf990e0385 100644 --- a/core/src/syscall/precompiles/sha256/compress/columns.rs +++ b/core/src/syscall/precompiles/sha256/compress/columns.rs @@ -102,6 +102,7 @@ pub struct ShaCompressCols { pub finalize_add: AddOperation, pub is_compression: T, + pub is_last_row: T, pub is_real: T, } diff --git a/core/src/syscall/precompiles/sha256/compress/execute.rs b/core/src/syscall/precompiles/sha256/compress/execute.rs index 5f4bf66e00..72ee312a5e 100644 --- a/core/src/syscall/precompiles/sha256/compress/execute.rs +++ b/core/src/syscall/precompiles/sha256/compress/execute.rs @@ -1,3 +1,4 @@ +use super::ShaCompressChip; use crate::{ runtime::Syscall, syscall::precompiles::{ @@ -6,8 +7,6 @@ use crate::{ }, }; -use super::ShaCompressChip; - impl Syscall for ShaCompressChip { fn num_extra_cycles(&self) -> u32 { 1 diff --git a/core/src/syscall/precompiles/sha256/compress/mod.rs b/core/src/syscall/precompiles/sha256/compress/mod.rs index 731b689d2c..e95669cee4 100644 --- a/core/src/syscall/precompiles/sha256/compress/mod.rs +++ b/core/src/syscall/precompiles/sha256/compress/mod.rs @@ -1,11 +1,12 @@ -use crate::runtime::{MemoryReadRecord, MemoryWriteRecord}; -use serde::{Deserialize, Serialize}; - mod air; mod columns; mod execute; mod trace; +use serde::{Deserialize, Serialize}; + +use crate::runtime::{MemoryReadRecord, MemoryWriteRecord}; + pub const SHA_COMPRESS_K: [u32; 64] = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, diff --git a/core/src/syscall/precompiles/sha256/compress/trace.rs b/core/src/syscall/precompiles/sha256/compress/trace.rs index 27b76e9037..ea4f1a1976 100644 --- a/core/src/syscall/precompiles/sha256/compress/trace.rs +++ b/core/src/syscall/precompiles/sha256/compress/trace.rs @@ -3,17 +3,16 @@ use std::borrow::BorrowMut; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; +use super::{ + columns::{ShaCompressCols, NUM_SHA_COMPRESS_COLS}, + ShaCompressChip, SHA_COMPRESS_K, +}; use crate::{ air::{MachineAir, Word}, runtime::{ExecutionRecord, Program}, utils::pad_rows, }; -use super::{ - columns::{ShaCompressCols, NUM_SHA_COMPRESS_COLS}, - ShaCompressChip, SHA_COMPRESS_K, -}; - impl MachineAir for ShaCompressChip { type Record = ExecutionRecord; @@ -210,6 +209,7 @@ impl MachineAir for ShaCompressChip { }; cols.is_real = F::one(); + cols.is_last_row = cols.octet[7] * cols.octet_num[9]; cols.start = cols.is_real * cols.octet_num[0] * cols.octet[0]; rows.push(row); diff --git a/core/src/syscall/precompiles/sha256/extend/air.rs b/core/src/syscall/precompiles/sha256/extend/air.rs index 8a9f368ffb..6058afd3d3 100644 --- a/core/src/syscall/precompiles/sha256/extend/air.rs +++ b/core/src/syscall/precompiles/sha256/extend/air.rs @@ -48,7 +48,7 @@ where .assert_eq(local.w_ptr, next.w_ptr); // Read w[i-15]. - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + (local.i - i_start), local.w_ptr + (local.i - AB::F::from_canonical_u32(15)) * nb_bytes_in_word, @@ -57,7 +57,7 @@ where ); // Read w[i-2]. - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + (local.i - i_start), local.w_ptr + (local.i - AB::F::from_canonical_u32(2)) * nb_bytes_in_word, @@ -66,7 +66,7 @@ where ); // Read w[i-16]. - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + (local.i - i_start), local.w_ptr + (local.i - AB::F::from_canonical_u32(16)) * nb_bytes_in_word, @@ -75,7 +75,7 @@ where ); // Read w[i-7]. - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + (local.i - i_start), local.w_ptr + (local.i - AB::F::from_canonical_u32(7)) * nb_bytes_in_word, @@ -190,7 +190,7 @@ where ); // Write `s2` to `w[i]`. - builder.constraint_memory_access( + builder.eval_memory_access( local.shard, local.clk + (local.i - i_start), local.w_ptr + local.i * nb_bytes_in_word, diff --git a/core/src/syscall/precompiles/sha256/extend/columns.rs b/core/src/syscall/precompiles/sha256/extend/columns.rs index 45428192d3..a4197ce7f5 100644 --- a/core/src/syscall/precompiles/sha256/extend/columns.rs +++ b/core/src/syscall/precompiles/sha256/extend/columns.rs @@ -22,14 +22,19 @@ pub struct ShaExtendCols { /// Control flags. pub i: T, + /// g^n where g is generator with order 16 and n is the row number. pub cycle_16: T, + /// Checks whether current row is start of a 16-row cycle. Bool result is stored in `result`. pub cycle_16_start: IsZeroOperation, + /// Checks whether current row is end of a 16-row cycle. Bool result is stored in `result`. pub cycle_16_end: IsZeroOperation, + /// Flags for when in the first, second, or third 16-row cycle. pub cycle_48: [T; 3], + /// Whether the current row is the first of a 48-row cycle. pub cycle_48_start: T, pub cycle_48_end: T, @@ -40,6 +45,7 @@ pub struct ShaExtendCols { pub w_i_minus_15_rr_18: FixedRotateRightOperation, pub w_i_minus_15_rs_3: FixedShiftRightOperation, pub s0_intermediate: XorOperation, + /// `s0 := (w[i-15] rightrotate 7) xor (w[i-15] rightrotate 18) xor (w[i-15] rightshift 3)`. pub s0: XorOperation, @@ -49,12 +55,14 @@ pub struct ShaExtendCols { pub w_i_minus_2_rr_19: FixedRotateRightOperation, pub w_i_minus_2_rs_10: FixedShiftRightOperation, pub s1_intermediate: XorOperation, + /// `s1 := (w[i-2] rightrotate 17) xor (w[i-2] rightrotate 19) xor (w[i-2] rightshift 10)`. pub s1: XorOperation, /// Inputs to `s2`. pub w_i_minus_16: MemoryReadCols, pub w_i_minus_7: MemoryReadCols, + /// `w[i] := w[i-16] + s0 + w[i-7] + s1`. pub s2: Add4Operation, diff --git a/core/src/syscall/precompiles/sha256/extend/flags.rs b/core/src/syscall/precompiles/sha256/extend/flags.rs index 97bbdfda35..2f97dc92fc 100644 --- a/core/src/syscall/precompiles/sha256/extend/flags.rs +++ b/core/src/syscall/precompiles/sha256/extend/flags.rs @@ -48,12 +48,18 @@ impl ShaExtendChip { let next: &ShaExtendCols = (*next).borrow(); let one = AB::Expr::from(AB::F::one()); + // Generator with order 16 within BabyBear. let g = AB::F::from_canonical_u32(BabyBear::two_adic_generator(4).as_canonical_u32()); // First row of the table must have g^1. builder.when_first_row().assert_eq(local.cycle_16, g); + // First row of the table must have i = 16. + builder + .when_first_row() + .assert_eq(local.i, AB::F::from_canonical_u32(16)); + // Every row's `cycle_16` must be previous multiplied by `g`. builder .when_transition() @@ -116,6 +122,7 @@ impl ShaExtendChip { .when_transition() .when(local.cycle_16_end.result * local.cycle_48[2]) .assert_eq(next.i, AB::F::from_canonical_u32(16)); + // When it's not the end of a 16-cycle, the next `i` must be the current plus one. builder .when_transition() diff --git a/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs b/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs index 94db555eb6..8ee8ce7c4d 100644 --- a/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs +++ b/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs @@ -1,3 +1,20 @@ +use core::borrow::{Borrow, BorrowMut}; +use core::mem::size_of; +use std::fmt::Debug; +use std::marker::PhantomData; + +use generic_array::GenericArray; +use num::BigUint; +use num::Zero; +use p3_air::AirBuilder; +use p3_air::{Air, BaseAir}; +use p3_field::AbstractField; +use p3_field::PrimeField32; +use p3_matrix::dense::RowMajorMatrix; +use p3_matrix::Matrix; +use sp1_derive::AlignedBorrow; +use typenum::Unsigned; + use crate::air::MachineAir; use crate::air::SP1AirBuilder; use crate::memory::MemoryCols; @@ -21,21 +38,6 @@ use crate::utils::ec::CurveType; use crate::utils::ec::EllipticCurve; use crate::utils::limbs_from_prev_access; use crate::utils::pad_rows; -use core::borrow::{Borrow, BorrowMut}; -use core::mem::size_of; -use generic_array::GenericArray; -use num::BigUint; -use num::Zero; -use p3_air::AirBuilder; -use p3_air::{Air, BaseAir}; -use p3_field::AbstractField; -use p3_field::PrimeField32; -use p3_matrix::dense::RowMajorMatrix; -use p3_matrix::Matrix; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; -use std::marker::PhantomData; -use typenum::Unsigned; pub const fn num_weierstrass_add_cols() -> usize { size_of::>() @@ -323,14 +325,14 @@ where .assert_eq(row.y3_ins.result[i], row.p_access[8 + i / 4].value()[i % 4]); } - builder.constraint_memory_access_slice( + builder.eval_memory_access_slice( row.shard, row.clk.into(), row.q_ptr, &row.q_access, row.is_real, ); - builder.constraint_memory_access_slice( + builder.eval_memory_access_slice( row.shard, row.clk + AB::F::from_canonical_u32(1), // We read p at +1 since p, q could be the same. row.p_ptr, diff --git a/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs b/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs index ab212664dc..4ef835a53d 100644 --- a/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs +++ b/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs @@ -1,3 +1,22 @@ +use core::borrow::{Borrow, BorrowMut}; +use core::mem::size_of; +use std::fmt::Debug; +use std::marker::PhantomData; + +use generic_array::GenericArray; +use num::BigUint; +use num::Zero; +use p3_air::AirBuilder; +use p3_air::{Air, BaseAir}; +use p3_field::AbstractField; +use p3_field::PrimeField32; +use p3_matrix::dense::RowMajorMatrix; +use p3_matrix::Matrix; +use p3_maybe_rayon::prelude::ParallelIterator; +use p3_maybe_rayon::prelude::ParallelSlice; +use sp1_derive::AlignedBorrow; +use tracing::instrument; + use crate::air::MachineAir; use crate::air::SP1AirBuilder; use crate::memory::MemoryCols; @@ -22,23 +41,6 @@ use crate::utils::ec::EllipticCurve; use crate::utils::ec::NUM_WORDS_FIELD_ELEMENT; use crate::utils::limbs_from_prev_access; use crate::utils::pad_rows; -use core::borrow::{Borrow, BorrowMut}; -use core::mem::size_of; -use generic_array::GenericArray; -use num::BigUint; -use num::Zero; -use p3_air::AirBuilder; -use p3_air::{Air, BaseAir}; -use p3_field::AbstractField; -use p3_field::PrimeField32; -use p3_matrix::dense::RowMajorMatrix; -use p3_matrix::Matrix; -use p3_maybe_rayon::prelude::ParallelIterator; -use p3_maybe_rayon::prelude::ParallelSlice; -use sp1_derive::AlignedBorrow; -use std::fmt::Debug; -use std::marker::PhantomData; -use tracing::instrument; pub const fn num_weierstrass_double_cols() -> usize { size_of::>() @@ -367,7 +369,7 @@ where ); } - builder.constraint_memory_access_slice( + builder.eval_memory_access_slice( row.shard, row.clk.into(), row.p_ptr, diff --git a/core/src/utils/ec/edwards/ed25519.rs b/core/src/utils/ec/edwards/ed25519.rs index be584eaf8d..8a2e317eef 100644 --- a/core/src/utils/ec/edwards/ed25519.rs +++ b/core/src/utils/ec/edwards/ed25519.rs @@ -1,8 +1,9 @@ +use std::str::FromStr; + use curve25519_dalek::edwards::CompressedEdwardsY; use generic_array::GenericArray; use num::{BigUint, Num, One}; use serde::{Deserialize, Serialize}; -use std::str::FromStr; use typenum::{U32, U62}; use crate::utils::ec::edwards::{EdwardsCurve, EdwardsParameters}; diff --git a/core/src/utils/ec/edwards/mod.rs b/core/src/utils/ec/edwards/mod.rs index dae8927975..d07a2fa4da 100644 --- a/core/src/utils/ec/edwards/mod.rs +++ b/core/src/utils/ec/edwards/mod.rs @@ -4,11 +4,10 @@ use generic_array::GenericArray; use num::{BigUint, Zero}; use serde::{Deserialize, Serialize}; -use crate::utils::ec::field::FieldParameters; -use crate::utils::ec::{AffinePoint, EllipticCurve, EllipticCurveParameters}; - use super::field::NumLimbs; use super::CurveType; +use crate::utils::ec::field::FieldParameters; +use crate::utils::ec::{AffinePoint, EllipticCurve, EllipticCurveParameters}; pub trait EdwardsParameters: EllipticCurveParameters { const D: GenericArray::Limbs>; diff --git a/core/src/utils/ec/field.rs b/core/src/utils/ec/field.rs index f1920cbcba..e853c71738 100644 --- a/core/src/utils/ec/field.rs +++ b/core/src/utils/ec/field.rs @@ -1,15 +1,17 @@ -use super::utils::biguint_from_limbs; -use crate::operations::field::params::{Limbs, NB_BITS_PER_LIMB}; +use std::fmt::Debug; +use std::ops::Div; + use generic_array::sequence::GenericSequence; use generic_array::{ArrayLength, GenericArray}; use num::BigUint; use p3_field::Field; use serde::{de::DeserializeOwned, Serialize}; -use std::fmt::Debug; -use std::ops::Div; use typenum::Unsigned; use typenum::{U2, U4}; +use super::utils::biguint_from_limbs; +use crate::operations::field::params::{Limbs, NB_BITS_PER_LIMB}; + pub trait FieldParameters: Send + Sync + Copy + 'static + Debug + Serialize + DeserializeOwned + NumLimbs { diff --git a/core/src/utils/ec/mod.rs b/core/src/utils/ec/mod.rs index 7491a6e095..6be5e35257 100644 --- a/core/src/utils/ec/mod.rs +++ b/core/src/utils/ec/mod.rs @@ -4,15 +4,15 @@ pub mod scalar_mul; pub mod utils; pub mod weierstrass; -use field::FieldParameters; -use num::BigUint; -use serde::{de::DeserializeOwned, Serialize}; use std::fmt::{Debug, Display, Formatter, Result}; use std::ops::{Add, Neg}; -use crate::air::WORD_SIZE; +use field::FieldParameters; +use num::BigUint; +use serde::{de::DeserializeOwned, Serialize}; use self::field::NumWords; +use crate::air::WORD_SIZE; pub const NUM_WORDS_FIELD_ELEMENT: usize = 8; pub const NUM_BYTES_FIELD_ELEMENT: usize = NUM_WORDS_FIELD_ELEMENT * WORD_SIZE; diff --git a/core/src/utils/ec/weierstrass/mod.rs b/core/src/utils/ec/weierstrass/mod.rs index ed33b778aa..ac4146b478 100644 --- a/core/src/utils/ec/weierstrass/mod.rs +++ b/core/src/utils/ec/weierstrass/mod.rs @@ -2,13 +2,12 @@ use generic_array::GenericArray; use num::{BigUint, Zero}; use serde::{Deserialize, Serialize}; +use super::field::NumLimbs; +use super::CurveType; use crate::utils::ec::field::FieldParameters; use crate::utils::ec::utils::biguint_to_bits_le; use crate::utils::ec::{AffinePoint, EllipticCurve, EllipticCurveParameters}; -use super::field::NumLimbs; -use super::CurveType; - pub mod bn254; pub mod secp256k1; diff --git a/core/src/utils/ec/weierstrass/secp256k1.rs b/core/src/utils/ec/weierstrass/secp256k1.rs index d534c59ce6..5dbb0d4ff0 100644 --- a/core/src/utils/ec/weierstrass/secp256k1.rs +++ b/core/src/utils/ec/weierstrass/secp256k1.rs @@ -4,6 +4,9 @@ use std::str::FromStr; use generic_array::GenericArray; +use k256::FieldElement; +use num::traits::FromBytes; +use num::traits::ToBytes; use num::{BigUint, Zero}; use serde::{Deserialize, Serialize}; use typenum::{U32, U62}; @@ -13,9 +16,6 @@ use crate::utils::ec::field::FieldParameters; use crate::utils::ec::field::NumLimbs; use crate::utils::ec::CurveType; use crate::utils::ec::EllipticCurveParameters; -use k256::FieldElement; -use num::traits::FromBytes; -use num::traits::ToBytes; #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] /// Secp256k1 curve parameter diff --git a/core/src/utils/prove.rs b/core/src/utils/prove.rs index 476f4c53f0..a757293de5 100644 --- a/core/src/utils/prove.rs +++ b/core/src/utils/prove.rs @@ -2,6 +2,13 @@ use std::fs::File; use std::io::{Seek, Write}; use std::time::Instant; +pub use baby_bear_blake3::BabyBearBlake3; +use p3_challenger::CanObserve; +use p3_field::PrimeField32; +use serde::de::DeserializeOwned; +use serde::Serialize; +use size::Size; + use crate::air::SP1_PROOF_NUM_PV_ELTS; use crate::runtime::{ExecutionRecord, ShardingConfig}; use crate::stark::MachineRecord; @@ -15,13 +22,6 @@ use crate::{ }; use crate::{SP1ProofWithIO, SP1PublicValues, SP1Stdin}; -pub use baby_bear_blake3::BabyBearBlake3; -use p3_challenger::CanObserve; - -use p3_field::PrimeField32; -use serde::de::DeserializeOwned; -use serde::Serialize; -use size::Size; const LOG_DEGREE_BOUND: usize = 31; diff --git a/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf b/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf index d6a60bfc7b40e345280b4f704367ab08b7698f4c..6ca90dc0cd21b062dd84df4a1441bd1f3bc3ba0a 100755 GIT binary patch delta 27691 zcmb__3w#ts@_+Xv8;J5q2nitxWH$-#5cd7RND|3HkSHK1ARz3MpeP7YLBI_{5Ck-^ zV55Kn0*8tUg633|AVhqCf{!~?6p)9gsBq#P_mjK*e`|IoyIH_+cmMf(hTd;ib#+yB zb#>2719jhDyXX6BYqb2t65X5*>xVH$cRa(D#281>_Gix8w#s2`m+Z3f`mO)`B8e~G z_G$7X%}|VLe+>_|&+O19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8wVg zk3mDJ+o;p&_=p$TgI>I6a~sW8D{99}Gn?5FjK(^bba@)k+jM4|&WM=|W7ULd(qNZk zu}%%rh)BWYdjl21HH8Uy3uxAP3?6GKp888{R@r0UtY+B>Zi~%>=|orJvEUzH!=f&V zbmINiu=IF+sl|f1vDD<$yW!9h{@@xmH(qCRm6n=HEcOzYrBsi(AZ9J|W}93dtIpyv zVw-`{XqQL2#csit2Xj023>cwSld*EsTDFVcG!k#n25I0#MxysdLejKdr?2E``$n#+ zXMbT#dZnfAzc)geJN{b@URSPN9x4B=3RkXP_g|~repKP&V3 z|KJRHrmbH?yf@s%>;LzW99rD|x+UJfdYI7vfAEGf58uQL?}Xes2b%tW4RS>2&4S!p z|GCld-$%I;Z8(FtY?wh;(Q zdx_5I!uxawSHHuO_)o90N8$~546&IkSS(DKqfJ)s-Ne*+b?@P2k6>aqTP+r|0sBGh z$aQ$qsQhvhJF7}J;;@?ZcAL&>wqa4iJL2dmxO?Iag!s~JtbMw?Kf6hO?#&Cz6TyuN z_IQS+S9aOXPW9k%KeL|rmk;~@j1N*5e}^9i`S_oiRwezPnD}yWD}E%;wFuBKO5d%BC8#pMjYS6r5GA1L! diff --git a/examples/ssz-withdrawals/script/Cargo.lock b/examples/ssz-withdrawals/script/Cargo.lock index b09b3b3c49..d7b2013cee 100644 --- a/examples/ssz-withdrawals/script/Cargo.lock +++ b/examples/ssz-withdrawals/script/Cargo.lock @@ -40,9 +40,397 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "alloy" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-contract", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-provider", + "alloy-rpc-client", + "alloy-serde", + "alloy-signer", + "alloy-signer-wallet", + "alloy-transport-http", + "reqwest 0.12.3", +] + +[[package]] +name = "alloy-consensus" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "serde", + "sha2", +] + +[[package]] +name = "alloy-contract" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network", + "alloy-primitives", + "alloy-provider", + "alloy-rpc-types", + "alloy-sol-types", + "alloy-transport", + "futures", + "futures-util", + "thiserror", +] + +[[package]] +name = "alloy-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbd9ee412dfb4e81d23cd1ae816d828c494a77d1eb00358035043695d4c5808" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872f239c15befa27cc4f0d3d82a70b3365c2d0202562bf906eb93b299fa31882" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow 0.6.6", +] + +[[package]] +name = "alloy-eips" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "c-kzg", + "once_cell", + "serde", +] + +[[package]] +name = "alloy-genesis" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-json-abi" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a35ddfd27576474322a5869e4c123e5f3e7b2177297c18e4e82ea501cb125b" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-network" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-primitives", + "alloy-rpc-types", + "alloy-signer", + "async-trait", + "futures-utils-wasm", + "serde", + "thiserror", +] + +[[package]] +name = "alloy-primitives" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99bbad0a6b588ef4aec1b5ddbbfdacd9ef04e00b979617765b03174318ee1f3a" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-provider" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-json-rpc", + "alloy-network", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-rpc-types-trace", + "alloy-transport", + "alloy-transport-http", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "futures", + "lru", + "reqwest 0.12.3", + "serde_json", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "alloy-transport-http", + "futures", + "pin-project", + "reqwest 0.12.3", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-genesis", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types", + "itertools 0.12.1", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-rpc-types-trace" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types", + "alloy-serde", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-serde" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-signer-wallet" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "async-trait", + "k256", + "rand", + "thiserror", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "452d929748ac948a10481fff4123affead32c553cf362841c5103dd508bdfc16" +dependencies = [ + "alloy-json-abi", + "alloy-sol-macro-input", + "const-hex", + "heck 0.4.1", + "indexmap 2.2.6", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.58", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df64e094f6d2099339f9e82b5b38440b159757b6920878f28316243f8166c8d1" +dependencies = [ + "alloy-json-abi", + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.58", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "715f4d09a330cc181fc7c361b5c5c2766408fa59a0bac60349dcb7baabd404cc" +dependencies = [ + "winnow 0.6.6", +] + +[[package]] +name = "alloy-sol-types" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43bc2d6dfc2a19fd56644494479510f98b1ee929e04cf0d4aa45e98baa3e545b" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-transport" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-json-rpc", + "base64 0.22.0", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "url", + "wasm-bindgen-futures", +] + +[[package]] +name = "alloy-transport-http" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy?rev=bfd0fda#bfd0fda492e560c3463d521958793c81bbeadfc1" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest 0.12.3", + "serde_json", + "tower", + "url", +] [[package]] name = "android-tzdata" @@ -83,44 +471,168 @@ dependencies = [ ] [[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" dependencies = [ - "utf8parse", + "ark-std 0.3.0", + "digest 0.9.0", ] [[package]] -name = "anstyle-query" -version = "1.0.2" +name = "ark-serialize" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "windows-sys 0.52.0", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", ] [[package]] -name = "anstyle-wincon" -version = "3.0.2" +name = "ark-std" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ - "anstyle", - "windows-sys 0.52.0", + "num-traits", + "rand", ] [[package]] -name = "anyhow" -version = "1.0.81" +name = "ark-std" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] [[package]] name = "arrayref" @@ -134,11 +646,44 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + +[[package]] +name = "auto_impl" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", @@ -233,6 +778,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64ct" version = "1.6.0" @@ -248,6 +799,21 @@ dependencies = [ "serde", ] +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -300,17 +866,58 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "blst" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +dependencies = [ + "serde", +] + +[[package]] +name = "c-kzg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3130f3d8717cc02e668a896af24984d5d5d4e8bf12e278e982e0f1bd88a0f9af" +dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "serde", +] [[package]] name = "camino" @@ -338,7 +945,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.22", "serde", "serde_json", "thiserror", @@ -346,9 +953,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" [[package]] name = "cfg-if" @@ -366,7 +973,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -428,6 +1035,19 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "const-hex" +version = "1.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -440,6 +1060,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.4" @@ -529,16 +1155,16 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "fiat-crypto", "platforms", - "rustc_version", + "rustc_version 0.4.0", "subtle", "zeroize", ] @@ -628,6 +1254,39 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "digest" version = "0.10.7" @@ -640,11 +1299,23 @@ dependencies = [ "subtle", ] +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dunce" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "ecdsa" @@ -653,7 +1324,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", @@ -662,9 +1333,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elf" @@ -680,7 +1351,7 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest", + "digest 0.10.7", "ff", "generic-array 0.14.7", "group", @@ -700,9 +1371,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -741,6 +1412,17 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" @@ -754,9 +1436,21 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" + +[[package]] +name = "fixed-hash" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] [[package]] name = "fixedbitset" @@ -899,6 +1593,18 @@ dependencies = [ "slab", ] +[[package]] +name = "futures-utils-wasm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" + +[[package]] +name = "gcd" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a" + [[package]] name = "generic-array" version = "0.14.7" @@ -921,9 +1627,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -936,6 +1642,12 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -1024,6 +1736,15 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hickory-proto" @@ -1076,7 +1797,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -1200,6 +1921,7 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", + "want", ] [[package]] @@ -1229,6 +1951,22 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.2.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.3" @@ -1236,6 +1974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" dependencies = [ "bytes", + "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", @@ -1243,6 +1982,9 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -1294,6 +2036,26 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1347,7 +2109,7 @@ dependencies = [ "socket2", "widestring", "windows-sys 0.48.0", - "winreg", + "winreg 0.50.0", ] [[package]] @@ -1356,6 +2118,15 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.11.0" @@ -1403,6 +2174,16 @@ dependencies = [ "signature", ] +[[package]] +name = "keccak-asm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1449,6 +2230,15 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.3", +] + [[package]] name = "lru-cache" version = "0.1.2" @@ -1557,9 +2347,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" dependencies = [ "num-bigint", "num-complex", @@ -1634,6 +2424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1661,7 +2452,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -1741,7 +2532,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "p3-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "p3-field", "p3-matrix", @@ -1750,7 +2541,7 @@ dependencies = [ [[package]] name = "p3-baby-bear" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "num-bigint", "p3-field", @@ -1764,7 +2555,7 @@ dependencies = [ [[package]] name = "p3-blake3" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "blake3", "p3-symmetric", @@ -1773,7 +2564,7 @@ dependencies = [ [[package]] name = "p3-challenger" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -1785,7 +2576,7 @@ dependencies = [ [[package]] name = "p3-commit" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -1798,7 +2589,7 @@ dependencies = [ [[package]] name = "p3-dft" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "p3-field", "p3-matrix", @@ -1810,7 +2601,7 @@ dependencies = [ [[package]] name = "p3-field" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "num-bigint", @@ -1823,7 +2614,7 @@ dependencies = [ [[package]] name = "p3-fri" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "p3-challenger", @@ -1841,7 +2632,7 @@ dependencies = [ [[package]] name = "p3-goldilocks" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "num-bigint", "p3-dft", @@ -1857,7 +2648,7 @@ dependencies = [ [[package]] name = "p3-interpolation" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "p3-field", "p3-matrix", @@ -1867,7 +2658,7 @@ dependencies = [ [[package]] name = "p3-keccak" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "p3-symmetric", "tiny-keccak", @@ -1876,7 +2667,7 @@ dependencies = [ [[package]] name = "p3-keccak-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "p3-air", "p3-field", @@ -1888,7 +2679,7 @@ dependencies = [ [[package]] name = "p3-matrix" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "p3-field", @@ -1902,7 +2693,7 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "rayon", ] @@ -1910,7 +2701,7 @@ dependencies = [ [[package]] name = "p3-mds" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.11.0", "p3-dft", @@ -1924,7 +2715,7 @@ dependencies = [ [[package]] name = "p3-merkle-tree" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "p3-commit", @@ -1940,9 +2731,11 @@ dependencies = [ [[package]] name = "p3-poseidon2" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ + "gcd", "p3-field", + "p3-mds", "p3-symmetric", "rand", ] @@ -1950,7 +2743,7 @@ dependencies = [ [[package]] name = "p3-symmetric" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "p3-field", @@ -1960,7 +2753,7 @@ dependencies = [ [[package]] name = "p3-uni-stark" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" dependencies = [ "itertools 0.12.1", "p3-air", @@ -1978,11 +2771,37 @@ dependencies = [ [[package]] name = "p3-util" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#7e4f7afedeffbc49c9c123e21f29e0eb1a9b2227" +source = "git+https://github.com/Plonky3/Plonky3.git?branch=sp1#c1edbc59b9b227f94f3bb409fc1e5939721857fd" +dependencies = [ + "serde", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", "serde", ] +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +dependencies = [ + "proc-macro-crate 2.0.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -2016,7 +2835,18 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] [[package]] name = "petgraph" @@ -2100,6 +2930,17 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2107,7 +2948,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", ] [[package]] @@ -2119,6 +2994,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.5.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.3", + "rusty-fork", + "tempfile", + "unarray", +] + [[package]] name = "prost" version = "0.12.4" @@ -2159,9 +3054,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2202,6 +3097,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + [[package]] name = "rayon" version = "1.10.0" @@ -2281,7 +3185,7 @@ version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -2292,7 +3196,7 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -2303,7 +3207,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -2318,7 +3222,46 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" +dependencies = [ + "base64 0.22.0", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.2.0", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.1.2", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.52.0", ] [[package]] @@ -2330,7 +3273,7 @@ dependencies = [ "anyhow", "async-trait", "http 0.2.12", - "reqwest", + "reqwest 0.11.27", "serde", "task-local-extensions", "thiserror", @@ -2371,6 +3314,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + [[package]] name = "rrs-lib" version = "0.1.0" @@ -2381,19 +3334,64 @@ dependencies = [ "paste", ] +[[package]] +name = "ruint" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" + [[package]] name = "rustc-demangle" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.22", ] [[package]] @@ -2427,9 +3425,25 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64", + "base64 0.21.7", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.0", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -2442,9 +3456,21 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" + +[[package]] +name = "rusty-fork" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] [[package]] name = "ryu" @@ -2514,6 +3540,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.22" @@ -2523,6 +3558,15 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "serde" version = "1.0.197" @@ -2582,7 +3626,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" dependencies = [ - "base64", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", @@ -2639,7 +3683,17 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha3-asm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" +dependencies = [ + "cc", + "cfg-if", ] [[package]] @@ -2666,7 +3720,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", + "digest 0.10.7", "rand_core", ] @@ -2798,10 +3852,12 @@ dependencies = [ name = "sp1-sdk" version = "0.1.0" dependencies = [ + "alloy", "anyhow", "async-trait", "axum", "bincode", + "dotenv", "futures", "hex", "indicatif", @@ -2811,7 +3867,7 @@ dependencies = [ "p3-matrix", "prost", "prost-types", - "reqwest", + "reqwest 0.11.27", "reqwest-middleware", "serde", "serde_json", @@ -2861,6 +3917,12 @@ dependencies = [ "sp1-sdk", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.10.0" @@ -2920,6 +3982,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4497156948bd342b52038035a6fa514a89626e37af9d2c52a5e8d8ebcc7ee479" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -3004,11 +4078,20 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -3027,9 +4110,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -3109,6 +4192,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -3125,9 +4220,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" @@ -3137,7 +4232,18 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.6", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", ] [[package]] @@ -3252,7 +4358,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "twirp" version = "0.3.0" -source = "git+https://github.com/github/twirp-rs.git#6f90763c9bbea7529ab6a54edcf923ae2611cc69" +source = "git+https://github.com/github/twirp-rs.git#90244e417d27bf9233e96de37bbab8121e983020" dependencies = [ "async-trait", "axum", @@ -3262,7 +4368,7 @@ dependencies = [ "http-body-util", "hyper 1.2.0", "prost", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -3277,6 +4383,30 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicase" version = "2.7.0" @@ -3354,6 +4484,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "want" version = "0.3.1" @@ -3453,9 +4592,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -3485,7 +4624,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -3503,7 +4642,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -3523,17 +4662,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -3544,9 +4684,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -3556,9 +4696,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -3568,9 +4708,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -3580,9 +4726,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -3592,9 +4738,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -3604,9 +4750,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -3616,9 +4762,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" @@ -3629,6 +4775,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -3639,6 +4794,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wyz" version = "0.5.1" @@ -3673,3 +4838,17 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] diff --git a/recursion/circuit/src/domain.rs b/recursion/circuit/src/domain.rs index 31b549277b..148ef76b50 100644 --- a/recursion/circuit/src/domain.rs +++ b/recursion/circuit/src/domain.rs @@ -94,7 +94,6 @@ where } } - // TODO: something is wrong with this function fn zp_at_point( &self, builder: &mut Builder, diff --git a/recursion/compiler/src/ir/bits.rs b/recursion/compiler/src/ir/bits.rs index 7655a5f348..7df2f0e5e5 100644 --- a/recursion/compiler/src/ir/bits.rs +++ b/recursion/compiler/src/ir/bits.rs @@ -16,7 +16,10 @@ impl Builder { self.assign(sum, sum + bit * C::N::from_canonical_u32(1 << i)); } + // TODO: There is an edge case where the witnessed bits may slightly overflow and cause + // the output to be incorrect. This is a known issue and will be fixed in the future. self.assert_var_eq(sum, num); + output } @@ -46,7 +49,9 @@ impl Builder { }); } - // self.assert_felt_eq(sum, num); + // TODO: There is an edge case where the witnessed bits may slightly overflow and cause + // the output to be incorrect. This is a known issue and will be fixed in the future. + self.assert_felt_eq(sum, num); output } diff --git a/recursion/compiler/src/ir/builder.rs b/recursion/compiler/src/ir/builder.rs index e51c781f69..5f07b12f93 100644 --- a/recursion/compiler/src/ir/builder.rs +++ b/recursion/compiler/src/ir/builder.rs @@ -1,12 +1,13 @@ use std::{iter::Zip, vec::IntoIter}; +use backtrace::Backtrace; +use p3_field::AbstractField; +use sp1_recursion_core::runtime::PV_BUFFER_MAX_SIZE; + use super::{ Array, Config, DslIr, Ext, Felt, FromConstant, SymbolicExt, SymbolicFelt, SymbolicUsize, SymbolicVar, Usize, Var, Variable, }; -use backtrace::Backtrace; -use p3_field::AbstractField; -use sp1_recursion_core::runtime::PV_BUFFER_MAX_SIZE; /// TracedVec is a Vec wrapper that records a trace whenever an element is pushed. When extending /// from another TracedVec, the traces are copied over.