Skip to content

Commit 5f449f3

Browse files
committed
feat: use deterministic build for risc0
1 parent 99b447d commit 5f449f3

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

aggregation_mode/build.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
use risc0_build::{DockerOptionsBuilder, GuestOptionsBuilder};
2+
use std::collections::HashMap;
3+
14
fn main() {
25
sp1_build::build_program_with_args("./aggregation_programs/sp1", {
36
sp1_build::BuildArgs {
@@ -6,5 +9,16 @@ fn main() {
69
}
710
});
811

9-
risc0_build::embed_methods();
12+
// With this containerized build process, we ensure that all builds of the guest code,
13+
// regardless of the machine or local environment, will produce the same ImageID
14+
let docker_options = DockerOptionsBuilder::default().build().unwrap();
15+
// Reference: https://github.com/risc0/risc0/blob/main/risc0/build/src/config.rs#L73-L90
16+
let guest_options = GuestOptionsBuilder::default()
17+
.use_docker(docker_options)
18+
.build()
19+
.unwrap();
20+
risc0_build::embed_methods_with_options(HashMap::from([(
21+
"risc0_aggregation_program",
22+
guest_options,
23+
)]));
1024
}

0 commit comments

Comments
 (0)