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

bug: some fixed columns are not fixed at all #986

Closed
lispc opened this issue Dec 14, 2022 · 7 comments · Fixed by #1064 or #1062
Closed

bug: some fixed columns are not fixed at all #986

lispc opened this issue Dec 14, 2022 · 7 comments · Fixed by #1064 or #1062

Comments

@lispc
Copy link
Collaborator

lispc commented Dec 14, 2022

In super circuit, copy_table.q_enable has no padding mechanism so it is not fixed in fact.

So using empty block and real block can result with different vks. Even if proof from real block can be verified with vk from empty block, it is not sound since q_enable is almost disabled in (allmost?) all offsets..

Another smaller problem is that evm circuit has tx_table.tag, which is also a fixed column, but in evm circuit it is not fixed (while in super circuit tx_table.tag is fixed). If we treat evm circuit as a "sub" circuit then it may be acceptable. But again, vk from evm circuit is not universal anyway...

I remember we have encounter this problem (sveral times?) before.. So maybe better to setup a test case to ensure gen_vk(empty_block) == gen_vk(a_real_block)..

@han0110
Copy link
Collaborator

han0110 commented Dec 15, 2022

But again, vk from evm circuit is not universal anyway...

I think we can update it to be fixed just by move TxCircuit::assign_tx_table logic to TxTable::load, and it shouldn't affect the testing time. Then also need to update this

let num_rows_required_for_tx_table: usize =
block.txs.iter().map(|tx| 9 + tx.call_data.len()).sum();
to use max_calldata instead of tx.call_data.len().

So maybe better to setup a test case to ensure gen_vk(empty_block) == gen_vk(a_real_block)..

I think this is a really nice idea if we have this test in integration test.

@ed255 ed255 added this to the successful-erc20 milestone Dec 16, 2022
@CPerezz CPerezz self-assigned this Jan 5, 2023
@aguzmant103
Copy link
Member

aguzmant103 commented Jan 5, 2023

Meeting notes:

  • Not only fixing but adding a new test to the code base to verify
  • Concern this test will take a lot of time because it will need a real prover
  • Key generation not much but supercircuit maybe yes
  • We want to address all circuits not just the ones identified above

@CPerezz
Copy link
Member

CPerezz commented Jan 13, 2023

@han0110 I think that this wasn't a testing issue but rather an absence of padding for the CopyCircuit.
At least we've been with it with @ed255 and seems that we have discovered a couple of things that were missing!

Let us know what you think if you have time!

@ed255
Copy link
Member

ed255 commented Jan 17, 2023

Maybe related to this issue (@CPerezz pointed me to it): privacy-scaling-explorations/zkevm-specs#359 as all circuits will require a padding strategy to have constant fixed columns regardless of the input.

@CPerezz CPerezz reopened this Jan 18, 2023
@CPerezz
Copy link
Member

CPerezz commented Jan 18, 2023

This won't be closed until #1062 is merged.

@ed255 ed255 linked a pull request Jan 19, 2023 that will close this issue
@aguzmant103 aguzmant103 assigned ed255 and unassigned CPerezz Jan 26, 2023
@aguzmant103
Copy link
Member

Note: the remaining circuit is exp circuit.
After working on the alternative PR we can close this PR as duplicate #1062

@ed255
Copy link
Member

ed255 commented Jan 27, 2023

Haichen will check with the author of the spec PR privacy-scaling-explorations/zkevm-specs#359 to determine when is the circuit PR is expected to be done in order to coordinate with PSE. We would like to address this issue (non-constant fixed columns) with high priority, so if the expected date for the circuit is too far away we (PSE) can work on on the circuit in parallel while the spec PR is being done (considering that the strategy on how to resolve the Exp Circuit padding has already been discussed and won't change the circuit constraints)

@ed255 ed255 removed their assignment Jan 27, 2023
noel2004 pushed a commit to noel2004/zkevm-circuits that referenced this issue Nov 29, 2023
…scaling-explorations#986)

* skip stTimeConsuming

* add glob pattern support

* Update config.rs

* lint

---------

Co-authored-by: Zhang Zhuo <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
5 participants