Skip to content

Commit

Permalink
fix kzg compilation on sp1
Browse files Browse the repository at this point in the history
  • Loading branch information
Brechtpd committed May 8, 2024
1 parent 56c46a8 commit 8f474fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
26 changes: 10 additions & 16 deletions lib/src/protocol_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,16 @@ pub fn assemble_protocol_instance(
) -> Result<ProtocolInstance> {
let blob_used = input.taiko.block_proposed.meta.blobUsed;
let tx_list_hash = if blob_used {
if cfg!(not(feature = "sp1")) {
println!("kzg check enabled!");
let mut data = Vec::from(KZG_TRUST_SETUP_DATA);
let kzg_settings = KzgSettings::from_u8_slice(&mut data);
let kzg_commit = KzgCommitment::blob_to_kzg_commitment(
&Blob::from_bytes(&input.taiko.tx_data.as_slice()).unwrap(),
&kzg_settings,
)
.unwrap();
let versioned_hash = kzg_to_versioned_hash(kzg_commit);
assert_eq!(versioned_hash, input.taiko.tx_blob_hash.unwrap());
versioned_hash
} else {
println!("kzg check disabled!");
input.taiko.tx_blob_hash.unwrap()
}
let mut data = Vec::from(KZG_TRUST_SETUP_DATA);
let kzg_settings = KzgSettings::from_u8_slice(&mut data);
let kzg_commit = KzgCommitment::blob_to_kzg_commitment(
&Blob::from_bytes(&input.taiko.tx_data.as_slice()).unwrap(),
&kzg_settings,
)
.unwrap();
let versioned_hash = kzg_to_versioned_hash(kzg_commit);
assert_eq!(versioned_hash, input.taiko.tx_blob_hash.unwrap());
versioned_hash
} else {
TxHash::from(keccak(input.taiko.tx_data.as_slice()))
};
Expand Down
2 changes: 1 addition & 1 deletion provers/sp1/builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Pipeline for Sp1Pipeline {
"panic=abort",
])
.cc_compiler("gcc".into())
.c_flags(&["/opt/riscv/bin/riscv32-unknown-elf-gcc"])
.c_flags(&["/opt/riscv/bin/riscv32-unknown-elf-gcc", "-mstrict-align"])
.custom_args(&["--ignore-rust-version"])
}

Expand Down

0 comments on commit 8f474fd

Please sign in to comment.