Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Proof generation for tx circuit fails with: Error:InvalidInstances #1052

Closed
AronisAt79 opened this issue Jan 10, 2023 · 10 comments
Closed

Proof generation for tx circuit fails with: Error:InvalidInstances #1052

AronisAt79 opened this issue Jan 10, 2023 · 10 comments

Comments

@AronisAt79
Copy link
Contributor

zkevm-chain commit: dfe9cc5717b7f248b644715b00726cc340adcce6
circuits commit: "https://github.com/pinkiebell/zkevm-circuits.git", branch = "zkevm-chain"

logs & traces: https://zkevm-chain-testing.s3.eu-central-1.amazonaws.com/proveSingeCrossChainTx_tx_False_57-maronis.tar.gz

@AronisAt79 AronisAt79 added this to the successful-erc20 milestone Jan 10, 2023
@CPerezz CPerezz removed their assignment Jan 10, 2023
@ed255 ed255 moved this to 🆕 Product Backlog Items in zkEVM Community Edition Jan 12, 2023
@aguzmant103 aguzmant103 moved this from 🆕 Product Backlog Items to 📋 Refined Backlog in zkEVM Community Edition Jan 12, 2023
@aguzmant103
Copy link
Member

@ChihChengLiang will check the logs and extract useful information on how to proceed.

@ChihChengLiang
Copy link
Collaborator

This one has nothing traceable other than invalid instances. It would be helpful to know what inputs are fed into what circuits. cc @pinkiebell

https://github.com/privacy-scaling-explorations/zkevm-chain/blob/68982510b93fd34e06f5d2f444a3807b90668b40/prover/src/utils.rs#L63

@pinkiebell
Copy link
Contributor

I think that is due the tx circuit doesn't have a proper fn instance implemented yet.

@CPerezz
Copy link
Member

CPerezz commented Jan 16, 2023

Could you fill an issue in the repo to include them?? @pinkiebell

@ed255
Copy link
Member

ed255 commented Jan 25, 2023

I think that is due the tx circuit doesn't have a proper fn instance implemented yet.

This is correct! I fixed it here #1104

@pinkiebell Once that PR is merged, the zkevm-chain should be able to run all circuits like this:

/// Integration test generic function
pub async fn test_circuit_at_block<C: SubCircuit<Fr> + Circuit<Fr>>(
circuit_name: &str,
degree: u32,
block_num: u64,
actual: bool,
proving_key: Option<ProvingKey<G1Affine>>,
) {
log::info!("test {} circuit, block number: {}", circuit_name, block_num);
let (builder, _) = gen_inputs(block_num).await;
let mut block = block_convert(&builder.block, &builder.code_db).unwrap();
block.randomness = Fr::from(TEST_MOCK_RANDOMNESS);
let circuit = C::new_from_block(&block);
let instance = circuit.instance();
if actual {
test_actual(degree, circuit, instance, proving_key);
} else {
test_mock(degree, &circuit, instance);
}
}

That function can be called for each circuit like in here: https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/feature%2Funify-integration-tests-1/integration-tests/tests/circuits.rs

@davidnevadoc
Copy link
Contributor

Is this solved then? @ed255

@ed255
Copy link
Member

ed255 commented Jan 31, 2023

Is this solved then? @ed255

In theory I think it should be resolved, but I'd prefer to wait until this is deployed in the testnet so that we can really confirm this error is not appearing anymore :)

@pinkiebell
Copy link
Contributor

@AronisAt79
Copy link
Contributor Author

@AronisAt79 This can be tested with this branch https://github.com/privacy-scaling-explorations/zkevm-chain/tree/2023-01-16

Thanks @pinkiebell! will start the tests now.

@AronisAt79
Copy link
Contributor Author

Testedon zkevm-chain commit 6cdd88644cfe87a7f640cc279c54a44b93bbf0fa.
Proof generation now succeeds.
Full logs: https://zkevm-chain-testing.s3.eu-central-1.amazonaws.com/proveSingeCrossChainTx_tx_True_329-timer.tar.gz

@ed255 ed255 moved this from 📋 Refined Backlog to ✅ Done in zkEVM Community Edition Feb 1, 2023
SuccinctPaul pushed a commit to SuccinctPaul/zkevm-circuits that referenced this issue Feb 15, 2024
* fix typos README.md

* fix minor typos Bytecode_Circuit.md

* fix typos EVM_Circuit.md

* fix typos Keccak_Circuit.md

* fix typos MPT_Circuit.md

* fix typos Modexp_Circuit.md

* fix typos Public_Input_Circuit.md

* fix typos Sig_Circuit.md

* fix typos State_Circuit.md

* fix typos Tx_Circuit.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

7 participants