Sitelet https://github.com/Galoretka/sp1/commit/65d13907dca146039c09eb423174171cf429eab9
Skip to content

Commit 65d1390

Browse files
authored
feat(verifier): verify multi-shard compress proofs (succinctlabs#2450)
1 parent d64934f commit 65d1390

49 files changed

Lines changed: 1574 additions & 940 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Cargo.lock‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ debug-assertions = true
5151
# sp1
5252
sp1-build = { path = "crates/build", version = "5.2.1" }
5353
sp1-cli = { path = "crates/cli", version = "5.2.1", default-features = false }
54-
sp1-core-machine = { path = "crates/core/machine", version = "5.2.1" }
54+
sp1-core-machine = { path = "crates/core/machine", version = "5.2.1", default-features = false }
5555
sp1-core-executor = { path = "crates/core/executor", version = "5.2.1" }
5656
sp1-curves = { path = "crates/curves", version = "5.2.1" }
5757
sp1-derive = { path = "crates/derive", version = "5.2.1" }
@@ -60,7 +60,7 @@ sp1-helper = { path = "crates/helper", version = "5.2.1", default-features = fal
6060
sp1-primitives = { path = "crates/primitives", version = "5.2.1" }
6161
sp1-prover = { path = "crates/prover", version = "5.2.1" }
6262
sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "5.2.1" }
63-
sp1-recursion-core = { path = "crates/recursion/core", version = "5.2.1" }
63+
sp1-recursion-core = { path = "crates/recursion/core", version = "5.2.1", default-features = false }
6464
sp1-recursion-derive = { path = "crates/recursion/derive", version = "5.2.1", default-features = false }
6565
sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "5.2.1", default-features = false }
6666
sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "5.2.1", default-features = false }
@@ -69,6 +69,7 @@ sp1-cuda = { path = "crates/cuda", version = "5.2.1" }
6969
sp1-stark = { path = "crates/stark", version = "5.2.1" }
7070
sp1-lib = { path = "crates/zkvm/lib", version = "5.2.1", default-features = false }
7171
sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "5.2.1", default-features = false }
72+
sp1-verifier = { path = "crates/verifier", version = "5.2.1", default-features = false }
7273

7374
# For testing.
7475
test-artifacts = { path = "crates/test-artifacts" }

‎crates/cli/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ anyhow = { version = "1.0.83", features = ["backtrace"] }
2222
clap = { version = "4.5.9", features = ["derive", "env"] }
2323
sp1-build = { workspace = true }
2424
sp1-sdk = { workspace = true }
25-
sp1-core-machine = { workspace = true }
25+
sp1-core-machine = { workspace = true, default-features = true }
2626
reqwest = { version = "0.12.4", features = [
2727
"stream",
2828
"json",

‎crates/core/executor/src/io.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::io::Read;
22

33
use serde::{de::DeserializeOwned, Serialize};
4-
use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, StarkVerifyingKey};
4+
use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, SP1ReduceProof, StarkVerifyingKey};
55

66
use super::Executor;
7-
use crate::SP1ReduceProof;
87

98
impl Read for Executor<'_> {
109
fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {

‎crates/core/executor/src/lib.rs‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ mod opcode;
3737
mod profiler;
3838
mod program;
3939
mod record;
40-
mod reduce;
4140
mod register;
4241
mod report;
4342
mod state;
@@ -54,7 +53,6 @@ pub use instruction::*;
5453
pub use opcode::*;
5554
pub use program::*;
5655
pub use record::*;
57-
pub use reduce::*;
5856
pub use register::*;
5957
pub use report::*;
6058
pub use state::*;

‎crates/core/executor/src/reduce.rs‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎crates/core/executor/src/state.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ use std::{
66

77
use hashbrown::HashMap;
88
use serde::{Deserialize, Serialize};
9-
use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, StarkVerifyingKey};
9+
use sp1_stark::{baby_bear_poseidon2::BabyBearPoseidon2, SP1ReduceProof, StarkVerifyingKey};
1010

1111
use crate::{
1212
events::MemoryRecord,
1313
memory::Memory,
1414
record::{ExecutionRecord, MemoryAccessRecord},
1515
syscalls::SyscallCode,
16-
ExecutorMode, SP1ReduceProof,
16+
ExecutorMode,
1717
};
1818

1919
/// Holds data describing the current state of a program's execution.

‎crates/core/executor/src/subproof.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//! Types and methods for subproof verification inside the [`crate::Executor`].
22
33
use sp1_stark::{
4-
baby_bear_poseidon2::BabyBearPoseidon2, MachineVerificationError, StarkVerifyingKey,
4+
baby_bear_poseidon2::BabyBearPoseidon2, MachineVerificationError, SP1ReduceProof,
5+
StarkVerifyingKey,
56
};
67

7-
use crate::SP1ReduceProof;
8-
98
/// Verifier used in runtime when `sp1_zkvm::precompiles::verify::verify_sp1_proof` is called. This
109
/// is then used to sanity check that the user passed in the correct proof; the actual constraints
1110
/// happen in the recursion layer.

‎crates/core/executor/src/syscalls/context.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl<'a, 'b> SyscallContext<'a, 'b> {
157157
&estimator.current_precompile_touched_compressed_addresses;
158158
// Add the number of addresses that were removed from the main set.
159159
estimator.current_local_mem +=
160-
original_len - estimator.current_touched_compressed_addresses.len();
160+
(original_len - estimator.current_touched_compressed_addresses.len()) as usize;
161161
}
162162
}
163163

‎crates/core/machine/build.rs‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1+
/// The library name, used for the static library archive and the headers.
2+
/// Should be chosen as to not conflict with other library/header names.
3+
const LIB_NAME: &str = "sp1-core-machine-sys";
4+
15
fn main() {
26
if std::env::var("DOCS_RS").is_ok() {
37
return;
48
}
59

610
#[cfg(feature = "sys")]
711
sys::build_ffi();
12+
13+
#[cfg(not(feature = "sys"))]
14+
{
15+
// Build an empty library.
16+
use std::{env, path::PathBuf};
17+
let source = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("empty.cpp");
18+
let mut cc_builder = cc::Build::new();
19+
cc_builder.files(&[source]);
20+
cc_builder.compile(LIB_NAME);
21+
}
822
}
923

1024
#[cfg(feature = "sys")]
@@ -16,9 +30,7 @@ mod sys {
1630

1731
use pathdiff::diff_paths;
1832

19-
/// The library name, used for the static library archive and the headers.
20-
/// Should be chosen as to not conflict with other library/header names.
21-
const LIB_NAME: &str = "sp1-core-machine-sys";
33+
use super::LIB_NAME;
2234

2335
/// The name of all include directories involved, used to find and output header files.
2436
const INCLUDE_DIRNAME: &str = "include";

0 commit comments

Comments
 (0)