Skip to content

Commit

Permalink
chore: update dev from upstream (#238)
Browse files Browse the repository at this point in the history
* chore: bump docker image

* chore: bump patches

* fix: workflow docker gnark install toolchain

* fix: bump examples patch

* fix: clean up install logic

* fix: remove ed-consesnus patch

* fix: test mod vis

* fix: examples

* fix: docker ci (#230)

* chore: bump docker image

* chore: bump patches

* fix: workflow docker gnark install toolchain

* fix: bump examples patch

* fix: clean up install logic

* fix

* fix ci

---------

Co-authored-by: nhtyy <[email protected]>

* doc updates

* chore: book + tracing (#1932)

* fix: book deploy workflow

* add versioned docs

* chore: don't skip deploy step

* try symlink gcc per rocksdb rec

* try add fix for ARM musl targets

* fix: need seperate musl setups arm vs x86

* combine old arm musl setup

* feat: v4.0.1 (#1941)

Co-authored-by: Ratan Kaliani <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: macos-12 runners deprecated

* improve docs regarding new memory argument

* resolve comments

* fix(book): commit yarn lock file (#1960)

* feat: display the correct proof type in SP1ProofWithPublicValues::bytes() (#1964)

* fix(ci): cache paths not found in book workflow

* fix(ci): correct cache usage for book (#1965)

* fix(ci): fix big int version to avoid msrv (#1966)

* chore: include rustc --version stderr in panic (#1968)

* fix(sdk): implemented verify for EnvProver (#1963)

* perf: rm vec allocs from words conversions (#1972)

* feat(sdk): proof timeout fix (#1971)

* feat: don't checkout submodules when doing `cargo prove new --evm` (#1976)

* fix(sdk): retry network request proof (#1977)

* feat(sdk): Turn off `alloy-*` crate features by default (#1980)

* docs: add audit report for v4, fix typo (#1988)

* docs: improve precompile security docs (#1991)

* fix: Write diagnostics to stderr (vs stdout) (#1978)

* fix(examples): check next validators hash in tendermint program (#1992)

* feat(docker-build): pass additional workspace directory (#1975)

* chore: ignore generated by Intellij-based IDEs. (#1986)

* docs: add GitHub token usage example in installation guide (#1984)

* feat: remove deprecated #[clap] attribute (#1898)

* chore: rm redundant to_vec (#1970)

* chore(clippy): misc clippy fixes (#1969)

* fix: use downloadable go directive 1.22.0 (#1967)

* chore: reorder impl members to match trait definition (#1985)

* fix: deferred checkpoints optimization (#1973)

Co-authored-by: N <[email protected]>

* fix(ci): clippy + fmt (#1997)

* fix: typo in prover network docs (#1998)

* test: check syscalls are actually emitted (#1981)

* perf(prover): powers of alpha (#2000)

Co-authored-by: nhtyy <[email protected]>
Co-authored-by: Yuwen Zhang <[email protected]>
Co-authored-by: jtguibas <[email protected]>
Co-authored-by: Ratan Kaliani <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: rkm0959 <[email protected]>
Co-authored-by: Aurélien <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: srdtrk <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Ivan Mikushin <[email protected]>
Co-authored-by: Abishek Bashyal <[email protected]>
Co-authored-by: DevOrbitlabs <[email protected]>
Co-authored-by: Gengar <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Chris T. <[email protected]>

* nit

---------

Co-authored-by: nhtyy <[email protected]>
Co-authored-by: Yuwen Zhang <[email protected]>
Co-authored-by: jtguibas <[email protected]>
Co-authored-by: Ratan Kaliani <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: rkm0959 <[email protected]>
Co-authored-by: Aurélien <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: srdtrk <[email protected]>
Co-authored-by: Matt Stam <[email protected]>
Co-authored-by: Ivan Mikushin <[email protected]>
Co-authored-by: Abishek Bashyal <[email protected]>
Co-authored-by: DevOrbitlabs <[email protected]>
Co-authored-by: Gengar <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: Chris T. <[email protected]>
  • Loading branch information
17 people authored Jan 30, 2025
1 parent 1dda2c0 commit 057874b
Show file tree
Hide file tree
Showing 41 changed files with 1,184 additions and 852 deletions.
264 changes: 159 additions & 105 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion audits/sp1-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ builder

The global interaction system works as follows. Each chip that needs to send a global interaction, first sends an interaction with `InteractionKind::Global` locally. Then, the `GlobalChip` receives these local interactions with `InteractionKind::Global`, then converts these messages into digests and accumulates them, making the results global.

However, while these informations are sent locally with `InteractionKind::Global`, there are actually two different "actual" `InteractionKind`s - `Memory` and `Syscall`.
However, while these information are sent locally with `InteractionKind::Global`, there are actually two different "actual" `InteractionKind`s - `Memory` and `Syscall`.

The vulnerability was in that the actual underlying `InteractionKind` was not sent as a part of the local interaction between the chips and `GlobalChip`. Therefore, a "memory" interaction could be regarded as "syscall" interaction, and vice versa.

Expand Down
2 changes: 1 addition & 1 deletion book/docs/generating-proofs/prover-network/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ let proof = prover
.prove(&pk, &stdin)
.groth16()
.skip_simulation(true)
.fulfillment_strategy(FulfillmentStrategy::Reserved)
.strategy(FulfillmentStrategy::Reserved)
.timeout(Duration::from_secs(60 * 60))
.run()
.unwrap();
Expand Down
7 changes: 5 additions & 2 deletions crates/core/machine/src/utils/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use p3_air::Air;
use p3_baby_bear::BabyBear;
use p3_matrix::dense::RowMajorMatrix;
use p3_uni_stark::SymbolicAirBuilder;
use serde::{de::DeserializeOwned, Serialize};
use sp1_core_executor::{ExecutionRecord, Executor, Program, SP1Context};
use sp1_primitives::io::SP1PublicValues;
Expand Down Expand Up @@ -128,7 +129,8 @@ where
A: MachineAir<SC::Val>
+ Air<InteractionBuilder<Val<SC>>>
+ for<'a> Air<VerifierConstraintFolder<'a, SC>>
+ for<'a> Air<DebugConstraintBuilder<'a, Val<SC>, SC::Challenge>>,
+ for<'a> Air<DebugConstraintBuilder<'a, Val<SC>, SC::Challenge>>
+ Air<SymbolicAirBuilder<SC::Val>>,
A::Record: MachineRecord<Config = SP1CoreOpts>,
SC: StarkGenericConfig,
SC::Val: p3_field::PrimeField32,
Expand Down Expand Up @@ -169,7 +171,8 @@ where
+ for<'a> Air<ProverConstraintFolder<'a, SC>>
+ Air<InteractionBuilder<Val<SC>>>
+ for<'a> Air<VerifierConstraintFolder<'a, SC>>
+ for<'a> Air<DebugConstraintBuilder<'a, Val<SC>, SC::Challenge>>,
+ for<'a> Air<DebugConstraintBuilder<'a, Val<SC>, SC::Challenge>>
+ Air<SymbolicAirBuilder<SC::Val>>,
A::Record: MachineRecord<Config = SP1CoreOpts>,
SC: StarkGenericConfig,
SC::Val: p3_field::PrimeField32,
Expand Down
1 change: 1 addition & 0 deletions crates/recursion/circuit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ p3-challenger = { workspace = true }
p3-dft = { workspace = true }
p3-bn254-fr = { workspace = true }
p3-baby-bear = { workspace = true }
p3-uni-stark = { workspace = true }

sp1-core-machine = { workspace = true }
sp1-core-executor = { workspace = true }
Expand Down
16 changes: 10 additions & 6 deletions crates/stark/src/folder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ pub struct ProverConstraintFolder<'a, SC: StarkGenericConfig> {
pub is_last_row: PackedVal<SC>,
/// The selector for the transition.
pub is_transition: PackedVal<SC>,
/// The constraint folding challenge.
pub alpha: SC::Challenge,
/// The powers of the constraint folding challenge.
pub powers_of_alpha: &'a Vec<SC::Challenge>,
/// The accumulator for the constraint folding.
pub accumulator: PackedChallenge<SC>,
/// The public values.
pub public_values: &'a [Val<SC>],
/// The constraint index.
pub constraint_index: usize,
}

impl<'a, SC: StarkGenericConfig> AirBuilder for ProverConstraintFolder<'a, SC> {
Expand Down Expand Up @@ -77,8 +79,9 @@ impl<'a, SC: StarkGenericConfig> AirBuilder for ProverConstraintFolder<'a, SC> {

fn assert_zero<I: Into<Self::Expr>>(&mut self, x: I) {
let x: PackedVal<SC> = x.into();
self.accumulator *= PackedChallenge::<SC>::from_f(self.alpha);
self.accumulator += x;
self.accumulator +=
PackedChallenge::<SC>::from_f(self.powers_of_alpha[self.constraint_index]) * x;
self.constraint_index += 1;
}
}

Expand All @@ -94,8 +97,9 @@ impl<SC: StarkGenericConfig> ExtensionBuilder for ProverConstraintFolder<'_, SC>
I: Into<Self::ExprEF>,
{
let x: PackedChallenge<SC> = x.into();
self.accumulator *= PackedChallenge::<SC>::from_f(self.alpha);
self.accumulator += x;
self.accumulator +=
PackedChallenge::<SC>::from_f(self.powers_of_alpha[self.constraint_index]) * x;
self.constraint_index += 1;
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/stark/src/lookup/debug.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::collections::BTreeMap;

use p3_baby_bear::BabyBear;
use p3_field::{AbstractField, Field, PrimeField32, PrimeField64};
use p3_matrix::Matrix;
use std::collections::BTreeMap;

use super::InteractionKind;
use crate::{
Expand Down
Loading

0 comments on commit 057874b

Please sign in to comment.