diff --git a/Cargo.lock b/Cargo.lock index c4bbc0da..f455865d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1545,6 +1545,7 @@ dependencies = [ "glob", "hex", "libc", + "serde", ] [[package]] @@ -4870,7 +4871,7 @@ dependencies = [ "axum", "bincode", "bytemuck", - "c-kzg", + "c-kzg-taiko", "cap", "cfg-if", "clap 4.5.4", @@ -4972,7 +4973,7 @@ dependencies = [ "alloy-sol-types", "anyhow", "bincode", - "c-kzg", + "c-kzg-taiko", "hex-literal", "once_cell", "revm-primitives", @@ -5294,7 +5295,7 @@ dependencies = [ [[package]] name = "revm" version = "8.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "auto_impl", "cfg-if", @@ -5308,7 +5309,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "4.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "revm-primitives", "serde", @@ -5317,10 +5318,10 @@ dependencies = [ [[package]] name = "revm-precompile" version = "6.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "aurora-engine-modexp", - "c-kzg", + "c-kzg-taiko", "cfg-if", "k256", "once_cell", @@ -5334,13 +5335,13 @@ dependencies = [ [[package]] name = "revm-primitives" version = "3.1.1" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "alloy-primitives", "auto_impl", "bitflags 2.5.0", "bitvec", - "c-kzg", + "c-kzg-taiko", "cfg-if", "derive_more", "dyn-clone", diff --git a/Cargo.toml b/Cargo.toml index 0721e12d..df850485 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,10 +35,11 @@ raiko-lib = { path = "./lib", features = ["std"] } raiko-primitives = { path = "./primitives" } # revm -revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "feat/zk-op", default-features = false } -revm = { git = "https://github.com/taikoxyz/revm.git", branch = "feat/zk-op", default-features = false, features = [ +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko_v2", default-features = false } +revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko_v2", default-features = false, features = [ "serde", "std", + "c-kzg", "taiko", ] } @@ -130,8 +131,7 @@ reqwest = { version = "0.11.22", features = ["json"] } url = "2.5.0" # crypto -c-kzg = "1.0.0" -c-kzg-taiko = { git = "https://github.com/smtmfft/c-kzg-4844", branch = "for-alpha7", default-features = false, features = [ +c-kzg = { package = "c-kzg-taiko", git = "https://github.com/smtmfft/c-kzg-4844", branch = "for-alpha7", default-features = false, features = [ "preload-kzg-settings", "no-threads", ] } diff --git a/host/config/chain_spec_list_default.json b/host/config/chain_spec_list_default.json index a529e0d2..e80a1e6c 100644 --- a/host/config/chain_spec_list_default.json +++ b/host/config/chain_spec_list_default.json @@ -56,7 +56,7 @@ "l1_contract": null, "l2_contract": null, "rpc": "https://ethereum-holesky-rpc.publicnode.com", - "beacon_rpc": "https://api.holesky.blobscan.com", + "beacon_rpc": "https://fabled-weathered-cherry.ethereum-holesky.quiknode.pro/8f1c66935fa5f9afbda0db43318fe3c9e7b061e1/", "sgx_verifier_address": null, "genesis_time": 1695902400, "seconds_per_slot": 12, diff --git a/host/src/preflight.rs b/host/src/preflight.rs index d61fba51..7cc1552e 100644 --- a/host/src/preflight.rs +++ b/host/src/preflight.rs @@ -83,67 +83,63 @@ pub async fn preflight( }; measurement.stop(); - let input = - GuestInput { - chain_spec: taiko_chain_spec.clone(), - block_number, - gas_used: block.header.gas_used.try_into().map_err(|_| { - HostError::Conversion("Failed converting gas used to u64".to_string()) - })?, - block_hash_reference: hash, - block_header_reference: to_header(&block.header), - beneficiary: block.header.miner, - gas_limit: block.header.gas_limit.try_into().map_err(|_| { - HostError::Conversion("Failed converting gas limit to u64".to_string()) - })?, - timestamp: block.header.timestamp, - extra_data: block.header.extra_data.clone(), - mix_hash: if let Some(mix_hash) = block.header.mix_hash { - mix_hash - } else { - return Err(HostError::Preflight( - "No mix hash for the requested block".to_owned(), - )); + let input = GuestInput { + chain_spec: taiko_chain_spec.clone(), + block_number, + block_hash_reference: hash, + block_header_reference: to_header(&block.header), + beneficiary: block.header.miner, + gas_limit: block + .header + .gas_limit + .try_into() + .map_err(|_| HostError::Conversion("Failed converting gas limit to u64".to_string()))?, + timestamp: block.header.timestamp, + extra_data: block.header.extra_data.clone(), + mix_hash: if let Some(mix_hash) = block.header.mix_hash { + mix_hash + } else { + return Err(HostError::Preflight( + "No mix hash for the requested block".to_owned(), + )); + }, + withdrawals: block.withdrawals.clone().unwrap_or_default(), + parent_state_trie: Default::default(), + parent_storage: Default::default(), + contracts: Default::default(), + parent_header: to_header(&parent_block.header), + ancestor_headers: Default::default(), + base_fee_per_gas: block.header.base_fee_per_gas.map_or_else( + || { + Err(HostError::Preflight( + "No base fee per gas for the requested block".to_owned(), + )) }, - withdrawals: block.withdrawals.clone().unwrap_or_default(), - parent_state_trie: Default::default(), - parent_storage: Default::default(), - contracts: Default::default(), - parent_header: to_header(&parent_block.header), - ancestor_headers: Default::default(), - base_fee_per_gas: block.header.base_fee_per_gas.map_or_else( - || { - Err(HostError::Preflight( - "No base fee per gas for the requested block".to_owned(), - )) - }, - |base_fee_per_gas| { - base_fee_per_gas.try_into().map_err(|_| { - HostError::Conversion( - "Failed converting base fee per gas to u64".to_owned(), - ) - }) - }, - )?, - blob_gas_used: block.header.blob_gas_used.map_or_else( - || Ok(None), - |b: u128| -> HostResult> { - b.try_into().map(Some).map_err(|_| { - HostError::Conversion("Failed converting blob gas used to u64".to_owned()) - }) - }, - )?, - excess_blob_gas: block.header.excess_blob_gas.map_or_else( - || Ok(None), - |b: u128| -> HostResult> { - b.try_into().map(Some).map_err(|_| { - HostError::Conversion("Failed converting excess blob gas to u64".to_owned()) - }) - }, - )?, - parent_beacon_block_root: block.header.parent_beacon_block_root, - taiko: taiko_guest_input, - }; + |base_fee_per_gas| { + base_fee_per_gas.try_into().map_err(|_| { + HostError::Conversion("Failed converting base fee per gas to u64".to_owned()) + }) + }, + )?, + blob_gas_used: block.header.blob_gas_used.map_or_else( + || Ok(None), + |b: u128| -> HostResult> { + b.try_into().map(Some).map_err(|_| { + HostError::Conversion("Failed converting blob gas used to u64".to_owned()) + }) + }, + )?, + excess_blob_gas: block.header.excess_blob_gas.map_or_else( + || Ok(None), + |b: u128| -> HostResult> { + b.try_into().map(Some).map_err(|_| { + HostError::Conversion("Failed converting excess blob gas to u64".to_owned()) + }) + }, + )?, + parent_beacon_block_root: block.header.parent_beacon_block_root, + taiko: taiko_guest_input, + }; // Create the block builder, run the transactions and extract the DB let provider_db = ProviderDb::new( @@ -177,7 +173,6 @@ pub async fn preflight( } num_iterations += 1; } - builder = builder.prepare_header::()?; let provider_db = builder.mut_db().unwrap(); // Gather inclusion proofs for the initial and final state diff --git a/host/src/raiko.rs b/host/src/raiko.rs index c6822529..96801c6b 100644 --- a/host/src/raiko.rs +++ b/host/src/raiko.rs @@ -116,7 +116,8 @@ impl Raiko { assert_eq!( Into::>::into(header.hash().0), input.block_hash_reference, - "block hash unexpected" + "block hash unexpected for block {}", + input.block_number, ); let output = GuestOutput::Success { header, hash: pi }; diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 68ad7069..6d2ac371 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -24,7 +24,7 @@ serde_with = { workspace = true, optional = true } thiserror-no-std = { workspace = true } url = { workspace = true } hex = { workspace = true } -c-kzg-taiko = { workspace = true } +c-kzg = { workspace = true } sha2 = { workspace = true } cfg-if = { workspace = true } diff --git a/lib/src/consts.rs b/lib/src/consts.rs index 4bc6ed49..7ef7373a 100644 --- a/lib/src/consts.rs +++ b/lib/src/consts.rs @@ -83,6 +83,13 @@ impl SupportedChainSpecs { pub fn get_chain_spec(&self, network: &String) -> Option { self.0.get(network).cloned() } + + pub fn get_chain_spec_with_chain_id(&self, chain_id: u64) -> Option { + self.0 + .values() + .find(|spec| spec.chain_id == chain_id) + .map(|spec| spec.clone()) + } } /// The condition at which a fork is activated. diff --git a/lib/src/input.rs b/lib/src/input.rs index ebbfd46b..cb183713 100644 --- a/lib/src/input.rs +++ b/lib/src/input.rs @@ -41,8 +41,6 @@ pub struct GuestInput { pub chain_spec: ChainSpec, /// Block number pub block_number: u64, - /// Block gas used - pub gas_used: u64, /// Block hash - for reference! pub block_hash_reference: B256, /// Block header - for reference! diff --git a/lib/src/protocol_instance.rs b/lib/src/protocol_instance.rs index 58d1aa87..3b427a8e 100644 --- a/lib/src/protocol_instance.rs +++ b/lib/src/protocol_instance.rs @@ -2,7 +2,7 @@ use alloy_consensus::Header as AlloyConsensusHeader; use alloy_primitives::{Address, TxHash, B256}; use alloy_sol_types::SolValue; use anyhow::{ensure, Result}; -use c_kzg_taiko::{Blob, KzgCommitment, KzgSettings}; +use c_kzg::{Blob, KzgCommitment, KzgSettings}; use raiko_primitives::keccak::keccak; use sha2::{Digest as _, Sha256}; @@ -10,6 +10,7 @@ use super::utils::ANCHOR_GAS_LIMIT; #[cfg(not(feature = "std"))] use crate::no_std::*; use crate::{ + consts::SupportedChainSpecs, input::{BlockMetadata, EthDeposit, GuestInput, Transition}, utils::HeaderHasher, }; @@ -114,6 +115,42 @@ pub fn assemble_protocol_instance( TxHash::from(keccak(input.taiko.tx_data.as_slice())) }; + // If the passed in chain spec contains a known chain id, the chain spec NEEDS to match the + // one we expect, because the prover could otherwise just fill in any values. + // The chain id is used because that is the value that is put onchain, + // and so all other chain data needs to be derived from it. + // For unknown chain ids we just skip this check so that tests using test data can still pass. + // TODO: we should probably split things up in critical and non-critical parts + // in the chain spec itself so we don't have to manually all the ones we have to care about. + if let Some(verified_chain_spec) = + SupportedChainSpecs::default().get_chain_spec_with_chain_id(input.chain_spec.chain_id) + { + assert_eq!( + input.chain_spec.max_spec_id, verified_chain_spec.max_spec_id, + "unexpected max_spec_id" + ); + assert_eq!( + input.chain_spec.hard_forks, verified_chain_spec.hard_forks, + "unexpected hard_forks" + ); + assert_eq!( + input.chain_spec.eip_1559_constants, verified_chain_spec.eip_1559_constants, + "unexpected eip_1559_constants" + ); + assert_eq!( + input.chain_spec.l1_contract, verified_chain_spec.l1_contract, + "unexpected l1_contract" + ); + assert_eq!( + input.chain_spec.l2_contract, verified_chain_spec.l2_contract, + "unexpected l2_contract" + ); + assert_eq!( + input.chain_spec.is_taiko, verified_chain_spec.is_taiko, + "unexpected eip_1559_constants" + ); + } + let deposits = input .withdrawals .iter() diff --git a/primitives/src/mpt.rs b/primitives/src/mpt.rs index 2e6fc61c..9680f7a4 100644 --- a/primitives/src/mpt.rs +++ b/primitives/src/mpt.rs @@ -633,7 +633,7 @@ impl MptNode { /// the value and returns `false`. #[inline] pub fn insert(&mut self, key: &[u8], value: Vec) -> Result { - assert!(value.is_empty(), "value must not be empty"); + assert!(!value.is_empty(), "value must not be empty"); self.insert_internal(&to_nibs(key), value) } diff --git a/provers/risc0/guest/Cargo.lock b/provers/risc0/guest/Cargo.lock index 61f9e5b7..bc5bf897 100644 --- a/provers/risc0/guest/Cargo.lock +++ b/provers/risc0/guest/Cargo.lock @@ -718,6 +718,7 @@ dependencies = [ "glob", "hex", "libc", + "serde", ] [[package]] @@ -1837,7 +1838,7 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "revm" version = "8.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "auto_impl", "cfg-if", @@ -1851,7 +1852,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "4.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "revm-primitives", "serde", @@ -1860,10 +1861,10 @@ dependencies = [ [[package]] name = "revm-precompile" version = "6.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "aurora-engine-modexp", - "c-kzg", + "c-kzg-taiko", "cfg-if", "k256 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", @@ -1877,18 +1878,20 @@ dependencies = [ [[package]] name = "revm-primitives" version = "3.1.1" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "alloy-primitives", "auto_impl", "bitflags", "bitvec", - "c-kzg", + "c-kzg-taiko", "cfg-if", + "derive_more", "dyn-clone", "enumn", "hashbrown 0.14.5", "hex", + "once_cell", "serde", ] diff --git a/provers/risc0/guest/Cargo.toml b/provers/risc0/guest/Cargo.toml index 4ed82de0..9f0690cf 100644 --- a/provers/risc0/guest/Cargo.toml +++ b/provers/risc0/guest/Cargo.toml @@ -21,14 +21,13 @@ path = "src/benchmark/ecdsa.rs" raiko-primitives = { path = "../../../primitives" } raiko-lib = { path = "../../../lib", features = ["std", "risc0"] } risc0-zkvm = { version = "0.21.0", default-features = false, features = ['std', "getrandom"] } -revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "feat/zk-op", default-features = false, features = [ - "taiko", - "std", -] } -revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "feat/zk-op", default-features = false, features = [ +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko_v2", default-features = false, features = [ "taiko", "std", + "c-kzg", ] } +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko_v2", default-features = false } + k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.0" } sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.6-risczero.0" } crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.2-risczero.0" } @@ -38,4 +37,3 @@ harness = { path = "../../../harness/macro", features = ["risc0"]} [patch.crates-io] # Can't use ZkOp since it's big int optimization used everywhere crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.2-risczero.0" } - diff --git a/provers/risc0/guest/src/zk_op.rs b/provers/risc0/guest/src/zk_op.rs index 3995c64b..b1157903 100644 --- a/provers/risc0/guest/src/zk_op.rs +++ b/provers/risc0/guest/src/zk_op.rs @@ -46,7 +46,7 @@ impl ZkvmOperator for Risc0Operator { // parse signature let mut sig = Signature::from_slice(sig.as_slice()).map_err(|_| { - Error::ZkvmOperatrion("Patched k256 deserialize signature failed".to_string()) + Error::ZkvmOperation("Patched k256 deserialize signature failed".to_string()) })?; // normalize signature and flip recovery id if needed. if let Some(sig_normalized) = sig.normalize_s() { @@ -56,7 +56,7 @@ impl ZkvmOperator for Risc0Operator { let recid = RecoveryId::from_byte(recid).expect("recovery ID is valid"); // recover key let recovered_key = VerifyingKey::recover_from_prehash(&msg[..], &sig, recid) - .map_err(|_| Error::ZkvmOperatrion("Patched k256 recover key failed".to_string()))?; + .map_err(|_| Error::ZkvmOperation("Patched k256 recover key failed".to_string()))?; // hash it let mut hash = revm_primitives::keccak256( &recovered_key @@ -74,14 +74,14 @@ harness::zk_suits!( pub mod tests { #[test] pub fn test_sha256() { - + use harness::*; use raiko_primitives::hex; use risc0_sha2::{Digest, Sha256}; let test_ves = [ ("", hex!("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")), - ( "The quick brown fox jumps over the lazy dog", + ( "The quick brown fox jumps over the lazy dog", hex!("d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592") ), ("hello", hex!("2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824")), diff --git a/provers/sp1/guest/Cargo.lock b/provers/sp1/guest/Cargo.lock index f9b598db..690b650c 100644 --- a/provers/sp1/guest/Cargo.lock +++ b/provers/sp1/guest/Cargo.lock @@ -588,6 +588,7 @@ dependencies = [ "glob", "hex", "libc", + "serde", ] [[package]] @@ -1665,7 +1666,7 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "revm" version = "8.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "auto_impl", "cfg-if", @@ -1679,7 +1680,7 @@ dependencies = [ [[package]] name = "revm-interpreter" version = "4.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "revm-primitives", "serde", @@ -1688,10 +1689,10 @@ dependencies = [ [[package]] name = "revm-precompile" version = "6.0.0" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "aurora-engine-modexp", - "c-kzg", + "c-kzg-taiko", "cfg-if", "k256", "once_cell", @@ -1705,18 +1706,20 @@ dependencies = [ [[package]] name = "revm-primitives" version = "3.1.1" -source = "git+https://github.com/taikoxyz/revm.git?branch=feat/zk-op#2733b062c075d11f09b15138be9a47801fa3c775" +source = "git+https://github.com/taikoxyz/revm.git?branch=v35_taiko_v2#a5c01f345f4362f4d5d8bbddf37e9d8aeb27b0d3" dependencies = [ "alloy-primitives", "auto_impl", "bitflags", "bitvec", - "c-kzg", + "c-kzg-taiko", "cfg-if", + "derive_more", "dyn-clone", "enumn", "hashbrown 0.14.5", "hex", + "once_cell", "serde", ] diff --git a/provers/sp1/guest/Cargo.toml b/provers/sp1/guest/Cargo.toml index 72fd73bc..66218400 100644 --- a/provers/sp1/guest/Cargo.toml +++ b/provers/sp1/guest/Cargo.toml @@ -37,14 +37,12 @@ path = "src/benchmark/bn254_mul.rs" [dependencies] raiko-lib = { path = "../../../lib", features = ["std", "sp1"] } sp1-zkvm ={ git = "https://github.com/succinctlabs/sp1.git", branch = "main" } -revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "feat/zk-op", default-features = false, features = [ - "taiko", - "std", -] } -revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "feat/zk-op", default-features = false, features = [ +revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko_v2", default-features = false, features = [ "taiko", "std", + "c-kzg", ] } +revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v35_taiko_v2", default-features = false } sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "v0.10.8" } sp1-precompiles = { git = "https://github.com/succinctlabs/sp1.git", branch = "main"} harness-core = { path = "../../../harness/core" } diff --git a/provers/sp1/guest/elf/sp1-guest b/provers/sp1/guest/elf/sp1-guest index 5d17b0a5..fc56a297 100755 Binary files a/provers/sp1/guest/elf/sp1-guest and b/provers/sp1/guest/elf/sp1-guest differ diff --git a/provers/sp1/guest/src/zk_op.rs b/provers/sp1/guest/src/zk_op.rs index 77355f9f..70dcfcf3 100644 --- a/provers/sp1/guest/src/zk_op.rs +++ b/provers/sp1/guest/src/zk_op.rs @@ -27,7 +27,7 @@ impl ZkvmOperator for Sp1Operator { .map(|chunk| u32::from_le_bytes(chunk.try_into().unwrap())) .collect::>() .try_into() - .map_err(|e| Error::ZkvmOperatrion("Input point processing failed".to_string()))?; + .map_err(|e| Error::ZkvmOperation("Input point processing failed".to_string()))?; p.mul_assign(&k); Ok(point_to_be_bytes(p)) @@ -64,7 +64,7 @@ impl ZkvmOperator for Sp1Operator { sig_id[..64].copy_from_slice(sig); sig_id[64] = recid; let recovered_key = sp1_precompiles::secp256k1::ecrecover(&sig_id, msg) - .map_err(|e| Error::ZkvmOperatrion(e.to_string()))?; + .map_err(|e| Error::ZkvmOperation(e.to_string()))?; let mut hash = keccak256(&recovered_key[1..]);