Skip to content

feat: Goblinize the final ecc ops in ZM#3741

Merged
codygunton merged 6 commits into
masterfrom
lde/gob_ops_in_zm
Jan 3, 2024
Merged

feat: Goblinize the final ecc ops in ZM#3741
codygunton merged 6 commits into
masterfrom
lde/gob_ops_in_zm

Conversation

@ledwards2225

@ledwards2225 ledwards2225 commented Dec 19, 2023

Copy link
Copy Markdown
Contributor

In the initial implementation of ZM I forgot to goblinize a couple of the final group operations in Zeromorph which was causing the gate count of the recursive verifier to blow up. We fix this. We implement the addition, subtraction, and single scalar multiplication operation inefficiently using the batch_mul methods. We disable some member functions that do not use Goblin when they could, and leave references to AztecProtocol/barretenberg#707 as a future optimization task.

@ledwards2225 ledwards2225 self-assigned this Dec 19, 2023
@AztecBot

AztecBot commented Dec 19, 2023

Copy link
Copy Markdown
Collaborator

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (public-kernel-private-input): 202 (+17%)
  • circuit_simulation_time_in_ms (public-kernel-non-first-iteration): 200 (+17%)
  • circuit_input_size_in_bytes (private-kernel-ordering): 30,953 (+20%)
  • circuit_input_size_in_bytes (public-kernel-private-input): 31,891 (+27%)
  • circuit_input_size_in_bytes (public-kernel-non-first-iteration): 31,933 (+26%)
  • circuit_output_size_in_bytes (private-kernel-init): 25,561 (+25%)
  • circuit_output_size_in_bytes (private-kernel-ordering): 14,809 (+53%)
  • circuit_output_size_in_bytes (private-kernel-inner): 25,561 (+25%)
  • circuit_output_size_in_bytes (public-kernel-private-input): 25,561 (+25%)
  • circuit_output_size_in_bytes (public-kernel-non-first-iteration): 25,561 (+25%)
  • tx_size_in_bytes (0): 15,487 (+50%)
  • tx_size_in_bytes (1): 31,879 (+21%)
  • note_history_successful_decrypting_time_in_ms (5): 2,975 (+19%)
  • l2_block_public_tx_process_time_in_ms (8): 4,279 (+21%)
  • l2_block_public_tx_process_time_in_ms (32): 16,981 (+21%)
  • l2_block_public_tx_process_time_in_ms (128): 67,865 (+21%)
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 ec2e36e6 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,972 868,028 3,448,484
l1_rollup_execution_gas 867,081 3,746,081 23,305,249
l2_block_processing_time_in_ms 1,322 5,084 21,122
note_successful_decrypting_time_in_ms 363 (+8%) 1,137 (-2%) 4,186 (+10%)
note_trial_decrypting_time_in_ms 72.5 (+58%) 55.3 (+52%) 132 (-10%)
l2_block_building_time_in_ms 14,887 (+6%) 59,281 (+6%) 237,725 (+6%)
l2_block_rollup_simulation_time_in_ms 10,576 (+1%) 42,224 (+1%) 169,597 (+1%)
l2_block_public_tx_process_time_in_ms ⚠️ 4,279 (+21%) ⚠️ 16,981 (+21%) ⚠️ 67,865 (+21%)

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 15,175 29,189
note_history_successful_decrypting_time_in_ms ⚠️ 2,975 (+19%) 5,576 (+13%)
note_history_trial_decrypting_time_in_ms 108 (+36%) 154 (-31%)
node_database_size_in_bytes 3,617,899 3,726,454
pxe_database_size_in_bytes 29,923 59,478

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 210 (+5%) 44,709 (+4%) ⚠️ 25,561 (+25%)
private-kernel-ordering 137 (+19%) ⚠️ 30,953 (+20%) ⚠️ 14,809 (+53%)
base-rollup 1,073 (+1%) 128,374 (+4%) 881
root-rollup 82.4 4,088 889
private-kernel-inner 286 (+9%) 71,236 (+10%) ⚠️ 25,561 (+25%)
public-kernel-private-input ⚠️ 202 (+17%) ⚠️ 31,891 (+27%) ⚠️ 25,561 (+25%)
public-kernel-non-first-iteration ⚠️ 200 (+17%) ⚠️ 31,933 (+26%) ⚠️ 25,561 (+25%)
merge-rollup 9.66 2,608 881

Miscellaneous

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

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes ⚠️ 15,487 (+50%) ⚠️ 31,879 (+21%)

@codygunton codygunton self-requested a review January 3, 2024 20:39

@codygunton codygunton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. Will ask Luke to look over my additions.

@codygunton

Copy link
Copy Markdown
Contributor

Luke pointed out in a side convo that I did not test the new special-case operators. Added those tests.

@codygunton codygunton enabled auto-merge (squash) January 3, 2024 21:27
@codygunton codygunton merged commit 3048d08 into master Jan 3, 2024
@codygunton codygunton deleted the lde/gob_ops_in_zm branch January 3, 2024 21:52
@codygunton codygunton self-assigned this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants