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

Introduce the Root Circuit to the integration tests #1471

Merged
merged 19 commits into from
Jun 20, 2023

Conversation

ed255
Copy link
Member

@ed255 ed255 commented Jun 13, 2023

Description

Introduce two new sets of tests in the Integration tests with the root circuit: one where the root circuit is verified with the MockProver and the other where a real proof is generated. The input proof to the root circuit is the output of each subcircuit test we had before.

Issue Link

Resolve #1334
Resolve #1460

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Contents

Issue #1335 has been resolved by assigning the fixed columns in the ExpTable and CopyTable in their load methods. Previously they were either not assigned, or assigned dynamically. This was not affecting the SuperCircuit or the Exp/Copy Circuit because in those cases, the assignment is done with a different method. Only for SubCircuit tests where the SubCircuit requires the external table the load method is used.

Rationale

Testing a Root Circuit (no mater if it's with the MockProver or with a real proof) requires a real proof of the underlying circuit. This means that now for each SubCircuit we have 3 tests that require the SubCircuit proof:

  • normal real prover test
  • root mock prover test
  • root real prover test

I implemented a cache to keep the SubCircuit proofs for each SubCircuit and block so that we have the possibility of running all the tests in a single run while reusing the SubCircuit proofs.

How Has This Been Tested?

I have only tested the SubCircuits (minus SuperCircuit) + Root Circuit via MockProver.

  • The machine I use has 64 GiB of memory, and that's not enough to generate a SuperCircuit proof
  • I have as a pending task to try the Root Circuit real prover

But now we can run these tests under the github CI, so we can defer full testing after the PR is merged.

ed255 added 11 commits June 13, 2023 13:25
The CopyTable contains a BinaryNumberChip that uses a selector, but the load method doesn't enable the selector.  The result of this is that when testing standalone circuits like the EVM circuit, the CopyTable will be included with a fixed column that is all zeroes.  This causes problems when testing the EVM circuit with the Root aggregation circuit, because it doesn't support zeroed fixed columns.  This commit should fix the problem.
@github-actions github-actions bot added CI Issues related to the Continuous Integration mechanisms of the repository. crate-integration-tests Issues related to the integration-tests workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member labels Jun 13, 2023
@github-actions github-actions bot added the crate-bus-mapping Issues related to the bus-mapping workspace member label Jun 13, 2023
@ed255 ed255 changed the title [WIP] Introduce the Root Circuit to the integration tests Introduce the Root Circuit to the integration tests Jun 14, 2023
@ChihChengLiang
Copy link
Collaborator

Need 2 reviwers. The priority of this task is lower than word lo-hi

@han0110 han0110 self-requested a review June 15, 2023 08:38
@ed255 ed255 requested a review from CPerezz June 15, 2023 11:07
Copy link
Collaborator

@han0110 han0110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work!

(for SuperCircuit it seems we'd need 226 size RootCircuit to aggregate from the experience of zkevm-chain)

@ed255
Copy link
Member Author

ed255 commented Jun 16, 2023

(for SuperCircuit it seems we'd need 2^26 size RootCircuit to aggregate from the experience of zkevm-chain)

Thanks for the hint! I've updated the tests in 93dddd2 to use degree=26 for Root Circuit with SuperCircuit and degree=24 for the other cases.

Copy link
Member

@CPerezz CPerezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Just 2 small suggestions. Feel free to ignore!

integration-tests/src/integration_test_circuits.rs Outdated Show resolved Hide resolved
integration-tests/src/integration_test_circuits.rs Outdated Show resolved Hide resolved
@ed255
Copy link
Member Author

ed255 commented Jun 19, 2023

LGTM!
Just 2 small suggestions. Feel free to ignore!

Thanks for the suggestions! I've addressed them in 957f6bd

@ed255 ed255 added this pull request to the merge queue Jun 20, 2023
Merged via the queue into main with commit 0ecd781 Jun 20, 2023
19 checks passed
@ed255 ed255 deleted the feature/copy-table-assign-fixed branch June 20, 2023 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI Issues related to the Continuous Integration mechanisms of the repository. crate-bus-mapping Issues related to the bus-mapping workspace member crate-integration-tests Issues related to the integration-tests workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member
Projects
None yet
4 participants