Skip to content

Commit 608588f

Browse files
authored
chore: release 4.1.6 (#2169)
2 parents f05dc20 + 4643da6 commit 608588f

File tree

14 files changed

+305
-267
lines changed

14 files changed

+305
-267
lines changed

Diff for: Cargo.lock

+61-61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+41-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace.package]
2-
version = "4.1.4"
2+
version = "4.1.6"
33
edition = "2021"
44
license = "MIT OR Apache-2.0"
55
rust-version = "1.79"
@@ -50,51 +50,51 @@ debug-assertions = true
5050

5151
[workspace.dependencies]
5252
# sp1
53-
sp1-build = { path = "crates/build", version = "4.1.4" }
54-
sp1-cli = { path = "crates/cli", version = "4.1.4", default-features = false }
55-
sp1-core-machine = { path = "crates/core/machine", version = "4.1.4" }
56-
sp1-core-executor = { path = "crates/core/executor", version = "4.1.4" }
57-
sp1-curves = { path = "crates/curves", version = "4.1.4" }
58-
sp1-derive = { path = "crates/derive", version = "4.1.4" }
59-
sp1-eval = { path = "crates/eval", version = "4.1.4" }
60-
sp1-helper = { path = "crates/helper", version = "4.1.4", default-features = false }
61-
sp1-primitives = { path = "crates/primitives", version = "4.1.4" }
62-
sp1-prover = { path = "crates/prover", version = "4.1.4" }
63-
sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "4.1.4" }
64-
sp1-recursion-core = { path = "crates/recursion/core", version = "4.1.4" }
65-
sp1-recursion-derive = { path = "crates/recursion/derive", version = "4.1.4", default-features = false }
66-
sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "4.1.4", default-features = false }
67-
sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "4.1.4", default-features = false }
68-
sp1-sdk = { path = "crates/sdk", version = "4.1.4" }
69-
sp1-cuda = { path = "crates/cuda", version = "4.1.4" }
70-
sp1-stark = { path = "crates/stark", version = "4.1.4" }
71-
sp1-lib = { path = "crates/zkvm/lib", version = "4.1.4", default-features = false }
72-
sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "4.1.4", default-features = false }
53+
sp1-build = { path = "crates/build", version = "4.1.6" }
54+
sp1-cli = { path = "crates/cli", version = "4.1.6", default-features = false }
55+
sp1-core-machine = { path = "crates/core/machine", version = "4.1.6" }
56+
sp1-core-executor = { path = "crates/core/executor", version = "4.1.6" }
57+
sp1-curves = { path = "crates/curves", version = "4.1.6" }
58+
sp1-derive = { path = "crates/derive", version = "4.1.6" }
59+
sp1-eval = { path = "crates/eval", version = "4.1.6" }
60+
sp1-helper = { path = "crates/helper", version = "4.1.6", default-features = false }
61+
sp1-primitives = { path = "crates/primitives", version = "4.1.6" }
62+
sp1-prover = { path = "crates/prover", version = "4.1.6" }
63+
sp1-recursion-compiler = { path = "crates/recursion/compiler", version = "4.1.6" }
64+
sp1-recursion-core = { path = "crates/recursion/core", version = "4.1.6" }
65+
sp1-recursion-derive = { path = "crates/recursion/derive", version = "4.1.6", default-features = false }
66+
sp1-recursion-gnark-ffi = { path = "crates/recursion/gnark-ffi", version = "4.1.6", default-features = false }
67+
sp1-recursion-circuit = { path = "crates/recursion/circuit", version = "4.1.6", default-features = false }
68+
sp1-sdk = { path = "crates/sdk", version = "4.1.6" }
69+
sp1-cuda = { path = "crates/cuda", version = "4.1.6" }
70+
sp1-stark = { path = "crates/stark", version = "4.1.6" }
71+
sp1-lib = { path = "crates/zkvm/lib", version = "4.1.6", default-features = false }
72+
sp1-zkvm = { path = "crates/zkvm/entrypoint", version = "4.1.6", default-features = false }
7373

7474
# For testing.
7575
test-artifacts = { path = "crates/test-artifacts" }
7676

