diff --git a/evm_arithmetization/benches/fibonacci_25m_gas.rs b/evm_arithmetization/benches/fibonacci_25m_gas.rs index f6d5fc39f..2242b3049 100644 --- a/evm_arithmetization/benches/fibonacci_25m_gas.rs +++ b/evm_arithmetization/benches/fibonacci_25m_gas.rs @@ -20,14 +20,13 @@ use evm_arithmetization::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; -use evm_arithmetization::Node; +use evm_arithmetization::{Node, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; type F = GoldilocksField; @@ -183,7 +182,7 @@ fn prepare_setup() -> anyhow::Result> { checkpoint_state_trie_root: H256(hex!( "fe07ff6d1ab215df17884b89112ccf2373597285a56c5902150313ad1a53ee57" )), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), ger_data: None, block_metadata, txn_number_before: 0.into(), diff --git a/evm_arithmetization/src/cpu/kernel/tests/add11.rs b/evm_arithmetization/src/cpu/kernel/tests/add11.rs index fe36b40e3..683987244 100644 --- a/evm_arithmetization/src/cpu/kernel/tests/add11.rs +++ b/evm_arithmetization/src/cpu/kernel/tests/add11.rs @@ -10,7 +10,6 @@ use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, Node, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField as F; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use crate::cpu::kernel::aggregator::KERNEL; use crate::cpu::kernel::interpreter::Interpreter; @@ -21,7 +20,7 @@ use crate::testing_utils::{ beacon_roots_account_nibbles, beacon_roots_contract_from_storage, preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; -use crate::GenerationInputs; +use crate::{GenerationInputs, EMPTY_CONSOLIDATED_BLOCKHASH}; #[test] fn test_add11_yml() { @@ -176,7 +175,7 @@ fn test_add11_yml() { receipts_root: receipts_trie.hash(), }; - let inputs = GenerationInputs:: { + let inputs = GenerationInputs { signed_txns: vec![txn.to_vec()], burn_addr: None, withdrawals: vec![], @@ -186,7 +185,7 @@ fn test_add11_yml() { contract_code: contract_code.clone(), block_metadata, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), txn_number_before: 0.into(), gas_used_before: 0.into(), gas_used_after: gas_used, @@ -363,7 +362,7 @@ fn test_add11_yml_with_exception() { contract_code: contract_code.clone(), block_metadata, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), txn_number_before: 0.into(), gas_used_before: 0.into(), gas_used_after: txn_gas_limit.into(), diff --git a/evm_arithmetization/src/cpu/kernel/tests/init_exc_stop.rs b/evm_arithmetization/src/cpu/kernel/tests/init_exc_stop.rs index be88021de..2dea58b55 100644 --- a/evm_arithmetization/src/cpu/kernel/tests/init_exc_stop.rs +++ b/evm_arithmetization/src/cpu/kernel/tests/init_exc_stop.rs @@ -5,7 +5,6 @@ use keccak_hash::{keccak, H256}; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField as F; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use crate::cpu::kernel::{aggregator::KERNEL, interpreter::Interpreter}; use crate::generation::{ @@ -17,6 +16,7 @@ use crate::testing_utils::{ preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; use crate::witness::{memory::MemoryAddress, state::RegistersState}; +use crate::EMPTY_CONSOLIDATED_BLOCKHASH; use crate::{ proof::{BlockHashes, BlockMetadata, TrieRoots}, GenerationInputs, Node, @@ -78,7 +78,7 @@ fn test_init_exc_stop() { receipts_root: receipts_trie.hash(), }; - let inputs = GenerationInputs:: { + let inputs = GenerationInputs { signed_txns: vec![], burn_addr: None, withdrawals: vec![], @@ -91,7 +91,7 @@ fn test_init_exc_stop() { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/src/generation/segments.rs b/evm_arithmetization/src/generation/segments.rs index 7f123aa10..51de9fa83 100644 --- a/evm_arithmetization/src/generation/segments.rs +++ b/evm_arithmetization/src/generation/segments.rs @@ -5,13 +5,13 @@ use anyhow::Result; use plonky2::hash::hash_types::RichField; use serde::{Deserialize, Serialize}; +use super::TrimmedGenerationInputs; use crate::cpu::kernel::aggregator::KERNEL; use crate::cpu::kernel::interpreter::{set_registers_and_run, ExtraSegmentData, Interpreter}; use crate::generation::state::State; use crate::generation::{debug_inputs, GenerationInputs}; use crate::witness::memory::MemoryState; use crate::witness::state::RegistersState; -use crate::AllData; /// Structure holding the data needed to initialize a segment. #[derive(Clone, Default, Debug, Serialize, Deserialize)] @@ -169,6 +169,10 @@ impl SegmentDataIterator { } } +/// Returned type from a `SegmentDataIterator`, needed to prove all segments in +/// a transaction batch. +pub type AllData = Result<(TrimmedGenerationInputs, GenerationSegmentData), SegmentError>; + impl Iterator for SegmentDataIterator { type Item = AllData; diff --git a/evm_arithmetization/src/lib.rs b/evm_arithmetization/src/lib.rs index ca2cf2bd7..1a6a4a38e 100644 --- a/evm_arithmetization/src/lib.rs +++ b/evm_arithmetization/src/lib.rs @@ -216,22 +216,10 @@ pub mod extension_tower; pub mod testing_utils; pub mod util; -use generation::segments::SegmentError; -use generation::TrimmedGenerationInputs; -use mpt_trie::partial_trie::HashedPartialTrie; - // Public definitions and re-exports - -pub type Node = mpt_trie::partial_trie::Node; -/// A type alias for `u64` of a block height. -pub type BlockHeight = u64; - -pub use all_stark::{AllStark, NUM_TABLES}; -pub use fixed_recursive_verifier::AllRecursiveCircuits; -pub use generation::segments::{GenerationSegmentData, SegmentDataIterator}; -pub use generation::GenerationInputs; +mod public_types; +pub use public_types::*; pub use starky::config::StarkConfig; -/// Returned type from a `SegmentDataIterator`, needed to prove all segments in -/// a transaction batch. -pub type AllData = Result<(TrimmedGenerationInputs, GenerationSegmentData), SegmentError>; +pub use crate::all_stark::{AllStark, NUM_TABLES}; +pub use crate::generation::segments::{GenerationSegmentData, SegmentDataIterator}; diff --git a/evm_arithmetization/src/public_types.rs b/evm_arithmetization/src/public_types.rs new file mode 100644 index 000000000..9d3de7196 --- /dev/null +++ b/evm_arithmetization/src/public_types.rs @@ -0,0 +1,67 @@ +use mpt_trie::partial_trie::HashedPartialTrie; +use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; + +use crate::{generation::segments::SegmentError, GenerationSegmentData}; + +pub type Node = mpt_trie::partial_trie::Node; +pub type BlockHeight = u64; + +use plonky2::{ + field::goldilocks_field::GoldilocksField, hash::poseidon::PoseidonHash, + plonk::config::PoseidonGoldilocksConfig, +}; + +/// The base field on which statements are being proven. +pub type Field = GoldilocksField; +/// The recursive circuit configuration to be used to shrink and aggregate +/// proofs. +pub type RecursionConfig = PoseidonGoldilocksConfig; +/// The extension degree of the field used in the proof system. +pub const EXTENSION_DEGREE: usize = 2; + +/// A type alias for EVM witness payloads. +pub type GenerationInputs = crate::generation::GenerationInputs; +/// A type alias for the trimmed version of EVM witness payloads. +pub type TrimmedGenerationInputs = crate::generation::TrimmedGenerationInputs; + +pub type Hasher = PoseidonHash; +/// A type alias for plonky2 hash outputs. +pub type Hash = >::Hash; + +pub type ConsolidatedHash = [Field; NUM_HASH_OUT_ELTS]; +pub use crate::proof::EMPTY_CONSOLIDATED_BLOCKHASH; + +/// A type alias for recursive proofs generated by the zkEVM. +pub type ProofWithPublicInputs = + plonky2::plonk::proof::ProofWithPublicInputs; + +/// A type alias for EVM public values used to generate and verify intermediate +/// proofs. +pub type PublicValues = crate::proof::PublicValues; + +pub type AllData = Result<(TrimmedGenerationInputs, GenerationSegmentData), SegmentError>; + +/// Returned type from the zkEVM STARK prover, before recursive verification. +pub type AllProof = crate::proof::AllProof; + +/// A type alias for the set of preprocessed circuits necessary to generate +/// succinct block proofs. +pub type AllRecursiveCircuits = + crate::fixed_recursive_verifier::AllRecursiveCircuits; + +/// A type alias for the recursive chains of circuits needed to shrink EVM STARK +/// proofs. +pub type RecursiveCircuitsForTableSize = + crate::fixed_recursive_verifier::RecursiveCircuitsForTableSize< + Field, + RecursionConfig, + { EXTENSION_DEGREE }, + >; + +/// A type alias for the verifier data necessary to verify succinct block +/// proofs. +/// While the prover state [`AllRecursiveCircuits`] can also verify proofs, this +/// [`VerifierData`] is much lighter, allowing anyone to verify block proofs, +/// regardless of the underlying hardware. +pub type VerifierData = + plonky2::plonk::circuit_data::VerifierCircuitData; diff --git a/evm_arithmetization/tests/add11_yml.rs b/evm_arithmetization/tests/add11_yml.rs index 5b8290229..dd9bfb1ce 100644 --- a/evm_arithmetization/tests/add11_yml.rs +++ b/evm_arithmetization/tests/add11_yml.rs @@ -14,15 +14,15 @@ use evm_arithmetization::testing_utils::{ preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::StarkConfig; -use evm_arithmetization::{AllStark, GenerationInputs, Node}; +use evm_arithmetization::{ + AllStark, GenerationInputs, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH, +}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::KeccakGoldilocksConfig; use plonky2::util::timing::TimingTree; @@ -30,7 +30,7 @@ type F = GoldilocksField; const D: usize = 2; type C = KeccakGoldilocksConfig; -fn get_generation_inputs() -> GenerationInputs { +fn get_generation_inputs() -> GenerationInputs { let beneficiary = hex!("2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"); let sender = hex!("a94f5374fce5edbc8e2a8697c15331677e6ebf0b"); let to = hex!("095e7baea6a6c7c4c2dfeb977efac326af552d87"); @@ -182,7 +182,7 @@ fn get_generation_inputs() -> GenerationInputs { receipts_root: receipts_trie.hash(), }; - GenerationInputs:: { + GenerationInputs { signed_txns: vec![txn.to_vec()], burn_addr: None, withdrawals: vec![], @@ -192,7 +192,7 @@ fn get_generation_inputs() -> GenerationInputs { contract_code, block_metadata, checkpoint_state_trie_root: state_trie_before.hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), txn_number_before: 0.into(), gas_used_before: 0.into(), gas_used_after: 0xa868u64.into(), diff --git a/evm_arithmetization/tests/erc20.rs b/evm_arithmetization/tests/erc20.rs index 2c1a56829..2baf716e7 100644 --- a/evm_arithmetization/tests/erc20.rs +++ b/evm_arithmetization/tests/erc20.rs @@ -13,14 +13,13 @@ use evm_arithmetization::testing_utils::{ init_logger, preinitialized_state_and_storage_tries, sd2u, update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig}; +use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::KeccakGoldilocksConfig; use plonky2::util::timing::TimingTree; @@ -187,7 +186,7 @@ fn test_erc20() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/tests/erc721.rs b/evm_arithmetization/tests/erc721.rs index 170a19df4..e416dc87a 100644 --- a/evm_arithmetization/tests/erc721.rs +++ b/evm_arithmetization/tests/erc721.rs @@ -14,14 +14,13 @@ use evm_arithmetization::testing_utils::{ update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig}; +use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::KeccakGoldilocksConfig; use plonky2::util::timing::TimingTree; @@ -191,7 +190,7 @@ fn test_erc721() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/tests/global_exit_root.rs b/evm_arithmetization/tests/global_exit_root.rs index a41d79e6f..193255622 100644 --- a/evm_arithmetization/tests/global_exit_root.rs +++ b/evm_arithmetization/tests/global_exit_root.rs @@ -18,7 +18,6 @@ use keccak_hash::keccak; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::PoseidonGoldilocksConfig; use plonky2::util::timing::TimingTree; @@ -105,7 +104,7 @@ fn test_global_exit_root() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/tests/log_opcode.rs b/evm_arithmetization/tests/log_opcode.rs index 44453ae22..81daf588c 100644 --- a/evm_arithmetization/tests/log_opcode.rs +++ b/evm_arithmetization/tests/log_opcode.rs @@ -18,14 +18,13 @@ use evm_arithmetization::testing_utils::{ preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig}; +use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::PoseidonGoldilocksConfig; use plonky2::util::timing::TimingTree; @@ -257,7 +256,7 @@ fn test_log_opcodes() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/tests/selfdestruct.rs b/evm_arithmetization/tests/selfdestruct.rs index 7d8ecba5b..f97dd41cd 100644 --- a/evm_arithmetization/tests/selfdestruct.rs +++ b/evm_arithmetization/tests/selfdestruct.rs @@ -13,14 +13,13 @@ use evm_arithmetization::testing_utils::{ preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig}; +use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::KeccakGoldilocksConfig; use plonky2::util::timing::TimingTree; use zk_evm_common::eth_to_wei; @@ -162,7 +161,7 @@ fn test_selfdestruct() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/tests/simple_transfer.rs b/evm_arithmetization/tests/simple_transfer.rs index 7dbf91399..a1e7fb655 100644 --- a/evm_arithmetization/tests/simple_transfer.rs +++ b/evm_arithmetization/tests/simple_transfer.rs @@ -14,14 +14,13 @@ use evm_arithmetization::testing_utils::{ preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig}; +use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; use hex_literal::hex; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::KeccakGoldilocksConfig; use plonky2::util::timing::TimingTree; use zk_evm_common::eth_to_wei; @@ -154,7 +153,7 @@ fn test_simple_transfer() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/evm_arithmetization/tests/two_to_one_block.rs b/evm_arithmetization/tests/two_to_one_block.rs index a70c43c8c..a420a223b 100644 --- a/evm_arithmetization/tests/two_to_one_block.rs +++ b/evm_arithmetization/tests/two_to_one_block.rs @@ -102,7 +102,7 @@ fn dummy_payload(timestamp: u64, is_first_payload: bool) -> anyhow::Result, + all_circuits: &AllRecursiveCircuits, all_stark: &AllStark, config: &StarkConfig, ) -> anyhow::Result> { @@ -172,7 +172,7 @@ fn test_two_to_one_block_aggregation() -> anyhow::Result<()> { let all_stark = AllStark::::default(); let config = StarkConfig::standard_fast_config(); - let all_circuits = AllRecursiveCircuits::::new( + let all_circuits = AllRecursiveCircuits::new( &all_stark, &[ 16..17, diff --git a/evm_arithmetization/tests/withdrawals.rs b/evm_arithmetization/tests/withdrawals.rs index fcdd73f49..01b48c0c6 100644 --- a/evm_arithmetization/tests/withdrawals.rs +++ b/evm_arithmetization/tests/withdrawals.rs @@ -13,13 +13,12 @@ use evm_arithmetization::testing_utils::{ preinitialized_state_and_storage_tries, update_beacon_roots_account_storage, }; use evm_arithmetization::verifier::testing::verify_all_proofs; -use evm_arithmetization::{AllStark, Node, StarkConfig}; +use evm_arithmetization::{AllStark, Node, StarkConfig, EMPTY_CONSOLIDATED_BLOCKHASH}; use keccak_hash::keccak; use mpt_trie::nibbles::Nibbles; use mpt_trie::partial_trie::{HashedPartialTrie, PartialTrie}; use plonky2::field::goldilocks_field::GoldilocksField; use plonky2::field::types::Field; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use plonky2::plonk::config::PoseidonGoldilocksConfig; use plonky2::util::timing::TimingTree; use rand::random; @@ -97,7 +96,7 @@ fn test_withdrawals() -> anyhow::Result<()> { trie_roots_after, contract_code, checkpoint_state_trie_root: HashedPartialTrie::from(Node::Empty).hash(), - checkpoint_consolidated_hash: [F::ZERO; NUM_HASH_OUT_ELTS], + checkpoint_consolidated_hash: EMPTY_CONSOLIDATED_BLOCKHASH.map(F::from_canonical_u64), block_metadata, txn_number_before: 0.into(), gas_used_before: 0.into(), diff --git a/proof_gen/src/lib.rs b/proof_gen/src/lib.rs index bdfa7943e..bb08f59f3 100644 --- a/proof_gen/src/lib.rs +++ b/proof_gen/src/lib.rs @@ -140,7 +140,6 @@ pub(crate) mod constants; pub mod proof_gen; pub mod proof_types; pub mod prover_state; -pub mod types; pub mod verifier_state; // Re-exports diff --git a/proof_gen/src/proof_gen.rs b/proof_gen/src/proof_gen.rs index e69d8de3c..8e713de27 100644 --- a/proof_gen/src/proof_gen.rs +++ b/proof_gen/src/proof_gen.rs @@ -4,8 +4,8 @@ use std::sync::{atomic::AtomicBool, Arc}; use evm_arithmetization::{ - fixed_recursive_verifier::ProverOutputData, generation::TrimmedGenerationInputs, AllStark, - GenerationSegmentData, StarkConfig, + fixed_recursive_verifier::ProverOutputData, AllStark, GenerationSegmentData, + ProofWithPublicInputs, StarkConfig, TrimmedGenerationInputs, }; use hashbrown::HashMap; use plonky2::{ @@ -21,7 +21,6 @@ use crate::{ SegmentAggregatableProof, }, prover_state::ProverState, - types::{Field, PlonkyProofIntern, EXTENSION_DEGREE}, }; /// A type alias for `Result`. @@ -50,7 +49,7 @@ impl From for ProofGenError { /// Generates a transaction proof from some IR data. pub fn generate_segment_proof( p_state: &ProverState, - gen_inputs: TrimmedGenerationInputs, + gen_inputs: TrimmedGenerationInputs, segment_data: &mut GenerationSegmentData, abort_signal: Option>, ) -> ProofGenResult { @@ -197,8 +196,8 @@ pub fn generate_agg_block_proof( /// Generates a dummy proof for a dummy circuit doing nothing. /// This is useful for testing purposes only. -pub fn dummy_proof() -> ProofGenResult { - let mut builder = CircuitBuilder::::new(CircuitConfig::default()); +pub fn dummy_proof() -> ProofGenResult { + let mut builder = CircuitBuilder::new(CircuitConfig::default()); builder.add_gate(NoopGate, vec![]); let circuit_data = builder.build::<_>(); diff --git a/proof_gen/src/proof_types.rs b/proof_gen/src/proof_types.rs index a0a1db43c..6dc5d0749 100644 --- a/proof_gen/src/proof_types.rs +++ b/proof_gen/src/proof_types.rs @@ -3,22 +3,19 @@ use evm_arithmetization::{ fixed_recursive_verifier::{extract_block_final_public_values, extract_two_to_one_block_hash}, - proof::PublicValues, - BlockHeight, + BlockHeight, Hash, Hasher, ProofWithPublicInputs, PublicValues, }; use plonky2::plonk::config::Hasher as _; use serde::{Deserialize, Serialize}; -use crate::types::{Field, Hash, Hasher, PlonkyProofIntern}; - /// A transaction proof along with its public values, for proper connection with /// contiguous proofs. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GeneratedSegmentProof { /// Public values of this transaction proof. - pub p_vals: PublicValues, + pub p_vals: PublicValues, /// Underlying plonky2 proof. - pub intern: PlonkyProofIntern, + pub intern: ProofWithPublicInputs, } /// A segment aggregation proof along with its public values, for proper @@ -29,9 +26,9 @@ pub struct GeneratedSegmentProof { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GeneratedSegmentAggProof { /// Public values of this aggregation proof. - pub p_vals: PublicValues, + pub p_vals: PublicValues, /// Underlying plonky2 proof. - pub intern: PlonkyProofIntern, + pub intern: ProofWithPublicInputs, } /// A transaction aggregation proof along with its public values, for proper @@ -42,9 +39,9 @@ pub struct GeneratedSegmentAggProof { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GeneratedTxnAggProof { /// Public values of this transaction aggregation proof. - pub p_vals: PublicValues, + pub p_vals: PublicValues, /// Underlying plonky2 proof. - pub intern: PlonkyProofIntern, + pub intern: ProofWithPublicInputs, } /// A block proof along with the block height against which this proof ensures @@ -54,7 +51,7 @@ pub struct GeneratedBlockProof { /// Associated block height. pub b_height: BlockHeight, /// Underlying plonky2 proof. - pub intern: PlonkyProofIntern, + pub intern: ProofWithPublicInputs, } /// An aggregation block proof along with its hashed public values, for proper @@ -65,7 +62,7 @@ pub struct GeneratedBlockProof { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GeneratedAggBlockProof { /// Underlying plonky2 proof. - pub intern: PlonkyProofIntern, + pub intern: ProofWithPublicInputs, } /// Sometimes we don't care about the underlying proof type and instead only if @@ -94,7 +91,7 @@ pub enum BatchAggregatableProof { } impl SegmentAggregatableProof { - pub(crate) fn public_values(&self) -> PublicValues { + pub(crate) fn public_values(&self) -> PublicValues { match self { SegmentAggregatableProof::Seg(info) => info.p_vals.clone(), SegmentAggregatableProof::Agg(info) => info.p_vals.clone(), @@ -108,7 +105,7 @@ impl SegmentAggregatableProof { } } - pub(crate) const fn intern(&self) -> &PlonkyProofIntern { + pub(crate) const fn intern(&self) -> &ProofWithPublicInputs { match self { SegmentAggregatableProof::Seg(info) => &info.intern, SegmentAggregatableProof::Agg(info) => &info.intern, @@ -117,7 +114,7 @@ impl SegmentAggregatableProof { } impl BatchAggregatableProof { - pub(crate) fn public_values(&self) -> PublicValues { + pub(crate) fn public_values(&self) -> PublicValues { match self { BatchAggregatableProof::Segment(info) => info.p_vals.clone(), BatchAggregatableProof::Txn(info) => info.p_vals.clone(), @@ -133,7 +130,7 @@ impl BatchAggregatableProof { } } - pub(crate) const fn intern(&self) -> &PlonkyProofIntern { + pub(crate) const fn intern(&self) -> &ProofWithPublicInputs { match self { BatchAggregatableProof::Segment(info) => &info.intern, BatchAggregatableProof::Txn(info) => &info.intern, @@ -204,7 +201,7 @@ impl AggregatableBlockProof { } } - pub(crate) const fn intern(&self) -> &PlonkyProofIntern { + pub(crate) const fn intern(&self) -> &ProofWithPublicInputs { match self { AggregatableBlockProof::Block(info) => &info.intern, AggregatableBlockProof::Agg(info) => &info.intern, diff --git a/proof_gen/src/prover_state.rs b/proof_gen/src/prover_state.rs index 7d8acf901..c5e1a88a4 100644 --- a/proof_gen/src/prover_state.rs +++ b/proof_gen/src/prover_state.rs @@ -5,12 +5,11 @@ use std::ops::Range; -use evm_arithmetization::{AllStark, StarkConfig}; +use evm_arithmetization::{AllRecursiveCircuits, AllStark, StarkConfig}; use log::info; use paste::paste; use crate::constants::*; -use crate::types::AllRecursiveCircuits; /// Plonky2 proving state. Note that this is generally going to be massive in /// terms of memory and has a long spin-up time, diff --git a/proof_gen/src/types.rs b/proof_gen/src/types.rs deleted file mode 100644 index 5e6c47c2d..000000000 --- a/proof_gen/src/types.rs +++ /dev/null @@ -1,40 +0,0 @@ -//! This module contains type aliases and custom `Error` definition for -//! convenient proof generation. - -use plonky2::{ - field::goldilocks_field::GoldilocksField, - hash::poseidon::PoseidonHash, - plonk::{self, config::PoseidonGoldilocksConfig, proof::ProofWithPublicInputs}, -}; - -/// The base field on which statements are being proven. -// TODO(Robin): https://github.com/0xPolygonZero/zk_evm/issues/531 -pub type Field = GoldilocksField; -/// The recursive circuit configuration to be used to shrink and aggregate -/// proofs. -pub type Config = PoseidonGoldilocksConfig; -/// The extension degree of the field used in the proof system. -pub const EXTENSION_DEGREE: usize = 2; - -/// A type alias for proofs generated by the zkEVM. -pub type PlonkyProofIntern = ProofWithPublicInputs; - -pub type Hasher = PoseidonHash; - -pub type Hash = >::Hash; - -/// A type alias for the set of preprocessed circuits necessary to generate -/// succinct block proofs. -pub type AllRecursiveCircuits = evm_arithmetization::fixed_recursive_verifier::AllRecursiveCircuits< - Field, - Config, - EXTENSION_DEGREE, ->; - -/// A type alias for the verifier data necessary to verify succinct block -/// proofs. -/// While the prover state [`AllRecursiveCircuits`] can also verify proofs, this -/// [`VerifierData`] is much lighter, allowing anyone to verify block proofs, -/// regardless of the underlying hardware. -pub type VerifierData = - plonky2::plonk::circuit_data::VerifierCircuitData; diff --git a/proof_gen/src/verifier_state.rs b/proof_gen/src/verifier_state.rs index b6a3ceb32..f5b4f7c27 100644 --- a/proof_gen/src/verifier_state.rs +++ b/proof_gen/src/verifier_state.rs @@ -3,13 +3,13 @@ use core::borrow::Borrow; +use evm_arithmetization::{ProofWithPublicInputs, VerifierData}; use log::info; use plonky2::recursion::cyclic_recursion::check_cyclic_proof_verifier_data; use crate::proof_gen::ProofGenResult; +use crate::prover_state::ProverState; use crate::prover_state::ProverStateBuilder; -use crate::types::PlonkyProofIntern; -use crate::{prover_state::ProverState, types::VerifierData}; /// Plonky2 verifier state. /// @@ -53,7 +53,7 @@ impl> From for VerifierState { impl VerifierState { /// Verifies a `block_proof`. - pub fn verify(&self, block_proof: &PlonkyProofIntern) -> ProofGenResult<()> { + pub fn verify(&self, block_proof: &ProofWithPublicInputs) -> ProofGenResult<()> { // Proof verification self.state .verify(block_proof.clone()) diff --git a/trace_decoder/src/core.rs b/trace_decoder/src/core.rs index 3193402e2..959e03967 100644 --- a/trace_decoder/src/core.rs +++ b/trace_decoder/src/core.rs @@ -22,8 +22,8 @@ use zk_evm_common::gwei_to_wei; use crate::{ typed_mpt::{ReceiptTrie, StateMpt, StateTrie, StorageTrie, TransactionTrie, TrieKey}, BlockLevelData, BlockTrace, BlockTraceTriePreImages, CombinedPreImages, ContractCodeUsage, - Field, OtherBlockData, SeparateStorageTriesPreImage, SeparateTriePreImage, - SeparateTriePreImages, TxnInfo, TxnMeta, TxnTrace, + OtherBlockData, SeparateStorageTriesPreImage, SeparateTriePreImage, SeparateTriePreImages, + TxnInfo, TxnMeta, TxnTrace, }; /// TODO(0xaatif): document this after https://github.com/0xPolygonZero/zk_evm/issues/275 @@ -31,7 +31,7 @@ pub fn entrypoint( trace: BlockTrace, other: OtherBlockData, batch_size_hint: usize, -) -> anyhow::Result>> { +) -> anyhow::Result> { ensure!(batch_size_hint != 0); let BlockTrace { @@ -87,7 +87,7 @@ pub fn entrypoint( }, after, withdrawals, - }| GenerationInputs:: { + }| GenerationInputs { txn_number_before: first_txn_ix.into(), gas_used_before: running_gas_used.into(), gas_used_after: { diff --git a/trace_decoder/src/interface.rs b/trace_decoder/src/interface.rs index ef2e64486..abe3b0af0 100644 --- a/trace_decoder/src/interface.rs +++ b/trace_decoder/src/interface.rs @@ -6,13 +6,11 @@ use std::collections::{BTreeMap, BTreeSet, HashMap}; use ethereum_types::{Address, U256}; use evm_arithmetization::proof::{BlockHashes, BlockMetadata}; +use evm_arithmetization::ConsolidatedHash; use keccak_hash::H256; use mpt_trie::partial_trie::HashedPartialTrie; -use plonky2::hash::hash_types::NUM_HASH_OUT_ELTS; use serde::{Deserialize, Serialize}; -use crate::Field; - /// Core payload needed to generate proof for a block. /// Additional data retrievable from the blockchain node (using standard ETH RPC /// API) may be needed for proof generation. @@ -173,7 +171,7 @@ pub struct OtherBlockData { /// State trie root hash at the checkpoint. pub checkpoint_state_trie_root: H256, /// Consolidated block hashes at the checkpoint. - pub checkpoint_consolidated_hash: [Field; NUM_HASH_OUT_ELTS], + pub checkpoint_consolidated_hash: ConsolidatedHash, /// Address where the burnt fees are stored. /// /// Only used if the `cfg_erigon` feature is activated. diff --git a/trace_decoder/src/lib.rs b/trace_decoder/src/lib.rs index 8c54eea8e..53db82a69 100644 --- a/trace_decoder/src/lib.rs +++ b/trace_decoder/src/lib.rs @@ -55,7 +55,6 @@ const _DEVELOPER_DOCS: () = (); mod interface; pub use interface::*; -use plonky2::field::goldilocks_field::GoldilocksField; mod type1; // TODO(0xaatif): https://github.com/0xPolygonZero/zk_evm/issues/275 @@ -70,10 +69,6 @@ pub use core::entrypoint; mod core; -/// The base field on which statements are being proven. -// TODO(Robin): https://github.com/0xPolygonZero/zk_evm/issues/531 -pub type Field = GoldilocksField; - /// Like `#[serde(with = "hex")`, but tolerates and emits leading `0x` prefixes mod hex { use serde::{de::Error as _, Deserialize as _, Deserializer, Serializer}; diff --git a/zero/src/ops.rs b/zero/src/ops.rs index a697d9416..2c0eb557a 100644 --- a/zero/src/ops.rs +++ b/zero/src/ops.rs @@ -2,14 +2,12 @@ zk_evm_common::check_chain_features!(); use std::time::Instant; -use evm_arithmetization::generation::TrimmedGenerationInputs; -use evm_arithmetization::proof::PublicValues; use evm_arithmetization::{prover::testing::simulate_execution_all_segments, GenerationInputs}; +use evm_arithmetization::{Field, PublicValues, TrimmedGenerationInputs}; use paladin::{ operation::{FatalError, FatalStrategy, Monoid, Operation, Result}, registry, RemoteExecute, }; -use proof_gen::types::Field; use proof_gen::{ proof_gen::{generate_block_proof, generate_segment_agg_proof, generate_transaction_agg_proof}, proof_types::{ @@ -30,7 +28,7 @@ pub struct SegmentProof { } impl Operation for SegmentProof { - type Input = evm_arithmetization::AllData; + type Input = evm_arithmetization::AllData; type Output = proof_gen::proof_types::SegmentAggregatableProof; fn execute(&self, all_data: Self::Input) -> Result { @@ -75,7 +73,7 @@ pub struct SegmentProofTestOnly { } impl Operation for SegmentProofTestOnly { - type Input = (GenerationInputs, usize); + type Input = (GenerationInputs, usize); type Output = (); fn execute(&self, inputs: Self::Input) -> Result { @@ -116,7 +114,7 @@ struct SegmentProofSpan { impl SegmentProofSpan { /// Get a unique id for the transaction proof. - fn get_id(ir: &TrimmedGenerationInputs, segment_index: usize) -> String { + fn get_id(ir: &TrimmedGenerationInputs, segment_index: usize) -> String { if ir.txn_hashes.len() == 1 { format!( "b{} - {} ({})", @@ -137,7 +135,7 @@ impl SegmentProofSpan { /// /// Either the first 8 characters of the hex-encoded hash of the first and /// last transactions, or "Dummy" if there is no transaction. - fn get_descriptor(ir: &TrimmedGenerationInputs) -> String { + fn get_descriptor(ir: &TrimmedGenerationInputs) -> String { if ir.txn_hashes.is_empty() { "Dummy".to_string() } else if ir.txn_hashes.len() == 1 { @@ -160,7 +158,7 @@ impl SegmentProofSpan { /// Create a new transaction proof span. /// /// When dropped, it logs the time taken by the transaction proof. - fn new(ir: &TrimmedGenerationInputs, segment_index: usize) -> Self { + fn new(ir: &TrimmedGenerationInputs, segment_index: usize) -> Self { let id = Self::get_id(ir, segment_index); let span = info_span!("p_gen", id).entered(); let start = Instant::now(); @@ -189,7 +187,7 @@ pub struct SegmentAggProof { pub save_inputs_on_error: bool, } -fn get_seg_agg_proof_public_values(elem: SegmentAggregatableProof) -> PublicValues { +fn get_seg_agg_proof_public_values(elem: SegmentAggregatableProof) -> PublicValues { match elem { SegmentAggregatableProof::Seg(info) => info.p_vals, SegmentAggregatableProof::Agg(info) => info.p_vals, @@ -233,7 +231,7 @@ impl Monoid for SegmentAggProof { pub struct BatchAggProof { pub save_inputs_on_error: bool, } -fn get_agg_proof_public_values(elem: BatchAggregatableProof) -> PublicValues { +fn get_agg_proof_public_values(elem: BatchAggregatableProof) -> PublicValues { match elem { BatchAggregatableProof::Segment(info) => info.p_vals, BatchAggregatableProof::Txn(info) => info.p_vals, diff --git a/zero/src/prover.rs b/zero/src/prover.rs index 02360e0f7..33c21c7bd 100644 --- a/zero/src/prover.rs +++ b/zero/src/prover.rs @@ -8,6 +8,7 @@ use std::sync::Arc; use alloy::primitives::U256; use anyhow::{Context, Result}; +use evm_arithmetization::Field; use futures::{future::BoxFuture, FutureExt, TryFutureExt, TryStreamExt}; use num_traits::ToPrimitive as _; use paladin::runtime::Runtime; @@ -100,10 +101,8 @@ impl BlockProverInput { .iter() .enumerate() .map(|(idx, txn_batch)| { - let segment_data_iterator = SegmentDataIterator::::new( - txn_batch, - Some(max_cpu_len_log), - ); + let segment_data_iterator = + SegmentDataIterator::::new(txn_batch, Some(max_cpu_len_log)); Directive::map(IndexedStream::from(segment_data_iterator), &seg_prove_ops) .fold(&seg_agg_ops) diff --git a/zero/src/prover_state/circuit.rs b/zero/src/prover_state/circuit.rs index de68b09f8..da9fb367d 100644 --- a/zero/src/prover_state/circuit.rs +++ b/zero/src/prover_state/circuit.rs @@ -6,8 +6,7 @@ use std::{ }; pub use evm_arithmetization::NUM_TABLES; -use evm_arithmetization::{AllStark, StarkConfig}; -use proof_gen::types::AllRecursiveCircuits; +use evm_arithmetization::{AllRecursiveCircuits, AllStark, StarkConfig}; use crate::parsing::{parse_range_exclusive, RangeParseError}; diff --git a/zero/src/prover_state/mod.rs b/zero/src/prover_state/mod.rs index 793b726f1..8cfa3f013 100644 --- a/zero/src/prover_state/mod.rs +++ b/zero/src/prover_state/mod.rs @@ -15,13 +15,10 @@ use std::{fmt::Display, sync::OnceLock}; use clap::ValueEnum; use evm_arithmetization::{ - fixed_recursive_verifier::ProverOutputData, generation::TrimmedGenerationInputs, - proof::AllProof, prover::prove, AllStark, GenerationSegmentData, StarkConfig, -}; -use plonky2::{ - field::goldilocks_field::GoldilocksField, plonk::config::PoseidonGoldilocksConfig, - util::timing::TimingTree, + fixed_recursive_verifier::ProverOutputData, prover::prove, AllProof, AllStark, + GenerationSegmentData, RecursiveCircuitsForTableSize, StarkConfig, TrimmedGenerationInputs, }; +use plonky2::util::timing::TimingTree; use proof_gen::{proof_types::GeneratedSegmentProof, prover_state::ProverState, VerifierState}; use tracing::info; @@ -35,18 +32,6 @@ pub mod circuit; pub mod cli; pub mod persistence; -// TODO(Robin): https://github.com/0xPolygonZero/zk_evm/issues/531 -pub(crate) type Config = PoseidonGoldilocksConfig; -pub(crate) type Field = GoldilocksField; -pub(crate) const SIZE: usize = 2; - -pub(crate) type RecursiveCircuitsForTableSize = - evm_arithmetization::fixed_recursive_verifier::RecursiveCircuitsForTableSize< - Field, - Config, - SIZE, - >; - /// The global prover state. /// /// It is specified as a `OnceLock` for the following reasons: @@ -149,7 +134,7 @@ impl ProverStateManager { fn load_table_circuits( &self, config: &StarkConfig, - all_proof: &AllProof, + all_proof: &AllProof, ) -> anyhow::Result<[(RecursiveCircuitsForTableSize, u8); NUM_TABLES]> { let degrees = all_proof.degree_bits(config); @@ -196,7 +181,7 @@ impl ProverStateManager { /// and finally aggregating them to a final transaction proof. fn segment_proof_on_demand( &self, - input: TrimmedGenerationInputs, + input: TrimmedGenerationInputs, segment_data: &mut GenerationSegmentData, ) -> anyhow::Result { let config = StarkConfig::standard_fast_config(); @@ -225,7 +210,7 @@ impl ProverStateManager { /// circuit. fn segment_proof_monolithic( &self, - input: TrimmedGenerationInputs, + input: TrimmedGenerationInputs, segment_data: &mut GenerationSegmentData, ) -> anyhow::Result { let p_out = p_state().state.prove_segment( @@ -257,7 +242,7 @@ impl ProverStateManager { /// needed. pub fn generate_segment_proof( &self, - input: (TrimmedGenerationInputs, GenerationSegmentData), + input: (TrimmedGenerationInputs, GenerationSegmentData), ) -> anyhow::Result { let (generation_inputs, mut segment_data) = input; diff --git a/zero/src/prover_state/persistence.rs b/zero/src/prover_state/persistence.rs index cd3f9a043..fbd7be2d0 100644 --- a/zero/src/prover_state/persistence.rs +++ b/zero/src/prover_state/persistence.rs @@ -8,18 +8,17 @@ use std::{ use alloy::hex; use anyhow::anyhow; use directories::ProjectDirs; -use evm_arithmetization::cpu::kernel::aggregator::KERNEL; +use evm_arithmetization::{ + cpu::kernel::aggregator::KERNEL, AllRecursiveCircuits, RecursionConfig, + RecursiveCircuitsForTableSize, VerifierData, EXTENSION_DEGREE, +}; use once_cell::sync::Lazy; use plonky2::util::serialization::{ Buffer, DefaultGateSerializer, DefaultGeneratorSerializer, IoError, }; -use proof_gen::types::{AllRecursiveCircuits, VerifierData}; use thiserror::Error; -use super::{ - circuit::{Circuit, CircuitConfig}, - Config, RecursiveCircuitsForTableSize, SIZE, -}; +use super::circuit::{Circuit, CircuitConfig}; const PROVER_STATE_FILE_PREFIX: &str = "prover_state"; const VERIFIER_STATE_FILE_PREFIX: &str = "verifier_state"; @@ -46,10 +45,10 @@ pub static KERNEL_HASH: Lazy<&'static str> = Lazy::new(|| { fn get_serializers() -> ( DefaultGateSerializer, - DefaultGeneratorSerializer, + DefaultGeneratorSerializer, ) { let gate_serializer = DefaultGateSerializer; - let witness_serializer: DefaultGeneratorSerializer = + let witness_serializer: DefaultGeneratorSerializer = DefaultGeneratorSerializer::default(); (gate_serializer, witness_serializer) diff --git a/zero/src/rpc/mod.rs b/zero/src/rpc/mod.rs index 88be3e79e..007a4fdb2 100644 --- a/zero/src/rpc/mod.rs +++ b/zero/src/rpc/mod.rs @@ -12,9 +12,11 @@ use alloy::{ use anyhow::{anyhow, Context as _}; use clap::ValueEnum; use compat::Compat; -use evm_arithmetization::proof::{consolidate_hashes, BlockHashes, BlockMetadata}; +use evm_arithmetization::{ + proof::{consolidate_hashes, BlockHashes, BlockMetadata}, + Field, Hasher, +}; use futures::{StreamExt as _, TryStreamExt as _}; -use proof_gen::types::{Field, Hasher}; use serde_json::json; use trace_decoder::{BlockLevelData, OtherBlockData}; use tracing::warn;