Skip to content

Commit bf1766f

Browse files
authored
Merge pull request #1724 from matter-labs/deniallugo-fix-nonce
Fix nonce mismatched
2 parents d81870b + 498ebc3 commit bf1766f

4 files changed

Lines changed: 708 additions & 664 deletions

File tree

core/bin/prover/src/plonk_step_by_step_prover.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
use std::sync::Mutex;
33
// Workspace deps
44
use zksync_config::ChainConfig;
5+
use zksync_crypto::bellman::Circuit;
56
use zksync_crypto::proof::{AggregatedProof, PrecomputedSampleProofs, SingleProof};
67
use zksync_crypto::Engine;
78
use zksync_prover_utils::aggregated_proofs::{gen_aggregate_proof, prepare_proof_data};
@@ -10,6 +11,7 @@ use zksync_prover_utils::{PlonkVerificationKey, SetupForStepByStepProver};
1011
use zksync_utils::parse_env;
1112
// Local deps
1213
use crate::{ProverConfig, ProverImpl};
14+
use zksync_crypto::franklin_crypto::circuit::test::TestConstraintSystem;
1315
use zksync_prover_utils::fs_utils::load_precomputed_proofs;
1416

1517
/// We prepare some data before making proof for each block size, so we cache it in case next block
@@ -56,6 +58,14 @@ impl PlonkStepByStepProver {
5658
block_size: usize,
5759
) -> anyhow::Result<SingleProof> {
5860
// we do this way here so old precomp is dropped
61+
let mut cs = TestConstraintSystem::<Engine>::new();
62+
witness.clone().synthesize(&mut cs).unwrap();
63+
64+
if let Some(err) = cs.which_is_unsatisfied() {
65+
println!("unconstrained: {}", cs.find_unconstrained());
66+
println!("number of constraints {}", cs.num_constraints());
67+
println!("Unsatisfied {:?}", err);
68+
}
5969
let valid_cached_precomp = {
6070
self.prepared_computations
6171
.lock()

core/lib/circuit/src/witness/tests/mint_nft.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use num::BigUint;
22

33
use zksync_crypto::franklin_crypto::bellman::pairing::bn256::Bn256;
4+
use zksync_crypto::params::{MIN_NFT_TOKEN_ID, NFT_STORAGE_ACCOUNT_ID, NFT_TOKEN_ID};
45
use zksync_state::handler::TxHandler;
56
use zksync_state::state::{CollectedFee, ZkSyncState};
67
use zksync_types::{AccountId, MintNFT, MintNFTOp, TokenId, H256};
@@ -10,7 +11,6 @@ use crate::witness::tests::test_utils::{
1011
WitnessTestAccount,
1112
};
1213
use crate::witness::{utils::WitnessBuilder, MintNFTWitness, SigDataInput};
13-
use zksync_crypto::params::{MIN_NFT_TOKEN_ID, NFT_STORAGE_ACCOUNT_ID, NFT_TOKEN_ID};
1414

1515
/// Basic check for execution of `MintNFT` operation in circuit.
1616
/// Here we create two accounts and perform a mintNFT operation.

0 commit comments

Comments
 (0)