Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(raiko): make kzg work on SP1 #205

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading