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: Squashing public writes in kernel #5165

Closed
wants to merge 16 commits into from

Conversation

LeilaWang
Copy link
Contributor

Please read contributing guidelines and remove this line.

@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (public-kernel-tail): 91.8 (-47%)
  • circuit_input_size_in_bytes (public-kernel-tail): 34,206 (-16%)
  • l2_block_public_tx_process_time_in_ms (8): 5,077 (-16%)
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 426bd6d2 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 64 txs
l1_rollup_calldata_size_in_bytes 5,668 18,820 36,356
l1_rollup_calldata_gas 66,016 238,732 469,472
l1_rollup_execution_gas 666,648 953,593 1,336,780
l2_block_processing_time_in_ms 1,303 4,779 (-1%) 9,465 (+3%)
note_successful_decrypting_time_in_ms 142 (+10%) 565 (+1%) 1,035 (+3%)
note_trial_decrypting_time_in_ms 44.5 (+26%) 88.4 (+26%) 56.9 (-57%)
l2_block_building_time_in_ms 12,130 (-7%) 48,453 (-5%) 96,473 (-5%)
l2_block_rollup_simulation_time_in_ms 7,029 (+1%) 28,052 (+1%) 55,876
l2_block_public_tx_process_time_in_ms ⚠️ 5,077 (-16%) 20,340 (-11%) 40,492 (-12%)

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 14,124 (+1%) 26,981 (+7%)
note_history_successful_decrypting_time_in_ms 1,207 (+2%) 2,498 (+3%)
note_history_trial_decrypting_time_in_ms 71.6 (+15%) 140 (-7%)
node_database_size_in_bytes 19,054,672 35,979,344 (+1%)
pxe_database_size_in_bytes 29,859 59,414

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 271 44,370 27,700
private-kernel-ordering 206 (+1%) 52,324 14,326
base-rollup 637 (+2%) 177,083 925
root-rollup 68.3 (+1%) 4,176 789
private-kernel-inner 361 (+1%) 73,229 27,700
public-kernel-app-logic 182 (-1%) 34,646 (-2%) 27,671 (-2%)
public-kernel-tail ⚠️ 91.8 (-47%) ⚠️ 34,206 (-16%) 27,671 (-2%)
merge-rollup 8.32 2,696 925

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 9.98 15.9 (+1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.6 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.582 0.493 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 46.5 (+1%) 72.0 (+1%) 229 446 (+1%) 868 1,724 (+1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.477 (+1%) 0.445 0.418 0.417 (+1%) 0.413 0.412 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 54.1 (+2%) 107 (+1%) 338 (+2%) 661 (+1%) 1,314 (+1%) 2,627 (+1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 104 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.481 (+1%) 0.481 (+1%) 0.459 (+1%) 0.455 (+1%) 0.455 0.454 (+1%) N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 61.3
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 109
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.536

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes
tx_size_in_bytes 22,014

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,036 (-2%) 1,446 (+1%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 13.7 (+14%) 627 (-12%)

@iAmMichaelConnor
Copy link
Contributor

Is this dead?

@iAmMichaelConnor iAmMichaelConnor added the S-inactive Status: inactive. This issue/PR has been active for quite some time. It might get closed soon. label Oct 1, 2024
@LeilaWang
Copy link
Contributor Author

Done in #8296

@LeilaWang LeilaWang closed this Oct 1, 2024
@LeilaWang LeilaWang deleted the lw/squashing_public_writes branch October 1, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: inactive. This issue/PR has been active for quite some time. It might get closed soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants