Skip to content

Commit f3d70e3

Browse files
authored
feat: Bump SP1 to 4.0.0 (#330)
* feat: v4.0.0 * add * fix * chore: add
1 parent 9792d8f commit f3d70e3

File tree

8 files changed

+60
-80
lines changed

8 files changed

+60
-80
lines changed

.github/workflows/compile.yaml

-20
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,3 @@ jobs:
2222
- name: Compile the range program
2323
run: cargo build --profile release-client-lto
2424
working-directory: programs/range
25-
build_zkvm_programs:
26-
runs-on:
27-
- runs-on
28-
- runner=64cpu-linux-arm64
29-
- run-id=${{ github.run_id }}
30-
steps:
31-
- name: Checkout code
32-
uses: actions/checkout@v4
33-
- name: Install SP1 toolchain
34-
run: |
35-
curl -L https://sp1.succinct.xyz | bash
36-
~/.sp1/bin/sp1up
37-
~/.sp1/bin/cargo-prove prove --version
38-
source ~/.bashrc
39-
- name: Compile the range program
40-
run: ~/.sp1/bin/cargo-prove prove build --binary range
41-
working-directory: programs/range
42-
- name: Compile the aggregation program
43-
run: ~/.sp1/bin/cargo-prove prove build --binary aggregation
44-
working-directory: programs/aggregation

.github/workflows/elf.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
run: |
3030
# Build the binaries
3131
cd programs/range
32-
~/.sp1/bin/cargo-prove prove build --elf-name range-elf --docker --tag v4.0.0-rc.3
32+
~/.sp1/bin/cargo-prove prove build --elf-name range-elf --docker --tag v4.0.0-rc.10 --output-directory ../../elf
3333
cd ../aggregation
34-
~/.sp1/bin/cargo-prove prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.3
34+
~/.sp1/bin/cargo-prove prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.10 --output-directory ../../elf
3535
cd ../../
3636
3737
# Check for any changes in the elf directory

Cargo.lock

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

Cargo.toml

+10-11
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ op-alloy-rpc-types-engine = { version = "0.6.8", default-features = false }
8888
op-alloy-network = { version = "0.6.8", default-features = false }
8989

9090
# sp1
91-
sp1-lib = { version = "4.0.0-rc.11", features = ["verify"] }
92-
sp1-sdk = { version = "4.0.0-rc.11" }
93-
sp1-zkvm = {version = "4.0.0-rc.11", features = ["verify", "embedded"] }
94-
sp1-build = { version = "4.0.0-rc.11" }
91+
sp1-lib = { version = "4.0.0", features = ["verify"] }
92+
sp1-sdk = { version = "4.0.0" }
93+
sp1-zkvm = {version = "4.0.0", features = ["verify", "embedded"] }
94+
sp1-build = { version = "4.0.0" }
9595

9696
[profile.release-client-lto]
9797
inherits = "release"
@@ -100,11 +100,10 @@ codegen-units = 1
100100
lto = "fat"
101101

102102
[patch.crates-io]
103-
tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", tag = "patch-2.0.2-sp1-4.0.0-rc.3" }
104-
sha2 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.8-sp1-4.0.0-rc.3" }
105-
ecdsa = { git = "https://github.com/sp1-patches/signatures", tag = "patch-0.16.9-sp1-4.0.0-rc.3-v2" }
106-
substrate-bn = { git = "https://github.com/sp1-patches/bn", tag = "patch-0.6.0-sp1-4.0.0-rc.3-v1" }
107-
sha3 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "patch-sha3-0.10.8-sp1-4.0.0-rc.3" }
103+
tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", tag = "patch-2.0.2-sp1-4.0.0" }
104+
sha2 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", tag = "patch-sha2-0.10.8-sp1-4.0.0" }
105+
ecdsa = { git = "https://github.com/sp1-patches/signatures", tag = "patch-0.16.9-sp1-4.0.0" }
106+
substrate-bn = { git = "https://github.com/sp1-patches/bn", tag = "patch-0.6.0-sp1-4.0.0" }
107+
sha3 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha3", tag = "patch-sha3-0.10.8-sp1-4.0.0" }
108108

109-
# Note: Renamed this package to sp1_bls12_381 because it was published with that crate name to kzg_rs.
110-
sp1_bls12_381 = { git = "https://github.com/sp1-patches/bls12_381.git", branch = "ratan/patch-0.8.0-sp1-4.0.0-rc.3-v1-rename-package" }
109+
# Note: kzg-rs must be on version 0.2.4, https://github.com/bluealloy/revm/pull/2002.

book/advanced/verify-binaries.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Then build the binaries:
3737
```bash
3838
cd programs/range
3939
# Build the range-elf
40-
cargo prove build --elf-name range-elf --docker --tag v4.0.0-rc.3
40+
cargo prove build --elf-name range-elf --docker --tag v4.0.0-rc.10
4141

4242
cd ../aggregation
4343
# Build the aggregation-elf
44-
cargo prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.3
44+
cargo prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.10
4545
```
4646

4747
Now, verify the binaries by confirming the output of `vkey` matches the vkeys on the contract. The `vkey` program outputs the verification keys

elf/aggregation-elf

-3.55 KB
Binary file not shown.

elf/range-elf

-110 KB
Binary file not shown.

utils/build/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn build_zkvm_program(program: &str) {
8888
BuildArgs {
8989
elf_name: Some(format!("{}-elf", program)),
9090
docker: true,
91-
tag: "v4.0.0-rc.3".to_string(),
91+
tag: "v4.0.0-rc.10".to_string(),
9292
..Default::default()
9393
},
9494
);

0 commit comments

Comments
 (0)