Skip to content

Commit bce2924

Browse files
authored
feat(raiko): upgrade r0 to v2.0.2 (#555)
* upgrade r0 to v2.0.2 * update prove-batch.sh * fix append issue * update README
1 parent 49c7cfe commit bce2924

File tree

16 files changed

+176
-63
lines changed

16 files changed

+176
-63
lines changed

Cargo.lock

Lines changed: 57 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ reth-chainspec = { git = "https://github.com/taikoxyz/taiko-reth.git", branch =
6262
reth-provider = { git = "https://github.com/taikoxyz/taiko-reth.git", branch = "v1.0.0-rc.2-taiko", default-features = false }
6363

6464
# risc zero
65-
risc0-zkvm = { version = "=2.0.1", features = ["prove", "getrandom"] }
65+
risc0-zkvm = { version = "=2.0.2", features = ["prove", "getrandom"] }
6666
bonsai-sdk = { version = "=1.4.0" }
67-
risc0-binfmt = { version = "=2.0.0" }
68-
risc0-zkos-v1compat = { version = "=2.0.0" }
67+
risc0-binfmt = { version = "=2.0.1" }
68+
risc0-zkos-v1compat = { version = "=2.0.1" }
6969

7070
# SP1
7171
sp1-sdk = { version = "=4.1.7" }

RELEASE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# v1.7.4-zk
2+
3+
## zk image
4+
"/opt/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/risc0-aggregation"
5+
risc0 elf image id: 02ca31a77475bbef11606b3a35464b0d94d5042f33cb483c4ba10de924a204fb
6+
"/opt/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/risc0-batch"
7+
risc0 elf image id: 44f1110ca785f265ef17f673642f059357a034fca2a7e783f4133923c78b985e
8+
"/opt/raiko/provers/risc0/guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest"
9+
risc0 elf image id: 8f0a65ce70c5ff40a1b1551168d2af6e91c2df74ec3e539181505499ac0ec59c
10+
11+
"/opt/raiko/provers/sp1/guest/target/riscv32im-succinct-zkvm-elf/release/sp1-aggregation"
12+
sp1 elf vk bn256 is: 0x00ea4798a8cb36fa438a38d1092194921c1e0d984cde18f28249d1d2457436e2
13+
sp1 elf vk hash_bytes is: 7523cc5432cdbe9071471a211219492160f06cc2337863ca0493a3a4457436e2
14+
"/opt/raiko/provers/sp1/guest/target/riscv32im-succinct-zkvm-elf/release/sp1-batch"
15+
sp1 elf vk bn256 is: 0x0054527f6c42c6e20420a139277d1f61b039a6844859978eed26f7b771462549
16+
sp1 elf vk hash_bytes is: 2a293fb610b1b8810414272477d1f61b01cd342221665e3b5a4def6e71462549
17+
"/opt/raiko/provers/sp1/guest/target/riscv32im-succinct-zkvm-elf/release/sp1-guest"
18+
sp1 elf vk bn256 is: 0x0033cdccfcd57b8d1e17a10a251c7d9fd9a88992195e5fc63464626b8830ec3e
19+
sp1 elf vk hash_bytes is: 19e6e67e355ee34742f4214451c7d9fd4d444c9065797f1868c8c4d70830ec3e
20+
121
# v1.7.3
222

323
## image

pipeline/src/builder.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ pub struct CommandBuilder {
114114
pub rustc: Option<PathBuf>,
115115
// -C flags
116116
pub rust_flags: Option<Vec<String>>,
117+
// --cfg configs
118+
pub rust_cfgs: Option<Vec<String>>,
117119
// -Z flags
118120
pub z_flags: Option<Vec<String>>,
119121
// riscv32im gcc
@@ -163,6 +165,7 @@ impl CommandBuilder {
163165
rustc: CommandBuilder::get_path_buf("rustc", toolchain),
164166
sanitized_env: Vec::new(),
165167
rust_flags: None,
168+
rust_cfgs: None,
166169
z_flags: None,
167170
cc_compiler: None,
168171
c_flags: None,
@@ -189,6 +192,11 @@ impl CommandBuilder {
189192
self
190193
}
191194

195+
pub fn rust_cfgs(mut self, flags: &[&str]) -> Self {
196+
self.rust_cfgs = Some(to_strings(flags));
197+
self
198+
}
199+
192200
pub fn z_flags(mut self, flags: &[&str]) -> Self {
193201
self.z_flags = Some(to_strings(flags));
194202
self
@@ -321,6 +329,7 @@ impl CommandBuilder {
321329
cargo,
322330
rustc,
323331
rust_flags,
332+
rust_cfgs,
324333
z_flags,
325334
cc_compiler,
326335
c_flags,
@@ -373,12 +382,15 @@ impl CommandBuilder {
373382
}),
374383
);
375384

385+
let mut encoded_flags: Vec<String> = vec![];
376386
if let Some(rust_flags) = rust_flags {
377-
cmd.env(
378-
"CARGO_ENCODED_RUSTFLAGS",
379-
format_flags("-C", &rust_flags).join("\x1f"),
380-
);
387+
encoded_flags = format_flags("-C", &rust_flags);
388+
}
389+
390+
if let Some(cfgs) = rust_cfgs {
391+
encoded_flags.extend(format_flags("--cfg", &cfgs));
381392
}
393+
cmd.env("CARGO_ENCODED_RUSTFLAGS", encoded_flags.join("\x1f"));
382394

383395
// Set C compiler path and flags
384396
if let Some(cc_compiler) = cc_compiler {

provers/risc0/builder/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ impl Pipeline for Risc0Pipeline {
3535
// and can be removed in the future.
3636
.custom_env([("RISC0_FEATURE_bigint2".to_string(), "1".to_string())].into())
3737
.rust_flags(&[
38-
"passes=loweratomic",
38+
"passes=lower-atomic",
3939
"link-arg=-Ttext=0x00200800",
40+
"link-arg=--fatal-warnings",
4041
"panic=abort",
4142
])
43+
.rust_cfgs(&["getrandom_backend=\"custom\""])
4244
.cc_compiler("gcc".into())
4345
.c_flags(&[
4446
"/opt/riscv/bin/riscv32-unknown-elf-gcc",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub const RISC0_AGGREGATION_ELF: &[u8] =
22
include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-aggregation.bin");
33
pub const RISC0_AGGREGATION_ID: [u32; 8] = [
4-
1755096741, 3104731471, 3897409404, 1764987546, 2368818630, 438608404, 2673773745, 4059657912,
4+
1007494747, 4111588986, 2925906166, 2944070927, 3385479535, 596818810, 3549952976, 2950587177,
55
];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub const RISC0_BATCH_ELF: &[u8] =
22
include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-batch.bin");
33
pub const RISC0_BATCH_ID: [u32; 8] = [
4-
2799826313, 1146822635, 4144432365, 299604400, 536823753, 1503986349, 3698813577, 2002202435,
4+
992250817, 2928324580, 4087942144, 3418630899, 315269259, 393989864, 1105406974, 925281959,
55
];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub const RISC0_GUEST_ELF: &[u8] =
22
include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest.bin");
33
pub const RISC0_GUEST_ID: [u32; 8] = [
4-
1095459983, 1406338564, 3500532327, 2251670090, 1544526449, 3367186052, 2772914985, 2149869005,
4+
2151630411, 3224101199, 1088151439, 676925749, 2975387509, 3045345968, 522682411, 3254761167,
55
];

0 commit comments

Comments
 (0)