From 00513b280834f54daa2e1c6afffa39146fd6f19c Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 14 Dec 2023 12:05:46 +0200 Subject: [PATCH 01/27] Add circuits seal criterion --- Cargo.lock | 1 + core/lib/multivm/Cargo.toml | 2 +- .../src/glue/types/vm/vm_block_result.rs | 6 + .../types/vm/vm_partial_execution_result.rs | 3 + .../types/outputs/execution_result.rs | 1 + .../src/interface/types/outputs/statistic.rs | 1 + .../vm_latest/implementation/execution.rs | 9 ++ .../vm_latest/implementation/statistics.rs | 2 + .../vm_latest/tracers/default_tracers.rs | 74 +++++++++- .../implementation/statistics.rs | 1 + .../implementation/statistics.rs | 1 + core/lib/types/src/fee.rs | 1 + core/lib/types/src/tx/tx_execution_info.rs | 3 + .../execution_sandbox/vm_metrics.rs | 1 + .../seal_criteria/conditional_sealer.rs | 6 +- .../criteria/geometry_seal_criteria.rs | 132 ++---------------- .../seal_criteria/criteria/mod.rs | 9 +- .../zksync_core/src/state_keeper/tests/mod.rs | 1 + 18 files changed, 116 insertions(+), 138 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a35ccbf237ab..6615ea6f28bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4226,6 +4226,7 @@ name = "multivm" version = "0.1.0" dependencies = [ "anyhow", + "bigdecimal", "ethabi", "hex", "itertools", diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index 8b69af498a05..4582e1f3b285 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -28,7 +28,7 @@ once_cell = "1.7" thiserror = "1.0" tracing = "0.1" vise = { git = "https://github.com/matter-labs/vise.git", version = "0.1.0", rev = "dd05139b76ab0843443ab3ff730174942c825dae" } - +bigdecimal = "0.2.2" [dev-dependencies] tokio = { version = "1", features = ["time"] } diff --git a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs index e63ab376bad4..8c92a2dc7edf 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs @@ -26,6 +26,7 @@ impl GlueFrom for crate::interface::Fi computational_gas_used: value.full_result.gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), }, @@ -63,6 +64,7 @@ impl GlueFrom for crate::interface::Fi computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), }, @@ -106,6 +108,7 @@ impl GlueFrom for crate::interface: computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), }, @@ -165,6 +168,7 @@ impl GlueFrom computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), } @@ -195,6 +199,7 @@ impl GlueFrom computational_gas_used: 0, gas_used: value.full_result.gas_used, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), } @@ -236,6 +241,7 @@ impl GlueFrom computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), } diff --git a/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs b/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs index 4de727a04c10..07fc2b8b05d3 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs @@ -16,6 +16,7 @@ impl GlueFrom // There are no such fields in m5 computational_gas_used: 0, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: crate::interface::Refunds { gas_refunded: 0, @@ -39,6 +40,7 @@ impl GlueFrom computational_gas_used: value.computational_gas_used, total_log_queries: value.logs.total_log_queries_count, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: crate::interface::Refunds { gas_refunded: 0, @@ -62,6 +64,7 @@ impl GlueFrom computational_gas_used: value.computational_gas_used, total_log_queries: value.logs.total_log_queries_count, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: crate::interface::Refunds { gas_refunded: 0, diff --git a/core/lib/multivm/src/interface/types/outputs/execution_result.rs b/core/lib/multivm/src/interface/types/outputs/execution_result.rs index e177b6300120..6471ca1fe193 100644 --- a/core/lib/multivm/src/interface/types/outputs/execution_result.rs +++ b/core/lib/multivm/src/interface/types/outputs/execution_result.rs @@ -101,6 +101,7 @@ impl VmExecutionResultAndLogs { cycles_used: self.statistics.cycles_used, computational_gas_used: self.statistics.computational_gas_used, pubdata_published: self.statistics.pubdata_published, + estimated_circuits_used: self.statistics.estimated_circuits_used, } } } diff --git a/core/lib/multivm/src/interface/types/outputs/statistic.rs b/core/lib/multivm/src/interface/types/outputs/statistic.rs index c1312fc95da8..a29c14443f3a 100644 --- a/core/lib/multivm/src/interface/types/outputs/statistic.rs +++ b/core/lib/multivm/src/interface/types/outputs/statistic.rs @@ -12,6 +12,7 @@ pub struct VmExecutionStatistics { /// Number of log queries produced by the VM during the tx execution. pub total_log_queries: usize, pub pubdata_published: u32, + pub estimated_circuits_used: usize, } /// Oracle metrics of the VM. diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs index a913ea3ed463..9680543a17be 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs @@ -1,3 +1,4 @@ +use bigdecimal::{BigDecimal, ToPrimitive}; use zk_evm_1_4_0::aux_structures::Timestamp; use zksync_state::WriteStorage; @@ -71,6 +72,13 @@ impl Vm { .map(|x| (x.get_refunds(), x.pubdata_published())) .unwrap_or_default(); + // Ceil and convert to usize. + let estimated_circuits_used = (tx_tracer.estimated_circuits_used.clone() + + BigDecimal::from(1u8) / BigDecimal::from(2u8)) + .round(0) + .to_usize() + .expect("estimated_circuits_used must fix into usize"); + let statistics = self.get_statistics( timestamp_initial, cycles_initial, @@ -80,6 +88,7 @@ impl Vm { spent_pubdata_counter_before, pubdata_published, logs.total_log_queries_count, + estimated_circuits_used, ); let result = tx_tracer.result_tracer.into_result(); diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs index 6af9ad041feb..e5bdda4d59ca 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs @@ -24,6 +24,7 @@ impl Vm { spent_pubdata_counter_before: u32, pubdata_published: u32, total_log_queries_count: usize, + estimated_circuits_used: usize, ) -> VmExecutionStatistics { let computational_gas_used = self.calculate_computational_gas_used( tracer, @@ -40,6 +41,7 @@ impl Vm { computational_gas_used, total_log_queries: total_log_queries_count, pubdata_published, + estimated_circuits_used, } } diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs index 0e18d989af62..0bde3f576496 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs @@ -3,18 +3,24 @@ use std::{ marker::PhantomData, }; +use bigdecimal::{BigDecimal, Zero}; use zk_evm_1_4_0::{ tracing::{ AfterDecodingData, AfterExecutionData, BeforeExecutionData, Tracer, VmLocalStateData, }, vm_state::VmLocalState, witness_trace::DummyTracer, - zkevm_opcode_defs::{decoding::EncodingModeProduction, Opcode, RetOpcode}, + zkevm_opcode_defs::{decoding::EncodingModeProduction, LogOpcode, Opcode, RetOpcode}, }; use zksync_state::{StoragePtr, WriteStorage}; -use zksync_types::Timestamp; +use zksync_system_constants::{ + ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS, +}; +use zksync_types::{AccountTreeId, StorageKey, Timestamp}; +use zksync_utils::u256_to_h256; use super::PubdataTracer; +use crate::vm_m5::storage::Storage; use crate::{ interface::{ tracer::{TracerExecutionStopReason, VmExecutionStopReason}, @@ -62,6 +68,9 @@ pub(crate) struct DefaultExecutionTracer { pub(crate) pubdata_tracer: Option>, pub(crate) dispatcher: TracerDispatcher, ret_from_the_bootloader: Option, + // + pub(crate) estimated_circuits_used: BigDecimal, + storage: StoragePtr, _phantom: PhantomData, } @@ -88,6 +97,7 @@ impl DefaultExecutionTracer { dispatcher, pubdata_tracer, ret_from_the_bootloader: None, + estimated_circuits_used: BigDecimal::zero(), storage, _phantom: PhantomData, } @@ -138,6 +148,64 @@ impl DefaultExecutionTracer { } TracerExecutionStatus::Continue } + + fn circuits_used_by_opcode( + &mut self, + state: &VmLocalStateData<'_>, + data: &BeforeExecutionData, + ) -> BigDecimal { + match data.opcode.variant.opcode { + Opcode::Invalid(_) + | Opcode::Nop(_) + | Opcode::Add(_) + | Opcode::Sub(_) + | Opcode::Mul(_) + | Opcode::Div(_) + | Opcode::Jump(_) + | Opcode::Binop(_) + | Opcode::Shift(_) + | Opcode::Ptr(_) + | Opcode::NearCall(_) + | Opcode::Context(_) + | Opcode::Ret(_) => { + todo!(); // const + } + Opcode::Log(LogOpcode::StorageRead) => todo!(), // const + Opcode::Log(LogOpcode::StorageWrite) => { + let storage_key = StorageKey::new( + AccountTreeId::new(state.vm_local_state.callstack.current.this_address), + u256_to_h256(data.src0_value.value), + ); + + let first_write = !self + .storage + .borrow() + .get_modified_storage_keys() + .contains_key(&storage_key); + if first_write { + if self.storage.borrow_mut().is_write_initial(&storage_key) { + todo!() // const + } else { + todo!() // const + } + } else { + todo!() // const + } + } + Opcode::Log(LogOpcode::ToL1Message) => todo!(), // const + Opcode::Log(LogOpcode::Event) => todo!(), // const + Opcode::Log(LogOpcode::PrecompileCall) => { + match state.vm_local_state.callstack.current.this_address { + a if a == KECCAK256_PRECOMPILE_ADDRESS => todo!(), // const + a if a == SHA256_PRECOMPILE_ADDRESS => todo!(), // const + a if a == ECRECOVER_PRECOMPILE_ADDRESS => todo!(), // const + _ => todo!(), // const + } + } + Opcode::FarCall(_) => todo!(), // const + Opcode::UMA(_) => todo!(), // const + } + } } impl Debug for DefaultExecutionTracer { @@ -221,6 +289,8 @@ impl Tracer for DefaultExecutionTracer { self.gas_spent_on_bytecodes_and_long_messages += gas_spent_on_bytecodes_and_long_messages_this_opcode(&state, &data); + // self.estimated_circuits_used += self.circuits_used_by_opcode(&state, &data); + dispatch_tracers!(self.before_execution(state, data, memory, self.storage.clone())); } diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs index 3e9de5de4ec0..ec2dc9036437 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs @@ -40,6 +40,7 @@ impl Vm { computational_gas_used, total_log_queries: total_log_queries_count, pubdata_published, + estimated_circuits_used: 0, } } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs index 074e8dae56ed..3afb073bd175 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs @@ -40,6 +40,7 @@ impl Vm { total_log_queries: total_log_queries_count, // This field will be populated by the RefundTracer pubdata_published: 0, + estimated_circuits_used: 0, } } diff --git a/core/lib/types/src/fee.rs b/core/lib/types/src/fee.rs index 53e05fbb59a9..d8a34bed5c5c 100644 --- a/core/lib/types/src/fee.rs +++ b/core/lib/types/src/fee.rs @@ -24,6 +24,7 @@ pub struct TransactionExecutionMetrics { pub computational_gas_used: u32, pub total_updated_values_size: usize, pub pubdata_published: u32, + pub estimated_circuits_used: usize, } #[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/core/lib/types/src/tx/tx_execution_info.rs b/core/lib/types/src/tx/tx_execution_info.rs index d19757ee970b..6338c7e00b86 100644 --- a/core/lib/types/src/tx/tx_execution_info.rs +++ b/core/lib/types/src/tx/tx_execution_info.rs @@ -69,6 +69,7 @@ pub struct ExecutionMetrics { pub cycles_used: u32, pub computational_gas_used: u32, pub pubdata_published: u32, + pub estimated_circuits_used: usize, } impl ExecutionMetrics { @@ -86,6 +87,7 @@ impl ExecutionMetrics { cycles_used: tx_metrics.cycles_used, computational_gas_used: tx_metrics.computational_gas_used, pubdata_published: tx_metrics.pubdata_published, + estimated_circuits_used: tx_metrics.estimated_circuits_used, } } @@ -119,6 +121,7 @@ impl Add for ExecutionMetrics { cycles_used: self.cycles_used + other.cycles_used, computational_gas_used: self.computational_gas_used + other.computational_gas_used, pubdata_published: self.pubdata_published + other.pubdata_published, + estimated_circuits_used: self.estimated_circuits_used + other.estimated_circuits_used, } } } diff --git a/core/lib/zksync_core/src/api_server/execution_sandbox/vm_metrics.rs b/core/lib/zksync_core/src/api_server/execution_sandbox/vm_metrics.rs index 6842fe438f83..82e082d4dd81 100644 --- a/core/lib/zksync_core/src/api_server/execution_sandbox/vm_metrics.rs +++ b/core/lib/zksync_core/src/api_server/execution_sandbox/vm_metrics.rs @@ -240,5 +240,6 @@ pub(super) fn collect_tx_execution_metrics( computational_gas_used: result.statistics.computational_gas_used, total_updated_values_size: writes_metrics.total_updated_values_size, pubdata_published: result.statistics.pubdata_published, + estimated_circuits_used: result.statistics.estimated_circuits_used, } } diff --git a/core/lib/zksync_core/src/state_keeper/seal_criteria/conditional_sealer.rs b/core/lib/zksync_core/src/state_keeper/seal_criteria/conditional_sealer.rs index 2b5fb9fba485..6a8459e0e7a9 100644 --- a/core/lib/zksync_core/src/state_keeper/seal_criteria/conditional_sealer.rs +++ b/core/lib/zksync_core/src/state_keeper/seal_criteria/conditional_sealer.rs @@ -105,12 +105,8 @@ impl ConditionalSealer { Box::new(criteria::SlotsCriterion), Box::new(criteria::GasCriterion), Box::new(criteria::PubDataBytesCriterion), - Box::new(criteria::InitialWritesCriterion), - Box::new(criteria::RepeatedWritesCriterion), - Box::new(criteria::MaxCyclesCriterion), - Box::new(criteria::ComputationalGasCriterion), + Box::new(criteria::CircuitsCriterion), Box::new(criteria::TxEncodingSizeCriterion), - Box::new(criteria::L2ToL1LogsCriterion), ] } } diff --git a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs index 9f99554e58a2..0066707d0638 100644 --- a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs +++ b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs @@ -1,9 +1,7 @@ use std::fmt; -use multivm::vm_latest::constants::{ERGS_PER_CIRCUIT, MAX_CYCLES_FOR_TX}; use zksync_config::configs::chain::StateKeeperConfig; use zksync_types::{ - circuit::{GEOMETRY_CONFIG, SCHEDULER_UPPER_BOUND}, tx::tx_execution_info::{DeduplicatedWritesMetrics, ExecutionMetrics}, ProtocolVersionId, }; @@ -15,15 +13,7 @@ use crate::state_keeper::seal_criteria::{SealCriterion, SealData, SealResolution // Otherwise witness generation will fail and proof won't be generated. #[derive(Debug, Default)] -pub struct RepeatedWritesCriterion; -#[derive(Debug, Default)] -pub struct InitialWritesCriterion; -#[derive(Debug, Default)] -pub struct MaxCyclesCriterion; -#[derive(Debug, Default)] -pub struct ComputationalGasCriterion; -#[derive(Debug, Default)] -pub struct L2ToL1LogsCriterion; +pub struct CircuitsCriterion; trait MetricExtractor { const PROM_METRIC_CRITERION_NAME: &'static str; @@ -71,85 +61,21 @@ where } } -impl MetricExtractor for RepeatedWritesCriterion { - const PROM_METRIC_CRITERION_NAME: &'static str = "repeated_storage_writes"; - - fn limit_per_block(protocol_version_id: ProtocolVersionId) -> usize { - if protocol_version_id.is_pre_boojum() { - GEOMETRY_CONFIG.limit_for_repeated_writes_pubdata_hasher as usize - } else { - // In boojum there is no limit for repeated writes. - usize::MAX - } - } - - fn extract(_metrics: &ExecutionMetrics, writes: &DeduplicatedWritesMetrics) -> usize { - writes.repeated_storage_writes - } -} - -impl MetricExtractor for InitialWritesCriterion { - const PROM_METRIC_CRITERION_NAME: &'static str = "initial_storage_writes"; - - fn limit_per_block(protocol_version_id: ProtocolVersionId) -> usize { - if protocol_version_id.is_pre_boojum() { - GEOMETRY_CONFIG.limit_for_initial_writes_pubdata_hasher as usize - } else { - // In boojum there is no limit for initial writes. - usize::MAX - } - } - - fn extract(_metrics: &ExecutionMetrics, writes: &DeduplicatedWritesMetrics) -> usize { - writes.initial_storage_writes - } -} - -impl MetricExtractor for MaxCyclesCriterion { - const PROM_METRIC_CRITERION_NAME: &'static str = "max_cycles"; - - fn limit_per_block(_protocol_version_id: ProtocolVersionId) -> usize { - MAX_CYCLES_FOR_TX as usize - } - - fn extract(metrics: &ExecutionMetrics, _writes: &DeduplicatedWritesMetrics) -> usize { - metrics.cycles_used as usize - } -} - -impl MetricExtractor for ComputationalGasCriterion { - const PROM_METRIC_CRITERION_NAME: &'static str = "computational_gas"; +impl MetricExtractor for CircuitsCriterion { + const PROM_METRIC_CRITERION_NAME: &'static str = "circuits"; fn limit_per_block(_protocol_version_id: ProtocolVersionId) -> usize { // We subtract constant to take into account that circuits may be not fully filled. // This constant should be greater than number of circuits types // but we keep it larger to be on the safe side. - const MARGIN_NUMBER_OF_CIRCUITS: usize = 100; - const MAX_NUMBER_OF_MUTLIINSTANCE_CIRCUITS: usize = - SCHEDULER_UPPER_BOUND as usize - MARGIN_NUMBER_OF_CIRCUITS; + const MARGIN_NUMBER_OF_CIRCUITS: usize = 10000; + const MAX_NUMBER_OF_CIRCUITS: usize = (1 << 14) + (1 << 13) - MARGIN_NUMBER_OF_CIRCUITS; - MAX_NUMBER_OF_MUTLIINSTANCE_CIRCUITS * ERGS_PER_CIRCUIT as usize + MAX_NUMBER_OF_CIRCUITS } fn extract(metrics: &ExecutionMetrics, _writes: &DeduplicatedWritesMetrics) -> usize { - metrics.computational_gas_used as usize - } -} - -impl MetricExtractor for L2ToL1LogsCriterion { - const PROM_METRIC_CRITERION_NAME: &'static str = "l2_to_l1_logs"; - - fn limit_per_block(protocol_version_id: ProtocolVersionId) -> usize { - if protocol_version_id.is_pre_boojum() { - GEOMETRY_CONFIG.limit_for_l1_messages_merklizer as usize - } else { - // In boojum there is no limit for L2 to L1 logs. - usize::MAX - } - } - - fn extract(metrics: &ExecutionMetrics, _writes: &DeduplicatedWritesMetrics) -> usize { - metrics.l2_to_l1_logs + metrics.estimated_circuits_used } } @@ -369,51 +295,11 @@ mod tests { }; } - #[test] - fn repeated_writes_seal_criterion() { - test_scenario_writes_metrics!( - RepeatedWritesCriterion, - repeated_storage_writes, - usize, - ProtocolVersionId::Version17 - ); - } - - #[test] - fn initial_writes_seal_criterion() { - test_scenario_writes_metrics!( - InitialWritesCriterion, - initial_storage_writes, - usize, - ProtocolVersionId::Version17 - ); - } - - #[test] - fn max_cycles_seal_criterion() { - test_scenario_execution_metrics!( - MaxCyclesCriterion, - cycles_used, - u32, - ProtocolVersionId::Version17 - ); - } - #[test] fn computational_gas_seal_criterion() { test_scenario_execution_metrics!( - ComputationalGasCriterion, - computational_gas_used, - u32, - ProtocolVersionId::Version17 - ); - } - - #[test] - fn l2_to_l1_logs_seal_criterion() { - test_scenario_execution_metrics!( - L2ToL1LogsCriterion, - l2_to_l1_logs, + CircuitsCriterion, + estimated_circuits_used, usize, ProtocolVersionId::Version17 ); diff --git a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/mod.rs b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/mod.rs index 8e0d89e8e0f2..4e30f2a8b608 100644 --- a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/mod.rs +++ b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/mod.rs @@ -5,12 +5,7 @@ mod slots; mod tx_encoding_size; pub(in crate::state_keeper) use self::{ - gas::GasCriterion, - geometry_seal_criteria::{ - ComputationalGasCriterion, InitialWritesCriterion, L2ToL1LogsCriterion, MaxCyclesCriterion, - RepeatedWritesCriterion, - }, - pubdata_bytes::PubDataBytesCriterion, - slots::SlotsCriterion, + gas::GasCriterion, geometry_seal_criteria::CircuitsCriterion, + pubdata_bytes::PubDataBytesCriterion, slots::SlotsCriterion, tx_encoding_size::TxEncodingSizeCriterion, }; diff --git a/core/lib/zksync_core/src/state_keeper/tests/mod.rs b/core/lib/zksync_core/src/state_keeper/tests/mod.rs index 26458956af7a..237f84dbae6e 100644 --- a/core/lib/zksync_core/src/state_keeper/tests/mod.rs +++ b/core/lib/zksync_core/src/state_keeper/tests/mod.rs @@ -198,6 +198,7 @@ pub(super) fn create_execution_result( computational_gas_used: 0, total_log_queries, pubdata_published: 0, + estimated_circuits_used: 0, }, refunds: Refunds::default(), } From 6dfd8837aea446ff2ca368d11a9ded06b26bf5c3 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 14:40:15 +0200 Subject: [PATCH 02/27] Proper calculation of used circuits --- .dockerignore | 1 - .gitignore | 1 - Cargo.lock | 21 +- Cargo.toml | 1 - .../Cargo.toml | 37 -- .../README.md | 39 -- .../data/verification_0_key.json | 399 ------------------ .../data/verification_10_key.json | 399 ------------------ .../data/verification_11_key.json | 399 ------------------ .../data/verification_12_key.json | 399 ------------------ .../data/verification_13_key.json | 399 ------------------ .../data/verification_14_key.json | 399 ------------------ .../data/verification_15_key.json | 399 ------------------ .../data/verification_16_key.json | 399 ------------------ .../data/verification_17_key.json | 399 ------------------ .../data/verification_18_key.json | 399 ------------------ .../data/verification_1_key.json | 399 ------------------ .../data/verification_2_key.json | 399 ------------------ .../data/verification_3_key.json | 399 ------------------ .../data/verification_4_key.json | 399 ------------------ .../data/verification_5_key.json | 399 ------------------ .../data/verification_6_key.json | 399 ------------------ .../data/verification_7_key.json | 399 ------------------ .../data/verification_8_key.json | 399 ------------------ .../data/verification_9_key.json | 399 ------------------ .../src/commitment_generator.rs | 37 -- .../src/json_to_binary_vk_converter.rs | 31 -- .../src/lib.rs | 188 --------- .../src/main.rs | 48 --- .../src/tests.rs | 68 --- core/lib/multivm/Cargo.toml | 2 + .../vm_latest/implementation/execution.rs | 2 +- .../vm_latest/tracers/circuits_capacity.rs | 102 +++++ .../vm_latest/tracers/circuits_tracer.rs | 160 +++++++ .../vm_latest/tracers/default_tracers.rs | 81 +--- .../src/versions/vm_latest/tracers/mod.rs | 3 + core/lib/types/src/circuit.rs | 13 - core/lib/types/src/lib.rs | 1 - core/lib/zksync_core/Cargo.toml | 1 - docker/circuit-synthesizer/Dockerfile | 1 - docker/prover-gar/Dockerfile | 1 - docker/prover/Dockerfile | 2 - docker/server-v2/Dockerfile | 1 - etc/env/base/rust.toml | 1 - prover/circuit_synthesizer/Cargo.toml | 1 - prover/prover/Cargo.toml | 1 - 46 files changed, 277 insertions(+), 8149 deletions(-) delete mode 100644 core/bin/verification_key_generator_and_server/Cargo.toml delete mode 100644 core/bin/verification_key_generator_and_server/README.md delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_0_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_10_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_11_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_12_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_13_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_14_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_15_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_16_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_17_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_18_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_1_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_2_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_3_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_4_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_5_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_6_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_7_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_8_key.json delete mode 100644 core/bin/verification_key_generator_and_server/data/verification_9_key.json delete mode 100644 core/bin/verification_key_generator_and_server/src/commitment_generator.rs delete mode 100644 core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs delete mode 100644 core/bin/verification_key_generator_and_server/src/lib.rs delete mode 100644 core/bin/verification_key_generator_and_server/src/main.rs delete mode 100644 core/bin/verification_key_generator_and_server/src/tests.rs create mode 100644 core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs create mode 100644 core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs delete mode 100644 core/lib/types/src/circuit.rs diff --git a/.dockerignore b/.dockerignore index afd2582d7a29..95fcdfc0a0a7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -37,6 +37,5 @@ contracts/.git !etc/multivm_bootloaders !cargo !bellman-cuda -!core/bin/verification_key_generator_and_server/data/ !prover/vk_setup_data_generator_server_fri/data/ !.github/release-please/manifest.json diff --git a/.gitignore b/.gitignore index eff8079e75db..20c5973e8f48 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ todo Cargo.lock !/Cargo.lock -!/core/bin/verification_key_generator_and_server/Cargo.lock !/infrastructure/zksync-crypto/Cargo.lock !/prover/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index e891a7649841..f46e1fb5a10c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4238,6 +4238,7 @@ dependencies = [ "zk_evm 1.3.1", "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", "zk_evm 1.4.0", + "zkevm_test_harness 1.4.0", "zksync_contracts", "zksync_eth_signer", "zksync_state", @@ -8756,7 +8757,6 @@ dependencies = [ "zksync_test_account", "zksync_types", "zksync_utils", - "zksync_verification_key_generator_and_server", "zksync_web3_decl", ] @@ -9173,25 +9173,6 @@ dependencies = [ "zksync_basic_types", ] -[[package]] -name = "zksync_verification_key_generator_and_server" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "circuit_testing", - "ff_ce", - "hex", - "itertools", - "once_cell", - "serde_json", - "structopt", - "tracing", - "vlog", - "zksync_prover_utils", - "zksync_types", -] - [[package]] name = "zksync_web3_decl" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index ac01673bfb99..3d0c2a93f580 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ members = [ "core/bin/snapshots_creator", "core/bin/storage_logs_dedup_migration", "core/bin/system-constants-generator", - "core/bin/verification_key_generator_and_server", "core/bin/verified_sources_fetcher", "core/bin/zksync_server", # Libraries diff --git a/core/bin/verification_key_generator_and_server/Cargo.toml b/core/bin/verification_key_generator_and_server/Cargo.toml deleted file mode 100644 index b49683424a40..000000000000 --- a/core/bin/verification_key_generator_and_server/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "zksync_verification_key_generator_and_server" -version = "0.1.0" -edition = "2018" -license = "MIT OR Apache-2.0" - -[lib] -name = "zksync_verification_key_server" -path = "src/lib.rs" - -[[bin]] -name = "zksync_verification_key_generator" -path = "src/main.rs" - -[[bin]] -name = "zksync_json_to_binary_vk_converter" -path = "src/json_to_binary_vk_converter.rs" - -[[bin]] -name = "zksync_commitment_generator" -path = "src/commitment_generator.rs" - -[dependencies] -zksync_types = { path = "../../lib/types" } -zksync_prover_utils = { path = "../../lib/prover_utils" } -vlog = { path = "../../lib/vlog" } -circuit_testing = { git = "https://github.com/matter-labs/era-circuit_testing.git", branch = "main" } -itertools = "0.10.5" -bincode = "1.3.3" - -anyhow = "1.0" -serde_json = "1.0.85" -hex = "0.4.3" -structopt = "0.3.26" -ff = { package = "ff_ce", version = "0.14.1" } -once_cell = "1.8.0" -tracing = "0.1" diff --git a/core/bin/verification_key_generator_and_server/README.md b/core/bin/verification_key_generator_and_server/README.md deleted file mode 100644 index efe7d3f99a4e..000000000000 --- a/core/bin/verification_key_generator_and_server/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Verification keys - -We currently have around 20 different circuits like: Scheduler, Leaf, KeccakPrecompile etc (for the full list - look at -CircuitType enum in sync_vm repo). - -Each such circuit requires a separate verification key. - -This crate fulfills 2 roles: - -- it has the binaries that can generate the updated versions of the keys (for example if VM code changes) -- it provides the libraries that can be used by other components that need to use these keys (for example provers) - - behaving like a key server. - -Moreover, all these keys are submitted as code within the repo in `verification_XX_key.json` files. - -## zksync_verification_key_server - -This is the library that can be used by other components to fetch the verification key for a given circuit (using -`get_vk_for_circuit_type` function). - -## zksync_verification_key_generator - -The main binary that generates verification key for given circuits. Most of the heavy lifting is done by the -`create_vk_for_padding_size_log_2` method from circuit_testing repo. - -The results are written to the `verification_XX_key.json` files in the current repository. - -## zksync_json_to_binary_vk_converter - -Converts the local json verification keys into the binary format (and stores them in the output directory). - -## zksync_commitment_generator - -This tool takes the 3 commitments (one for all the basic circuits, one for node and one for leaf), computed based on the -current verification keys - and updates the contract.toml config file (which is located in etc/env/base/contracts.toml). - -These commitments are later used in one of the circuit breakers - to compare their values to the commitments that L1 -contract holds (so that we can 'panic' properly - if we notice that our server's commitments differ from the L1 -contracts - which would result in failed L1 transactions). diff --git a/core/bin/verification_key_generator_and_server/data/verification_0_key.json b/core/bin/verification_key_generator_and_server/data/verification_0_key.json deleted file mode 100644 index c3262193a4fd..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_0_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 14745348174000482855, - 2839037062185937123, - 3369862715588854899, - 1495909583940713128 - ], - "y": [ - 6859454683840363585, - 11340551061368171664, - 9528805406487149561, - 3414144677220223705 - ], - "infinity": false - }, - { - "x": [ - 9215749870136224396, - 18418669114332753377, - 13140219601461030180, - 2381098845928447331 - ], - "y": [ - 8834765081837029169, - 4424842234296363904, - 13294547557836067005, - 414624398145171890 - ], - "infinity": false - }, - { - "x": [ - 2148575411987453084, - 16730180692461995258, - 12423475767707134837, - 3014264170083149730 - ], - "y": [ - 10870860158804422503, - 14060279526953529989, - 2266257082861680293, - 22356173050560284 - ], - "infinity": false - }, - { - "x": [ - 17803008042411335770, - 5713064950476621403, - 17979342410816871746, - 491265656076548841 - ], - "y": [ - 9823492080506672630, - 3637386621225409615, - 8776978043600973097, - 2514196809208915768 - ], - "infinity": false - }, - { - "x": [ - 3768479078383323179, - 16153057542709544671, - 10578964798085613273, - 2831188075764800753 - ], - "y": [ - 2387514805820590694, - 15085489652142686165, - 8141513931186597223, - 1582376980242699819 - ], - "infinity": false - }, - { - "x": [ - 5395455814671474247, - 5013790368139874617, - 8671649443504728767, - 839142828943885970 - ], - "y": [ - 11231626069154926735, - 5078347962234771017, - 17373886182204596447, - 513647957075879347 - ], - "infinity": false - }, - { - "x": [ - 8940485327950054531, - 9156997542069636576, - 14316753178152000598, - 3357551869664255582 - ], - "y": [ - 14102490706504125272, - 4494991810930729808, - 15532318871086968466, - 1537365238286274178 - ], - "infinity": false - }, - { - "x": [ - 13914906478277300859, - 6213896071228541481, - 4364409818367302306, - 659097390118096039 - ], - "y": [ - 7328372274594390887, - 2650332638498669615, - 15455628473476960005, - 3119379427019958230 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 9438200511694036157, - 11094162170960057340, - 9123678872696723713, - 2950597355117190054 - ], - "y": [ - 6153972960518016517, - 8045683598100955864, - 13410633858416643489, - 988361678931464913 - ], - "infinity": false - }, - { - "x": [ - 805964423710846142, - 13603470797942296854, - 11292123377140077447, - 1455913517812009773 - ], - "y": [ - 4541622738043214385, - 8186357170000535775, - 4765839113294831637, - 3026863977499737494 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 1851039213129741497, - 11907960788190413713, - 2882727828085561070, - 1451278944954982956 - ], - "y": [ - 15245785050592773860, - 1774295027236395480, - 3373069120056880915, - 1080245109458702174 - ], - "infinity": false - }, - { - "x": [ - 9366052859968548005, - 12275028918364559591, - 2472023927159177225, - 1052535074027277666 - ], - "y": [ - 2428574557555628629, - 15067392861858369528, - 16949255188095910778, - 2297925771936569168 - ], - "infinity": false - }, - { - "x": [ - 17016009610362956206, - 4047659663396753591, - 1832464593155416403, - 2725142957049914767 - ], - "y": [ - 12447928856414787240, - 3072280375285720285, - 12294239288643819494, - 613511140380288958 - ], - "infinity": false - }, - { - "x": [ - 6312774245791141720, - 496150993329472460, - 12773767122915456934, - 3404402910494500531 - ], - "y": [ - 13852578578747731084, - 9030931732410275304, - 17159996848865265705, - 1696956882146098553 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 1073530, - "lookup_selector_commitment": { - "x": [ - 4441974708940861232, - 11325614820129407652, - 7273013871150456559, - 2270181644629652201 - ], - "y": [ - 3070631142979677922, - 15247189094202672776, - 12651459662740804392, - 1832216259472686694 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 7312875299592476003, - 313526216906044060, - 13914875394436353152, - 3424388477700656316 - ], - "y": [ - 2572062173996296044, - 5984767625164919974, - 12005537293370417131, - 616463121946800406 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_10_key.json b/core/bin/verification_key_generator_and_server/data/verification_10_key.json deleted file mode 100644 index ec9d3727bff9..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_10_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 4364720487844379181, - 17010766725144227333, - 1022678199111276314, - 1146578362772127376 - ], - "y": [ - 10340654727439455072, - 12691578856596245032, - 837883495763401146, - 2135776887902289239 - ], - "infinity": false - }, - { - "x": [ - 14564870240038241482, - 16001391704613609683, - 16397364612792898214, - 1316914335235774452 - ], - "y": [ - 2386942353392090183, - 4642131766714508143, - 16789479723446408276, - 2261353401184907401 - ], - "infinity": false - }, - { - "x": [ - 6081056006818109026, - 14051483412950926523, - 8605392534710099348, - 1527183574619010123 - ], - "y": [ - 3896696527234063839, - 12862398541231039501, - 1005646628007936886, - 3479645512156004366 - ], - "infinity": false - }, - { - "x": [ - 11266242489999219523, - 8100856016495224488, - 6788749864393617587, - 482299081118345826 - ], - "y": [ - 225211373180020785, - 6498635074385582091, - 4274055525472487569, - 2578651815252093838 - ], - "infinity": false - }, - { - "x": [ - 10378455392293934375, - 13391940670290769236, - 10463014668466536299, - 472544008986099462 - ], - "y": [ - 1502016714118108544, - 14252801754530793876, - 2203844491975584716, - 1116114255465135672 - ], - "infinity": false - }, - { - "x": [ - 9703616742074407567, - 9691703077434834222, - 7366620887865105973, - 36165572355418066 - ], - "y": [ - 7430304832706471782, - 5173267152399523091, - 14416699599905226230, - 2681204653630184824 - ], - "infinity": false - }, - { - "x": [ - 9347312215430913530, - 13606433894103359668, - 14013475178334262360, - 2947181048682744075 - ], - "y": [ - 4001199390012145932, - 4622813642635649819, - 16433672063298879053, - 1247842462976799965 - ], - "infinity": false - }, - { - "x": [ - 1639425503718708209, - 8242804754724970899, - 11043260258533730377, - 2245145560504199089 - ], - "y": [ - 14202551139064230506, - 4307109380979442947, - 13141687433511141087, - 1913204959448290015 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 17540836040216578409, - 14577118461028955096, - 2300935836423716880, - 427649651480863044 - ], - "y": [ - 13066723755606073272, - 17324941433857131282, - 1679499122173566851, - 3298750515604566671 - ], - "infinity": false - }, - { - "x": [ - 14709152157752642079, - 13510549649315108277, - 3019440420162710858, - 627188607991231846 - ], - "y": [ - 16615706301470133997, - 915024441316023047, - 13798541787831785917, - 3340602253234308653 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 12626704863583094704, - 3308474372162220296, - 16088806788444947642, - 636430705662147361 - ], - "y": [ - 17052785040105865748, - 11203395113497209978, - 2939609765212411460, - 3167290643533167611 - ], - "infinity": false - }, - { - "x": [ - 3075146465184418179, - 11559452521956513155, - 1656597085428845901, - 1618447062156730856 - ], - "y": [ - 2010693621773175313, - 2977509893150409878, - 9431891659616951962, - 1776222288355278384 - ], - "infinity": false - }, - { - "x": [ - 6408318860212838666, - 9847136022608767026, - 18080834927350013528, - 3306285138140631107 - ], - "y": [ - 16064928058583899597, - 461689523483649779, - 13572099112445223829, - 1563453638232968523 - ], - "infinity": false - }, - { - "x": [ - 327171445663828020, - 12706053900720413614, - 9237483585964880752, - 1960293149538216528 - ], - "y": [ - 11030775691809003651, - 11089052388657955457, - 3209890793790993499, - 1198867574642866523 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 5202052, - "lookup_selector_commitment": { - "x": [ - 781239045644769777, - 14316527640474633593, - 2443643435827373112, - 3049372365263474427 - ], - "y": [ - 4073012743593667819, - 16009537994875540924, - 11173412503242869179, - 1513208421597995174 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 697552212563769686, - 7709943502535418760, - 15019345407325619175, - 3433081085078580257 - ], - "y": [ - 8668947019840357731, - 14698901351824712883, - 15088598879190660424, - 2873081208166433946 - ], - "infinity": false - }, - { - "x": [ - 7893133928909060673, - 7064922516930129957, - 3592836702741304814, - 2239702595710114437 - ], - "y": [ - 7691360541875191519, - 11379321785127235277, - 6653616064071569031, - 2555434628517540774 - ], - "infinity": false - }, - { - "x": [ - 6243944238013052821, - 7908243182210136125, - 17178099109525791299, - 2553622184721264566 - ], - "y": [ - 736121280088239428, - 6158073429758170526, - 11217302997977204117, - 2594798912020899417 - ], - "infinity": false - }, - { - "x": [ - 2064240298596094591, - 16917726764104887991, - 11042784977532408536, - 3377647228930170830 - ], - "y": [ - 10635525052494768819, - 387400048616497096, - 9379200582543310995, - 1571766153703296253 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 7603211811706190713, - 2486982239745271096, - 11528266448545919500, - 3080741880407152411 - ], - "y": [ - 7967754771633653173, - 6016822892450616749, - 9688696792558711613, - 2682562048141398047 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_11_key.json b/core/bin/verification_key_generator_and_server/data/verification_11_key.json deleted file mode 100644 index ec60b1b5c70c..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_11_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 6404793958941109752, - 600086648940026770, - 17621036346050218167, - 648286585825030202 - ], - "y": [ - 15536368541166505022, - 13874331483468128999, - 15299774519724050181, - 694528839710637549 - ], - "infinity": false - }, - { - "x": [ - 8437895530551083583, - 9515418928119648176, - 13043255827139294721, - 2995712510038409810 - ], - "y": [ - 2599666661350767554, - 5213004864468121936, - 3448071048439343925, - 3372727479169634860 - ], - "infinity": false - }, - { - "x": [ - 4949545806128010634, - 7991544258837652527, - 13984289231122041826, - 435264553263929947 - ], - "y": [ - 5315155210033461895, - 5269954775753247626, - 8365554241810378947, - 3038338810517586456 - ], - "infinity": false - }, - { - "x": [ - 10765735847634894938, - 996016141851615448, - 17905928073714218280, - 1382306444325686451 - ], - "y": [ - 2138154197587423296, - 10332772886666867909, - 18365120064743353477, - 3036329558617382049 - ], - "infinity": false - }, - { - "x": [ - 10826908009799408310, - 17008417534705779156, - 6763973494549063072, - 2085829964414931488 - ], - "y": [ - 8778528796073273991, - 3575354418973385595, - 7700555759899743641, - 2991788183234680231 - ], - "infinity": false - }, - { - "x": [ - 4838537981048085423, - 17733460364049897496, - 2406410363431464143, - 317979983533551325 - ], - "y": [ - 1063783130085451648, - 17468950496650586998, - 1638492556781126884, - 2655791721465286744 - ], - "infinity": false - }, - { - "x": [ - 9900079822056413611, - 2971494295919434281, - 3851188096409515874, - 1674965457600938162 - ], - "y": [ - 278026997091552202, - 4169606578927284200, - 4285297176993939496, - 1835673146863992148 - ], - "infinity": false - }, - { - "x": [ - 14972922803706426724, - 1950002897609593521, - 14885502244328862256, - 2711533695106895845 - ], - "y": [ - 6445273103061253271, - 13093783937225622775, - 16913300898726970338, - 3338984185497324237 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 7023363902839996761, - 10470701207992157969, - 15655647820064667897, - 1574806151825297776 - ], - "y": [ - 5374465760860613169, - 17808737811039085287, - 9497881147171478776, - 2496973717640690197 - ], - "infinity": false - }, - { - "x": [ - 11667333913021610767, - 981513539224109240, - 906325130343873228, - 2938085706999497365 - ], - "y": [ - 12114685726509803851, - 8176447551157079615, - 4677211732718215770, - 612959750791398009 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 5178916486603003859, - 12440762249350081718, - 17531240512375127539, - 562979322442547791 - ], - "y": [ - 13269831614205338393, - 14075713698585784838, - 5009519510530479124, - 346033861980045408 - ], - "infinity": false - }, - { - "x": [ - 9815443577325313677, - 10727907015331332054, - 7582395371050260833, - 1746872659838481572 - ], - "y": [ - 3973552805135639320, - 14426732004648741961, - 8133164322153358522, - 2668541869556858228 - ], - "infinity": false - }, - { - "x": [ - 4868257934818957423, - 11529848268525929099, - 7089666284160764141, - 796901367628793969 - ], - "y": [ - 991195814042705325, - 1559922382138761102, - 15616159453482282503, - 1031107741111093289 - ], - "infinity": false - }, - { - "x": [ - 17936772813090339705, - 10208762457499980701, - 14796710996322725970, - 638550977107438851 - ], - "y": [ - 5073905611192321777, - 2956648407808816974, - 7778989780119416172, - 2955106321082932072 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 7960377, - "lookup_selector_commitment": { - "x": [ - 1083743271968869166, - 3134203175755215736, - 5835502497758804469, - 3010956977291777466 - ], - "y": [ - 3645612220088813035, - 32844736552579976, - 5426466326302260857, - 1489565191618899261 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 5825422128268478267, - 9219263846299851036, - 3879231702557190566, - 1702488722758880769 - ], - "y": [ - 18311881100262470992, - 5742998199368802392, - 18106865487471159417, - 502191980176920012 - ], - "infinity": false - }, - { - "x": [ - 17195892082859417081, - 7890531942603584793, - 2381805632820057528, - 3173232410464566465 - ], - "y": [ - 16359614627947132075, - 3459600273035137079, - 4550762061432972122, - 3394559699318358224 - ], - "infinity": false - }, - { - "x": [ - 1716103379277390185, - 18097936269579187542, - 16357329729761063450, - 1508640059338197502 - ], - "y": [ - 11014806739603983364, - 4396503314588777389, - 9397245609635151055, - 1703957955248411380 - ], - "infinity": false - }, - { - "x": [ - 4770171350693477354, - 17110558673192292253, - 9799800677557311408, - 761984875463445481 - ], - "y": [ - 1560561403388310063, - 31331275310848146, - 287152055803835484, - 457826332542037277 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 11327495732840772606, - 7407664417001729515, - 9486600059857658309, - 3060296564241189838 - ], - "y": [ - 7624492872489320847, - 18248981556039704277, - 3877205757853252152, - 939885486002612376 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_12_key.json b/core/bin/verification_key_generator_and_server/data/verification_12_key.json deleted file mode 100644 index fec076f39eda..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_12_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 456514006020943025, - 9595480195714948127, - 12254096252487404245, - 1742692690750856358 - ], - "y": [ - 16294223586064957217, - 3958270970168887906, - 11264067544872898258, - 1692817687935973108 - ], - "infinity": false - }, - { - "x": [ - 1359655052308122459, - 13840124148496555776, - 1774237333490664500, - 2964872651584750318 - ], - "y": [ - 11907598503482948769, - 8700506041798646988, - 15081040576888859990, - 3096802642049924528 - ], - "infinity": false - }, - { - "x": [ - 2884314851670818573, - 13442465544210396156, - 5937955495868181363, - 2486997439179977778 - ], - "y": [ - 9309776793338098458, - 14492906371677122697, - 8837309186596588911, - 1081143755093508499 - ], - "infinity": false - }, - { - "x": [ - 2655654413304275855, - 4244723109566147837, - 12150359360501203194, - 3338981627918702615 - ], - "y": [ - 2522870072161287404, - 17341373219317210182, - 13058930363994599297, - 210373422168410518 - ], - "infinity": false - }, - { - "x": [ - 16728834675380740056, - 2139390496020366235, - 9480389182940223467, - 2279560291896695719 - ], - "y": [ - 12461418813218976432, - 357566005384566098, - 5295578385080568808, - 1801243085576438875 - ], - "infinity": false - }, - { - "x": [ - 8716201428771436123, - 3392394702404760386, - 9990956922582058945, - 1388317411153212399 - ], - "y": [ - 11666415392681680155, - 10553517485129490455, - 16061047708722635939, - 2386622646140901822 - ], - "infinity": false - }, - { - "x": [ - 16162432560623854812, - 15537581062716888632, - 12927223782958923606, - 2800634589869451227 - ], - "y": [ - 5345141365329635916, - 2224393250977631865, - 396527108738048188, - 2298318725146167177 - ], - "infinity": false - }, - { - "x": [ - 18372685954785469756, - 10436523365152935441, - 15509622927999798123, - 2050428620045833325 - ], - "y": [ - 4996265985148335658, - 6073112270434155721, - 4873288683270752338, - 503179567393027927 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 4986139828502830074, - 8644425445976253042, - 4851433922656693398, - 1419574698085640872 - ], - "y": [ - 16192186537521161947, - 16183885683582261905, - 1655718756619164666, - 3420236094426390604 - ], - "infinity": false - }, - { - "x": [ - 10727231722644915889, - 13777116005624794169, - 1422623412369619026, - 1701279717637612575 - ], - "y": [ - 6503647097427010249, - 6381043883853023011, - 15391366286376907281, - 1261207976874708261 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 11852073725466955067, - 179170887563176222, - 17529899074897279348, - 2496783194148289461 - ], - "y": [ - 15490041181991978284, - 6745436372504113852, - 7017978386715410058, - 3482556315200370895 - ], - "infinity": false - }, - { - "x": [ - 1330152738947291505, - 1668990644246591877, - 6805443255260621096, - 1309987766073890626 - ], - "y": [ - 18322300356676620444, - 8225233874302527542, - 5744327785164342590, - 410571567010522636 - ], - "infinity": false - }, - { - "x": [ - 13968210937929584911, - 17067601391996082961, - 4861463652254416951, - 2147834012714370408 - ], - "y": [ - 9012483356698219484, - 8660929519763525826, - 17744882010750642463, - 331423342438323189 - ], - "infinity": false - }, - { - "x": [ - 1352282553299127274, - 8587971715415488300, - 2471024479841756772, - 1239586065229072559 - ], - "y": [ - 1597792022909153930, - 5020991346876715357, - 5622801511814109910, - 1916460940163680567 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 46287674, - "lookup_selector_commitment": { - "x": [ - 11573469000684493293, - 15304040816406013002, - 9206902553183544808, - 2597693769113957036 - ], - "y": [ - 10538181061926273477, - 5239567589495426242, - 3627181047901924882, - 302644994241575377 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 5134795695995115566, - 12287750992060803275, - 3112021177339560487, - 2737779104829043419 - ], - "y": [ - 12960786984497012138, - 17246059378047870426, - 11486754204718893642, - 46104506716724806 - ], - "infinity": false - }, - { - "x": [ - 148472607159578301, - 1393814398025790148, - 13651878286378332448, - 3460878321325997474 - ], - "y": [ - 10791022888598424744, - 1931353219232076143, - 12342018346439101174, - 23632989633122111 - ], - "infinity": false - }, - { - "x": [ - 1355031833403957875, - 10754997913401276231, - 8672292473740482178, - 3014145653612856517 - ], - "y": [ - 3728402825933673134, - 16492594359417243041, - 14619929139939206930, - 2894280666048705144 - ], - "infinity": false - }, - { - "x": [ - 11362104917939269301, - 3050269804312222606, - 17884269955997757593, - 2804911625130359365 - ], - "y": [ - 9563576475625880180, - 9736108320914226650, - 11545696954602328389, - 1108440262014676246 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 5367643753678334453, - 18149093736372716410, - 1335188566370936146, - 668596617655217713 - ], - "y": [ - 9984652217894703540, - 16253861114794085212, - 2139268495406835151, - 710303505771002735 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_13_key.json b/core/bin/verification_key_generator_and_server/data/verification_13_key.json deleted file mode 100644 index 73ffbd212002..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_13_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 17551054392858982554, - 6093238351564742844, - 9461983640740135929, - 665917981733823732 - ], - "y": [ - 5039211542045701927, - 14102316155129161178, - 7599318237652648682, - 1484263542771007309 - ], - "infinity": false - }, - { - "x": [ - 14015566113565304739, - 12895182424777444911, - 5150482782915031712, - 3280776276671330755 - ], - "y": [ - 5503211683737487414, - 5857977821275887356, - 1294122171191120577, - 2917900236095606783 - ], - "infinity": false - }, - { - "x": [ - 11180353512945796758, - 5467792637578213396, - 14862660111090994534, - 1678570344676416345 - ], - "y": [ - 16496106534540891926, - 4355829424666415263, - 8379906815867503783, - 2141225531456729878 - ], - "infinity": false - }, - { - "x": [ - 10512618919562577175, - 8909238001556772501, - 8669074760108324520, - 3259590816167766101 - ], - "y": [ - 15477336671232249792, - 10209451912771766896, - 13672268903388741173, - 682487251336397201 - ], - "infinity": false - }, - { - "x": [ - 14233534177298597555, - 14428793231398751908, - 18070433438826750034, - 1176819688107481869 - ], - "y": [ - 9251234182098356520, - 17131606126090989402, - 17185633762130361526, - 70013401388751862 - ], - "infinity": false - }, - { - "x": [ - 14148566925658671094, - 812517577375883951, - 5030512299767107864, - 44275794325016754 - ], - "y": [ - 3275438385460491589, - 12366768737850140720, - 10754478223029148744, - 64366431004577735 - ], - "infinity": false - }, - { - "x": [ - 5646513434714516506, - 12578668031398681290, - 6956692825033783810, - 536471110695536326 - ], - "y": [ - 876079378616587621, - 9787032999740439668, - 14965634813605966164, - 367083452910738472 - ], - "infinity": false - }, - { - "x": [ - 10902302115259229513, - 14044271471332330954, - 14571826360674828773, - 733766328575554031 - ], - "y": [ - 8186695183963076514, - 621472878958955881, - 14756382569165412398, - 3165780226323675661 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 17780673306296332984, - 10355922416617009060, - 5077451999006954761, - 2644291606399153501 - ], - "y": [ - 884498752701137122, - 731399349168706916, - 4286165746592754883, - 3279732117855760703 - ], - "infinity": false - }, - { - "x": [ - 11012802284910829398, - 7859388231941271159, - 17586341808458361180, - 1386364899721133297 - ], - "y": [ - 15634369655108108777, - 3858480397682251762, - 17706291110507066608, - 1663421415693803071 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 18134041530736321349, - 4345724579806003155, - 2324407857452293002, - 2319164124977213120 - ], - "y": [ - 14302129084811449335, - 8588677756442252515, - 3323846949783670865, - 2109729211841784387 - ], - "infinity": false - }, - { - "x": [ - 14486843004985564085, - 10799247040254992370, - 7658639806933647132, - 2215292564171027727 - ], - "y": [ - 14258341133968554193, - 11685656973533320944, - 14111972937744219524, - 1172604679688980794 - ], - "infinity": false - }, - { - "x": [ - 12872375111956991701, - 14049784009914403066, - 15325016171856456312, - 2811875539960405333 - ], - "y": [ - 5711194902040443430, - 13827091592207472460, - 17950028361571343192, - 1672758585097311581 - ], - "infinity": false - }, - { - "x": [ - 11717525586585736911, - 730672019767199816, - 3010255132348992613, - 2780587454575324896 - ], - "y": [ - 1473124157542628664, - 1573646910034288561, - 10026766074599473146, - 563223750818543582 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 42547753, - "lookup_selector_commitment": { - "x": [ - 4539928924349895484, - 2792770915461027618, - 11611697420465472575, - 1384307956752801018 - ], - "y": [ - 8840366360901511807, - 8892919985613263102, - 11941090149541110830, - 1930352681887390920 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 4121704254446914578, - 13863658665929861884, - 15362282368839162345, - 2762703036966024619 - ], - "y": [ - 102846692212239082, - 14904466746900448136, - 16872429770359000841, - 1687152581020907098 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_14_key.json b/core/bin/verification_key_generator_and_server/data/verification_14_key.json deleted file mode 100644 index e8c42d407e35..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_14_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 6916434521451934576, - 614815553772638285, - 3742595993843812033, - 2823214088432624432 - ], - "y": [ - 11642815096362884283, - 18063950820723921281, - 6353943092001719992, - 3201898419478369298 - ], - "infinity": false - }, - { - "x": [ - 10647237757917239762, - 1269177049592707998, - 2650053775033150725, - 582198744757304104 - ], - "y": [ - 9804667267596536998, - 493663115027956828, - 13953159385227792767, - 1568248765042207679 - ], - "infinity": false - }, - { - "x": [ - 7910659438561833906, - 12456422925439856914, - 10869604528749370003, - 1213616301038416610 - ], - "y": [ - 2606202790862698157, - 6809934263763206210, - 17472080335242458272, - 2884639755368519501 - ], - "infinity": false - }, - { - "x": [ - 14211325859682683183, - 11018598407116786751, - 10064425366978091674, - 2748595948091261209 - ], - "y": [ - 13960202853590116423, - 1211975538022172568, - 16303435518817750320, - 1634234707214097860 - ], - "infinity": false - }, - { - "x": [ - 4528591178982443847, - 16310104707629911601, - 5532120103079323919, - 1347877820087040669 - ], - "y": [ - 17983603511717948746, - 9529659424488112452, - 7820918413906679254, - 1819855238351369466 - ], - "infinity": false - }, - { - "x": [ - 14415562798118912210, - 6550719056383417327, - 424281724891761932, - 1264340531903932141 - ], - "y": [ - 7768057951329404686, - 15024442753889769568, - 9676935351692818899, - 1492251668690310932 - ], - "infinity": false - }, - { - "x": [ - 2619366878850208112, - 12150914745315976156, - 8375197026043390274, - 1935272977563031501 - ], - "y": [ - 5381369692389055354, - 17978011500330472972, - 17420193441326928998, - 479187691463910357 - ], - "infinity": false - }, - { - "x": [ - 8720830951139717797, - 15985700059986022675, - 11876530273787337931, - 421322430672290976 - ], - "y": [ - 9700690437922183179, - 1976785701667862157, - 16634886936358874061, - 3002178567925406588 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 8284083154661042764, - 11776500066398184343, - 868620904897679124, - 2988582549909766892 - ], - "y": [ - 10794129605563176627, - 15487634480061313925, - 17194646451372113884, - 2087686927573540537 - ], - "infinity": false - }, - { - "x": [ - 7916190330285050096, - 11731220788334102406, - 6221883233572429550, - 2552280229203107267 - ], - "y": [ - 10510502959728300366, - 14682539966609739595, - 8275243146917870162, - 164811532254637923 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 195850038587200624, - 10136289160450054078, - 4386512701252721226, - 219366815902177323 - ], - "y": [ - 12042545079209848932, - 599057886584676736, - 14545610403811537682, - 498958995843318019 - ], - "infinity": false - }, - { - "x": [ - 4721932753701441297, - 1676671918244393403, - 6943597542294442696, - 50994782040503038 - ], - "y": [ - 8321420884695240511, - 10606883887907326697, - 11471075822795411018, - 1311422627151559437 - ], - "infinity": false - }, - { - "x": [ - 85448132386017640, - 13016912343020112485, - 11647418800345296605, - 1741562939125330787 - ], - "y": [ - 10753835454658443286, - 8646325836340244979, - 7348777908140142985, - 2196062626460604424 - ], - "infinity": false - }, - { - "x": [ - 2125624295892265840, - 12754141819506101591, - 8789168208880604752, - 947087620272222934 - ], - "y": [ - 12566258871261234263, - 12307504590191426495, - 6700589767183706452, - 1828704371386663334 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 42212029, - "lookup_selector_commitment": { - "x": [ - 7709849601046260359, - 6836713108454667472, - 17360769186231334246, - 2348971634881039863 - ], - "y": [ - 13380830060569421804, - 15446653016734774164, - 17884501636917484387, - 1386904567459265970 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 6960699536013090594, - 2075384204892265266, - 12053931571725248687, - 1371193846897305849 - ], - "y": [ - 8904850119058507432, - 10465598889525773001, - 16159541505228012497, - 1982452464017823539 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_15_key.json b/core/bin/verification_key_generator_and_server/data/verification_15_key.json deleted file mode 100644 index 356dbb3c531a..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_15_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 3227382513538635502, - 10189582412003011525, - 1928710987967879299, - 1641062823248805930 - ], - "y": [ - 3271795224553087841, - 14036363906521936156, - 10253705337161624780, - 3091191233208402889 - ], - "infinity": false - }, - { - "x": [ - 3541471743181642086, - 8117051273006688414, - 685909872467163024, - 2614724468827209722 - ], - "y": [ - 1096952120887201428, - 8197980407203032569, - 3949713006885563085, - 2838982585728277197 - ], - "infinity": false - }, - { - "x": [ - 12432945880074879560, - 13444859845042471186, - 16599097070979057001, - 3064039790213026567 - ], - "y": [ - 3745088406100356357, - 11715355314289478148, - 2282946417129489745, - 1619614407449915711 - ], - "infinity": false - }, - { - "x": [ - 6864310053920223866, - 11095455024311706186, - 12229748247000682102, - 2475016349586561501 - ], - "y": [ - 2946781066962542712, - 14275500021265062654, - 7624481756022778467, - 1439658776940615826 - ], - "infinity": false - }, - { - "x": [ - 13589273139905087785, - 10411035015021574213, - 7322465558208873130, - 1805943743448229826 - ], - "y": [ - 13035238946064559886, - 8309482746549063820, - 14229757515324464781, - 1676135665275665956 - ], - "infinity": false - }, - { - "x": [ - 84006308859404982, - 13783127238980064918, - 14101945786439708601, - 3343881426944938693 - ], - "y": [ - 11959320721291234482, - 7288504259378326725, - 9638777183731403514, - 1648453409181088010 - ], - "infinity": false - }, - { - "x": [ - 10987163680360734145, - 3374907765066907489, - 14421201974855570464, - 3148542489906320493 - ], - "y": [ - 17180031485000081847, - 1609372527008367113, - 6050341427989573858, - 477684541505306009 - ], - "infinity": false - }, - { - "x": [ - 2257028353691713628, - 6330174784373016532, - 1686021628649718039, - 2159927805963705967 - ], - "y": [ - 10814125155819336479, - 9673780307204445954, - 7995606758095566598, - 2252251279727988680 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 12209724104183572477, - 11631007075974892904, - 18407423517909669447, - 1123848354500646471 - ], - "y": [ - 4749227851055533192, - 16918951234067984229, - 5345146076707243019, - 2836719468222132526 - ], - "infinity": false - }, - { - "x": [ - 7250866110466496804, - 16022969863388101391, - 16334300930347324147, - 2232272485807431638 - ], - "y": [ - 257675104580526310, - 8044331403028603186, - 2070174268860891010, - 412313474208091695 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 6736882681315025594, - 13400430183084617843, - 17182588928882896917, - 413858188107207402 - ], - "y": [ - 11944170108613027081, - 10598841640624895850, - 9086311820289524704, - 994240611047161478 - ], - "infinity": false - }, - { - "x": [ - 9500318283622871785, - 5480449932874899465, - 13224510306395939252, - 1891329668301281157 - ], - "y": [ - 7314078756040350933, - 1023294602177498218, - 16475078688698425911, - 1793945182112302214 - ], - "infinity": false - }, - { - "x": [ - 17207548058425781429, - 2519222249126358251, - 16087595361924038018, - 3470846273906312296 - ], - "y": [ - 7578361094884620755, - 7082109151721400218, - 13675372677342046523, - 3204472226310685459 - ], - "infinity": false - }, - { - "x": [ - 7036282717341939568, - 3035419720331773758, - 6765191455902729185, - 1301973211946290083 - ], - "y": [ - 697377419426635450, - 14612037890797520515, - 11746079616766057625, - 1031190413179598818 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 6391155, - "lookup_selector_commitment": { - "x": [ - 17111915492430945419, - 17971275185478677346, - 14211391044159602918, - 2381455978713737016 - ], - "y": [ - 13971515893527127207, - 7078722574057096191, - 6337080743811431820, - 757015217034494132 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 5825422128268478267, - 9219263846299851036, - 3879231702557190566, - 1702488722758880769 - ], - "y": [ - 18311881100262470992, - 5742998199368802392, - 18106865487471159417, - 502191980176920012 - ], - "infinity": false - }, - { - "x": [ - 17195892082859417081, - 7890531942603584793, - 2381805632820057528, - 3173232410464566465 - ], - "y": [ - 16359614627947132075, - 3459600273035137079, - 4550762061432972122, - 3394559699318358224 - ], - "infinity": false - }, - { - "x": [ - 1716103379277390185, - 18097936269579187542, - 16357329729761063450, - 1508640059338197502 - ], - "y": [ - 11014806739603983364, - 4396503314588777389, - 9397245609635151055, - 1703957955248411380 - ], - "infinity": false - }, - { - "x": [ - 4770171350693477354, - 17110558673192292253, - 9799800677557311408, - 761984875463445481 - ], - "y": [ - 1560561403388310063, - 31331275310848146, - 287152055803835484, - 457826332542037277 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 12452920133699897102, - 6896642231513345496, - 4655495116895575043, - 1453525729114564853 - ], - "y": [ - 3574087764464303986, - 10141819911397868785, - 2342639320036978232, - 556196027732983028 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_16_key.json b/core/bin/verification_key_generator_and_server/data/verification_16_key.json deleted file mode 100644 index 356dbb3c531a..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_16_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 3227382513538635502, - 10189582412003011525, - 1928710987967879299, - 1641062823248805930 - ], - "y": [ - 3271795224553087841, - 14036363906521936156, - 10253705337161624780, - 3091191233208402889 - ], - "infinity": false - }, - { - "x": [ - 3541471743181642086, - 8117051273006688414, - 685909872467163024, - 2614724468827209722 - ], - "y": [ - 1096952120887201428, - 8197980407203032569, - 3949713006885563085, - 2838982585728277197 - ], - "infinity": false - }, - { - "x": [ - 12432945880074879560, - 13444859845042471186, - 16599097070979057001, - 3064039790213026567 - ], - "y": [ - 3745088406100356357, - 11715355314289478148, - 2282946417129489745, - 1619614407449915711 - ], - "infinity": false - }, - { - "x": [ - 6864310053920223866, - 11095455024311706186, - 12229748247000682102, - 2475016349586561501 - ], - "y": [ - 2946781066962542712, - 14275500021265062654, - 7624481756022778467, - 1439658776940615826 - ], - "infinity": false - }, - { - "x": [ - 13589273139905087785, - 10411035015021574213, - 7322465558208873130, - 1805943743448229826 - ], - "y": [ - 13035238946064559886, - 8309482746549063820, - 14229757515324464781, - 1676135665275665956 - ], - "infinity": false - }, - { - "x": [ - 84006308859404982, - 13783127238980064918, - 14101945786439708601, - 3343881426944938693 - ], - "y": [ - 11959320721291234482, - 7288504259378326725, - 9638777183731403514, - 1648453409181088010 - ], - "infinity": false - }, - { - "x": [ - 10987163680360734145, - 3374907765066907489, - 14421201974855570464, - 3148542489906320493 - ], - "y": [ - 17180031485000081847, - 1609372527008367113, - 6050341427989573858, - 477684541505306009 - ], - "infinity": false - }, - { - "x": [ - 2257028353691713628, - 6330174784373016532, - 1686021628649718039, - 2159927805963705967 - ], - "y": [ - 10814125155819336479, - 9673780307204445954, - 7995606758095566598, - 2252251279727988680 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 12209724104183572477, - 11631007075974892904, - 18407423517909669447, - 1123848354500646471 - ], - "y": [ - 4749227851055533192, - 16918951234067984229, - 5345146076707243019, - 2836719468222132526 - ], - "infinity": false - }, - { - "x": [ - 7250866110466496804, - 16022969863388101391, - 16334300930347324147, - 2232272485807431638 - ], - "y": [ - 257675104580526310, - 8044331403028603186, - 2070174268860891010, - 412313474208091695 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 6736882681315025594, - 13400430183084617843, - 17182588928882896917, - 413858188107207402 - ], - "y": [ - 11944170108613027081, - 10598841640624895850, - 9086311820289524704, - 994240611047161478 - ], - "infinity": false - }, - { - "x": [ - 9500318283622871785, - 5480449932874899465, - 13224510306395939252, - 1891329668301281157 - ], - "y": [ - 7314078756040350933, - 1023294602177498218, - 16475078688698425911, - 1793945182112302214 - ], - "infinity": false - }, - { - "x": [ - 17207548058425781429, - 2519222249126358251, - 16087595361924038018, - 3470846273906312296 - ], - "y": [ - 7578361094884620755, - 7082109151721400218, - 13675372677342046523, - 3204472226310685459 - ], - "infinity": false - }, - { - "x": [ - 7036282717341939568, - 3035419720331773758, - 6765191455902729185, - 1301973211946290083 - ], - "y": [ - 697377419426635450, - 14612037890797520515, - 11746079616766057625, - 1031190413179598818 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 6391155, - "lookup_selector_commitment": { - "x": [ - 17111915492430945419, - 17971275185478677346, - 14211391044159602918, - 2381455978713737016 - ], - "y": [ - 13971515893527127207, - 7078722574057096191, - 6337080743811431820, - 757015217034494132 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 5825422128268478267, - 9219263846299851036, - 3879231702557190566, - 1702488722758880769 - ], - "y": [ - 18311881100262470992, - 5742998199368802392, - 18106865487471159417, - 502191980176920012 - ], - "infinity": false - }, - { - "x": [ - 17195892082859417081, - 7890531942603584793, - 2381805632820057528, - 3173232410464566465 - ], - "y": [ - 16359614627947132075, - 3459600273035137079, - 4550762061432972122, - 3394559699318358224 - ], - "infinity": false - }, - { - "x": [ - 1716103379277390185, - 18097936269579187542, - 16357329729761063450, - 1508640059338197502 - ], - "y": [ - 11014806739603983364, - 4396503314588777389, - 9397245609635151055, - 1703957955248411380 - ], - "infinity": false - }, - { - "x": [ - 4770171350693477354, - 17110558673192292253, - 9799800677557311408, - 761984875463445481 - ], - "y": [ - 1560561403388310063, - 31331275310848146, - 287152055803835484, - 457826332542037277 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 12452920133699897102, - 6896642231513345496, - 4655495116895575043, - 1453525729114564853 - ], - "y": [ - 3574087764464303986, - 10141819911397868785, - 2342639320036978232, - 556196027732983028 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_17_key.json b/core/bin/verification_key_generator_and_server/data/verification_17_key.json deleted file mode 100644 index 4886f501712e..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_17_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 17914331890341023175, - 5200903915088916638, - 7417971632353510341, - 989671567770015891 - ], - "y": [ - 2927207345798721401, - 12686845373576710402, - 977520799157489114, - 1882223742569339495 - ], - "infinity": false - }, - { - "x": [ - 17162848902278956536, - 16169550484471334725, - 10830640611178609260, - 1347016616567630867 - ], - "y": [ - 6224316231648682710, - 10518372790293065661, - 4887066336660303630, - 703109868065750569 - ], - "infinity": false - }, - { - "x": [ - 15783141083967762454, - 16153855592853073081, - 5667838393811413602, - 1552498518850981979 - ], - "y": [ - 4220445586486275972, - 13196202402039716924, - 17506868028821343237, - 2718319833724164541 - ], - "infinity": false - }, - { - "x": [ - 4896615254637588846, - 5804270398165250639, - 10274952983674590649, - 1937027782721476561 - ], - "y": [ - 14180244016629518742, - 1376497406583367686, - 11268467489552574214, - 2331396669725958189 - ], - "infinity": false - }, - { - "x": [ - 191294939748295885, - 2804205121966814820, - 3897841028303648224, - 3406986167359695085 - ], - "y": [ - 6000542982074572633, - 1697448874567677325, - 10313504031977824294, - 320347014349001728 - ], - "infinity": false - }, - { - "x": [ - 6817435454105168413, - 15823888625999007373, - 9766931118761036330, - 3392959293697897728 - ], - "y": [ - 3549039265311512008, - 4758653036115592629, - 219467419355603781, - 83059544477934848 - ], - "infinity": false - }, - { - "x": [ - 5038171725639341807, - 6859992384823395611, - 15284967171349293554, - 16807092603996758 - ], - "y": [ - 16504201956683368367, - 12931995037356002803, - 16812826192957092842, - 3169839139097845275 - ], - "infinity": false - }, - { - "x": [ - 7140480682142203727, - 9518528852331365100, - 6189914959408603471, - 535939568308325781 - ], - "y": [ - 5944679084532939174, - 17280810090456322382, - 3743919877743496107, - 1235924204609568068 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 1929812895882850703, - 10386198218814398503, - 17007521659662498274, - 1093092717342753672 - ], - "y": [ - 14834187133095267171, - 15506032964234961178, - 7626816120460943443, - 871778379365004315 - ], - "infinity": false - }, - { - "x": [ - 15660406110329165813, - 8146521122567923995, - 2421739551937359002, - 3037598346026174089 - ], - "y": [ - 526124545966722472, - 1168331442853419483, - 4128095883471549051, - 2951909971734725955 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 6206240620508019400, - 3690935139087147193, - 15230272164329216928, - 2140680869789406894 - ], - "y": [ - 14967331981004447304, - 1624146052760537503, - 8986435052862626311, - 334011853307313390 - ], - "infinity": false - }, - { - "x": [ - 4342223064246074020, - 2037946044543710684, - 9057698479075332373, - 1955362957846693345 - ], - "y": [ - 13253375713250043938, - 6754658208742468331, - 9339617748652368850, - 3066524060291544175 - ], - "infinity": false - }, - { - "x": [ - 17765629723696241082, - 14243015821582305127, - 922013493526048847, - 186830516636733479 - ], - "y": [ - 14465184942185208224, - 11235596895177038197, - 5490682932088517686, - 1253279069662324930 - ], - "infinity": false - }, - { - "x": [ - 9369367805867402420, - 12663806522952881709, - 10184609326459106945, - 1664572000409921348 - ], - "y": [ - 4383960972942823390, - 6526609131568596717, - 1343118583674917141, - 113408414321095416 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 6306340, - "lookup_selector_commitment": { - "x": [ - 8662938005624859815, - 9126108646717466191, - 14321121874090966307, - 2777446762308933634 - ], - "y": [ - 12555265159079607081, - 9054928862248682392, - 2784170007581120117, - 1769718192676345815 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 12644448349947379666, - 16345179309557779118, - 10854030671875297787, - 1358228639202695992 - ], - "y": [ - 2673142241557152443, - 11674634738064487673, - 12992693662201776412, - 1888958170754620568 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_18_key.json b/core/bin/verification_key_generator_and_server/data/verification_18_key.json deleted file mode 100644 index 0987039dd1fa..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_18_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 8828437332483635107, - 13777915698231175292, - 11504510351588004199, - 2516385517175522236 - ], - "y": [ - 1530453459325046685, - 2126477283125660971, - 6874073688275717548, - 2971751478402184988 - ], - "infinity": false - }, - { - "x": [ - 3490885152333630169, - 4123320877294819459, - 5138828731030738163, - 3039569146695764058 - ], - "y": [ - 10725322881860790776, - 1512262420257872325, - 10563843054743673205, - 447776577449487981 - ], - "infinity": false - }, - { - "x": [ - 14957646468235752771, - 6216555943494703122, - 7827110015048654177, - 2702223139144227095 - ], - "y": [ - 505353369980003046, - 9687811614109626117, - 5346740791392836415, - 1340467989233731971 - ], - "infinity": false - }, - { - "x": [ - 3201028595190213325, - 9659059230246338206, - 901122635500995415, - 765851963674764103 - ], - "y": [ - 10609226610841230792, - 8145519080052709505, - 17851750066177581293, - 362176586681460505 - ], - "infinity": false - }, - { - "x": [ - 13374935211181268625, - 1347742735582506393, - 4588995338963087243, - 94453217016201562 - ], - "y": [ - 4077548225372117006, - 11859845367084549583, - 2736752177668563039, - 1134818940315684409 - ], - "infinity": false - }, - { - "x": [ - 9467178015658262369, - 10545965721679492606, - 5726831550010619228, - 2051827871593168334 - ], - "y": [ - 6169140154733194545, - 5574043976386236933, - 12140759986363309479, - 1521273866181786590 - ], - "infinity": false - }, - { - "x": [ - 9642818207174528085, - 15617465062711953088, - 11263174413902929450, - 639683138088730423 - ], - "y": [ - 15150652293369779803, - 11338278639695990684, - 12204993260723588081, - 2039902155290309382 - ], - "infinity": false - }, - { - "x": [ - 7292405600450693833, - 573142590034645775, - 1583019100043676600, - 1978695840953226358 - ], - "y": [ - 5154489367309996043, - 8763740977657654022, - 9821219773990064941, - 2636875463267519559 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 2075450237700219880, - 2920304484074114568, - 8294843245052708759, - 555293007149161182 - ], - "y": [ - 6360019558055677441, - 7673047654179899818, - 10263007591992092214, - 2148859098846651643 - ], - "infinity": false - }, - { - "x": [ - 3970783323754285443, - 13019363829879217592, - 18197490676081603277, - 630296172623407012 - ], - "y": [ - 7987745494904024640, - 9631048689610078757, - 1592818072678520163, - 2678374240960081558 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 3055966415338102721, - 18231075292903695376, - 9187400351012014001, - 2311743062653684305 - ], - "y": [ - 2553578246375478674, - 930511927228692161, - 2271826946385879571, - 3124263363559878329 - ], - "infinity": false - }, - { - "x": [ - 6936812562216228782, - 15195638439305648290, - 17827467578192758430, - 2674740411261002393 - ], - "y": [ - 9738743088557108685, - 17225541903460577384, - 16627013813461429872, - 494410407050490065 - ], - "infinity": false - }, - { - "x": [ - 10570962909758341245, - 18167360144953681397, - 2744925075742623060, - 736412139310579435 - ], - "y": [ - 13849279071386536985, - 10093748777935480433, - 904764951143479286, - 138814932031469939 - ], - "infinity": false - }, - { - "x": [ - 4533871929444677010, - 10106157783629999301, - 4178648893377901718, - 3164693318611048089 - ], - "y": [ - 12699039702383686311, - 4388078229442418460, - 8961813905523894854, - 570254591975307765 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 18884644, - "lookup_selector_commitment": { - "x": [ - 15022814412717317376, - 17444332185630324119, - 14685665421775887958, - 906494215348891007 - ], - "y": [ - 9833778905776399360, - 1648124311168457783, - 3500435402371619753, - 2370413643071351216 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 8321950609730151216, - 18010887235457883784, - 17038267498493175776, - 1380842840607309871 - ], - "y": [ - 3264160671000273944, - 16611917363401804468, - 8505391859632632917, - 2149881676646664319 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_1_key.json b/core/bin/verification_key_generator_and_server/data/verification_1_key.json deleted file mode 100644 index 0310303d2a53..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_1_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 7601801432079276288, - 15201863322122857773, - 8806193975262404580, - 2590787273683229105 - ], - "y": [ - 16702527967956763728, - 6181870639994435984, - 1867123357108619315, - 2767403024411663364 - ], - "infinity": false - }, - { - "x": [ - 2455316591212726341, - 2027771240685247927, - 10685588854446154162, - 3030775657966372875 - ], - "y": [ - 18300009037843703356, - 1612973442135305251, - 10693350009422283513, - 1442590213691840716 - ], - "infinity": false - }, - { - "x": [ - 12311884457715965312, - 10390638194798557018, - 11306832124741148566, - 300716765354847473 - ], - "y": [ - 9707964220031061231, - 14753080439380196493, - 5717535245627190368, - 702219636062983319 - ], - "infinity": false - }, - { - "x": [ - 7758453297146426337, - 1673770484163252092, - 14607544807007157753, - 857313958429629763 - ], - "y": [ - 14921629410308576937, - 15298335487420996140, - 2704982045392946878, - 2611590721009022852 - ], - "infinity": false - }, - { - "x": [ - 14311011031579784592, - 15625526098906078640, - 1319146597092063841, - 774276845418764858 - ], - "y": [ - 3893523842912943845, - 18146056093503974553, - 11030513442747849089, - 389965813625175232 - ], - "infinity": false - }, - { - "x": [ - 7007915445081129178, - 2401922490835966325, - 418720827124106725, - 2770268368066902308 - ], - "y": [ - 12116308634970006696, - 14528630571959109449, - 9950799281726780069, - 724152027617190422 - ], - "infinity": false - }, - { - "x": [ - 2442021019274420960, - 16295185893380203674, - 2439146651414642189, - 2243335375830582173 - ], - "y": [ - 3782090054162740071, - 4704457281172608987, - 4410900061257118309, - 764611777065564766 - ], - "infinity": false - }, - { - "x": [ - 17964884224938230037, - 7876675311267561320, - 16762398450655445790, - 1210707988542142007 - ], - "y": [ - 10470358785861361347, - 9485656365593190672, - 6046378362748740079, - 2457285875935475197 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 17157526827088368172, - 11284084393440625999, - 9351565798611728109, - 3234841809825307363 - ], - "y": [ - 8319704714678793930, - 4159327153032521498, - 15356346081767327573, - 3239913585027348493 - ], - "infinity": false - }, - { - "x": [ - 15456321646261647359, - 15891438700803416959, - 3317730603133051465, - 2641175705943818316 - ], - "y": [ - 1411951218052246200, - 1661720531643832913, - 13537400120511760371, - 2292851110898807736 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 10328956753700766823, - 2827084848292920926, - 6753362467616392790, - 3266354497443915853 - ], - "y": [ - 4786671171082888838, - 11071539213550223285, - 3886224490311829958, - 1435384580945051012 - ], - "infinity": false - }, - { - "x": [ - 6970901872301032061, - 11845499850875638451, - 12523013241874863158, - 564589203700245768 - ], - "y": [ - 9149991346853645253, - 10833082414663634622, - 10032445307744641248, - 3184550747076826571 - ], - "infinity": false - }, - { - "x": [ - 2899501934612768796, - 7289832407727333580, - 15398305180487198919, - 2955735241334744486 - ], - "y": [ - 4963499698281910643, - 5723522390488208800, - 3637467607919864741, - 339118267031086794 - ], - "infinity": false - }, - { - "x": [ - 16561673014946600686, - 6893642268089467710, - 11554023210615815565, - 122477375056362239 - ], - "y": [ - 15978560303000591303, - 6087766803442805629, - 6114779478264008006, - 2753348573959524636 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 30899639, - "lookup_selector_commitment": { - "x": [ - 4819118611809066421, - 16205075690681881406, - 8088108199972047891, - 2462381205202312681 - ], - "y": [ - 9403235417076804812, - 11746452954984920263, - 5479393366572364588, - 2168476120537571525 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 1589280911861251894, - 2000192568988587993, - 18399902493387281635, - 1843483375839232315 - ], - "y": [ - 14712825033319581746, - 11500494123399487569, - 4370642671010258701, - 567620704393396341 - ], - "infinity": false - }, - { - "x": [ - 0, - 0, - 0, - 0 - ], - "y": [ - 1, - 0, - 0, - 0 - ], - "infinity": true - }, - { - "x": [ - 0, - 0, - 0, - 0 - ], - "y": [ - 1, - 0, - 0, - 0 - ], - "infinity": true - }, - { - "x": [ - 5989740765536181742, - 7510673671757970234, - 7988398980529338112, - 2047433943537325290 - ], - "y": [ - 14952889876146512965, - 17141012675484923048, - 328206788961236528, - 866564802795139 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 4824978155651454377, - 12191454623887257586, - 12973919510878979890, - 52932438992466171 - ], - "y": [ - 17857145998747603901, - 2092039184434926372, - 11018504664231591204, - 1321736242331612854 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_2_key.json b/core/bin/verification_key_generator_and_server/data/verification_2_key.json deleted file mode 100644 index 79b16257213f..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_2_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 5518783475412319303, - 13900056820557691891, - 3293972357974626054, - 2215936931279678502 - ], - "y": [ - 7955917949806788616, - 13341003959544330056, - 2090626280536970058, - 340565138339520735 - ], - "infinity": false - }, - { - "x": [ - 14185170917510557830, - 8046892618400404954, - 16599645397148333553, - 2994187418830549588 - ], - "y": [ - 7234254448777026502, - 8445782435526889669, - 14116370103157060862, - 2248206929083565209 - ], - "infinity": false - }, - { - "x": [ - 11154659552703848544, - 12941656139895069323, - 17062140236305086427, - 722110816848028084 - ], - "y": [ - 5009717036998782771, - 827592822749515890, - 15966856850732642654, - 618036931564479654 - ], - "infinity": false - }, - { - "x": [ - 5157594213696692987, - 15014090155482426422, - 706425002062263449, - 3203486979181293219 - ], - "y": [ - 14363949081622225749, - 9001876918808042476, - 1615414451418136701, - 444697301726425121 - ], - "infinity": false - }, - { - "x": [ - 9176460251336839321, - 17295305184785757140, - 7831134341003191604, - 2666806971657364559 - ], - "y": [ - 2598277252699259004, - 11916936738177575234, - 2912317122505195338, - 2404138220482962548 - ], - "infinity": false - }, - { - "x": [ - 11575910134534349159, - 14192914809594698195, - 18267718409201448839, - 142641722814285206 - ], - "y": [ - 5883506329268908990, - 2832339585209792351, - 14642260147093833347, - 392817691249359885 - ], - "infinity": false - }, - { - "x": [ - 12908012748245269010, - 6525727331816152736, - 16979431824428028279, - 2845131870310951239 - ], - "y": [ - 1571963770034876851, - 17602700402136611105, - 13310928253737079884, - 3347891464097055062 - ], - "infinity": false - }, - { - "x": [ - 832167803175150309, - 11457734167413059640, - 13250442890410377059, - 2814079984479722654 - ], - "y": [ - 1463471541691279258, - 1744973157713476297, - 1204969522442685286, - 1269233371856967282 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 10352656458395970023, - 3995520406692994966, - 13084432248093257522, - 2302839365715839904 - ], - "y": [ - 8225034751786073151, - 16771047952615636124, - 616708265068224682, - 186403683175385821 - ], - "infinity": false - }, - { - "x": [ - 4270731028924703792, - 3128341040439802084, - 15083522049785140229, - 2261189689222904761 - ], - "y": [ - 8781157350107493893, - 14766318733918494793, - 9428422381369337621, - 419743052593117743 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 11112968480130414212, - 11913364106966677596, - 36671493864905181, - 496058283903160224 - ], - "y": [ - 9691136012048916590, - 12909186572206021308, - 1700657689434945171, - 3072265811815532764 - ], - "infinity": false - }, - { - "x": [ - 11360744654540534278, - 9830357778413675465, - 5192069313646589173, - 113131628631742646 - ], - "y": [ - 5515513518975242303, - 323890392099446701, - 2255482865429449468, - 2322464724330067577 - ], - "infinity": false - }, - { - "x": [ - 3414259545645111239, - 5416149397109634837, - 12993204506510556426, - 2894091844446687144 - ], - "y": [ - 4731949297479191167, - 1043460441127916951, - 16890401788673829290, - 1356564712828723527 - ], - "infinity": false - }, - { - "x": [ - 8993182433738017869, - 11441314659459910136, - 8181494681500166120, - 1591321336872387140 - ], - "y": [ - 5278254820002084488, - 17932571960593236295, - 7626453034762681225, - 3463596506399756742 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 30783671, - "lookup_selector_commitment": { - "x": [ - 1336161834228740427, - 15823221750660268452, - 13689567356831376139, - 1839611883700311389 - ], - "y": [ - 14875759795137726191, - 20318096045504920, - 8816565555629805366, - 75556627728969178 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 1589280911861251894, - 2000192568988587993, - 18399902493387281635, - 1843483375839232315 - ], - "y": [ - 14712825033319581746, - 11500494123399487569, - 4370642671010258701, - 567620704393396341 - ], - "infinity": false - }, - { - "x": [ - 0, - 0, - 0, - 0 - ], - "y": [ - 1, - 0, - 0, - 0 - ], - "infinity": true - }, - { - "x": [ - 0, - 0, - 0, - 0 - ], - "y": [ - 1, - 0, - 0, - 0 - ], - "infinity": true - }, - { - "x": [ - 5989740765536181742, - 7510673671757970234, - 7988398980529338112, - 2047433943537325290 - ], - "y": [ - 14952889876146512965, - 17141012675484923048, - 328206788961236528, - 866564802795139 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 3408213281770836085, - 15382444791373914560, - 16110552627056571461, - 1161688479331593061 - ], - "y": [ - 13379188756114722390, - 12926267823879081751, - 14282599792449107495, - 3244837013658545871 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_3_key.json b/core/bin/verification_key_generator_and_server/data/verification_3_key.json deleted file mode 100644 index 613c65dec32a..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_3_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 4247884029119603815, - 14048318895702359089, - 1617022869923646571, - 1004300266779052296 - ], - "y": [ - 17868528514201987465, - 4244261302597587354, - 10221573892940475912, - 2482382880446840010 - ], - "infinity": false - }, - { - "x": [ - 6238506840459074871, - 18254983327500098151, - 12976360180164130634, - 1219856697105853614 - ], - "y": [ - 1359994609126438238, - 17827470346804056210, - 16773833510918183872, - 2604619773311417557 - ], - "infinity": false - }, - { - "x": [ - 5480908979724966765, - 3393255975447524652, - 10371160681199271551, - 3483125449532424455 - ], - "y": [ - 6910224697959110691, - 8190986918875328214, - 18233342390114194740, - 371038657258361111 - ], - "infinity": false - }, - { - "x": [ - 1589636458242554884, - 17321835409586313003, - 13993520794641679178, - 1266542986497561712 - ], - "y": [ - 5397891169353072140, - 5878548729835574296, - 15706893227817678651, - 1769961527856953483 - ], - "infinity": false - }, - { - "x": [ - 17541435070606794744, - 2655627213950653916, - 11216216944579921605, - 1313780180047509779 - ], - "y": [ - 16950319453735037870, - 1632204383055288188, - 15201163922365522932, - 2864472556240937346 - ], - "infinity": false - }, - { - "x": [ - 11997977223945303553, - 14325590013978700522, - 15557533141347230729, - 3289139360100222484 - ], - "y": [ - 2276406350677881932, - 12276125258173429823, - 6135372778488654786, - 2960027660870022236 - ], - "infinity": false - }, - { - "x": [ - 8889079782908651911, - 9444258938063781000, - 6152157289837951831, - 2046144251434758098 - ], - "y": [ - 3506685845878604982, - 480610274681523215, - 17898829927408725055, - 478373452366390807 - ], - "infinity": false - }, - { - "x": [ - 9543795530837745598, - 5641706788025454992, - 2058665597673045347, - 3199980849578540913 - ], - "y": [ - 2134420461745303677, - 11079036403297001210, - 13973590059437528369, - 2236186172656440899 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 17082763384512425754, - 5415974525679408765, - 2982831717715582652, - 2185533346241584143 - ], - "y": [ - 889517497459248510, - 11305258809453581163, - 14785916458686019285, - 712045239932611417 - ], - "infinity": false - }, - { - "x": [ - 1486326951928055275, - 17648143945822975405, - 8789056175543467342, - 1582641302957127155 - ], - "y": [ - 16130216435506275947, - 186882025793811656, - 5333388052689527168, - 2555185016165074595 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 6775436174991417687, - 1962133343483010121, - 3639644700285584252, - 2751431324201714590 - ], - "y": [ - 16721581791017871189, - 2572212631009994187, - 12263629829130796245, - 1194783809693078725 - ], - "infinity": false - }, - { - "x": [ - 9781583375044732502, - 17099127122236789849, - 15683598159868779227, - 2137916464125382410 - ], - "y": [ - 11971077938028623721, - 14460546631248863771, - 3674726360546135290, - 2587006282919627488 - ], - "infinity": false - }, - { - "x": [ - 2258960665841769264, - 11476106728738999555, - 2154715457718708453, - 1652460267728538717 - ], - "y": [ - 591013691648424928, - 2747643213972148016, - 4382285331965077793, - 700518369290275435 - ], - "infinity": false - }, - { - "x": [ - 17029386353507514799, - 12736838109975824615, - 17948233540620781856, - 1661567367117856229 - ], - "y": [ - 5088293739561490025, - 257269786506894093, - 7029871828271960168, - 2982592857123453815 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 15390957, - "lookup_selector_commitment": { - "x": [ - 3143229288506876352, - 14398478555351850494, - 17971061391349533728, - 2397240458539623423 - ], - "y": [ - 2507720097747632492, - 4897824016944146490, - 8535810669426357324, - 2617442440174156771 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 12925597216490182210, - 13030942092034120135, - 17733316148446765999, - 112547709703624791 - ], - "y": [ - 13293415162200038331, - 13010565234555563811, - 15476251035925496743, - 2588541998389664114 - ], - "infinity": false - }, - { - "x": [ - 11118240121224901946, - 9394562257959111170, - 9026436993514314918, - 1751747619588842429 - ], - "y": [ - 6039590802345873394, - 17531716309156986038, - 1711770599161550805, - 1941094644175870288 - ], - "infinity": false - }, - { - "x": [ - 17999903301086933877, - 10468070608989378923, - 3479353092436121335, - 607756992244480908 - ], - "y": [ - 10863079642303790364, - 4737012301447477097, - 4605789209164294308, - 1430572887755557386 - ], - "infinity": false - }, - { - "x": [ - 4609762018249049814, - 4113097757442144437, - 4725434011535510809, - 2977599521231955696 - ], - "y": [ - 14636094180551257630, - 8819447661702130886, - 1091706295519429215, - 56675985696303183 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 7406705046881629689, - 13550366909312172285, - 11707241152492715411, - 1951231993396003315 - ], - "y": [ - 649840467305243342, - 10916062129580101841, - 7643158916474300887, - 1216418901317802861 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_4_key.json b/core/bin/verification_key_generator_and_server/data/verification_4_key.json deleted file mode 100644 index 8d42dcd66a75..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_4_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 15923176050075197, - 8963905519117333456, - 5333091548039957996, - 1660697180439834807 - ], - "y": [ - 13105864494044341635, - 10079874572012628853, - 4164109084931753781, - 1860950003357484648 - ], - "infinity": false - }, - { - "x": [ - 8216018177730810417, - 13660800917029254431, - 2933384097067755755, - 2823425599268575868 - ], - "y": [ - 8768863192718196559, - 10146282684570870426, - 8275806247588563419, - 605489936306033583 - ], - "infinity": false - }, - { - "x": [ - 4277344855257545209, - 11172040917478096607, - 4489086903928758598, - 289283798032159440 - ], - "y": [ - 10444137083253378550, - 12133212848977612596, - 6748791972701343485, - 286274227999569844 - ], - "infinity": false - }, - { - "x": [ - 8861797510071553254, - 12734094237204882518, - 13692967202881086499, - 641906135411222522 - ], - "y": [ - 6831762763487302461, - 11965405347371646114, - 6218256502970252800, - 3201462388136754725 - ], - "infinity": false - }, - { - "x": [ - 12385743015818134054, - 16282219738575446638, - 3256359841301423419, - 505673042938576760 - ], - "y": [ - 6744956686738207932, - 8994291190634790001, - 16789606231722015883, - 2027930268272962928 - ], - "infinity": false - }, - { - "x": [ - 13671822069226357541, - 818021157447551159, - 10542481209144358852, - 2459295197762128786 - ], - "y": [ - 1072649761929447549, - 6089126583512618706, - 1178131210084507361, - 1066836948212725576 - ], - "infinity": false - }, - { - "x": [ - 16878956366815094090, - 364977461173568122, - 5439594588743996145, - 1265442855735725449 - ], - "y": [ - 11461704536083653156, - 660278441271820299, - 4314245569905306892, - 1438663846765259508 - ], - "infinity": false - }, - { - "x": [ - 9038539654045396650, - 539827912679485452, - 15399544523862100757, - 1256406598444490417 - ], - "y": [ - 5422113905848106255, - 4943961807853536385, - 10022409325033689104, - 3200702511424842211 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 7750990741566547331, - 12040155777441846781, - 3000981333322867315, - 2393292192734976436 - ], - "y": [ - 3394853839941291504, - 944019051205640111, - 1104911864338577098, - 2127308956089601096 - ], - "infinity": false - }, - { - "x": [ - 4735140124663926465, - 16935779121597983173, - 17111626619540374574, - 2327973550601526140 - ], - "y": [ - 8990848735371189388, - 4589751206662798166, - 7575424772436241307, - 2798852347400154642 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 4765077060699177749, - 15235935045874519477, - 2022237788491579392, - 354385727984957703 - ], - "y": [ - 11620113321350620961, - 2521830680983779826, - 14047226057605943635, - 2718701882953208503 - ], - "infinity": false - }, - { - "x": [ - 12967015398643083015, - 1100660813730542482, - 7835181433213557652, - 803165211156388599 - ], - "y": [ - 8557385569712401227, - 535900682745452035, - 16083571717847325979, - 396765644246918860 - ], - "infinity": false - }, - { - "x": [ - 6868107733370365435, - 17106601841261210672, - 12219407605084986215, - 2345246684976405066 - ], - "y": [ - 17532412968783851743, - 9996315626158111485, - 17970945522106166231, - 1003764081419207606 - ], - "infinity": false - }, - { - "x": [ - 7011201477832405407, - 8818123127103997131, - 2979445003396953339, - 318603240233076406 - ], - "y": [ - 11712108043964996282, - 3474989587891133574, - 3983451673298542860, - 1181581919257021598 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 8484642, - "lookup_selector_commitment": { - "x": [ - 27459247093738343, - 1785927757103538268, - 14972116880195568621, - 1034224917068963325 - ], - "y": [ - 17453858127001596558, - 6200103235089742197, - 16245568162666829501, - 651193715230511441 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 697552212563769686, - 7709943502535418760, - 15019345407325619175, - 3433081085078580257 - ], - "y": [ - 8668947019840357731, - 14698901351824712883, - 15088598879190660424, - 2873081208166433946 - ], - "infinity": false - }, - { - "x": [ - 7893133928909060673, - 7064922516930129957, - 3592836702741304814, - 2239702595710114437 - ], - "y": [ - 7691360541875191519, - 11379321785127235277, - 6653616064071569031, - 2555434628517540774 - ], - "infinity": false - }, - { - "x": [ - 6243944238013052821, - 7908243182210136125, - 17178099109525791299, - 2553622184721264566 - ], - "y": [ - 736121280088239428, - 6158073429758170526, - 11217302997977204117, - 2594798912020899417 - ], - "infinity": false - }, - { - "x": [ - 2064240298596094591, - 16917726764104887991, - 11042784977532408536, - 3377647228930170830 - ], - "y": [ - 10635525052494768819, - 387400048616497096, - 9379200582543310995, - 1571766153703296253 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 14868101692362122308, - 8135288013508071846, - 9460482611527381887, - 512823635961282598 - ], - "y": [ - 8358211286664762188, - 3532634521932288534, - 5862145521507736138, - 1807935137626658536 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_5_key.json b/core/bin/verification_key_generator_and_server/data/verification_5_key.json deleted file mode 100644 index b9a31b919f1c..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_5_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 12322129650547620518, - 4320033807979823995, - 4503809593276792861, - 630958448551597950 - ], - "y": [ - 4947307957322067889, - 1897773243457379956, - 1563584362302565484, - 802109862761172056 - ], - "infinity": false - }, - { - "x": [ - 5860641327684713918, - 16885915425353665713, - 7037370194263044401, - 1837438863045303696 - ], - "y": [ - 13386292219804271609, - 4960073609197619993, - 7328379249582994262, - 191728769121948464 - ], - "infinity": false - }, - { - "x": [ - 9390502900121613993, - 17218409610830310329, - 4830832371938391322, - 1805131323553685028 - ], - "y": [ - 15707040961083920686, - 16216062707384374953, - 16957058843586642758, - 1341814870249072628 - ], - "infinity": false - }, - { - "x": [ - 969252611989285232, - 181405773082212747, - 11110666465356509832, - 1888802363524687207 - ], - "y": [ - 5293477339288357424, - 12076391347720360980, - 11422893229655154394, - 3165450734777404812 - ], - "infinity": false - }, - { - "x": [ - 642192487369089358, - 9585449571929647331, - 3847960352134961209, - 984199510163128792 - ], - "y": [ - 13950390676065893881, - 975256099594703300, - 253120832016214204, - 1860679841584192219 - ], - "infinity": false - }, - { - "x": [ - 3564548447861991296, - 6278944799487206913, - 1163701992635366786, - 3214877162977671335 - ], - "y": [ - 13131873482361140204, - 14012120801722220187, - 13254371011592477950, - 1082108070640175604 - ], - "infinity": false - }, - { - "x": [ - 14190764189814537607, - 18412181832598818289, - 17213387738194113336, - 1662783623959823461 - ], - "y": [ - 7987199081435644988, - 17119136750046780209, - 8770669323846078492, - 3183489396270587333 - ], - "infinity": false - }, - { - "x": [ - 14638218826597535389, - 16409988612234258347, - 5025411344133541245, - 603088654230685360 - ], - "y": [ - 12538363432956258836, - 6558875956959901550, - 2415879426147965883, - 750702584304895055 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 2599908293582905760, - 13534206398743622493, - 15926090086034346074, - 467418127379229858 - ], - "y": [ - 9529512934078774185, - 1459270552041127965, - 13418846370362665102, - 2270996612016337371 - ], - "infinity": false - }, - { - "x": [ - 7264275706530137047, - 5590205367072257545, - 17891440127697345143, - 360638857846382524 - ], - "y": [ - 17983779934218975397, - 1625779403076670241, - 1474025795387210129, - 1716171421120825643 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 9354841115000244260, - 12887310615208346489, - 1120617137774653400, - 424227936372254439 - ], - "y": [ - 3626714025954019309, - 4480975902927818206, - 10093567956580931634, - 2779897825000836477 - ], - "infinity": false - }, - { - "x": [ - 1864884782104066211, - 1247154271168453374, - 9982166936353409582, - 1177339527115773898 - ], - "y": [ - 9932597332303163060, - 1888682277213109000, - 11684220277443154622, - 3062389133489783806 - ], - "infinity": false - }, - { - "x": [ - 9943021177878836437, - 9004866876172522532, - 14085451328492136137, - 1567186274425392936 - ], - "y": [ - 7148906168793986389, - 4780330524752436486, - 10067456648871712650, - 179752856567560382 - ], - "infinity": false - }, - { - "x": [ - 14745822832390509907, - 13862030626549782961, - 10000268356302875837, - 705042314567833799 - ], - "y": [ - 11091254259539384938, - 11733968109785394056, - 11099103738494585500, - 1527456782567955191 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 35330543, - "lookup_selector_commitment": { - "x": [ - 12333191731462980214, - 17841370099698959347, - 12878670991018181621, - 2894319630687016858 - ], - "y": [ - 76816727314643395, - 3214684791046221459, - 878301108738499830, - 126016925902987736 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 911668445361375614, - 12752365066512000136, - 11550232015863976467, - 2053619216798992367 - ], - "y": [ - 4194339833917391280, - 1643071887467668153, - 3377480965202592691, - 1664272901450533719 - ], - "infinity": false - }, - { - "x": [ - 2999316735203966181, - 5189676006781764591, - 14324679313847304783, - 1264086978509739587 - ], - "y": [ - 8714172036038650967, - 10907167170124829028, - 8950970593162102458, - 1596853051185997037 - ], - "infinity": false - }, - { - "x": [ - 1146500486770850326, - 13562754408872334896, - 14063471769392190265, - 3387351506820193517 - ], - "y": [ - 6677788829230735422, - 15425668102208730571, - 5341291772716012975, - 539156410041791428 - ], - "infinity": false - }, - { - "x": [ - 18159886519320172405, - 4286826840324377773, - 16364826089434525345, - 228697666397725767 - ], - "y": [ - 4850633487261444791, - 6327421534074497160, - 12883776034588695446, - 1510314148471267214 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 18245233954308230592, - 8193493714287610439, - 6521078295132558240, - 861511081336275611 - ], - "y": [ - 4275834222266292944, - 13179071278128968874, - 5943013356852335765, - 2456639561657053045 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_6_key.json b/core/bin/verification_key_generator_and_server/data/verification_6_key.json deleted file mode 100644 index 34419df17702..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_6_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 11033020679838791108, - 14920056278440370765, - 8156477685651219112, - 2935096142913695825 - ], - "y": [ - 12780055516709256833, - 966513406268819160, - 9584266886886532866, - 892347068344972829 - ], - "infinity": false - }, - { - "x": [ - 4044870432040348042, - 10630300946926732771, - 3143480015080245177, - 323917785885883620 - ], - "y": [ - 2297905282612888789, - 8206728682979815807, - 10628767928228215441, - 3062326525278498604 - ], - "infinity": false - }, - { - "x": [ - 14760731158538087565, - 9176522400170689419, - 9855180338242634009, - 2456568616568530201 - ], - "y": [ - 5168103953295979961, - 397013651969935557, - 13864468728668213717, - 2925074735515169158 - ], - "infinity": false - }, - { - "x": [ - 13613691592548742743, - 11339389230513898784, - 4864282628000142183, - 2568915564796772962 - ], - "y": [ - 13074021698952750513, - 14891339562597317806, - 6145754680491802845, - 913243322463864468 - ], - "infinity": false - }, - { - "x": [ - 9607983563343027008, - 1604609357347728263, - 6735137627175405143, - 91305611485454778 - ], - "y": [ - 2068449139446365265, - 6171753015906067998, - 16290186276604645197, - 420889087081901603 - ], - "infinity": false - }, - { - "x": [ - 15994614598808477960, - 5137738490508028659, - 6599503545391493738, - 3293094250487745346 - ], - "y": [ - 3246688300070721763, - 8836841286539929132, - 1231014124908407748, - 3042941126579517307 - ], - "infinity": false - }, - { - "x": [ - 12550390789117808745, - 14001030013656521177, - 16383284077678821701, - 1815317458772356897 - ], - "y": [ - 10125044837604978181, - 7468984969058409331, - 592554137766258541, - 2877688586321491725 - ], - "infinity": false - }, - { - "x": [ - 12238091769471133989, - 184716847866634800, - 5888077423956723698, - 609118759536864800 - ], - "y": [ - 7725369615076384544, - 7561073323636510559, - 10473734750023783127, - 861766554781597742 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 1206127807467530207, - 3510053718168412786, - 7933459343694333819, - 3179950874373950282 - ], - "y": [ - 5784856107466398982, - 395767970566909293, - 11244200096534021583, - 2068407511544404377 - ], - "infinity": false - }, - { - "x": [ - 4044617248058764838, - 11957266999135308674, - 17621747993137866783, - 990156155955733134 - ], - "y": [ - 17234504892477991728, - 17558826298225495489, - 9349531438753716103, - 2656409262947709594 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 4308597000331285311, - 12130199317436319902, - 3842336010209461436, - 191866453597778475 - ], - "y": [ - 2144400171783010971, - 13016087318985913183, - 7166370365336301922, - 2216888390030560212 - ], - "infinity": false - }, - { - "x": [ - 4661184458541745063, - 12423889401726065791, - 11959346001895915074, - 779668716585305501 - ], - "y": [ - 16401363790535442499, - 7367694133722005848, - 8015837005184593399, - 454166987511489961 - ], - "infinity": false - }, - { - "x": [ - 858215262803403659, - 1405268530667707386, - 7763962169005921611, - 2845435536097215865 - ], - "y": [ - 10639490331338262540, - 6397733211512468794, - 968161689973799899, - 2054756257253905633 - ], - "infinity": false - }, - { - "x": [ - 17338818659525246480, - 13318488425310212471, - 10548319374858973842, - 87084958643052105 - ], - "y": [ - 2279840344577984658, - 15197280761751903251, - 16019225334594459873, - 149925650787595538 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 3054916, - "lookup_selector_commitment": { - "x": [ - 4844230422625825285, - 956290027823441223, - 763010695794739308, - 2426170829255106638 - ], - "y": [ - 13850520521470006763, - 9003994589054655373, - 10310690204425503422, - 3012516431885755457 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 5825422128268478267, - 9219263846299851036, - 3879231702557190566, - 1702488722758880769 - ], - "y": [ - 18311881100262470992, - 5742998199368802392, - 18106865487471159417, - 502191980176920012 - ], - "infinity": false - }, - { - "x": [ - 17195892082859417081, - 7890531942603584793, - 2381805632820057528, - 3173232410464566465 - ], - "y": [ - 16359614627947132075, - 3459600273035137079, - 4550762061432972122, - 3394559699318358224 - ], - "infinity": false - }, - { - "x": [ - 1716103379277390185, - 18097936269579187542, - 16357329729761063450, - 1508640059338197502 - ], - "y": [ - 11014806739603983364, - 4396503314588777389, - 9397245609635151055, - 1703957955248411380 - ], - "infinity": false - }, - { - "x": [ - 4770171350693477354, - 17110558673192292253, - 9799800677557311408, - 761984875463445481 - ], - "y": [ - 1560561403388310063, - 31331275310848146, - 287152055803835484, - 457826332542037277 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 16775586915653722908, - 9787338077086882544, - 8381721730521821042, - 2974660093975661578 - ], - "y": [ - 3011389235487891234, - 15409507493813096391, - 17416460976276029026, - 324418288749844627 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_7_key.json b/core/bin/verification_key_generator_and_server/data/verification_7_key.json deleted file mode 100644 index 406afcf4f0fe..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_7_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 14104278525941001335, - 6652111379088654370, - 12369045377338511525, - 969809670184836151 - ], - "y": [ - 10111598525423302991, - 15018239425425696172, - 3683372413830991953, - 1023765059890131543 - ], - "infinity": false - }, - { - "x": [ - 11576486884237685781, - 16315823052257401029, - 9860864515877414033, - 3179959598270002012 - ], - "y": [ - 487035971539979311, - 5573003039451484772, - 15711637819381564577, - 1904127920269177012 - ], - "infinity": false - }, - { - "x": [ - 18299921128106602792, - 211731469708793711, - 17645028854462121436, - 675870769139913517 - ], - "y": [ - 15146647508675165454, - 18353083579110652488, - 12704645658780892142, - 2929235299763077823 - ], - "infinity": false - }, - { - "x": [ - 11570586127780196277, - 2363872676317471379, - 7386811009552915084, - 959006902628416514 - ], - "y": [ - 17455735716787098890, - 14879699386306994564, - 5628100821420984321, - 2862659911936763739 - ], - "infinity": false - }, - { - "x": [ - 8746328571248006135, - 17089435014355939378, - 8764506524471462449, - 1810135458362589443 - ], - "y": [ - 14070512019208911265, - 8756287737315170424, - 14821473955626613, - 1559545289765661890 - ], - "infinity": false - }, - { - "x": [ - 2113591086436573082, - 12629483649401688389, - 11845953673798951216, - 3081238281103628853 - ], - "y": [ - 727696133406005469, - 14413827745813557208, - 6425035421156126073, - 291513487083052109 - ], - "infinity": false - }, - { - "x": [ - 15346257923988607256, - 10403316660718504706, - 7158515894996917286, - 2702098910103276762 - ], - "y": [ - 16559143492878738107, - 12716298061927369795, - 12296985344891017351, - 2814996798832983835 - ], - "infinity": false - }, - { - "x": [ - 2213195001372039295, - 8878300942582564036, - 10524986226191936528, - 1815326540993196034 - ], - "y": [ - 11397120982692424098, - 4455537142488107627, - 14205354993332845055, - 2313809587433567240 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 14849046431510808003, - 11699893139960418168, - 6000246307731364190, - 3362832011707902866 - ], - "y": [ - 3242560497217933852, - 11672398501106836413, - 987926723326096281, - 2451226739475091625 - ], - "infinity": false - }, - { - "x": [ - 9272095445402359796, - 1201046264826394411, - 7424934554242366462, - 1125893484262333608 - ], - "y": [ - 15903920299684884420, - 17703294385387204708, - 2256937129195345942, - 1905295733884217610 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 7591926766688292250, - 10457199375342460747, - 3214976192729961314, - 1412860682249358355 - ], - "y": [ - 16894260140402496006, - 3666374878391815131, - 15124268261678582348, - 1340579262756129480 - ], - "infinity": false - }, - { - "x": [ - 2963934507934439034, - 17415763666461861018, - 6331792462137338053, - 3122358526111186727 - ], - "y": [ - 15040784043381591388, - 7188410244350767315, - 14077554108063383431, - 1704329843327300001 - ], - "infinity": false - }, - { - "x": [ - 7967507884960122293, - 13509230570773443525, - 11125712791473385552, - 2241808950326876268 - ], - "y": [ - 10594180941877323940, - 17179032413109513856, - 17941607623778808075, - 646138820984886096 - ], - "infinity": false - }, - { - "x": [ - 4729534828155895283, - 15489050734511381239, - 4847364931161261393, - 2461584260035042491 - ], - "y": [ - 15255817542606978857, - 6517429187947361297, - 17127878630247240853, - 3389541567226838859 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 40724289, - "lookup_selector_commitment": { - "x": [ - 5449769839889646584, - 2072406321611922291, - 9391796773218391195, - 2377769168011090955 - ], - "y": [ - 1789189431152658324, - 2639430755172378798, - 136577695530283091, - 3045539535973502646 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 12639039925867405095, - 9606685454938605275, - 7802675863289639223, - 1948831418843225802 - ], - "y": [ - 11059150608777595761, - 10458812733010634961, - 16772660325487078311, - 340608886692078192 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_8_key.json b/core/bin/verification_key_generator_and_server/data/verification_8_key.json deleted file mode 100644 index b8511e17b755..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_8_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 1834112096176967541, - 5137529514715617427, - 6540843391881340212, - 3033401888759110412 - ], - "y": [ - 8910602970094475216, - 13169513767982514776, - 5761530093694221441, - 2733318557350866268 - ], - "infinity": false - }, - { - "x": [ - 4701064149158432365, - 5425087325981406309, - 7911131985858828309, - 1683257627049186617 - ], - "y": [ - 13565328904521460918, - 17013189171844282257, - 4897087111183007258, - 2345861178674095559 - ], - "infinity": false - }, - { - "x": [ - 17285353863442654170, - 17787410547699779811, - 4803131526909484890, - 1607731426619418092 - ], - "y": [ - 3219378920021652314, - 11046862703797106703, - 10595836629242151972, - 2970963661532337787 - ], - "infinity": false - }, - { - "x": [ - 6619857367954187649, - 8023974497004524989, - 10088058961892288757, - 938018804109053807 - ], - "y": [ - 15549411064757453720, - 1776820811429478220, - 8222111141823917842, - 290593315633281086 - ], - "infinity": false - }, - { - "x": [ - 3338931670632164423, - 11330459786926502111, - 13560408114559586439, - 233279858410037466 - ], - "y": [ - 9757980615881472290, - 6475296714459436577, - 15954545788543926629, - 2522580407814024231 - ], - "infinity": false - }, - { - "x": [ - 2168501453409628158, - 16417992951888116942, - 1994813140597965849, - 1938552030580060698 - ], - "y": [ - 2393885012813093493, - 5109365147685051030, - 4449898145078443978, - 996506294158321126 - ], - "infinity": false - }, - { - "x": [ - 8163446935422765754, - 17127634458571165785, - 18101155318188210010, - 1502677094108070955 - ], - "y": [ - 4184320355428455210, - 15479528531137595907, - 8455846016430686855, - 2570922865513301289 - ], - "infinity": false - }, - { - "x": [ - 407579941387952352, - 17088458915370169940, - 16892753644011369852, - 2421666516533613805 - ], - "y": [ - 597435837737447683, - 18122233368438707442, - 4844832744563923839, - 396103093107107006 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 16242434178832819081, - 2218928756172422054, - 5871927983870638422, - 810020555846721779 - ], - "y": [ - 9387856576677982883, - 5119490172321159350, - 14295435318421985120, - 1325809191818871673 - ], - "infinity": false - }, - { - "x": [ - 5933965238687071287, - 10681704800081225943, - 14555731010498897395, - 959799154476325145 - ], - "y": [ - 1501632601560034962, - 9401704677918783964, - 12292111854761501889, - 858616662661742045 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 12841507457971520539, - 6525486152471484441, - 3744486588589217686, - 2769451038405535407 - ], - "y": [ - 14145668232228974364, - 9864097401535863500, - 12665512227995054273, - 1710776254334161256 - ], - "infinity": false - }, - { - "x": [ - 12108157388466567796, - 12008825937320240484, - 11228446795405478904, - 1520424921904150640 - ], - "y": [ - 18157047055378899649, - 10836823561088895074, - 583613418617515639, - 2570085764232471205 - ], - "infinity": false - }, - { - "x": [ - 3117226099128838157, - 10181632193024509490, - 1215328570209780930, - 1536961491401844084 - ], - "y": [ - 11646905141441654681, - 6168936708987385450, - 14459621573162108487, - 2047975568887748173 - ], - "infinity": false - }, - { - "x": [ - 12034664246790330785, - 12032082546920592595, - 12002839514296456095, - 3009479689157977152 - ], - "y": [ - 180421277197569955, - 5815678523367268562, - 11718416396488597085, - 408186057258055191 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 34384753, - "lookup_selector_commitment": { - "x": [ - 3872970821419373956, - 13556503327407661223, - 12832313376327677595, - 211677646774476601 - ], - "y": [ - 17281673428499585093, - 235933066531227024, - 17890327653152417391, - 2551853991532334733 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 14943975734974680929, - 9516136771242606543, - 6695719565456036638, - 3449077049666620393 - ], - "y": [ - 11678209093898264827, - 4499447145490933412, - 6317798459829178953, - 1439219764789809864 - ], - "infinity": false - }, - { - "x": [ - 13501290183905491407, - 17914451638435951710, - 5188762915201956497, - 1220375585898114161 - ], - "y": [ - 14519533874806433487, - 409100046306023, - 2203176115240501563, - 3105700623762337563 - ], - "infinity": false - }, - { - "x": [ - 13968159480895722732, - 6973568812120893251, - 6250254745096478587, - 2299355969860561070 - ], - "y": [ - 7695944005480078577, - 12009671787784557856, - 13727042561077817002, - 219052945806305675 - ], - "infinity": false - }, - { - "x": [ - 4871629130106420314, - 4091595855728790015, - 1851744390500340594, - 3123168382710331270 - ], - "y": [ - 9703969956757970162, - 1215036492891076659, - 11876727836856213678, - 2640893636590396388 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 10299044894603982393, - 4664166516779563250, - 13124827128688646542, - 3361599897730972314 - ], - "y": [ - 18259946931458798404, - 10145479316480429602, - 15446978899103328376, - 265382288883021070 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_9_key.json b/core/bin/verification_key_generator_and_server/data/verification_9_key.json deleted file mode 100644 index 75de5f75c78d..000000000000 --- a/core/bin/verification_key_generator_and_server/data/verification_9_key.json +++ /dev/null @@ -1,399 +0,0 @@ -{ - "n": 67108863, - "num_inputs": 1, - "state_width": 4, - "num_witness_polys": 0, - "gate_setup_commitments": [ - { - "x": [ - 15041888416700822899, - 15908701850433687369, - 6928173929840686173, - 501601364708497325 - ], - "y": [ - 9443860646360881208, - 15174745959183347299, - 3341918218952258763, - 1470216750942469587 - ], - "infinity": false - }, - { - "x": [ - 1713492202424532619, - 5921868784153327820, - 3919870428680620477, - 2459274846398943915 - ], - "y": [ - 8012717129874416534, - 13032363221581987781, - 9462161206147300944, - 1151760065513271967 - ], - "infinity": false - }, - { - "x": [ - 6636128327108235840, - 9362733145474272574, - 7779132015244601843, - 474802631021936400 - ], - "y": [ - 3900992471196218787, - 113851245079995197, - 7493904056590361535, - 3140468871801097229 - ], - "infinity": false - }, - { - "x": [ - 4340102674797800902, - 8715432707094353745, - 4331145745081713603, - 45456583984841487 - ], - "y": [ - 18326546742044058782, - 15443239165658185296, - 9765917874876721196, - 687859761729374839 - ], - "infinity": false - }, - { - "x": [ - 10804694580890857975, - 10550068287306981825, - 14956274043654722561, - 3060589920124935341 - ], - "y": [ - 17010223672048359580, - 263749806111642373, - 8349695975133446526, - 2826070525773268002 - ], - "infinity": false - }, - { - "x": [ - 16133249269780245267, - 4275571784340824698, - 6262619645627758753, - 3231281899173719188 - ], - "y": [ - 11839616617849449709, - 7142633755989890055, - 10840735473548209733, - 2847350786075278882 - ], - "infinity": false - }, - { - "x": [ - 16258572583186965203, - 1354691125575792689, - 17235265854934968790, - 1252220109588505888 - ], - "y": [ - 9336541637487074271, - 18402912967310224930, - 13223187653117829136, - 2979297976786733465 - ], - "infinity": false - }, - { - "x": [ - 8525686695522099028, - 4103157564078645049, - 18392570749492199187, - 2911539491816599180 - ], - "y": [ - 114653447583918953, - 10470307038453386601, - 11189850644566793538, - 1298227034210846592 - ], - "infinity": false - } - ], - "gate_selectors_commitments": [ - { - "x": [ - 2069700145549311928, - 4250782333685017927, - 14207216715687122978, - 1145927286048477791 - ], - "y": [ - 9341202692364554712, - 12346939747104737180, - 2826478533799125818, - 2279570556437452275 - ], - "infinity": false - }, - { - "x": [ - 12388902775325386546, - 1277383964095999647, - 10535796018183893831, - 3359866702323175506 - ], - "y": [ - 16500893366957272235, - 2806147688388338314, - 8233156072220488773, - 2867848844627212711 - ], - "infinity": false - } - ], - "permutation_commitments": [ - { - "x": [ - 17521183961631816299, - 18327810537117645266, - 16586212795163003556, - 3052771534158410452 - ], - "y": [ - 8441310283734453731, - 14146088755801181801, - 17480253356603213989, - 3217948944323396651 - ], - "infinity": false - }, - { - "x": [ - 16076801532842923524, - 7514743296775639295, - 2571323986448120255, - 184367540214459973 - ], - "y": [ - 13389643967183613114, - 17108261756464256828, - 11145735340309739417, - 2142196980030893874 - ], - "infinity": false - }, - { - "x": [ - 8034683328666433725, - 5436036566901194392, - 18053257213361014053, - 2821377847227509494 - ], - "y": [ - 14471305228212723444, - 8894846184648865892, - 7047725473055235530, - 2413388400332075493 - ], - "infinity": false - }, - { - "x": [ - 14026981588443304814, - 14671946927765496183, - 13387079215022495926, - 2554705188091675830 - ], - "y": [ - 440116222237740520, - 1630168477189852269, - 17833425794232523381, - 908824471705597078 - ], - "infinity": false - } - ], - "total_lookup_entries_length": 41494904, - "lookup_selector_commitment": { - "x": [ - 13889323383351416990, - 17887386740570674124, - 5463612855590268091, - 2434255340534820869 - ], - "y": [ - 2436699678434218349, - 11251365794004058995, - 11023509005141034197, - 2867854671852170604 - ], - "infinity": false - }, - "lookup_tables_commitments": [ - { - "x": [ - 631990924006796604, - 16139625628991115157, - 13331739325995827711, - 1062301837743594995 - ], - "y": [ - 15303054606290800139, - 15906872095881647437, - 7093896572295020249, - 1342952934989901142 - ], - "infinity": false - }, - { - "x": [ - 7983921919542246393, - 13296544189644416678, - 17081022784392007697, - 1980832835348244027 - ], - "y": [ - 10874958134865200330, - 7702740658637630534, - 14052057929798961943, - 3193353539419869016 - ], - "infinity": false - }, - { - "x": [ - 1114587284824996932, - 4636906500482867924, - 15328247172597030456, - 87946895873973686 - ], - "y": [ - 15573033830207915877, - 5194694185599035278, - 2562407345425607214, - 2782078999306862675 - ], - "infinity": false - }, - { - "x": [ - 18225112781127431982, - 18048613958187123807, - 7325490730844456621, - 1953409020724855888 - ], - "y": [ - 7577000130125917198, - 6193701449695751861, - 4102082927677054717, - 395350071385269650 - ], - "infinity": false - } - ], - "lookup_table_type_commitment": { - "x": [ - 3832160677272803715, - 2122279734318217808, - 811690144328522684, - 1416829483108546006 - ], - "y": [ - 10041279311991435550, - 14702496983143623186, - 4419862575487552747, - 1429817244630465543 - ], - "infinity": false - }, - "non_residues": [ - [ - 5, - 0, - 0, - 0 - ], - [ - 7, - 0, - 0, - 0 - ], - [ - 10, - 0, - 0, - 0 - ] - ], - "g2_elements": [ - { - "x": { - "c0": [ - 5106727233969649389, - 7440829307424791261, - 4785637993704342649, - 1729627375292849782 - ], - "c1": [ - 10945020018377822914, - 17413811393473931026, - 8241798111626485029, - 1841571559660931130 - ] - }, - "y": { - "c0": [ - 5541340697920699818, - 16416156555105522555, - 5380518976772849807, - 1353435754470862315 - ], - "c1": [ - 6173549831154472795, - 13567992399387660019, - 17050234209342075797, - 650358724130500725 - ] - }, - "infinity": false - }, - { - "x": { - "c0": [ - 9089143573911733168, - 11482283522806384523, - 13585589533905622862, - 79029415676722370 - ], - "c1": [ - 5692040832573735873, - 16884514497384809355, - 16717166481813659368, - 2742131088506155463 - ] - }, - "y": { - "c0": [ - 9604638503594647125, - 1289961608472612514, - 6217038149984805214, - 2521661352385209130 - ], - "c1": [ - 17168069778630926308, - 11309277837895768996, - 15154989611154567813, - 359271377050603491 - ] - }, - "infinity": false - } - ] -} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/src/commitment_generator.rs b/core/bin/verification_key_generator_and_server/src/commitment_generator.rs deleted file mode 100644 index ed859bcb4366..000000000000 --- a/core/bin/verification_key_generator_and_server/src/commitment_generator.rs +++ /dev/null @@ -1,37 +0,0 @@ -use anyhow::Context as _; -use zksync_prover_utils::vk_commitment_helper::{ - get_toml_formatted_value, read_contract_toml, write_contract_toml, -}; -use zksync_verification_key_server::generate_commitments; - -fn main() -> anyhow::Result<()> { - tracing::info!("Starting commitment generation!"); - read_and_update_contract_toml() -} - -fn read_and_update_contract_toml() -> anyhow::Result<()> { - let mut contract_doc = read_contract_toml().context("read_contract_toml()")?; - let ( - basic_circuit_commitment_hex, - leaf_aggregation_commitment_hex, - node_aggregation_commitment_hex, - ) = generate_commitments(); - contract_doc["contracts"]["RECURSION_CIRCUITS_SET_VKS_HASH"] = - get_toml_formatted_value(basic_circuit_commitment_hex); - contract_doc["contracts"]["RECURSION_LEAF_LEVEL_VK_HASH"] = - get_toml_formatted_value(leaf_aggregation_commitment_hex); - contract_doc["contracts"]["RECURSION_NODE_LEVEL_VK_HASH"] = - get_toml_formatted_value(node_aggregation_commitment_hex); - tracing::info!("Updated toml content: {:?}", contract_doc.to_string()); - write_contract_toml(contract_doc).context("write_contract_toml") -} - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn test_read_and_update_contract_toml() { - read_and_update_contract_toml().unwrap(); - } -} diff --git a/core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs b/core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs deleted file mode 100644 index c04a67128334..000000000000 --- a/core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::{fs::File, io::BufWriter}; - -use bincode::serialize_into; -use structopt::StructOpt; -use zksync_verification_key_server::get_vk_for_circuit_type; - -#[derive(Debug, StructOpt)] -#[structopt( - name = "json existing json VK's to binary vk", - about = "converter tool" -)] -struct Opt { - /// Binary output path of verification keys. - #[structopt(short)] - output_bin_path: String, -} - -fn main() { - let opt = Opt::from_args(); - println!("Converting existing json keys to binary"); - generate_bin_vks(opt.output_bin_path); -} - -fn generate_bin_vks(output_path: String) { - for circuit_type in 1..=18 { - let filename = format!("{}/verification_{}.key", output_path, circuit_type); - let vk = get_vk_for_circuit_type(circuit_type); - let mut f = BufWriter::new(File::create(filename).unwrap()); - serialize_into(&mut f, &vk).unwrap(); - } -} diff --git a/core/bin/verification_key_generator_and_server/src/lib.rs b/core/bin/verification_key_generator_and_server/src/lib.rs deleted file mode 100644 index 20260a30b20b..000000000000 --- a/core/bin/verification_key_generator_and_server/src/lib.rs +++ /dev/null @@ -1,188 +0,0 @@ -use std::{collections::HashMap, path::Path, str::FromStr}; - -use ff::to_hex; -use itertools::Itertools; -use once_cell::sync::Lazy; -use structopt::lazy_static::lazy_static; -use zksync_types::{ - circuit::{ - GEOMETRY_CONFIG, LEAF_CIRCUIT_INDEX, LEAF_SPLITTING_FACTOR, NODE_CIRCUIT_INDEX, - NODE_SPLITTING_FACTOR, SCHEDULER_CIRCUIT_INDEX, SCHEDULER_UPPER_BOUND, - }, - protocol_version::{L1VerifierConfig, VerifierParams}, - vk_transform::generate_vk_commitment, - zkevm_test_harness::{ - abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, - bellman::{bn256::Bn256, plonk::better_better_cs::setup::VerificationKey}, - witness, - witness::{ - full_block_artifact::BlockBasicCircuits, - oracle::VmWitnessOracle, - recursive_aggregation::{erase_vk_type, padding_aggregations}, - vk_set_generator::circuits_for_vk_generation, - }, - }, - H256, -}; - -#[cfg(test)] -mod tests; - -lazy_static! { - static ref COMMITMENTS: Lazy = Lazy::new(|| { circuit_commitments() }); -} - -pub fn get_vks_for_basic_circuits( -) -> HashMap>>> { - // 3-17 are the ids of basic circuits - (3..=18) - .map(|circuit_type| (circuit_type, get_vk_for_circuit_type(circuit_type))) - .collect() -} - -pub fn get_vk_for_circuit_type( - circuit_type: u8, -) -> VerificationKey>> { - let filepath = get_file_path(circuit_type); - tracing::info!("Fetching verification key from path: {}", filepath); - let text = std::fs::read_to_string(&filepath) - .unwrap_or_else(|_| panic!("Failed reading verification key from path: {}", filepath)); - serde_json::from_str::>>>( - &text, - ) - .unwrap_or_else(|_| { - panic!( - "Failed deserializing verification key from path: {}", - filepath - ) - }) -} - -pub fn save_vk_for_circuit_type( - circuit_type: u8, - vk: VerificationKey>>, -) { - let filepath = get_file_path(circuit_type); - tracing::info!("saving verification key to: {}", filepath); - std::fs::write(filepath, serde_json::to_string_pretty(&vk).unwrap()).unwrap(); -} - -pub fn get_ordered_vks_for_basic_circuits( - circuits: &BlockBasicCircuits, - verification_keys: &HashMap< - u8, - VerificationKey>>, - >, -) -> Vec>>> { - circuits - .clone() - .into_flattened_set() - .iter() - .map(|circuit| { - let circuit_id = circuit.numeric_circuit_type(); - verification_keys - .get(&circuit_id) - .unwrap_or_else(|| { - panic!("no VK for circuit number {:?}", circuit.short_description()) - }) - .clone() - }) - .collect() -} - -pub fn get_vks_for_commitment( - verification_keys: HashMap< - u8, - VerificationKey>>, - >, -) -> Vec>>> { - // We need all the vks sorted by their respective circuit ids - verification_keys - .into_iter() - .sorted_by_key(|(id, _)| *id) - .map(|(_, val)| val) - .collect() -} - -pub fn get_circuits_for_vk() -> Vec>> { - ensure_setup_key_exist(); - let padding_aggregations = padding_aggregations(NODE_SPLITTING_FACTOR); - circuits_for_vk_generation( - GEOMETRY_CONFIG, - LEAF_SPLITTING_FACTOR, - NODE_SPLITTING_FACTOR, - SCHEDULER_UPPER_BOUND, - padding_aggregations, - ) -} - -fn ensure_setup_key_exist() { - if !Path::new("setup_2^26.key").exists() { - panic!("File setup_2^26.key is required to be present in current directory for verification keys generation. \ndownload from https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2^26.key"); - } -} -fn get_file_path(circuit_type: u8) -> String { - let zksync_home = std::env::var("ZKSYNC_HOME").unwrap_or_else(|_| "/".into()); - format!( - "{}/core/bin/verification_key_generator_and_server/data/verification_{}_key.json", - zksync_home, circuit_type - ) -} - -pub fn generate_commitments() -> (String, String, String) { - let (_, basic_circuit_commitment, _) = - witness::recursive_aggregation::form_base_circuits_committment(get_vks_for_commitment( - get_vks_for_basic_circuits(), - )); - - let leaf_aggregation_vk = get_vk_for_circuit_type(LEAF_CIRCUIT_INDEX); - let node_aggregation_vk = get_vk_for_circuit_type(NODE_CIRCUIT_INDEX); - - let (_, leaf_aggregation_vk_commitment) = - witness::recursive_aggregation::compute_vk_encoding_and_committment(erase_vk_type( - leaf_aggregation_vk, - )); - - let (_, node_aggregation_vk_commitment) = - witness::recursive_aggregation::compute_vk_encoding_and_committment(erase_vk_type( - node_aggregation_vk, - )); - let basic_circuit_commitment_hex = format!("0x{}", to_hex(&basic_circuit_commitment)); - let leaf_aggregation_commitment_hex = format!("0x{}", to_hex(&leaf_aggregation_vk_commitment)); - let node_aggregation_commitment_hex = format!("0x{}", to_hex(&node_aggregation_vk_commitment)); - tracing::info!( - "basic circuit commitment {:?}", - basic_circuit_commitment_hex - ); - tracing::info!( - "leaf aggregation commitment {:?}", - leaf_aggregation_commitment_hex - ); - tracing::info!( - "node aggregation commitment {:?}", - node_aggregation_commitment_hex - ); - ( - basic_circuit_commitment_hex, - leaf_aggregation_commitment_hex, - node_aggregation_commitment_hex, - ) -} - -fn circuit_commitments() -> L1VerifierConfig { - let (basic, leaf, node) = generate_commitments(); - let scheduler = generate_vk_commitment(get_vk_for_circuit_type(SCHEDULER_CIRCUIT_INDEX)); - L1VerifierConfig { - params: VerifierParams { - recursion_node_level_vk_hash: H256::from_str(&node).expect("invalid node commitment"), - recursion_leaf_level_vk_hash: H256::from_str(&leaf).expect("invalid leaf commitment"), - recursion_circuits_set_vks_hash: H256::from_str(&basic) - .expect("invalid basic commitment"), - }, - recursion_scheduler_level_vk_hash: scheduler, - } -} - -pub fn get_cached_commitments() -> L1VerifierConfig { - **COMMITMENTS -} diff --git a/core/bin/verification_key_generator_and_server/src/main.rs b/core/bin/verification_key_generator_and_server/src/main.rs deleted file mode 100644 index b64e5757fceb..000000000000 --- a/core/bin/verification_key_generator_and_server/src/main.rs +++ /dev/null @@ -1,48 +0,0 @@ -use std::{collections::HashSet, env}; - -use zksync_types::zkevm_test_harness::{ - abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, - bellman::{ - bn256::Bn256, plonk::better_better_cs::cs::PlonkCsWidth4WithNextStepAndCustomGatesParams, - }, - witness::oracle::VmWitnessOracle, -}; -use zksync_verification_key_server::{get_circuits_for_vk, save_vk_for_circuit_type}; - -/// Creates verification keys for the given circuit. -fn main() { - let args: Vec = env::args().collect(); - - let circuit_types: HashSet = if args.len() > 1 { - [get_and_ensure_valid_circuit_type(args[1].clone())].into() - } else { - (3..17).collect() - }; - tracing::info!("Starting verification key generation!"); - get_circuits_for_vk() - .into_iter() - .filter(|c| circuit_types.contains(&c.numeric_circuit_type())) - .for_each(generate_verification_key); -} - -fn get_and_ensure_valid_circuit_type(circuit_type: String) -> u8 { - tracing::info!("Received circuit_type: {:?}", circuit_type); - circuit_type - .parse::() - .expect("Please specify a circuit type in range [1, 17]") -} - -fn generate_verification_key(circuit: ZkSyncCircuit>) { - let res = circuit_testing::create_vk_for_padding_size_log_2::< - Bn256, - _, - PlonkCsWidth4WithNextStepAndCustomGatesParams, - >(circuit.clone(), 26) - .unwrap(); - save_vk_for_circuit_type(circuit.numeric_circuit_type(), res); - tracing::info!( - "Finished VK generation for circuit {:?} (id {:?})", - circuit.short_description(), - circuit.numeric_circuit_type() - ); -} diff --git a/core/bin/verification_key_generator_and_server/src/tests.rs b/core/bin/verification_key_generator_and_server/src/tests.rs deleted file mode 100644 index f0fea866de6d..000000000000 --- a/core/bin/verification_key_generator_and_server/src/tests.rs +++ /dev/null @@ -1,68 +0,0 @@ -use std::collections::HashMap; - -use itertools::Itertools; -use serde_json::Value; -use zksync_types::zkevm_test_harness::{ - abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, - bellman::{bn256::Bn256, plonk::better_better_cs::setup::VerificationKey}, - witness::oracle::VmWitnessOracle, -}; - -use crate::{get_vk_for_circuit_type, get_vks_for_basic_circuits, get_vks_for_commitment}; - -#[test] -fn test_get_vk_for_circuit_type() { - for circuit_type in 1..=18 { - get_vk_for_circuit_type(circuit_type); - } -} - -#[test] -fn test_get_vks_for_basic_circuits() { - let circuit_type_to_vk = get_vks_for_basic_circuits(); - let circuit_types: Vec = circuit_type_to_vk.into_keys().sorted().collect::>(); - let expected: Vec = (3..=18).collect(); - assert_eq!( - expected, circuit_types, - "circuit types must be in the range [3, 17]" - ); -} - -#[test] -fn test_get_vks_for_commitment() { - let vk_5 = get_vk_for_circuit_type(5); - let vk_2 = get_vk_for_circuit_type(2); - let vk_3 = get_vk_for_circuit_type(3); - let map = HashMap::from([ - (5u8, vk_5.clone()), - (2u8, vk_2.clone()), - (3u8, vk_3.clone()), - ]); - let vks = get_vks_for_commitment(map); - let expected = vec![vk_2, vk_3, vk_5]; - compare_vks( - expected, - vks, - "expected verification key to be in order 2, 3, 5", - ); -} - -fn get_vk_json(vk: &VerificationKey>>) -> Value { - serde_json::to_value(vk).unwrap() -} - -fn get_vk_jsons( - vks: Vec>>>, -) -> Vec { - vks.into_iter().map(|vk| get_vk_json(&vk)).collect() -} - -fn compare_vks( - first: Vec>>>, - second: Vec>>>, - error_message: &str, -) { - let first_json = get_vk_jsons(first); - let second_json = get_vk_jsons(second); - assert_eq!(first_json, second_json, "{:?}", error_message); -} diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index 4582e1f3b285..e60fa7d21b69 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -14,6 +14,8 @@ zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-z zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.3-rc2" } zk_evm_1_3_1 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.1-rc2" } +zkevm_test_harness_1_4_0 = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0", package = "zkevm_test_harness" } + zksync_types = { path = "../types" } zksync_state = { path = "../state" } zksync_contracts = { path = "../contracts" } diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs index 9680543a17be..86e3fc46eff0 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs @@ -73,7 +73,7 @@ impl Vm { .unwrap_or_default(); // Ceil and convert to usize. - let estimated_circuits_used = (tx_tracer.estimated_circuits_used.clone() + let estimated_circuits_used = (tx_tracer.circuits_tracer.estimated_circuits_used.clone() + BigDecimal::from(1u8) / BigDecimal::from(2u8)) .round(0) .to_usize() diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs new file mode 100644 index 000000000000..676cd2fb1b5a --- /dev/null +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -0,0 +1,102 @@ +use bigdecimal::BigDecimal; +use once_cell::sync::Lazy; +use zkevm_test_harness_1_4_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; + +const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const OVERESTIMATE_PERCENT: u32 = 5; + +fn calculate_fraction(cycles_per_circuit: u32) -> BigDecimal { + (BigDecimal::from(1) / BigDecimal::from(cycles_per_circuit) + * (BigDecimal::from(1) + BigDecimal::from(OVERESTIMATE_PERCENT) / BigDecimal::from(100))) + .with_prec(8) +} + +static MAIN_VM_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_vm_snapshot)); + +static CODE_DECOMMITTER_SORTER_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_code_decommitter_sorter)); + +static LOG_DEMUXER_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_log_demuxer)); + +static STORAGE_SORTER_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_storage_sorter)); + +static EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter)); + +static RAM_PERMUTATION_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_ram_permutation)); + +pub(crate) static CODE_DECOMMITTER_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_code_decommitter)); + +static STORAGE_APPLICATION_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_storage_application)); + +pub(crate) static KECCAK256_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_keccak256_circuit)); + +pub(crate) static SHA256_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_sha256_circuit)); + +pub(crate) static ECRECOVER_CYCLE_FRACTION: Lazy = + Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_ecrecover_circuit)); + +pub(crate) static RICH_ADDRESSING_OPCODE_FRACTION: Lazy = Lazy::new(|| { + MAIN_VM_CYCLE_FRACTION.clone() + BigDecimal::from(3) * RAM_PERMUTATION_CYCLE_FRACTION.clone() +}); + +pub(crate) static AVERAGE_OPCODE_FRACTION: Lazy = + Lazy::new(|| MAIN_VM_CYCLE_FRACTION.clone() + RAM_PERMUTATION_CYCLE_FRACTION.clone()); + +pub(crate) static STORAGE_READ_FRACTION: Lazy = Lazy::new(|| { + MAIN_VM_CYCLE_FRACTION.clone() + + RAM_PERMUTATION_CYCLE_FRACTION.clone() + + LOG_DEMUXER_CYCLE_FRACTION.clone() + + STORAGE_SORTER_CYCLE_FRACTION.clone() + + STORAGE_APPLICATION_CYCLE_FRACTION.clone() +}); + +pub(crate) static EVENT_OR_L1_MESSAGE_FRACTION: Lazy = Lazy::new(|| { + BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() + + RAM_PERMUTATION_CYCLE_FRACTION.clone() + + BigDecimal::from(2) * LOG_DEMUXER_CYCLE_FRACTION.clone() + + BigDecimal::from(2) * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION.clone() +}); + +pub(crate) static HOT_STORAGE_WRITE_FRACTION: Lazy = Lazy::new(|| { + BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() + + RAM_PERMUTATION_CYCLE_FRACTION.clone() + + BigDecimal::from(2) * LOG_DEMUXER_CYCLE_FRACTION.clone() + + BigDecimal::from(2) * STORAGE_SORTER_CYCLE_FRACTION.clone() +}); + +pub(crate) static COLD_STORAGE_WRITE_FRACTION: Lazy = Lazy::new(|| { + HOT_STORAGE_WRITE_FRACTION.clone() + + BigDecimal::from(2) * STORAGE_APPLICATION_CYCLE_FRACTION.clone() +}); + +pub(crate) static FAR_CALL_FRACTION: Lazy = Lazy::new(|| { + BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() + + RAM_PERMUTATION_CYCLE_FRACTION.clone() + + STORAGE_SORTER_CYCLE_FRACTION.clone() + + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION.clone() +}); + +pub(crate) static UMA_WRITE_FRACTION: Lazy = Lazy::new(|| { + BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() + + BigDecimal::from(5) * RAM_PERMUTATION_CYCLE_FRACTION.clone() +}); + +pub(crate) static UMA_READ_FRACTION: Lazy = Lazy::new(|| { + BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() + + BigDecimal::from(3) * RAM_PERMUTATION_CYCLE_FRACTION.clone() +}); + +pub(crate) static PRECOMPILE_CALL_COMMON_FRACTION: Lazy = Lazy::new(|| { + MAIN_VM_CYCLE_FRACTION.clone() + + RAM_PERMUTATION_CYCLE_FRACTION.clone() + + LOG_DEMUXER_CYCLE_FRACTION.clone() +}); diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs new file mode 100644 index 000000000000..70cc728b16f8 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -0,0 +1,160 @@ +use bigdecimal::{BigDecimal, Zero}; +use std::marker::PhantomData; +use zk_evm_1_4_0::zkevm_opcode_defs::{LogOpcode, Opcode, UMAOpcode}; + +use zk_evm_1_4_0::tracing::{BeforeExecutionData, VmLocalStateData}; +use zksync_state::{StoragePtr, WriteStorage}; +use zksync_system_constants::{ + ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS, +}; +use zksync_types::{AccountTreeId, StorageKey}; +use zksync_utils::u256_to_h256; + +use super::circuits_capacity::*; +use crate::{ + interface::{dyn_tracers::vm_1_4_0::DynTracer, tracer::TracerExecutionStatus}, + vm_latest::{ + bootloader_state::BootloaderState, + old_vm::{history_recorder::HistoryMode, memory::SimpleMemory}, + tracers::traits::VmTracer, + types::internals::ZkSyncVmState, + }, +}; + +/// Tracer responsible for collecting information about refunds. +#[derive(Debug)] +pub(crate) struct CircuitsTracer { + pub(crate) estimated_circuits_used: BigDecimal, + last_decommitment_history_entry_checked: Option, + _phantom_data: PhantomData, +} + +impl CircuitsTracer { + pub(crate) fn new() -> Self { + Self { + estimated_circuits_used: BigDecimal::zero(), + last_decommitment_history_entry_checked: None, + _phantom_data: Default::default(), + } + } +} + +impl DynTracer> for CircuitsTracer { + fn before_execution( + &mut self, + state: VmLocalStateData<'_>, + data: BeforeExecutionData, + _memory: &SimpleMemory, + storage: StoragePtr, + ) { + let used = match data.opcode.variant.opcode { + Opcode::Nop(_) + | Opcode::Add(_) + | Opcode::Sub(_) + | Opcode::Mul(_) + | Opcode::Div(_) + | Opcode::Jump(_) + | Opcode::Binop(_) + | Opcode::Shift(_) + | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION.clone(), + Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => { + AVERAGE_OPCODE_FRACTION.clone() + } + Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION.clone(), + Opcode::Log(LogOpcode::StorageWrite) => { + let storage_key = StorageKey::new( + AccountTreeId::new(state.vm_local_state.callstack.current.this_address), + u256_to_h256(data.src0_value.value), + ); + + let first_write = !storage + .borrow() + .modified_storage_keys() + .contains_key(&storage_key); + if first_write { + COLD_STORAGE_WRITE_FRACTION.clone() + } else { + HOT_STORAGE_WRITE_FRACTION.clone() + } + } + Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { + EVENT_OR_L1_MESSAGE_FRACTION.clone() + } + Opcode::Log(LogOpcode::PrecompileCall) => { + match state.vm_local_state.callstack.current.this_address { + a if a == KECCAK256_PRECOMPILE_ADDRESS => { + let precompile_interpreted = data.src0_value.value.0[3]; + PRECOMPILE_CALL_COMMON_FRACTION.clone() + + BigDecimal::from(precompile_interpreted) + * KECCAK256_CYCLE_FRACTION.clone() + } + a if a == SHA256_PRECOMPILE_ADDRESS => { + let precompile_interpreted = data.src0_value.value.0[3]; + PRECOMPILE_CALL_COMMON_FRACTION.clone() + + BigDecimal::from(precompile_interpreted) + * SHA256_CYCLE_FRACTION.clone() + } + a if a == ECRECOVER_PRECOMPILE_ADDRESS => { + PRECOMPILE_CALL_COMMON_FRACTION.clone() + ECRECOVER_CYCLE_FRACTION.clone() + } + _ => PRECOMPILE_CALL_COMMON_FRACTION.clone(), + } + } + Opcode::FarCall(_) => FAR_CALL_FRACTION.clone(), + Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => { + UMA_WRITE_FRACTION.clone() + } + Opcode::UMA( + UMAOpcode::AuxHeapRead | UMAOpcode::HeapRead | UMAOpcode::FatPointerRead, + ) => UMA_READ_FRACTION.clone(), + Opcode::Invalid(_) => unreachable!(), // invalid opcodes are never executed + }; + + self.estimated_circuits_used += used; + } +} + +impl VmTracer for CircuitsTracer { + fn initialize_tracer(&mut self, state: &mut ZkSyncVmState) { + self.last_decommitment_history_entry_checked = Some( + state + .decommittment_processor + .decommitted_code_hashes + .history() + .len(), + ); + } + + fn finish_cycle( + &mut self, + state: &mut ZkSyncVmState, + _bootloader_state: &mut BootloaderState, + ) -> TracerExecutionStatus { + let last_decommitment_history_entry_checked = self + .last_decommitment_history_entry_checked + .expect("Value must be set during init"); + let history = state + .decommittment_processor + .decommitted_code_hashes + .history(); + for (_, history_event) in &history[last_decommitment_history_entry_checked..] { + // We assume that only insertions may happen during a single VM inspection. + assert!(history_event.value.is_some()); + let bytecode_len = state + .decommittment_processor + .known_bytecodes + .inner() + .get(&history_event.key) + .expect("Bytecode must be known at this point") + .len(); + + // Each cycle of `CodeDecommitter` processes 64 bits. + let decommitter_cycles_used = bytecode_len / 4; + self.estimated_circuits_used += BigDecimal::from(decommitter_cycles_used as u64) + * CODE_DECOMMITTER_CYCLE_FRACTION.clone(); + } + self.last_decommitment_history_entry_checked = Some(history.len()); + + TracerExecutionStatus::Continue + } +} diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs index 0bde3f576496..b4f534f4fe9d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs @@ -3,24 +3,18 @@ use std::{ marker::PhantomData, }; -use bigdecimal::{BigDecimal, Zero}; use zk_evm_1_4_0::{ tracing::{ AfterDecodingData, AfterExecutionData, BeforeExecutionData, Tracer, VmLocalStateData, }, vm_state::VmLocalState, witness_trace::DummyTracer, - zkevm_opcode_defs::{decoding::EncodingModeProduction, LogOpcode, Opcode, RetOpcode}, + zkevm_opcode_defs::{decoding::EncodingModeProduction, Opcode, RetOpcode}, }; use zksync_state::{StoragePtr, WriteStorage}; -use zksync_system_constants::{ - ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS, -}; -use zksync_types::{AccountTreeId, StorageKey, Timestamp}; -use zksync_utils::u256_to_h256; +use zksync_types::Timestamp; use super::PubdataTracer; -use crate::vm_m5::storage::Storage; use crate::{ interface::{ tracer::{TracerExecutionStopReason, VmExecutionStopReason}, @@ -38,7 +32,7 @@ use crate::{ computational_gas_price, gas_spent_on_bytecodes_and_long_messages_this_opcode, print_debug_if_needed, VmHook, }, - RefundsTracer, ResultTracer, + CircuitsTracer, RefundsTracer, ResultTracer, }, types::internals::ZkSyncVmState, VmTracer, @@ -69,7 +63,7 @@ pub(crate) struct DefaultExecutionTracer { pub(crate) dispatcher: TracerDispatcher, ret_from_the_bootloader: Option, // - pub(crate) estimated_circuits_used: BigDecimal, + pub(crate) circuits_tracer: CircuitsTracer, storage: StoragePtr, _phantom: PhantomData, @@ -97,7 +91,7 @@ impl DefaultExecutionTracer { dispatcher, pubdata_tracer, ret_from_the_bootloader: None, - estimated_circuits_used: BigDecimal::zero(), + circuits_tracer: CircuitsTracer::new(), storage, _phantom: PhantomData, } @@ -148,64 +142,6 @@ impl DefaultExecutionTracer { } TracerExecutionStatus::Continue } - - fn circuits_used_by_opcode( - &mut self, - state: &VmLocalStateData<'_>, - data: &BeforeExecutionData, - ) -> BigDecimal { - match data.opcode.variant.opcode { - Opcode::Invalid(_) - | Opcode::Nop(_) - | Opcode::Add(_) - | Opcode::Sub(_) - | Opcode::Mul(_) - | Opcode::Div(_) - | Opcode::Jump(_) - | Opcode::Binop(_) - | Opcode::Shift(_) - | Opcode::Ptr(_) - | Opcode::NearCall(_) - | Opcode::Context(_) - | Opcode::Ret(_) => { - todo!(); // const - } - Opcode::Log(LogOpcode::StorageRead) => todo!(), // const - Opcode::Log(LogOpcode::StorageWrite) => { - let storage_key = StorageKey::new( - AccountTreeId::new(state.vm_local_state.callstack.current.this_address), - u256_to_h256(data.src0_value.value), - ); - - let first_write = !self - .storage - .borrow() - .get_modified_storage_keys() - .contains_key(&storage_key); - if first_write { - if self.storage.borrow_mut().is_write_initial(&storage_key) { - todo!() // const - } else { - todo!() // const - } - } else { - todo!() // const - } - } - Opcode::Log(LogOpcode::ToL1Message) => todo!(), // const - Opcode::Log(LogOpcode::Event) => todo!(), // const - Opcode::Log(LogOpcode::PrecompileCall) => { - match state.vm_local_state.callstack.current.this_address { - a if a == KECCAK256_PRECOMPILE_ADDRESS => todo!(), // const - a if a == SHA256_PRECOMPILE_ADDRESS => todo!(), // const - a if a == ECRECOVER_PRECOMPILE_ADDRESS => todo!(), // const - _ => todo!(), // const - } - } - Opcode::FarCall(_) => todo!(), // const - Opcode::UMA(_) => todo!(), // const - } - } } impl Debug for DefaultExecutionTracer { @@ -229,14 +165,15 @@ impl Debug for DefaultExecutionTracer { /// The macro passes the function call to all tracers. macro_rules! dispatch_tracers { ($self:ident.$function:ident($( $params:expr ),*)) => { - $self.result_tracer.$function($( $params ),*); - $self.dispatcher.$function($( $params ),*); + $self.result_tracer.$function($( $params ),*); + $self.dispatcher.$function($( $params ),*); if let Some(tracer) = &mut $self.refund_tracer { tracer.$function($( $params ),*); } if let Some(tracer) = &mut $self.pubdata_tracer { tracer.$function($( $params ),*); } + $self.circuits_tracer.$function($( $params ),*); }; } @@ -289,8 +226,6 @@ impl Tracer for DefaultExecutionTracer { self.gas_spent_on_bytecodes_and_long_messages += gas_spent_on_bytecodes_and_long_messages_this_opcode(&state, &data); - // self.estimated_circuits_used += self.circuits_used_by_opcode(&state, &data); - dispatch_tracers!(self.before_execution(state, data, memory, self.storage.clone())); } diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/mod.rs b/core/lib/multivm/src/versions/vm_latest/tracers/mod.rs index 33d043de6eb1..1bdb1b6ccdbf 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/mod.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/mod.rs @@ -1,13 +1,16 @@ +pub(crate) use circuits_tracer::CircuitsTracer; pub(crate) use default_tracers::DefaultExecutionTracer; pub(crate) use pubdata_tracer::PubdataTracer; pub(crate) use refunds::RefundsTracer; pub(crate) use result_tracer::ResultTracer; +pub(crate) mod circuits_tracer; pub(crate) mod default_tracers; pub(crate) mod pubdata_tracer; pub(crate) mod refunds; pub(crate) mod result_tracer; +mod circuits_capacity; pub mod dispatcher; pub(crate) mod traits; pub(crate) mod utils; diff --git a/core/lib/types/src/circuit.rs b/core/lib/types/src/circuit.rs deleted file mode 100644 index 05f269c451ec..000000000000 --- a/core/lib/types/src/circuit.rs +++ /dev/null @@ -1,13 +0,0 @@ -use zkevm_test_harness::{geometry_config::get_geometry_config, toolset::GeometryConfig}; - -pub const LEAF_SPLITTING_FACTOR: usize = 50; -pub const NODE_SPLITTING_FACTOR: usize = 48; - -/// Max number of basic circuits per L1 batch. -pub const SCHEDULER_UPPER_BOUND: u32 = (LEAF_SPLITTING_FACTOR * NODE_SPLITTING_FACTOR) as u32; - -pub const LEAF_CIRCUIT_INDEX: u8 = 2; -pub const NODE_CIRCUIT_INDEX: u8 = 1; -pub const SCHEDULER_CIRCUIT_INDEX: u8 = 0; - -pub const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); diff --git a/core/lib/types/src/lib.rs b/core/lib/types/src/lib.rs index a7d7e71e0eff..dbe893b7d20f 100644 --- a/core/lib/types/src/lib.rs +++ b/core/lib/types/src/lib.rs @@ -33,7 +33,6 @@ use crate::{l2::TransactionType, protocol_version::ProtocolUpgradeTxCommonData}; pub mod aggregated_operations; pub mod block; -pub mod circuit; pub mod commitment; pub mod contract_verification_api; pub mod contracts; diff --git a/core/lib/zksync_core/Cargo.toml b/core/lib/zksync_core/Cargo.toml index 10fe43bdf404..16d0eb10ba46 100644 --- a/core/lib/zksync_core/Cargo.toml +++ b/core/lib/zksync_core/Cargo.toml @@ -28,7 +28,6 @@ zksync_circuit_breaker = { path = "../circuit_breaker" } zksync_storage = { path = "../storage" } zksync_merkle_tree = { path = "../merkle_tree" } zksync_mini_merkle_tree = { path = "../mini_merkle_tree" } -zksync_verification_key_generator_and_server = { path = "../../bin/verification_key_generator_and_server" } prometheus_exporter = { path = "../prometheus_exporter" } zksync_web3_decl = { path = "../web3_decl", default-features = false, features = [ "server", diff --git a/docker/circuit-synthesizer/Dockerfile b/docker/circuit-synthesizer/Dockerfile index 831fe1672239..5ea76836d712 100644 --- a/docker/circuit-synthesizer/Dockerfile +++ b/docker/circuit-synthesizer/Dockerfile @@ -23,7 +23,6 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y curl openssl libpq5 ca-certificates && rm -rf /var/lib/apt/lists/* -COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ COPY --from=builder /usr/src/zksync/target/release/zksync_circuit_synthesizer /usr/bin/ ENTRYPOINT ["zksync_circuit_synthesizer"] diff --git a/docker/prover-gar/Dockerfile b/docker/prover-gar/Dockerfile index ced97d6d7e77..763bbc7f8d54 100644 --- a/docker/prover-gar/Dockerfile +++ b/docker/prover-gar/Dockerfile @@ -15,7 +15,6 @@ COPY --from=prover etc/system-contracts/bootloader/build/artifacts/ /etc/system- COPY --from=prover etc/system-contracts/artifacts-zk /etc/system-contracts/artifacts-zk COPY --from=prover contracts/ethereum/artifacts/ /contracts/ethereum/artifacts/ COPY --from=prover contracts/zksync/artifacts-zk/ /contracts/zksync/artifacts-zk/ -COPY --from=prover core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ COPY --from=prover /usr/bin/zksync_prover /usr/bin/ ENTRYPOINT ["zksync_prover"] diff --git a/docker/prover/Dockerfile b/docker/prover/Dockerfile index a883aa027977..d84f10531de8 100644 --- a/docker/prover/Dockerfile +++ b/docker/prover/Dockerfile @@ -56,8 +56,6 @@ COPY contracts/ethereum/artifacts/ /contracts/ethereum/artifacts/ COPY contracts/zksync/artifacts-zk/ /contracts/zksync/artifacts-zk/ COPY setup_2\^26.key /etc/ -COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ - COPY --from=builder /usr/src/zksync/target/release/zksync_prover /usr/bin/ ENTRYPOINT ["zksync_prover"] diff --git a/docker/server-v2/Dockerfile b/docker/server-v2/Dockerfile index 1b79fb328545..5d7252a65be0 100644 --- a/docker/server-v2/Dockerfile +++ b/docker/server-v2/Dockerfile @@ -41,6 +41,5 @@ COPY contracts/zksync/artifacts-zk/ /contracts/zksync/artifacts-zk/ COPY etc/tokens/ /etc/tokens/ COPY etc/ERC20/ /etc/ERC20/ COPY etc/multivm_bootloaders/ /etc/multivm_bootloaders/ -COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ ENTRYPOINT ["zksync_server"] diff --git a/etc/env/base/rust.toml b/etc/env/base/rust.toml index 4c0ebb6ed052..18c7823f73e3 100644 --- a/etc/env/base/rust.toml +++ b/etc/env/base/rust.toml @@ -22,7 +22,6 @@ zksync_mempool=debug,\ loadnext=info,\ vm=info,\ block_sizes_test=info,\ -zksync_verification_key_generator_and_server=info,\ zksync_object_store=info,\ setup_key_generator_and_server=info,\ zksync_circuit_synthesizer=info,\ diff --git a/prover/circuit_synthesizer/Cargo.toml b/prover/circuit_synthesizer/Cargo.toml index c6f70bd5c3b8..9f3cda69e9f1 100644 --- a/prover/circuit_synthesizer/Cargo.toml +++ b/prover/circuit_synthesizer/Cargo.toml @@ -21,7 +21,6 @@ zksync_prover_fri_utils = { path = "../prover_fri_utils" } vlog = { path = "../../core/lib/vlog" } prometheus_exporter = { path = "../../core/lib/prometheus_exporter" } zksync_prover_utils = { path = "../../core/lib/prover_utils" } -zksync_verification_key_generator_and_server = { path = "../../core/bin/verification_key_generator_and_server" } zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.3.3" } diff --git a/prover/prover/Cargo.toml b/prover/prover/Cargo.toml index 03adce72daf0..fa2baf27002d 100644 --- a/prover/prover/Cargo.toml +++ b/prover/prover/Cargo.toml @@ -23,7 +23,6 @@ zksync_eth_client = { path = "../../core/lib/eth_client" } zksync_types = { path = "../../core/lib/types" } prometheus_exporter = { path = "../../core/lib/prometheus_exporter" } vlog = { path = "../../core/lib/vlog" } -zksync_verification_key_generator_and_server = { path = "../../core/bin/verification_key_generator_and_server" } zksync_object_store = { path = "../../core/lib/object_store" } setup_key_generator_and_server = { path = "../setup_key_generator_and_server" } From eef8c1dc0343a6731bebf4b5f27ccc2774e0d467 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 14:40:39 +0200 Subject: [PATCH 03/27] fmt --- .../src/versions/vm_latest/tracers/circuits_tracer.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index 70cc728b16f8..c28edcb06ba4 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -1,8 +1,10 @@ -use bigdecimal::{BigDecimal, Zero}; use std::marker::PhantomData; -use zk_evm_1_4_0::zkevm_opcode_defs::{LogOpcode, Opcode, UMAOpcode}; -use zk_evm_1_4_0::tracing::{BeforeExecutionData, VmLocalStateData}; +use bigdecimal::{BigDecimal, Zero}; +use zk_evm_1_4_0::{ + tracing::{BeforeExecutionData, VmLocalStateData}, + zkevm_opcode_defs::{LogOpcode, Opcode, UMAOpcode}, +}; use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::{ ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS, From 8de4cc31735143784fbc9ac20af5ebe0477aa515 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 15:01:19 +0200 Subject: [PATCH 04/27] Clean up geometry criteria interface --- .../criteria/geometry_seal_criteria.rs | 98 ++----------------- 1 file changed, 8 insertions(+), 90 deletions(-) diff --git a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs index 0066707d0638..57437d023028 100644 --- a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs +++ b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs @@ -1,10 +1,7 @@ use std::fmt; use zksync_config::configs::chain::StateKeeperConfig; -use zksync_types::{ - tx::tx_execution_info::{DeduplicatedWritesMetrics, ExecutionMetrics}, - ProtocolVersionId, -}; +use zksync_types::{tx::tx_execution_info::ExecutionMetrics, ProtocolVersionId}; // Local uses use crate::state_keeper::seal_criteria::{SealCriterion, SealData, SealResolution}; @@ -18,7 +15,7 @@ pub struct CircuitsCriterion; trait MetricExtractor { const PROM_METRIC_CRITERION_NAME: &'static str; fn limit_per_block(protocol_version: ProtocolVersionId) -> usize; - fn extract(metric: &ExecutionMetrics, writes: &DeduplicatedWritesMetrics) -> usize; + fn extract(metric: &ExecutionMetrics) -> usize; } impl SealCriterion for T @@ -41,15 +38,13 @@ where * config.close_block_at_geometry_percentage) .round(); - if T::extract(&tx_data.execution_metrics, &tx_data.writes_metrics) > reject_bound as usize { + if T::extract(&tx_data.execution_metrics) > reject_bound as usize { SealResolution::Unexecutable("ZK proof cannot be generated for a transaction".into()) - } else if T::extract(&block_data.execution_metrics, &block_data.writes_metrics) + } else if T::extract(&block_data.execution_metrics) >= T::limit_per_block(protocol_version_id) { SealResolution::ExcludeAndSeal - } else if T::extract(&block_data.execution_metrics, &block_data.writes_metrics) - > close_bound as usize - { + } else if T::extract(&block_data.execution_metrics) > close_bound as usize { SealResolution::IncludeAndSeal } else { SealResolution::NoSeal @@ -74,7 +69,7 @@ impl MetricExtractor for CircuitsCriterion { MAX_NUMBER_OF_CIRCUITS } - fn extract(metrics: &ExecutionMetrics, _writes: &DeduplicatedWritesMetrics) -> usize { + fn extract(metrics: &ExecutionMetrics) -> usize { metrics.estimated_circuits_used } } @@ -93,7 +88,6 @@ mod tests { fn test_no_seal_block_resolution( block_execution_metrics: ExecutionMetrics, - block_writes_metrics: DeduplicatedWritesMetrics, criterion: &dyn SealCriterion, protocol_version: ProtocolVersionId, ) { @@ -104,7 +98,6 @@ mod tests { 0, &SealData { execution_metrics: block_execution_metrics, - writes_metrics: block_writes_metrics, ..SealData::default() }, &SealData::default(), @@ -115,7 +108,6 @@ mod tests { fn test_include_and_seal_block_resolution( block_execution_metrics: ExecutionMetrics, - block_writes_metrics: DeduplicatedWritesMetrics, criterion: &dyn SealCriterion, protocol_version: ProtocolVersionId, ) { @@ -126,7 +118,6 @@ mod tests { 0, &SealData { execution_metrics: block_execution_metrics, - writes_metrics: block_writes_metrics, ..SealData::default() }, &SealData::default(), @@ -137,7 +128,6 @@ mod tests { fn test_exclude_and_seal_block_resolution( block_execution_metrics: ExecutionMetrics, - block_writes_metrics: DeduplicatedWritesMetrics, criterion: &dyn SealCriterion, protocol_version: ProtocolVersionId, ) { @@ -148,7 +138,6 @@ mod tests { 0, &SealData { execution_metrics: block_execution_metrics, - writes_metrics: block_writes_metrics, ..SealData::default() }, &SealData::default(), @@ -159,7 +148,6 @@ mod tests { fn test_unexecutable_tx_resolution( tx_execution_metrics: ExecutionMetrics, - tx_writes_metrics: DeduplicatedWritesMetrics, criterion: &dyn SealCriterion, protocol_version: ProtocolVersionId, ) { @@ -171,7 +159,6 @@ mod tests { &SealData::default(), &SealData { execution_metrics: tx_execution_metrics, - writes_metrics: tx_writes_metrics, ..SealData::default() }, protocol_version, @@ -186,17 +173,11 @@ mod tests { macro_rules! test_scenario_execution_metrics { ($criterion: tt, $metric_name: ident, $metric_type: ty, $protocol_version: expr) => { let config = get_config(); - let writes_metrics = DeduplicatedWritesMetrics::default(); let block_execution_metrics = ExecutionMetrics { $metric_name: ($criterion::limit_per_block($protocol_version) / 2) as $metric_type, ..ExecutionMetrics::default() }; - test_no_seal_block_resolution( - block_execution_metrics, - writes_metrics, - &$criterion, - $protocol_version, - ); + test_no_seal_block_resolution(block_execution_metrics, &$criterion, $protocol_version); let block_execution_metrics = ExecutionMetrics { $metric_name: ($criterion::limit_per_block($protocol_version) - 1) as $metric_type, @@ -205,7 +186,6 @@ mod tests { test_include_and_seal_block_resolution( block_execution_metrics, - writes_metrics, &$criterion, $protocol_version, ); @@ -217,7 +197,6 @@ mod tests { test_exclude_and_seal_block_resolution( block_execution_metrics, - writes_metrics, &$criterion, $protocol_version, ); @@ -230,68 +209,7 @@ mod tests { ..ExecutionMetrics::default() }; - test_unexecutable_tx_resolution( - tx_execution_metrics, - writes_metrics, - &$criterion, - $protocol_version, - ); - }; - } - - macro_rules! test_scenario_writes_metrics { - ($criterion:tt, $metric_name:ident, $metric_type:ty, $protocol_version:expr) => { - let config = get_config(); - let execution_metrics = ExecutionMetrics::default(); - let block_writes_metrics = DeduplicatedWritesMetrics { - $metric_name: ($criterion::limit_per_block($protocol_version) / 2) as $metric_type, - ..Default::default() - }; - test_no_seal_block_resolution( - execution_metrics, - block_writes_metrics, - &$criterion, - $protocol_version, - ); - - let block_writes_metrics = DeduplicatedWritesMetrics { - $metric_name: ($criterion::limit_per_block($protocol_version) - 1) as $metric_type, - ..Default::default() - }; - - test_include_and_seal_block_resolution( - execution_metrics, - block_writes_metrics, - &$criterion, - $protocol_version, - ); - - let block_writes_metrics = DeduplicatedWritesMetrics { - $metric_name: ($criterion::limit_per_block($protocol_version)) as $metric_type, - ..Default::default() - }; - - test_exclude_and_seal_block_resolution( - execution_metrics, - block_writes_metrics, - &$criterion, - $protocol_version, - ); - - let tx_writes_metrics = DeduplicatedWritesMetrics { - $metric_name: ($criterion::limit_per_block($protocol_version) as f64 - * config.reject_tx_at_geometry_percentage - + 1f64) - .round() as $metric_type, - ..Default::default() - }; - - test_unexecutable_tx_resolution( - execution_metrics, - tx_writes_metrics, - &$criterion, - $protocol_version, - ); + test_unexecutable_tx_resolution(tx_execution_metrics, &$criterion, $protocol_version); }; } From 6c9185d9590497a6c01498da05568049ab4d85d0 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 15:03:49 +0200 Subject: [PATCH 05/27] Add comment --- .../multivm/src/versions/vm_latest/tracers/default_tracers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs index b4f534f4fe9d..4ad0c568348d 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs @@ -62,7 +62,7 @@ pub(crate) struct DefaultExecutionTracer { pub(crate) pubdata_tracer: Option>, pub(crate) dispatcher: TracerDispatcher, ret_from_the_bootloader: Option, - // + // This tracer tracks what opcodes were executed and calculates how much circuits will be generated. pub(crate) circuits_tracer: CircuitsTracer, storage: StoragePtr, From fcaec4db7158110930acdce490b2233995a910af Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 15:19:58 +0200 Subject: [PATCH 06/27] revert --- .../Cargo.toml | 37 ++ .../README.md | 39 ++ .../data/verification_0_key.json | 399 ++++++++++++++++++ .../data/verification_10_key.json | 399 ++++++++++++++++++ .../data/verification_11_key.json | 399 ++++++++++++++++++ .../data/verification_12_key.json | 399 ++++++++++++++++++ .../data/verification_13_key.json | 399 ++++++++++++++++++ .../data/verification_14_key.json | 399 ++++++++++++++++++ .../data/verification_15_key.json | 399 ++++++++++++++++++ .../data/verification_16_key.json | 399 ++++++++++++++++++ .../data/verification_17_key.json | 399 ++++++++++++++++++ .../data/verification_18_key.json | 399 ++++++++++++++++++ .../data/verification_1_key.json | 399 ++++++++++++++++++ .../data/verification_2_key.json | 399 ++++++++++++++++++ .../data/verification_3_key.json | 399 ++++++++++++++++++ .../data/verification_4_key.json | 399 ++++++++++++++++++ .../data/verification_5_key.json | 399 ++++++++++++++++++ .../data/verification_6_key.json | 399 ++++++++++++++++++ .../data/verification_7_key.json | 399 ++++++++++++++++++ .../data/verification_8_key.json | 399 ++++++++++++++++++ .../data/verification_9_key.json | 399 ++++++++++++++++++ .../src/commitment_generator.rs | 37 ++ .../src/json_to_binary_vk_converter.rs | 31 ++ .../src/lib.rs | 188 +++++++++ .../src/main.rs | 48 +++ .../src/tests.rs | 68 +++ core/lib/types/src/circuit.rs | 13 + prover/circuit_synthesizer/Cargo.toml | 1 + prover/prover/Cargo.toml | 1 + 29 files changed, 8044 insertions(+) create mode 100644 core/bin/verification_key_generator_and_server/Cargo.toml create mode 100644 core/bin/verification_key_generator_and_server/README.md create mode 100644 core/bin/verification_key_generator_and_server/data/verification_0_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_10_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_11_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_12_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_13_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_14_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_15_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_16_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_17_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_18_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_1_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_2_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_3_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_4_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_5_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_6_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_7_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_8_key.json create mode 100644 core/bin/verification_key_generator_and_server/data/verification_9_key.json create mode 100644 core/bin/verification_key_generator_and_server/src/commitment_generator.rs create mode 100644 core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs create mode 100644 core/bin/verification_key_generator_and_server/src/lib.rs create mode 100644 core/bin/verification_key_generator_and_server/src/main.rs create mode 100644 core/bin/verification_key_generator_and_server/src/tests.rs create mode 100644 core/lib/types/src/circuit.rs diff --git a/core/bin/verification_key_generator_and_server/Cargo.toml b/core/bin/verification_key_generator_and_server/Cargo.toml new file mode 100644 index 000000000000..b49683424a40 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "zksync_verification_key_generator_and_server" +version = "0.1.0" +edition = "2018" +license = "MIT OR Apache-2.0" + +[lib] +name = "zksync_verification_key_server" +path = "src/lib.rs" + +[[bin]] +name = "zksync_verification_key_generator" +path = "src/main.rs" + +[[bin]] +name = "zksync_json_to_binary_vk_converter" +path = "src/json_to_binary_vk_converter.rs" + +[[bin]] +name = "zksync_commitment_generator" +path = "src/commitment_generator.rs" + +[dependencies] +zksync_types = { path = "../../lib/types" } +zksync_prover_utils = { path = "../../lib/prover_utils" } +vlog = { path = "../../lib/vlog" } +circuit_testing = { git = "https://github.com/matter-labs/era-circuit_testing.git", branch = "main" } +itertools = "0.10.5" +bincode = "1.3.3" + +anyhow = "1.0" +serde_json = "1.0.85" +hex = "0.4.3" +structopt = "0.3.26" +ff = { package = "ff_ce", version = "0.14.1" } +once_cell = "1.8.0" +tracing = "0.1" diff --git a/core/bin/verification_key_generator_and_server/README.md b/core/bin/verification_key_generator_and_server/README.md new file mode 100644 index 000000000000..efe7d3f99a4e --- /dev/null +++ b/core/bin/verification_key_generator_and_server/README.md @@ -0,0 +1,39 @@ +# Verification keys + +We currently have around 20 different circuits like: Scheduler, Leaf, KeccakPrecompile etc (for the full list - look at +CircuitType enum in sync_vm repo). + +Each such circuit requires a separate verification key. + +This crate fulfills 2 roles: + +- it has the binaries that can generate the updated versions of the keys (for example if VM code changes) +- it provides the libraries that can be used by other components that need to use these keys (for example provers) - + behaving like a key server. + +Moreover, all these keys are submitted as code within the repo in `verification_XX_key.json` files. + +## zksync_verification_key_server + +This is the library that can be used by other components to fetch the verification key for a given circuit (using +`get_vk_for_circuit_type` function). + +## zksync_verification_key_generator + +The main binary that generates verification key for given circuits. Most of the heavy lifting is done by the +`create_vk_for_padding_size_log_2` method from circuit_testing repo. + +The results are written to the `verification_XX_key.json` files in the current repository. + +## zksync_json_to_binary_vk_converter + +Converts the local json verification keys into the binary format (and stores them in the output directory). + +## zksync_commitment_generator + +This tool takes the 3 commitments (one for all the basic circuits, one for node and one for leaf), computed based on the +current verification keys - and updates the contract.toml config file (which is located in etc/env/base/contracts.toml). + +These commitments are later used in one of the circuit breakers - to compare their values to the commitments that L1 +contract holds (so that we can 'panic' properly - if we notice that our server's commitments differ from the L1 +contracts - which would result in failed L1 transactions). diff --git a/core/bin/verification_key_generator_and_server/data/verification_0_key.json b/core/bin/verification_key_generator_and_server/data/verification_0_key.json new file mode 100644 index 000000000000..c3262193a4fd --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_0_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 14745348174000482855, + 2839037062185937123, + 3369862715588854899, + 1495909583940713128 + ], + "y": [ + 6859454683840363585, + 11340551061368171664, + 9528805406487149561, + 3414144677220223705 + ], + "infinity": false + }, + { + "x": [ + 9215749870136224396, + 18418669114332753377, + 13140219601461030180, + 2381098845928447331 + ], + "y": [ + 8834765081837029169, + 4424842234296363904, + 13294547557836067005, + 414624398145171890 + ], + "infinity": false + }, + { + "x": [ + 2148575411987453084, + 16730180692461995258, + 12423475767707134837, + 3014264170083149730 + ], + "y": [ + 10870860158804422503, + 14060279526953529989, + 2266257082861680293, + 22356173050560284 + ], + "infinity": false + }, + { + "x": [ + 17803008042411335770, + 5713064950476621403, + 17979342410816871746, + 491265656076548841 + ], + "y": [ + 9823492080506672630, + 3637386621225409615, + 8776978043600973097, + 2514196809208915768 + ], + "infinity": false + }, + { + "x": [ + 3768479078383323179, + 16153057542709544671, + 10578964798085613273, + 2831188075764800753 + ], + "y": [ + 2387514805820590694, + 15085489652142686165, + 8141513931186597223, + 1582376980242699819 + ], + "infinity": false + }, + { + "x": [ + 5395455814671474247, + 5013790368139874617, + 8671649443504728767, + 839142828943885970 + ], + "y": [ + 11231626069154926735, + 5078347962234771017, + 17373886182204596447, + 513647957075879347 + ], + "infinity": false + }, + { + "x": [ + 8940485327950054531, + 9156997542069636576, + 14316753178152000598, + 3357551869664255582 + ], + "y": [ + 14102490706504125272, + 4494991810930729808, + 15532318871086968466, + 1537365238286274178 + ], + "infinity": false + }, + { + "x": [ + 13914906478277300859, + 6213896071228541481, + 4364409818367302306, + 659097390118096039 + ], + "y": [ + 7328372274594390887, + 2650332638498669615, + 15455628473476960005, + 3119379427019958230 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 9438200511694036157, + 11094162170960057340, + 9123678872696723713, + 2950597355117190054 + ], + "y": [ + 6153972960518016517, + 8045683598100955864, + 13410633858416643489, + 988361678931464913 + ], + "infinity": false + }, + { + "x": [ + 805964423710846142, + 13603470797942296854, + 11292123377140077447, + 1455913517812009773 + ], + "y": [ + 4541622738043214385, + 8186357170000535775, + 4765839113294831637, + 3026863977499737494 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 1851039213129741497, + 11907960788190413713, + 2882727828085561070, + 1451278944954982956 + ], + "y": [ + 15245785050592773860, + 1774295027236395480, + 3373069120056880915, + 1080245109458702174 + ], + "infinity": false + }, + { + "x": [ + 9366052859968548005, + 12275028918364559591, + 2472023927159177225, + 1052535074027277666 + ], + "y": [ + 2428574557555628629, + 15067392861858369528, + 16949255188095910778, + 2297925771936569168 + ], + "infinity": false + }, + { + "x": [ + 17016009610362956206, + 4047659663396753591, + 1832464593155416403, + 2725142957049914767 + ], + "y": [ + 12447928856414787240, + 3072280375285720285, + 12294239288643819494, + 613511140380288958 + ], + "infinity": false + }, + { + "x": [ + 6312774245791141720, + 496150993329472460, + 12773767122915456934, + 3404402910494500531 + ], + "y": [ + 13852578578747731084, + 9030931732410275304, + 17159996848865265705, + 1696956882146098553 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 1073530, + "lookup_selector_commitment": { + "x": [ + 4441974708940861232, + 11325614820129407652, + 7273013871150456559, + 2270181644629652201 + ], + "y": [ + 3070631142979677922, + 15247189094202672776, + 12651459662740804392, + 1832216259472686694 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 7312875299592476003, + 313526216906044060, + 13914875394436353152, + 3424388477700656316 + ], + "y": [ + 2572062173996296044, + 5984767625164919974, + 12005537293370417131, + 616463121946800406 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_10_key.json b/core/bin/verification_key_generator_and_server/data/verification_10_key.json new file mode 100644 index 000000000000..ec9d3727bff9 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_10_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 4364720487844379181, + 17010766725144227333, + 1022678199111276314, + 1146578362772127376 + ], + "y": [ + 10340654727439455072, + 12691578856596245032, + 837883495763401146, + 2135776887902289239 + ], + "infinity": false + }, + { + "x": [ + 14564870240038241482, + 16001391704613609683, + 16397364612792898214, + 1316914335235774452 + ], + "y": [ + 2386942353392090183, + 4642131766714508143, + 16789479723446408276, + 2261353401184907401 + ], + "infinity": false + }, + { + "x": [ + 6081056006818109026, + 14051483412950926523, + 8605392534710099348, + 1527183574619010123 + ], + "y": [ + 3896696527234063839, + 12862398541231039501, + 1005646628007936886, + 3479645512156004366 + ], + "infinity": false + }, + { + "x": [ + 11266242489999219523, + 8100856016495224488, + 6788749864393617587, + 482299081118345826 + ], + "y": [ + 225211373180020785, + 6498635074385582091, + 4274055525472487569, + 2578651815252093838 + ], + "infinity": false + }, + { + "x": [ + 10378455392293934375, + 13391940670290769236, + 10463014668466536299, + 472544008986099462 + ], + "y": [ + 1502016714118108544, + 14252801754530793876, + 2203844491975584716, + 1116114255465135672 + ], + "infinity": false + }, + { + "x": [ + 9703616742074407567, + 9691703077434834222, + 7366620887865105973, + 36165572355418066 + ], + "y": [ + 7430304832706471782, + 5173267152399523091, + 14416699599905226230, + 2681204653630184824 + ], + "infinity": false + }, + { + "x": [ + 9347312215430913530, + 13606433894103359668, + 14013475178334262360, + 2947181048682744075 + ], + "y": [ + 4001199390012145932, + 4622813642635649819, + 16433672063298879053, + 1247842462976799965 + ], + "infinity": false + }, + { + "x": [ + 1639425503718708209, + 8242804754724970899, + 11043260258533730377, + 2245145560504199089 + ], + "y": [ + 14202551139064230506, + 4307109380979442947, + 13141687433511141087, + 1913204959448290015 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 17540836040216578409, + 14577118461028955096, + 2300935836423716880, + 427649651480863044 + ], + "y": [ + 13066723755606073272, + 17324941433857131282, + 1679499122173566851, + 3298750515604566671 + ], + "infinity": false + }, + { + "x": [ + 14709152157752642079, + 13510549649315108277, + 3019440420162710858, + 627188607991231846 + ], + "y": [ + 16615706301470133997, + 915024441316023047, + 13798541787831785917, + 3340602253234308653 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 12626704863583094704, + 3308474372162220296, + 16088806788444947642, + 636430705662147361 + ], + "y": [ + 17052785040105865748, + 11203395113497209978, + 2939609765212411460, + 3167290643533167611 + ], + "infinity": false + }, + { + "x": [ + 3075146465184418179, + 11559452521956513155, + 1656597085428845901, + 1618447062156730856 + ], + "y": [ + 2010693621773175313, + 2977509893150409878, + 9431891659616951962, + 1776222288355278384 + ], + "infinity": false + }, + { + "x": [ + 6408318860212838666, + 9847136022608767026, + 18080834927350013528, + 3306285138140631107 + ], + "y": [ + 16064928058583899597, + 461689523483649779, + 13572099112445223829, + 1563453638232968523 + ], + "infinity": false + }, + { + "x": [ + 327171445663828020, + 12706053900720413614, + 9237483585964880752, + 1960293149538216528 + ], + "y": [ + 11030775691809003651, + 11089052388657955457, + 3209890793790993499, + 1198867574642866523 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 5202052, + "lookup_selector_commitment": { + "x": [ + 781239045644769777, + 14316527640474633593, + 2443643435827373112, + 3049372365263474427 + ], + "y": [ + 4073012743593667819, + 16009537994875540924, + 11173412503242869179, + 1513208421597995174 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 697552212563769686, + 7709943502535418760, + 15019345407325619175, + 3433081085078580257 + ], + "y": [ + 8668947019840357731, + 14698901351824712883, + 15088598879190660424, + 2873081208166433946 + ], + "infinity": false + }, + { + "x": [ + 7893133928909060673, + 7064922516930129957, + 3592836702741304814, + 2239702595710114437 + ], + "y": [ + 7691360541875191519, + 11379321785127235277, + 6653616064071569031, + 2555434628517540774 + ], + "infinity": false + }, + { + "x": [ + 6243944238013052821, + 7908243182210136125, + 17178099109525791299, + 2553622184721264566 + ], + "y": [ + 736121280088239428, + 6158073429758170526, + 11217302997977204117, + 2594798912020899417 + ], + "infinity": false + }, + { + "x": [ + 2064240298596094591, + 16917726764104887991, + 11042784977532408536, + 3377647228930170830 + ], + "y": [ + 10635525052494768819, + 387400048616497096, + 9379200582543310995, + 1571766153703296253 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 7603211811706190713, + 2486982239745271096, + 11528266448545919500, + 3080741880407152411 + ], + "y": [ + 7967754771633653173, + 6016822892450616749, + 9688696792558711613, + 2682562048141398047 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_11_key.json b/core/bin/verification_key_generator_and_server/data/verification_11_key.json new file mode 100644 index 000000000000..ec60b1b5c70c --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_11_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 6404793958941109752, + 600086648940026770, + 17621036346050218167, + 648286585825030202 + ], + "y": [ + 15536368541166505022, + 13874331483468128999, + 15299774519724050181, + 694528839710637549 + ], + "infinity": false + }, + { + "x": [ + 8437895530551083583, + 9515418928119648176, + 13043255827139294721, + 2995712510038409810 + ], + "y": [ + 2599666661350767554, + 5213004864468121936, + 3448071048439343925, + 3372727479169634860 + ], + "infinity": false + }, + { + "x": [ + 4949545806128010634, + 7991544258837652527, + 13984289231122041826, + 435264553263929947 + ], + "y": [ + 5315155210033461895, + 5269954775753247626, + 8365554241810378947, + 3038338810517586456 + ], + "infinity": false + }, + { + "x": [ + 10765735847634894938, + 996016141851615448, + 17905928073714218280, + 1382306444325686451 + ], + "y": [ + 2138154197587423296, + 10332772886666867909, + 18365120064743353477, + 3036329558617382049 + ], + "infinity": false + }, + { + "x": [ + 10826908009799408310, + 17008417534705779156, + 6763973494549063072, + 2085829964414931488 + ], + "y": [ + 8778528796073273991, + 3575354418973385595, + 7700555759899743641, + 2991788183234680231 + ], + "infinity": false + }, + { + "x": [ + 4838537981048085423, + 17733460364049897496, + 2406410363431464143, + 317979983533551325 + ], + "y": [ + 1063783130085451648, + 17468950496650586998, + 1638492556781126884, + 2655791721465286744 + ], + "infinity": false + }, + { + "x": [ + 9900079822056413611, + 2971494295919434281, + 3851188096409515874, + 1674965457600938162 + ], + "y": [ + 278026997091552202, + 4169606578927284200, + 4285297176993939496, + 1835673146863992148 + ], + "infinity": false + }, + { + "x": [ + 14972922803706426724, + 1950002897609593521, + 14885502244328862256, + 2711533695106895845 + ], + "y": [ + 6445273103061253271, + 13093783937225622775, + 16913300898726970338, + 3338984185497324237 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 7023363902839996761, + 10470701207992157969, + 15655647820064667897, + 1574806151825297776 + ], + "y": [ + 5374465760860613169, + 17808737811039085287, + 9497881147171478776, + 2496973717640690197 + ], + "infinity": false + }, + { + "x": [ + 11667333913021610767, + 981513539224109240, + 906325130343873228, + 2938085706999497365 + ], + "y": [ + 12114685726509803851, + 8176447551157079615, + 4677211732718215770, + 612959750791398009 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 5178916486603003859, + 12440762249350081718, + 17531240512375127539, + 562979322442547791 + ], + "y": [ + 13269831614205338393, + 14075713698585784838, + 5009519510530479124, + 346033861980045408 + ], + "infinity": false + }, + { + "x": [ + 9815443577325313677, + 10727907015331332054, + 7582395371050260833, + 1746872659838481572 + ], + "y": [ + 3973552805135639320, + 14426732004648741961, + 8133164322153358522, + 2668541869556858228 + ], + "infinity": false + }, + { + "x": [ + 4868257934818957423, + 11529848268525929099, + 7089666284160764141, + 796901367628793969 + ], + "y": [ + 991195814042705325, + 1559922382138761102, + 15616159453482282503, + 1031107741111093289 + ], + "infinity": false + }, + { + "x": [ + 17936772813090339705, + 10208762457499980701, + 14796710996322725970, + 638550977107438851 + ], + "y": [ + 5073905611192321777, + 2956648407808816974, + 7778989780119416172, + 2955106321082932072 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 7960377, + "lookup_selector_commitment": { + "x": [ + 1083743271968869166, + 3134203175755215736, + 5835502497758804469, + 3010956977291777466 + ], + "y": [ + 3645612220088813035, + 32844736552579976, + 5426466326302260857, + 1489565191618899261 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 5825422128268478267, + 9219263846299851036, + 3879231702557190566, + 1702488722758880769 + ], + "y": [ + 18311881100262470992, + 5742998199368802392, + 18106865487471159417, + 502191980176920012 + ], + "infinity": false + }, + { + "x": [ + 17195892082859417081, + 7890531942603584793, + 2381805632820057528, + 3173232410464566465 + ], + "y": [ + 16359614627947132075, + 3459600273035137079, + 4550762061432972122, + 3394559699318358224 + ], + "infinity": false + }, + { + "x": [ + 1716103379277390185, + 18097936269579187542, + 16357329729761063450, + 1508640059338197502 + ], + "y": [ + 11014806739603983364, + 4396503314588777389, + 9397245609635151055, + 1703957955248411380 + ], + "infinity": false + }, + { + "x": [ + 4770171350693477354, + 17110558673192292253, + 9799800677557311408, + 761984875463445481 + ], + "y": [ + 1560561403388310063, + 31331275310848146, + 287152055803835484, + 457826332542037277 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 11327495732840772606, + 7407664417001729515, + 9486600059857658309, + 3060296564241189838 + ], + "y": [ + 7624492872489320847, + 18248981556039704277, + 3877205757853252152, + 939885486002612376 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_12_key.json b/core/bin/verification_key_generator_and_server/data/verification_12_key.json new file mode 100644 index 000000000000..fec076f39eda --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_12_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 456514006020943025, + 9595480195714948127, + 12254096252487404245, + 1742692690750856358 + ], + "y": [ + 16294223586064957217, + 3958270970168887906, + 11264067544872898258, + 1692817687935973108 + ], + "infinity": false + }, + { + "x": [ + 1359655052308122459, + 13840124148496555776, + 1774237333490664500, + 2964872651584750318 + ], + "y": [ + 11907598503482948769, + 8700506041798646988, + 15081040576888859990, + 3096802642049924528 + ], + "infinity": false + }, + { + "x": [ + 2884314851670818573, + 13442465544210396156, + 5937955495868181363, + 2486997439179977778 + ], + "y": [ + 9309776793338098458, + 14492906371677122697, + 8837309186596588911, + 1081143755093508499 + ], + "infinity": false + }, + { + "x": [ + 2655654413304275855, + 4244723109566147837, + 12150359360501203194, + 3338981627918702615 + ], + "y": [ + 2522870072161287404, + 17341373219317210182, + 13058930363994599297, + 210373422168410518 + ], + "infinity": false + }, + { + "x": [ + 16728834675380740056, + 2139390496020366235, + 9480389182940223467, + 2279560291896695719 + ], + "y": [ + 12461418813218976432, + 357566005384566098, + 5295578385080568808, + 1801243085576438875 + ], + "infinity": false + }, + { + "x": [ + 8716201428771436123, + 3392394702404760386, + 9990956922582058945, + 1388317411153212399 + ], + "y": [ + 11666415392681680155, + 10553517485129490455, + 16061047708722635939, + 2386622646140901822 + ], + "infinity": false + }, + { + "x": [ + 16162432560623854812, + 15537581062716888632, + 12927223782958923606, + 2800634589869451227 + ], + "y": [ + 5345141365329635916, + 2224393250977631865, + 396527108738048188, + 2298318725146167177 + ], + "infinity": false + }, + { + "x": [ + 18372685954785469756, + 10436523365152935441, + 15509622927999798123, + 2050428620045833325 + ], + "y": [ + 4996265985148335658, + 6073112270434155721, + 4873288683270752338, + 503179567393027927 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 4986139828502830074, + 8644425445976253042, + 4851433922656693398, + 1419574698085640872 + ], + "y": [ + 16192186537521161947, + 16183885683582261905, + 1655718756619164666, + 3420236094426390604 + ], + "infinity": false + }, + { + "x": [ + 10727231722644915889, + 13777116005624794169, + 1422623412369619026, + 1701279717637612575 + ], + "y": [ + 6503647097427010249, + 6381043883853023011, + 15391366286376907281, + 1261207976874708261 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 11852073725466955067, + 179170887563176222, + 17529899074897279348, + 2496783194148289461 + ], + "y": [ + 15490041181991978284, + 6745436372504113852, + 7017978386715410058, + 3482556315200370895 + ], + "infinity": false + }, + { + "x": [ + 1330152738947291505, + 1668990644246591877, + 6805443255260621096, + 1309987766073890626 + ], + "y": [ + 18322300356676620444, + 8225233874302527542, + 5744327785164342590, + 410571567010522636 + ], + "infinity": false + }, + { + "x": [ + 13968210937929584911, + 17067601391996082961, + 4861463652254416951, + 2147834012714370408 + ], + "y": [ + 9012483356698219484, + 8660929519763525826, + 17744882010750642463, + 331423342438323189 + ], + "infinity": false + }, + { + "x": [ + 1352282553299127274, + 8587971715415488300, + 2471024479841756772, + 1239586065229072559 + ], + "y": [ + 1597792022909153930, + 5020991346876715357, + 5622801511814109910, + 1916460940163680567 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 46287674, + "lookup_selector_commitment": { + "x": [ + 11573469000684493293, + 15304040816406013002, + 9206902553183544808, + 2597693769113957036 + ], + "y": [ + 10538181061926273477, + 5239567589495426242, + 3627181047901924882, + 302644994241575377 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 5134795695995115566, + 12287750992060803275, + 3112021177339560487, + 2737779104829043419 + ], + "y": [ + 12960786984497012138, + 17246059378047870426, + 11486754204718893642, + 46104506716724806 + ], + "infinity": false + }, + { + "x": [ + 148472607159578301, + 1393814398025790148, + 13651878286378332448, + 3460878321325997474 + ], + "y": [ + 10791022888598424744, + 1931353219232076143, + 12342018346439101174, + 23632989633122111 + ], + "infinity": false + }, + { + "x": [ + 1355031833403957875, + 10754997913401276231, + 8672292473740482178, + 3014145653612856517 + ], + "y": [ + 3728402825933673134, + 16492594359417243041, + 14619929139939206930, + 2894280666048705144 + ], + "infinity": false + }, + { + "x": [ + 11362104917939269301, + 3050269804312222606, + 17884269955997757593, + 2804911625130359365 + ], + "y": [ + 9563576475625880180, + 9736108320914226650, + 11545696954602328389, + 1108440262014676246 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 5367643753678334453, + 18149093736372716410, + 1335188566370936146, + 668596617655217713 + ], + "y": [ + 9984652217894703540, + 16253861114794085212, + 2139268495406835151, + 710303505771002735 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_13_key.json b/core/bin/verification_key_generator_and_server/data/verification_13_key.json new file mode 100644 index 000000000000..73ffbd212002 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_13_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 17551054392858982554, + 6093238351564742844, + 9461983640740135929, + 665917981733823732 + ], + "y": [ + 5039211542045701927, + 14102316155129161178, + 7599318237652648682, + 1484263542771007309 + ], + "infinity": false + }, + { + "x": [ + 14015566113565304739, + 12895182424777444911, + 5150482782915031712, + 3280776276671330755 + ], + "y": [ + 5503211683737487414, + 5857977821275887356, + 1294122171191120577, + 2917900236095606783 + ], + "infinity": false + }, + { + "x": [ + 11180353512945796758, + 5467792637578213396, + 14862660111090994534, + 1678570344676416345 + ], + "y": [ + 16496106534540891926, + 4355829424666415263, + 8379906815867503783, + 2141225531456729878 + ], + "infinity": false + }, + { + "x": [ + 10512618919562577175, + 8909238001556772501, + 8669074760108324520, + 3259590816167766101 + ], + "y": [ + 15477336671232249792, + 10209451912771766896, + 13672268903388741173, + 682487251336397201 + ], + "infinity": false + }, + { + "x": [ + 14233534177298597555, + 14428793231398751908, + 18070433438826750034, + 1176819688107481869 + ], + "y": [ + 9251234182098356520, + 17131606126090989402, + 17185633762130361526, + 70013401388751862 + ], + "infinity": false + }, + { + "x": [ + 14148566925658671094, + 812517577375883951, + 5030512299767107864, + 44275794325016754 + ], + "y": [ + 3275438385460491589, + 12366768737850140720, + 10754478223029148744, + 64366431004577735 + ], + "infinity": false + }, + { + "x": [ + 5646513434714516506, + 12578668031398681290, + 6956692825033783810, + 536471110695536326 + ], + "y": [ + 876079378616587621, + 9787032999740439668, + 14965634813605966164, + 367083452910738472 + ], + "infinity": false + }, + { + "x": [ + 10902302115259229513, + 14044271471332330954, + 14571826360674828773, + 733766328575554031 + ], + "y": [ + 8186695183963076514, + 621472878958955881, + 14756382569165412398, + 3165780226323675661 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 17780673306296332984, + 10355922416617009060, + 5077451999006954761, + 2644291606399153501 + ], + "y": [ + 884498752701137122, + 731399349168706916, + 4286165746592754883, + 3279732117855760703 + ], + "infinity": false + }, + { + "x": [ + 11012802284910829398, + 7859388231941271159, + 17586341808458361180, + 1386364899721133297 + ], + "y": [ + 15634369655108108777, + 3858480397682251762, + 17706291110507066608, + 1663421415693803071 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 18134041530736321349, + 4345724579806003155, + 2324407857452293002, + 2319164124977213120 + ], + "y": [ + 14302129084811449335, + 8588677756442252515, + 3323846949783670865, + 2109729211841784387 + ], + "infinity": false + }, + { + "x": [ + 14486843004985564085, + 10799247040254992370, + 7658639806933647132, + 2215292564171027727 + ], + "y": [ + 14258341133968554193, + 11685656973533320944, + 14111972937744219524, + 1172604679688980794 + ], + "infinity": false + }, + { + "x": [ + 12872375111956991701, + 14049784009914403066, + 15325016171856456312, + 2811875539960405333 + ], + "y": [ + 5711194902040443430, + 13827091592207472460, + 17950028361571343192, + 1672758585097311581 + ], + "infinity": false + }, + { + "x": [ + 11717525586585736911, + 730672019767199816, + 3010255132348992613, + 2780587454575324896 + ], + "y": [ + 1473124157542628664, + 1573646910034288561, + 10026766074599473146, + 563223750818543582 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 42547753, + "lookup_selector_commitment": { + "x": [ + 4539928924349895484, + 2792770915461027618, + 11611697420465472575, + 1384307956752801018 + ], + "y": [ + 8840366360901511807, + 8892919985613263102, + 11941090149541110830, + 1930352681887390920 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 4121704254446914578, + 13863658665929861884, + 15362282368839162345, + 2762703036966024619 + ], + "y": [ + 102846692212239082, + 14904466746900448136, + 16872429770359000841, + 1687152581020907098 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_14_key.json b/core/bin/verification_key_generator_and_server/data/verification_14_key.json new file mode 100644 index 000000000000..e8c42d407e35 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_14_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 6916434521451934576, + 614815553772638285, + 3742595993843812033, + 2823214088432624432 + ], + "y": [ + 11642815096362884283, + 18063950820723921281, + 6353943092001719992, + 3201898419478369298 + ], + "infinity": false + }, + { + "x": [ + 10647237757917239762, + 1269177049592707998, + 2650053775033150725, + 582198744757304104 + ], + "y": [ + 9804667267596536998, + 493663115027956828, + 13953159385227792767, + 1568248765042207679 + ], + "infinity": false + }, + { + "x": [ + 7910659438561833906, + 12456422925439856914, + 10869604528749370003, + 1213616301038416610 + ], + "y": [ + 2606202790862698157, + 6809934263763206210, + 17472080335242458272, + 2884639755368519501 + ], + "infinity": false + }, + { + "x": [ + 14211325859682683183, + 11018598407116786751, + 10064425366978091674, + 2748595948091261209 + ], + "y": [ + 13960202853590116423, + 1211975538022172568, + 16303435518817750320, + 1634234707214097860 + ], + "infinity": false + }, + { + "x": [ + 4528591178982443847, + 16310104707629911601, + 5532120103079323919, + 1347877820087040669 + ], + "y": [ + 17983603511717948746, + 9529659424488112452, + 7820918413906679254, + 1819855238351369466 + ], + "infinity": false + }, + { + "x": [ + 14415562798118912210, + 6550719056383417327, + 424281724891761932, + 1264340531903932141 + ], + "y": [ + 7768057951329404686, + 15024442753889769568, + 9676935351692818899, + 1492251668690310932 + ], + "infinity": false + }, + { + "x": [ + 2619366878850208112, + 12150914745315976156, + 8375197026043390274, + 1935272977563031501 + ], + "y": [ + 5381369692389055354, + 17978011500330472972, + 17420193441326928998, + 479187691463910357 + ], + "infinity": false + }, + { + "x": [ + 8720830951139717797, + 15985700059986022675, + 11876530273787337931, + 421322430672290976 + ], + "y": [ + 9700690437922183179, + 1976785701667862157, + 16634886936358874061, + 3002178567925406588 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 8284083154661042764, + 11776500066398184343, + 868620904897679124, + 2988582549909766892 + ], + "y": [ + 10794129605563176627, + 15487634480061313925, + 17194646451372113884, + 2087686927573540537 + ], + "infinity": false + }, + { + "x": [ + 7916190330285050096, + 11731220788334102406, + 6221883233572429550, + 2552280229203107267 + ], + "y": [ + 10510502959728300366, + 14682539966609739595, + 8275243146917870162, + 164811532254637923 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 195850038587200624, + 10136289160450054078, + 4386512701252721226, + 219366815902177323 + ], + "y": [ + 12042545079209848932, + 599057886584676736, + 14545610403811537682, + 498958995843318019 + ], + "infinity": false + }, + { + "x": [ + 4721932753701441297, + 1676671918244393403, + 6943597542294442696, + 50994782040503038 + ], + "y": [ + 8321420884695240511, + 10606883887907326697, + 11471075822795411018, + 1311422627151559437 + ], + "infinity": false + }, + { + "x": [ + 85448132386017640, + 13016912343020112485, + 11647418800345296605, + 1741562939125330787 + ], + "y": [ + 10753835454658443286, + 8646325836340244979, + 7348777908140142985, + 2196062626460604424 + ], + "infinity": false + }, + { + "x": [ + 2125624295892265840, + 12754141819506101591, + 8789168208880604752, + 947087620272222934 + ], + "y": [ + 12566258871261234263, + 12307504590191426495, + 6700589767183706452, + 1828704371386663334 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 42212029, + "lookup_selector_commitment": { + "x": [ + 7709849601046260359, + 6836713108454667472, + 17360769186231334246, + 2348971634881039863 + ], + "y": [ + 13380830060569421804, + 15446653016734774164, + 17884501636917484387, + 1386904567459265970 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 6960699536013090594, + 2075384204892265266, + 12053931571725248687, + 1371193846897305849 + ], + "y": [ + 8904850119058507432, + 10465598889525773001, + 16159541505228012497, + 1982452464017823539 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_15_key.json b/core/bin/verification_key_generator_and_server/data/verification_15_key.json new file mode 100644 index 000000000000..356dbb3c531a --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_15_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 3227382513538635502, + 10189582412003011525, + 1928710987967879299, + 1641062823248805930 + ], + "y": [ + 3271795224553087841, + 14036363906521936156, + 10253705337161624780, + 3091191233208402889 + ], + "infinity": false + }, + { + "x": [ + 3541471743181642086, + 8117051273006688414, + 685909872467163024, + 2614724468827209722 + ], + "y": [ + 1096952120887201428, + 8197980407203032569, + 3949713006885563085, + 2838982585728277197 + ], + "infinity": false + }, + { + "x": [ + 12432945880074879560, + 13444859845042471186, + 16599097070979057001, + 3064039790213026567 + ], + "y": [ + 3745088406100356357, + 11715355314289478148, + 2282946417129489745, + 1619614407449915711 + ], + "infinity": false + }, + { + "x": [ + 6864310053920223866, + 11095455024311706186, + 12229748247000682102, + 2475016349586561501 + ], + "y": [ + 2946781066962542712, + 14275500021265062654, + 7624481756022778467, + 1439658776940615826 + ], + "infinity": false + }, + { + "x": [ + 13589273139905087785, + 10411035015021574213, + 7322465558208873130, + 1805943743448229826 + ], + "y": [ + 13035238946064559886, + 8309482746549063820, + 14229757515324464781, + 1676135665275665956 + ], + "infinity": false + }, + { + "x": [ + 84006308859404982, + 13783127238980064918, + 14101945786439708601, + 3343881426944938693 + ], + "y": [ + 11959320721291234482, + 7288504259378326725, + 9638777183731403514, + 1648453409181088010 + ], + "infinity": false + }, + { + "x": [ + 10987163680360734145, + 3374907765066907489, + 14421201974855570464, + 3148542489906320493 + ], + "y": [ + 17180031485000081847, + 1609372527008367113, + 6050341427989573858, + 477684541505306009 + ], + "infinity": false + }, + { + "x": [ + 2257028353691713628, + 6330174784373016532, + 1686021628649718039, + 2159927805963705967 + ], + "y": [ + 10814125155819336479, + 9673780307204445954, + 7995606758095566598, + 2252251279727988680 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 12209724104183572477, + 11631007075974892904, + 18407423517909669447, + 1123848354500646471 + ], + "y": [ + 4749227851055533192, + 16918951234067984229, + 5345146076707243019, + 2836719468222132526 + ], + "infinity": false + }, + { + "x": [ + 7250866110466496804, + 16022969863388101391, + 16334300930347324147, + 2232272485807431638 + ], + "y": [ + 257675104580526310, + 8044331403028603186, + 2070174268860891010, + 412313474208091695 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 6736882681315025594, + 13400430183084617843, + 17182588928882896917, + 413858188107207402 + ], + "y": [ + 11944170108613027081, + 10598841640624895850, + 9086311820289524704, + 994240611047161478 + ], + "infinity": false + }, + { + "x": [ + 9500318283622871785, + 5480449932874899465, + 13224510306395939252, + 1891329668301281157 + ], + "y": [ + 7314078756040350933, + 1023294602177498218, + 16475078688698425911, + 1793945182112302214 + ], + "infinity": false + }, + { + "x": [ + 17207548058425781429, + 2519222249126358251, + 16087595361924038018, + 3470846273906312296 + ], + "y": [ + 7578361094884620755, + 7082109151721400218, + 13675372677342046523, + 3204472226310685459 + ], + "infinity": false + }, + { + "x": [ + 7036282717341939568, + 3035419720331773758, + 6765191455902729185, + 1301973211946290083 + ], + "y": [ + 697377419426635450, + 14612037890797520515, + 11746079616766057625, + 1031190413179598818 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 6391155, + "lookup_selector_commitment": { + "x": [ + 17111915492430945419, + 17971275185478677346, + 14211391044159602918, + 2381455978713737016 + ], + "y": [ + 13971515893527127207, + 7078722574057096191, + 6337080743811431820, + 757015217034494132 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 5825422128268478267, + 9219263846299851036, + 3879231702557190566, + 1702488722758880769 + ], + "y": [ + 18311881100262470992, + 5742998199368802392, + 18106865487471159417, + 502191980176920012 + ], + "infinity": false + }, + { + "x": [ + 17195892082859417081, + 7890531942603584793, + 2381805632820057528, + 3173232410464566465 + ], + "y": [ + 16359614627947132075, + 3459600273035137079, + 4550762061432972122, + 3394559699318358224 + ], + "infinity": false + }, + { + "x": [ + 1716103379277390185, + 18097936269579187542, + 16357329729761063450, + 1508640059338197502 + ], + "y": [ + 11014806739603983364, + 4396503314588777389, + 9397245609635151055, + 1703957955248411380 + ], + "infinity": false + }, + { + "x": [ + 4770171350693477354, + 17110558673192292253, + 9799800677557311408, + 761984875463445481 + ], + "y": [ + 1560561403388310063, + 31331275310848146, + 287152055803835484, + 457826332542037277 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 12452920133699897102, + 6896642231513345496, + 4655495116895575043, + 1453525729114564853 + ], + "y": [ + 3574087764464303986, + 10141819911397868785, + 2342639320036978232, + 556196027732983028 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_16_key.json b/core/bin/verification_key_generator_and_server/data/verification_16_key.json new file mode 100644 index 000000000000..356dbb3c531a --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_16_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 3227382513538635502, + 10189582412003011525, + 1928710987967879299, + 1641062823248805930 + ], + "y": [ + 3271795224553087841, + 14036363906521936156, + 10253705337161624780, + 3091191233208402889 + ], + "infinity": false + }, + { + "x": [ + 3541471743181642086, + 8117051273006688414, + 685909872467163024, + 2614724468827209722 + ], + "y": [ + 1096952120887201428, + 8197980407203032569, + 3949713006885563085, + 2838982585728277197 + ], + "infinity": false + }, + { + "x": [ + 12432945880074879560, + 13444859845042471186, + 16599097070979057001, + 3064039790213026567 + ], + "y": [ + 3745088406100356357, + 11715355314289478148, + 2282946417129489745, + 1619614407449915711 + ], + "infinity": false + }, + { + "x": [ + 6864310053920223866, + 11095455024311706186, + 12229748247000682102, + 2475016349586561501 + ], + "y": [ + 2946781066962542712, + 14275500021265062654, + 7624481756022778467, + 1439658776940615826 + ], + "infinity": false + }, + { + "x": [ + 13589273139905087785, + 10411035015021574213, + 7322465558208873130, + 1805943743448229826 + ], + "y": [ + 13035238946064559886, + 8309482746549063820, + 14229757515324464781, + 1676135665275665956 + ], + "infinity": false + }, + { + "x": [ + 84006308859404982, + 13783127238980064918, + 14101945786439708601, + 3343881426944938693 + ], + "y": [ + 11959320721291234482, + 7288504259378326725, + 9638777183731403514, + 1648453409181088010 + ], + "infinity": false + }, + { + "x": [ + 10987163680360734145, + 3374907765066907489, + 14421201974855570464, + 3148542489906320493 + ], + "y": [ + 17180031485000081847, + 1609372527008367113, + 6050341427989573858, + 477684541505306009 + ], + "infinity": false + }, + { + "x": [ + 2257028353691713628, + 6330174784373016532, + 1686021628649718039, + 2159927805963705967 + ], + "y": [ + 10814125155819336479, + 9673780307204445954, + 7995606758095566598, + 2252251279727988680 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 12209724104183572477, + 11631007075974892904, + 18407423517909669447, + 1123848354500646471 + ], + "y": [ + 4749227851055533192, + 16918951234067984229, + 5345146076707243019, + 2836719468222132526 + ], + "infinity": false + }, + { + "x": [ + 7250866110466496804, + 16022969863388101391, + 16334300930347324147, + 2232272485807431638 + ], + "y": [ + 257675104580526310, + 8044331403028603186, + 2070174268860891010, + 412313474208091695 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 6736882681315025594, + 13400430183084617843, + 17182588928882896917, + 413858188107207402 + ], + "y": [ + 11944170108613027081, + 10598841640624895850, + 9086311820289524704, + 994240611047161478 + ], + "infinity": false + }, + { + "x": [ + 9500318283622871785, + 5480449932874899465, + 13224510306395939252, + 1891329668301281157 + ], + "y": [ + 7314078756040350933, + 1023294602177498218, + 16475078688698425911, + 1793945182112302214 + ], + "infinity": false + }, + { + "x": [ + 17207548058425781429, + 2519222249126358251, + 16087595361924038018, + 3470846273906312296 + ], + "y": [ + 7578361094884620755, + 7082109151721400218, + 13675372677342046523, + 3204472226310685459 + ], + "infinity": false + }, + { + "x": [ + 7036282717341939568, + 3035419720331773758, + 6765191455902729185, + 1301973211946290083 + ], + "y": [ + 697377419426635450, + 14612037890797520515, + 11746079616766057625, + 1031190413179598818 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 6391155, + "lookup_selector_commitment": { + "x": [ + 17111915492430945419, + 17971275185478677346, + 14211391044159602918, + 2381455978713737016 + ], + "y": [ + 13971515893527127207, + 7078722574057096191, + 6337080743811431820, + 757015217034494132 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 5825422128268478267, + 9219263846299851036, + 3879231702557190566, + 1702488722758880769 + ], + "y": [ + 18311881100262470992, + 5742998199368802392, + 18106865487471159417, + 502191980176920012 + ], + "infinity": false + }, + { + "x": [ + 17195892082859417081, + 7890531942603584793, + 2381805632820057528, + 3173232410464566465 + ], + "y": [ + 16359614627947132075, + 3459600273035137079, + 4550762061432972122, + 3394559699318358224 + ], + "infinity": false + }, + { + "x": [ + 1716103379277390185, + 18097936269579187542, + 16357329729761063450, + 1508640059338197502 + ], + "y": [ + 11014806739603983364, + 4396503314588777389, + 9397245609635151055, + 1703957955248411380 + ], + "infinity": false + }, + { + "x": [ + 4770171350693477354, + 17110558673192292253, + 9799800677557311408, + 761984875463445481 + ], + "y": [ + 1560561403388310063, + 31331275310848146, + 287152055803835484, + 457826332542037277 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 12452920133699897102, + 6896642231513345496, + 4655495116895575043, + 1453525729114564853 + ], + "y": [ + 3574087764464303986, + 10141819911397868785, + 2342639320036978232, + 556196027732983028 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_17_key.json b/core/bin/verification_key_generator_and_server/data/verification_17_key.json new file mode 100644 index 000000000000..4886f501712e --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_17_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 17914331890341023175, + 5200903915088916638, + 7417971632353510341, + 989671567770015891 + ], + "y": [ + 2927207345798721401, + 12686845373576710402, + 977520799157489114, + 1882223742569339495 + ], + "infinity": false + }, + { + "x": [ + 17162848902278956536, + 16169550484471334725, + 10830640611178609260, + 1347016616567630867 + ], + "y": [ + 6224316231648682710, + 10518372790293065661, + 4887066336660303630, + 703109868065750569 + ], + "infinity": false + }, + { + "x": [ + 15783141083967762454, + 16153855592853073081, + 5667838393811413602, + 1552498518850981979 + ], + "y": [ + 4220445586486275972, + 13196202402039716924, + 17506868028821343237, + 2718319833724164541 + ], + "infinity": false + }, + { + "x": [ + 4896615254637588846, + 5804270398165250639, + 10274952983674590649, + 1937027782721476561 + ], + "y": [ + 14180244016629518742, + 1376497406583367686, + 11268467489552574214, + 2331396669725958189 + ], + "infinity": false + }, + { + "x": [ + 191294939748295885, + 2804205121966814820, + 3897841028303648224, + 3406986167359695085 + ], + "y": [ + 6000542982074572633, + 1697448874567677325, + 10313504031977824294, + 320347014349001728 + ], + "infinity": false + }, + { + "x": [ + 6817435454105168413, + 15823888625999007373, + 9766931118761036330, + 3392959293697897728 + ], + "y": [ + 3549039265311512008, + 4758653036115592629, + 219467419355603781, + 83059544477934848 + ], + "infinity": false + }, + { + "x": [ + 5038171725639341807, + 6859992384823395611, + 15284967171349293554, + 16807092603996758 + ], + "y": [ + 16504201956683368367, + 12931995037356002803, + 16812826192957092842, + 3169839139097845275 + ], + "infinity": false + }, + { + "x": [ + 7140480682142203727, + 9518528852331365100, + 6189914959408603471, + 535939568308325781 + ], + "y": [ + 5944679084532939174, + 17280810090456322382, + 3743919877743496107, + 1235924204609568068 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 1929812895882850703, + 10386198218814398503, + 17007521659662498274, + 1093092717342753672 + ], + "y": [ + 14834187133095267171, + 15506032964234961178, + 7626816120460943443, + 871778379365004315 + ], + "infinity": false + }, + { + "x": [ + 15660406110329165813, + 8146521122567923995, + 2421739551937359002, + 3037598346026174089 + ], + "y": [ + 526124545966722472, + 1168331442853419483, + 4128095883471549051, + 2951909971734725955 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 6206240620508019400, + 3690935139087147193, + 15230272164329216928, + 2140680869789406894 + ], + "y": [ + 14967331981004447304, + 1624146052760537503, + 8986435052862626311, + 334011853307313390 + ], + "infinity": false + }, + { + "x": [ + 4342223064246074020, + 2037946044543710684, + 9057698479075332373, + 1955362957846693345 + ], + "y": [ + 13253375713250043938, + 6754658208742468331, + 9339617748652368850, + 3066524060291544175 + ], + "infinity": false + }, + { + "x": [ + 17765629723696241082, + 14243015821582305127, + 922013493526048847, + 186830516636733479 + ], + "y": [ + 14465184942185208224, + 11235596895177038197, + 5490682932088517686, + 1253279069662324930 + ], + "infinity": false + }, + { + "x": [ + 9369367805867402420, + 12663806522952881709, + 10184609326459106945, + 1664572000409921348 + ], + "y": [ + 4383960972942823390, + 6526609131568596717, + 1343118583674917141, + 113408414321095416 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 6306340, + "lookup_selector_commitment": { + "x": [ + 8662938005624859815, + 9126108646717466191, + 14321121874090966307, + 2777446762308933634 + ], + "y": [ + 12555265159079607081, + 9054928862248682392, + 2784170007581120117, + 1769718192676345815 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 12644448349947379666, + 16345179309557779118, + 10854030671875297787, + 1358228639202695992 + ], + "y": [ + 2673142241557152443, + 11674634738064487673, + 12992693662201776412, + 1888958170754620568 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_18_key.json b/core/bin/verification_key_generator_and_server/data/verification_18_key.json new file mode 100644 index 000000000000..0987039dd1fa --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_18_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 8828437332483635107, + 13777915698231175292, + 11504510351588004199, + 2516385517175522236 + ], + "y": [ + 1530453459325046685, + 2126477283125660971, + 6874073688275717548, + 2971751478402184988 + ], + "infinity": false + }, + { + "x": [ + 3490885152333630169, + 4123320877294819459, + 5138828731030738163, + 3039569146695764058 + ], + "y": [ + 10725322881860790776, + 1512262420257872325, + 10563843054743673205, + 447776577449487981 + ], + "infinity": false + }, + { + "x": [ + 14957646468235752771, + 6216555943494703122, + 7827110015048654177, + 2702223139144227095 + ], + "y": [ + 505353369980003046, + 9687811614109626117, + 5346740791392836415, + 1340467989233731971 + ], + "infinity": false + }, + { + "x": [ + 3201028595190213325, + 9659059230246338206, + 901122635500995415, + 765851963674764103 + ], + "y": [ + 10609226610841230792, + 8145519080052709505, + 17851750066177581293, + 362176586681460505 + ], + "infinity": false + }, + { + "x": [ + 13374935211181268625, + 1347742735582506393, + 4588995338963087243, + 94453217016201562 + ], + "y": [ + 4077548225372117006, + 11859845367084549583, + 2736752177668563039, + 1134818940315684409 + ], + "infinity": false + }, + { + "x": [ + 9467178015658262369, + 10545965721679492606, + 5726831550010619228, + 2051827871593168334 + ], + "y": [ + 6169140154733194545, + 5574043976386236933, + 12140759986363309479, + 1521273866181786590 + ], + "infinity": false + }, + { + "x": [ + 9642818207174528085, + 15617465062711953088, + 11263174413902929450, + 639683138088730423 + ], + "y": [ + 15150652293369779803, + 11338278639695990684, + 12204993260723588081, + 2039902155290309382 + ], + "infinity": false + }, + { + "x": [ + 7292405600450693833, + 573142590034645775, + 1583019100043676600, + 1978695840953226358 + ], + "y": [ + 5154489367309996043, + 8763740977657654022, + 9821219773990064941, + 2636875463267519559 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 2075450237700219880, + 2920304484074114568, + 8294843245052708759, + 555293007149161182 + ], + "y": [ + 6360019558055677441, + 7673047654179899818, + 10263007591992092214, + 2148859098846651643 + ], + "infinity": false + }, + { + "x": [ + 3970783323754285443, + 13019363829879217592, + 18197490676081603277, + 630296172623407012 + ], + "y": [ + 7987745494904024640, + 9631048689610078757, + 1592818072678520163, + 2678374240960081558 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 3055966415338102721, + 18231075292903695376, + 9187400351012014001, + 2311743062653684305 + ], + "y": [ + 2553578246375478674, + 930511927228692161, + 2271826946385879571, + 3124263363559878329 + ], + "infinity": false + }, + { + "x": [ + 6936812562216228782, + 15195638439305648290, + 17827467578192758430, + 2674740411261002393 + ], + "y": [ + 9738743088557108685, + 17225541903460577384, + 16627013813461429872, + 494410407050490065 + ], + "infinity": false + }, + { + "x": [ + 10570962909758341245, + 18167360144953681397, + 2744925075742623060, + 736412139310579435 + ], + "y": [ + 13849279071386536985, + 10093748777935480433, + 904764951143479286, + 138814932031469939 + ], + "infinity": false + }, + { + "x": [ + 4533871929444677010, + 10106157783629999301, + 4178648893377901718, + 3164693318611048089 + ], + "y": [ + 12699039702383686311, + 4388078229442418460, + 8961813905523894854, + 570254591975307765 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 18884644, + "lookup_selector_commitment": { + "x": [ + 15022814412717317376, + 17444332185630324119, + 14685665421775887958, + 906494215348891007 + ], + "y": [ + 9833778905776399360, + 1648124311168457783, + 3500435402371619753, + 2370413643071351216 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 8321950609730151216, + 18010887235457883784, + 17038267498493175776, + 1380842840607309871 + ], + "y": [ + 3264160671000273944, + 16611917363401804468, + 8505391859632632917, + 2149881676646664319 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_1_key.json b/core/bin/verification_key_generator_and_server/data/verification_1_key.json new file mode 100644 index 000000000000..0310303d2a53 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_1_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 7601801432079276288, + 15201863322122857773, + 8806193975262404580, + 2590787273683229105 + ], + "y": [ + 16702527967956763728, + 6181870639994435984, + 1867123357108619315, + 2767403024411663364 + ], + "infinity": false + }, + { + "x": [ + 2455316591212726341, + 2027771240685247927, + 10685588854446154162, + 3030775657966372875 + ], + "y": [ + 18300009037843703356, + 1612973442135305251, + 10693350009422283513, + 1442590213691840716 + ], + "infinity": false + }, + { + "x": [ + 12311884457715965312, + 10390638194798557018, + 11306832124741148566, + 300716765354847473 + ], + "y": [ + 9707964220031061231, + 14753080439380196493, + 5717535245627190368, + 702219636062983319 + ], + "infinity": false + }, + { + "x": [ + 7758453297146426337, + 1673770484163252092, + 14607544807007157753, + 857313958429629763 + ], + "y": [ + 14921629410308576937, + 15298335487420996140, + 2704982045392946878, + 2611590721009022852 + ], + "infinity": false + }, + { + "x": [ + 14311011031579784592, + 15625526098906078640, + 1319146597092063841, + 774276845418764858 + ], + "y": [ + 3893523842912943845, + 18146056093503974553, + 11030513442747849089, + 389965813625175232 + ], + "infinity": false + }, + { + "x": [ + 7007915445081129178, + 2401922490835966325, + 418720827124106725, + 2770268368066902308 + ], + "y": [ + 12116308634970006696, + 14528630571959109449, + 9950799281726780069, + 724152027617190422 + ], + "infinity": false + }, + { + "x": [ + 2442021019274420960, + 16295185893380203674, + 2439146651414642189, + 2243335375830582173 + ], + "y": [ + 3782090054162740071, + 4704457281172608987, + 4410900061257118309, + 764611777065564766 + ], + "infinity": false + }, + { + "x": [ + 17964884224938230037, + 7876675311267561320, + 16762398450655445790, + 1210707988542142007 + ], + "y": [ + 10470358785861361347, + 9485656365593190672, + 6046378362748740079, + 2457285875935475197 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 17157526827088368172, + 11284084393440625999, + 9351565798611728109, + 3234841809825307363 + ], + "y": [ + 8319704714678793930, + 4159327153032521498, + 15356346081767327573, + 3239913585027348493 + ], + "infinity": false + }, + { + "x": [ + 15456321646261647359, + 15891438700803416959, + 3317730603133051465, + 2641175705943818316 + ], + "y": [ + 1411951218052246200, + 1661720531643832913, + 13537400120511760371, + 2292851110898807736 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 10328956753700766823, + 2827084848292920926, + 6753362467616392790, + 3266354497443915853 + ], + "y": [ + 4786671171082888838, + 11071539213550223285, + 3886224490311829958, + 1435384580945051012 + ], + "infinity": false + }, + { + "x": [ + 6970901872301032061, + 11845499850875638451, + 12523013241874863158, + 564589203700245768 + ], + "y": [ + 9149991346853645253, + 10833082414663634622, + 10032445307744641248, + 3184550747076826571 + ], + "infinity": false + }, + { + "x": [ + 2899501934612768796, + 7289832407727333580, + 15398305180487198919, + 2955735241334744486 + ], + "y": [ + 4963499698281910643, + 5723522390488208800, + 3637467607919864741, + 339118267031086794 + ], + "infinity": false + }, + { + "x": [ + 16561673014946600686, + 6893642268089467710, + 11554023210615815565, + 122477375056362239 + ], + "y": [ + 15978560303000591303, + 6087766803442805629, + 6114779478264008006, + 2753348573959524636 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 30899639, + "lookup_selector_commitment": { + "x": [ + 4819118611809066421, + 16205075690681881406, + 8088108199972047891, + 2462381205202312681 + ], + "y": [ + 9403235417076804812, + 11746452954984920263, + 5479393366572364588, + 2168476120537571525 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 1589280911861251894, + 2000192568988587993, + 18399902493387281635, + 1843483375839232315 + ], + "y": [ + 14712825033319581746, + 11500494123399487569, + 4370642671010258701, + 567620704393396341 + ], + "infinity": false + }, + { + "x": [ + 0, + 0, + 0, + 0 + ], + "y": [ + 1, + 0, + 0, + 0 + ], + "infinity": true + }, + { + "x": [ + 0, + 0, + 0, + 0 + ], + "y": [ + 1, + 0, + 0, + 0 + ], + "infinity": true + }, + { + "x": [ + 5989740765536181742, + 7510673671757970234, + 7988398980529338112, + 2047433943537325290 + ], + "y": [ + 14952889876146512965, + 17141012675484923048, + 328206788961236528, + 866564802795139 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 4824978155651454377, + 12191454623887257586, + 12973919510878979890, + 52932438992466171 + ], + "y": [ + 17857145998747603901, + 2092039184434926372, + 11018504664231591204, + 1321736242331612854 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_2_key.json b/core/bin/verification_key_generator_and_server/data/verification_2_key.json new file mode 100644 index 000000000000..79b16257213f --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_2_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 5518783475412319303, + 13900056820557691891, + 3293972357974626054, + 2215936931279678502 + ], + "y": [ + 7955917949806788616, + 13341003959544330056, + 2090626280536970058, + 340565138339520735 + ], + "infinity": false + }, + { + "x": [ + 14185170917510557830, + 8046892618400404954, + 16599645397148333553, + 2994187418830549588 + ], + "y": [ + 7234254448777026502, + 8445782435526889669, + 14116370103157060862, + 2248206929083565209 + ], + "infinity": false + }, + { + "x": [ + 11154659552703848544, + 12941656139895069323, + 17062140236305086427, + 722110816848028084 + ], + "y": [ + 5009717036998782771, + 827592822749515890, + 15966856850732642654, + 618036931564479654 + ], + "infinity": false + }, + { + "x": [ + 5157594213696692987, + 15014090155482426422, + 706425002062263449, + 3203486979181293219 + ], + "y": [ + 14363949081622225749, + 9001876918808042476, + 1615414451418136701, + 444697301726425121 + ], + "infinity": false + }, + { + "x": [ + 9176460251336839321, + 17295305184785757140, + 7831134341003191604, + 2666806971657364559 + ], + "y": [ + 2598277252699259004, + 11916936738177575234, + 2912317122505195338, + 2404138220482962548 + ], + "infinity": false + }, + { + "x": [ + 11575910134534349159, + 14192914809594698195, + 18267718409201448839, + 142641722814285206 + ], + "y": [ + 5883506329268908990, + 2832339585209792351, + 14642260147093833347, + 392817691249359885 + ], + "infinity": false + }, + { + "x": [ + 12908012748245269010, + 6525727331816152736, + 16979431824428028279, + 2845131870310951239 + ], + "y": [ + 1571963770034876851, + 17602700402136611105, + 13310928253737079884, + 3347891464097055062 + ], + "infinity": false + }, + { + "x": [ + 832167803175150309, + 11457734167413059640, + 13250442890410377059, + 2814079984479722654 + ], + "y": [ + 1463471541691279258, + 1744973157713476297, + 1204969522442685286, + 1269233371856967282 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 10352656458395970023, + 3995520406692994966, + 13084432248093257522, + 2302839365715839904 + ], + "y": [ + 8225034751786073151, + 16771047952615636124, + 616708265068224682, + 186403683175385821 + ], + "infinity": false + }, + { + "x": [ + 4270731028924703792, + 3128341040439802084, + 15083522049785140229, + 2261189689222904761 + ], + "y": [ + 8781157350107493893, + 14766318733918494793, + 9428422381369337621, + 419743052593117743 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 11112968480130414212, + 11913364106966677596, + 36671493864905181, + 496058283903160224 + ], + "y": [ + 9691136012048916590, + 12909186572206021308, + 1700657689434945171, + 3072265811815532764 + ], + "infinity": false + }, + { + "x": [ + 11360744654540534278, + 9830357778413675465, + 5192069313646589173, + 113131628631742646 + ], + "y": [ + 5515513518975242303, + 323890392099446701, + 2255482865429449468, + 2322464724330067577 + ], + "infinity": false + }, + { + "x": [ + 3414259545645111239, + 5416149397109634837, + 12993204506510556426, + 2894091844446687144 + ], + "y": [ + 4731949297479191167, + 1043460441127916951, + 16890401788673829290, + 1356564712828723527 + ], + "infinity": false + }, + { + "x": [ + 8993182433738017869, + 11441314659459910136, + 8181494681500166120, + 1591321336872387140 + ], + "y": [ + 5278254820002084488, + 17932571960593236295, + 7626453034762681225, + 3463596506399756742 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 30783671, + "lookup_selector_commitment": { + "x": [ + 1336161834228740427, + 15823221750660268452, + 13689567356831376139, + 1839611883700311389 + ], + "y": [ + 14875759795137726191, + 20318096045504920, + 8816565555629805366, + 75556627728969178 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 1589280911861251894, + 2000192568988587993, + 18399902493387281635, + 1843483375839232315 + ], + "y": [ + 14712825033319581746, + 11500494123399487569, + 4370642671010258701, + 567620704393396341 + ], + "infinity": false + }, + { + "x": [ + 0, + 0, + 0, + 0 + ], + "y": [ + 1, + 0, + 0, + 0 + ], + "infinity": true + }, + { + "x": [ + 0, + 0, + 0, + 0 + ], + "y": [ + 1, + 0, + 0, + 0 + ], + "infinity": true + }, + { + "x": [ + 5989740765536181742, + 7510673671757970234, + 7988398980529338112, + 2047433943537325290 + ], + "y": [ + 14952889876146512965, + 17141012675484923048, + 328206788961236528, + 866564802795139 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 3408213281770836085, + 15382444791373914560, + 16110552627056571461, + 1161688479331593061 + ], + "y": [ + 13379188756114722390, + 12926267823879081751, + 14282599792449107495, + 3244837013658545871 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_3_key.json b/core/bin/verification_key_generator_and_server/data/verification_3_key.json new file mode 100644 index 000000000000..613c65dec32a --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_3_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 4247884029119603815, + 14048318895702359089, + 1617022869923646571, + 1004300266779052296 + ], + "y": [ + 17868528514201987465, + 4244261302597587354, + 10221573892940475912, + 2482382880446840010 + ], + "infinity": false + }, + { + "x": [ + 6238506840459074871, + 18254983327500098151, + 12976360180164130634, + 1219856697105853614 + ], + "y": [ + 1359994609126438238, + 17827470346804056210, + 16773833510918183872, + 2604619773311417557 + ], + "infinity": false + }, + { + "x": [ + 5480908979724966765, + 3393255975447524652, + 10371160681199271551, + 3483125449532424455 + ], + "y": [ + 6910224697959110691, + 8190986918875328214, + 18233342390114194740, + 371038657258361111 + ], + "infinity": false + }, + { + "x": [ + 1589636458242554884, + 17321835409586313003, + 13993520794641679178, + 1266542986497561712 + ], + "y": [ + 5397891169353072140, + 5878548729835574296, + 15706893227817678651, + 1769961527856953483 + ], + "infinity": false + }, + { + "x": [ + 17541435070606794744, + 2655627213950653916, + 11216216944579921605, + 1313780180047509779 + ], + "y": [ + 16950319453735037870, + 1632204383055288188, + 15201163922365522932, + 2864472556240937346 + ], + "infinity": false + }, + { + "x": [ + 11997977223945303553, + 14325590013978700522, + 15557533141347230729, + 3289139360100222484 + ], + "y": [ + 2276406350677881932, + 12276125258173429823, + 6135372778488654786, + 2960027660870022236 + ], + "infinity": false + }, + { + "x": [ + 8889079782908651911, + 9444258938063781000, + 6152157289837951831, + 2046144251434758098 + ], + "y": [ + 3506685845878604982, + 480610274681523215, + 17898829927408725055, + 478373452366390807 + ], + "infinity": false + }, + { + "x": [ + 9543795530837745598, + 5641706788025454992, + 2058665597673045347, + 3199980849578540913 + ], + "y": [ + 2134420461745303677, + 11079036403297001210, + 13973590059437528369, + 2236186172656440899 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 17082763384512425754, + 5415974525679408765, + 2982831717715582652, + 2185533346241584143 + ], + "y": [ + 889517497459248510, + 11305258809453581163, + 14785916458686019285, + 712045239932611417 + ], + "infinity": false + }, + { + "x": [ + 1486326951928055275, + 17648143945822975405, + 8789056175543467342, + 1582641302957127155 + ], + "y": [ + 16130216435506275947, + 186882025793811656, + 5333388052689527168, + 2555185016165074595 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 6775436174991417687, + 1962133343483010121, + 3639644700285584252, + 2751431324201714590 + ], + "y": [ + 16721581791017871189, + 2572212631009994187, + 12263629829130796245, + 1194783809693078725 + ], + "infinity": false + }, + { + "x": [ + 9781583375044732502, + 17099127122236789849, + 15683598159868779227, + 2137916464125382410 + ], + "y": [ + 11971077938028623721, + 14460546631248863771, + 3674726360546135290, + 2587006282919627488 + ], + "infinity": false + }, + { + "x": [ + 2258960665841769264, + 11476106728738999555, + 2154715457718708453, + 1652460267728538717 + ], + "y": [ + 591013691648424928, + 2747643213972148016, + 4382285331965077793, + 700518369290275435 + ], + "infinity": false + }, + { + "x": [ + 17029386353507514799, + 12736838109975824615, + 17948233540620781856, + 1661567367117856229 + ], + "y": [ + 5088293739561490025, + 257269786506894093, + 7029871828271960168, + 2982592857123453815 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 15390957, + "lookup_selector_commitment": { + "x": [ + 3143229288506876352, + 14398478555351850494, + 17971061391349533728, + 2397240458539623423 + ], + "y": [ + 2507720097747632492, + 4897824016944146490, + 8535810669426357324, + 2617442440174156771 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 12925597216490182210, + 13030942092034120135, + 17733316148446765999, + 112547709703624791 + ], + "y": [ + 13293415162200038331, + 13010565234555563811, + 15476251035925496743, + 2588541998389664114 + ], + "infinity": false + }, + { + "x": [ + 11118240121224901946, + 9394562257959111170, + 9026436993514314918, + 1751747619588842429 + ], + "y": [ + 6039590802345873394, + 17531716309156986038, + 1711770599161550805, + 1941094644175870288 + ], + "infinity": false + }, + { + "x": [ + 17999903301086933877, + 10468070608989378923, + 3479353092436121335, + 607756992244480908 + ], + "y": [ + 10863079642303790364, + 4737012301447477097, + 4605789209164294308, + 1430572887755557386 + ], + "infinity": false + }, + { + "x": [ + 4609762018249049814, + 4113097757442144437, + 4725434011535510809, + 2977599521231955696 + ], + "y": [ + 14636094180551257630, + 8819447661702130886, + 1091706295519429215, + 56675985696303183 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 7406705046881629689, + 13550366909312172285, + 11707241152492715411, + 1951231993396003315 + ], + "y": [ + 649840467305243342, + 10916062129580101841, + 7643158916474300887, + 1216418901317802861 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_4_key.json b/core/bin/verification_key_generator_and_server/data/verification_4_key.json new file mode 100644 index 000000000000..8d42dcd66a75 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_4_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 15923176050075197, + 8963905519117333456, + 5333091548039957996, + 1660697180439834807 + ], + "y": [ + 13105864494044341635, + 10079874572012628853, + 4164109084931753781, + 1860950003357484648 + ], + "infinity": false + }, + { + "x": [ + 8216018177730810417, + 13660800917029254431, + 2933384097067755755, + 2823425599268575868 + ], + "y": [ + 8768863192718196559, + 10146282684570870426, + 8275806247588563419, + 605489936306033583 + ], + "infinity": false + }, + { + "x": [ + 4277344855257545209, + 11172040917478096607, + 4489086903928758598, + 289283798032159440 + ], + "y": [ + 10444137083253378550, + 12133212848977612596, + 6748791972701343485, + 286274227999569844 + ], + "infinity": false + }, + { + "x": [ + 8861797510071553254, + 12734094237204882518, + 13692967202881086499, + 641906135411222522 + ], + "y": [ + 6831762763487302461, + 11965405347371646114, + 6218256502970252800, + 3201462388136754725 + ], + "infinity": false + }, + { + "x": [ + 12385743015818134054, + 16282219738575446638, + 3256359841301423419, + 505673042938576760 + ], + "y": [ + 6744956686738207932, + 8994291190634790001, + 16789606231722015883, + 2027930268272962928 + ], + "infinity": false + }, + { + "x": [ + 13671822069226357541, + 818021157447551159, + 10542481209144358852, + 2459295197762128786 + ], + "y": [ + 1072649761929447549, + 6089126583512618706, + 1178131210084507361, + 1066836948212725576 + ], + "infinity": false + }, + { + "x": [ + 16878956366815094090, + 364977461173568122, + 5439594588743996145, + 1265442855735725449 + ], + "y": [ + 11461704536083653156, + 660278441271820299, + 4314245569905306892, + 1438663846765259508 + ], + "infinity": false + }, + { + "x": [ + 9038539654045396650, + 539827912679485452, + 15399544523862100757, + 1256406598444490417 + ], + "y": [ + 5422113905848106255, + 4943961807853536385, + 10022409325033689104, + 3200702511424842211 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 7750990741566547331, + 12040155777441846781, + 3000981333322867315, + 2393292192734976436 + ], + "y": [ + 3394853839941291504, + 944019051205640111, + 1104911864338577098, + 2127308956089601096 + ], + "infinity": false + }, + { + "x": [ + 4735140124663926465, + 16935779121597983173, + 17111626619540374574, + 2327973550601526140 + ], + "y": [ + 8990848735371189388, + 4589751206662798166, + 7575424772436241307, + 2798852347400154642 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 4765077060699177749, + 15235935045874519477, + 2022237788491579392, + 354385727984957703 + ], + "y": [ + 11620113321350620961, + 2521830680983779826, + 14047226057605943635, + 2718701882953208503 + ], + "infinity": false + }, + { + "x": [ + 12967015398643083015, + 1100660813730542482, + 7835181433213557652, + 803165211156388599 + ], + "y": [ + 8557385569712401227, + 535900682745452035, + 16083571717847325979, + 396765644246918860 + ], + "infinity": false + }, + { + "x": [ + 6868107733370365435, + 17106601841261210672, + 12219407605084986215, + 2345246684976405066 + ], + "y": [ + 17532412968783851743, + 9996315626158111485, + 17970945522106166231, + 1003764081419207606 + ], + "infinity": false + }, + { + "x": [ + 7011201477832405407, + 8818123127103997131, + 2979445003396953339, + 318603240233076406 + ], + "y": [ + 11712108043964996282, + 3474989587891133574, + 3983451673298542860, + 1181581919257021598 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 8484642, + "lookup_selector_commitment": { + "x": [ + 27459247093738343, + 1785927757103538268, + 14972116880195568621, + 1034224917068963325 + ], + "y": [ + 17453858127001596558, + 6200103235089742197, + 16245568162666829501, + 651193715230511441 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 697552212563769686, + 7709943502535418760, + 15019345407325619175, + 3433081085078580257 + ], + "y": [ + 8668947019840357731, + 14698901351824712883, + 15088598879190660424, + 2873081208166433946 + ], + "infinity": false + }, + { + "x": [ + 7893133928909060673, + 7064922516930129957, + 3592836702741304814, + 2239702595710114437 + ], + "y": [ + 7691360541875191519, + 11379321785127235277, + 6653616064071569031, + 2555434628517540774 + ], + "infinity": false + }, + { + "x": [ + 6243944238013052821, + 7908243182210136125, + 17178099109525791299, + 2553622184721264566 + ], + "y": [ + 736121280088239428, + 6158073429758170526, + 11217302997977204117, + 2594798912020899417 + ], + "infinity": false + }, + { + "x": [ + 2064240298596094591, + 16917726764104887991, + 11042784977532408536, + 3377647228930170830 + ], + "y": [ + 10635525052494768819, + 387400048616497096, + 9379200582543310995, + 1571766153703296253 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 14868101692362122308, + 8135288013508071846, + 9460482611527381887, + 512823635961282598 + ], + "y": [ + 8358211286664762188, + 3532634521932288534, + 5862145521507736138, + 1807935137626658536 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_5_key.json b/core/bin/verification_key_generator_and_server/data/verification_5_key.json new file mode 100644 index 000000000000..b9a31b919f1c --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_5_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 12322129650547620518, + 4320033807979823995, + 4503809593276792861, + 630958448551597950 + ], + "y": [ + 4947307957322067889, + 1897773243457379956, + 1563584362302565484, + 802109862761172056 + ], + "infinity": false + }, + { + "x": [ + 5860641327684713918, + 16885915425353665713, + 7037370194263044401, + 1837438863045303696 + ], + "y": [ + 13386292219804271609, + 4960073609197619993, + 7328379249582994262, + 191728769121948464 + ], + "infinity": false + }, + { + "x": [ + 9390502900121613993, + 17218409610830310329, + 4830832371938391322, + 1805131323553685028 + ], + "y": [ + 15707040961083920686, + 16216062707384374953, + 16957058843586642758, + 1341814870249072628 + ], + "infinity": false + }, + { + "x": [ + 969252611989285232, + 181405773082212747, + 11110666465356509832, + 1888802363524687207 + ], + "y": [ + 5293477339288357424, + 12076391347720360980, + 11422893229655154394, + 3165450734777404812 + ], + "infinity": false + }, + { + "x": [ + 642192487369089358, + 9585449571929647331, + 3847960352134961209, + 984199510163128792 + ], + "y": [ + 13950390676065893881, + 975256099594703300, + 253120832016214204, + 1860679841584192219 + ], + "infinity": false + }, + { + "x": [ + 3564548447861991296, + 6278944799487206913, + 1163701992635366786, + 3214877162977671335 + ], + "y": [ + 13131873482361140204, + 14012120801722220187, + 13254371011592477950, + 1082108070640175604 + ], + "infinity": false + }, + { + "x": [ + 14190764189814537607, + 18412181832598818289, + 17213387738194113336, + 1662783623959823461 + ], + "y": [ + 7987199081435644988, + 17119136750046780209, + 8770669323846078492, + 3183489396270587333 + ], + "infinity": false + }, + { + "x": [ + 14638218826597535389, + 16409988612234258347, + 5025411344133541245, + 603088654230685360 + ], + "y": [ + 12538363432956258836, + 6558875956959901550, + 2415879426147965883, + 750702584304895055 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 2599908293582905760, + 13534206398743622493, + 15926090086034346074, + 467418127379229858 + ], + "y": [ + 9529512934078774185, + 1459270552041127965, + 13418846370362665102, + 2270996612016337371 + ], + "infinity": false + }, + { + "x": [ + 7264275706530137047, + 5590205367072257545, + 17891440127697345143, + 360638857846382524 + ], + "y": [ + 17983779934218975397, + 1625779403076670241, + 1474025795387210129, + 1716171421120825643 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 9354841115000244260, + 12887310615208346489, + 1120617137774653400, + 424227936372254439 + ], + "y": [ + 3626714025954019309, + 4480975902927818206, + 10093567956580931634, + 2779897825000836477 + ], + "infinity": false + }, + { + "x": [ + 1864884782104066211, + 1247154271168453374, + 9982166936353409582, + 1177339527115773898 + ], + "y": [ + 9932597332303163060, + 1888682277213109000, + 11684220277443154622, + 3062389133489783806 + ], + "infinity": false + }, + { + "x": [ + 9943021177878836437, + 9004866876172522532, + 14085451328492136137, + 1567186274425392936 + ], + "y": [ + 7148906168793986389, + 4780330524752436486, + 10067456648871712650, + 179752856567560382 + ], + "infinity": false + }, + { + "x": [ + 14745822832390509907, + 13862030626549782961, + 10000268356302875837, + 705042314567833799 + ], + "y": [ + 11091254259539384938, + 11733968109785394056, + 11099103738494585500, + 1527456782567955191 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 35330543, + "lookup_selector_commitment": { + "x": [ + 12333191731462980214, + 17841370099698959347, + 12878670991018181621, + 2894319630687016858 + ], + "y": [ + 76816727314643395, + 3214684791046221459, + 878301108738499830, + 126016925902987736 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 911668445361375614, + 12752365066512000136, + 11550232015863976467, + 2053619216798992367 + ], + "y": [ + 4194339833917391280, + 1643071887467668153, + 3377480965202592691, + 1664272901450533719 + ], + "infinity": false + }, + { + "x": [ + 2999316735203966181, + 5189676006781764591, + 14324679313847304783, + 1264086978509739587 + ], + "y": [ + 8714172036038650967, + 10907167170124829028, + 8950970593162102458, + 1596853051185997037 + ], + "infinity": false + }, + { + "x": [ + 1146500486770850326, + 13562754408872334896, + 14063471769392190265, + 3387351506820193517 + ], + "y": [ + 6677788829230735422, + 15425668102208730571, + 5341291772716012975, + 539156410041791428 + ], + "infinity": false + }, + { + "x": [ + 18159886519320172405, + 4286826840324377773, + 16364826089434525345, + 228697666397725767 + ], + "y": [ + 4850633487261444791, + 6327421534074497160, + 12883776034588695446, + 1510314148471267214 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 18245233954308230592, + 8193493714287610439, + 6521078295132558240, + 861511081336275611 + ], + "y": [ + 4275834222266292944, + 13179071278128968874, + 5943013356852335765, + 2456639561657053045 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_6_key.json b/core/bin/verification_key_generator_and_server/data/verification_6_key.json new file mode 100644 index 000000000000..34419df17702 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_6_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 11033020679838791108, + 14920056278440370765, + 8156477685651219112, + 2935096142913695825 + ], + "y": [ + 12780055516709256833, + 966513406268819160, + 9584266886886532866, + 892347068344972829 + ], + "infinity": false + }, + { + "x": [ + 4044870432040348042, + 10630300946926732771, + 3143480015080245177, + 323917785885883620 + ], + "y": [ + 2297905282612888789, + 8206728682979815807, + 10628767928228215441, + 3062326525278498604 + ], + "infinity": false + }, + { + "x": [ + 14760731158538087565, + 9176522400170689419, + 9855180338242634009, + 2456568616568530201 + ], + "y": [ + 5168103953295979961, + 397013651969935557, + 13864468728668213717, + 2925074735515169158 + ], + "infinity": false + }, + { + "x": [ + 13613691592548742743, + 11339389230513898784, + 4864282628000142183, + 2568915564796772962 + ], + "y": [ + 13074021698952750513, + 14891339562597317806, + 6145754680491802845, + 913243322463864468 + ], + "infinity": false + }, + { + "x": [ + 9607983563343027008, + 1604609357347728263, + 6735137627175405143, + 91305611485454778 + ], + "y": [ + 2068449139446365265, + 6171753015906067998, + 16290186276604645197, + 420889087081901603 + ], + "infinity": false + }, + { + "x": [ + 15994614598808477960, + 5137738490508028659, + 6599503545391493738, + 3293094250487745346 + ], + "y": [ + 3246688300070721763, + 8836841286539929132, + 1231014124908407748, + 3042941126579517307 + ], + "infinity": false + }, + { + "x": [ + 12550390789117808745, + 14001030013656521177, + 16383284077678821701, + 1815317458772356897 + ], + "y": [ + 10125044837604978181, + 7468984969058409331, + 592554137766258541, + 2877688586321491725 + ], + "infinity": false + }, + { + "x": [ + 12238091769471133989, + 184716847866634800, + 5888077423956723698, + 609118759536864800 + ], + "y": [ + 7725369615076384544, + 7561073323636510559, + 10473734750023783127, + 861766554781597742 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 1206127807467530207, + 3510053718168412786, + 7933459343694333819, + 3179950874373950282 + ], + "y": [ + 5784856107466398982, + 395767970566909293, + 11244200096534021583, + 2068407511544404377 + ], + "infinity": false + }, + { + "x": [ + 4044617248058764838, + 11957266999135308674, + 17621747993137866783, + 990156155955733134 + ], + "y": [ + 17234504892477991728, + 17558826298225495489, + 9349531438753716103, + 2656409262947709594 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 4308597000331285311, + 12130199317436319902, + 3842336010209461436, + 191866453597778475 + ], + "y": [ + 2144400171783010971, + 13016087318985913183, + 7166370365336301922, + 2216888390030560212 + ], + "infinity": false + }, + { + "x": [ + 4661184458541745063, + 12423889401726065791, + 11959346001895915074, + 779668716585305501 + ], + "y": [ + 16401363790535442499, + 7367694133722005848, + 8015837005184593399, + 454166987511489961 + ], + "infinity": false + }, + { + "x": [ + 858215262803403659, + 1405268530667707386, + 7763962169005921611, + 2845435536097215865 + ], + "y": [ + 10639490331338262540, + 6397733211512468794, + 968161689973799899, + 2054756257253905633 + ], + "infinity": false + }, + { + "x": [ + 17338818659525246480, + 13318488425310212471, + 10548319374858973842, + 87084958643052105 + ], + "y": [ + 2279840344577984658, + 15197280761751903251, + 16019225334594459873, + 149925650787595538 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 3054916, + "lookup_selector_commitment": { + "x": [ + 4844230422625825285, + 956290027823441223, + 763010695794739308, + 2426170829255106638 + ], + "y": [ + 13850520521470006763, + 9003994589054655373, + 10310690204425503422, + 3012516431885755457 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 5825422128268478267, + 9219263846299851036, + 3879231702557190566, + 1702488722758880769 + ], + "y": [ + 18311881100262470992, + 5742998199368802392, + 18106865487471159417, + 502191980176920012 + ], + "infinity": false + }, + { + "x": [ + 17195892082859417081, + 7890531942603584793, + 2381805632820057528, + 3173232410464566465 + ], + "y": [ + 16359614627947132075, + 3459600273035137079, + 4550762061432972122, + 3394559699318358224 + ], + "infinity": false + }, + { + "x": [ + 1716103379277390185, + 18097936269579187542, + 16357329729761063450, + 1508640059338197502 + ], + "y": [ + 11014806739603983364, + 4396503314588777389, + 9397245609635151055, + 1703957955248411380 + ], + "infinity": false + }, + { + "x": [ + 4770171350693477354, + 17110558673192292253, + 9799800677557311408, + 761984875463445481 + ], + "y": [ + 1560561403388310063, + 31331275310848146, + 287152055803835484, + 457826332542037277 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 16775586915653722908, + 9787338077086882544, + 8381721730521821042, + 2974660093975661578 + ], + "y": [ + 3011389235487891234, + 15409507493813096391, + 17416460976276029026, + 324418288749844627 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_7_key.json b/core/bin/verification_key_generator_and_server/data/verification_7_key.json new file mode 100644 index 000000000000..406afcf4f0fe --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_7_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 14104278525941001335, + 6652111379088654370, + 12369045377338511525, + 969809670184836151 + ], + "y": [ + 10111598525423302991, + 15018239425425696172, + 3683372413830991953, + 1023765059890131543 + ], + "infinity": false + }, + { + "x": [ + 11576486884237685781, + 16315823052257401029, + 9860864515877414033, + 3179959598270002012 + ], + "y": [ + 487035971539979311, + 5573003039451484772, + 15711637819381564577, + 1904127920269177012 + ], + "infinity": false + }, + { + "x": [ + 18299921128106602792, + 211731469708793711, + 17645028854462121436, + 675870769139913517 + ], + "y": [ + 15146647508675165454, + 18353083579110652488, + 12704645658780892142, + 2929235299763077823 + ], + "infinity": false + }, + { + "x": [ + 11570586127780196277, + 2363872676317471379, + 7386811009552915084, + 959006902628416514 + ], + "y": [ + 17455735716787098890, + 14879699386306994564, + 5628100821420984321, + 2862659911936763739 + ], + "infinity": false + }, + { + "x": [ + 8746328571248006135, + 17089435014355939378, + 8764506524471462449, + 1810135458362589443 + ], + "y": [ + 14070512019208911265, + 8756287737315170424, + 14821473955626613, + 1559545289765661890 + ], + "infinity": false + }, + { + "x": [ + 2113591086436573082, + 12629483649401688389, + 11845953673798951216, + 3081238281103628853 + ], + "y": [ + 727696133406005469, + 14413827745813557208, + 6425035421156126073, + 291513487083052109 + ], + "infinity": false + }, + { + "x": [ + 15346257923988607256, + 10403316660718504706, + 7158515894996917286, + 2702098910103276762 + ], + "y": [ + 16559143492878738107, + 12716298061927369795, + 12296985344891017351, + 2814996798832983835 + ], + "infinity": false + }, + { + "x": [ + 2213195001372039295, + 8878300942582564036, + 10524986226191936528, + 1815326540993196034 + ], + "y": [ + 11397120982692424098, + 4455537142488107627, + 14205354993332845055, + 2313809587433567240 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 14849046431510808003, + 11699893139960418168, + 6000246307731364190, + 3362832011707902866 + ], + "y": [ + 3242560497217933852, + 11672398501106836413, + 987926723326096281, + 2451226739475091625 + ], + "infinity": false + }, + { + "x": [ + 9272095445402359796, + 1201046264826394411, + 7424934554242366462, + 1125893484262333608 + ], + "y": [ + 15903920299684884420, + 17703294385387204708, + 2256937129195345942, + 1905295733884217610 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 7591926766688292250, + 10457199375342460747, + 3214976192729961314, + 1412860682249358355 + ], + "y": [ + 16894260140402496006, + 3666374878391815131, + 15124268261678582348, + 1340579262756129480 + ], + "infinity": false + }, + { + "x": [ + 2963934507934439034, + 17415763666461861018, + 6331792462137338053, + 3122358526111186727 + ], + "y": [ + 15040784043381591388, + 7188410244350767315, + 14077554108063383431, + 1704329843327300001 + ], + "infinity": false + }, + { + "x": [ + 7967507884960122293, + 13509230570773443525, + 11125712791473385552, + 2241808950326876268 + ], + "y": [ + 10594180941877323940, + 17179032413109513856, + 17941607623778808075, + 646138820984886096 + ], + "infinity": false + }, + { + "x": [ + 4729534828155895283, + 15489050734511381239, + 4847364931161261393, + 2461584260035042491 + ], + "y": [ + 15255817542606978857, + 6517429187947361297, + 17127878630247240853, + 3389541567226838859 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 40724289, + "lookup_selector_commitment": { + "x": [ + 5449769839889646584, + 2072406321611922291, + 9391796773218391195, + 2377769168011090955 + ], + "y": [ + 1789189431152658324, + 2639430755172378798, + 136577695530283091, + 3045539535973502646 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 12639039925867405095, + 9606685454938605275, + 7802675863289639223, + 1948831418843225802 + ], + "y": [ + 11059150608777595761, + 10458812733010634961, + 16772660325487078311, + 340608886692078192 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_8_key.json b/core/bin/verification_key_generator_and_server/data/verification_8_key.json new file mode 100644 index 000000000000..b8511e17b755 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_8_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 1834112096176967541, + 5137529514715617427, + 6540843391881340212, + 3033401888759110412 + ], + "y": [ + 8910602970094475216, + 13169513767982514776, + 5761530093694221441, + 2733318557350866268 + ], + "infinity": false + }, + { + "x": [ + 4701064149158432365, + 5425087325981406309, + 7911131985858828309, + 1683257627049186617 + ], + "y": [ + 13565328904521460918, + 17013189171844282257, + 4897087111183007258, + 2345861178674095559 + ], + "infinity": false + }, + { + "x": [ + 17285353863442654170, + 17787410547699779811, + 4803131526909484890, + 1607731426619418092 + ], + "y": [ + 3219378920021652314, + 11046862703797106703, + 10595836629242151972, + 2970963661532337787 + ], + "infinity": false + }, + { + "x": [ + 6619857367954187649, + 8023974497004524989, + 10088058961892288757, + 938018804109053807 + ], + "y": [ + 15549411064757453720, + 1776820811429478220, + 8222111141823917842, + 290593315633281086 + ], + "infinity": false + }, + { + "x": [ + 3338931670632164423, + 11330459786926502111, + 13560408114559586439, + 233279858410037466 + ], + "y": [ + 9757980615881472290, + 6475296714459436577, + 15954545788543926629, + 2522580407814024231 + ], + "infinity": false + }, + { + "x": [ + 2168501453409628158, + 16417992951888116942, + 1994813140597965849, + 1938552030580060698 + ], + "y": [ + 2393885012813093493, + 5109365147685051030, + 4449898145078443978, + 996506294158321126 + ], + "infinity": false + }, + { + "x": [ + 8163446935422765754, + 17127634458571165785, + 18101155318188210010, + 1502677094108070955 + ], + "y": [ + 4184320355428455210, + 15479528531137595907, + 8455846016430686855, + 2570922865513301289 + ], + "infinity": false + }, + { + "x": [ + 407579941387952352, + 17088458915370169940, + 16892753644011369852, + 2421666516533613805 + ], + "y": [ + 597435837737447683, + 18122233368438707442, + 4844832744563923839, + 396103093107107006 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 16242434178832819081, + 2218928756172422054, + 5871927983870638422, + 810020555846721779 + ], + "y": [ + 9387856576677982883, + 5119490172321159350, + 14295435318421985120, + 1325809191818871673 + ], + "infinity": false + }, + { + "x": [ + 5933965238687071287, + 10681704800081225943, + 14555731010498897395, + 959799154476325145 + ], + "y": [ + 1501632601560034962, + 9401704677918783964, + 12292111854761501889, + 858616662661742045 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 12841507457971520539, + 6525486152471484441, + 3744486588589217686, + 2769451038405535407 + ], + "y": [ + 14145668232228974364, + 9864097401535863500, + 12665512227995054273, + 1710776254334161256 + ], + "infinity": false + }, + { + "x": [ + 12108157388466567796, + 12008825937320240484, + 11228446795405478904, + 1520424921904150640 + ], + "y": [ + 18157047055378899649, + 10836823561088895074, + 583613418617515639, + 2570085764232471205 + ], + "infinity": false + }, + { + "x": [ + 3117226099128838157, + 10181632193024509490, + 1215328570209780930, + 1536961491401844084 + ], + "y": [ + 11646905141441654681, + 6168936708987385450, + 14459621573162108487, + 2047975568887748173 + ], + "infinity": false + }, + { + "x": [ + 12034664246790330785, + 12032082546920592595, + 12002839514296456095, + 3009479689157977152 + ], + "y": [ + 180421277197569955, + 5815678523367268562, + 11718416396488597085, + 408186057258055191 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 34384753, + "lookup_selector_commitment": { + "x": [ + 3872970821419373956, + 13556503327407661223, + 12832313376327677595, + 211677646774476601 + ], + "y": [ + 17281673428499585093, + 235933066531227024, + 17890327653152417391, + 2551853991532334733 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 14943975734974680929, + 9516136771242606543, + 6695719565456036638, + 3449077049666620393 + ], + "y": [ + 11678209093898264827, + 4499447145490933412, + 6317798459829178953, + 1439219764789809864 + ], + "infinity": false + }, + { + "x": [ + 13501290183905491407, + 17914451638435951710, + 5188762915201956497, + 1220375585898114161 + ], + "y": [ + 14519533874806433487, + 409100046306023, + 2203176115240501563, + 3105700623762337563 + ], + "infinity": false + }, + { + "x": [ + 13968159480895722732, + 6973568812120893251, + 6250254745096478587, + 2299355969860561070 + ], + "y": [ + 7695944005480078577, + 12009671787784557856, + 13727042561077817002, + 219052945806305675 + ], + "infinity": false + }, + { + "x": [ + 4871629130106420314, + 4091595855728790015, + 1851744390500340594, + 3123168382710331270 + ], + "y": [ + 9703969956757970162, + 1215036492891076659, + 11876727836856213678, + 2640893636590396388 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 10299044894603982393, + 4664166516779563250, + 13124827128688646542, + 3361599897730972314 + ], + "y": [ + 18259946931458798404, + 10145479316480429602, + 15446978899103328376, + 265382288883021070 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/data/verification_9_key.json b/core/bin/verification_key_generator_and_server/data/verification_9_key.json new file mode 100644 index 000000000000..75de5f75c78d --- /dev/null +++ b/core/bin/verification_key_generator_and_server/data/verification_9_key.json @@ -0,0 +1,399 @@ +{ + "n": 67108863, + "num_inputs": 1, + "state_width": 4, + "num_witness_polys": 0, + "gate_setup_commitments": [ + { + "x": [ + 15041888416700822899, + 15908701850433687369, + 6928173929840686173, + 501601364708497325 + ], + "y": [ + 9443860646360881208, + 15174745959183347299, + 3341918218952258763, + 1470216750942469587 + ], + "infinity": false + }, + { + "x": [ + 1713492202424532619, + 5921868784153327820, + 3919870428680620477, + 2459274846398943915 + ], + "y": [ + 8012717129874416534, + 13032363221581987781, + 9462161206147300944, + 1151760065513271967 + ], + "infinity": false + }, + { + "x": [ + 6636128327108235840, + 9362733145474272574, + 7779132015244601843, + 474802631021936400 + ], + "y": [ + 3900992471196218787, + 113851245079995197, + 7493904056590361535, + 3140468871801097229 + ], + "infinity": false + }, + { + "x": [ + 4340102674797800902, + 8715432707094353745, + 4331145745081713603, + 45456583984841487 + ], + "y": [ + 18326546742044058782, + 15443239165658185296, + 9765917874876721196, + 687859761729374839 + ], + "infinity": false + }, + { + "x": [ + 10804694580890857975, + 10550068287306981825, + 14956274043654722561, + 3060589920124935341 + ], + "y": [ + 17010223672048359580, + 263749806111642373, + 8349695975133446526, + 2826070525773268002 + ], + "infinity": false + }, + { + "x": [ + 16133249269780245267, + 4275571784340824698, + 6262619645627758753, + 3231281899173719188 + ], + "y": [ + 11839616617849449709, + 7142633755989890055, + 10840735473548209733, + 2847350786075278882 + ], + "infinity": false + }, + { + "x": [ + 16258572583186965203, + 1354691125575792689, + 17235265854934968790, + 1252220109588505888 + ], + "y": [ + 9336541637487074271, + 18402912967310224930, + 13223187653117829136, + 2979297976786733465 + ], + "infinity": false + }, + { + "x": [ + 8525686695522099028, + 4103157564078645049, + 18392570749492199187, + 2911539491816599180 + ], + "y": [ + 114653447583918953, + 10470307038453386601, + 11189850644566793538, + 1298227034210846592 + ], + "infinity": false + } + ], + "gate_selectors_commitments": [ + { + "x": [ + 2069700145549311928, + 4250782333685017927, + 14207216715687122978, + 1145927286048477791 + ], + "y": [ + 9341202692364554712, + 12346939747104737180, + 2826478533799125818, + 2279570556437452275 + ], + "infinity": false + }, + { + "x": [ + 12388902775325386546, + 1277383964095999647, + 10535796018183893831, + 3359866702323175506 + ], + "y": [ + 16500893366957272235, + 2806147688388338314, + 8233156072220488773, + 2867848844627212711 + ], + "infinity": false + } + ], + "permutation_commitments": [ + { + "x": [ + 17521183961631816299, + 18327810537117645266, + 16586212795163003556, + 3052771534158410452 + ], + "y": [ + 8441310283734453731, + 14146088755801181801, + 17480253356603213989, + 3217948944323396651 + ], + "infinity": false + }, + { + "x": [ + 16076801532842923524, + 7514743296775639295, + 2571323986448120255, + 184367540214459973 + ], + "y": [ + 13389643967183613114, + 17108261756464256828, + 11145735340309739417, + 2142196980030893874 + ], + "infinity": false + }, + { + "x": [ + 8034683328666433725, + 5436036566901194392, + 18053257213361014053, + 2821377847227509494 + ], + "y": [ + 14471305228212723444, + 8894846184648865892, + 7047725473055235530, + 2413388400332075493 + ], + "infinity": false + }, + { + "x": [ + 14026981588443304814, + 14671946927765496183, + 13387079215022495926, + 2554705188091675830 + ], + "y": [ + 440116222237740520, + 1630168477189852269, + 17833425794232523381, + 908824471705597078 + ], + "infinity": false + } + ], + "total_lookup_entries_length": 41494904, + "lookup_selector_commitment": { + "x": [ + 13889323383351416990, + 17887386740570674124, + 5463612855590268091, + 2434255340534820869 + ], + "y": [ + 2436699678434218349, + 11251365794004058995, + 11023509005141034197, + 2867854671852170604 + ], + "infinity": false + }, + "lookup_tables_commitments": [ + { + "x": [ + 631990924006796604, + 16139625628991115157, + 13331739325995827711, + 1062301837743594995 + ], + "y": [ + 15303054606290800139, + 15906872095881647437, + 7093896572295020249, + 1342952934989901142 + ], + "infinity": false + }, + { + "x": [ + 7983921919542246393, + 13296544189644416678, + 17081022784392007697, + 1980832835348244027 + ], + "y": [ + 10874958134865200330, + 7702740658637630534, + 14052057929798961943, + 3193353539419869016 + ], + "infinity": false + }, + { + "x": [ + 1114587284824996932, + 4636906500482867924, + 15328247172597030456, + 87946895873973686 + ], + "y": [ + 15573033830207915877, + 5194694185599035278, + 2562407345425607214, + 2782078999306862675 + ], + "infinity": false + }, + { + "x": [ + 18225112781127431982, + 18048613958187123807, + 7325490730844456621, + 1953409020724855888 + ], + "y": [ + 7577000130125917198, + 6193701449695751861, + 4102082927677054717, + 395350071385269650 + ], + "infinity": false + } + ], + "lookup_table_type_commitment": { + "x": [ + 3832160677272803715, + 2122279734318217808, + 811690144328522684, + 1416829483108546006 + ], + "y": [ + 10041279311991435550, + 14702496983143623186, + 4419862575487552747, + 1429817244630465543 + ], + "infinity": false + }, + "non_residues": [ + [ + 5, + 0, + 0, + 0 + ], + [ + 7, + 0, + 0, + 0 + ], + [ + 10, + 0, + 0, + 0 + ] + ], + "g2_elements": [ + { + "x": { + "c0": [ + 5106727233969649389, + 7440829307424791261, + 4785637993704342649, + 1729627375292849782 + ], + "c1": [ + 10945020018377822914, + 17413811393473931026, + 8241798111626485029, + 1841571559660931130 + ] + }, + "y": { + "c0": [ + 5541340697920699818, + 16416156555105522555, + 5380518976772849807, + 1353435754470862315 + ], + "c1": [ + 6173549831154472795, + 13567992399387660019, + 17050234209342075797, + 650358724130500725 + ] + }, + "infinity": false + }, + { + "x": { + "c0": [ + 9089143573911733168, + 11482283522806384523, + 13585589533905622862, + 79029415676722370 + ], + "c1": [ + 5692040832573735873, + 16884514497384809355, + 16717166481813659368, + 2742131088506155463 + ] + }, + "y": { + "c0": [ + 9604638503594647125, + 1289961608472612514, + 6217038149984805214, + 2521661352385209130 + ], + "c1": [ + 17168069778630926308, + 11309277837895768996, + 15154989611154567813, + 359271377050603491 + ] + }, + "infinity": false + } + ] +} \ No newline at end of file diff --git a/core/bin/verification_key_generator_and_server/src/commitment_generator.rs b/core/bin/verification_key_generator_and_server/src/commitment_generator.rs new file mode 100644 index 000000000000..ed859bcb4366 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/src/commitment_generator.rs @@ -0,0 +1,37 @@ +use anyhow::Context as _; +use zksync_prover_utils::vk_commitment_helper::{ + get_toml_formatted_value, read_contract_toml, write_contract_toml, +}; +use zksync_verification_key_server::generate_commitments; + +fn main() -> anyhow::Result<()> { + tracing::info!("Starting commitment generation!"); + read_and_update_contract_toml() +} + +fn read_and_update_contract_toml() -> anyhow::Result<()> { + let mut contract_doc = read_contract_toml().context("read_contract_toml()")?; + let ( + basic_circuit_commitment_hex, + leaf_aggregation_commitment_hex, + node_aggregation_commitment_hex, + ) = generate_commitments(); + contract_doc["contracts"]["RECURSION_CIRCUITS_SET_VKS_HASH"] = + get_toml_formatted_value(basic_circuit_commitment_hex); + contract_doc["contracts"]["RECURSION_LEAF_LEVEL_VK_HASH"] = + get_toml_formatted_value(leaf_aggregation_commitment_hex); + contract_doc["contracts"]["RECURSION_NODE_LEVEL_VK_HASH"] = + get_toml_formatted_value(node_aggregation_commitment_hex); + tracing::info!("Updated toml content: {:?}", contract_doc.to_string()); + write_contract_toml(contract_doc).context("write_contract_toml") +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_read_and_update_contract_toml() { + read_and_update_contract_toml().unwrap(); + } +} diff --git a/core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs b/core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs new file mode 100644 index 000000000000..c04a67128334 --- /dev/null +++ b/core/bin/verification_key_generator_and_server/src/json_to_binary_vk_converter.rs @@ -0,0 +1,31 @@ +use std::{fs::File, io::BufWriter}; + +use bincode::serialize_into; +use structopt::StructOpt; +use zksync_verification_key_server::get_vk_for_circuit_type; + +#[derive(Debug, StructOpt)] +#[structopt( + name = "json existing json VK's to binary vk", + about = "converter tool" +)] +struct Opt { + /// Binary output path of verification keys. + #[structopt(short)] + output_bin_path: String, +} + +fn main() { + let opt = Opt::from_args(); + println!("Converting existing json keys to binary"); + generate_bin_vks(opt.output_bin_path); +} + +fn generate_bin_vks(output_path: String) { + for circuit_type in 1..=18 { + let filename = format!("{}/verification_{}.key", output_path, circuit_type); + let vk = get_vk_for_circuit_type(circuit_type); + let mut f = BufWriter::new(File::create(filename).unwrap()); + serialize_into(&mut f, &vk).unwrap(); + } +} diff --git a/core/bin/verification_key_generator_and_server/src/lib.rs b/core/bin/verification_key_generator_and_server/src/lib.rs new file mode 100644 index 000000000000..20260a30b20b --- /dev/null +++ b/core/bin/verification_key_generator_and_server/src/lib.rs @@ -0,0 +1,188 @@ +use std::{collections::HashMap, path::Path, str::FromStr}; + +use ff::to_hex; +use itertools::Itertools; +use once_cell::sync::Lazy; +use structopt::lazy_static::lazy_static; +use zksync_types::{ + circuit::{ + GEOMETRY_CONFIG, LEAF_CIRCUIT_INDEX, LEAF_SPLITTING_FACTOR, NODE_CIRCUIT_INDEX, + NODE_SPLITTING_FACTOR, SCHEDULER_CIRCUIT_INDEX, SCHEDULER_UPPER_BOUND, + }, + protocol_version::{L1VerifierConfig, VerifierParams}, + vk_transform::generate_vk_commitment, + zkevm_test_harness::{ + abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, + bellman::{bn256::Bn256, plonk::better_better_cs::setup::VerificationKey}, + witness, + witness::{ + full_block_artifact::BlockBasicCircuits, + oracle::VmWitnessOracle, + recursive_aggregation::{erase_vk_type, padding_aggregations}, + vk_set_generator::circuits_for_vk_generation, + }, + }, + H256, +}; + +#[cfg(test)] +mod tests; + +lazy_static! { + static ref COMMITMENTS: Lazy = Lazy::new(|| { circuit_commitments() }); +} + +pub fn get_vks_for_basic_circuits( +) -> HashMap>>> { + // 3-17 are the ids of basic circuits + (3..=18) + .map(|circuit_type| (circuit_type, get_vk_for_circuit_type(circuit_type))) + .collect() +} + +pub fn get_vk_for_circuit_type( + circuit_type: u8, +) -> VerificationKey>> { + let filepath = get_file_path(circuit_type); + tracing::info!("Fetching verification key from path: {}", filepath); + let text = std::fs::read_to_string(&filepath) + .unwrap_or_else(|_| panic!("Failed reading verification key from path: {}", filepath)); + serde_json::from_str::>>>( + &text, + ) + .unwrap_or_else(|_| { + panic!( + "Failed deserializing verification key from path: {}", + filepath + ) + }) +} + +pub fn save_vk_for_circuit_type( + circuit_type: u8, + vk: VerificationKey>>, +) { + let filepath = get_file_path(circuit_type); + tracing::info!("saving verification key to: {}", filepath); + std::fs::write(filepath, serde_json::to_string_pretty(&vk).unwrap()).unwrap(); +} + +pub fn get_ordered_vks_for_basic_circuits( + circuits: &BlockBasicCircuits, + verification_keys: &HashMap< + u8, + VerificationKey>>, + >, +) -> Vec>>> { + circuits + .clone() + .into_flattened_set() + .iter() + .map(|circuit| { + let circuit_id = circuit.numeric_circuit_type(); + verification_keys + .get(&circuit_id) + .unwrap_or_else(|| { + panic!("no VK for circuit number {:?}", circuit.short_description()) + }) + .clone() + }) + .collect() +} + +pub fn get_vks_for_commitment( + verification_keys: HashMap< + u8, + VerificationKey>>, + >, +) -> Vec>>> { + // We need all the vks sorted by their respective circuit ids + verification_keys + .into_iter() + .sorted_by_key(|(id, _)| *id) + .map(|(_, val)| val) + .collect() +} + +pub fn get_circuits_for_vk() -> Vec>> { + ensure_setup_key_exist(); + let padding_aggregations = padding_aggregations(NODE_SPLITTING_FACTOR); + circuits_for_vk_generation( + GEOMETRY_CONFIG, + LEAF_SPLITTING_FACTOR, + NODE_SPLITTING_FACTOR, + SCHEDULER_UPPER_BOUND, + padding_aggregations, + ) +} + +fn ensure_setup_key_exist() { + if !Path::new("setup_2^26.key").exists() { + panic!("File setup_2^26.key is required to be present in current directory for verification keys generation. \ndownload from https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2^26.key"); + } +} +fn get_file_path(circuit_type: u8) -> String { + let zksync_home = std::env::var("ZKSYNC_HOME").unwrap_or_else(|_| "/".into()); + format!( + "{}/core/bin/verification_key_generator_and_server/data/verification_{}_key.json", + zksync_home, circuit_type + ) +} + +pub fn generate_commitments() -> (String, String, String) { + let (_, basic_circuit_commitment, _) = + witness::recursive_aggregation::form_base_circuits_committment(get_vks_for_commitment( + get_vks_for_basic_circuits(), + )); + + let leaf_aggregation_vk = get_vk_for_circuit_type(LEAF_CIRCUIT_INDEX); + let node_aggregation_vk = get_vk_for_circuit_type(NODE_CIRCUIT_INDEX); + + let (_, leaf_aggregation_vk_commitment) = + witness::recursive_aggregation::compute_vk_encoding_and_committment(erase_vk_type( + leaf_aggregation_vk, + )); + + let (_, node_aggregation_vk_commitment) = + witness::recursive_aggregation::compute_vk_encoding_and_committment(erase_vk_type( + node_aggregation_vk, + )); + let basic_circuit_commitment_hex = format!("0x{}", to_hex(&basic_circuit_commitment)); + let leaf_aggregation_commitment_hex = format!("0x{}", to_hex(&leaf_aggregation_vk_commitment)); + let node_aggregation_commitment_hex = format!("0x{}", to_hex(&node_aggregation_vk_commitment)); + tracing::info!( + "basic circuit commitment {:?}", + basic_circuit_commitment_hex + ); + tracing::info!( + "leaf aggregation commitment {:?}", + leaf_aggregation_commitment_hex + ); + tracing::info!( + "node aggregation commitment {:?}", + node_aggregation_commitment_hex + ); + ( + basic_circuit_commitment_hex, + leaf_aggregation_commitment_hex, + node_aggregation_commitment_hex, + ) +} + +fn circuit_commitments() -> L1VerifierConfig { + let (basic, leaf, node) = generate_commitments(); + let scheduler = generate_vk_commitment(get_vk_for_circuit_type(SCHEDULER_CIRCUIT_INDEX)); + L1VerifierConfig { + params: VerifierParams { + recursion_node_level_vk_hash: H256::from_str(&node).expect("invalid node commitment"), + recursion_leaf_level_vk_hash: H256::from_str(&leaf).expect("invalid leaf commitment"), + recursion_circuits_set_vks_hash: H256::from_str(&basic) + .expect("invalid basic commitment"), + }, + recursion_scheduler_level_vk_hash: scheduler, + } +} + +pub fn get_cached_commitments() -> L1VerifierConfig { + **COMMITMENTS +} diff --git a/core/bin/verification_key_generator_and_server/src/main.rs b/core/bin/verification_key_generator_and_server/src/main.rs new file mode 100644 index 000000000000..b64e5757fceb --- /dev/null +++ b/core/bin/verification_key_generator_and_server/src/main.rs @@ -0,0 +1,48 @@ +use std::{collections::HashSet, env}; + +use zksync_types::zkevm_test_harness::{ + abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, + bellman::{ + bn256::Bn256, plonk::better_better_cs::cs::PlonkCsWidth4WithNextStepAndCustomGatesParams, + }, + witness::oracle::VmWitnessOracle, +}; +use zksync_verification_key_server::{get_circuits_for_vk, save_vk_for_circuit_type}; + +/// Creates verification keys for the given circuit. +fn main() { + let args: Vec = env::args().collect(); + + let circuit_types: HashSet = if args.len() > 1 { + [get_and_ensure_valid_circuit_type(args[1].clone())].into() + } else { + (3..17).collect() + }; + tracing::info!("Starting verification key generation!"); + get_circuits_for_vk() + .into_iter() + .filter(|c| circuit_types.contains(&c.numeric_circuit_type())) + .for_each(generate_verification_key); +} + +fn get_and_ensure_valid_circuit_type(circuit_type: String) -> u8 { + tracing::info!("Received circuit_type: {:?}", circuit_type); + circuit_type + .parse::() + .expect("Please specify a circuit type in range [1, 17]") +} + +fn generate_verification_key(circuit: ZkSyncCircuit>) { + let res = circuit_testing::create_vk_for_padding_size_log_2::< + Bn256, + _, + PlonkCsWidth4WithNextStepAndCustomGatesParams, + >(circuit.clone(), 26) + .unwrap(); + save_vk_for_circuit_type(circuit.numeric_circuit_type(), res); + tracing::info!( + "Finished VK generation for circuit {:?} (id {:?})", + circuit.short_description(), + circuit.numeric_circuit_type() + ); +} diff --git a/core/bin/verification_key_generator_and_server/src/tests.rs b/core/bin/verification_key_generator_and_server/src/tests.rs new file mode 100644 index 000000000000..f0fea866de6d --- /dev/null +++ b/core/bin/verification_key_generator_and_server/src/tests.rs @@ -0,0 +1,68 @@ +use std::collections::HashMap; + +use itertools::Itertools; +use serde_json::Value; +use zksync_types::zkevm_test_harness::{ + abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, + bellman::{bn256::Bn256, plonk::better_better_cs::setup::VerificationKey}, + witness::oracle::VmWitnessOracle, +}; + +use crate::{get_vk_for_circuit_type, get_vks_for_basic_circuits, get_vks_for_commitment}; + +#[test] +fn test_get_vk_for_circuit_type() { + for circuit_type in 1..=18 { + get_vk_for_circuit_type(circuit_type); + } +} + +#[test] +fn test_get_vks_for_basic_circuits() { + let circuit_type_to_vk = get_vks_for_basic_circuits(); + let circuit_types: Vec = circuit_type_to_vk.into_keys().sorted().collect::>(); + let expected: Vec = (3..=18).collect(); + assert_eq!( + expected, circuit_types, + "circuit types must be in the range [3, 17]" + ); +} + +#[test] +fn test_get_vks_for_commitment() { + let vk_5 = get_vk_for_circuit_type(5); + let vk_2 = get_vk_for_circuit_type(2); + let vk_3 = get_vk_for_circuit_type(3); + let map = HashMap::from([ + (5u8, vk_5.clone()), + (2u8, vk_2.clone()), + (3u8, vk_3.clone()), + ]); + let vks = get_vks_for_commitment(map); + let expected = vec![vk_2, vk_3, vk_5]; + compare_vks( + expected, + vks, + "expected verification key to be in order 2, 3, 5", + ); +} + +fn get_vk_json(vk: &VerificationKey>>) -> Value { + serde_json::to_value(vk).unwrap() +} + +fn get_vk_jsons( + vks: Vec>>>, +) -> Vec { + vks.into_iter().map(|vk| get_vk_json(&vk)).collect() +} + +fn compare_vks( + first: Vec>>>, + second: Vec>>>, + error_message: &str, +) { + let first_json = get_vk_jsons(first); + let second_json = get_vk_jsons(second); + assert_eq!(first_json, second_json, "{:?}", error_message); +} diff --git a/core/lib/types/src/circuit.rs b/core/lib/types/src/circuit.rs new file mode 100644 index 000000000000..05f269c451ec --- /dev/null +++ b/core/lib/types/src/circuit.rs @@ -0,0 +1,13 @@ +use zkevm_test_harness::{geometry_config::get_geometry_config, toolset::GeometryConfig}; + +pub const LEAF_SPLITTING_FACTOR: usize = 50; +pub const NODE_SPLITTING_FACTOR: usize = 48; + +/// Max number of basic circuits per L1 batch. +pub const SCHEDULER_UPPER_BOUND: u32 = (LEAF_SPLITTING_FACTOR * NODE_SPLITTING_FACTOR) as u32; + +pub const LEAF_CIRCUIT_INDEX: u8 = 2; +pub const NODE_CIRCUIT_INDEX: u8 = 1; +pub const SCHEDULER_CIRCUIT_INDEX: u8 = 0; + +pub const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); diff --git a/prover/circuit_synthesizer/Cargo.toml b/prover/circuit_synthesizer/Cargo.toml index 9f3cda69e9f1..c6f70bd5c3b8 100644 --- a/prover/circuit_synthesizer/Cargo.toml +++ b/prover/circuit_synthesizer/Cargo.toml @@ -21,6 +21,7 @@ zksync_prover_fri_utils = { path = "../prover_fri_utils" } vlog = { path = "../../core/lib/vlog" } prometheus_exporter = { path = "../../core/lib/prometheus_exporter" } zksync_prover_utils = { path = "../../core/lib/prover_utils" } +zksync_verification_key_generator_and_server = { path = "../../core/bin/verification_key_generator_and_server" } zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.3.3" } diff --git a/prover/prover/Cargo.toml b/prover/prover/Cargo.toml index fa2baf27002d..03adce72daf0 100644 --- a/prover/prover/Cargo.toml +++ b/prover/prover/Cargo.toml @@ -23,6 +23,7 @@ zksync_eth_client = { path = "../../core/lib/eth_client" } zksync_types = { path = "../../core/lib/types" } prometheus_exporter = { path = "../../core/lib/prometheus_exporter" } vlog = { path = "../../core/lib/vlog" } +zksync_verification_key_generator_and_server = { path = "../../core/bin/verification_key_generator_and_server" } zksync_object_store = { path = "../../core/lib/object_store" } setup_key_generator_and_server = { path = "../setup_key_generator_and_server" } From 5bd13d3ad34cdfb94df0c9c579b46204be3acee5 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 15:20:28 +0200 Subject: [PATCH 07/27] Revert --- .dockerignore | 1 + .gitignore | 1 + Cargo.toml | 1 + core/lib/types/src/lib.rs | 1 + core/lib/zksync_core/Cargo.toml | 1 + docker/circuit-synthesizer/Dockerfile | 1 + docker/prover/Dockerfile | 2 ++ docker/server-v2/Dockerfile | 1 + etc/env/base/rust.toml | 1 + 9 files changed, 10 insertions(+) diff --git a/.dockerignore b/.dockerignore index 736cf6ea4820..91b5220c669b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -37,5 +37,6 @@ contracts/.git !etc/multivm_bootloaders !cargo !bellman-cuda +!core/bin/verification_key_generator_and_server/data/ !prover/vk_setup_data_generator_server_fri/data/ !.github/release-please/manifest.json diff --git a/.gitignore b/.gitignore index 20c5973e8f48..eff8079e75db 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ todo Cargo.lock !/Cargo.lock +!/core/bin/verification_key_generator_and_server/Cargo.lock !/infrastructure/zksync-crypto/Cargo.lock !/prover/Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 3d0c2a93f580..ac01673bfb99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "core/bin/snapshots_creator", "core/bin/storage_logs_dedup_migration", "core/bin/system-constants-generator", + "core/bin/verification_key_generator_and_server", "core/bin/verified_sources_fetcher", "core/bin/zksync_server", # Libraries diff --git a/core/lib/types/src/lib.rs b/core/lib/types/src/lib.rs index dbe893b7d20f..a7d7e71e0eff 100644 --- a/core/lib/types/src/lib.rs +++ b/core/lib/types/src/lib.rs @@ -33,6 +33,7 @@ use crate::{l2::TransactionType, protocol_version::ProtocolUpgradeTxCommonData}; pub mod aggregated_operations; pub mod block; +pub mod circuit; pub mod commitment; pub mod contract_verification_api; pub mod contracts; diff --git a/core/lib/zksync_core/Cargo.toml b/core/lib/zksync_core/Cargo.toml index 917b8fe69b5b..6caeed0857e5 100644 --- a/core/lib/zksync_core/Cargo.toml +++ b/core/lib/zksync_core/Cargo.toml @@ -28,6 +28,7 @@ zksync_circuit_breaker = { path = "../circuit_breaker" } zksync_storage = { path = "../storage" } zksync_merkle_tree = { path = "../merkle_tree" } zksync_mini_merkle_tree = { path = "../mini_merkle_tree" } +zksync_verification_key_generator_and_server = { path = "../../bin/verification_key_generator_and_server" } prometheus_exporter = { path = "../prometheus_exporter" } zksync_web3_decl = { path = "../web3_decl", default-features = false, features = [ "server", diff --git a/docker/circuit-synthesizer/Dockerfile b/docker/circuit-synthesizer/Dockerfile index 5ea76836d712..831fe1672239 100644 --- a/docker/circuit-synthesizer/Dockerfile +++ b/docker/circuit-synthesizer/Dockerfile @@ -23,6 +23,7 @@ FROM debian:bookworm-slim RUN apt-get update && apt-get install -y curl openssl libpq5 ca-certificates && rm -rf /var/lib/apt/lists/* +COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ COPY --from=builder /usr/src/zksync/target/release/zksync_circuit_synthesizer /usr/bin/ ENTRYPOINT ["zksync_circuit_synthesizer"] diff --git a/docker/prover/Dockerfile b/docker/prover/Dockerfile index 3adc9e39fbb4..d6dc38b29873 100644 --- a/docker/prover/Dockerfile +++ b/docker/prover/Dockerfile @@ -56,6 +56,8 @@ COPY contracts/l1-contracts/artifacts/ /contracts/l1-contracts/artifacts/ COPY contracts/l2-contracts/artifacts-zk/ /contracts/l2-contracts/artifacts-zk/ COPY setup_2\^26.key /etc/ +COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ + COPY --from=builder /usr/src/zksync/target/release/zksync_prover /usr/bin/ ENTRYPOINT ["zksync_prover"] diff --git a/docker/server-v2/Dockerfile b/docker/server-v2/Dockerfile index 880fcec91b47..6bd011d6d6cd 100644 --- a/docker/server-v2/Dockerfile +++ b/docker/server-v2/Dockerfile @@ -41,5 +41,6 @@ COPY contracts/l2-contracts/artifacts-zk/ /contracts/l2-contracts/artifacts-zk/ COPY etc/tokens/ /etc/tokens/ COPY etc/ERC20/ /etc/ERC20/ COPY etc/multivm_bootloaders/ /etc/multivm_bootloaders/ +COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ ENTRYPOINT ["zksync_server"] diff --git a/etc/env/base/rust.toml b/etc/env/base/rust.toml index 18c7823f73e3..4c0ebb6ed052 100644 --- a/etc/env/base/rust.toml +++ b/etc/env/base/rust.toml @@ -22,6 +22,7 @@ zksync_mempool=debug,\ loadnext=info,\ vm=info,\ block_sizes_test=info,\ +zksync_verification_key_generator_and_server=info,\ zksync_object_store=info,\ setup_key_generator_and_server=info,\ zksync_circuit_synthesizer=info,\ From a128c01518c9c666296a84d235e225b4e9454575 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 15:22:00 +0200 Subject: [PATCH 08/27] Fix --- Cargo.lock | 20 ++++++++++++++++++++ docker/prover-gar/Dockerfile | 1 + 2 files changed, 21 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d468146f82fe..cca2eb82baa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8516,6 +8516,7 @@ dependencies = [ "zksync_test_account", "zksync_types", "zksync_utils", + "zksync_verification_key_generator_and_server", "zksync_web3_decl", ] @@ -8932,6 +8933,25 @@ dependencies = [ "zksync_basic_types", ] +[[package]] +name = "zksync_verification_key_generator_and_server" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "circuit_testing", + "ff_ce", + "hex", + "itertools", + "once_cell", + "serde_json", + "structopt", + "tracing", + "vlog", + "zksync_prover_utils", + "zksync_types", +] + [[package]] name = "zksync_web3_decl" version = "0.1.0" diff --git a/docker/prover-gar/Dockerfile b/docker/prover-gar/Dockerfile index b8fa470017cb..1dc55e57c899 100644 --- a/docker/prover-gar/Dockerfile +++ b/docker/prover-gar/Dockerfile @@ -15,6 +15,7 @@ COPY --from=prover contracts/system-contracts/bootloader/build/artifacts/ /contr COPY --from=prover contracts/system-contracts/artifacts-zk /contracts/system-contracts/artifacts-zk COPY --from=prover contracts/l1-contracts/artifacts/ /contracts/l1-contracts/artifacts/ COPY --from=prover contracts/l2-contracts/artifacts-zk/ /contracts/l2-contracts/artifacts-zk/ +COPY --from=prover core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ COPY --from=prover /usr/bin/zksync_prover /usr/bin/ From 3d9d349e085429f634ef1fc88b7c620711f2dd2e Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 15:22:24 +0200 Subject: [PATCH 09/27] Fix --- docker/prover-gar/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/prover-gar/Dockerfile b/docker/prover-gar/Dockerfile index 1dc55e57c899..1e96e23bbbac 100644 --- a/docker/prover-gar/Dockerfile +++ b/docker/prover-gar/Dockerfile @@ -16,7 +16,6 @@ COPY --from=prover contracts/system-contracts/artifacts-zk /contracts/system-con COPY --from=prover contracts/l1-contracts/artifacts/ /contracts/l1-contracts/artifacts/ COPY --from=prover contracts/l2-contracts/artifacts-zk/ /contracts/l2-contracts/artifacts-zk/ COPY --from=prover core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/ - COPY --from=prover /usr/bin/zksync_prover /usr/bin/ ENTRYPOINT ["zksync_prover"] From 0844bd940ed8e4fc4d5ced18a91efb49588c8dad Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 17:12:47 +0200 Subject: [PATCH 10/27] try f32 --- .../vm_latest/implementation/execution.rs | 7 +- .../vm_latest/tracers/circuits_capacity.rs | 73 +++++++++ .../vm_latest/tracers/circuits_tracer.rs | 140 +++++++++++++----- 3 files changed, 177 insertions(+), 43 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs index 86e3fc46eff0..99d04ad86113 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs @@ -73,11 +73,8 @@ impl Vm { .unwrap_or_default(); // Ceil and convert to usize. - let estimated_circuits_used = (tx_tracer.circuits_tracer.estimated_circuits_used.clone() - + BigDecimal::from(1u8) / BigDecimal::from(2u8)) - .round(0) - .to_usize() - .expect("estimated_circuits_used must fix into usize"); + let estimated_circuits_used = + (tx_tracer.circuits_tracer.estimated_circuits_used + 0.5).round() as usize; let statistics = self.get_statistics( timestamp_initial, diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs index 676cd2fb1b5a..c7f8d364359b 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -100,3 +100,76 @@ pub(crate) static PRECOMPILE_CALL_COMMON_FRACTION: Lazy = Lazy::new( + RAM_PERMUTATION_CYCLE_FRACTION.clone() + LOG_DEMUXER_CYCLE_FRACTION.clone() }); + +// f32 + +const MAIN_VM_CYCLE_FRACTION_F32: f32 = 1.05 / GEOMETRY_CONFIG.cycles_per_vm_snapshot as f32; + +const CODE_DECOMMITTER_SORTER_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_code_decommitter_sorter as f32; + +const LOG_DEMUXER_CYCLE_FRACTION_F32: f32 = 1.05 / GEOMETRY_CONFIG.cycles_per_log_demuxer as f32; + +const STORAGE_SORTER_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_storage_sorter as f32; + +const EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter as f32; + +const RAM_PERMUTATION_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_ram_permutation as f32; + +pub(crate) const CODE_DECOMMITTER_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_code_decommitter as f32; + +const STORAGE_APPLICATION_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_storage_application as f32; + +pub(crate) const KECCAK256_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_keccak256_circuit as f32; + +pub(crate) const SHA256_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_sha256_circuit as f32; + +pub(crate) const ECRECOVER_CYCLE_FRACTION_F32: f32 = + 1.05 / GEOMETRY_CONFIG.cycles_per_ecrecover_circuit as f32; + +pub(crate) const RICH_ADDRESSING_OPCODE_FRACTION_F32: f32 = + MAIN_VM_CYCLE_FRACTION_F32 + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION_F32; + +pub(crate) const AVERAGE_OPCODE_FRACTION_F32: f32 = + MAIN_VM_CYCLE_FRACTION_F32 + RAM_PERMUTATION_CYCLE_FRACTION_F32; + +pub(crate) const STORAGE_READ_FRACTION_F32: f32 = MAIN_VM_CYCLE_FRACTION_F32 + + RAM_PERMUTATION_CYCLE_FRACTION_F32 + + LOG_DEMUXER_CYCLE_FRACTION_F32 + + STORAGE_SORTER_CYCLE_FRACTION_F32 + + STORAGE_APPLICATION_CYCLE_FRACTION_F32; + +pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION_F32: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + + RAM_PERMUTATION_CYCLE_FRACTION_F32 + + 2.0 * LOG_DEMUXER_CYCLE_FRACTION_F32 + + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION_F32; + +pub(crate) const HOT_STORAGE_WRITE_FRACTION_F32: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + + RAM_PERMUTATION_CYCLE_FRACTION_F32 + + 2.0 * LOG_DEMUXER_CYCLE_FRACTION_F32 + + 2.0 * STORAGE_SORTER_CYCLE_FRACTION_F32; + +pub(crate) const COLD_STORAGE_WRITE_FRACTION_F32: f32 = + HOT_STORAGE_WRITE_FRACTION_F32 + 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION_F32; + +pub(crate) const FAR_CALL_FRACTION_F32: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + + RAM_PERMUTATION_CYCLE_FRACTION_F32 + + STORAGE_SORTER_CYCLE_FRACTION_F32 + + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION_F32; + +pub(crate) const UMA_WRITE_FRACTION_F32: f32 = + 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION_F32; + +pub(crate) const UMA_READ_FRACTION_F32: f32 = + 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION_F32; + +pub(crate) const PRECOMPILE_CALL_COMMON_FRACTION_F32: f32 = MAIN_VM_CYCLE_FRACTION_F32 + + RAM_PERMUTATION_CYCLE_FRACTION_F32 + + LOG_DEMUXER_CYCLE_FRACTION_F32; diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index c28edcb06ba4..9bd7a22ab96b 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -26,7 +26,7 @@ use crate::{ /// Tracer responsible for collecting information about refunds. #[derive(Debug)] pub(crate) struct CircuitsTracer { - pub(crate) estimated_circuits_used: BigDecimal, + pub(crate) estimated_circuits_used: f32, last_decommitment_history_entry_checked: Option, _phantom_data: PhantomData, } @@ -34,7 +34,7 @@ pub(crate) struct CircuitsTracer { impl CircuitsTracer { pub(crate) fn new() -> Self { Self { - estimated_circuits_used: BigDecimal::zero(), + estimated_circuits_used: 0.0, last_decommitment_history_entry_checked: None, _phantom_data: Default::default(), } @@ -47,8 +47,72 @@ impl DynTracer> for Circuits state: VmLocalStateData<'_>, data: BeforeExecutionData, _memory: &SimpleMemory, - storage: StoragePtr, + _storage: StoragePtr, ) { + // let used = match data.opcode.variant.opcode { + // Opcode::Nop(_) + // | Opcode::Add(_) + // | Opcode::Sub(_) + // | Opcode::Mul(_) + // | Opcode::Div(_) + // | Opcode::Jump(_) + // | Opcode::Binop(_) + // | Opcode::Shift(_) + // | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION.clone(), + // Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => { + // AVERAGE_OPCODE_FRACTION.clone() + // } + // Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION.clone(), + // Opcode::Log(LogOpcode::StorageWrite) => { + // COLD_STORAGE_WRITE_FRACTION.clone() + // // let storage_key = StorageKey::new( + // // AccountTreeId::new(state.vm_local_state.callstack.current.this_address), + // // u256_to_h256(data.src0_value.value), + // // ); + // // + // // let first_write = !storage + // // .borrow() + // // .modified_storage_keys() + // // .contains_key(&storage_key); + // // if first_write { + // // COLD_STORAGE_WRITE_FRACTION.clone() + // // } else { + // // HOT_STORAGE_WRITE_FRACTION.clone() + // // } + // } + // Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { + // EVENT_OR_L1_MESSAGE_FRACTION.clone() + // } + // Opcode::Log(LogOpcode::PrecompileCall) => { + // match state.vm_local_state.callstack.current.this_address { + // a if a == KECCAK256_PRECOMPILE_ADDRESS => { + // let precompile_interpreted = data.src0_value.value.0[3]; + // PRECOMPILE_CALL_COMMON_FRACTION.clone() + // + BigDecimal::from(precompile_interpreted) + // * KECCAK256_CYCLE_FRACTION.clone() + // } + // a if a == SHA256_PRECOMPILE_ADDRESS => { + // let precompile_interpreted = data.src0_value.value.0[3]; + // PRECOMPILE_CALL_COMMON_FRACTION.clone() + // + BigDecimal::from(precompile_interpreted) + // * SHA256_CYCLE_FRACTION.clone() + // } + // a if a == ECRECOVER_PRECOMPILE_ADDRESS => { + // PRECOMPILE_CALL_COMMON_FRACTION.clone() + ECRECOVER_CYCLE_FRACTION.clone() + // } + // _ => PRECOMPILE_CALL_COMMON_FRACTION.clone(), + // } + // } + // Opcode::FarCall(_) => FAR_CALL_FRACTION.clone(), + // Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => { + // UMA_WRITE_FRACTION.clone() + // } + // Opcode::UMA( + // UMAOpcode::AuxHeapRead | UMAOpcode::HeapRead | UMAOpcode::FatPointerRead, + // ) => UMA_READ_FRACTION.clone(), + // Opcode::Invalid(_) => unreachable!(), // invalid opcodes are never executed + // }; + let used = match data.opcode.variant.opcode { Opcode::Nop(_) | Opcode::Add(_) @@ -58,57 +122,54 @@ impl DynTracer> for Circuits | Opcode::Jump(_) | Opcode::Binop(_) | Opcode::Shift(_) - | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION.clone(), + | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION_F32, Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => { - AVERAGE_OPCODE_FRACTION.clone() + AVERAGE_OPCODE_FRACTION_F32 } - Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION.clone(), + Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION_F32, Opcode::Log(LogOpcode::StorageWrite) => { - let storage_key = StorageKey::new( - AccountTreeId::new(state.vm_local_state.callstack.current.this_address), - u256_to_h256(data.src0_value.value), - ); - - let first_write = !storage - .borrow() - .modified_storage_keys() - .contains_key(&storage_key); - if first_write { - COLD_STORAGE_WRITE_FRACTION.clone() - } else { - HOT_STORAGE_WRITE_FRACTION.clone() - } + COLD_STORAGE_WRITE_FRACTION_F32 + // let storage_key = StorageKey::new( + // AccountTreeId::new(state.vm_local_state.callstack.current.this_address), + // u256_to_h256(data.src0_value.value), + // ); + // + // let first_write = !storage + // .borrow() + // .modified_storage_keys() + // .contains_key(&storage_key); + // if first_write { + // COLD_STORAGE_WRITE_FRACTION_F32 + // } else { + // HOT_STORAGE_WRITE_FRACTION_F32 + // } } Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { - EVENT_OR_L1_MESSAGE_FRACTION.clone() + EVENT_OR_L1_MESSAGE_FRACTION_F32 } Opcode::Log(LogOpcode::PrecompileCall) => { match state.vm_local_state.callstack.current.this_address { a if a == KECCAK256_PRECOMPILE_ADDRESS => { - let precompile_interpreted = data.src0_value.value.0[3]; - PRECOMPILE_CALL_COMMON_FRACTION.clone() - + BigDecimal::from(precompile_interpreted) - * KECCAK256_CYCLE_FRACTION.clone() + let precompile_interpreted = data.src0_value.value.0[3] as f32; + PRECOMPILE_CALL_COMMON_FRACTION_F32 + + precompile_interpreted * KECCAK256_CYCLE_FRACTION_F32 } a if a == SHA256_PRECOMPILE_ADDRESS => { - let precompile_interpreted = data.src0_value.value.0[3]; - PRECOMPILE_CALL_COMMON_FRACTION.clone() - + BigDecimal::from(precompile_interpreted) - * SHA256_CYCLE_FRACTION.clone() + let precompile_interpreted = data.src0_value.value.0[3] as f32; + PRECOMPILE_CALL_COMMON_FRACTION_F32 + + precompile_interpreted * SHA256_CYCLE_FRACTION_F32 } a if a == ECRECOVER_PRECOMPILE_ADDRESS => { - PRECOMPILE_CALL_COMMON_FRACTION.clone() + ECRECOVER_CYCLE_FRACTION.clone() + PRECOMPILE_CALL_COMMON_FRACTION_F32 + ECRECOVER_CYCLE_FRACTION_F32 } - _ => PRECOMPILE_CALL_COMMON_FRACTION.clone(), + _ => PRECOMPILE_CALL_COMMON_FRACTION_F32, } } - Opcode::FarCall(_) => FAR_CALL_FRACTION.clone(), - Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => { - UMA_WRITE_FRACTION.clone() - } + Opcode::FarCall(_) => FAR_CALL_FRACTION_F32, + Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => UMA_WRITE_FRACTION_F32, Opcode::UMA( UMAOpcode::AuxHeapRead | UMAOpcode::HeapRead | UMAOpcode::FatPointerRead, - ) => UMA_READ_FRACTION.clone(), + ) => UMA_READ_FRACTION_F32, Opcode::Invalid(_) => unreachable!(), // invalid opcodes are never executed }; @@ -152,8 +213,11 @@ impl VmTracer for CircuitsTracer { // Each cycle of `CodeDecommitter` processes 64 bits. let decommitter_cycles_used = bytecode_len / 4; - self.estimated_circuits_used += BigDecimal::from(decommitter_cycles_used as u64) - * CODE_DECOMMITTER_CYCLE_FRACTION.clone(); + // self.estimated_circuits_used += BigDecimal::from(decommitter_cycles_used as u64) + // * CODE_DECOMMITTER_CYCLE_FRACTION.clone(); + + self.estimated_circuits_used += + (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION_F32; } self.last_decommitment_history_entry_checked = Some(history.len()); From 812f2112d0ac26ee194116af8bc94ad551600ef5 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 17:33:57 +0200 Subject: [PATCH 11/27] Clean up --- Cargo.lock | 1 - core/lib/multivm/Cargo.toml | 1 - .../vm_latest/implementation/execution.rs | 4 +- .../vm_latest/tracers/circuits_capacity.rs | 203 +++++------------- .../vm_latest/tracers/circuits_tracer.rs | 104 ++------- 5 files changed, 70 insertions(+), 243 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cca2eb82baa9..6428a95d68e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3995,7 +3995,6 @@ name = "multivm" version = "0.1.0" dependencies = [ "anyhow", - "bigdecimal", "ethabi", "hex", "itertools", diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index e60fa7d21b69..25a7a2857ee8 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -30,7 +30,6 @@ once_cell = "1.7" thiserror = "1.0" tracing = "0.1" vise = { git = "https://github.com/matter-labs/vise.git", version = "0.1.0", rev = "dd05139b76ab0843443ab3ff730174942c825dae" } -bigdecimal = "0.2.2" [dev-dependencies] tokio = { version = "1", features = ["time"] } diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs index 99d04ad86113..dc2aace0de85 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs @@ -1,4 +1,3 @@ -use bigdecimal::{BigDecimal, ToPrimitive}; use zk_evm_1_4_0::aux_structures::Timestamp; use zksync_state::WriteStorage; @@ -72,9 +71,8 @@ impl Vm { .map(|x| (x.get_refunds(), x.pubdata_published())) .unwrap_or_default(); - // Ceil and convert to usize. let estimated_circuits_used = - (tx_tracer.circuits_tracer.estimated_circuits_used + 0.5).round() as usize; + tx_tracer.circuits_tracer.estimated_circuits_used.ceil() as usize; let statistics = self.get_statistics( timestamp_initial, diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs index c7f8d364359b..53889a370452 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -1,175 +1,76 @@ -use bigdecimal::BigDecimal; -use once_cell::sync::Lazy; use zkevm_test_harness_1_4_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); -const OVERESTIMATE_PERCENT: u32 = 5; +const OVERESTIMATE_PERCENT: f32 = 1.05; -fn calculate_fraction(cycles_per_circuit: u32) -> BigDecimal { - (BigDecimal::from(1) / BigDecimal::from(cycles_per_circuit) - * (BigDecimal::from(1) + BigDecimal::from(OVERESTIMATE_PERCENT) / BigDecimal::from(100))) - .with_prec(8) -} +const MAIN_VM_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_vm_snapshot as f32; -static MAIN_VM_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_vm_snapshot)); +const CODE_DECOMMITTER_SORTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_code_decommitter_sorter as f32; -static CODE_DECOMMITTER_SORTER_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_code_decommitter_sorter)); +const LOG_DEMUXER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_log_demuxer as f32; -static LOG_DEMUXER_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_log_demuxer)); +const STORAGE_SORTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_storage_sorter as f32; -static STORAGE_SORTER_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_storage_sorter)); +const EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter as f32; -static EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter)); +const RAM_PERMUTATION_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_ram_permutation as f32; -static RAM_PERMUTATION_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_ram_permutation)); +pub(crate) const CODE_DECOMMITTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_code_decommitter as f32; -pub(crate) static CODE_DECOMMITTER_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_code_decommitter)); +const STORAGE_APPLICATION_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_storage_application as f32; -static STORAGE_APPLICATION_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_storage_application)); +pub(crate) const KECCAK256_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_keccak256_circuit as f32; -pub(crate) static KECCAK256_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_keccak256_circuit)); +pub(crate) const SHA256_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_sha256_circuit as f32; -pub(crate) static SHA256_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_sha256_circuit)); +pub(crate) const ECRECOVER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_ecrecover_circuit as f32; -pub(crate) static ECRECOVER_CYCLE_FRACTION: Lazy = - Lazy::new(|| calculate_fraction(GEOMETRY_CONFIG.cycles_per_ecrecover_circuit)); +pub(crate) const RICH_ADDRESSING_OPCODE_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; -pub(crate) static RICH_ADDRESSING_OPCODE_FRACTION: Lazy = Lazy::new(|| { - MAIN_VM_CYCLE_FRACTION.clone() + BigDecimal::from(3) * RAM_PERMUTATION_CYCLE_FRACTION.clone() -}); +pub(crate) const AVERAGE_OPCODE_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION; -pub(crate) static AVERAGE_OPCODE_FRACTION: Lazy = - Lazy::new(|| MAIN_VM_CYCLE_FRACTION.clone() + RAM_PERMUTATION_CYCLE_FRACTION.clone()); +pub(crate) const STORAGE_READ_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + LOG_DEMUXER_CYCLE_FRACTION + + STORAGE_SORTER_CYCLE_FRACTION + + STORAGE_APPLICATION_CYCLE_FRACTION; -pub(crate) static STORAGE_READ_FRACTION: Lazy = Lazy::new(|| { - MAIN_VM_CYCLE_FRACTION.clone() - + RAM_PERMUTATION_CYCLE_FRACTION.clone() - + LOG_DEMUXER_CYCLE_FRACTION.clone() - + STORAGE_SORTER_CYCLE_FRACTION.clone() - + STORAGE_APPLICATION_CYCLE_FRACTION.clone() -}); +pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION; -pub(crate) static EVENT_OR_L1_MESSAGE_FRACTION: Lazy = Lazy::new(|| { - BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() - + RAM_PERMUTATION_CYCLE_FRACTION.clone() - + BigDecimal::from(2) * LOG_DEMUXER_CYCLE_FRACTION.clone() - + BigDecimal::from(2) * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION.clone() -}); +pub(crate) const HOT_STORAGE_WRITE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + + 2.0 * STORAGE_SORTER_CYCLE_FRACTION; -pub(crate) static HOT_STORAGE_WRITE_FRACTION: Lazy = Lazy::new(|| { - BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() - + RAM_PERMUTATION_CYCLE_FRACTION.clone() - + BigDecimal::from(2) * LOG_DEMUXER_CYCLE_FRACTION.clone() - + BigDecimal::from(2) * STORAGE_SORTER_CYCLE_FRACTION.clone() -}); +pub(crate) const COLD_STORAGE_WRITE_FRACTION: f32 = + HOT_STORAGE_WRITE_FRACTION + 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION; -pub(crate) static COLD_STORAGE_WRITE_FRACTION: Lazy = Lazy::new(|| { - HOT_STORAGE_WRITE_FRACTION.clone() - + BigDecimal::from(2) * STORAGE_APPLICATION_CYCLE_FRACTION.clone() -}); +pub(crate) const FAR_CALL_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + STORAGE_SORTER_CYCLE_FRACTION + + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION; -pub(crate) static FAR_CALL_FRACTION: Lazy = Lazy::new(|| { - BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() - + RAM_PERMUTATION_CYCLE_FRACTION.clone() - + STORAGE_SORTER_CYCLE_FRACTION.clone() - + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION.clone() -}); +pub(crate) const UMA_WRITE_FRACTION: f32 = + 2.0 * MAIN_VM_CYCLE_FRACTION + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION; -pub(crate) static UMA_WRITE_FRACTION: Lazy = Lazy::new(|| { - BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() - + BigDecimal::from(5) * RAM_PERMUTATION_CYCLE_FRACTION.clone() -}); +pub(crate) const UMA_READ_FRACTION: f32 = + 2.0 * MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; -pub(crate) static UMA_READ_FRACTION: Lazy = Lazy::new(|| { - BigDecimal::from(2) * MAIN_VM_CYCLE_FRACTION.clone() - + BigDecimal::from(3) * RAM_PERMUTATION_CYCLE_FRACTION.clone() -}); - -pub(crate) static PRECOMPILE_CALL_COMMON_FRACTION: Lazy = Lazy::new(|| { - MAIN_VM_CYCLE_FRACTION.clone() - + RAM_PERMUTATION_CYCLE_FRACTION.clone() - + LOG_DEMUXER_CYCLE_FRACTION.clone() -}); - -// f32 - -const MAIN_VM_CYCLE_FRACTION_F32: f32 = 1.05 / GEOMETRY_CONFIG.cycles_per_vm_snapshot as f32; - -const CODE_DECOMMITTER_SORTER_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_code_decommitter_sorter as f32; - -const LOG_DEMUXER_CYCLE_FRACTION_F32: f32 = 1.05 / GEOMETRY_CONFIG.cycles_per_log_demuxer as f32; - -const STORAGE_SORTER_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_storage_sorter as f32; - -const EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter as f32; - -const RAM_PERMUTATION_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_ram_permutation as f32; - -pub(crate) const CODE_DECOMMITTER_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_code_decommitter as f32; - -const STORAGE_APPLICATION_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_storage_application as f32; - -pub(crate) const KECCAK256_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_keccak256_circuit as f32; - -pub(crate) const SHA256_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_sha256_circuit as f32; - -pub(crate) const ECRECOVER_CYCLE_FRACTION_F32: f32 = - 1.05 / GEOMETRY_CONFIG.cycles_per_ecrecover_circuit as f32; - -pub(crate) const RICH_ADDRESSING_OPCODE_FRACTION_F32: f32 = - MAIN_VM_CYCLE_FRACTION_F32 + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION_F32; - -pub(crate) const AVERAGE_OPCODE_FRACTION_F32: f32 = - MAIN_VM_CYCLE_FRACTION_F32 + RAM_PERMUTATION_CYCLE_FRACTION_F32; - -pub(crate) const STORAGE_READ_FRACTION_F32: f32 = MAIN_VM_CYCLE_FRACTION_F32 - + RAM_PERMUTATION_CYCLE_FRACTION_F32 - + LOG_DEMUXER_CYCLE_FRACTION_F32 - + STORAGE_SORTER_CYCLE_FRACTION_F32 - + STORAGE_APPLICATION_CYCLE_FRACTION_F32; - -pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION_F32: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION_F32 - + RAM_PERMUTATION_CYCLE_FRACTION_F32 - + 2.0 * LOG_DEMUXER_CYCLE_FRACTION_F32 - + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION_F32; - -pub(crate) const HOT_STORAGE_WRITE_FRACTION_F32: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION_F32 - + RAM_PERMUTATION_CYCLE_FRACTION_F32 - + 2.0 * LOG_DEMUXER_CYCLE_FRACTION_F32 - + 2.0 * STORAGE_SORTER_CYCLE_FRACTION_F32; - -pub(crate) const COLD_STORAGE_WRITE_FRACTION_F32: f32 = - HOT_STORAGE_WRITE_FRACTION_F32 + 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION_F32; - -pub(crate) const FAR_CALL_FRACTION_F32: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION_F32 - + RAM_PERMUTATION_CYCLE_FRACTION_F32 - + STORAGE_SORTER_CYCLE_FRACTION_F32 - + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION_F32; - -pub(crate) const UMA_WRITE_FRACTION_F32: f32 = - 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION_F32; - -pub(crate) const UMA_READ_FRACTION_F32: f32 = - 2.0 * MAIN_VM_CYCLE_FRACTION_F32 + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION_F32; - -pub(crate) const PRECOMPILE_CALL_COMMON_FRACTION_F32: f32 = MAIN_VM_CYCLE_FRACTION_F32 - + RAM_PERMUTATION_CYCLE_FRACTION_F32 - + LOG_DEMUXER_CYCLE_FRACTION_F32; +pub(crate) const PRECOMPILE_CALL_COMMON_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + LOG_DEMUXER_CYCLE_FRACTION; diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index 9bd7a22ab96b..6c77c8175838 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -1,6 +1,5 @@ use std::marker::PhantomData; -use bigdecimal::{BigDecimal, Zero}; use zk_evm_1_4_0::{ tracing::{BeforeExecutionData, VmLocalStateData}, zkevm_opcode_defs::{LogOpcode, Opcode, UMAOpcode}, @@ -49,70 +48,6 @@ impl DynTracer> for Circuits _memory: &SimpleMemory, _storage: StoragePtr, ) { - // let used = match data.opcode.variant.opcode { - // Opcode::Nop(_) - // | Opcode::Add(_) - // | Opcode::Sub(_) - // | Opcode::Mul(_) - // | Opcode::Div(_) - // | Opcode::Jump(_) - // | Opcode::Binop(_) - // | Opcode::Shift(_) - // | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION.clone(), - // Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => { - // AVERAGE_OPCODE_FRACTION.clone() - // } - // Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION.clone(), - // Opcode::Log(LogOpcode::StorageWrite) => { - // COLD_STORAGE_WRITE_FRACTION.clone() - // // let storage_key = StorageKey::new( - // // AccountTreeId::new(state.vm_local_state.callstack.current.this_address), - // // u256_to_h256(data.src0_value.value), - // // ); - // // - // // let first_write = !storage - // // .borrow() - // // .modified_storage_keys() - // // .contains_key(&storage_key); - // // if first_write { - // // COLD_STORAGE_WRITE_FRACTION.clone() - // // } else { - // // HOT_STORAGE_WRITE_FRACTION.clone() - // // } - // } - // Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { - // EVENT_OR_L1_MESSAGE_FRACTION.clone() - // } - // Opcode::Log(LogOpcode::PrecompileCall) => { - // match state.vm_local_state.callstack.current.this_address { - // a if a == KECCAK256_PRECOMPILE_ADDRESS => { - // let precompile_interpreted = data.src0_value.value.0[3]; - // PRECOMPILE_CALL_COMMON_FRACTION.clone() - // + BigDecimal::from(precompile_interpreted) - // * KECCAK256_CYCLE_FRACTION.clone() - // } - // a if a == SHA256_PRECOMPILE_ADDRESS => { - // let precompile_interpreted = data.src0_value.value.0[3]; - // PRECOMPILE_CALL_COMMON_FRACTION.clone() - // + BigDecimal::from(precompile_interpreted) - // * SHA256_CYCLE_FRACTION.clone() - // } - // a if a == ECRECOVER_PRECOMPILE_ADDRESS => { - // PRECOMPILE_CALL_COMMON_FRACTION.clone() + ECRECOVER_CYCLE_FRACTION.clone() - // } - // _ => PRECOMPILE_CALL_COMMON_FRACTION.clone(), - // } - // } - // Opcode::FarCall(_) => FAR_CALL_FRACTION.clone(), - // Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => { - // UMA_WRITE_FRACTION.clone() - // } - // Opcode::UMA( - // UMAOpcode::AuxHeapRead | UMAOpcode::HeapRead | UMAOpcode::FatPointerRead, - // ) => UMA_READ_FRACTION.clone(), - // Opcode::Invalid(_) => unreachable!(), // invalid opcodes are never executed - // }; - let used = match data.opcode.variant.opcode { Opcode::Nop(_) | Opcode::Add(_) @@ -122,13 +57,11 @@ impl DynTracer> for Circuits | Opcode::Jump(_) | Opcode::Binop(_) | Opcode::Shift(_) - | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION_F32, - Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => { - AVERAGE_OPCODE_FRACTION_F32 - } - Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION_F32, + | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION, + Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => AVERAGE_OPCODE_FRACTION, + Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION, Opcode::Log(LogOpcode::StorageWrite) => { - COLD_STORAGE_WRITE_FRACTION_F32 + COLD_STORAGE_WRITE_FRACTION // let storage_key = StorageKey::new( // AccountTreeId::new(state.vm_local_state.callstack.current.this_address), // u256_to_h256(data.src0_value.value), @@ -139,37 +72,37 @@ impl DynTracer> for Circuits // .modified_storage_keys() // .contains_key(&storage_key); // if first_write { - // COLD_STORAGE_WRITE_FRACTION_F32 + // COLD_STORAGE_WRITE_FRACTION // } else { - // HOT_STORAGE_WRITE_FRACTION_F32 + // HOT_STORAGE_WRITE_FRACTION // } } Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { - EVENT_OR_L1_MESSAGE_FRACTION_F32 + EVENT_OR_L1_MESSAGE_FRACTION } Opcode::Log(LogOpcode::PrecompileCall) => { match state.vm_local_state.callstack.current.this_address { a if a == KECCAK256_PRECOMPILE_ADDRESS => { let precompile_interpreted = data.src0_value.value.0[3] as f32; - PRECOMPILE_CALL_COMMON_FRACTION_F32 - + precompile_interpreted * KECCAK256_CYCLE_FRACTION_F32 + PRECOMPILE_CALL_COMMON_FRACTION + + precompile_interpreted * KECCAK256_CYCLE_FRACTION } a if a == SHA256_PRECOMPILE_ADDRESS => { let precompile_interpreted = data.src0_value.value.0[3] as f32; - PRECOMPILE_CALL_COMMON_FRACTION_F32 - + precompile_interpreted * SHA256_CYCLE_FRACTION_F32 + PRECOMPILE_CALL_COMMON_FRACTION + + precompile_interpreted * SHA256_CYCLE_FRACTION } a if a == ECRECOVER_PRECOMPILE_ADDRESS => { - PRECOMPILE_CALL_COMMON_FRACTION_F32 + ECRECOVER_CYCLE_FRACTION_F32 + PRECOMPILE_CALL_COMMON_FRACTION + ECRECOVER_CYCLE_FRACTION } - _ => PRECOMPILE_CALL_COMMON_FRACTION_F32, + _ => PRECOMPILE_CALL_COMMON_FRACTION, } } - Opcode::FarCall(_) => FAR_CALL_FRACTION_F32, - Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => UMA_WRITE_FRACTION_F32, + Opcode::FarCall(_) => FAR_CALL_FRACTION, + Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => UMA_WRITE_FRACTION, Opcode::UMA( UMAOpcode::AuxHeapRead | UMAOpcode::HeapRead | UMAOpcode::FatPointerRead, - ) => UMA_READ_FRACTION_F32, + ) => UMA_READ_FRACTION, Opcode::Invalid(_) => unreachable!(), // invalid opcodes are never executed }; @@ -213,11 +146,8 @@ impl VmTracer for CircuitsTracer { // Each cycle of `CodeDecommitter` processes 64 bits. let decommitter_cycles_used = bytecode_len / 4; - // self.estimated_circuits_used += BigDecimal::from(decommitter_cycles_used as u64) - // * CODE_DECOMMITTER_CYCLE_FRACTION.clone(); - self.estimated_circuits_used += - (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION_F32; + (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION; } self.last_decommitment_history_entry_checked = Some(history.len()); From 569a493aa7968ed04a1442e0a13d4f4fa81cbe8a Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 21 Dec 2023 18:11:17 +0200 Subject: [PATCH 12/27] Track hot write and reads --- .../src/versions/vm_latest/oracles/storage.rs | 21 +++++- .../vm_latest/tracers/circuits_capacity.rs | 12 ++-- .../vm_latest/tracers/circuits_tracer.rs | 65 +++++++++++++------ 3 files changed, 68 insertions(+), 30 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs index 2b6b5988e06e..b59507a02fdc 100644 --- a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs @@ -59,6 +59,10 @@ pub struct StorageOracle { // Storage refunds that oracle has returned in `estimate_refunds_for_write`. pub(crate) returned_refunds: HistoryRecorder, H>, + + // + pub(crate) hot_writes: HistoryRecorder, HistoryEnabled>, + pub(crate) hot_reads: HistoryRecorder, HistoryEnabled>, } impl OracleWithHistory for StorageOracle { @@ -69,6 +73,8 @@ impl OracleWithHistory for StorageOracle { self.paid_changes.rollback_to_timestamp(timestamp); self.initial_values.rollback_to_timestamp(timestamp); self.returned_refunds.rollback_to_timestamp(timestamp); + self.hot_writes.rollback_to_timestamp(timestamp); + self.hot_reads.rollback_to_timestamp(timestamp); } } @@ -81,6 +87,8 @@ impl StorageOracle { paid_changes: Default::default(), initial_values: Default::default(), returned_refunds: Default::default(), + hot_writes: Default::default(), + hot_reads: Default::default(), } } @@ -91,6 +99,8 @@ impl StorageOracle { self.paid_changes.delete_history(); self.initial_values.delete_history(); self.returned_refunds.delete_history(); + self.hot_writes.delete_history(); + self.hot_reads.delete_history(); } fn is_storage_key_free(&self, key: &StorageKey) -> bool { @@ -108,8 +118,12 @@ impl StorageOracle { } } - pub fn read_value(&mut self, mut query: LogQuery) -> LogQuery { + fn read_value(&mut self, mut query: LogQuery) -> LogQuery { let key = triplet_to_storage_key(query.shard_id, query.address, query.key); + + if !self.hot_reads.inner().contains_key(&key) { + self.hot_reads.insert(key, (), query.timestamp); + } let current_value = self.storage.read_from_storage(&key); query.read_value = current_value; @@ -127,8 +141,11 @@ impl StorageOracle { query } - pub fn write_value(&mut self, query: LogQuery) -> LogQuery { + fn write_value(&mut self, query: LogQuery) -> LogQuery { let key = triplet_to_storage_key(query.shard_id, query.address, query.key); + if !self.hot_writes.inner().contains_key(&key) { + self.hot_writes.insert(key, (), query.timestamp); + } let current_value = self.storage .write_to_storage(key, query.written_value, query.timestamp); diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs index 53889a370452..22a058d8ff8f 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -24,7 +24,7 @@ const RAM_PERMUTATION_CYCLE_FRACTION: f32 = pub(crate) const CODE_DECOMMITTER_CYCLE_FRACTION: f32 = OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_code_decommitter as f32; -const STORAGE_APPLICATION_CYCLE_FRACTION: f32 = +pub(crate) const STORAGE_APPLICATION_CYCLE_FRACTION: f32 = OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_storage_application as f32; pub(crate) const KECCAK256_CYCLE_FRACTION: f32 = @@ -42,25 +42,21 @@ pub(crate) const RICH_ADDRESSING_OPCODE_FRACTION: f32 = pub(crate) const AVERAGE_OPCODE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION; -pub(crate) const STORAGE_READ_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION +pub(crate) const STORAGE_READ_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + LOG_DEMUXER_CYCLE_FRACTION - + STORAGE_SORTER_CYCLE_FRACTION - + STORAGE_APPLICATION_CYCLE_FRACTION; + + STORAGE_SORTER_CYCLE_FRACTION; pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION; -pub(crate) const HOT_STORAGE_WRITE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION +pub(crate) const STORAGE_WRITE_BASE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + 2.0 * STORAGE_SORTER_CYCLE_FRACTION; -pub(crate) const COLD_STORAGE_WRITE_FRACTION: f32 = - HOT_STORAGE_WRITE_FRACTION + 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION; - pub(crate) const FAR_CALL_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + STORAGE_SORTER_CYCLE_FRACTION diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index 6c77c8175838..142adf1a99ee 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -8,8 +8,6 @@ use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::{ ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS, }; -use zksync_types::{AccountTreeId, StorageKey}; -use zksync_utils::u256_to_h256; use super::circuits_capacity::*; use crate::{ @@ -27,6 +25,8 @@ use crate::{ pub(crate) struct CircuitsTracer { pub(crate) estimated_circuits_used: f32, last_decommitment_history_entry_checked: Option, + last_hot_writes_history_entry_checked: Option, + last_hot_reads_history_entry_checked: Option, _phantom_data: PhantomData, } @@ -35,6 +35,8 @@ impl CircuitsTracer { Self { estimated_circuits_used: 0.0, last_decommitment_history_entry_checked: None, + last_hot_writes_history_entry_checked: None, + last_hot_reads_history_entry_checked: None, _phantom_data: Default::default(), } } @@ -59,24 +61,8 @@ impl DynTracer> for Circuits | Opcode::Shift(_) | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION, Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => AVERAGE_OPCODE_FRACTION, - Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_FRACTION, - Opcode::Log(LogOpcode::StorageWrite) => { - COLD_STORAGE_WRITE_FRACTION - // let storage_key = StorageKey::new( - // AccountTreeId::new(state.vm_local_state.callstack.current.this_address), - // u256_to_h256(data.src0_value.value), - // ); - // - // let first_write = !storage - // .borrow() - // .modified_storage_keys() - // .contains_key(&storage_key); - // if first_write { - // COLD_STORAGE_WRITE_FRACTION - // } else { - // HOT_STORAGE_WRITE_FRACTION - // } - } + Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_BASE_FRACTION, + Opcode::Log(LogOpcode::StorageWrite) => STORAGE_WRITE_BASE_FRACTION, Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { EVENT_OR_L1_MESSAGE_FRACTION } @@ -119,6 +105,10 @@ impl VmTracer for CircuitsTracer { .history() .len(), ); + + self.last_hot_writes_history_entry_checked = Some(state.storage.hot_writes.history().len()); + + self.last_hot_reads_history_entry_checked = Some(state.storage.hot_reads.history().len()); } fn finish_cycle( @@ -126,6 +116,7 @@ impl VmTracer for CircuitsTracer { state: &mut ZkSyncVmState, _bootloader_state: &mut BootloaderState, ) -> TracerExecutionStatus { + // Trace decommitments. let last_decommitment_history_entry_checked = self .last_decommitment_history_entry_checked .expect("Value must be set during init"); @@ -151,6 +142,40 @@ impl VmTracer for CircuitsTracer { } self.last_decommitment_history_entry_checked = Some(history.len()); + // Process storage writes + let last_writes_history_entry_checked = self + .last_hot_writes_history_entry_checked + .expect("Value must be set during init"); + let history = state.storage.hot_writes.history(); + for (_, history_event) in &history[last_writes_history_entry_checked..] { + // We assume that only insertions may happen during a single VM inspection. + assert!(history_event.value.is_some()); + + self.estimated_circuits_used += 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION; + } + self.last_hot_writes_history_entry_checked = Some(history.len()); + + // Process storage reads + let last_reads_history_entry_checked = self + .last_hot_reads_history_entry_checked + .expect("Value must be set during init"); + let history = state.storage.hot_reads.history(); + for (_, history_event) in &history[last_reads_history_entry_checked..] { + // We assume that only insertions may happen during a single VM inspection. + assert!(history_event.value.is_some()); + + // If the slot was already written to, then we already take 2 cycles into account. + if !state + .storage + .hot_writes + .inner() + .contains_key(&history_event.key) + { + self.estimated_circuits_used += STORAGE_APPLICATION_CYCLE_FRACTION; + } + } + self.last_hot_reads_history_entry_checked = Some(history.len()); + TracerExecutionStatus::Continue } } From df9b7df365b29140e9ca59d7ebac9829e5d49f66 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Fri, 22 Dec 2023 10:36:38 +0200 Subject: [PATCH 13/27] Add comment --- core/lib/multivm/src/versions/vm_latest/oracles/storage.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs index b59507a02fdc..46de667488ae 100644 --- a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs @@ -60,8 +60,9 @@ pub struct StorageOracle { // Storage refunds that oracle has returned in `estimate_refunds_for_write`. pub(crate) returned_refunds: HistoryRecorder, H>, - // + // Keeps track of storage keys that were written to. pub(crate) hot_writes: HistoryRecorder, HistoryEnabled>, + // Keeps track of storage keys that were read. pub(crate) hot_reads: HistoryRecorder, HistoryEnabled>, } From fae2f1f1ee9e3e23a274d25b8a25f10d98b443e2 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Tue, 2 Jan 2024 12:36:55 +0200 Subject: [PATCH 14/27] Apply some review suggestions --- .../src/versions/vm_latest/oracles/storage.rs | 24 +++++++------- .../vm_latest/tracers/circuits_capacity.rs | 10 +++--- .../vm_latest/tracers/circuits_tracer.rs | 31 ++++++++++--------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs index 46de667488ae..2fe0931b6263 100644 --- a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs @@ -61,9 +61,9 @@ pub struct StorageOracle { pub(crate) returned_refunds: HistoryRecorder, H>, // Keeps track of storage keys that were written to. - pub(crate) hot_writes: HistoryRecorder, HistoryEnabled>, + pub(crate) written_keys: HistoryRecorder, HistoryEnabled>, // Keeps track of storage keys that were read. - pub(crate) hot_reads: HistoryRecorder, HistoryEnabled>, + pub(crate) read_keys: HistoryRecorder, HistoryEnabled>, } impl OracleWithHistory for StorageOracle { @@ -74,8 +74,8 @@ impl OracleWithHistory for StorageOracle { self.paid_changes.rollback_to_timestamp(timestamp); self.initial_values.rollback_to_timestamp(timestamp); self.returned_refunds.rollback_to_timestamp(timestamp); - self.hot_writes.rollback_to_timestamp(timestamp); - self.hot_reads.rollback_to_timestamp(timestamp); + self.written_keys.rollback_to_timestamp(timestamp); + self.read_keys.rollback_to_timestamp(timestamp); } } @@ -88,8 +88,8 @@ impl StorageOracle { paid_changes: Default::default(), initial_values: Default::default(), returned_refunds: Default::default(), - hot_writes: Default::default(), - hot_reads: Default::default(), + written_keys: Default::default(), + read_keys: Default::default(), } } @@ -100,8 +100,8 @@ impl StorageOracle { self.paid_changes.delete_history(); self.initial_values.delete_history(); self.returned_refunds.delete_history(); - self.hot_writes.delete_history(); - self.hot_reads.delete_history(); + self.written_keys.delete_history(); + self.read_keys.delete_history(); } fn is_storage_key_free(&self, key: &StorageKey) -> bool { @@ -122,8 +122,8 @@ impl StorageOracle { fn read_value(&mut self, mut query: LogQuery) -> LogQuery { let key = triplet_to_storage_key(query.shard_id, query.address, query.key); - if !self.hot_reads.inner().contains_key(&key) { - self.hot_reads.insert(key, (), query.timestamp); + if !self.read_keys.inner().contains_key(&key) { + self.read_keys.insert(key, (), query.timestamp); } let current_value = self.storage.read_from_storage(&key); @@ -144,8 +144,8 @@ impl StorageOracle { fn write_value(&mut self, query: LogQuery) -> LogQuery { let key = triplet_to_storage_key(query.shard_id, query.address, query.key); - if !self.hot_writes.inner().contains_key(&key) { - self.hot_writes.insert(key, (), query.timestamp); + if !self.written_keys.inner().contains_key(&key) { + self.written_keys.insert(key, (), query.timestamp); } let current_value = self.storage diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs index 22a058d8ff8f..006c95a85846 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -47,26 +47,26 @@ pub(crate) const STORAGE_READ_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + LOG_DEMUXER_CYCLE_FRACTION + STORAGE_SORTER_CYCLE_FRACTION; -pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION +pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION; -pub(crate) const STORAGE_WRITE_BASE_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION +pub(crate) const STORAGE_WRITE_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + 2.0 * STORAGE_SORTER_CYCLE_FRACTION; -pub(crate) const FAR_CALL_FRACTION: f32 = 2.0 * MAIN_VM_CYCLE_FRACTION +pub(crate) const FAR_CALL_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + STORAGE_SORTER_CYCLE_FRACTION + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION; pub(crate) const UMA_WRITE_FRACTION: f32 = - 2.0 * MAIN_VM_CYCLE_FRACTION + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION; + MAIN_VM_CYCLE_FRACTION + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION; pub(crate) const UMA_READ_FRACTION: f32 = - 2.0 * MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; + MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; pub(crate) const PRECOMPILE_CALL_COMMON_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + LOG_DEMUXER_CYCLE_FRACTION; diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index 142adf1a99ee..db36aecbe0d4 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -25,8 +25,8 @@ use crate::{ pub(crate) struct CircuitsTracer { pub(crate) estimated_circuits_used: f32, last_decommitment_history_entry_checked: Option, - last_hot_writes_history_entry_checked: Option, - last_hot_reads_history_entry_checked: Option, + last_written_keys_history_entry_checked: Option, + last_read_keys_history_entry_checked: Option, _phantom_data: PhantomData, } @@ -35,8 +35,8 @@ impl CircuitsTracer { Self { estimated_circuits_used: 0.0, last_decommitment_history_entry_checked: None, - last_hot_writes_history_entry_checked: None, - last_hot_reads_history_entry_checked: None, + last_written_keys_history_entry_checked: None, + last_read_keys_history_entry_checked: None, _phantom_data: Default::default(), } } @@ -106,9 +106,10 @@ impl VmTracer for CircuitsTracer { .len(), ); - self.last_hot_writes_history_entry_checked = Some(state.storage.hot_writes.history().len()); + self.last_written_keys_history_entry_checked = + Some(state.storage.written_keys.history().len()); - self.last_hot_reads_history_entry_checked = Some(state.storage.hot_reads.history().len()); + self.last_read_keys_history_entry_checked = Some(state.storage.read_keys.history().len()); } fn finish_cycle( @@ -135,7 +136,7 @@ impl VmTracer for CircuitsTracer { .expect("Bytecode must be known at this point") .len(); - // Each cycle of `CodeDecommitter` processes 64 bits. + // Each cycle of `CodeDecommitter` processes 64 bytes. let decommitter_cycles_used = bytecode_len / 4; self.estimated_circuits_used += (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION; @@ -144,37 +145,37 @@ impl VmTracer for CircuitsTracer { // Process storage writes let last_writes_history_entry_checked = self - .last_hot_writes_history_entry_checked + .last_written_keys_history_entry_checked .expect("Value must be set during init"); - let history = state.storage.hot_writes.history(); + let history = state.storage.written_keys.history(); for (_, history_event) in &history[last_writes_history_entry_checked..] { // We assume that only insertions may happen during a single VM inspection. assert!(history_event.value.is_some()); self.estimated_circuits_used += 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION; } - self.last_hot_writes_history_entry_checked = Some(history.len()); + self.last_written_keys_history_entry_checked = Some(history.len()); // Process storage reads let last_reads_history_entry_checked = self - .last_hot_reads_history_entry_checked + .last_read_keys_history_entry_checked .expect("Value must be set during init"); - let history = state.storage.hot_reads.history(); + let history = state.storage.read_keys.history(); for (_, history_event) in &history[last_reads_history_entry_checked..] { // We assume that only insertions may happen during a single VM inspection. assert!(history_event.value.is_some()); - // If the slot was already written to, then we already take 2 cycles into account. + // If the slot is already written to, then we've already taken 2 cycles into account. if !state .storage - .hot_writes + .written_keys .inner() .contains_key(&history_event.key) { self.estimated_circuits_used += STORAGE_APPLICATION_CYCLE_FRACTION; } } - self.last_hot_reads_history_entry_checked = Some(history.len()); + self.last_read_keys_history_entry_checked = Some(history.len()); TracerExecutionStatus::Continue } From 8a487a228a855de0308650709062d1fa891b9e7f Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Tue, 2 Jan 2024 17:47:38 +0200 Subject: [PATCH 15/27] Use updated zk_evm_abstractions --- Cargo.lock | 64 ++++++++++++--- core/lib/commitment_utils/src/lib.rs | 1 + core/lib/multivm/Cargo.toml | 4 +- .../vm_latest/old_vm/oracles/precompile.rs | 78 +++++++++++++++---- .../vm_latest/types/internals/vm_state.rs | 4 +- core/lib/types/Cargo.toml | 6 +- 6 files changed, 124 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6428a95d68e6..2b4b9be96fc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1230,7 +1230,7 @@ dependencies = [ "derivative", "serde", "snark_wrapper", - "zk_evm 1.4.0", + "zk_evm 1.4.0 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.4.0)", "zkevm_circuits", ] @@ -4004,8 +4004,8 @@ dependencies = [ "tracing", "vise", "zk_evm 1.3.1", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", - "zk_evm 1.4.0", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum)", + "zk_evm 1.4.0 (git+https://github.com/matter-labs/era-zk_evm.git?branch=perekopskiy-add-precompiles-enum)", "zkevm_test_harness 1.4.0", "zksync_contracts", "zksync_eth_signer", @@ -8013,7 +8013,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions", + "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git)", "zkevm_opcode_defs 1.3.2", ] @@ -8028,7 +8028,37 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions", + "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git)", + "zkevm_opcode_defs 1.3.2", +] + +[[package]] +name = "zk_evm" +version = "1.3.3" +source = "git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum#3d76dadc419b862a89a00731066a8e0aa863f608" +dependencies = [ + "anyhow", + "lazy_static", + "num 0.4.1", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git?branch=perekopskiy-add-precompiles-enum)", + "zkevm_opcode_defs 1.3.2", +] + +[[package]] +name = "zk_evm" +version = "1.4.0" +source = "git+https://github.com/matter-labs/era-zk_evm.git?branch=perekopskiy-add-precompiles-enum#405220c7ca48b1f1d11a2e6dad5d9f78e3adb834" +dependencies = [ + "anyhow", + "lazy_static", + "num 0.4.1", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git?branch=perekopskiy-add-precompiles-enum)", "zkevm_opcode_defs 1.3.2", ] @@ -8043,7 +8073,19 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions", + "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git)", + "zkevm_opcode_defs 1.3.2", +] + +[[package]] +name = "zk_evm_abstractions" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git?branch=perekopskiy-add-precompiles-enum#72aee66dc059ae73f97d2843da7da50df56efc4a" +dependencies = [ + "anyhow", + "num_enum", + "serde", + "static_assertions", "zkevm_opcode_defs 1.3.2", ] @@ -8125,14 +8167,14 @@ dependencies = [ [[package]] name = "zkevm_test_harness" version = "1.3.3" -source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=v1.3.3#d52b56d6ba8196c8a3c74c4933654469e6f27a5a" +source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=perekopskiy-add-precompiles-enum#3a1b229e5c8abf971a7cfc4cd1dd757d1700b455" dependencies = [ "bincode", "circuit_testing", "codegen 0.2.0", "crossbeam 0.8.2", "derivative", - "env_logger 0.10.0", + "env_logger 0.9.3", "hex", "num-bigint 0.4.4", "num-integer", @@ -8145,7 +8187,7 @@ dependencies = [ "sync_vm", "test-log", "tracing", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3)", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum)", "zkevm-assembly", ] @@ -8897,8 +8939,8 @@ dependencies = [ "strum", "thiserror", "tokio", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", - "zk_evm 1.4.0", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum)", + "zk_evm 1.4.0 (git+https://github.com/matter-labs/era-zk_evm.git?branch=perekopskiy-add-precompiles-enum)", "zkevm_test_harness 1.3.3", "zksync_basic_types", "zksync_consensus_roles", diff --git a/core/lib/commitment_utils/src/lib.rs b/core/lib/commitment_utils/src/lib.rs index ac6dc8ff9178..10adefcb38ae 100644 --- a/core/lib/commitment_utils/src/lib.rs +++ b/core/lib/commitment_utils/src/lib.rs @@ -6,6 +6,7 @@ use zksync_types::{LogQuery, H256, U256, USED_BOOTLOADER_MEMORY_BYTES}; use zksync_utils::expand_memory_contents; pub fn events_queue_commitment(events_queue: &Vec, is_pre_boojum: bool) -> Option { + let events_queue = unsafe { std::mem::transmute(events_queue) }; (!is_pre_boojum).then(|| H256(events_queue_commitment_fixed(events_queue))) } diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index 25a7a2857ee8..e8ceb102b0a7 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -10,8 +10,8 @@ keywords = ["blockchain", "zksync"] categories = ["cryptography"] [dependencies] -zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.0" } -zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.3-rc2" } +zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "perekopskiy-add-precompiles-enum" } +zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.3.3-perekopskiy-add-precompiles-enum" } zk_evm_1_3_1 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.1-rc2" } zkevm_test_harness_1_4_0 = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0", package = "zkevm_test_harness" } diff --git a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs index 92b88e40fc95..665939fa67fb 100644 --- a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs +++ b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs @@ -1,7 +1,9 @@ +use std::{collections::HashMap, convert::TryFrom}; + use zk_evm_1_4_0::{ abstractions::{Memory, PrecompileCyclesWitness, PrecompilesProcessor}, aux_structures::{LogQuery, MemoryQuery, Timestamp}, - zk_evm_abstractions::precompiles::DefaultPrecompilesProcessor, + zk_evm_abstractions::precompiles::{ecrecover, keccak256, sha256, PrecompileAddress}, }; use super::OracleWithHistory; @@ -13,40 +15,43 @@ use crate::vm_latest::old_vm::history_recorder::{HistoryEnabled, HistoryMode, Hi /// saving timestamps allows us to check the exact number /// of log queries, that were used during the tx execution. #[derive(Debug, Clone)] -pub struct PrecompilesProcessorWithHistory { +pub struct PrecompilesProcessorWithHistory { pub timestamp_history: HistoryRecorder, H>, - pub default_precompiles_processor: DefaultPrecompilesProcessor, + pub circuit_cycles_history: HistoryRecorder, H>, } -impl Default for PrecompilesProcessorWithHistory { +impl Default for PrecompilesProcessorWithHistory { fn default() -> Self { Self { timestamp_history: Default::default(), - default_precompiles_processor: DefaultPrecompilesProcessor, + circuit_cycles_history: Default::default(), } } } -impl OracleWithHistory for PrecompilesProcessorWithHistory { +impl OracleWithHistory for PrecompilesProcessorWithHistory { fn rollback_to_timestamp(&mut self, timestamp: Timestamp) { self.timestamp_history.rollback_to_timestamp(timestamp); + self.circuit_cycles_history.rollback_to_timestamp(timestamp); } } -impl PrecompilesProcessorWithHistory { +impl PrecompilesProcessorWithHistory { pub fn get_timestamp_history(&self) -> &Vec { self.timestamp_history.inner() } pub fn delete_history(&mut self) { self.timestamp_history.delete_history(); + self.circuit_cycles_history.delete_history(); } } -impl PrecompilesProcessor for PrecompilesProcessorWithHistory { +impl PrecompilesProcessor for PrecompilesProcessorWithHistory { fn start_frame(&mut self) { - self.default_precompiles_processor.start_frame(); + // there are no precompiles to rollback, do nothing } + fn execute_precompile( &mut self, monotonic_cycle_counter: u32, @@ -60,13 +65,56 @@ impl PrecompilesProcessor for PrecompilesProcesso // where operations and timestamp have different types. self.timestamp_history .push(query.timestamp, query.timestamp); - self.default_precompiles_processor.execute_precompile( - monotonic_cycle_counter, - query, - memory, - ) + + let address_low = u16::from_le_bytes([query.address.0[19], query.address.0[18]]); + if let Ok(precompile_address) = PrecompileAddress::try_from(address_low) { + let rounds = match precompile_address { + PrecompileAddress::Keccak256 => { + // pure function call, non-revertable + keccak256::keccak256_rounds_function::( + monotonic_cycle_counter, + query, + memory, + ) + .0 + } + PrecompileAddress::SHA256 => { + // pure function call, non-revertable + sha256::sha256_rounds_function::( + monotonic_cycle_counter, + query, + memory, + ) + .0 + } + PrecompileAddress::Ecrecover => { + // pure function call, non-revertable + ecrecover::ecrecover_function::( + monotonic_cycle_counter, + query, + memory, + ) + .0 + } + }; + + let prev_value = self + .circuit_cycles_history + .inner() + .get(&precompile_address) + .copied() + .unwrap_or(0); + self.circuit_cycles_history.insert( + precompile_address, + prev_value + rounds, + query.timestamp, + ); + }; + + None } + fn finish_frame(&mut self, _panicked: bool) { - self.default_precompiles_processor.finish_frame(_panicked); + // there are no revertable precompile yes, so we are ok } } diff --git a/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs index da9c81321440..2430e163fe87 100644 --- a/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs @@ -40,7 +40,7 @@ pub type ZkSyncVmState = VmState< StorageOracle, SimpleMemory, InMemoryEventSink, - PrecompilesProcessorWithHistory, + PrecompilesProcessorWithHistory, DecommitterOracle, DummyTracer, >; @@ -84,7 +84,7 @@ pub(crate) fn new_vm_state( let storage_oracle: StorageOracle = StorageOracle::new(storage.clone()); let mut memory = SimpleMemory::default(); let event_sink = InMemoryEventSink::default(); - let precompiles_processor = PrecompilesProcessorWithHistory::::default(); + let precompiles_processor = PrecompilesProcessorWithHistory::::default(); let mut decommittment_processor: DecommitterOracle = DecommitterOracle::new(storage); diff --git a/core/lib/types/Cargo.toml b/core/lib/types/Cargo.toml index 903520764597..cea77bee9ce4 100644 --- a/core/lib/types/Cargo.toml +++ b/core/lib/types/Cargo.toml @@ -18,9 +18,9 @@ zksync_contracts = { path = "../contracts" } zksync_mini_merkle_tree = { path = "../mini_merkle_tree" } # We need this import because we wanat DAL to be responsible for (de)serialization codegen = { git = "https://github.com/matter-labs/solidity_plonk_verifier.git", branch = "dev" } -zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.3.3" } -zk_evm_1_4_0 = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.0", package = "zk_evm" } -zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", tag = "v1.3.3-rc2" } +zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "perekopskiy-add-precompiles-enum" } +zk_evm_1_4_0 = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "perekopskiy-add-precompiles-enum", package = "zk_evm" } +zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.3.3-perekopskiy-add-precompiles-enum" } zksync_consensus_roles = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "49b1a98f80d0e9f74fdceadece4283e745c71599" } zksync_protobuf = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "49b1a98f80d0e9f74fdceadece4283e745c71599" } From 428618fe7f39d3ec7295e9e0fb011149fb21c370 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Wed, 3 Jan 2024 11:33:37 +0200 Subject: [PATCH 16/27] Add comments --- .../versions/vm_latest/tracers/circuits_capacity.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs index 006c95a85846..16f5540172a8 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_capacity.rs @@ -36,12 +36,18 @@ pub(crate) const SHA256_CYCLE_FRACTION: f32 = pub(crate) const ECRECOVER_CYCLE_FRACTION: f32 = OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_ecrecover_circuit as f32; +// "Rich addressing" opcodes are opcodes that can write their return value/read the input onto the stack +// and so take 1-2 RAM permutations more than an average opcode. +// In the worst case, a rich addressing may take 3 ram permutations +// (1 for reading the opcode, 1 for writing input value, 1 for writing output value). pub(crate) const RICH_ADDRESSING_OPCODE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; pub(crate) const AVERAGE_OPCODE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION; +// Here "base" fraction is a fraction that will be used unconditionally. +// Usage of StorageApplication is being tracked separately as it depends on whether slot was read before or not. pub(crate) const STORAGE_READ_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + LOG_DEMUXER_CYCLE_FRACTION @@ -52,6 +58,8 @@ pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION; +// Here "base" fraction is a fraction that will be used unconditionally. +// Usage of StorageApplication is being tracked separately as it depends on whether slot was written before or not. pub(crate) const STORAGE_WRITE_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + 2.0 * LOG_DEMUXER_CYCLE_FRACTION @@ -62,9 +70,14 @@ pub(crate) const FAR_CALL_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + STORAGE_SORTER_CYCLE_FRACTION + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION; +// 5 RAM permutations, because: 1 to read opcode + 2 reads + 2 writes. +// 2 reads and 2 writes are needed because unaligned access is implemented with +// aligned queries. pub(crate) const UMA_WRITE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION; +// 3 RAM permutations, because: 1 to read opcode + 2 reads. +// 2 reads are needed because unaligned access is implemented with aligned queries. pub(crate) const UMA_READ_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; From 8bda047f61a8c740209258f31a1041d32c84566c Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Wed, 3 Jan 2024 11:52:11 +0200 Subject: [PATCH 17/27] Change approach to tracing precompiles --- .../vm_latest/old_vm/oracles/precompile.rs | 24 +++---- .../vm_latest/tracers/circuits_tracer.rs | 64 +++++++++++-------- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs index 665939fa67fb..dbc03fb143a5 100644 --- a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs +++ b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/precompile.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, convert::TryFrom}; +use std::convert::TryFrom; use zk_evm_1_4_0::{ abstractions::{Memory, PrecompileCyclesWitness, PrecompilesProcessor}, @@ -17,14 +17,14 @@ use crate::vm_latest::old_vm::history_recorder::{HistoryEnabled, HistoryMode, Hi #[derive(Debug, Clone)] pub struct PrecompilesProcessorWithHistory { pub timestamp_history: HistoryRecorder, H>, - pub circuit_cycles_history: HistoryRecorder, H>, + pub precompile_cycles_history: HistoryRecorder, HistoryEnabled>, } impl Default for PrecompilesProcessorWithHistory { fn default() -> Self { Self { timestamp_history: Default::default(), - circuit_cycles_history: Default::default(), + precompile_cycles_history: Default::default(), } } } @@ -32,7 +32,8 @@ impl Default for PrecompilesProcessorWithHistory { impl OracleWithHistory for PrecompilesProcessorWithHistory { fn rollback_to_timestamp(&mut self, timestamp: Timestamp) { self.timestamp_history.rollback_to_timestamp(timestamp); - self.circuit_cycles_history.rollback_to_timestamp(timestamp); + self.precompile_cycles_history + .rollback_to_timestamp(timestamp); } } @@ -43,7 +44,7 @@ impl PrecompilesProcessorWithHistory { pub fn delete_history(&mut self) { self.timestamp_history.delete_history(); - self.circuit_cycles_history.delete_history(); + self.precompile_cycles_history.delete_history(); } } @@ -98,17 +99,8 @@ impl PrecompilesProcessor for PrecompilesProcessorWithHistory } }; - let prev_value = self - .circuit_cycles_history - .inner() - .get(&precompile_address) - .copied() - .unwrap_or(0); - self.circuit_cycles_history.insert( - precompile_address, - prev_value + rounds, - query.timestamp, - ); + self.precompile_cycles_history + .push((precompile_address, rounds), query.timestamp); }; None diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index db36aecbe0d4..c65664977568 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -2,19 +2,20 @@ use std::marker::PhantomData; use zk_evm_1_4_0::{ tracing::{BeforeExecutionData, VmLocalStateData}, + zk_evm_abstractions::precompiles::PrecompileAddress, zkevm_opcode_defs::{LogOpcode, Opcode, UMAOpcode}, }; use zksync_state::{StoragePtr, WriteStorage}; -use zksync_system_constants::{ - ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS, -}; use super::circuits_capacity::*; use crate::{ interface::{dyn_tracers::vm_1_4_0::DynTracer, tracer::TracerExecutionStatus}, vm_latest::{ bootloader_state::BootloaderState, - old_vm::{history_recorder::HistoryMode, memory::SimpleMemory}, + old_vm::{ + history_recorder::{HistoryMode, VectorHistoryEvent}, + memory::SimpleMemory, + }, tracers::traits::VmTracer, types::internals::ZkSyncVmState, }, @@ -27,6 +28,7 @@ pub(crate) struct CircuitsTracer { last_decommitment_history_entry_checked: Option, last_written_keys_history_entry_checked: Option, last_read_keys_history_entry_checked: Option, + last_precompile_history_entry_checked: Option, _phantom_data: PhantomData, } @@ -37,6 +39,7 @@ impl CircuitsTracer { last_decommitment_history_entry_checked: None, last_written_keys_history_entry_checked: None, last_read_keys_history_entry_checked: None, + last_precompile_history_entry_checked: None, _phantom_data: Default::default(), } } @@ -45,7 +48,7 @@ impl CircuitsTracer { impl DynTracer> for CircuitsTracer { fn before_execution( &mut self, - state: VmLocalStateData<'_>, + _state: VmLocalStateData<'_>, data: BeforeExecutionData, _memory: &SimpleMemory, _storage: StoragePtr, @@ -66,24 +69,7 @@ impl DynTracer> for Circuits Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { EVENT_OR_L1_MESSAGE_FRACTION } - Opcode::Log(LogOpcode::PrecompileCall) => { - match state.vm_local_state.callstack.current.this_address { - a if a == KECCAK256_PRECOMPILE_ADDRESS => { - let precompile_interpreted = data.src0_value.value.0[3] as f32; - PRECOMPILE_CALL_COMMON_FRACTION - + precompile_interpreted * KECCAK256_CYCLE_FRACTION - } - a if a == SHA256_PRECOMPILE_ADDRESS => { - let precompile_interpreted = data.src0_value.value.0[3] as f32; - PRECOMPILE_CALL_COMMON_FRACTION - + precompile_interpreted * SHA256_CYCLE_FRACTION - } - a if a == ECRECOVER_PRECOMPILE_ADDRESS => { - PRECOMPILE_CALL_COMMON_FRACTION + ECRECOVER_CYCLE_FRACTION - } - _ => PRECOMPILE_CALL_COMMON_FRACTION, - } - } + Opcode::Log(LogOpcode::PrecompileCall) => PRECOMPILE_CALL_COMMON_FRACTION, Opcode::FarCall(_) => FAR_CALL_FRACTION, Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => UMA_WRITE_FRACTION, Opcode::UMA( @@ -110,6 +96,14 @@ impl VmTracer for CircuitsTracer { Some(state.storage.written_keys.history().len()); self.last_read_keys_history_entry_checked = Some(state.storage.read_keys.history().len()); + + self.last_precompile_history_entry_checked = Some( + state + .precompiles_processor + .precompile_cycles_history + .history() + .len(), + ); } fn finish_cycle( @@ -143,7 +137,7 @@ impl VmTracer for CircuitsTracer { } self.last_decommitment_history_entry_checked = Some(history.len()); - // Process storage writes + // Process storage writes. let last_writes_history_entry_checked = self .last_written_keys_history_entry_checked .expect("Value must be set during init"); @@ -156,7 +150,7 @@ impl VmTracer for CircuitsTracer { } self.last_written_keys_history_entry_checked = Some(history.len()); - // Process storage reads + // Process storage reads. let last_reads_history_entry_checked = self .last_read_keys_history_entry_checked .expect("Value must be set during init"); @@ -177,6 +171,26 @@ impl VmTracer for CircuitsTracer { } self.last_read_keys_history_entry_checked = Some(history.len()); + // Process precompiles. + let last_precompile_history_entry_checked = self + .last_precompile_history_entry_checked + .expect("Value must be set during init"); + let history = state + .precompiles_processor + .precompile_cycles_history + .history(); + for (_, history_event) in &history[last_precompile_history_entry_checked..] { + if let VectorHistoryEvent::Push((precompile, cycles)) = history_event { + let fraction = match precompile { + PrecompileAddress::Ecrecover => ECRECOVER_CYCLE_FRACTION, + PrecompileAddress::SHA256 => SHA256_CYCLE_FRACTION, + PrecompileAddress::Keccak256 => KECCAK256_CYCLE_FRACTION, + }; + self.estimated_circuits_used += (*cycles as f32) * fraction; + } + } + self.last_precompile_history_entry_checked = Some(history.len()); + TracerExecutionStatus::Continue } } From 7a80f0682400bc9941224e5054743a1c9546dc51 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Wed, 3 Jan 2024 13:52:47 +0200 Subject: [PATCH 18/27] Tests --- .../src/glue/types/vm/vm_block_result.rs | 12 +- .../types/vm/vm_partial_execution_result.rs | 6 +- .../src/interface/types/outputs/statistic.rs | 2 +- .../vm_latest/implementation/execution.rs | 5 +- .../vm_latest/implementation/statistics.rs | 2 +- .../src/versions/vm_latest/tests/circuits.rs | 43 ++++++ .../src/versions/vm_latest/tests/mod.rs | 2 + .../versions/vm_latest/tests/precompiles.rs | 134 ++++++++++++++++++ .../src/versions/vm_latest/tests/utils.rs | 6 + .../implementation/statistics.rs | 2 +- .../implementation/statistics.rs | 2 +- core/lib/types/src/fee.rs | 2 +- core/lib/types/src/tx/tx_execution_info.rs | 2 +- .../criteria/geometry_seal_criteria.rs | 4 +- .../zksync_core/src/state_keeper/tests/mod.rs | 2 +- .../contracts/precompiles/precompiles.sol | 21 +++ 16 files changed, 225 insertions(+), 22 deletions(-) create mode 100644 core/lib/multivm/src/versions/vm_latest/tests/circuits.rs create mode 100644 core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs create mode 100644 etc/contracts-test-data/contracts/precompiles/precompiles.sol diff --git a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs index b3267f2c441f..f7eda05cc02d 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_block_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_block_result.rs @@ -26,7 +26,7 @@ impl GlueFrom for crate::interface::Fi computational_gas_used: value.full_result.gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), }, @@ -65,7 +65,7 @@ impl GlueFrom for crate::interface::Fi computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), }, @@ -110,7 +110,7 @@ impl GlueFrom for crate::interface: computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), }, @@ -171,7 +171,7 @@ impl GlueFrom computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), } @@ -202,7 +202,7 @@ impl GlueFrom computational_gas_used: 0, gas_used: value.full_result.gas_used, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), } @@ -244,7 +244,7 @@ impl GlueFrom computational_gas_used: value.full_result.computational_gas_used, gas_used: value.full_result.gas_used, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), } diff --git a/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs b/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs index 07fc2b8b05d3..6a52c7e66987 100644 --- a/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs +++ b/core/lib/multivm/src/glue/types/vm/vm_partial_execution_result.rs @@ -16,7 +16,7 @@ impl GlueFrom // There are no such fields in m5 computational_gas_used: 0, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: crate::interface::Refunds { gas_refunded: 0, @@ -40,7 +40,7 @@ impl GlueFrom computational_gas_used: value.computational_gas_used, total_log_queries: value.logs.total_log_queries_count, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: crate::interface::Refunds { gas_refunded: 0, @@ -64,7 +64,7 @@ impl GlueFrom computational_gas_used: value.computational_gas_used, total_log_queries: value.logs.total_log_queries_count, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: crate::interface::Refunds { gas_refunded: 0, diff --git a/core/lib/multivm/src/interface/types/outputs/statistic.rs b/core/lib/multivm/src/interface/types/outputs/statistic.rs index a29c14443f3a..1f5b233423c0 100644 --- a/core/lib/multivm/src/interface/types/outputs/statistic.rs +++ b/core/lib/multivm/src/interface/types/outputs/statistic.rs @@ -12,7 +12,7 @@ pub struct VmExecutionStatistics { /// Number of log queries produced by the VM during the tx execution. pub total_log_queries: usize, pub pubdata_published: u32, - pub estimated_circuits_used: usize, + pub estimated_circuits_used: f32, } /// Oracle metrics of the VM. diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs index dc2aace0de85..91e920ffd502 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/execution.rs @@ -71,9 +71,6 @@ impl Vm { .map(|x| (x.get_refunds(), x.pubdata_published())) .unwrap_or_default(); - let estimated_circuits_used = - tx_tracer.circuits_tracer.estimated_circuits_used.ceil() as usize; - let statistics = self.get_statistics( timestamp_initial, cycles_initial, @@ -83,7 +80,7 @@ impl Vm { spent_pubdata_counter_before, pubdata_published, logs.total_log_queries_count, - estimated_circuits_used, + tx_tracer.circuits_tracer.estimated_circuits_used, ); let result = tx_tracer.result_tracer.into_result(); diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs index e5bdda4d59ca..c41b33beb538 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs @@ -24,7 +24,7 @@ impl Vm { spent_pubdata_counter_before: u32, pubdata_published: u32, total_log_queries_count: usize, - estimated_circuits_used: usize, + estimated_circuits_used: f32, ) -> VmExecutionStatistics { let computational_gas_used = self.calculate_computational_gas_used( tracer, diff --git a/core/lib/multivm/src/versions/vm_latest/tests/circuits.rs b/core/lib/multivm/src/versions/vm_latest/tests/circuits.rs new file mode 100644 index 000000000000..c76f3dc1c729 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_latest/tests/circuits.rs @@ -0,0 +1,43 @@ +use zksync_types::{Address, Execute, U256}; + +use crate::{ + interface::{TxExecutionMode, VmExecutionMode, VmInterface}, + vm_latest::{constants::BLOCK_GAS_LIMIT, tests::tester::VmTesterBuilder, HistoryEnabled}, +}; + +// Checks that estimated number of circuits for simple transfer doesn't differ much +// from hardcoded expected value. +#[test] +fn test_circuits() { + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .build(); + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: Address::random(), + calldata: Vec::new(), + value: U256::from(1u8), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let res = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + const EXPECTED_CIRCUITS_USED: f32 = 1.5521; + let delta = + (res.statistics.estimated_circuits_used - EXPECTED_CIRCUITS_USED) / EXPECTED_CIRCUITS_USED; + + if delta.abs() > 0.1 { + panic!( + "Estimation differs from expected result by too much: {}%", + delta * 100.0 + ); + } +} diff --git a/core/lib/multivm/src/versions/vm_latest/tests/mod.rs b/core/lib/multivm/src/versions/vm_latest/tests/mod.rs index ffb38dd3725a..95377232b3e3 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/mod.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/mod.rs @@ -4,12 +4,14 @@ mod default_aa; // mod invalid_bytecode; mod bytecode_publishing; mod call_tracer; +mod circuits; mod gas_limit; mod get_used_contracts; mod is_write_initial; mod l1_tx_execution; mod l2_blocks; mod nonce_holder; +mod precompiles; mod refunds; mod require_eip712; mod rollbacks; diff --git a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs new file mode 100644 index 000000000000..c2a0ce12760d --- /dev/null +++ b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs @@ -0,0 +1,134 @@ +use zk_evm_1_4_0::zk_evm_abstractions::precompiles::PrecompileAddress; +use zksync_types::{Address, Execute}; + +use crate::{ + interface::{TxExecutionMode, VmExecutionMode, VmInterface}, + vm_latest::{ + constants::BLOCK_GAS_LIMIT, + tests::{tester::VmTesterBuilder, utils::read_precompiles_contract}, + HistoryEnabled, + }, +}; + +#[test] +fn test_keccak() { + // Execute special transaction and check that at least 1000 keccak calls were made. + let contract = read_precompiles_contract(); + let address = Address::random(); + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .with_custom_contracts(vec![(contract, address, true)]) + .build(); + + let keccak1000_calldata = + "370f20ac00000000000000000000000000000000000000000000000000000000000003e8"; + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: address, + calldata: hex::decode(keccak1000_calldata).unwrap(), + value: Default::default(), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + let keccak_count = vm + .vm + .state + .precompiles_processor + .precompile_cycles_history + .inner() + .iter() + .filter(|(precompile, _)| precompile == &PrecompileAddress::Keccak256) + .count(); + + assert!(keccak_count >= 1000); +} + +#[test] +fn test_sha256() { + // Execute special transaction and check that at least 1000 sha256 calls were made. + let contract = read_precompiles_contract(); + let address = Address::random(); + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .with_custom_contracts(vec![(contract, address, true)]) + .build(); + + let sha1000_calldata = + "5d0b4fb500000000000000000000000000000000000000000000000000000000000003e8"; + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: address, + calldata: hex::decode(sha1000_calldata).unwrap(), + value: Default::default(), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + let sha_count = vm + .vm + .state + .precompiles_processor + .precompile_cycles_history + .inner() + .iter() + .filter(|(precompile, _)| precompile == &PrecompileAddress::SHA256) + .count(); + + assert!(sha_count >= 1000); +} + +#[test] +fn test_ecrecover() { + // Execute simple transfer and check that exactly 1 ecrecover call was made (it's done during tx validation). + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .build(); + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: account.address, + calldata: Vec::new(), + value: Default::default(), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + let ecrecover_count = vm + .vm + .state + .precompiles_processor + .precompile_cycles_history + .inner() + .iter() + .filter(|(precompile, _)| precompile == &PrecompileAddress::Ecrecover) + .count(); + + assert_eq!(ecrecover_count, 1); +} diff --git a/core/lib/multivm/src/versions/vm_latest/tests/utils.rs b/core/lib/multivm/src/versions/vm_latest/tests/utils.rs index c126b50cb574..7c937033a218 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/utils.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/utils.rs @@ -103,3 +103,9 @@ pub(crate) fn read_max_depth_contract() -> Vec { "core/tests/ts-integration/contracts/zkasm/artifacts/deep_stak.zkasm/deep_stak.zkasm.zbin", ) } + +pub(crate) fn read_precompiles_contract() -> Vec { + read_bytecode( + "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", + ) +} diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs index ec2dc9036437..d64e71c3ff20 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs @@ -40,7 +40,7 @@ impl Vm { computational_gas_used, total_log_queries: total_log_queries_count, pubdata_published, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, } } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs index 3afb073bd175..7657babfe4a4 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs @@ -40,7 +40,7 @@ impl Vm { total_log_queries: total_log_queries_count, // This field will be populated by the RefundTracer pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, } } diff --git a/core/lib/types/src/fee.rs b/core/lib/types/src/fee.rs index d8a34bed5c5c..fad4d09f5280 100644 --- a/core/lib/types/src/fee.rs +++ b/core/lib/types/src/fee.rs @@ -24,7 +24,7 @@ pub struct TransactionExecutionMetrics { pub computational_gas_used: u32, pub total_updated_values_size: usize, pub pubdata_published: u32, - pub estimated_circuits_used: usize, + pub estimated_circuits_used: f32, } #[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/core/lib/types/src/tx/tx_execution_info.rs b/core/lib/types/src/tx/tx_execution_info.rs index 6338c7e00b86..968a56d6c55a 100644 --- a/core/lib/types/src/tx/tx_execution_info.rs +++ b/core/lib/types/src/tx/tx_execution_info.rs @@ -69,7 +69,7 @@ pub struct ExecutionMetrics { pub cycles_used: u32, pub computational_gas_used: u32, pub pubdata_published: u32, - pub estimated_circuits_used: usize, + pub estimated_circuits_used: f32, } impl ExecutionMetrics { diff --git a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs index 57437d023028..7878621a7296 100644 --- a/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs +++ b/core/lib/zksync_core/src/state_keeper/seal_criteria/criteria/geometry_seal_criteria.rs @@ -70,7 +70,7 @@ impl MetricExtractor for CircuitsCriterion { } fn extract(metrics: &ExecutionMetrics) -> usize { - metrics.estimated_circuits_used + metrics.estimated_circuits_used.ceil() as usize } } @@ -218,7 +218,7 @@ mod tests { test_scenario_execution_metrics!( CircuitsCriterion, estimated_circuits_used, - usize, + f32, ProtocolVersionId::Version17 ); } diff --git a/core/lib/zksync_core/src/state_keeper/tests/mod.rs b/core/lib/zksync_core/src/state_keeper/tests/mod.rs index 3a32687e2ee2..c324270a0df5 100644 --- a/core/lib/zksync_core/src/state_keeper/tests/mod.rs +++ b/core/lib/zksync_core/src/state_keeper/tests/mod.rs @@ -199,7 +199,7 @@ pub(super) fn create_execution_result( computational_gas_used: 0, total_log_queries, pubdata_published: 0, - estimated_circuits_used: 0, + estimated_circuits_used: 0.0, }, refunds: Refunds::default(), } diff --git a/etc/contracts-test-data/contracts/precompiles/precompiles.sol b/etc/contracts-test-data/contracts/precompiles/precompiles.sol new file mode 100644 index 000000000000..d9e23c46a6fa --- /dev/null +++ b/etc/contracts-test-data/contracts/precompiles/precompiles.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: UNLICENSED + +pragma solidity ^0.8.0; + +contract Precompiles { + function doKeccak(uint256 iters) public pure returns (uint256) { + uint256 sum = 0; + for (uint256 i = 0; i < iters; i += 1) { + sum += uint(keccak256(abi.encode(i))) % 256; + } + return sum; + } + + function doSha256(uint256 iters) public pure returns (uint256) { + uint256 sum = 0; + for (uint256 i = 0; i < iters; i += 1) { + sum += uint(sha256(abi.encode(i))) % 256; + } + return sum; + } +} From 987e5fc64ac07499f0fae19cbf2e1ad174819ae1 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Wed, 3 Jan 2024 18:32:01 +0200 Subject: [PATCH 19/27] Switch to main branches back --- Cargo.lock | 63 +++++----------------------- core/lib/commitment_utils/src/lib.rs | 1 - core/lib/multivm/Cargo.toml | 4 +- core/lib/types/Cargo.toml | 6 +-- 4 files changed, 16 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 914c69d328c4..b8df707f31df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1230,7 +1230,7 @@ dependencies = [ "derivative", "serde", "snark_wrapper", - "zk_evm 1.4.0 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.4.0)", + "zk_evm 1.4.0", "zkevm_circuits", ] @@ -4009,8 +4009,8 @@ dependencies = [ "tracing", "vise", "zk_evm 1.3.1", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum)", - "zk_evm 1.4.0 (git+https://github.com/matter-labs/era-zk_evm.git?branch=perekopskiy-add-precompiles-enum)", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", + "zk_evm 1.4.0", "zkevm_test_harness 1.4.0", "zksync_contracts", "zksync_eth_signer", @@ -8007,7 +8007,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git)", + "zk_evm_abstractions", "zkevm_opcode_defs 1.3.2", ] @@ -8022,37 +8022,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git)", - "zkevm_opcode_defs 1.3.2", -] - -[[package]] -name = "zk_evm" -version = "1.3.3" -source = "git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum#3d76dadc419b862a89a00731066a8e0aa863f608" -dependencies = [ - "anyhow", - "lazy_static", - "num 0.4.1", - "serde", - "serde_json", - "static_assertions", - "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git?branch=perekopskiy-add-precompiles-enum)", - "zkevm_opcode_defs 1.3.2", -] - -[[package]] -name = "zk_evm" -version = "1.4.0" -source = "git+https://github.com/matter-labs/era-zk_evm.git?branch=perekopskiy-add-precompiles-enum#405220c7ca48b1f1d11a2e6dad5d9f78e3adb834" -dependencies = [ - "anyhow", - "lazy_static", - "num 0.4.1", - "serde", - "serde_json", - "static_assertions", - "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git?branch=perekopskiy-add-precompiles-enum)", + "zk_evm_abstractions", "zkevm_opcode_defs 1.3.2", ] @@ -8067,14 +8037,14 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "zk_evm_abstractions 0.1.0 (git+https://github.com/matter-labs/era-zk_evm_abstractions.git)", + "zk_evm_abstractions", "zkevm_opcode_defs 1.3.2", ] [[package]] name = "zk_evm_abstractions" version = "0.1.0" -source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git?branch=perekopskiy-add-precompiles-enum#72aee66dc059ae73f97d2843da7da50df56efc4a" +source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#32dd320953841aa78579d9da08abbc70bcaed175" dependencies = [ "anyhow", "num_enum", @@ -8083,17 +8053,6 @@ dependencies = [ "zkevm_opcode_defs 1.3.2", ] -[[package]] -name = "zk_evm_abstractions" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#15a2af404902d5f10352e3d1fac693cc395fcff9" -dependencies = [ - "anyhow", - "serde", - "static_assertions", - "zkevm_opcode_defs 1.3.2", -] - [[package]] name = "zkevm-assembly" version = "1.3.2" @@ -8161,7 +8120,7 @@ dependencies = [ [[package]] name = "zkevm_test_harness" version = "1.3.3" -source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=perekopskiy-add-precompiles-enum#3a1b229e5c8abf971a7cfc4cd1dd757d1700b455" +source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=v1.3.3#d52b56d6ba8196c8a3c74c4933654469e6f27a5a" dependencies = [ "bincode", "circuit_testing", @@ -8181,7 +8140,7 @@ dependencies = [ "sync_vm", "test-log", "tracing", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum)", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3)", "zkevm-assembly", ] @@ -8933,8 +8892,8 @@ dependencies = [ "strum", "thiserror", "tokio", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3-perekopskiy-add-precompiles-enum)", - "zk_evm 1.4.0 (git+https://github.com/matter-labs/era-zk_evm.git?branch=perekopskiy-add-precompiles-enum)", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", + "zk_evm 1.4.0", "zkevm_test_harness 1.3.3", "zksync_basic_types", "zksync_consensus_roles", diff --git a/core/lib/commitment_utils/src/lib.rs b/core/lib/commitment_utils/src/lib.rs index 10adefcb38ae..ac6dc8ff9178 100644 --- a/core/lib/commitment_utils/src/lib.rs +++ b/core/lib/commitment_utils/src/lib.rs @@ -6,7 +6,6 @@ use zksync_types::{LogQuery, H256, U256, USED_BOOTLOADER_MEMORY_BYTES}; use zksync_utils::expand_memory_contents; pub fn events_queue_commitment(events_queue: &Vec, is_pre_boojum: bool) -> Option { - let events_queue = unsafe { std::mem::transmute(events_queue) }; (!is_pre_boojum).then(|| H256(events_queue_commitment_fixed(events_queue))) } diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index b1b35d9d206e..5f87b5ae5543 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -10,8 +10,8 @@ keywords = ["blockchain", "zksync"] categories = ["cryptography"] [dependencies] -zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "perekopskiy-add-precompiles-enum" } -zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.3.3-perekopskiy-add-precompiles-enum" } +zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.0" } +zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.3-rc2" } zk_evm_1_3_1 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.1-rc2" } zkevm_test_harness_1_4_0 = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0", package = "zkevm_test_harness" } diff --git a/core/lib/types/Cargo.toml b/core/lib/types/Cargo.toml index f99ade8222a2..594160c27287 100644 --- a/core/lib/types/Cargo.toml +++ b/core/lib/types/Cargo.toml @@ -18,9 +18,9 @@ zksync_contracts = { path = "../contracts" } zksync_mini_merkle_tree = { path = "../mini_merkle_tree" } # We need this import because we wanat DAL to be responsible for (de)serialization codegen = { git = "https://github.com/matter-labs/solidity_plonk_verifier.git", branch = "dev" } -zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "perekopskiy-add-precompiles-enum" } -zk_evm_1_4_0 = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "perekopskiy-add-precompiles-enum", package = "zk_evm" } -zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.3.3-perekopskiy-add-precompiles-enum" } +zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.3.3" } +zk_evm_1_4_0 = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.0", package = "zk_evm" } +zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", tag = "v1.3.3-rc2" } zksync_consensus_roles = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "84cdd9e45fd84bc1fac0b394c899ae33aef91afa" } zksync_protobuf = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "84cdd9e45fd84bc1fac0b394c899ae33aef91afa" } From a3413e6250d728a1551f429e33863c782b87a497 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Wed, 3 Jan 2024 18:44:23 +0200 Subject: [PATCH 20/27] Update prover lock file --- prover/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 8e4c1fd01d8b..772a61c5a6c9 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -6801,7 +6801,7 @@ dependencies = [ [[package]] name = "zk_evm_abstractions" version = "0.1.0" -source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#7502a661d7d38906d849dcd3e7a15e5848af6581" +source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#32dd320953841aa78579d9da08abbc70bcaed175" dependencies = [ "anyhow", "serde", From 2e6ad239cc6b3dd3164c20701d9ea54c1db9c753 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 4 Jan 2024 12:08:09 +0200 Subject: [PATCH 21/27] Add comment --- .../multivm/src/versions/vm_latest/tracers/default_tracers.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs index 4ad0c568348d..018272365f8f 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/default_tracers.rs @@ -63,6 +63,8 @@ pub(crate) struct DefaultExecutionTracer { pub(crate) dispatcher: TracerDispatcher, ret_from_the_bootloader: Option, // This tracer tracks what opcodes were executed and calculates how much circuits will be generated. + // It only takes into account circuits that are generated for actual execution. It doesn't + // take into account e.g circuits produced by the initial bootloader memory commitment. pub(crate) circuits_tracer: CircuitsTracer, storage: StoragePtr, From cc8f1cff66b14e72821ae6289f81d9b9d62a034b Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 4 Jan 2024 15:46:45 +0200 Subject: [PATCH 22/27] new db column --- ...21833_l1-batch-predicted-circuits.down.sql | 2 + ...4121833_l1-batch-predicted-circuits.up.sql | 2 + core/lib/dal/sqlx-data.json | 71 ++++++++++--------- core/lib/dal/src/blocks_dal.rs | 10 ++- core/lib/dal/src/storage_logs_dal.rs | 2 +- core/lib/dal/src/sync_dal.rs | 4 +- core/lib/dal/src/tests/mod.rs | 4 +- 7 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.down.sql create mode 100644 core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.up.sql diff --git a/core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.down.sql b/core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.down.sql new file mode 100644 index 000000000000..925299304ebe --- /dev/null +++ b/core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE l1_batches + DROP COLUMN IF EXISTS predicted_circuits; diff --git a/core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.up.sql b/core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.up.sql new file mode 100644 index 000000000000..a957fce4d984 --- /dev/null +++ b/core/lib/dal/migrations/20240104121833_l1-batch-predicted-circuits.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE l1_batches + ADD COLUMN IF NOT EXISTS predicted_circuits INT; diff --git a/core/lib/dal/sqlx-data.json b/core/lib/dal/sqlx-data.json index 36b8bad5787f..a0b19f08aa7b 100644 --- a/core/lib/dal/sqlx-data.json +++ b/core/lib/dal/sqlx-data.json @@ -6178,6 +6178,42 @@ }, "query": "\n SELECT\n number,\n hash\n FROM\n miniblocks\n WHERE\n number >= $1\n ORDER BY\n number ASC\n LIMIT\n $2\n " }, + "70979db81f473950b2fae7816dbad7fe3464f2619cee2d583accaa829aa12b94": { + "describe": { + "columns": [], + "nullable": [], + "parameters": { + "Left": [ + "Int8", + "Int4", + "Int4", + "Int8", + "Bool", + "Bytea", + "ByteaArray", + "ByteaArray", + "Bytea", + "ByteaArray", + "Int8", + "Int8", + "Int8", + "Jsonb", + "Jsonb", + "Numeric", + "Int8", + "Int8", + "Bytea", + "Bytea", + "Int4", + "ByteaArray", + "Int8Array", + "Bytea", + "Int4" + ] + } + }, + "query": "\n INSERT INTO\n l1_batches (\n number,\n l1_tx_count,\n l2_tx_count,\n timestamp,\n is_finished,\n fee_account_address,\n l2_to_l1_logs,\n l2_to_l1_messages,\n bloom,\n priority_ops_onchain_data,\n predicted_commit_gas_cost,\n predicted_prove_gas_cost,\n predicted_execute_gas_cost,\n initial_bootloader_heap_content,\n used_contract_hashes,\n base_fee_per_gas,\n l1_gas_price,\n l2_fair_gas_price,\n bootloader_code_hash,\n default_aa_code_hash,\n protocol_version,\n system_logs,\n storage_refunds,\n pubdata_input,\n predicted_circuits,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n $18,\n $19,\n $20,\n $21,\n $22,\n $23,\n $24,\n $25,\n NOW(),\n NOW()\n )\n " + }, "72a4f50355324cce85ebaef9fa32826095e9290f0c1157094bd0c44e06012e42": { "describe": { "columns": [ @@ -8440,41 +8476,6 @@ }, "query": "\n SELECT\n upgrade_tx_hash\n FROM\n protocol_versions\n WHERE\n id = $1\n " }, - "aa8e569cf406cd0975a6ffaeeafa92f632186181ba8b93518e549e0643f58da8": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int8", - "Int4", - "Int4", - "Int8", - "Bool", - "Bytea", - "ByteaArray", - "ByteaArray", - "Bytea", - "ByteaArray", - "Int8", - "Int8", - "Int8", - "Jsonb", - "Jsonb", - "Numeric", - "Int8", - "Int8", - "Bytea", - "Bytea", - "Int4", - "ByteaArray", - "Int8Array", - "Bytea" - ] - } - }, - "query": "\n INSERT INTO\n l1_batches (\n number,\n l1_tx_count,\n l2_tx_count,\n timestamp,\n is_finished,\n fee_account_address,\n l2_to_l1_logs,\n l2_to_l1_messages,\n bloom,\n priority_ops_onchain_data,\n predicted_commit_gas_cost,\n predicted_prove_gas_cost,\n predicted_execute_gas_cost,\n initial_bootloader_heap_content,\n used_contract_hashes,\n base_fee_per_gas,\n l1_gas_price,\n l2_fair_gas_price,\n bootloader_code_hash,\n default_aa_code_hash,\n protocol_version,\n system_logs,\n storage_refunds,\n pubdata_input,\n created_at,\n updated_at\n )\n VALUES\n (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16,\n $17,\n $18,\n $19,\n $20,\n $21,\n $22,\n $23,\n $24,\n NOW(),\n NOW()\n )\n " - }, "aa91697157517322b0dbb53dca99f41220c51f58a03c61d6b7789eab0504e320": { "describe": { "columns": [ diff --git a/core/lib/dal/src/blocks_dal.rs b/core/lib/dal/src/blocks_dal.rs index ae3ef48bcbb6..239f9074800e 100644 --- a/core/lib/dal/src/blocks_dal.rs +++ b/core/lib/dal/src/blocks_dal.rs @@ -450,6 +450,7 @@ impl BlocksDal<'_, '_> { predicted_block_gas: BlockGasCount, events_queue: &[LogQuery], storage_refunds: &[u32], + predicted_circuits: u32, ) -> anyhow::Result<()> { let priority_onchain_data: Vec> = header .priority_ops_onchain_data @@ -509,6 +510,7 @@ impl BlocksDal<'_, '_> { system_logs, storage_refunds, pubdata_input, + predicted_circuits, created_at, updated_at ) @@ -538,6 +540,7 @@ impl BlocksDal<'_, '_> { $22, $23, $24, + $25, NOW(), NOW() ) @@ -566,6 +569,7 @@ impl BlocksDal<'_, '_> { &system_logs, &storage_refunds, pubdata_input, + predicted_circuits as i32, ) .execute(transaction.conn()) .await?; @@ -2341,7 +2345,7 @@ mod tests { header.l2_to_l1_messages.push(vec![33; 33]); conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); @@ -2390,7 +2394,7 @@ mod tests { execute: 10, }; conn.blocks_dal() - .insert_l1_batch(&header, &[], predicted_gas, &[], &[]) + .insert_l1_batch(&header, &[], predicted_gas, &[], &[], 0) .await .unwrap(); @@ -2398,7 +2402,7 @@ mod tests { header.timestamp += 100; predicted_gas += predicted_gas; conn.blocks_dal() - .insert_l1_batch(&header, &[], predicted_gas, &[], &[]) + .insert_l1_batch(&header, &[], predicted_gas, &[], &[], 0) .await .unwrap(); diff --git a/core/lib/dal/src/storage_logs_dal.rs b/core/lib/dal/src/storage_logs_dal.rs index ff757b748e8d..21572f3d3c0f 100644 --- a/core/lib/dal/src/storage_logs_dal.rs +++ b/core/lib/dal/src/storage_logs_dal.rs @@ -733,7 +733,7 @@ mod tests { ); header.is_finished = true; conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); conn.blocks_dal() diff --git a/core/lib/dal/src/sync_dal.rs b/core/lib/dal/src/sync_dal.rs index 4d50f2855bbf..c9a737f581d0 100644 --- a/core/lib/dal/src/sync_dal.rs +++ b/core/lib/dal/src/sync_dal.rs @@ -136,7 +136,7 @@ mod tests { ProtocolVersionId::latest(), ); conn.blocks_dal() - .insert_l1_batch(&l1_batch_header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&l1_batch_header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); conn.blocks_dal() @@ -205,7 +205,7 @@ mod tests { l1_batch_header.number = L1BatchNumber(1); l1_batch_header.timestamp = 1; conn.blocks_dal() - .insert_l1_batch(&l1_batch_header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&l1_batch_header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); conn.blocks_dal() diff --git a/core/lib/dal/src/tests/mod.rs b/core/lib/dal/src/tests/mod.rs index 6b8ae6090f9c..533e97021917 100644 --- a/core/lib/dal/src/tests/mod.rs +++ b/core/lib/dal/src/tests/mod.rs @@ -294,7 +294,7 @@ async fn test_duplicate_insert_prover_jobs() { ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default(), &[], &[]) + .insert_l1_batch(&header, &[], Default::default(), &[], &[], 0) .await .unwrap(); @@ -357,7 +357,7 @@ async fn test_requeue_prover_jobs() { ); storage .blocks_dal() - .insert_l1_batch(&header, &[], Default::default(), &[], &[]) + .insert_l1_batch(&header, &[], Default::default(), &[], &[], 0) .await .unwrap(); From e37e910a93c4ba9e2e37a41e82cfd95dd9a35287 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Thu, 4 Jan 2024 16:11:08 +0200 Subject: [PATCH 23/27] new db column --- core/bin/snapshots_creator/src/tests.rs | 2 +- core/lib/state/src/test_utils.rs | 2 +- core/lib/zksync_core/src/eth_sender/tests.rs | 2 +- core/lib/zksync_core/src/genesis.rs | 1 + .../zksync_core/src/metadata_calculator/recovery/tests.rs | 2 +- core/lib/zksync_core/src/metadata_calculator/tests.rs | 5 +++-- core/lib/zksync_core/src/reorg_detector/tests.rs | 2 +- core/lib/zksync_core/src/state_keeper/io/seal_logic.rs | 4 ++++ core/lib/zksync_core/src/state_keeper/io/tests/tester.rs | 2 +- 9 files changed, 14 insertions(+), 8 deletions(-) diff --git a/core/bin/snapshots_creator/src/tests.rs b/core/bin/snapshots_creator/src/tests.rs index 33d7a225b7d6..4ce32a209c34 100644 --- a/core/bin/snapshots_creator/src/tests.rs +++ b/core/bin/snapshots_creator/src/tests.rs @@ -80,7 +80,7 @@ async fn create_l1_batch( ); header.is_finished = true; conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); conn.blocks_dal() diff --git a/core/lib/state/src/test_utils.rs b/core/lib/state/src/test_utils.rs index 2a5664ae0602..21c56678586a 100644 --- a/core/lib/state/src/test_utils.rs +++ b/core/lib/state/src/test_utils.rs @@ -105,7 +105,7 @@ pub(crate) async fn create_l1_batch( ); header.is_finished = true; conn.blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); conn.blocks_dal() diff --git a/core/lib/zksync_core/src/eth_sender/tests.rs b/core/lib/zksync_core/src/eth_sender/tests.rs index b563cf0443e7..5c7429b2795c 100644 --- a/core/lib/zksync_core/src/eth_sender/tests.rs +++ b/core/lib/zksync_core/src/eth_sender/tests.rs @@ -888,7 +888,7 @@ async fn insert_l1_batch(tester: &EthSenderTester, number: L1BatchNumber) -> L1B .storage() .await .blocks_dal() - .insert_l1_batch(&header, &[], Default::default(), &[], &[]) + .insert_l1_batch(&header, &[], Default::default(), &[], &[], 0) .await .unwrap(); tester diff --git a/core/lib/zksync_core/src/genesis.rs b/core/lib/zksync_core/src/genesis.rs index bba6a2d6744a..f1161e3b761a 100644 --- a/core/lib/zksync_core/src/genesis.rs +++ b/core/lib/zksync_core/src/genesis.rs @@ -315,6 +315,7 @@ pub(crate) async fn create_genesis_l1_batch( BlockGasCount::default(), &[], &[], + 0, ) .await .unwrap(); diff --git a/core/lib/zksync_core/src/metadata_calculator/recovery/tests.rs b/core/lib/zksync_core/src/metadata_calculator/recovery/tests.rs index d121990dc283..408db82c144c 100644 --- a/core/lib/zksync_core/src/metadata_calculator/recovery/tests.rs +++ b/core/lib/zksync_core/src/metadata_calculator/recovery/tests.rs @@ -401,7 +401,7 @@ async fn prepare_clean_recovery_snapshot( ); storage .blocks_dal() - .insert_l1_batch(&l1_batch, &[], Default::default(), &[], &[]) + .insert_l1_batch(&l1_batch, &[], Default::default(), &[], &[], 0) .await .unwrap(); diff --git a/core/lib/zksync_core/src/metadata_calculator/tests.rs b/core/lib/zksync_core/src/metadata_calculator/tests.rs index 8c8121fac65a..1046bbdcf1ec 100644 --- a/core/lib/zksync_core/src/metadata_calculator/tests.rs +++ b/core/lib/zksync_core/src/metadata_calculator/tests.rs @@ -290,6 +290,7 @@ async fn test_postgres_backup_recovery( BlockGasCount::default(), &[], &[], + 0, ) .await .unwrap(); @@ -315,7 +316,7 @@ async fn test_postgres_backup_recovery( for batch_header in &removed_batches { let mut txn = storage.start_transaction().await.unwrap(); txn.blocks_dal() - .insert_l1_batch(batch_header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(batch_header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); insert_initial_writes_for_batch(&mut txn, batch_header.number).await; @@ -518,7 +519,7 @@ pub(super) async fn extend_db_state_from_l1_batch( storage .blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); storage diff --git a/core/lib/zksync_core/src/reorg_detector/tests.rs b/core/lib/zksync_core/src/reorg_detector/tests.rs index 6f09c0e9fee7..77386f05d1e9 100644 --- a/core/lib/zksync_core/src/reorg_detector/tests.rs +++ b/core/lib/zksync_core/src/reorg_detector/tests.rs @@ -49,7 +49,7 @@ async fn seal_l1_batch(storage: &mut StorageProcessor<'_>, number: u32, hash: H2 ); storage .blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); storage diff --git a/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs b/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs index 15f10ce3ce7d..908e24fd2d5f 100644 --- a/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs +++ b/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs @@ -149,6 +149,10 @@ impl UpdatesManager { self.l1_batch.l1_gas_count, &events_queue, &finished_batch.final_execution_state.storage_refunds, + self.l1_batch + .block_execution_metrics + .estimated_circuits_used + .ceil() as u32, ) .await .unwrap(); diff --git a/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs b/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs index 01bc88c52915..49a3f64d6bff 100644 --- a/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs +++ b/core/lib/zksync_core/src/state_keeper/io/tests/tester.rs @@ -159,7 +159,7 @@ impl Tester { let mut storage = pool.access_storage_tagged("state_keeper").await.unwrap(); storage .blocks_dal() - .insert_l1_batch(&batch_header, &[], Default::default(), &[], &[]) + .insert_l1_batch(&batch_header, &[], Default::default(), &[], &[], 0) .await .unwrap(); storage From a14c18984b44caf390b2a253f4b73e94d4d7012f Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Fri, 5 Jan 2024 11:50:03 +0200 Subject: [PATCH 24/27] Add changes to vm_boojum_integration --- .../implementation/execution.rs | 1 + .../implementation/statistics.rs | 2 + .../old_vm/oracles/precompile.rs | 70 +++++-- .../vm_boojum_integration/oracles/storage.rs | 22 +- .../vm_boojum_integration/tests/circuits.rs | 43 ++++ .../vm_boojum_integration/tests/mod.rs | 2 + .../tests/precompiles.rs | 134 ++++++++++++ .../vm_boojum_integration/tests/utils.rs | 6 + .../tracers/circuits_capacity.rs | 85 ++++++++ .../tracers/circuits_tracer.rs | 196 ++++++++++++++++++ .../tracers/default_tracers.rs | 13 +- .../vm_boojum_integration/tracers/mod.rs | 3 + .../types/internals/vm_state.rs | 4 +- .../src/versions/vm_latest/oracles/storage.rs | 4 +- .../src/api_server/web3/tests/snapshots.rs | 2 +- 15 files changed, 562 insertions(+), 25 deletions(-) create mode 100644 core/lib/multivm/src/versions/vm_boojum_integration/tests/circuits.rs create mode 100644 core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs create mode 100644 core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs create mode 100644 core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs b/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs index 9623b21a1945..1d1d19f92b76 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/implementation/execution.rs @@ -80,6 +80,7 @@ impl Vm { spent_pubdata_counter_before, pubdata_published, logs.total_log_queries_count, + tx_tracer.circuits_tracer.estimated_circuits_used, ); let result = tx_tracer.result_tracer.into_result(); diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_boojum_integration/implementation/statistics.rs index c11165cf78d1..36780c8b8458 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/implementation/statistics.rs @@ -24,6 +24,7 @@ impl Vm { spent_pubdata_counter_before: u32, pubdata_published: u32, total_log_queries_count: usize, + estimated_circuits_used: f32, ) -> VmExecutionStatistics { let computational_gas_used = self.calculate_computational_gas_used( tracer, @@ -40,6 +41,7 @@ impl Vm { computational_gas_used, total_log_queries: total_log_queries_count, pubdata_published, + estimated_circuits_used, } } diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/old_vm/oracles/precompile.rs b/core/lib/multivm/src/versions/vm_boojum_integration/old_vm/oracles/precompile.rs index 4c798a00a37b..c4986250cbae 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/old_vm/oracles/precompile.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/old_vm/oracles/precompile.rs @@ -1,7 +1,9 @@ +use std::convert::TryFrom; + use zk_evm_1_4_0::{ abstractions::{Memory, PrecompileCyclesWitness, PrecompilesProcessor}, aux_structures::{LogQuery, MemoryQuery, Timestamp}, - zk_evm_abstractions::precompiles::DefaultPrecompilesProcessor, + zk_evm_abstractions::precompiles::{ecrecover, keccak256, sha256, PrecompileAddress}, }; use super::OracleWithHistory; @@ -15,40 +17,44 @@ use crate::vm_boojum_integration::old_vm::history_recorder::{ /// saving timestamps allows us to check the exact number /// of log queries, that were used during the tx execution. #[derive(Debug, Clone)] -pub struct PrecompilesProcessorWithHistory { +pub struct PrecompilesProcessorWithHistory { pub timestamp_history: HistoryRecorder, H>, - pub default_precompiles_processor: DefaultPrecompilesProcessor, + pub precompile_cycles_history: HistoryRecorder, HistoryEnabled>, } -impl Default for PrecompilesProcessorWithHistory { +impl Default for PrecompilesProcessorWithHistory { fn default() -> Self { Self { timestamp_history: Default::default(), - default_precompiles_processor: DefaultPrecompilesProcessor, + precompile_cycles_history: Default::default(), } } } -impl OracleWithHistory for PrecompilesProcessorWithHistory { +impl OracleWithHistory for PrecompilesProcessorWithHistory { fn rollback_to_timestamp(&mut self, timestamp: Timestamp) { self.timestamp_history.rollback_to_timestamp(timestamp); + self.precompile_cycles_history + .rollback_to_timestamp(timestamp); } } -impl PrecompilesProcessorWithHistory { +impl PrecompilesProcessorWithHistory { pub fn get_timestamp_history(&self) -> &Vec { self.timestamp_history.inner() } pub fn delete_history(&mut self) { self.timestamp_history.delete_history(); + self.precompile_cycles_history.delete_history(); } } -impl PrecompilesProcessor for PrecompilesProcessorWithHistory { +impl PrecompilesProcessor for PrecompilesProcessorWithHistory { fn start_frame(&mut self) { - self.default_precompiles_processor.start_frame(); + // there are no precompiles to rollback, do nothing } + fn execute_precompile( &mut self, monotonic_cycle_counter: u32, @@ -62,13 +68,47 @@ impl PrecompilesProcessor for PrecompilesProcesso // where operations and timestamp have different types. self.timestamp_history .push(query.timestamp, query.timestamp); - self.default_precompiles_processor.execute_precompile( - monotonic_cycle_counter, - query, - memory, - ) + + let address_low = u16::from_le_bytes([query.address.0[19], query.address.0[18]]); + if let Ok(precompile_address) = PrecompileAddress::try_from(address_low) { + let rounds = match precompile_address { + PrecompileAddress::Keccak256 => { + // pure function call, non-revertable + keccak256::keccak256_rounds_function::( + monotonic_cycle_counter, + query, + memory, + ) + .0 + } + PrecompileAddress::SHA256 => { + // pure function call, non-revertable + sha256::sha256_rounds_function::( + monotonic_cycle_counter, + query, + memory, + ) + .0 + } + PrecompileAddress::Ecrecover => { + // pure function call, non-revertable + ecrecover::ecrecover_function::( + monotonic_cycle_counter, + query, + memory, + ) + .0 + } + }; + + self.precompile_cycles_history + .push((precompile_address, rounds), query.timestamp); + }; + + None } + fn finish_frame(&mut self, _panicked: bool) { - self.default_precompiles_processor.finish_frame(_panicked); + // there are no revertable precompile yes, so we are ok } } diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/oracles/storage.rs b/core/lib/multivm/src/versions/vm_boojum_integration/oracles/storage.rs index 2e051db47481..919fd301c573 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/oracles/storage.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/oracles/storage.rs @@ -59,6 +59,11 @@ pub struct StorageOracle { // Storage refunds that oracle has returned in `estimate_refunds_for_write`. pub(crate) returned_refunds: HistoryRecorder, H>, + + // Keeps track of storage keys that were ever written to. + pub(crate) written_keys: HistoryRecorder, HistoryEnabled>, + // Keeps track of storage keys that were ever read. + pub(crate) read_keys: HistoryRecorder, HistoryEnabled>, } impl OracleWithHistory for StorageOracle { @@ -69,6 +74,8 @@ impl OracleWithHistory for StorageOracle { self.paid_changes.rollback_to_timestamp(timestamp); self.initial_values.rollback_to_timestamp(timestamp); self.returned_refunds.rollback_to_timestamp(timestamp); + self.written_keys.rollback_to_timestamp(timestamp); + self.read_keys.rollback_to_timestamp(timestamp); } } @@ -81,6 +88,8 @@ impl StorageOracle { paid_changes: Default::default(), initial_values: Default::default(), returned_refunds: Default::default(), + written_keys: Default::default(), + read_keys: Default::default(), } } @@ -91,6 +100,8 @@ impl StorageOracle { self.paid_changes.delete_history(); self.initial_values.delete_history(); self.returned_refunds.delete_history(); + self.written_keys.delete_history(); + self.read_keys.delete_history(); } fn is_storage_key_free(&self, key: &StorageKey) -> bool { @@ -108,8 +119,12 @@ impl StorageOracle { } } - pub fn read_value(&mut self, mut query: LogQuery) -> LogQuery { + fn read_value(&mut self, mut query: LogQuery) -> LogQuery { let key = triplet_to_storage_key(query.shard_id, query.address, query.key); + + if !self.read_keys.inner().contains_key(&key) { + self.read_keys.insert(key, (), query.timestamp); + } let current_value = self.storage.read_from_storage(&key); query.read_value = current_value; @@ -127,8 +142,11 @@ impl StorageOracle { query } - pub fn write_value(&mut self, query: LogQuery) -> LogQuery { + fn write_value(&mut self, query: LogQuery) -> LogQuery { let key = triplet_to_storage_key(query.shard_id, query.address, query.key); + if !self.written_keys.inner().contains_key(&key) { + self.written_keys.insert(key, (), query.timestamp); + } let current_value = self.storage .write_to_storage(key, query.written_value, query.timestamp); diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tests/circuits.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tests/circuits.rs new file mode 100644 index 000000000000..2630c913e02a --- /dev/null +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tests/circuits.rs @@ -0,0 +1,43 @@ +use zksync_types::{Address, Execute, U256}; + +use crate::{ + interface::{TxExecutionMode, VmExecutionMode, VmInterface}, + vm_boojum_integration::{constants::BLOCK_GAS_LIMIT, tests::tester::VmTesterBuilder, HistoryEnabled}, +}; + +// Checks that estimated number of circuits for simple transfer doesn't differ much +// from hardcoded expected value. +#[test] +fn test_circuits() { + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .build(); + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: Address::random(), + calldata: Vec::new(), + value: U256::from(1u8), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let res = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + const EXPECTED_CIRCUITS_USED: f32 = 1.5521; + let delta = + (res.statistics.estimated_circuits_used - EXPECTED_CIRCUITS_USED) / EXPECTED_CIRCUITS_USED; + + if delta.abs() > 0.1 { + panic!( + "Estimation differs from expected result by too much: {}%", + delta * 100.0 + ); + } +} diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tests/mod.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tests/mod.rs index ffb38dd3725a..95377232b3e3 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tests/mod.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tests/mod.rs @@ -4,12 +4,14 @@ mod default_aa; // mod invalid_bytecode; mod bytecode_publishing; mod call_tracer; +mod circuits; mod gas_limit; mod get_used_contracts; mod is_write_initial; mod l1_tx_execution; mod l2_blocks; mod nonce_holder; +mod precompiles; mod refunds; mod require_eip712; mod rollbacks; diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs new file mode 100644 index 000000000000..d45716dd98c8 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs @@ -0,0 +1,134 @@ +use zk_evm_1_4_0::zk_evm_abstractions::precompiles::PrecompileAddress; +use zksync_types::{Address, Execute}; + +use crate::{ + interface::{TxExecutionMode, VmExecutionMode, VmInterface}, + vm_boojum_integration::{ + constants::BLOCK_GAS_LIMIT, + tests::{tester::VmTesterBuilder, utils::read_precompiles_contract}, + HistoryEnabled, + }, +}; + +#[test] +fn test_keccak() { + // Execute special transaction and check that at least 1000 keccak calls were made. + let contract = read_precompiles_contract(); + let address = Address::random(); + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .with_custom_contracts(vec![(contract, address, true)]) + .build(); + + let keccak1000_calldata = + "370f20ac00000000000000000000000000000000000000000000000000000000000003e8"; + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: address, + calldata: hex::decode(keccak1000_calldata).unwrap(), + value: Default::default(), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + let keccak_count = vm + .vm + .state + .precompiles_processor + .precompile_cycles_history + .inner() + .iter() + .filter(|(precompile, _)| precompile == &PrecompileAddress::Keccak256) + .count(); + + assert!(keccak_count >= 1000); +} + +#[test] +fn test_sha256() { + // Execute special transaction and check that at least 1000 sha256 calls were made. + let contract = read_precompiles_contract(); + let address = Address::random(); + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .with_custom_contracts(vec![(contract, address, true)]) + .build(); + + let sha1000_calldata = + "5d0b4fb500000000000000000000000000000000000000000000000000000000000003e8"; + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: address, + calldata: hex::decode(sha1000_calldata).unwrap(), + value: Default::default(), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + let sha_count = vm + .vm + .state + .precompiles_processor + .precompile_cycles_history + .inner() + .iter() + .filter(|(precompile, _)| precompile == &PrecompileAddress::SHA256) + .count(); + + assert!(sha_count >= 1000); +} + +#[test] +fn test_ecrecover() { + // Execute simple transfer and check that exactly 1 ecrecover call was made (it's done during tx validation). + let mut vm = VmTesterBuilder::new(HistoryEnabled) + .with_empty_in_memory_storage() + .with_random_rich_accounts(1) + .with_deployer() + .with_gas_limit(BLOCK_GAS_LIMIT) + .with_execution_mode(TxExecutionMode::VerifyExecute) + .build(); + + let account = &mut vm.rich_accounts[0]; + let tx = account.get_l2_tx_for_execute( + Execute { + contract_address: account.address, + calldata: Vec::new(), + value: Default::default(), + factory_deps: None, + }, + None, + ); + vm.vm.push_transaction(tx); + let _ = vm.vm.inspect(Default::default(), VmExecutionMode::OneTx); + + let ecrecover_count = vm + .vm + .state + .precompiles_processor + .precompile_cycles_history + .inner() + .iter() + .filter(|(precompile, _)| precompile == &PrecompileAddress::Ecrecover) + .count(); + + assert_eq!(ecrecover_count, 1); +} diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tests/utils.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tests/utils.rs index 53ae1c17e917..2dd8e2350eb4 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tests/utils.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tests/utils.rs @@ -103,3 +103,9 @@ pub(crate) fn read_max_depth_contract() -> Vec { "core/tests/ts-integration/contracts/zkasm/artifacts/deep_stak.zkasm/deep_stak.zkasm.zbin", ) } + +pub(crate) fn read_precompiles_contract() -> Vec { + read_bytecode( + "etc/contracts-test-data/artifacts-zk/contracts/precompiles/precompiles.sol/Precompiles.json", + ) +} diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs new file mode 100644 index 000000000000..16f5540172a8 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_capacity.rs @@ -0,0 +1,85 @@ +use zkevm_test_harness_1_4_0::{geometry_config::get_geometry_config, toolset::GeometryConfig}; + +const GEOMETRY_CONFIG: GeometryConfig = get_geometry_config(); +const OVERESTIMATE_PERCENT: f32 = 1.05; + +const MAIN_VM_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_vm_snapshot as f32; + +const CODE_DECOMMITTER_SORTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_code_decommitter_sorter as f32; + +const LOG_DEMUXER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_log_demuxer as f32; + +const STORAGE_SORTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_storage_sorter as f32; + +const EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_events_or_l1_messages_sorter as f32; + +const RAM_PERMUTATION_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_ram_permutation as f32; + +pub(crate) const CODE_DECOMMITTER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_code_decommitter as f32; + +pub(crate) const STORAGE_APPLICATION_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_storage_application as f32; + +pub(crate) const KECCAK256_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_keccak256_circuit as f32; + +pub(crate) const SHA256_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_sha256_circuit as f32; + +pub(crate) const ECRECOVER_CYCLE_FRACTION: f32 = + OVERESTIMATE_PERCENT / GEOMETRY_CONFIG.cycles_per_ecrecover_circuit as f32; + +// "Rich addressing" opcodes are opcodes that can write their return value/read the input onto the stack +// and so take 1-2 RAM permutations more than an average opcode. +// In the worst case, a rich addressing may take 3 ram permutations +// (1 for reading the opcode, 1 for writing input value, 1 for writing output value). +pub(crate) const RICH_ADDRESSING_OPCODE_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; + +pub(crate) const AVERAGE_OPCODE_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION; + +// Here "base" fraction is a fraction that will be used unconditionally. +// Usage of StorageApplication is being tracked separately as it depends on whether slot was read before or not. +pub(crate) const STORAGE_READ_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + LOG_DEMUXER_CYCLE_FRACTION + + STORAGE_SORTER_CYCLE_FRACTION; + +pub(crate) const EVENT_OR_L1_MESSAGE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + + 2.0 * EVENTS_OR_L1_MESSAGES_SORTER_CYCLE_FRACTION; + +// Here "base" fraction is a fraction that will be used unconditionally. +// Usage of StorageApplication is being tracked separately as it depends on whether slot was written before or not. +pub(crate) const STORAGE_WRITE_BASE_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + 2.0 * LOG_DEMUXER_CYCLE_FRACTION + + 2.0 * STORAGE_SORTER_CYCLE_FRACTION; + +pub(crate) const FAR_CALL_FRACTION: f32 = MAIN_VM_CYCLE_FRACTION + + RAM_PERMUTATION_CYCLE_FRACTION + + STORAGE_SORTER_CYCLE_FRACTION + + CODE_DECOMMITTER_SORTER_CYCLE_FRACTION; + +// 5 RAM permutations, because: 1 to read opcode + 2 reads + 2 writes. +// 2 reads and 2 writes are needed because unaligned access is implemented with +// aligned queries. +pub(crate) const UMA_WRITE_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + 5.0 * RAM_PERMUTATION_CYCLE_FRACTION; + +// 3 RAM permutations, because: 1 to read opcode + 2 reads. +// 2 reads are needed because unaligned access is implemented with aligned queries. +pub(crate) const UMA_READ_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + 3.0 * RAM_PERMUTATION_CYCLE_FRACTION; + +pub(crate) const PRECOMPILE_CALL_COMMON_FRACTION: f32 = + MAIN_VM_CYCLE_FRACTION + RAM_PERMUTATION_CYCLE_FRACTION + LOG_DEMUXER_CYCLE_FRACTION; diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs new file mode 100644 index 000000000000..65ab323ef362 --- /dev/null +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs @@ -0,0 +1,196 @@ +use std::marker::PhantomData; + +use zk_evm_1_4_0::{ + tracing::{BeforeExecutionData, VmLocalStateData}, + zk_evm_abstractions::precompiles::PrecompileAddress, + zkevm_opcode_defs::{LogOpcode, Opcode, UMAOpcode}, +}; +use zksync_state::{StoragePtr, WriteStorage}; + +use super::circuits_capacity::*; +use crate::{ + interface::{dyn_tracers::vm_1_4_0::DynTracer, tracer::TracerExecutionStatus}, + vm_boojum_integration::{ + bootloader_state::BootloaderState, + old_vm::{ + history_recorder::{HistoryMode, VectorHistoryEvent}, + memory::SimpleMemory, + }, + tracers::traits::VmTracer, + types::internals::ZkSyncVmState, + }, +}; + +/// Tracer responsible for collecting information about refunds. +#[derive(Debug)] +pub(crate) struct CircuitsTracer { + pub(crate) estimated_circuits_used: f32, + last_decommitment_history_entry_checked: Option, + last_written_keys_history_entry_checked: Option, + last_read_keys_history_entry_checked: Option, + last_precompile_history_entry_checked: Option, + _phantom_data: PhantomData, +} + +impl CircuitsTracer { + pub(crate) fn new() -> Self { + Self { + estimated_circuits_used: 0.0, + last_decommitment_history_entry_checked: None, + last_written_keys_history_entry_checked: None, + last_read_keys_history_entry_checked: None, + last_precompile_history_entry_checked: None, + _phantom_data: Default::default(), + } + } +} + +impl DynTracer> for CircuitsTracer { + fn before_execution( + &mut self, + _state: VmLocalStateData<'_>, + data: BeforeExecutionData, + _memory: &SimpleMemory, + _storage: StoragePtr, + ) { + let used = match data.opcode.variant.opcode { + Opcode::Nop(_) + | Opcode::Add(_) + | Opcode::Sub(_) + | Opcode::Mul(_) + | Opcode::Div(_) + | Opcode::Jump(_) + | Opcode::Binop(_) + | Opcode::Shift(_) + | Opcode::Ptr(_) => RICH_ADDRESSING_OPCODE_FRACTION, + Opcode::Context(_) | Opcode::Ret(_) | Opcode::NearCall(_) => AVERAGE_OPCODE_FRACTION, + Opcode::Log(LogOpcode::StorageRead) => STORAGE_READ_BASE_FRACTION, + Opcode::Log(LogOpcode::StorageWrite) => STORAGE_WRITE_BASE_FRACTION, + Opcode::Log(LogOpcode::ToL1Message) | Opcode::Log(LogOpcode::Event) => { + EVENT_OR_L1_MESSAGE_FRACTION + } + Opcode::Log(LogOpcode::PrecompileCall) => PRECOMPILE_CALL_COMMON_FRACTION, + Opcode::FarCall(_) => FAR_CALL_FRACTION, + Opcode::UMA(UMAOpcode::AuxHeapWrite | UMAOpcode::HeapWrite) => UMA_WRITE_FRACTION, + Opcode::UMA( + UMAOpcode::AuxHeapRead | UMAOpcode::HeapRead | UMAOpcode::FatPointerRead, + ) => UMA_READ_FRACTION, + Opcode::Invalid(_) => unreachable!(), // invalid opcodes are never executed + }; + + self.estimated_circuits_used += used; + } +} + +impl VmTracer for CircuitsTracer { + fn initialize_tracer(&mut self, state: &mut ZkSyncVmState) { + self.last_decommitment_history_entry_checked = Some( + state + .decommittment_processor + .decommitted_code_hashes + .history() + .len(), + ); + + self.last_written_keys_history_entry_checked = + Some(state.storage.written_keys.history().len()); + + self.last_read_keys_history_entry_checked = Some(state.storage.read_keys.history().len()); + + self.last_precompile_history_entry_checked = Some( + state + .precompiles_processor + .precompile_cycles_history + .history() + .len(), + ); + } + + fn finish_cycle( + &mut self, + state: &mut ZkSyncVmState, + _bootloader_state: &mut BootloaderState, + ) -> TracerExecutionStatus { + // Trace decommitments. + let last_decommitment_history_entry_checked = self + .last_decommitment_history_entry_checked + .expect("Value must be set during init"); + let history = state + .decommittment_processor + .decommitted_code_hashes + .history(); + for (_, history_event) in &history[last_decommitment_history_entry_checked..] { + // We assume that only insertions may happen during a single VM inspection. + assert!(history_event.value.is_some()); + let bytecode_len = state + .decommittment_processor + .known_bytecodes + .inner() + .get(&history_event.key) + .expect("Bytecode must be known at this point") + .len(); + + // Each cycle of `CodeDecommitter` processes 64 bytes. + let decommitter_cycles_used = bytecode_len / 4; + self.estimated_circuits_used += + (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION; + } + self.last_decommitment_history_entry_checked = Some(history.len()); + + // Process storage writes. + let last_writes_history_entry_checked = self + .last_written_keys_history_entry_checked + .expect("Value must be set during init"); + let history = state.storage.written_keys.history(); + for (_, history_event) in &history[last_writes_history_entry_checked..] { + // We assume that only insertions may happen during a single VM inspection. + assert!(history_event.value.is_some()); + + self.estimated_circuits_used += 2.0 * STORAGE_APPLICATION_CYCLE_FRACTION; + } + self.last_written_keys_history_entry_checked = Some(history.len()); + + // Process storage reads. + let last_reads_history_entry_checked = self + .last_read_keys_history_entry_checked + .expect("Value must be set during init"); + let history = state.storage.read_keys.history(); + for (_, history_event) in &history[last_reads_history_entry_checked..] { + // We assume that only insertions may happen during a single VM inspection. + assert!(history_event.value.is_some()); + + // If the slot is already written to, then we've already taken 2 cycles into account. + if !state + .storage + .written_keys + .inner() + .contains_key(&history_event.key) + { + self.estimated_circuits_used += STORAGE_APPLICATION_CYCLE_FRACTION; + } + } + self.last_read_keys_history_entry_checked = Some(history.len()); + + // Process precompiles. + let last_precompile_history_entry_checked = self + .last_precompile_history_entry_checked + .expect("Value must be set during init"); + let history = state + .precompiles_processor + .precompile_cycles_history + .history(); + for (_, history_event) in &history[last_precompile_history_entry_checked..] { + if let VectorHistoryEvent::Push((precompile, cycles)) = history_event { + let fraction = match precompile { + PrecompileAddress::Ecrecover => ECRECOVER_CYCLE_FRACTION, + PrecompileAddress::SHA256 => SHA256_CYCLE_FRACTION, + PrecompileAddress::Keccak256 => KECCAK256_CYCLE_FRACTION, + }; + self.estimated_circuits_used += (*cycles as f32) * fraction; + } + } + self.last_precompile_history_entry_checked = Some(history.len()); + + TracerExecutionStatus::Continue + } +} diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/default_tracers.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/default_tracers.rs index f0690d996b21..236421726051 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/default_tracers.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/default_tracers.rs @@ -32,7 +32,7 @@ use crate::{ computational_gas_price, gas_spent_on_bytecodes_and_long_messages_this_opcode, print_debug_if_needed, VmHook, }, - RefundsTracer, ResultTracer, + CircuitsTracer, RefundsTracer, ResultTracer, }, types::internals::ZkSyncVmState, VmTracer, @@ -62,6 +62,11 @@ pub(crate) struct DefaultExecutionTracer { pub(crate) pubdata_tracer: Option>, pub(crate) dispatcher: TracerDispatcher, ret_from_the_bootloader: Option, + // This tracer tracks what opcodes were executed and calculates how much circuits will be generated. + // It only takes into account circuits that are generated for actual execution. It doesn't + // take into account e.g circuits produced by the initial bootloader memory commitment. + pub(crate) circuits_tracer: CircuitsTracer, + storage: StoragePtr, _phantom: PhantomData, } @@ -88,6 +93,7 @@ impl DefaultExecutionTracer { dispatcher, pubdata_tracer, ret_from_the_bootloader: None, + circuits_tracer: CircuitsTracer::new(), storage, _phantom: PhantomData, } @@ -161,14 +167,15 @@ impl Debug for DefaultExecutionTracer { /// The macro passes the function call to all tracers. macro_rules! dispatch_tracers { ($self:ident.$function:ident($( $params:expr ),*)) => { - $self.result_tracer.$function($( $params ),*); - $self.dispatcher.$function($( $params ),*); + $self.result_tracer.$function($( $params ),*); + $self.dispatcher.$function($( $params ),*); if let Some(tracer) = &mut $self.refund_tracer { tracer.$function($( $params ),*); } if let Some(tracer) = &mut $self.pubdata_tracer { tracer.$function($( $params ),*); } + $self.circuits_tracer.$function($( $params ),*); }; } diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/mod.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/mod.rs index 33d043de6eb1..1bdb1b6ccdbf 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/mod.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/mod.rs @@ -1,13 +1,16 @@ +pub(crate) use circuits_tracer::CircuitsTracer; pub(crate) use default_tracers::DefaultExecutionTracer; pub(crate) use pubdata_tracer::PubdataTracer; pub(crate) use refunds::RefundsTracer; pub(crate) use result_tracer::ResultTracer; +pub(crate) mod circuits_tracer; pub(crate) mod default_tracers; pub(crate) mod pubdata_tracer; pub(crate) mod refunds; pub(crate) mod result_tracer; +mod circuits_capacity; pub mod dispatcher; pub(crate) mod traits; pub(crate) mod utils; diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs index b775b4b63bca..bff8dbf0f56d 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs @@ -40,7 +40,7 @@ pub type ZkSyncVmState = VmState< StorageOracle, SimpleMemory, InMemoryEventSink, - PrecompilesProcessorWithHistory, + PrecompilesProcessorWithHistory, DecommitterOracle, DummyTracer, >; @@ -84,7 +84,7 @@ pub(crate) fn new_vm_state( let storage_oracle: StorageOracle = StorageOracle::new(storage.clone()); let mut memory = SimpleMemory::default(); let event_sink = InMemoryEventSink::default(); - let precompiles_processor = PrecompilesProcessorWithHistory::::default(); + let precompiles_processor = PrecompilesProcessorWithHistory::::default(); let mut decommittment_processor: DecommitterOracle = DecommitterOracle::new(storage); diff --git a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs index 2fe0931b6263..b72651c0a9d1 100644 --- a/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs +++ b/core/lib/multivm/src/versions/vm_latest/oracles/storage.rs @@ -60,9 +60,9 @@ pub struct StorageOracle { // Storage refunds that oracle has returned in `estimate_refunds_for_write`. pub(crate) returned_refunds: HistoryRecorder, H>, - // Keeps track of storage keys that were written to. + // Keeps track of storage keys that were ever written to. pub(crate) written_keys: HistoryRecorder, HistoryEnabled>, - // Keeps track of storage keys that were read. + // Keeps track of storage keys that were ever read. pub(crate) read_keys: HistoryRecorder, HistoryEnabled>, } diff --git a/core/lib/zksync_core/src/api_server/web3/tests/snapshots.rs b/core/lib/zksync_core/src/api_server/web3/tests/snapshots.rs index 608f2845065f..956120389825 100644 --- a/core/lib/zksync_core/src/api_server/web3/tests/snapshots.rs +++ b/core/lib/zksync_core/src/api_server/web3/tests/snapshots.rs @@ -21,7 +21,7 @@ async fn seal_l1_batch( ); storage .blocks_dal() - .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&header, &[], BlockGasCount::default(), &[], &[], 0) .await?; storage .blocks_dal() From bc3089475e05a1ea76383a86c913870e457c736e Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Fri, 5 Jan 2024 11:56:53 +0200 Subject: [PATCH 25/27] Add sanity panic --- .../src/versions/vm_boojum_integration/tests/precompiles.rs | 2 ++ .../versions/vm_boojum_integration/tracers/circuits_tracer.rs | 2 ++ core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs | 2 ++ .../multivm/src/versions/vm_latest/tracers/circuits_tracer.rs | 2 ++ 4 files changed, 8 insertions(+) diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs index d45716dd98c8..516331d574f4 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tests/precompiles.rs @@ -24,6 +24,7 @@ fn test_keccak() { .with_custom_contracts(vec![(contract, address, true)]) .build(); + // calldata for `doKeccak(1000)`. let keccak1000_calldata = "370f20ac00000000000000000000000000000000000000000000000000000000000003e8"; @@ -67,6 +68,7 @@ fn test_sha256() { .with_custom_contracts(vec![(contract, address, true)]) .build(); + // calldata for `doSha256(1000)`. let sha1000_calldata = "5d0b4fb500000000000000000000000000000000000000000000000000000000000003e8"; diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs index 65ab323ef362..123d5fd4f4ed 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs @@ -187,6 +187,8 @@ impl VmTracer for CircuitsTracer { PrecompileAddress::Keccak256 => KECCAK256_CYCLE_FRACTION, }; self.estimated_circuits_used += (*cycles as f32) * fraction; + } else { + panic!("Precompile calls should not be rolled back"); } } self.last_precompile_history_entry_checked = Some(history.len()); diff --git a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs index c2a0ce12760d..adc62a4bd2d6 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/precompiles.rs @@ -24,6 +24,7 @@ fn test_keccak() { .with_custom_contracts(vec![(contract, address, true)]) .build(); + // calldata for `doKeccak(1000)`. let keccak1000_calldata = "370f20ac00000000000000000000000000000000000000000000000000000000000003e8"; @@ -67,6 +68,7 @@ fn test_sha256() { .with_custom_contracts(vec![(contract, address, true)]) .build(); + // calldata for `doSha256(1000)`. let sha1000_calldata = "5d0b4fb500000000000000000000000000000000000000000000000000000000000003e8"; diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index c65664977568..e232b3566c47 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -187,6 +187,8 @@ impl VmTracer for CircuitsTracer { PrecompileAddress::Keccak256 => KECCAK256_CYCLE_FRACTION, }; self.estimated_circuits_used += (*cycles as f32) * fraction; + } else { + panic!("Precompile calls should not be rolled back"); } } self.last_precompile_history_entry_checked = Some(history.len()); From 31c949969d88370850254611f475f4f2dc54e2f0 Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Fri, 5 Jan 2024 12:16:17 +0200 Subject: [PATCH 26/27] Fix --- .../vm_boojum_integration/tracers/circuits_tracer.rs | 5 +++-- .../src/versions/vm_latest/tracers/circuits_tracer.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs index 123d5fd4f4ed..9f26cd057ff0 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/circuits_tracer.rs @@ -130,8 +130,9 @@ impl VmTracer for CircuitsTracer { .expect("Bytecode must be known at this point") .len(); - // Each cycle of `CodeDecommitter` processes 64 bytes. - let decommitter_cycles_used = bytecode_len / 4; + // Each cycle of `CodeDecommitter` processes 2 words. + // If the number of words in bytecode is odd, then number of cycles must be rounded up. + let decommitter_cycles_used = (bytecode_len + 1) / 2; self.estimated_circuits_used += (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION; } diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs index e232b3566c47..c2383b11561f 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/circuits_tracer.rs @@ -130,8 +130,9 @@ impl VmTracer for CircuitsTracer { .expect("Bytecode must be known at this point") .len(); - // Each cycle of `CodeDecommitter` processes 64 bytes. - let decommitter_cycles_used = bytecode_len / 4; + // Each cycle of `CodeDecommitter` processes 2 words. + // If the number of words in bytecode is odd, then number of cycles must be rounded up. + let decommitter_cycles_used = (bytecode_len + 1) / 2; self.estimated_circuits_used += (decommitter_cycles_used as f32) * CODE_DECOMMITTER_CYCLE_FRACTION; } From a3916dc9fcc91ba8dfd21ef9ab0420c7511e0fcb Mon Sep 17 00:00:00 2001 From: perekopskiy Date: Fri, 5 Jan 2024 16:31:54 +0200 Subject: [PATCH 27/27] Fix test --- core/lib/zksync_core/src/consistency_checker/tests/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/lib/zksync_core/src/consistency_checker/tests/mod.rs b/core/lib/zksync_core/src/consistency_checker/tests/mod.rs index 1dac556ec6a7..e8cc9f2c26cc 100644 --- a/core/lib/zksync_core/src/consistency_checker/tests/mod.rs +++ b/core/lib/zksync_core/src/consistency_checker/tests/mod.rs @@ -195,7 +195,7 @@ impl SaveAction<'_> { Self::InsertBatch(l1_batch) => { storage .blocks_dal() - .insert_l1_batch(&l1_batch.header, &[], BlockGasCount::default(), &[], &[]) + .insert_l1_batch(&l1_batch.header, &[], BlockGasCount::default(), &[], &[], 0) .await .unwrap(); }