Skip to content

Commit f248809

Browse files
committedFeb 27, 2025
feat: succinct-1.85.0
1 parent 4d91de4 commit f248809

File tree

10 files changed

+143
-122
lines changed

10 files changed

+143
-122
lines changed
 

‎.github/workflows/ci.yml

+74-95
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,9 @@
1-
# This file defines our primary CI workflow that runs on pull requests
2-
# and also on pushes to special branches (auto, try).
3-
#
4-
# The actual definition of the executed jobs is calculated by a Python
5-
# script located at src/ci/github-actions/calculate-job-matrix.py, which
6-
# uses job definition data from src/ci/github-actions/jobs.yml.
7-
# You should primarily modify the `jobs.yml` file if you want to modify
8-
# what jobs are executed in CI.
9-
101
name: CI
2+
113
on:
12-
push:
13-
branches:
14-
- auto
15-
- try
16-
- try-perf
17-
- automation/bors/try
18-
pull_request:
19-
branches:
20-
- "**"
21-
22-
permissions:
23-
contents: read
24-
packages: write
25-
26-
defaults:
27-
run:
28-
# On Linux, macOS, and Windows, use the system-provided bash as the default
29-
# shell. (This should only make a difference on Windows, where the default
30-
# shell is PowerShell.)
31-
shell: bash
32-
33-
concurrency:
34-
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
35-
# We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
36-
# are all triggered on the same branch, but which should be able to run concurrently.
37-
group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}
38-
cancel-in-progress: true
39-
env:
40-
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
41-
# This will be empty in PR jobs.
42-
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
4+
workflow_call:
5+
workflow_dispatch:
6+
437
jobs:
448
# The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
459
# It calculates which jobs should be executed, based on the data of the ${{ github }} context.
@@ -76,33 +40,28 @@ jobs:
7640
CACHE_DOMAIN: ci-caches.rust-lang.org
7741
continue-on-error: ${{ matrix.continue_on_error || false }}
7842
strategy:
43+
fail-fast: false
7944
matrix:
80-
# Check the `calculate_matrix` job to see how is the matrix defined.
81-
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
45+
include:
46+
- os: macos-14
47+
triple: aarch64-apple-darwin
48+
- os: macos-13
49+
triple: x86_64-apple-darwin
50+
- os: buildjet-32vcpu-ubuntu-2004
51+
triple: x86_64-unknown-linux-gnu
52+
runs-on: ${{ matrix.os }}
8253
steps:
83-
- if: contains(matrix.os, 'windows')
84-
uses: msys2/setup-msys2@v2.22.0
54+
- name: Install Rust
55+
uses: actions-rs/toolchain@v1
8556
with:
86-
# i686 jobs use mingw32. x86_64 and cross-compile jobs use mingw64.
87-
msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}
88-
# don't try to download updates for already installed packages
89-
update: false
90-
# don't try to use the msys that comes built-in to the github runner,
91-
# so we can control what is installed (i.e. not python)
92-
release: true
93-
# Inherit the full path from the Windows environment, with MSYS2's */bin/
94-
# dirs placed in front. This lets us run Windows-native Python etc.
95-
path-type: inherit
96-
install: >
97-
make
57+
toolchain: stable
58+
- uses: lukka/get-cmake@v3.27.4
9859

99-
- name: disable git crlf conversion
100-
run: git config --global core.autocrlf false
101-
102-
- name: checkout the source code
103-
uses: actions/checkout@v4
60+
- name: Install Go
61+
uses: actions/setup-go@v4
10462
with:
105-
fetch-depth: 2
63+
go-version: 1.21.4
64+
check-latest: true
10665

10766
# Free up disk space on Linux by removing preinstalled components that
10867
# we do not need. We do this to enable some of the less resource
@@ -207,23 +166,17 @@ jobs:
207166
- name: upload artifacts to github
208167
uses: actions/upload-artifact@v4
209168
with:
210-
# name is set in previous step
211-
name: ${{ env.DOC_ARTIFACT_NAME }}
212-
path: obj/artifacts/doc
213-
if-no-files-found: ignore
214-
retention-days: 5
215-
216-
- name: upload artifacts to S3
217-
run: src/ci/scripts/upload-artifacts.sh
218-
env:
219-
AWS_ACCESS_KEY_ID: ${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}
220-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}
221-
# Adding a condition on DEPLOY=1 or DEPLOY_ALT=1 is not needed as all deploy
222-
# builders *should* have the AWS credentials available. Still, explicitly
223-
# adding the condition is helpful as this way CI will not silently skip
224-
# deploying artifacts from a dist builder if the variables are misconfigured,
225-
# erroring about invalid credentials instead.
226-
if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
169+
submodules: "recursive"
170+
path: rust
171+
fetch-depth: 0
172+
ref: ${{ github.ref }}
173+
174+
- name: Check out succinctlabs/sp1
175+
uses: actions/checkout@v3
176+
with:
177+
repository: succinctlabs/sp1
178+
ref: dev
179+
path: sp1
227180

