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

feat: Zeromorph changes for full Goblin #3329

Conversation

codygunton
Copy link
Contributor

@codygunton codygunton commented Nov 16, 2023

This PR adds polynomial "concatenation" functionality into ZeroMorph.

The idea behind concatenation is the following: given several polynomials (for example, $X_1$, $X_2$, $X_3$, $X_4$, $Y_1$, $Y_2$, $Y_3$, $Y_4$) of length n, we want to show that the set of values in $X$ polynomials is identical to the values in $Y$.The way we can do it is with a grand product argument, however sumcheck complexity of the grand product argument is quadratic in the number of polynomials that are used in the GP (we have to extend the univariate to the degree d and then we need to multiply those (d+1) elements d times). However, if we were to perform the same grand product instead on polynomials $X= (X_1|X_2|X_3|X_4)$ and $Y=(Y_1|Y_2|Y_3|Y_4)$, the length of the sumcheck would increase 4 times, but the degree d would decrease proportionately.

So let's say we have an original circuit of length n, where all non-permutation relations are satisfied (including on $X_i$ and $Y_i$ polynomials). However, for the grand product argument we extend the polynomials to length $k\cdot n$ , where $k$ is a power of 2. Then we use the property of Zeromorph that it uses univariate commitments for commiting to multilinear polynomials. Because of this property, the final univariate opening of $X$ at challenge $x$ is equivalent to opening $X_1+x^n\cdot X_2+x^{2n}\cdot X_3+x^{3n}\cdot X_4$. So what we do in Zeromorph is substitute the opening of a concatenated polynomial by opening of a polynomial derived from a combination of $X_i$ polynomials multiplied by powers of $x$. This allows us to have fewer commitments and avoid shifts to prove the composition of concatenated polynomials

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

@codygunton codygunton changed the base branch from master to cg/eccvm-changes-for-full-goblin November 16, 2023 20:23
@codygunton codygunton force-pushed the cg/zeromorph-changes-for-full-goblin branch from e4f8be9 to 4b4361e Compare November 16, 2023 20:44
@codygunton codygunton self-assigned this Nov 16, 2023
@AztecBot
Copy link
Collaborator

Benchmark results

No metrics with a significant change found.

Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

Values are compared against data from master at commit 15a522ba and shown if the difference exceeds 1%.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 128 txs
l1_rollup_calldata_size_in_bytes 45,444 179,588 716,132
l1_rollup_calldata_gas 222,960 868,220 3,449,276
l1_rollup_execution_gas 842,047 3,595,328 22,204,645
l2_block_processing_time_in_ms 2,032 (+2%) 7,567 29,904 (-1%)
note_successful_decrypting_time_in_ms 294 (+1%) 869 3,171 (-3%)
note_trial_decrypting_time_in_ms 96.0 (+3%) 76.3 (+1%) 135
l2_block_building_time_in_ms 20,600 (-1%) 81,780 326,454
l2_block_rollup_simulation_time_in_ms 11,961 (-1%) 47,437 188,401
l2_block_public_tx_process_time_in_ms 8,593 (+1%) 34,210 137,571

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 21,871 (-1%) 42,453 (-1%)
note_history_successful_decrypting_time_in_ms 2,023 (-2%) 3,963 (-3%)
note_history_trial_decrypting_time_in_ms 121 145 (+1%)
node_database_size_in_bytes 1,630,865 1,101,119
pxe_database_size_in_bytes 29,748 59,307

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 763 (-1%) 61,697 18,905
private-kernel-ordering 125 (-1%) 24,297 8,153
base-rollup 1,765 (-1%) 656,428 873
root-rollup 173 (+2%) 4,072 1,097
private-kernel-inner 788 (-1%) 81,568 18,905
public-kernel-private-input 568 41,519 18,905
public-kernel-non-first-iteration 406 41,561 18,905
merge-rollup 15.2 2,592 873

Miscellaneous

Transaction sizes based on how many contracts are deployed in the tx.

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 8,787 27,547

@ledwards2225 ledwards2225 changed the base branch from cg/eccvm-changes-for-full-goblin to ad/build-system-build-cci-bump-add-timestamps November 17, 2023 17:21
@ledwards2225 ledwards2225 changed the base branch from ad/build-system-build-cci-bump-add-timestamps to master November 17, 2023 17:22
@ledwards2225 ledwards2225 changed the base branch from master to cg/eccvm-changes-for-full-goblin November 17, 2023 17:24
@codygunton
Copy link
Contributor Author

Handed off to @ledwards2225, became #3343

@codygunton codygunton closed this Nov 17, 2023
@codygunton codygunton deleted the cg/zeromorph-changes-for-full-goblin branch June 2, 2024 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants