Skip to content

feat: Bump SP1 to 4.0.0 #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,3 @@ jobs:
- name: Compile the range program
run: cargo build --profile release-client-lto
working-directory: programs/range
build_zkvm_programs:
runs-on:
- runs-on
- runner=64cpu-linux-arm64
- run-id=${{ github.run_id }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install SP1 toolchain
run: |
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up
~/.sp1/bin/cargo-prove prove --version
source ~/.bashrc
- name: Compile the range program
run: ~/.sp1/bin/cargo-prove prove build --binary range
working-directory: programs/range
- name: Compile the aggregation program
run: ~/.sp1/bin/cargo-prove prove build --binary aggregation
working-directory: programs/aggregation
4 changes: 2 additions & 2 deletions .github/workflows/elf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
run: |
# Build the binaries
cd programs/range
~/.sp1/bin/cargo-prove prove build --elf-name range-elf --docker --tag v4.0.0-rc.3
~/.sp1/bin/cargo-prove prove build --elf-name range-elf --docker --tag v4.0.0-rc.10 --output-directory ../../elf
cd ../aggregation
~/.sp1/bin/cargo-prove prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.3
~/.sp1/bin/cargo-prove prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.10 --output-directory ../../elf
cd ../../

# Check for any changes in the elf directory
Expand Down
89 changes: 45 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ op-alloy-rpc-types-engine = { version = "0.6.8", default-features = false }
op-alloy-network = { version = "0.6.8", default-features = false }

# sp1
sp1-lib = { version = "4.0.0-rc.11", features = ["verify"] }
sp1-sdk = { version = "4.0.0-rc.11" }
sp1-zkvm = {version = "4.0.0-rc.11", features = ["verify", "embedded"] }
sp1-build = { version = "4.0.0-rc.11" }
sp1-lib = { version = "4.0.0", features = ["verify"] }
sp1-sdk = { version = "4.0.0" }
sp1-zkvm = {version = "4.0.0", features = ["verify", "embedded"] }
sp1-build = { version = "4.0.0" }

[profile.release-client-lto]
inherits = "release"
Expand All @@ -100,11 +100,10 @@ codegen-units = 1
lto = "fat"

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

# Note: Renamed this package to sp1_bls12_381 because it was published with that crate name to kzg_rs.
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" }
# Note: kzg-rs must be on version 0.2.4, https://github.com/bluealloy/revm/pull/2002.
4 changes: 2 additions & 2 deletions book/advanced/verify-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ Then build the binaries:
```bash
cd programs/range
# Build the range-elf
cargo prove build --elf-name range-elf --docker --tag v4.0.0-rc.3
cargo prove build --elf-name range-elf --docker --tag v4.0.0-rc.10

cd ../aggregation
# Build the aggregation-elf
cargo prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.3
cargo prove build --elf-name aggregation-elf --docker --tag v4.0.0-rc.10
```

Now, verify the binaries by confirming the output of `vkey` matches the vkeys on the contract. The `vkey` program outputs the verification keys
Expand Down
Binary file modified elf/aggregation-elf
Binary file not shown.
Binary file modified elf/range-elf
Binary file not shown.
2 changes: 1 addition & 1 deletion utils/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn build_zkvm_program(program: &str) {
BuildArgs {
elf_name: Some(format!("{}-elf", program)),
docker: true,
tag: "v4.0.0-rc.3".to_string(),
tag: "v4.0.0-rc.10".to_string(),
..Default::default()
},
);
Expand Down
Loading