Skip to content

Commit

Permalink
feat(raiko): add alloc feature to compile risc0 guest to avoid oom is…
Browse files Browse the repository at this point in the history
…sue (#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]>
  • Loading branch information
smtmfft authored Nov 8, 2024
1 parent 9317ca1 commit 831efbe
Show file tree
Hide file tree
Showing 13 changed files with 340 additions and 324 deletions.
75 changes: 33 additions & 42 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ bonsai-sdk = { version = "=1.1.2" }
risc0-binfmt = { version = "=1.1.2" }

# SP1
sp1-sdk = { version = "=3.0.0-rc3" }
sp1-zkvm = { version = "2.0.0" }
sp1-helper = { version = "2.0.0" }
sp1-sdk = { version = "=3.0.0" }
sp1-zkvm = { version = "=3.0.0" }
sp1-helper = { version = "=3.0.0" }

# alloy
alloy-rlp = { version = "0.3.4", default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions host/config/chain_spec_list_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@
"verifier_address_forks": {
"HEKLA": {
"SGX": "0xb0f3186FC1963f774f52ff455DC86aEdD0b31F81",
"SP1": "0x0000000000000000000000000000000000000000",
"RISC0": "0x0000000000000000000000000000000000000000"
"SP1": "0x5c44f2239925b0d86d2BFEe539f19CD0A08Af452",
"RISC0": "0x55902b2D3DF2A65370A89C86Ae9dd71Ecd508edc"
},
"ONTAKE": {
"SGX": "0xb0f3186FC1963f774f52ff455DC86aEdD0b31F81",
"SP1": "0x0000000000000000000000000000000000000000",
"RISC0": "0x0000000000000000000000000000000000000000"
"SP1": "0x5c44f2239925b0d86d2BFEe539f19CD0A08Af452",
"RISC0": "0x55902b2D3DF2A65370A89C86Ae9dd71Ecd508edc"
}
},
"genesis_time": 0,
Expand Down
2 changes: 1 addition & 1 deletion provers/risc0/driver/src/methods/risc0_aggregation.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub const RISC0_AGGREGATION_ELF: &[u8] =
include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-aggregation");
pub const RISC0_AGGREGATION_ID: [u32; 8] = [
3597901240, 347325416, 3317656102, 3291080048, 86415258, 1347371281, 3482575988, 4094302300,
2333673138, 1389402087, 4157868707, 3509779465, 4233333805, 3247956400, 2845161127, 4015834081,
];
2 changes: 1 addition & 1 deletion provers/risc0/driver/src/methods/risc0_guest.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub const RISC0_GUEST_ELF: &[u8] =
include_bytes!("../../../guest/target/riscv32im-risc0-zkvm-elf/release/risc0-guest");
pub const RISC0_GUEST_ID: [u32; 8] = [
2705224968, 672422473, 3589767632, 3895344282, 3642477750, 1142566656, 2251137472, 1131663031,
643196937, 1246728629, 1886769928, 130762256, 177277998, 252070675, 1250330519, 622696287,
];
24 changes: 24 additions & 0 deletions provers/risc0/guest/Cargo.lock

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

1 change: 1 addition & 0 deletions provers/risc0/guest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ raiko-lib = { path = "../../../lib", features = ["std", "risc0"] }
risc0-zkvm = { version = "=1.1.2", default-features = false, features = [
'std',
"getrandom",
"heap-embedded-alloc"
] }
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" }
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" }
Expand Down
5 changes: 1 addition & 4 deletions provers/sp1/driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ impl Prover for Sp1Prover {
output.header.number
);
network_prover
.wait_proof::<sp1_sdk::SP1ProofWithPublicValues>(
&proof_id,
Some(Duration::from_secs(3600)),
)
.wait_proof(&proof_id, Some(Duration::from_secs(3600)))
.await
.map_err(|e| ProverError::GuestError(format!("Sp1: network proof failed {e:?}")))?
};
Expand Down
Loading

0 comments on commit 831efbe

Please sign in to comment.