diff --git a/emmarin/cl/bundle_risc0_proof/src/bin/bundle.rs b/emmarin/cl/bundle_risc0_proof/src/bin/bundle.rs index e5669d3..fbf5053 100644 --- a/emmarin/cl/bundle_risc0_proof/src/bin/bundle.rs +++ b/emmarin/cl/bundle_risc0_proof/src/bin/bundle.rs @@ -7,7 +7,7 @@ fn main() { for tx in &bundle_private.txs { env::verify( - <[u8; 32]>::from_hex(risc0_images::nomos_mantle_tx_risc0_proof::TX_ID).unwrap(), + <[u8; 32]>::from_hex(risc0_images::risc0_proofs::TX_ID).unwrap(), &serde::to_vec(&tx).unwrap(), ) .unwrap(); diff --git a/emmarin/cl/ledger/src/bundle.rs b/emmarin/cl/ledger/src/bundle.rs index ecdcdac..56d42c6 100644 --- a/emmarin/cl/ledger/src/bundle.rs +++ b/emmarin/cl/ledger/src/bundle.rs @@ -25,11 +25,7 @@ impl ProvedBundle { let opts = risc0_zkvm::ProverOpts::succinct(); let prove_info = prover - .prove_with_opts( - env, - risc0_images::nomos_mantle_bundle_risc0_proof::BUNDLE_ELF, - &opts, - ) + .prove_with_opts(env, risc0_images::bundle_risc0_proof::BUNDLE_ELF, &opts) .unwrap(); println!( @@ -52,10 +48,7 @@ impl ProvedBundle { pub fn verify(&self) -> bool { self.risc0_receipt - .verify( - <[u8; 32]>::from_hex(risc0_images::nomos_mantle_bundle_risc0_proof::BUNDLE_ID) - .unwrap(), - ) + .verify(<[u8; 32]>::from_hex(risc0_images::bundle_risc0_proof::BUNDLE_ID).unwrap()) .is_ok() } } diff --git a/emmarin/cl/ledger/src/ledger.rs b/emmarin/cl/ledger/src/ledger.rs index 25b20b2..fa1dc5f 100644 --- a/emmarin/cl/ledger/src/ledger.rs +++ b/emmarin/cl/ledger/src/ledger.rs @@ -77,7 +77,7 @@ impl ProvedLedgerTransition { // This struct contains the receipt along with statistics about execution of the guest let opts = risc0_zkvm::ProverOpts::succinct(); let prove_info = prover - .prove_with_opts(env, risc0_images::ledger_validity_proof::LEDGER_ELF, &opts) + .prove_with_opts(env, risc0_images::ledger_risc0_proof::LEDGER_ELF, &opts) .unwrap(); println!( @@ -101,7 +101,7 @@ impl ProvedLedgerTransition { pub fn verify(&self) -> bool { self.risc0_receipt - .verify(<[u8; 32]>::from_hex(risc0_images::ledger_validity_proof::LEDGER_ID).unwrap()) + .verify(<[u8; 32]>::from_hex(risc0_images::ledger_risc0_proof::LEDGER_ID).unwrap()) .is_ok() } } diff --git a/emmarin/cl/ledger/src/stf.rs b/emmarin/cl/ledger/src/stf.rs index e2940d3..f2bdb82 100644 --- a/emmarin/cl/ledger/src/stf.rs +++ b/emmarin/cl/ledger/src/stf.rs @@ -33,7 +33,7 @@ impl StfProof { } pub fn nop_stf() -> [u8; 32] { - FromHex::from_hex(risc0_images::nomos_mantle_risc0_proofs::STF_NOP_ID).unwrap() + FromHex::from_hex(risc0_images::risc0_proofs::STF_NOP_ID).unwrap() } pub fn prove_nop(public: StfPublic) -> Self { @@ -49,11 +49,7 @@ impl StfProof { let opts = risc0_zkvm::ProverOpts::succinct(); let prove_info = prover - .prove_with_opts( - env, - risc0_images::nomos_mantle_risc0_proofs::STF_NOP_ELF, - &opts, - ) + .prove_with_opts(env, risc0_images::risc0_proofs::STF_NOP_ELF, &opts) .unwrap(); println!( @@ -66,8 +62,7 @@ impl StfProof { let receipt = prove_info.receipt; Self { - risc0_id: FromHex::from_hex(risc0_images::nomos_mantle_risc0_proofs::STF_NOP_ID) - .unwrap(), + risc0_id: FromHex::from_hex(risc0_images::risc0_proofs::STF_NOP_ID).unwrap(), public, risc0_receipt: receipt, } diff --git a/emmarin/cl/ledger/src/tx.rs b/emmarin/cl/ledger/src/tx.rs index 3ebcd84..30eb96c 100644 --- a/emmarin/cl/ledger/src/tx.rs +++ b/emmarin/cl/ledger/src/tx.rs @@ -37,11 +37,7 @@ impl ProvedTx { // This struct contains the receipt along with statistics about execution of the guest let opts = risc0_zkvm::ProverOpts::succinct(); let prove_info = prover - .prove_with_opts( - env, - risc0_images::nomos_mantle_tx_risc0_proof::TX_ELF, - &opts, - ) + .prove_with_opts(env, risc0_images::risc0_proofs::TX_ELF, &opts) .map_err(|_| Error::Risc0ProofFailed)?; println!( @@ -62,7 +58,7 @@ impl ProvedTx { pub fn verify(&self) -> bool { self.risc0_receipt - .verify(<[u8; 32]>::from_hex(risc0_images::nomos_mantle_tx_risc0_proof::TX_ID).unwrap()) + .verify(<[u8; 32]>::from_hex(risc0_images::risc0_proofs::TX_ID).unwrap()) .is_ok() } } diff --git a/emmarin/cl/ledger_risc0_proof/src/bin/ledger.rs b/emmarin/cl/ledger_risc0_proof/src/bin/ledger.rs index 528ade1..5a457df 100644 --- a/emmarin/cl/ledger_risc0_proof/src/bin/ledger.rs +++ b/emmarin/cl/ledger_risc0_proof/src/bin/ledger.rs @@ -24,7 +24,7 @@ fn main() { } in bundles { env::verify( - <[u8; 32]>::from_hex(risc0_images::nomos_mantle_bundle_risc0_proof::BUNDLE_ID).unwrap(), + <[u8; 32]>::from_hex(risc0_images::bundle_risc0_proof::BUNDLE_ID).unwrap(), &serde::to_vec(&bundle).unwrap(), ) .unwrap(); @@ -42,8 +42,7 @@ fn main() { if let Some(ledger_update) = bundle .updates .into_iter() - .filter(|update| update.zone_id == id) - .next() + .find(|update| update.zone_id == id) { for node in &ledger_update.frontier_nodes { let past_cm_root_proof = cm_root_proofs diff --git a/emmarin/cl/risc0_images/src/lib.rs b/emmarin/cl/risc0_images/src/lib.rs index dfc3b0a..b7e5cf0 100644 --- a/emmarin/cl/risc0_images/src/lib.rs +++ b/emmarin/cl/risc0_images/src/lib.rs @@ -1,19 +1,20 @@ -pub mod nomos_mantle_risc0_proofs { +pub mod risc0_proofs { pub static STF_NOP_ID: &str = include_str!("STF_NOP_ID"); #[cfg(feature = "elf")] pub static STF_NOP_ELF: &[u8] = include_bytes!("STF_NOP_ELF"); -} -pub mod nomos_mantle_bundle_risc0_proof { - pub static BUNDLE_ID: &str = include_str!("BUNDLE_ID"); - #[cfg(feature = "elf")] - pub static BUNDLE_ELF: &[u8] = include_bytes!("BUNDLE_ELF"); -} -pub mod nomos_mantle_tx_risc0_proof { + pub static TX_ID: &str = include_str!("TX_ID"); #[cfg(feature = "elf")] pub static TX_ELF: &[u8] = include_bytes!("TX_ELF"); } -pub mod ledger_validity_proof { + +pub mod bundle_risc0_proof { + pub static BUNDLE_ID: &str = include_str!("BUNDLE_ID"); + #[cfg(feature = "elf")] + pub static BUNDLE_ELF: &[u8] = include_bytes!("BUNDLE_ELF"); +} + +pub mod ledger_risc0_proof { pub static LEDGER_ID: &str = include_str!("LEDGER_ID"); #[cfg(feature = "elf")] pub static LEDGER_ELF: &[u8] = include_bytes!("LEDGER_ELF");