Skip to content

Commit 831efbe

Browse files
authored
feat(raiko): add alloc feature to compile risc0 guest to avoid oom issue (#404)
* feat(raiko): multi blocks in one proposal tx Signed-off-by: smtmfft <[email protected]> * add alloc feature to r0 to avoid OOM Signed-off-by: smtmfft <[email protected]> * update zk tier verifier address Signed-off-by: smtmfft <[email protected]> * upgrade sp1 to 3.0.0 Signed-off-by: smtmfft <[email protected]> * update sp1 tier Signed-off-by: smtmfft <[email protected]> --------- Signed-off-by: smtmfft <[email protected]>
1 parent 9317ca1 commit 831efbe

File tree

13 files changed

+340
-324
lines changed

13 files changed

+340
-324
lines changed

Diff for: Cargo.lock

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

Diff for: Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ bonsai-sdk = { version = "=1.1.2" }
5858
risc0-binfmt = { version = "=1.1.2" }
5959

6060
# SP1
61-
sp1-sdk = { version = "=3.0.0-rc3" }
62-
sp1-zkvm = { version = "2.0.0" }
63-
sp1-helper = { version = "2.0.0" }
61+
sp1-sdk = { version = "=3.0.0" }
62+
sp1-zkvm = { version = "=3.0.0" }
63+
sp1-helper = { version = "=3.0.0" }
6464

6565
# alloy
6666
alloy-rlp = { version = "0.3.4", default-features = false }

Diff for: host/config/chain_spec_list_default.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@
139139
"verifier_address_forks": {
140140
"HEKLA": {
141141
"SGX": "0xb0f3186FC1963f774f52ff455DC86aEdD0b31F81",
142-
"SP1": "0x0000000000000000000000000000000000000000",
143-
"RISC0": "0x0000000000000000000000000000000000000000"
142+
"SP1": "0x5c44f2239925b0d86d2BFEe539f19CD0A08Af452",
143+
"RISC0": "0x55902b2D3DF2A65370A89C86Ae9dd71Ecd508edc"
144144
},
145145
"ONTAKE": {
146146
"SGX": "0xb0f3186FC1963f774f52ff455DC86aEdD0b31F81",
147-
"SP1": "0x0000000000000000000000000000000000000000",
148-
"RISC0": "0x0000000000000000000000000000000000000000"
147+
"SP1": "0x5c44f2239925b0d86d2BFEe539f19CD0A08Af452",
148+
"RISC0": "0x55902b2D3DF2A65370A89C86Ae9dd71Ecd508edc"
149149
}
150150
},
151151
"genesis_time": 0,
+1-1
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");
33
pub const RISC0_AGGREGATION_ID: [u32; 8] = [
4-
3597901240, 347325416, 3317656102, 3291080048, 86415258, 1347371281, 3482575988, 4094302300,
4+
2333673138, 1389402087, 4157868707, 3509779465, 4233333805, 3247956400, 2845161127, 4015834081,
55
];

Diff for: provers/risc0/driver/src/methods/risc0_guest.rs

+1-1
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");
33
pub const RISC0_GUEST_ID: [u32; 8] = [
4-
2705224968, 672422473, 3589767632, 3895344282, 3642477750, 1142566656, 2251137472, 1131663031,
4+
643196937, 1246728629, 1886769928, 130762256, 177277998, 252070675, 1250330519, 622696287,
55
];

Diff for: provers/risc0/guest/Cargo.lock

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

Diff for: provers/risc0/guest/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ raiko-lib = { path = "../../../lib", features = ["std", "risc0"] }
2626
risc0-zkvm = { version = "=1.1.2", default-features = false, features = [
2727
'std',
2828
"getrandom",
29+
"heap-embedded-alloc"
2930
] }
3031
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" }
3132
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" }

Diff for: provers/sp1/driver/src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ impl Prover for Sp1Prover {
167167
output.header.number
168168
);
169169
network_prover
170-
.wait_proof::<sp1_sdk::SP1ProofWithPublicValues>(
171-
&proof_id,
172-
Some(Duration::from_secs(3600)),
173-
)
170+
.wait_proof(&proof_id, Some(Duration::from_secs(3600)))
174171
.await
175172
.map_err(|e| ProverError::GuestError(format!("Sp1: network proof failed {e:?}")))?
176173
};

0 commit comments

Comments
 (0)