Skip to content

Commit

Permalink
fix(raiko): make kzg work on SP1 (#205)
Browse files Browse the repository at this point in the history
* fix kzg for SP1

* fix ci
  • Loading branch information
Brechtpd authored May 15, 2024
1 parent dc0a427 commit 027c3ae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ prometheus = { version = "0.13.3", features = ["process"] }
c-kzg = "1.0.0"
c-kzg-taiko = { git = "https://github.com/smtmfft/c-kzg-4844", branch = "for-alpha7", default-features = false, features = [
"preload-kzg-settings",
"no-threads",
] }
sha3 = { version = "0.10", default-features = false }
sha2 = "0.10.8"
Expand Down
6 changes: 4 additions & 2 deletions host/src/raiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ mod tests {
async fn test_prove_block_taiko_a7() {
let proof_type = get_proof_type_from_env();
let network = Network::TaikoA7;
let block_number = 105987;
// Give the CI an simpler block to test because it doesn't have enough memory.
// Unfortunately that also means that kzg is not getting fully verified by CI.
let block_number = if is_ci() { 105987 } else { 101368 };
let chain_spec = get_network_spec(network);
let proof_request = ProofRequest {
block_number,
Expand All @@ -290,7 +292,7 @@ mod tests {
async fn test_prove_block_ethereum() {
let proof_type = get_proof_type_from_env();
// Skip test on SP1 for now because it's too slow on CI
if proof_type != ProofType::Sp1 {
if !(is_ci() && proof_type == ProofType::Sp1) {
let network = Network::Ethereum;
let block_number = 19707175;
let chain_spec = get_network_spec(network);
Expand Down
7 changes: 6 additions & 1 deletion provers/risc0/builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ impl Pipeline for Risc0Pipeline {
"panic=abort",
])
.cc_compiler("gcc".into())
.c_flags(&["/opt/riscv/bin/riscv32-unknown-elf-gcc"])
.c_flags(&[
"/opt/riscv/bin/riscv32-unknown-elf-gcc",
"-march=rv32im",
"-mstrict-align",
"-falign-functions=2",
])
.custom_args(&["--ignore-rust-version"]);
// Cannot use /.rustup/toolchains/risc0/bin/cargo, use regular cargo
builder.unset_cargo();
Expand Down
7 changes: 6 additions & 1 deletion provers/sp1/builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ impl Pipeline for Sp1Pipeline {
"panic=abort",
])
.cc_compiler("gcc".into())
.c_flags(&["/opt/riscv/bin/riscv32-unknown-elf-gcc", "-mstrict-align"])
.c_flags(&[
"/opt/riscv/bin/riscv32-unknown-elf-gcc",
"-march=rv32im",
"-mstrict-align",
"-falign-functions=2",
])
.custom_args(&["--ignore-rust-version"])
}

Expand Down

0 comments on commit 027c3ae

Please sign in to comment.