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: add shared mutable access from external contract #5689 #5758

Conversation

sklppy88
Copy link
Contributor

Resolves #5689

fix
@sklppy88 sklppy88 requested a review from benesjan April 15, 2024 14:21
@sklppy88 sklppy88 marked this pull request as ready for review April 15, 2024 14:21
@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • batch_insert_into_append_only_tree_32_depth_ms (2048): 971 (-48%)
  • batch_insert_into_append_only_tree_32_depth_ms (4096): 1,926 (-28%)
  • batch_insert_into_append_only_tree_32_depth_hash_ms (2048): 0.463 (-48%)
  • batch_insert_into_indexed_tree_20_depth_ms (2048): 1,451 (-40%)
  • batch_insert_into_indexed_tree_20_depth_ms (4096): 2,885 (-26%)
  • batch_insert_into_indexed_tree_20_depth_hash_ms (2048): 0.505 (-39%)
  • l2_block_public_tx_process_time_in_ms (32): 20,802 (-20%)
  • l2_block_processing_time_in_ms (32): 5,298 (-28%)
  • l2_block_processing_time_in_ms (64): 10,037 (-16%)
  • note_trial_decrypting_time_in_ms (32): 47.1 (+216%)
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.

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 772 772 772
l1_rollup_calldata_gas 6,808 6,808 6,796
l1_rollup_execution_gas 587,289 587,289 587,277
l2_block_processing_time_in_ms 1,401 (-3%) ⚠️ 5,298 (-28%) ⚠️ 10,037 (-16%)
note_successful_decrypting_time_in_ms 244 (+2%) 538 (+6%) 962 (+8%)
note_trial_decrypting_time_in_ms 48.1 (+15%) ⚠️ 47.1 (+216%) 77.6 (-28%)
l2_block_building_time_in_ms 9,702 (+1%) 37,875 (-12%) 75,624 (-1%)
l2_block_rollup_simulation_time_in_ms 9,514 (+1%) 37,183 (-13%) 74,277 (-1%)
l2_block_public_tx_process_time_in_ms 5,313 (+1%) ⚠️ 20,802 (-20%) 41,682 (+1%)

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,657 (+3%) 30,096 (+4%)
note_history_successful_decrypting_time_in_ms 1,170 (-5%) 2,279 (-4%)
note_history_trial_decrypting_time_in_ms 41.8 (-31%) 80.9 (-21%)
node_database_size_in_bytes 18,735,184 35,221,584
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 149 (-2%) 44,561 26,424
private-kernel-inner 155 (-1%) 72,188 26,424
private-kernel-ordering 109 51,090 39,297
base-parity 51.9 128 311
root-parity 9.85 1,244 311
base-rollup 12,391 (-2%) 110,820 957
root-rollup 48.4 4,551 821
public-kernel-app-logic 81.1 (-3%) 48,151 40,933
public-kernel-tail 121 (-2%) 53,644 7,385
merge-rollup 11.9 (+16%) 2,760 957
public-kernel-teardown 78.2 (-1%) 48,151 40,933
public-kernel-setup 77.2 48,151 40,933

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 10.9 (-7%) 17.6 (-7%) 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.638 (-7%) 0.543 (-7%) 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 51.4 (-3%) 79.9 (-12%) 259 502 (-1%) ⚠️ 971 (-48%) ⚠️ 1,926 (-28%) 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.528 (-2%) 0.494 (-11%) 0.472 0.469 ⚠️ 0.463 (-48%) 0.461 (-28%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 60.2 (-2%) 118 (-9%) 374 (-1%) 740 (-1%) ⚠️ 1,451 (-40%) ⚠️ 2,885 (-26%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 105 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.534 (-2%) 0.535 (-8%) 0.509 0.510 ⚠️ 0.505 (-39%) 0.505 (-25%) 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 67.2 (-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.588 (-3%)

Miscellaneous

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

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 41,005 528,889

Transaction size based on fee payment method

Metric native fee payment method fpc_public fee payment method fpc_private fee payment method
tx_with_fee_size_in_bytes 905 1,161 1,377

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 1,148 783 (-1%) 3,409 (+1%)
Metric 1 public data writes 2 public data writes 3 public data writes 4 public data writes 5 public data writes 8 public data writes
tx_sequencer_processing_time_ms 453 (-3%) 307 (+1%) 814 391 (-1%) 1,352 461

@sklppy88 sklppy88 merged commit cbda439 into ek/feat/implement-key-registry Apr 15, 2024
77 of 83 checks passed
@sklppy88 sklppy88 deleted the ek/feat/add-shared-mutable-access-from-external-contract branch April 15, 2024 16:32
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.

2 participants