File tree Expand file tree Collapse file tree 5 files changed +39
-33
lines changed
crates/l2/prover/src/guest_program Expand file tree Collapse file tree 5 files changed +39
-33
lines changed Original file line number Diff line number Diff line change 1+ name : " Install RISC0"
2+ description : " Install RISC0 Toolchain"
3+
4+ runs :
5+ using : " composite"
6+ steps :
7+ - name : Install RISC0
8+ shell : bash
9+ run : |
10+ curl -L https://risczero.com/install | bash
11+ ~/.risc0/bin/rzup install cargo-risczero 3.0.3
12+ ~/.risc0/bin/rzup install risc0-groth16
13+ ~/.risc0/bin/rzup install rust
14+ ~/.risc0/bin/rzup install cpp
15+ ~/.risc0/bin/rzup install r0vm 3.0.3
Original file line number Diff line number Diff line change 6969 - name : Install RISC0
7070 env :
7171 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72- run : |
73- curl -L https://risczero.com/install | bash
74- ~/.risc0/bin/rzup install cargo-risczero 3.0.3
75- ~/.risc0/bin/rzup install risc0-groth16
76- ~/.risc0/bin/rzup install rust
72+ uses : ./.github/actions/install-risc0
7773
7874 - name : Create placeholder SP1 ELF
7975 run : |
Original file line number Diff line number Diff line change @@ -30,17 +30,11 @@ jobs:
3030 - name : Add Rust Cache
3131 uses : Swatinem/rust-cache@v2
3232
33- - name : RISC-V Risc0 toolchain install
33+ - name : Install RISC0
3434 if : matrix.backend == 'risc0'
3535 env :
3636 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37- # should be able to specify a version for `rzup install rust` (toolchain version)
38- # but it throws a "error decoding response body" in that case
39- run : |
40- curl -L https://risczero.com/install | bash
41- ~/.risc0/bin/rzup install cargo-risczero 3.0.3
42- ~/.risc0/bin/rzup install risc0-groth16
43- ~/.risc0/bin/rzup install rust
37+ uses : ./.github/actions/install-risc0
4438
4539 - name : RISC-V SP1 toolchain install
4640 if : matrix.backend == 'sp1'
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ permissions:
1818env :
1919 REGISTRY : ghcr.io
2020 IMAGE_NAME : ${{ github.repository }}
21+ PROVER_REPRODUCIBLE_BUILD : true
2122
2223jobs :
2324 build-ethrex :
9697 if : ${{ matrix.platform == 'ubuntu-22.04' }}
9798 env :
9899 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
99- run : |
100- curl -L https://risczero.com/install | bash
101- ~/.risc0/bin/rzup install cargo-risczero 3.0.3
102- ~/.risc0/bin/rzup install risc0-groth16
103- ~/.risc0/bin/rzup install rust
100+ uses : ./.github/actions/install-risc0
101+
104102 - name : Install CUDA (only Linux x86 GPU)
105103 uses : Jimver/cuda-toolkit@v0.2.24
106104 if : ${{ matrix.platform == 'ubuntu-22.04' && matrix.stack == 'l2_gpu' }}
@@ -185,11 +183,7 @@ jobs:
185183 if : ${{ matrix.zkvm == 'risc0' }}
186184 env :
187185 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
188- run : |
189- curl -L https://risczero.com/install | bash
190- ~/.risc0/bin/rzup install cargo-risczero 3.0.3
191- ~/.risc0/bin/rzup install risc0-groth16
192- ~/.risc0/bin/rzup install rust
186+ uses : ./.github/actions/install-risc0
193187
194188 - name : Build ethrex elf - ${{ matrix.zkvm }}
195189 run : |
Original file line number Diff line number Diff line change @@ -19,15 +19,22 @@ fn build_risc0_program() {
1919 vec ! [ ]
2020 } ;
2121
22- let docker_options = DockerOptionsBuilder :: default ( )
23- . root_dir ( format ! ( "{}/../../../../../" , env!( "CARGO_MANIFEST_DIR" ) ) )
24- . build ( )
25- . unwrap ( ) ;
26- let guest_options = GuestOptionsBuilder :: default ( )
27- . features ( features)
28- . use_docker ( docker_options)
29- . build ( )
30- . unwrap ( ) ;
22+ let guest_options = if option_env ! ( "PROVER_REPRODUCIBLE_BUILD" ) . is_some ( ) {
23+ let docker_options = DockerOptionsBuilder :: default ( )
24+ . root_dir ( format ! ( "{}/../../../../../" , env!( "CARGO_MANIFEST_DIR" ) ) )
25+ . build ( )
26+ . unwrap ( ) ;
27+ GuestOptionsBuilder :: default ( )
28+ . features ( features)
29+ . use_docker ( docker_options)
30+ . build ( )
31+ . unwrap ( )
32+ } else {
33+ GuestOptionsBuilder :: default ( )
34+ . features ( features)
35+ . build ( )
36+ . unwrap ( )
37+ } ;
3138
3239 let built_guests = embed_methods_with_options ( std:: collections:: HashMap :: from ( [ (
3340 "zkvm-risc0-program" ,
@@ -66,7 +73,7 @@ fn build_sp1_program() {
6673 output_directory : Some ( "./src/sp1/out" . to_string ( ) ) ,
6774 elf_name : Some ( "riscv32im-succinct-zkvm-elf" . to_string ( ) ) ,
6875 features,
69- docker : true ,
76+ docker : option_env ! ( "PROVER_REPRODUCIBLE_BUILD" ) . is_some ( ) ,
7077 tag : "v5.0.8" . to_string ( ) ,
7178 workspace_directory : Some ( format ! ( "{}/../../../../../" , env!( "CARGO_MANIFEST_DIR" ) ) ) ,
7279 ..Default :: default ( )
You can’t perform that action at this time.
0 commit comments