228181
- name: upload job metrics to DataDog
229182
if: needs.calculate_matrix.outputs.run_type != 'pr'
@@ -245,20 +198,46 @@ jobs:
245198
# !cancelled() executes the job regardless of whether the previous jobs passed or failed
246199
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
247200
steps:
248-
- name: checkout the source code
249-
uses: actions/checkout@v4
201+
- name: Install Rust
202+
uses: actions-rs/toolchain@v1
250203
with:
251-
fetch-depth: 2
252-
# Calculate the exit status of the whole CI workflow.
253-
# If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
254-
# If a some dependent job has failed, this exits with 1.
255-
- name: calculate the correct exit status
256-
run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
257-
# Publish the toolstate if an auto build succeeds (just before push to master)
258-
- name: publish toolstate
259-
run: src/ci/publish_toolstate.sh
260-
shell: bash
261-
if: needs.calculate_matrix.outputs.run_type == 'auto'
262-
env:
263-
TOOLSTATE_ISSUES_API_URL: https://api.github.com/repos/rust-lang/rust/issues
264-
TOOLSTATE_PUBLISH: 1
204+
toolchain: stable
205+
- uses: lukka/get-cmake@v3.27.4
206+
207+
- name: Install Go
208+
uses: actions/setup-go@v4
209+
with:
210+
go-version: 1.21.4
211+
check-latest: true
212+
213+
- name: Show rust version
214+
run: |
215+
cargo version
216+
rustup toolchain list
217+
218+
- name: Check out succinctlabs/rust
219+
uses: actions/checkout@v3
220+
with:
221+
submodules: "recursive"
222+
path: rust
223+
fetch-depth: 0
224+
ref: ${{ github.ref }}
225+
226+
- name: Check out succinctlabs/sp1
227+
uses: actions/checkout@v3
228+
with:
229+
repository: succinctlabs/sp1
230+
ref: dev
231+
path: sp1
232+
233+
- name: Build
234+
run: |
235+
cd sp1/crates/cli
236+
GITHUB_ACTIONS=false SP1_BUILD_DIR=$GITHUB_WORKSPACE cargo run --bin cargo-prove -- prove build-toolchain
237+
238+
- name: Archive build output
239+
uses: actions/upload-artifact@v3
240+
with:
241+
name: rust-toolchain-aarch64-unknown-linux-gnu
242+
path: sp1/crates/cli/rust-toolchain-aarch64-unknown-linux-gnu.tar.gz
243+

