Skip to content

docs(yellow-paper): private DA metering#5388

Merged
just-mitch merged 2 commits into03-19-feat_add_gas_costs_to_txeffectfrom
docs-da-metering-design
Mar 23, 2024
Merged

docs(yellow-paper): private DA metering#5388
just-mitch merged 2 commits into03-19-feat_add_gas_costs_to_txeffectfrom
docs-da-metering-design

Conversation

@just-mitch
Copy link
Collaborator

@just-mitch just-mitch commented Mar 22, 2024

Please see the changes to the docs for the proposed design.

Copy link
Collaborator Author

just-mitch commented Mar 22, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @just-mitch and the rest of your teammates on Graphite Graphite

@just-mitch just-mitch marked this pull request as ready for review March 22, 2024 11:42
@just-mitch just-mitch marked this pull request as draft March 22, 2024 11:43
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 22, 2024

Benchmark results

Metrics with a significant change:

  • batch_insert_into_append_only_tree_32_depth_ms (512): 231 (-25%)
  • note_trial_decrypting_time_in_ms (32): 102 (+97%)
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 41107e34 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 676 676 676
l1_rollup_calldata_gas 6,412 6,424 6,412
l1_rollup_execution_gas 585,745 585,757 585,745
l2_block_processing_time_in_ms 1,289 (-13%) 4,779 (+1%) 9,455 (+4%)
note_successful_decrypting_time_in_ms 157 (-18%) 484 (-10%) 960 (-4%)
note_trial_decrypting_time_in_ms 60.6 (-39%) ⚠️ 102 (+97%) 90.0 (-32%)
l2_block_building_time_in_ms 17,272 65,460 130,153
l2_block_rollup_simulation_time_in_ms 7,892 (-1%) 28,164 (-1%) 55,400 (-1%)
l2_block_public_tx_process_time_in_ms 9,361 37,243 74,654 (+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 13,733 (+1%) 26,436 (-3%)
note_history_successful_decrypting_time_in_ms 1,278 (+3%) 2,425 (+2%)
note_history_trial_decrypting_time_in_ms 97.8 (+19%) 140 (+18%)
node_database_size_in_bytes 18,645,072 35,102,800
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 248 (+3%) 44,344 28,181
private-kernel-ordering 214 52,847 14,263
base-parity 4,612 (+4%) 128 311
root-parity 1,607 1,244 311
base-rollup 17,935 (-1%) 165,727 861
root-rollup 50.0 4,359 725
private-kernel-inner 598 73,728 28,181
public-kernel-app-logic 401 35,185 28,151
public-kernel-tail 172 (-1%) 40,862 28,151
merge-rollup 7.54 (-10%) 2,568 861

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.99 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.584 0.493 (-1%) 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 45.6 72.1 ⚠️ 231 (-25%) 447 (+1%) 861 (-1%) 1,724 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.469 0.446 0.422 (-25%) 0.417 0.411 0.414 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.4 106 334 (-14%) 658 1,306 2,603 (-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.477 0.479 0.455 (-14%) 0.454 0.453 0.451 (-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 60.9
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.533

Miscellaneous

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

Metric 0 registered classes
tx_size_in_bytes 21,991

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,087 (-1%) 1,645
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 10.9 (+2%) 1,148 (-1%)

@just-mitch just-mitch force-pushed the docs-da-metering-design branch from 27ef123 to 4302fd3 Compare March 22, 2024 15:07
@just-mitch just-mitch changed the title start docs feat!: private DA metering Mar 22, 2024
@just-mitch just-mitch changed the title feat!: private DA metering docs(yellow-paper): private DA metering Mar 22, 2024
@just-mitch just-mitch marked this pull request as ready for review March 22, 2024 15:11
@just-mitch just-mitch force-pushed the docs-da-metering-design branch from 4302fd3 to c820cf8 Compare March 22, 2024 15:15
@just-mitch just-mitch force-pushed the docs-da-metering-design branch from c820cf8 to c359c8a Compare March 22, 2024 22:27
@just-mitch just-mitch changed the base branch from master to 03-19-feat_add_gas_costs_to_txeffect March 22, 2024 22:27
@github-actions
Copy link
Contributor

Changes to circuit sizes

Generated at commit: 9a63ad784ef7b73faae1815ce0a9275c23e20c8e, compared to commit: 606fdd5617314b62749039ffa7d73843ba352880

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
parity_base -728 ✅ -60.26% 0 ➖ 0.00%
rollup_merge -160 ✅ -30.89% 0 ➖ 0.00%
rollup_root -160 ✅ -14.65% 0 ➖ 0.00%
parity_root -240 ✅ -33.33% 0 ➖ 0.00%
private_kernel_tail -3 ✅ -0.00% -3 ✅ -0.00%
public_kernel_tail -7 ✅ -0.01% -12 ✅ -0.00%
rollup_base -54 ✅ -0.03% -1,105 ✅ -0.06%
private_kernel_init -113 ✅ -0.23% -385 ✅ -0.11%
private_kernel_init_simulated -3 ✅ -0.33% -6 ✅ -0.33%
private_kernel_inner_simulated -3 ✅ -0.33% -6 ✅ -0.33%
private_kernel_inner -163 ✅ -0.17% -2,036 ✅ -0.39%
public_kernel_tail_simulated -5 ✅ -0.55% -10 ✅ -0.55%
public_kernel_app_logic_simulated -5 ✅ -0.55% -10 ✅ -0.55%
public_kernel_setup_simulated -5 ✅ -0.55% -10 ✅ -0.55%
public_kernel_teardown_simulated -5 ✅ -0.55% -10 ✅ -0.55%
public_kernel_setup -90 ✅ -0.31% -1,541 ✅ -0.84%
public_kernel_teardown -132 ✅ -0.45% -1,583 ✅ -0.86%
public_kernel_app_logic -166 ✅ -0.30% -2,747 ✅ -0.87%
private_kernel_tail_simulated -5 ✅ -1.10% -10 ✅ -1.09%
rollup_base_simulated 0 ➖ 0.00% -2 ✅ -5.71%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
parity_base 480 (-728) -60.26% 79,811 (0) 0.00%
rollup_merge 358 (-160) -30.89% 45,970 (0) 0.00%
rollup_root 932 (-160) -14.65% 77,898 (0) 0.00%
parity_root 480 (-240) -33.33% 79,811 (0) 0.00%
private_kernel_tail 373,474 (-3) -0.00% 839,580 (-3) -0.00%
public_kernel_tail 124,962 (-7) -0.01% 358,953 (-12) -0.00%
rollup_base 171,461 (-54) -0.03% 1,730,707 (-1,105) -0.06%
private_kernel_init 48,594 (-113) -0.23% 348,606 (-385) -0.11%
private_kernel_init_simulated 904 (-3) -0.33% 1,811 (-6) -0.33%
private_kernel_inner_simulated 904 (-3) -0.33% 1,811 (-6) -0.33%
private_kernel_inner 95,835 (-163) -0.17% 519,409 (-2,036) -0.39%
public_kernel_tail_simulated 903 (-5) -0.55% 1,809 (-10) -0.55%
public_kernel_app_logic_simulated 903 (-5) -0.55% 1,809 (-10) -0.55%
public_kernel_setup_simulated 903 (-5) -0.55% 1,809 (-10) -0.55%
public_kernel_teardown_simulated 903 (-5) -0.55% 1,809 (-10) -0.55%
public_kernel_setup 29,330 (-90) -0.31% 182,766 (-1,541) -0.84%
public_kernel_teardown 29,397 (-132) -0.45% 182,834 (-1,583) -0.86%
public_kernel_app_logic 56,052 (-166) -0.30% 314,134 (-2,747) -0.87%
private_kernel_tail_simulated 451 (-5) -1.10% 905 (-10) -1.09%
rollup_base_simulated 1 (0) 0.00% 33 (-2) -5.71%

@just-mitch just-mitch force-pushed the 03-19-feat_add_gas_costs_to_txeffect branch from 8b29014 to cdd0d2b Compare March 23, 2024 18:35
@just-mitch just-mitch merged commit 2cb8bcf into 03-19-feat_add_gas_costs_to_txeffect Mar 23, 2024
@just-mitch just-mitch deleted the docs-da-metering-design branch March 23, 2024 19:17
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