forked from casper-network/casper-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reapply "add risc0 receipt verifier host function"
This reverts commit 2aa35fa.
- Loading branch information
Showing
97 changed files
with
5,807 additions
and
2,592 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "casper-execution-engine" | ||
version = "7.0.0" # when updating, also update 'html_root_url' in lib.rs | ||
version = "7.0.1" # when updating, also update 'html_root_url' in lib.rs | ||
authors = ["Henry Till <[email protected]>", "Ed Hastings <[email protected]>"] | ||
edition = "2021" | ||
description = "Casper execution engine crates." | ||
|
@@ -13,7 +13,7 @@ license = "Apache-2.0" | |
[dependencies] | ||
anyhow = "1.0.33" | ||
base16 = "0.2.1" | ||
bincode = "1.3.1" | ||
#bincode = "1.3.1" | ||
casper-hashing = { version = "3.0.0", path = "../hashing" } | ||
casper-types = { version = "4.0.1", path = "../types", default-features = false, features = ["datasize", "gens", "json-schema"] } | ||
casper-wasm = { version = "0.46.0", default-features = false } | ||
|
@@ -48,6 +48,9 @@ thiserror = "1.0.18" | |
tracing = "0.1.18" | ||
uint = "0.9.0" | ||
uuid = { version = "0.8.1", features = ["serde", "v4"] } | ||
risc0-zkvm = { version="0.21.0" } | ||
kairos-risc0-types = { path="../kairos-risc0-types" } | ||
bincode = "1.3.3" | ||
|
||
[dev-dependencies] | ||
assert_matches = "1.3.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use risc0_zkvm::{default_prover, ExecutorEnv, Receipt}; | ||
use kairos_risc0_types::RiscZeroProof; | ||
use serde_json; | ||
use bincode; | ||
|
||
#[doc(hidden)] | ||
pub fn verify<T: AsRef<[u8]>>( | ||
proof_serialized: T | ||
) -> [u8;1]{ | ||
let risc0_proof: RiscZeroProof = bincode::deserialize(&proof_serialized.as_ref()).unwrap(); | ||
let receipt: Receipt = bincode::deserialize(&risc0_proof.receipt_serialized).unwrap(); | ||
let program_id: [u32;8] = risc0_proof.program_id.try_into().unwrap(); | ||
match receipt.verify(program_id){ | ||
Ok(_) => [1], | ||
Err(_) => [0] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.