Skip to content

Commit

Permalink
new keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Jan 14, 2021
1 parent 4efefc4 commit 9e443d2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
5 changes: 1 addition & 4 deletions contracts/contracts/ZkSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,7 @@ contract ZkSync is UpgradeableMaster, Storage, Config, Events, ReentrancyGuard {
function proveBlocks(StoredBlockInfo[] memory _committedBlocks, ProofInput memory _proof) external nonReentrant {
uint32 currentTotalBlocksProven = totalBlocksProven;
for (uint256 i = 0; i < _committedBlocks.length; ++i) {
require(
hashStoredBlockInfo(_committedBlocks[i]) == storedBlockHashes[currentTotalBlocksProven + 1],
"pbl2"
);
require(hashStoredBlockInfo(_committedBlocks[i]) == storedBlockHashes[currentTotalBlocksProven + 1], "o1");
++currentTotalBlocksProven;

require(_proof.commitments[i] & INPUT_MASK == uint256(_committedBlocks[i].commitment) & INPUT_MASK, "o"); // incorrect block commitment in proof
Expand Down
1 change: 1 addition & 0 deletions core/lib/circuit/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2015,6 +2015,7 @@ impl<'a, E: RescueEngine + JubjubEngine> ZkSyncCircuit<'a, E> {
ohs_valid_flags.push(is_second_chunk.not());
ohs_valid_flags.push(is_transfer);
ohs_valid_flags.push(pubdata_properly_copied);
ohs_valid_flags.push(is_valid_timestamp.clone());

let is_ohs_valid = multi_and(cs.namespace(|| "is_ohs_valid"), &ohs_valid_flags)?;

Expand Down
14 changes: 8 additions & 6 deletions core/tests/testkit/src/bin/block_sizes_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use zksync_crypto::params::account_tree_depth;
use zksync_prover_utils::aggregated_proofs::{gen_aggregate_proof, prepare_proof_data};
use zksync_prover_utils::{PlonkVerificationKey, SetupForStepByStepProver};
use zksync_testkit::eth_account::EthereumAccount;
use zksync_testkit::external_commands::{deploy_contracts, get_test_accounts};
use zksync_testkit::external_commands::{deploy_contracts, get_test_accounts, js_revert_reason};
use zksync_testkit::zksync_account::ZkSyncAccount;
use zksync_testkit::{
genesis_state, spawn_state_keeper, AccountSet, ETHAccountId, TestSetup, TestkitConfig, Token,
Expand Down Expand Up @@ -212,12 +212,10 @@ async fn main() {
.expect_success();
}

{
for aggregated_proof_size in aggregated_proof_sizes {
let block_size = *available_block_chunk_sizes.first().unwrap();
info!("Checking recursive keys for block size: {}", block_size);

let aggregated_proof_size = 1;

let mut blocks = Vec::new();
let mut proofs = Vec::new();

Expand All @@ -236,7 +234,6 @@ async fn main() {
assert!(block.block_chunks_size <= block_size);
// complete block to the correct size with noops
block.block_chunks_size = block_size;
blocks.push(block.clone());

let timer = Instant::now();
let witness = build_block_witness(&mut circuit_account_tree, &block)
Expand Down Expand Up @@ -279,10 +276,15 @@ async fn main() {
blocks,
proof: aggregated_proof.serialize_aggregated_proof(),
};
test_setup
let tx_receipt = test_setup
.execute_verify_commitments(proof_op)
.await
.expect_success();
info!(
"Aggregated proof, size: {}, gas cost: {}",
aggregated_proof_size,
tx_receipt.gas_used.expect("Gas used empty")
);
}

stop_state_keeper_sender.send(()).expect("sk stop send");
Expand Down
2 changes: 1 addition & 1 deletion etc/env/dev.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ PRIVATE_CORE_SERVER_URL=http://127.0.0.1:8090
RUST_BACKTRACE=1

# key dir ending with latest version of circuit commit hash
KEY_DIR=keys/plonk-8c6e12e4c
KEY_DIR=keys/contracts-4
# actual supported block chunks sizes by verifier contract (determined by circuit size on setup boundaries)
# and setup power needed to proof block of this size
SUPPORTED_BLOCK_CHUNKS_SIZES=6,30,74,150,320,630
Expand Down
Binary file not shown.

0 comments on commit 9e443d2

Please sign in to comment.