AztecProtocol / aztec-packages

Apache License 2.0
155 stars 157 forks source link

feat: remove note hash nullifier counter. #7294

Closed LeilaWang closed 1 day ago

LeilaWang commented 2 days ago

7250

github-actions[bot] commented 2 days ago

Changes to circuit sizes

Generated at commit: 406a80150ba65985663c169531fcd5b95b317c6e, compared to commit: b7c6593ccd5b2d6247d65a37d57b4c2d790981bb

๐Ÿงพ Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_init -656 โœ… -2.60% -1,024 โœ… -0.27%
private_kernel_tail_to_public -80 โœ… -0.02% -10,288 โœ… -0.61%
private_kernel_tail -64 โœ… -0.30% -10,140 โœ… -0.82%
private_kernel_reset -2,934 โœ… -2.17% -13,968 โœ… -0.82%
private_kernel_reset_big -2,934 โœ… -2.50% -13,968 โœ… -0.90%
private_kernel_inner -1,369 โœ… -3.10% -12,105 โœ… -1.04%
private_kernel_reset_medium -2,486 โœ… -2.90% -13,504 โœ… -1.20%
private_kernel_reset_small -2,262 โœ… -3.23% -13,272 โœ… -1.45%
private_kernel_init_simulated 0 โž– 0.00% -64 โœ… -2.87%
private_kernel_inner_simulated 0 โž– 0.00% -64 โœ… -2.87%
private_kernel_reset_simulated 0 โž– 0.00% -64 โœ… -2.87%
private_kernel_reset_simulated_big 0 โž– 0.00% -64 โœ… -2.87%
private_kernel_reset_simulated_medium 0 โž– 0.00% -64 โœ… -2.87%
private_kernel_reset_simulated_small 0 โž– 0.00% -64 โœ… -2.87%

