Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two-to-one aggregation circuits #216

Closed
wants to merge 6 commits into from
Closed

Conversation

wborgeaud
Copy link
Contributor

Add two circuits to AllRecursiveCircuits:

  • two_to_one_aggregation that aggregates two unrelated aggregation proofs.
  • two_to_one_block that aggregates two unrelated block proofs.

@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label May 3, 2024
// Preprocess all circuits.
let all_circuits = AllRecursiveCircuits::<F, C, D>::new(
&all_stark,
&[8..17, 8..15, 8..18, 8..15, 8..10, 8..13, 8..20],
Copy link
Collaborator

@Nashtare Nashtare May 4, 2024

Choose a reason for hiding this comment

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

nit: let's at least use the start ranges of the empty_txn_list example so that it doesn't require a huge amount of RAM when trying it locally :)

Suggested change
&[8..17, 8..15, 8..18, 8..15, 8..10, 8..13, 8..20],
&[16..17, 9..15, 12..18, 14..15, 9..10, 12..13, 17..20],

Comment on lines +77 to +83
pub two_to_one_aggregation: TwoToOneAggCircuitData<F, C, D>,
/// The block circuit, which verifies an aggregation root proof and an
/// optional previous block proof.
pub block: BlockCircuitData<F, C, D>,
/// The two-to-one block aggregation circuit, which verifies two unrelated
/// block proofs.
pub two_to_one_block: TwoToOneAggCircuitData<F, C, D>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit confused about the two_to_one_aggregation.
I see the use of aggregating two final block proofs together, but why aggregating intermediary layers that don't share anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it could be useful in some cases. A "block proof" is just an "aggregation proof" along with a recursively verified previous block proof. But in some cases, the previous batch is already verified elsewhere (e.g. on L1), so the recursive proof is redundant.
I might be missing something though.

Comment on lines +77 to +83
pub two_to_one_aggregation: TwoToOneAggCircuitData<F, C, D>,
/// The block circuit, which verifies an aggregation root proof and an
/// optional previous block proof.
pub block: BlockCircuitData<F, C, D>,
/// The two-to-one block aggregation circuit, which verifies two unrelated
/// block proofs.
pub two_to_one_block: TwoToOneAggCircuitData<F, C, D>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What exactly is the goal behind? This will only support one additional layer of aggregation, not an arbitrary one, which I would have thought was the desired goal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so too. I think this is just a temporary solution. @muursh ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Aye it is just a place holder for now. We will have Einar make some modifications to the current approach.

@einar-polygon
Copy link
Contributor

For the record, I am actually developing on this branch: https://github.com/0xPolygonZero/zk_evm/tree/two_to_one_aggregation_local_friendly

@einar-polygon
Copy link
Contributor

Closing as agreed with @wborgeaud and @Nashtare.

Superseded by #318.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: evm_arithmetization Anything related to the evm_arithmetization crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants