Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions core/src/air/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ pub trait BaseAirBuilder: AirBuilder + MessageBuilder<AirInteraction<Self::Expr>
/// A trait which contains methods for byte interactions in an AIR.
pub trait ByteAirBuilder: BaseAirBuilder {
/// Sends a byte operation to be processed.

fn send_byte(
&mut self,
opcode: impl Into<Self::Expr>,
Expand All @@ -112,7 +111,6 @@ pub trait ByteAirBuilder: BaseAirBuilder {
}

/// Sends a byte operation with two outputs to be processed.

fn send_byte_pair(
&mut self,
opcode: impl Into<Self::Expr>,
Expand Down Expand Up @@ -140,7 +138,6 @@ pub trait ByteAirBuilder: BaseAirBuilder {
}

/// Receives a byte operation to be processed.

fn receive_byte(
&mut self,
opcode: impl Into<Self::Expr>,
Expand All @@ -164,7 +161,6 @@ pub trait ByteAirBuilder: BaseAirBuilder {
}

/// Receives a byte operation with two outputs to be processed.

fn receive_byte_pair(
&mut self,
opcode: impl Into<Self::Expr>,
Expand Down Expand Up @@ -303,7 +299,6 @@ pub trait WordAirBuilder: ByteAirBuilder {
/// A trait which contains methods related to ALU interactions in an AIR.
pub trait AluAirBuilder: BaseAirBuilder {
/// Sends an ALU operation to be processed.

fn send_alu(
&mut self,
opcode: impl Into<Self::Expr>,
Expand Down Expand Up @@ -332,7 +327,6 @@ pub trait AluAirBuilder: BaseAirBuilder {
}

/// Receives an ALU operation to be processed.

fn receive_alu(
&mut self,
opcode: impl Into<Self::Expr>,
Expand Down Expand Up @@ -361,7 +355,6 @@ pub trait AluAirBuilder: BaseAirBuilder {
}

/// Sends an syscall operation to be processed (with "ECALL" opcode).

fn send_syscall(
&mut self,
shard: impl Into<Self::Expr> + Clone,
Expand Down Expand Up @@ -389,7 +382,6 @@ pub trait AluAirBuilder: BaseAirBuilder {
}

/// Receives a syscall operation to be processed.

fn receive_syscall(
&mut self,
shard: impl Into<Self::Expr> + Clone,
Expand Down Expand Up @@ -712,7 +704,7 @@ pub trait SphinxAirBuilder:
{
}

impl<'a, AB: AirBuilder + MessageBuilder<M>, M> MessageBuilder<M> for FilteredAirBuilder<'a, AB> {
impl<AB: AirBuilder + MessageBuilder<M>, M> MessageBuilder<M> for FilteredAirBuilder<'_, AB> {
fn send(&mut self, message: M) {
self.inner.send(message);
}
Expand All @@ -732,10 +724,10 @@ impl<AB: BaseAirBuilder> ExtensionAirBuilder for AB {}
impl<AB: BaseAirBuilder + AirBuilderWithPublicValues> MachineAirBuilder for AB {}
impl<AB: BaseAirBuilder + AirBuilderWithPublicValues> SphinxAirBuilder for AB {}

impl<'a, SC: StarkGenericConfig> EmptyMessageBuilder for ProverConstraintFolder<'a, SC> {}
impl<'a, SC: StarkGenericConfig> EmptyMessageBuilder for VerifierConstraintFolder<'a, SC> {}
impl<SC: StarkGenericConfig> EmptyMessageBuilder for ProverConstraintFolder<'_, SC> {}
impl<SC: StarkGenericConfig> EmptyMessageBuilder for VerifierConstraintFolder<'_, SC> {}
impl<F: Field> EmptyMessageBuilder for SymbolicAirBuilder<F> {}

#[cfg(debug_assertions)]
#[cfg(not(doctest))]
impl<'a, F: Field> EmptyMessageBuilder for p3_uni_stark::DebugConstraintBuilder<'a, F> {}
impl<F: Field> EmptyMessageBuilder for p3_uni_stark::DebugConstraintBuilder<'_, F> {}
4 changes: 2 additions & 2 deletions core/src/air/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
}
}

impl<'a, T, R, U, F> EventLens<U> for Proj<'a, T, R, F>
impl<T, R, U, F> EventLens<U> for Proj<'_, T, R, F>
where
T: for<'b> WithEvents<'b>,
R: EventLens<T>,
Expand All @@ -71,7 +71,7 @@ where
}
}

impl<'a, T, R, F> Indexed for Proj<'a, T, R, F>
impl<T, R, F> Indexed for Proj<'_, T, R, F>
where
T: for<'b> WithEvents<'b>,
R: EventLens<T> + Indexed,
Expand Down
7 changes: 5 additions & 2 deletions core/src/air/sub_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ impl<M: Matrix<T>, T: Send + Sync> SubMatrixRowSlices<M, T> {

/// Implement `Matrix` for `SubMatrixRowSlices`.
impl<M: Matrix<T>, T: Send + Sync> Matrix<T> for SubMatrixRowSlices<M, T> {
type Row<'a> = Skip<Take<M::Row<'a>>> where Self: 'a;
type Row<'a>
= Skip<Take<M::Row<'a>>>
where
Self: 'a;

#[inline]
fn row(&self, r: usize) -> Self::Row<'_> {
Expand Down Expand Up @@ -69,7 +72,7 @@ impl<'a, AB: AirBuilder, SubAir: BaseAir<T>, T> SubAirBuilder<'a, AB, SubAir, T>
}

/// Implement `AirBuilder` for `SubAirBuilder`.
impl<'a, AB: AirBuilder, SubAir: BaseAir<F>, F> AirBuilder for SubAirBuilder<'a, AB, SubAir, F> {
impl<AB: AirBuilder, SubAir: BaseAir<F>, F> AirBuilder for SubAirBuilder<'_, AB, SubAir, F> {
type F = AB::F;
type Expr = AB::Expr;
type Var = AB::Var;
Expand Down
2 changes: 1 addition & 1 deletion core/src/memory/columns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct MemoryAccessCols<T> {
/// The following columns are decomposed limbs for the difference between the current access's timestamp
/// and the previous access's timestamp. Note the actual value of the timestamp is either the
/// accesses' shard or clk depending on the value of compare_clk.

///
/// This column is the least significant 16 bit limb of current access timestamp - prev access timestamp.
pub diff_16bit_limb: T,

Expand Down
1 change: 0 additions & 1 deletion core/src/operations/field/field_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ impl<F: PrimeField32, P: FieldParameters> FieldOpCols<F, P> {

/// Populate these columns with a specified modulus. This is useful in the `mulmod` precompile
/// as an example.

pub fn populate_with_modulus(
&mut self,
record: &mut impl ByteRecord,
Expand Down
4 changes: 2 additions & 2 deletions core/src/runtime/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl<'a> HookRegistry<'a> {
}
}

impl<'a> Default for HookRegistry<'a> {
impl Default for HookRegistry<'_> {
fn default() -> Self {
// When `LazyCell` gets stabilized (1.81.0), we can use it to avoid unnecessary allocations.
let table = HashMap::from([
Expand All @@ -80,7 +80,7 @@ impl<'a> Default for HookRegistry<'a> {
}
}

impl<'a> Debug for HookRegistry<'a> {
impl Debug for HookRegistry<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut keys = self.table.keys().collect::<Vec<_>>();
keys.sort_unstable();
Expand Down
4 changes: 2 additions & 2 deletions core/src/runtime/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ use serde::Serialize;

use super::Runtime;

impl<'a> Read for Runtime<'a> {
impl Read for Runtime<'_> {
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
self.read_public_values_slice(buf);
Ok(buf.len())
}
}

impl<'a> Runtime<'a> {
impl Runtime<'_> {
pub fn write_stdin<T: Serialize>(&mut self, input: &T) {
let mut buf = Vec::new();
bincode::serialize_into(&mut buf, input).expect("serialization failed");
Expand Down
2 changes: 1 addition & 1 deletion core/src/runtime/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ macro_rules! assert_valid_memory_access {
};
}

impl<'a> Runtime<'a> {
impl Runtime<'_> {
#[inline]
pub fn log(&mut self, instruction: &Instruction) {
// Write the current program counter to the trace buffer for the cycle tracer.
Expand Down
17 changes: 7 additions & 10 deletions core/src/stark/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub struct DebugConstraintBuilder<'a, F: Field, EF: ExtensionField<F>> {
pub(crate) public_values: &'a [F],
}

impl<'a, F, EF> ExtensionBuilder for DebugConstraintBuilder<'a, F, EF>
impl<F, EF> ExtensionBuilder for DebugConstraintBuilder<'_, F, EF>
where
F: Field,
EF: ExtensionField<F>,
Expand Down Expand Up @@ -174,7 +174,7 @@ where
}
}

impl<'a, F, EF> PairBuilder for DebugConstraintBuilder<'a, F, EF>
impl<F, EF> PairBuilder for DebugConstraintBuilder<'_, F, EF>
where
F: Field,
EF: ExtensionField<F>,
Expand All @@ -184,7 +184,7 @@ where
}
}

impl<'a, F, EF> DebugConstraintBuilder<'a, F, EF>
impl<F, EF> DebugConstraintBuilder<'_, F, EF>
where
F: Field,
EF: ExtensionField<F>,
Expand Down Expand Up @@ -252,7 +252,7 @@ where
}
}

impl<'a, F, EF> MultiTableAirBuilder for DebugConstraintBuilder<'a, F, EF>
impl<F, EF> MultiTableAirBuilder for DebugConstraintBuilder<'_, F, EF>
where
F: Field,
EF: ExtensionField<F>,
Expand All @@ -264,13 +264,10 @@ where
}
}

impl<'a, F: Field, EF: ExtensionField<F>> EmptyMessageBuilder
for DebugConstraintBuilder<'a, F, EF>
{
}
impl<F: Field, EF: ExtensionField<F>> EmptyMessageBuilder for DebugConstraintBuilder<'_, F, EF> {}

impl<'a, F: Field, EF: ExtensionField<F>> AirBuilderWithPublicValues
for DebugConstraintBuilder<'a, F, EF>
impl<F: Field, EF: ExtensionField<F>> AirBuilderWithPublicValues
for DebugConstraintBuilder<'_, F, EF>
{
type PublicVar = F;

Expand Down
30 changes: 15 additions & 15 deletions core/src/stark/folder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<'a, SC: StarkGenericConfig> AirBuilder for ProverConstraintFolder<'a, SC> {
}
}

impl<'a, SC: StarkGenericConfig> ExtensionBuilder for ProverConstraintFolder<'a, SC> {
impl<SC: StarkGenericConfig> ExtensionBuilder for ProverConstraintFolder<'_, SC> {
type EF = SC::Challenge;

type ExprEF = PackedChallenge<SC>;
Expand Down Expand Up @@ -100,23 +100,23 @@ impl<'a, SC: StarkGenericConfig> PermutationAirBuilder for ProverConstraintFolde
}
}

impl<'a, SC: StarkGenericConfig> MultiTableAirBuilder for ProverConstraintFolder<'a, SC> {
impl<SC: StarkGenericConfig> MultiTableAirBuilder for ProverConstraintFolder<'_, SC> {
type Sum = PackedChallenge<SC>;

fn cumulative_sum(&self) -> Self::Sum {
PackedChallenge::<SC>::from_f(self.cumulative_sum)
}
}

impl<'a, SC: StarkGenericConfig> PairBuilder for ProverConstraintFolder<'a, SC> {
impl<SC: StarkGenericConfig> PairBuilder for ProverConstraintFolder<'_, SC> {
fn preprocessed(&self) -> Self::M {
self.preprocessed
}
}

impl<'a, SC: StarkGenericConfig> EmptyMessageBuilder for ProverConstraintFolder<'a, SC> {}
impl<SC: StarkGenericConfig> EmptyMessageBuilder for ProverConstraintFolder<'_, SC> {}

impl<'a, SC: StarkGenericConfig> AirBuilderWithPublicValues for ProverConstraintFolder<'a, SC> {
impl<SC: StarkGenericConfig> AirBuilderWithPublicValues for ProverConstraintFolder<'_, SC> {
type PublicVar = Self::F;

fn public_values(&self) -> &[Self::PublicVar] {
Expand Down Expand Up @@ -210,8 +210,8 @@ where
}
}

impl<'a, F, EF, PubVar, Var, Expr> ExtensionBuilder
for GenericVerifierConstraintFolder<'a, F, EF, PubVar, Var, Expr>
impl<F, EF, PubVar, Var, Expr> ExtensionBuilder
for GenericVerifierConstraintFolder<'_, F, EF, PubVar, Var, Expr>
where
F: Field,
EF: ExtensionField<F>,
Expand Down Expand Up @@ -292,8 +292,8 @@ where
}
}

impl<'a, F, EF, PubVar, Var, Expr> MultiTableAirBuilder
for GenericVerifierConstraintFolder<'a, F, EF, PubVar, Var, Expr>
impl<F, EF, PubVar, Var, Expr> MultiTableAirBuilder
for GenericVerifierConstraintFolder<'_, F, EF, PubVar, Var, Expr>
where
F: Field,
EF: ExtensionField<F>,
Expand Down Expand Up @@ -328,8 +328,8 @@ where
}
}

impl<'a, F, EF, PubVar, Var, Expr> PairBuilder
for GenericVerifierConstraintFolder<'a, F, EF, PubVar, Var, Expr>
impl<F, EF, PubVar, Var, Expr> PairBuilder
for GenericVerifierConstraintFolder<'_, F, EF, PubVar, Var, Expr>
where
F: Field,
EF: ExtensionField<F>,
Expand Down Expand Up @@ -362,8 +362,8 @@ where
}
}

impl<'a, F, EF, PubVar, Var, Expr> EmptyMessageBuilder
for GenericVerifierConstraintFolder<'a, F, EF, PubVar, Var, Expr>
impl<F, EF, PubVar, Var, Expr> EmptyMessageBuilder
for GenericVerifierConstraintFolder<'_, F, EF, PubVar, Var, Expr>
where
F: Field,
EF: ExtensionField<F>,
Expand Down Expand Up @@ -393,8 +393,8 @@ where
{
}

impl<'a, F, EF, PubVar, Var, Expr> AirBuilderWithPublicValues
for GenericVerifierConstraintFolder<'a, F, EF, PubVar, Var, Expr>
impl<F, EF, PubVar, Var, Expr> AirBuilderWithPublicValues
for GenericVerifierConstraintFolder<'_, F, EF, PubVar, Var, Expr>
where
F: Field,
EF: ExtensionField<F>,
Expand Down
1 change: 0 additions & 1 deletion core/src/stark/permutation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rayon_scan::ScanParallelIterator;
use crate::{air::MultiTableAirBuilder, lookup::Interaction};

#[inline]

pub fn populate_permutation_row<F: PrimeField, EF: ExtensionField<F>>(
row: &mut [EF],
preprocessed_row: &[F],
Expand Down
2 changes: 0 additions & 2 deletions core/src/utils/programs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![allow(unused)]
pub mod tests {
/// Demos.

pub const CHESS_ELF: &[u8] =
include_bytes!("../../../examples/chess/program/elf/riscv32im-succinct-zkvm-elf");

Expand All @@ -27,7 +26,6 @@ pub mod tests {
include_bytes!("../../../examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf");

/// Tests.

pub const FIBONACCI_ELF: &[u8] =
include_bytes!("../../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf");

Expand Down
2 changes: 1 addition & 1 deletion prover/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn load_elf(path: &str) -> Result<Vec<u8>, std::io::Error> {
}

pub fn words_to_bytes<T: Copy>(words: &[Word<T>]) -> Vec<T> {
return words.iter().flat_map(|word| word.0).collect();
words.iter().flat_map(|word| word.0).collect()
}

/// Convert 8 BabyBear words into a Bn254Fr field element by shifting by 31 bits each time. The last
Expand Down
8 changes: 2 additions & 6 deletions recursion/compiler/src/asm/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,7 @@ pub struct IfCompiler<'a, F, EF> {
is_eq: bool,
}

impl<'a, F: PrimeField32 + TwoAdicField, EF: ExtensionField<F> + TwoAdicField>
IfCompiler<'a, F, EF>
{
impl<F: PrimeField32 + TwoAdicField, EF: ExtensionField<F> + TwoAdicField> IfCompiler<'_, F, EF> {
pub fn then<Func>(self, f: Func)
where
Func: FnOnce(&mut AsmCompiler<F, EF>),
Expand Down Expand Up @@ -758,9 +756,7 @@ pub struct ForCompiler<'a, F, EF> {
loop_var: Var<F>,
}

impl<'a, F: PrimeField32 + TwoAdicField, EF: ExtensionField<F> + TwoAdicField>
ForCompiler<'a, F, EF>
{
impl<F: PrimeField32 + TwoAdicField, EF: ExtensionField<F> + TwoAdicField> ForCompiler<'_, F, EF> {
pub(super) fn for_each(mut self, f: impl FnOnce(Var<F>, &mut AsmCompiler<F, EF>)) {
// The function block structure:
// - Setting the loop range
Expand Down
Loading