Skip to content

Commit

Permalink
print vk/image_id after build
Browse files Browse the repository at this point in the history
Signed-off-by: smtmfft <smtm@taiko.xyz>
  • Loading branch information
smtmfft committed Sep 16, 2024
1 parent 2d7d429 commit ed28bd5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

8 changes: 5 additions & 3 deletions pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"


[dependencies]
cargo_metadata = { workspace = true}
cargo_metadata = { workspace = true }
chrono = { workspace = true }
cfg-if = { workspace = true }
regex = { workspace = true }
Expand All @@ -16,7 +16,9 @@ anyhow = { workspace = true }
dirs = { workspace = true }
risc0-binfmt = { workspace = true, optional = true }
pathdiff = { workspace = true, optional = true }
hex = { workspace = true, optional = true }
sp1-sdk = { workspace = true, optional = true }

[features]
risc0 = ["dep:risc0-binfmt", "dep:pathdiff"]
sp1 = []
risc0 = ["dep:risc0-binfmt", "dep:pathdiff", "dep:hex"]
sp1 = ["dep:sp1-sdk"]
5 changes: 5 additions & 0 deletions pipeline/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl Executor {

#[cfg(feature = "sp1")]
pub fn sp1_placement(&self, dest: &str) -> anyhow::Result<()> {
use sp1_sdk::{CpuProver, HashableKey, Prover};
use std::fs;

let root = crate::ROOT_DIR.get().expect("No reference to ROOT_DIR");
Expand All @@ -96,6 +97,10 @@ impl Executor {
)?;

println!("Write elf from\n {src:?}\nto\n {dest:?}");
let elf = std::fs::read(&dest.join(&name.replace('_', "-")))?;
let prover = CpuProver::new();
let key_pair = prover.setup(&elf);
println!("sp1 elf vk is: {}", key_pair.1.bytes32());
}

Ok(())
Expand Down
1 change: 1 addition & 0 deletions pipeline/src/risc0_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ impl GuestListEntry {
let elf = std::fs::read(elf_path)?;
let image_id = risc0_binfmt::compute_image_id(&elf)?;

println!("risc0 elf image id: {}", hex::encode(image_id.as_bytes()));
Ok(Self {
name: Cow::Owned(name.to_owned()),
elf: Cow::Owned(elf),
Expand Down
Binary file modified provers/sp1/guest/elf/sp1-guest
Binary file not shown.

0 comments on commit ed28bd5

Please sign in to comment.