AztecProtocol / aztec-packages

Apache License 2.0
181 stars 184 forks source link

feat(docs): Aztecnr notes docs #7168

Closed catmcgee closed 1 month ago

catmcgee commented 3 months ago

Closes https://github.com/AztecProtocol/dev-rel/issues/196

AztecBot commented 3 months ago

Docs Preview

Hey there! 👋 You can check your preview at https://66b2347c175f042f667b1c34--aztec-docs-dev.netlify.app

AztecBot commented 3 months ago

Benchmark results

Metrics with a significant change:

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](https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/benchmarks-v1/pulls/7168.json). ### Proof generation Each column represents the number of threads used in proof generation. | Metric | 1 threads | 4 threads | 16 threads | 32 threads | 64 threads | | - | - | - | - | - | - | proof_construction_time_sha256_ms | :warning: 7,289 (**+27%**) | 1,542 | 705 | 760 (+2%) | 765 (-1%) | proof_construction_time_sha256_30_ms | 12,351 (+5%) | 3,196 (+2%) | :warning: 1,753 (**+25%**) | 1,625 (+13%) | 1,550 (+6%) | proof_construction_time_sha256_100_ms | 48,840 (+11%) | 12,430 | :warning: 7,426 (**+31%**) | 6,141 (+10%) | 5,967 (+8%) | proof_construction_time_poseidon_hash_ms | 78.0 | 35.0 (+3%) | 37.0 (+9%) | 59.0 | 90.0 (+5%) | proof_construction_time_poseidon_hash_30_ms | 1,518 | 415 | 200 (-1%) | 225 | 272 (-1%) | proof_construction_time_poseidon_hash_100_ms | 5,793 (+3%) | 1,516 | 676 | 726 (-2%) | 749 | ### L2 block published to L1 Each column represents the number of txs on an L2 block published to L1. | Metric | 4 txs | 8 txs | 16 txs | | - | - | - | - | l1_rollup_calldata_size_in_bytes | 740 | 740 | 740 | l1_rollup_calldata_gas | 6,716 | 6,716 | 6,716 | l1_rollup_execution_gas | 611,983 | 612,134 | 612,285 | l2_block_processing_time_in_ms | 256 (+3%) | 453 (+5%) | 787 (-1%) | l2_block_building_time_in_ms | 9,461 | 18,583 (+1%) | 36,730 | l2_block_rollup_simulation_time_in_ms | 9,461 | 18,583 (+1%) | 36,729 | l2_block_public_tx_process_time_in_ms | 7,875 | 16,787 (+1%) | 34,879 | ### L2 chain processing Each column represents the number of blocks on the L2 chain where each block has 8 txs. | Metric | 3 blocks | 5 blocks | | - | - | - | node_history_sync_time_in_ms | 2,765 (+4%) | 3,683 (+3%) | node_database_size_in_bytes | 12,714,064 | 16,908,368 | pxe_database_size_in_bytes | 16,254 | 26,813 | ### Circuits stats Stats on running time and I/O sizes collected for every kernel circuit run across all benchmarks. | Circuit | simulation_time_in_ms | witness_generation_time_in_ms | input_size_in_bytes | output_size_in_bytes | proving_time_in_ms | proof_size_in_bytes | num_public_inputs | size_in_gates | | - | - | - | - | - | - | - | - | - | private-kernel-init | 102 (+7%) | 385 | 21,846 | 44,858 | N/A | N/A | N/A | N/A | private-kernel-inner | 175 (+5%) | 676 (+1%) | 72,545 | 45,005 | N/A | N/A | N/A | N/A | private-kernel-tail | 688 (+1%) | 779 (-1%) | 53,216 | 50,574 | N/A | N/A | N/A | N/A | base-parity | 5.84 | 572 (-2%) | 160 | 96.0 | 1,760 (-4%) | 13,188 | 19.0 | 65,536 | root-parity | 110 (+1%) | 127 (+8%) | 69,084 | 96.0 | 30,138 (-6%) | 13,188 | 19.0 | 4,194,304 | base-rollup | 2,987 (+1%) | 5,114 | 182,736 | 664 | 97,768 (-1%) | 14,020 | 45.0 | 16,777,216 | root-rollup | 97.1 | 109 (-3%) | 54,525 | 716 | 28,324 (-3%) | 13,988 | 44.0 | 4,194,304 | public-kernel-setup | 90.5 (-4%) | 2,764 | 103,513 | 70,710 | 17,950 (+3%) | 128,708 | 3,629 | 2,097,152 | public-kernel-app-logic | 106 (+1%) | 4,036 (-2%) | 103,513 | 70,710 | 10,279 (+1%) | 128,708 | 3,629 | 1,048,576 | public-kernel-tail | 574 | 28,855 (-6%) | 403,238 | 11,326 | 104,630 (+1%) | 27,204 | 457 | 16,777,216 | private-kernel-reset-tiny | 199 (+2%) | 807 (-1%) | 68,621 | 44,750 | N/A | N/A | N/A | N/A | private-kernel-tail-to-public | :warning: 2,598 (**-48%**) | 1,504 (-7%) | 942,862 | 1,697 | N/A | N/A | N/A | N/A | public-kernel-teardown | 86.9 (-1%) | 4,035 | 103,513 | 70,710 | 19,313 (+2%) | 128,708 | 3,629 | 2,097,152 | merge-rollup | 60.7 (+1%) | N/A | 35,742 | 664 | N/A | N/A | N/A | N/A | undefined | N/A | N/A | N/A | N/A | 156,515 (+3%) | N/A | N/A | N/A | Stats on running time collected for app circuits | Function | input_size_in_bytes | output_size_in_bytes | witness_generation_time_in_ms | proof_size_in_bytes | proving_time_in_ms | | - | - | - | - | - | - | ContractClassRegisterer:register | 1,344 | 11,731 | 336 | N/A | N/A | ContractInstanceDeployer:deploy | 1,408 | 11,731 | 17.8 (-1%) | N/A | N/A | MultiCallEntrypoint:entrypoint | 1,920 | 11,731 | 467 (-2%) | N/A | N/A | GasToken:deploy | 1,376 | 11,731 | 370 (-2%) | N/A | N/A | SchnorrAccount:constructor | 1,312 | 11,731 | 173 (-1%) | N/A | N/A | SchnorrAccount:entrypoint | 2,304 | 11,731 | 561 (-1%) | N/A | N/A | Token:privately_mint_private_note | 1,280 | 11,731 | 214 (-8%) | N/A | N/A | FPC:fee_entrypoint_public | 1,344 | 11,731 | 27.5 (-13%) | N/A | N/A | Token:transfer | 1,312 | 11,731 | 795 (-1%) | N/A | N/A | AuthRegistry:set_authorized (avm) | 18,491 | N/A | N/A | 147,456 | 2,509 (-2%) | FPC:prepare_fee (avm) | 22,958 | N/A | N/A | 147,520 | 3,185 (-1%) | Token:transfer_public (avm) | 61,614 | N/A | N/A | 147,520 | 17,239 | AuthRegistry:consume (avm) | 41,719 | N/A | N/A | 147,488 | 7,448 (-1%) | FPC:pay_refund (avm) | 26,227 | N/A | N/A | 147,488 | 7,239 (-1%) | Benchmarking:create_note | 1,344 | 11,731 | 167 (-2%) | N/A | N/A | SchnorrAccount:verify_private_authwit | 1,280 | 11,731 | 27.7 | N/A | N/A | Token:unshield | 1,376 | 11,731 | 753 (-1%) | N/A | N/A | FPC:fee_entrypoint_private | 1,376 | 11,731 | 988 (-8%) | N/A | N/A | ### AVM Simulation Time to simulate various public functions in the AVM. | Function | time_ms | bytecode_size_in_bytes | | - | - | - | GasToken:_increase_public_balance | 90.5 (-1%) | 8,139 | GasToken:set_portal | 12.3 (+16%) | 2,362 | Token:constructor | 119 (+2%) | 31,107 | FPC:constructor | 91.1 (-1%) | 24,011 | GasToken:mint_public | 76.2 (+1%) | 6,150 | Token:mint_public | 79.5 (-2%) | 11,720 | Token:assert_minter_and_mint | 83.3 (-10%) | 8,028 | AuthRegistry:set_authorized | 8.44 (-20%) | 4,537 | FPC:prepare_fee | 290 (-1%) | 8,812 | Token:transfer_public | 35.5 (-15%) | 47,374 | FPC:pay_refund | 64.6 (+2%) | 12,114 | Benchmarking:increment_balance | 992 | 7,450 | Token:_increase_public_balance | 9.41 (-2%) | 8,960 | FPC:pay_refund_with_shielded_rebate | 138 (-1%) | 12,663 | ### Public DB Access Time to access various public DBs. | Function | time_ms | | - | - | get-nullifier-index | 0.150 | ### 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 | 256 leaves | 512 leaves | 1024 leaves | | - | - | - | - | - | - | - | - | batch_insert_into_append_only_tree_16_depth_ms | 2.11 (-1%) | 3.80 (-2%) | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_16_depth_hash_count | 16.8 | 31.7 | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_16_depth_hash_ms | 0.110 (-1%) | 0.108 (-2%) | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_32_depth_ms | N/A | N/A | 10.8 | 17.6 (+1%) | 30.6 (+3%) | 59.7 (+3%) | 111 (-1%) | batch_insert_into_append_only_tree_32_depth_hash_count | N/A | N/A | 95.9 | 159 | 287 | 543 | 1,055 | batch_insert_into_append_only_tree_32_depth_hash_ms | N/A | N/A | 0.104 | 0.102 (+1%) | 0.0999 (+2%) | 0.103 (+3%) | 0.101 (-1%) | batch_insert_into_indexed_tree_20_depth_ms | N/A | N/A | 13.9 (-2%) | 25.4 (+1%) | 43.2 (+2%) | 83.0 (+3%) | 160 (-2%) | batch_insert_into_indexed_tree_20_depth_hash_count | N/A | N/A | 109 | 207 | 355 | 691 | 1,363 | batch_insert_into_indexed_tree_20_depth_hash_ms | N/A | N/A | 0.105 (-2%) | 0.103 (+1%) | 0.105 (+1%) | 0.103 (+3%) | 0.102 | batch_insert_into_indexed_tree_40_depth_ms | N/A | N/A | 16.3 (+1%) | N/A | N/A | N/A | N/A | batch_insert_into_indexed_tree_40_depth_hash_count | N/A | N/A | 133 | N/A | N/A | N/A | N/A | batch_insert_into_indexed_tree_40_depth_hash_ms | N/A | N/A | 0.105 (+1%) | N/A | N/A | N/A | N/A | ### 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 | 63,596 | 665,010 | Transaction size based on fee payment method | Metric | | | - | |