‎.github/workflows/release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
jobs:
7+
build:
8+
uses: ./.github/workflows/ci.yml
9+
release:
10+
needs: build
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Download artifacts
16+
uses: actions/download-artifact@v3
17+
with:
18+
path: artifacts
19+
- name: List artifact contents
20+
run: |
21+
echo "Listing artifacts directory:"
22+
ls -R artifacts
23+
- name: Create release
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: |
27+
echo "Installing gh CLI..."
28+
curl -L https://github.com/cli/cli/releases/download/v2.17.0/gh_2.17.0_linux_amd64.tar.gz | \
29+
tar xvz --strip-components=2 --exclude=man
30+
chmod +x ./gh
31+
mkdir tars
32+
find artifacts -name "*.tar.gz" -exec mv {} tars/ \;
33+
if [ "$(ls -A tars)" ]; then
34+
./gh release create -p --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./tars/* || \
35+
./gh release upload --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./tars/*
36+
else
37+
echo "No files to release. Exiting."
38+
exit 1
39+
fi

‎compiler/rustc_target/src/spec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ supported_targets! {
18641864
("x86_64-unknown-trusty", x86_64_unknown_trusty),
18651865

18661866
("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
1867-
("riscv32im-risc0-zkvm-elf", riscv32im_risc0_zkvm_elf),
1867+
("riscv32im-succinct-zkvm-elf", riscv32im_succinct_zkvm_elf),
18681868
("riscv32im-unknown-none-elf", riscv32im_unknown_none_elf),
18691869
("riscv32ima-unknown-none-elf", riscv32ima_unknown_none_elf),
18701870
("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),

‎compiler/rustc_target/src/spec/targets/riscv32im_risc0_zkvm_elf.rs ‎compiler/rustc_target/src/spec/targets/riscv32im_succinct_zkvm_elf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515

1616
options: TargetOptions {
1717
os: "zkvm".into(),
18-
vendor: "risc0".into(),
18+
vendor: "succinct".into(),
1919
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
2020
linker: Some("rust-lld".into()),
2121
cpu: "generic-rv32".into(),

‎library/std/src/sys/pal/zkvm/abi.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//! ABI definitions for symbols exported by risc0-zkvm-platform.
1+
//! ABI definitions for symbols exported by sp1-zkvm.
22
3-
// Included here so we don't have to depend on risc0-zkvm-platform.
3+
// Included here so we don't have to depend on sp1-zkvm.
44
//
55
// FIXME: Should we move this to the "libc" crate? It seems like other
66
// architectures put a lot of this kind of stuff there. But there's
7-
// currently no risc0 fork of the libc crate, so we'd either have to
7+
// currently no succinct fork of the libc crate, so we'd either have to
88
// fork it or upstream it.
99

1010
#![allow(dead_code)]
@@ -19,7 +19,7 @@ pub mod fileno {
1919
}
2020

2121
extern "C" {
22-
// Wrappers around syscalls provided by risc0-zkvm-platform:
22+
// Wrappers around syscalls provided by sp1-zkvm-platform:
2323
pub fn sys_halt();
2424
pub fn sys_output(output_id: u32, output_value: u32);
2525
pub fn sys_sha_compress(
@@ -34,7 +34,7 @@ extern "C" {
3434
buf: *const u8,
3535
count: u32,
3636
);
37-
pub fn sys_rand(recv_buf: *mut u32, words: usize);
37+
pub fn sys_rand(recv_buf: *mut u8, words: usize);
3838
pub fn sys_panic(msg_ptr: *const u8, len: usize) -> !;
3939
pub fn sys_log(msg_ptr: *const u8, len: usize);
4040
pub fn sys_cycle_count() -> usize;

‎library/std/src/sys/pal/zkvm/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! System bindings for the risc0 zkvm platform
1+
//! System bindings for sp1-zkvm.
22
//!
33
//! This module contains the facade (aka platform-specific) implementations of
44
//! OS level functionality for zkvm.
@@ -60,3 +60,13 @@ pub fn decode_error_kind(_code: i32) -> crate::io::ErrorKind {
6060
pub fn abort_internal() -> ! {
6161
core::intrinsics::abort();
6262
}
63+
64+
pub fn hashmap_random_keys() -> (u64, u64) {
65+
let mut buf = [0u8; 16];
66+
unsafe {
67+
abi::sys_rand(buf.as_mut_ptr(), buf.len());
68+
};
69+
let a = u64::from_le_bytes(buf[0..8].try_into().unwrap());
70+
let b = u64::from_le_bytes(buf[8..16].try_into().unwrap());
71+
(a, b)
72+
}

‎src/doc/rustc/src/platform-support/riscv32im-risc0-zkvm-elf.md ‎src/doc/rustc/src/platform-support/riscv32im-succinct-zkvm-elf.md

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
# `riscv32im-risc0-zkvm-elf`
1+
# `riscv32im-succinct-zkvm-elf`
22

33
**Tier: 3**
44

5-
RISC Zero's Zero Knowledge Virtual Machine (zkVM) implementing the RV32IM instruction set.
6-
7-
## Target maintainers
8-
9-
- Frank Laub, `frank@risczero.com`, https://github.com/flaub
10-
- Jeremy Bruestle, `jeremy@risczero.com`, https://github.com/jbruestle
11-
- Erik Kaneda, `erik@risczero.com`, https://github.com/SchmErik
5+
Succinct's Zero Knowledge Virtual Machine (zkVM) implementing the RV32IM instruction set.
126

137
## Background
148

@@ -20,7 +14,7 @@ cryptographic seal. This receipt can be verified to ensure the integrity of the
2014
computation and its result. This target is implemented as software only; it has
2115
no hardware implementation.
2216

23-
We have a cargo extension called [cargo-risczero] that allow users to generate
17+
We have a cargo extension called [cargo-prove] that allow users to generate
2418
project templates, install tools for improved user experience, build the binary
2519
using a docker environment and test programs.
2620

@@ -44,7 +38,7 @@ Calling `extern "C"` on the target uses the C calling convention outlined in the
4438

4539
Programs for the zkVM could be built by adding it to the `target` list in
4640
`config.toml`. However, we recommend building programs in our starter template
47-
generated by the [cargo-risczero] utility and the [risc0-build] crate. This
41+
generated by the [cargo-prove] utility and the [sp1-build] crate. This
4842
crate calls `rustc` with `-C "link-arg=-Ttext=` so that it maps the text in the
4943
appropriate location as well as generating variables that represent the ELF and
5044
a unique ID associated with the ELF. The starter template provides developers
@@ -57,15 +51,15 @@ Rust does not yet ship pre-compiled artifacts for this target. To compile for
5751
this target, you will either need to build Rust with the target enabled (see
5852
"Building the target" above). We do not recommend using `build-std` as we have
5953
run into issues building core in the past on our starter template. An alternate
60-
solution is to download the risc0 tool chain by running `cargo risczero install`.
54+
solution is to download the risc0 tool chain by running `cargo prove install`.
6155

6256
## Testing
6357

6458
Note: the target is implemented as a software emulator called the zkVM and there
6559
is no hardware implementation of the target.
6660

6761
The most practical way to test the target program is to use our starter template
68-
that can be generated by using the `cargo risczero new` command. The template
62+
that can be generated by using the `cargo prove new` command. The template
6963
generates a sample "host" and "guest" code. The guest code compiled to the
7064
target (which is RV32IM) whereas the "host" code is compiled to run on the
7165
programmer's machine running either a Linux distribution or macOS. The host
@@ -82,5 +76,4 @@ target. On clang and ld.lld linker, it can be generated using the
8276
target `riscv32-unknown-none`.
8377

8478
[RISC-V specification]: https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
85-
[cargo-risczero]: https://docs.rs/cargo-risczero/latest/cargo_risczero/
86-
[risc0-build]: https://crates.io/crates/risc0-build
79+
[sp1-build]: https://crates.io/crates/sp1-build

‎src/tools/build-manifest/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static TARGETS: &[&str] = &[
134134
"powerpc64le-unknown-linux-gnu",
135135
"powerpc64le-unknown-linux-musl",
136136
"riscv32i-unknown-none-elf",
137-
"riscv32im-risc0-zkvm-elf",
137+
"riscv32im-succinct-zkvm-elf",
138138
"riscv32im-unknown-none-elf",
139139
"riscv32ima-unknown-none-elf",
140140
"riscv32imc-unknown-none-elf",

‎tests/assembly/targets/targets-elf.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@
393393
//@ revisions: riscv32i_unknown_none_elf
394394
//@ [riscv32i_unknown_none_elf] compile-flags: --target riscv32i-unknown-none-elf
395395
//@ [riscv32i_unknown_none_elf] needs-llvm-components: riscv
396-
//@ revisions: riscv32im_risc0_zkvm_elf
397-
//@ [riscv32im_risc0_zkvm_elf] compile-flags: --target riscv32im-risc0-zkvm-elf
398-
//@ [riscv32im_risc0_zkvm_elf] needs-llvm-components: riscv
396+
//@ revisions: riscv32im_succinct_zkvm_elf
397+
//@ [riscv32im_succinct_zkvm_elf] compile-flags: --target riscv32im-succinct-zkvm-elf
398+
//@ [riscv32im_succinct_zkvm_elf] needs-llvm-components: riscv
399399
//@ revisions: riscv32im_unknown_none_elf
400400
//@ [riscv32im_unknown_none_elf] compile-flags: --target riscv32im-unknown-none-elf
401401
//@ [riscv32im_unknown_none_elf] needs-llvm-components: riscv

‎tests/ui/check-cfg/well-known-values.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
230230
LL | target_vendor = "_UNEXPECTED_VALUE",
231231
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232232
|
233-
= note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `risc0`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
233+
= note: expected values for `target_vendor` are: `apple`, `espressif`, `fortanix`, `ibm`, `kmc`, `nintendo`, `nvidia`, `pc`, `succinct`, `sony`, `sun`, `unikraft`, `unknown`, `uwp`, `win7`, and `wrs`
234234
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
235235

236236
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`

0 commit comments

Comments
 (0)
Please sign in to comment.