7777
# p3
78-
p3-air = "=0.2.1-succinct"
79-
p3-field = "=0.2.1-succinct"
80-
p3-commit = "=0.2.1-succinct"
81-
p3-matrix = "=0.2.1-succinct"
82-
p3-baby-bear = { version = "=0.2.1-succinct", features = ["nightly-features"] }
83-
p3-util = "=0.2.1-succinct"
84-
p3-challenger = "=0.2.1-succinct"
85-
p3-dft = "=0.2.1-succinct"
86-
p3-fri = "=0.2.1-succinct"
87-
p3-goldilocks = "=0.2.1-succinct"
88-
p3-keccak = "=0.2.1-succinct"
89-
p3-keccak-air = "=0.2.1-succinct"
90-
p3-blake3 = "=0.2.1-succinct"
91-
p3-mds = "=0.2.1-succinct"
92-
p3-merkle-tree = "=0.2.1-succinct"
93-
p3-poseidon2 = "=0.2.1-succinct"
94-
p3-symmetric = "=0.2.1-succinct"
95-
p3-uni-stark = "=0.2.1-succinct"
96-
p3-maybe-rayon = "=0.2.1-succinct"
97-
p3-bn254-fr = "=0.2.1-succinct"
78+
p3-air = "=0.2.2-succinct"
79+
p3-field = "=0.2.2-succinct"
80+
p3-commit = "=0.2.2-succinct"
81+
p3-matrix = "=0.2.2-succinct"
82+
p3-baby-bear = { version = "=0.2.2-succinct", features = ["nightly-features"] }
83+
p3-util = "=0.2.2-succinct"
84+
p3-challenger = "=0.2.2-succinct"
85+
p3-dft = "=0.2.2-succinct"
86+
p3-fri = "=0.2.2-succinct"
87+
p3-goldilocks = "=0.2.2-succinct"
88+
p3-keccak = "=0.2.2-succinct"
89+
p3-keccak-air = "=0.2.2-succinct"
90+
p3-blake3 = "=0.2.2-succinct"
91+
p3-mds = "=0.2.2-succinct"
92+
p3-merkle-tree = "=0.2.2-succinct"
93+
p3-poseidon2 = "=0.2.2-succinct"
94+
p3-symmetric = "=0.2.2-succinct"
95+
p3-uni-stark = "=0.2.2-succinct"
96+
p3-maybe-rayon = "=0.2.2-succinct"
97+
p3-bn254-fr = "=0.2.2-succinct"
9898

9999
# misc
100100
hashbrown = "0.14.5"

Diff for: crates/build/src/lib.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -18,60 +18,60 @@ const HELPER_TARGET_SUBDIR: &str = "elf-compilation";
1818
/// features.
1919
#[derive(Clone, Parser, Debug)]
2020
pub struct BuildArgs {
21-
#[clap(
21+
#[arg(
2222
long,
2323
action,
2424
help = "Run compilation using a Docker container for reproducible builds."
2525
)]
2626
pub docker: bool,
27-
#[clap(
27+
#[arg(
2828
long,
2929
help = "The ghcr.io/succinctlabs/sp1 image tag to use when building with Docker.",
3030
default_value = DEFAULT_DOCKER_TAG
3131
)]
3232
pub tag: String,
33-
#[clap(
33+
#[arg(
3434
long,
3535
action,
3636
value_delimiter = ',',
3737
help = "Space or comma separated list of features to activate"
3838
)]
3939
pub features: Vec<String>,
40-
#[clap(
40+
#[arg(
4141
long,
4242
action,
4343
value_delimiter = ',',
4444
help = "Space or comma separated list of extra flags to invokes `rustc` with"
4545
)]
4646
pub rustflags: Vec<String>,
47-
#[clap(long, action, help = "Do not activate the `default` feature")]
47+
#[arg(long, action, help = "Do not activate the `default` feature")]
4848
pub no_default_features: bool,
49-
#[clap(long, action, help = "Ignore `rust-version` specification in packages")]
49+
#[arg(long, action, help = "Ignore `rust-version` specification in packages")]
5050
pub ignore_rust_version: bool,
51-
#[clap(long, action, help = "Assert that `Cargo.lock` will remain unchanged")]
51+
#[arg(long, action, help = "Assert that `Cargo.lock` will remain unchanged")]
5252
pub locked: bool,
53-
#[clap(
53+
#[arg(
5454
short,
5555
long,
5656
action,
5757
help = "Build only the specified packages",
5858
num_args = 1..
5959
)]
6060
pub packages: Vec<String>,
61-
#[clap(
61+
#[arg(
6262
alias = "bin",
6363
long,
6464
action,
6565
help = "Build only the specified binaries",
6666
num_args = 1..
6767
)]
6868
pub binaries: Vec<String>,
69-
#[clap(long, action, requires = "output_directory", help = "ELF binary name")]
69+
#[arg(long, action, requires = "output_directory", help = "ELF binary name")]
7070
pub elf_name: Option<String>,
71-
#[clap(alias = "out-dir", long, action, help = "Copy the compiled ELF to this directory")]
71+
#[arg(alias = "out-dir", long, action, help = "Copy the compiled ELF to this directory")]
7272
pub output_directory: Option<String>,
7373