Full diff report ๐Ÿ‘‡
| Program | ACIR opcodes (+/-) | % | Circuit size (+/-) | % | |:-|-:|-:|-:|-:| | **private_kernel_init** | 24,591 (-656) | **-2.60%** | 372,912 (-1,024) | **-0.27%** | | **private_kernel_tail_to_public** | 444,398 (-80) | **-0.02%** | 1,666,714 (-10,288) | **-0.61%** | | **private_kernel_tail** | 21,180 (-64) | **-0.30%** | 1,233,386 (-10,140) | **-0.82%** | | **private_kernel_reset** | 132,175 (-2,934) | **-2.17%** | 1,683,027 (-13,968) | **-0.82%** | | **private_kernel_reset_big** | 114,511 (-2,934) | **-2.50%** | 1,532,971 (-13,968) | **-0.90%** | | **private_kernel_inner** | 42,765 (-1,369) | **-3.10%** | 1,147,721 (-12,105) | **-1.04%** | | **private_kernel_reset_medium** | 83,367 (-2,486) | **-2.90%** | 1,112,567 (-13,504) | **-1.20%** | | **private_kernel_reset_small** | 67,794 (-2,262) | **-3.23%** | 902,364 (-13,272) | **-1.45%** | | **private_kernel_init_simulated** | 1 (0) | **0.00%** | 2,168 (-64) | **-2.87%** | | **private_kernel_inner_simulated** | 1 (0) | **0.00%** | 2,168 (-64) | **-2.87%** | | **private_kernel_reset_simulated** | 1 (0) | **0.00%** | 2,168 (-64) | **-2.87%** | | **private_kernel_reset_simulated_big** | 1 (0) | **0.00%** | 2,168 (-64) | **-2.87%** | | **private_kernel_reset_simulated_medium** | 1 (0) | **0.00%** | 2,168 (-64) | **-2.87%** | | **private_kernel_reset_simulated_small** | 1 (0) | **0.00%** | 2,168 (-64) | **-2.87%** |
AztecBot commented 2 days 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/7294.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 | 5,760 | 1,561 | 708 | 763 | 775 (-1%) | proof_construction_time_sha256_30_ms | 11,860 | 3,170 | 1,408 | 1,439 | 1,466 | proof_construction_time_sha256_100_ms | 44,100 | 11,808 | 5,421 | 5,403 | 5,351 | proof_construction_time_poseidon_hash_ms | 78.0 | 34.0 | 34.0 (-3%) | 58.0 (-2%) | 87.0 (-1%) | proof_construction_time_poseidon_hash_30_ms | 1,528 | 419 | 202 (+1%) | 226 (-1%) | 267 | proof_construction_time_poseidon_hash_100_ms | 5,787 | 1,571 | 729 (+1%) | 783 (-4%) | 801 (+2%) | ### 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 | 1,412 | 1,412 | 1,412 | l1_rollup_calldata_gas | 9,476 | 9,472 | 9,476 | l1_rollup_execution_gas | 611,215 | 611,362 | 611,517 | l2_block_processing_time_in_ms | 761 (-2%) | 1,412 | 2,697 (-1%) | l2_block_building_time_in_ms | 20,819 | 41,469 (-2%) | 81,656 (-1%) | l2_block_rollup_simulation_time_in_ms | 20,818 | 41,468 (-2%) | 81,656 (-1%) | l2_block_public_tx_process_time_in_ms | 17,806 | 38,257 (-2%) | 78,493 (-1%) | ### 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 | 7,003 (-1%) | 9,807 (-1%) | node_database_size_in_bytes | 12,476,496 | 16,203,856 | 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 | proving_time_in_ms | input_size_in_bytes | output_size_in_bytes | proof_size_in_bytes | num_public_inputs | size_in_gates | | - | - | - | - | - | - | - | - | - | private-kernel-init | 100 (-3%) | 373 (-5%) | 13,565 (+5%) | 19,418 | 53,878 | 71,872 (-3%) | 2,179 (-3%) | 524,288 | private-kernel-inner | 304 (-2%) | 841 (+4%) | 50,606 (+2%) | 80,374 | 53,878 | 71,872 (-3%) | 2,179 (-3%) | 2,097,152 | private-kernel-tail | 1,039 (-6%) | 2,502 (-5%) | 50,431 (+1%) | 61,201 | 62,057 | 14,912 | 399 | 2,097,152 | base-parity | 6.23 | 1,547 (-3%) | 2,747 | 128 | 64.0 | 2,208 | 2.00 | 131,072 | root-parity | 49.5 (+1%) | 72.8 (+4%) | 43,246 (+1%) | 27,100 | 64.0 | 2,720 | 18.0 | 2,097,152 | base-rollup | 6,527 (-2%) | 4,931 (-1%) | 92,267 | 170,330 | 728 | 3,648 | 47.0 | 4,194,304 | root-rollup | 112 (+2%) | 84.6 (+3%) | 24,943 (+4%) | 25,253 | 620 | 3,456 | 41.0 | 1,048,576 | public-kernel-setup | 543 | 2,419 (-2%) | 43,559 (+2%) | 102,121 | 80,278 | 106,912 | 3,274 | 2,097,152 | public-kernel-app-logic | 499 (-2%) | 3,383 (-1%) | 44,593 (-7%) | 102,121 | 80,278 | 106,912 | 3,274 | 2,097,152 | public-kernel-tail | 1,142 (-1%) | 27,037 | 175,996 (-5%) | 399,014 | 10,014 | 14,912 | 399 | 8,388,608 | private-kernel-reset-small | :warning: 316 (**-33%**) | 1,244 (+15%) | 31,503 (+1%) | 93,105 (-15%) | 53,878 | 71,872 (-3%) | 2,179 (-3%) | 1,048,576 | public-kernel-teardown | 493 | 3,404 (-2%) | 44,880 (-2%) | 102,121 | 80,278 | 106,912 | 3,274 | 2,097,152 | merge-rollup | 29.8 | N/A | N/A | 16,486 | 728 | N/A | N/A | N/A | private-kernel-tail-to-public | N/A | 8,408 (-1%) | 54,315 (+2%) | N/A | N/A | 106,912 | 3,274 | 2,097,152 | 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 | size_in_gates | num_public_inputs | | - | - | - | - | - | - | - | - | ContractClassRegisterer:register | 1,344 | 8,792 | 394 | N/A | N/A | N/A | N/A | ContractInstanceDeployer:deploy | 1,408 | 8,792 | 24.1 (-1%) | N/A | N/A | N/A | N/A | MultiCallEntrypoint:entrypoint | 1,920 | 8,792 | 1,156 | N/A | N/A | N/A | N/A | GasToken:deploy | 1,376 | 8,792 | 830 (+1%) | N/A | N/A | N/A | N/A | SchnorrAccount:constructor | 1,312 | 8,792 | 478 | N/A | N/A | N/A | N/A | SchnorrAccount:entrypoint | 2,304 | 8,792 | 1,601 (-1%) | 14,720 | 55,199 (+4%) | 2,097,152 | 393 | Token:privately_mint_private_note | 1,280 | 8,792 | 608 | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_public | 1,344 | 8,792 | 236 (+2%) | 14,720 | 11,308 | 524,288 | 393 | Token:transfer | 1,312 | 8,792 | 1,782 | 14,720 | 13,396 (+1%) | 524,288 | 393 | AuthRegistry:set_authorized (avm) | 19,226 | N/A | N/A | 91,264 | 1,389 (+6%) | N/A | N/A | FPC:prepare_fee (avm) | 26,668 | N/A | N/A | 91,328 | 2,941 (+2%) | N/A | N/A | Token:transfer_public (avm) | 42,918 | N/A | N/A | 91,328 | 4,047 (+1%) | N/A | N/A | AuthRegistry:consume (avm) | 33,104 | N/A | N/A | 91,264 | 3,112 (+9%) | N/A | N/A | FPC:pay_refund (avm) | 36,833 | N/A | N/A | 91,296 | 24,330 (+2%) | N/A | N/A | Benchmarking:create_note | 1,344 | 8,792 | 466 | N/A | N/A | N/A | N/A | SchnorrAccount:verify_private_authwit | 1,280 | 8,792 | 40.6 | N/A | N/A | N/A | N/A | Token:unshield | 1,376 | 8,792 | 1,452 | N/A | N/A | N/A | N/A | FPC:fee_entrypoint_private | 1,376 | 8,792 | 1,988 | N/A | N/A | 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 | 67.2 (-1%) | 13,790 | GasToken:set_portal | 16.1 (-3%) | 3,339 | Token:constructor | 92.2 | 23,692 | FPC:constructor | 64.2 (+4%) | 13,592 | GasToken:mint_public | 51.0 (+1%) | 10,158 | Token:mint_public | 507 | 19,034 | Token:assert_minter_and_mint | 58.7 (+5%) | 12,925 | AuthRegistry:set_authorized | 30.5 (-7%) | 7,812 | FPC:prepare_fee | 119 (+11%) | 15,062 | Token:transfer_public | 46.9 (+9%) | 31,218 | FPC:pay_refund | 142 (+13%) | 25,260 | Benchmarking:increment_balance | 2,190 (-1%) | 15,267 | Token:_increase_public_balance | 54.6 (+2%) | 15,006 | FPC:pay_refund_with_shielded_rebate | 112 (-3%) | 26,347 | ### Public DB Access Time to access various public DBs. | Function | time_ms | | - | - | get-nullifier-index | 0.163 (+1%) | ### 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 | 10.4 | 16.8 | 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.603 | 0.517 | N/A | N/A | N/A | N/A | N/A | batch_insert_into_append_only_tree_32_depth_ms | N/A | N/A | 48.3 | 75.6 (-2%) | 131 (-2%) | 244 (-1%) | 470 (-3%) | 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.494 | 0.464 (-2%) | 0.450 (-1%) | 0.442 (-1%) | 0.438 (-2%) | batch_insert_into_indexed_tree_20_depth_ms | N/A | N/A | 59.5 | 111 (-3%) | 182 (-2%) | 351 (-1%) | 693 (-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.502 | 0.499 (-3%) | 0.482 (-1%) | 0.476 | 0.475 (-2%) | batch_insert_into_indexed_tree_40_depth_ms | N/A | N/A | 72.7 (-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.517 (-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 | 74,057 | 667,841 | Transaction size based on fee payment method | Metric | | | - | |