Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.
Open
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
238 changes: 38 additions & 200 deletions Cargo.lock

Large diffs are not rendered by default.

32 changes: 25 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
[workspace]
resolver = "2"
exclude = [
"provers/zisk/guest",
]
members = [
"lib",
"host",
"harness/core",
"harness/macro",
"provers/sp1/driver",
"provers/sp1/builder",
"provers/risc0/driver",
"provers/risc0/builder",
"provers/sgx/prover",
"provers/sgx/guest",
"provers/sgx/setup",
"pipeline",
"core",
"taskdb",
"redis-derive",
"reqpool",
"reqactor",
"ballot",
"provers/zisk/driver",
"provers/zisk/builder",
]

# Conditional members based on target/features
[workspace.metadata.conditional-members]
sp1 = [
"provers/sp1/driver",
"provers/sp1/builder",
]
risc0 = [
"provers/risc0/driver",
"provers/risc0/builder",
]
zisk = [
"provers/zisk/driver",
"provers/zisk/builder",
]
sgx = [
"provers/sgx/prover",
"provers/sgx/guest",
"provers/sgx/setup",
]

# Always optimize; building and running the guest takes much longer without optimization.
Expand Down
5 changes: 3 additions & 2 deletions ballot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ mod tests {
#[test]
fn test_draw_deserialize() {
{
let serialized = "{\"Sp1\":[0.1, 100],\"Risc0\":[0.2, 100]}";
let serialized = "{\"Sp1\":[0.1, 100],\"Risc0\":[0.2, 100],\"Zisk\":[0.15, 100]}";
let probs: BTreeMap<ProofType, (f64, u64)> = serde_json::from_str(serialized).unwrap();
let ballot = Ballot::new(probs).unwrap();
assert_eq!(ballot.probabilities.len(), 2);
assert_eq!(ballot.probabilities.len(), 3);
assert_eq!(ballot.probabilities.get(&ProofType::Sp1), Some(&0.1));
assert_eq!(ballot.probabilities.get(&ProofType::Risc0), Some(&0.2));
assert_eq!(ballot.probabilities.get(&ProofType::Zisk), Some(&0.15));
}
{
let serialized = "{}";
Expand Down
2 changes: 2 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ edition = "2021"
# provers
sp1-driver = { path = "../provers/sp1/driver", optional = true }
risc0-driver = { path = "../provers/risc0/driver", optional = true }
zisk-driver = { path = "../provers/zisk/driver", optional = true }
sgx-prover = { path = "../provers/sgx/prover", optional = true }

# raiko
Expand Down Expand Up @@ -77,5 +78,6 @@ default = ["statedb_lru"]
# powdr = ["dep:powdr"]
sp1 = ["dep:sp1-driver", "sp1-driver/enable"]
risc0 = ["dep:risc0-driver", "risc0-driver/enable"]
zisk = ["dep:zisk-driver", "zisk-driver/enable"]
sgx = ["dep:sgx-prover", "sgx-prover/enable"]
statedb_lru = []
39 changes: 39 additions & 0 deletions core/src/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ pub async fn run_prover(
#[cfg(not(feature = "sgx"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
ProofType::Zisk => {
#[cfg(feature = "zisk")]
return zisk_driver::ZiskProver
.run(input.clone(), output, config, store)
.await
.map_err(|e| e.into());
#[cfg(not(feature = "zisk"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
}
}

Expand Down Expand Up @@ -163,6 +172,15 @@ pub async fn run_batch_prover(
#[cfg(not(feature = "sgx"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
ProofType::Zisk => {
#[cfg(feature = "zisk")]
return zisk_driver::ZiskProver
.batch_run(input.clone(), output, config, store)
.await
.map_err(|e| e.into());
#[cfg(not(feature = "zisk"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
}
}

Expand Down Expand Up @@ -206,6 +224,15 @@ pub async fn aggregate_proofs(
#[cfg(not(feature = "sgx"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
ProofType::Zisk => {
#[cfg(feature = "zisk")]
return zisk_driver::ZiskProver
.aggregate(input.clone(), output, config, store)
.await
.map_err(|e| e.into());
#[cfg(not(feature = "zisk"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
}?;

Ok(proof)
Expand Down Expand Up @@ -248,6 +275,15 @@ pub async fn cancel_proof(
#[cfg(not(feature = "sgx"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
ProofType::Zisk => {
#[cfg(feature = "zisk")]
return zisk_driver::ZiskProver
.cancel(proof_key, read)
.await
.map_err(|e| e.into());
#[cfg(not(feature = "zisk"))]
Err(RaikoError::FeatureNotSupportedError(proof_type))
}
}?;
Ok(())
}
Expand Down Expand Up @@ -416,6 +452,8 @@ pub struct ProverSpecificOpts {
pub sp1: Option<Value>,
/// RISC0 prover specific options.
pub risc0: Option<Value>,
/// Zisk prover specific options.
pub zisk: Option<Value>,
}

impl<S: ::std::hash::BuildHasher + ::std::default::Default> From<ProverSpecificOpts>
Expand All @@ -428,6 +466,7 @@ impl<S: ::std::hash::BuildHasher + ::std::default::Default> From<ProverSpecificO
("sgxgeth", value.sgxgeth.clone()),
("sp1", value.sp1.clone()),
("risc0", value.risc0.clone()),
("zisk", value.zisk.clone()),
]
.into_iter()
.filter_map(|(name, value)| value.map(|v| (name.to_string(), v)))
Expand Down
1 change: 1 addition & 0 deletions host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ test-log = { workspace = true }
default = []
sp1 = ["raiko-core/sp1"]
risc0 = ["raiko-core/risc0"]
zisk = ["raiko-core/zisk"]
sgx = ["raiko-core/sgx"]
integration = []

Expand Down
5 changes: 5 additions & 0 deletions host/config/config.devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"prover": "network",
"verify": false
},
"zisk": {
"prover": "local",
"verify": true,
"execution_mode": "prove"
},
"native": {
"json_guest_input": null
}
Expand Down
5 changes: 5 additions & 0 deletions host/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
"prover": "network",
"verify": false
},
"zisk": {
"prover": "local",
"verify": true,
"execution_mode": "prove"
},
"native": {
"json_guest_input": null
}
Expand Down
5 changes: 5 additions & 0 deletions host/config/config.sgx.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"prover": "network",
"verify": true
},
"zisk": {
"prover": "local",
"verify": true,
"execution_mode": "prove"
},
"native": {
"json_guest_input": null
}
Expand Down
5 changes: 5 additions & 0 deletions host/config/config.taiko_hekla.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"prover": "network",
"verify": true
},
"zisk": {
"prover": "local",
"verify": true,
"execution_mode": "prove"
},
"sgxgeth": {
"instance_ids": {
"PACAYA": 0
Expand Down
5 changes: 5 additions & 0 deletions host/config/config.taiko_mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"prover": "network",
"verify": true
},
"zisk": {
"prover": "local",
"verify": true,
"execution_mode": "prove"
},
"sgxgeth": {
"instance_ids": {
"PACAYA": 0
Expand Down
1 change: 1 addition & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ std = [
sgx = []
sp1 = []
risc0 = []
zisk = []
sp1-cycle-tracker = []
9 changes: 9 additions & 0 deletions lib/src/proof_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ pub enum ProofType {
/// Uses the SGX on geth prover to build the block.
#[serde(alias = "SGXGETH")]
SgxGeth = 4u8,

/// # Zisk
///
/// Uses the Zisk prover to build the block.
#[serde(alias = "ZISK")]
Zisk = 5u8,
}

impl std::fmt::Display for ProofType {
Expand All @@ -42,6 +48,7 @@ impl std::fmt::Display for ProofType {
ProofType::Sgx => "sgx",
ProofType::Risc0 => "risc0",
ProofType::SgxGeth => "sgxgeth",
ProofType::Zisk => "zisk",
})
}
}
Expand All @@ -56,6 +63,7 @@ impl std::str::FromStr for ProofType {
"sgx" => Ok(ProofType::Sgx),
"risc0" => Ok(ProofType::Risc0),
"sgxgeth" => Ok(ProofType::SgxGeth),
"zisk" => Ok(ProofType::Zisk),
_ => Err(format!("Unknown proof type {}", s)),
}
}
Expand All @@ -71,6 +79,7 @@ impl TryFrom<u8> for ProofType {
2 => Ok(Self::Sgx),
3 => Ok(Self::Risc0),
4 => Ok(Self::SgxGeth),
5 => Ok(Self::Zisk),
_ => Err(format!("Unknown proof type {}", value)),
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/protocol_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ fn get_blob_proof_type(
match proof_type {
ProofType::Native => blob_proof_type_hint,
ProofType::Sgx | ProofType::SgxGeth => BlobProofType::KzgVersionedHash,
ProofType::Sp1 | ProofType::Risc0 => BlobProofType::ProofOfEquivalence,
ProofType::Sp1 | ProofType::Risc0 | ProofType::Zisk => BlobProofType::ProofOfEquivalence,
}
}

Expand Down
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ guest: ## Build the guest binary
build: # Build the project
./script/build.sh $(TARGET)

gpu: ## Build the project with GPU support (NVIDIA GPUs only)
GPU=1 ./script/build.sh $(TARGET)

run: ## Run the project
RUN=1 ./script/build.sh $(TARGET)

Expand All @@ -32,3 +35,4 @@ update: ## Run cargo update
@cargo update
cd ./provers/sp1/guest && cargo update
cd ./provers/risc0/guest && cargo update
cd ./provers/zisk/guest && cargo update
2 changes: 2 additions & 0 deletions pipeline/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ hex = { workspace = true, optional = true }
sp1-sdk = { workspace = true, optional = true }

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

Ok(())
}

#[cfg(feature = "zisk")]
pub fn zisk_placement(&self, dest: &str) -> anyhow::Result<()> {
use std::fs;

let root = crate::ROOT_DIR.get().expect("No reference to ROOT_DIR");
let dest = PathBuf::from(dest);

if !dest.exists() {
fs::create_dir_all(&dest).expect("Couldn't create destination directories");
}

for src in &self.artifacts {
let mut name = file_name(src);
if self.test {
name = format!(
"test-{}",
name.split('-').next().expect("Couldn't get test name")
);
}

let src_path = root.join(src.to_str().expect("File name is not valid UTF-8"));
let dest_path = dest.join(&name);

fs::copy(&src_path, &dest_path)?;

println!("Write Zisk elf from\n {src_path:?}\nto\n {dest_path:?}");

// TODO: Add Zisk verification key generation if supported
// For now, just display the file size and hash for verification
let elf_data = fs::read(&dest_path)?;
println!("Zisk ELF size: {} bytes", elf_data.len());

// Simple hash for verification (could use a proper hash function)
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
let mut hasher = DefaultHasher::new();
elf_data.hash(&mut hasher);
println!("Zisk ELF hash: {:016x}", hasher.finish());
}

Ok(())
}
}

fn file_name(path: &Path) -> String {
Expand Down
15 changes: 15 additions & 0 deletions provers/zisk/builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "zisk-builder"
version = "0.1.0"
edition = "2021"

[dependencies]
raiko-lib = { path = "../../../lib" }
raiko-pipeline = { path = "../../../pipeline", features = ["zisk"] }
serde = "1.0"
serde_json = "1.0"

[features]
default = ["zisk"]
zisk = []
test = []
Loading
Loading