74-
#[clap(
74+
#[arg(
7575
alias = "workspace-dir",
7676
long,
7777
action,

Diff for: crates/core/executor/src/disassembler/elf.rs

+30-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use elf::{
66
file::Class,
77
ElfBytes,
88
};
9+
use eyre::OptionExt;
910
use hashbrown::HashMap;
1011
use sp1_primitives::consts::{MAXIMUM_MEMORY_SIZE, WORD_SIZE};
1112

@@ -82,6 +83,11 @@ impl Elf {
8283
let mut instructions: Vec<u32> = Vec::new();
8384
let mut base_address = u32::MAX;
8485

86+
// Data about the last segment.
87+
let mut prev_segment_end_addr = None;
88+
89+
// Check that the segments are sorted and disjoint.
90+
8591
// Only read segments that are executable instructions that are also PT_LOAD.
8692
for segment in segments.iter().filter(|x| x.p_type == PT_LOAD) {
8793
// Get the file size of the segment as an u32.
@@ -102,10 +108,30 @@ impl Elf {
102108
eyre::bail!("vaddr {vaddr:08x} is unaligned");
103109
}
104110

105-
// If the virtual address is less than the first memory address, then update the first
106-
// memory address.
107-
if (segment.p_flags & PF_X) != 0 && base_address > vaddr {
108-
base_address = vaddr;
111+
// Check that the ELF structure is supported.
112+
if let Some(last_addr) = prev_segment_end_addr {
113+
eyre::ensure!(last_addr <= vaddr, "unsupported elf structure");
114+
}
115+
prev_segment_end_addr =
116+
Some(vaddr.checked_add(mem_size).ok_or_eyre("last addr overflow")?);
117+
118+
if (segment.p_flags & PF_X) != 0 {
119+
if base_address == u32::MAX {
120+
base_address = vaddr;
121+
eyre::ensure!(
122+
base_address > 0x20,
123+
"base address {base_address} should be greater than 0x20"
124+
);
125+
} else {
126+
let instr_len: u32 = WORD_SIZE
127+
.checked_mul(instructions.len())
128+
.ok_or_eyre("instructions length overflow")?
129+
.try_into()?;
130+
let last_instruction_addr = base_address
131+
.checked_add(instr_len)
132+
.ok_or_eyre("instruction addr overflow")?;
133+
eyre::ensure!(vaddr == last_instruction_addr, "unsupported elf structure");
134+
}
109135
}
110136

111137
// Get the offset to the segment.

Diff for: crates/prover/scripts/find_maximal_shapes.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ use sp1_core_machine::{io::SP1Stdin, riscv::RiscvAir, utils::setup_logger};
77
use sp1_stark::{shape::Shape, SP1CoreOpts};
88

99
#[derive(Parser, Debug)]
10-
#[clap(author, version, about, long_about = None)]
10+
#[command(author, version, about, long_about = None)]
1111
struct Args {
12-
#[clap(short, long, value_delimiter = ' ')]
12+
#[arg(short, long, value_delimiter = ' ')]
1313
list: Vec<String>,
14-
#[clap(short, long, value_delimiter = ' ')]
14+
#[arg(short, long, value_delimiter = ' ')]
1515
shard_sizes: Vec<usize>,
16-
#[clap(short, long)]
16+
#[arg(short, long)]
1717
initial: Option<PathBuf>,
18-
#[clap(short, long, default_value = "maximal_shapes.json")]
18+
#[arg(short, long, default_value = "maximal_shapes.json")]
1919
output: Option<PathBuf>,
2020
}
2121

Diff for: crates/prover/scripts/find_oom_shapes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ use sp1_core_machine::utils::setup_logger;
88
use sp1_stark::shape::Shape;
99

1010
#[derive(Parser, Debug)]
11-
#[clap(author, version, about, long_about = None)]
11+
#[command(author, version, about, long_about = None)]
1212
struct Args {
13-
#[clap(short, long)]
13+
#[arg(short, long)]
1414
maximal_shapes_json: Option<PathBuf>,
15-
#[clap(short, long)]
15+
#[arg(short, long)]
1616
small_shapes_json: Option<PathBuf>,
17-
#[clap(short, long)]
17+
#[arg(short, long)]
1818
lde_threshold_bytes: usize,
1919
}
2020

Diff for: crates/prover/scripts/find_recursion_shapes.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ use sp1_recursion_core::shape::RecursionShapeConfig;
1414
use sp1_stark::{shape::OrderedShape, MachineProver};
1515

1616
#[derive(Parser, Debug)]
17-
#[clap(author, version, about, long_about = None)]
17+
#[command(author, version, about, long_about = None)]
1818
struct Args {
19-
#[clap(short, long, default_value_t = false)]
19+
#[arg(short, long, default_value_t = false)]
2020
dummy: bool,
21-
#[clap(short, long, default_value_t = REDUCE_BATCH_SIZE)]
21+
#[arg(short, long, default_value_t = REDUCE_BATCH_SIZE)]
2222
recursion_batch_size: usize,
23-
#[clap(short, long, default_value_t = 1)]
23+
#[arg(short, long, default_value_t = 1)]
2424
num_compiler_workers: usize,
25-
#[clap(short, long, default_value_t = 1)]
25+
#[arg(short, long, default_value_t = 1)]
2626
num_setup_workers: usize,
27-
#[clap(short, long)]
27+
#[arg(short, long)]
2828
start: Option<usize>,
29-
#[clap(short, long)]
29+
#[arg(short, long)]
3030
end: Option<usize>,
3131
}
3232

Diff for: crates/prover/scripts/find_small_shapes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use sp1_core_machine::utils::setup_logger;
66
use sp1_stark::shape::Shape;
77

88
#[derive(Parser, Debug)]
9-
#[clap(author, version, about, long_about = None)]
9+
#[command(author, version, about, long_about = None)]
1010
struct Args {
11-
#[clap(short, long)]
11+
#[arg(short, long)]
1212
maximal_shapes_json: PathBuf,
13-
#[clap(short, long, value_delimiter = ' ')]
13+
#[arg(short, long, value_delimiter = ' ')]
1414
log2_memory_heights: Vec<usize>,
15-
#[clap(short, long)]
15+
#[arg(short, long)]
1616
output: PathBuf,
1717
}
1818

Diff for: crates/prover/scripts/test_shape_fixing.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use sp1_core_machine::{
1010
use sp1_stark::SP1CoreOpts;
1111

1212
#[derive(Parser, Debug)]
13-
#[clap(author, version, about, long_about = None)]
13+
#[command(author, version, about, long_about = None)]
1414
struct Args {
15-
#[clap(short, long, value_delimiter = ' ')]
15+
#[arg(short, long, value_delimiter = ' ')]
1616
list: Vec<String>,
17-
#[clap(short, long, value_delimiter = ' ')]
17+
#[arg(short, long, value_delimiter = ' ')]
1818
shard_size: usize,
1919
}
2020

Diff for: crates/sdk/src/network/client.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,25 @@ impl NetworkClient {
339339
}
340340

341341
pub(crate) async fn prover_network_client(&self) -> Result<ProverNetworkClient<Channel>> {
342-
let channel = grpc::configure_endpoint(&self.rpc_url)?.connect().await?;
343-
Ok(ProverNetworkClient::new(channel))
342+
self.with_retry(
343+
|| async {
344+
let channel = grpc::configure_endpoint(&self.rpc_url)?.connect().await?;
345+
Ok(ProverNetworkClient::new(channel))
346+
},
347+
"creating network client",
348+
)
349+
.await
344350
}
345351

346352
pub(crate) async fn artifact_store_client(&self) -> Result<ArtifactStoreClient<Channel>> {
347-
let channel = grpc::configure_endpoint(&self.rpc_url)?.connect().await?;
348-
Ok(ArtifactStoreClient::new(channel))
353+
self.with_retry(
354+
|| async {
355+
let channel = grpc::configure_endpoint(&self.rpc_url)?.connect().await?;
356+
Ok(ArtifactStoreClient::new(channel))
357+
},
358+
"creating artifact client",
359+
)
360+
.await
349361
}
350362

351363
pub(crate) async fn create_artifact_with_content<T: Serialize + Send + Sync>(

0 commit comments

Comments
 (0)