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

fix: Align reset variant sizes after constants changes #7340

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

sirasistant
Copy link
Contributor

No description provided.

Copy link
Contributor

@LeilaWang LeilaWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Copy link
Contributor

github-actions bot commented Jul 4, 2024

Changes to circuit sizes

Generated at commit: 5872555d9c99295a3a84c223692caf10d44d2119, compared to commit: 56fe4febc179aa6b329f2a2f3a2d8675d039909f

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_reset_small -5,579 ✅ -8.23% -86,305 ✅ -9.56%
private_kernel_reset_medium -11,157 ✅ -13.38% -172,689 ✅ -15.52%
private_kernel_reset_big -22,312 ✅ -19.48% -345,376 ✅ -22.53%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_reset_small 62,215 (-5,579) -8.23% 816,059 (-86,305) -9.56%
private_kernel_reset_medium 72,210 (-11,157) -13.38% 939,878 (-172,689) -15.52%
private_kernel_reset_big 92,199 (-22,312) -19.48% 1,187,595 (-345,376) -22.53%

@AztecBot
Copy link
Collaborator

AztecBot commented Jul 4, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_input_size_in_bytes (private-kernel-reset-small): 78,065 (-16%)
  • avm_simulation_time_ms (GasToken:set_portal): 24.6 (+81%)
  • avm_simulation_time_ms (Token:mint_public): 51.6 (-90%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 169 (+199%)
  • avm_simulation_time_ms (Token:transfer_public): 43.1 (+35%)
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.

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,753 (+1%) 1,555 707 758 783 (+1%)
proof_construction_time_sha256_30_ms 11,851 3,167 (+1%) 1,413 1,443 (+1%) 1,462 (-1%)
proof_construction_time_sha256_100_ms 44,093 (+1%) 11,846 (+1%) 5,419 (-1%) 5,390 (-1%) 5,369 (-1%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 35.0 (+3%) 57.0 (-2%) 87.0 (-1%)
proof_construction_time_poseidon_hash_30_ms 1,527 (+1%) 419 (+1%) 200 229 269
proof_construction_time_poseidon_hash_100_ms 5,781 (+1%) 1,580 (+1%) 720 788 (+2%) 804 (+1%)

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,474 9,440
l1_rollup_execution_gas 611,215 611,364 611,481
l2_block_processing_time_in_ms 751 (-1%) 1,424 2,715
l2_block_building_time_in_ms 20,819 41,555 81,592
l2_block_rollup_simulation_time_in_ms 20,819 41,554 81,591
l2_block_public_tx_process_time_in_ms 17,809 38,348 78,414

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,110 9,951
node_database_size_in_bytes 12,431,440 16,183,376
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 370 (-2%) 12,940 (-1%) 19,418 53,878 71,872 2,179 524,288
private-kernel-inner 303 (-1%) 754 (+1%) 48,212 (-1%) 80,374 53,878 71,872 2,179 2,097,152
private-kernel-tail 1,029 (-2%) 2,417 (-4%) 47,712 (-4%) 61,201 62,057 14,912 399 2,097,152
base-parity 6.24 1,488 (-6%) 2,641 (-4%) 128 64.0 2,208 2.00 131,072
root-parity 48.9 (-1%) 69.5 (+2%) 42,417 (+2%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 6,562 4,806 (-3%) 91,025 (-1%) 170,330 728 3,648 47.0 4,194,304
root-rollup 110 79.3 (-6%) 24,172 (+1%) 25,253 620 3,456 41.0 1,048,576
public-kernel-setup 534 (-2%) 2,393 (-4%) 42,374 (-3%) 102,121 80,278 106,912 3,274 2,097,152
public-kernel-app-logic 498 (-1%) 3,327 (-2%) 42,607 (-2%) 102,121 80,278 106,912 3,274 2,097,152
public-kernel-tail 1,144 25,740 (-4%) 181,156 (-4%) 399,014 10,014 14,912 399 8,388,608
private-kernel-reset-small 290 (-9%) 1,093 (-14%) 30,497 (+1%) ⚠️ 78,065 (-16%) 53,878 71,872 2,179 1,048,576
public-kernel-teardown 487 (-2%) 3,326 (-4%) 43,876 (-1%) 102,121 80,278 106,912 3,274 2,097,152
merge-rollup 29.6 N/A N/A 16,486 728 N/A N/A N/A
private-kernel-tail-to-public N/A 8,440 51,253 (-3%) 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 388 (-3%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 8,792 23.8 (-3%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 8,792 1,144 (-2%) N/A N/A N/A N/A
GasToken:deploy 1,376 8,792 802 (-3%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 8,792 470 (-2%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 8,792 1,626 (+1%) 14,720 53,712 (-2%) 2,097,152 393
Token:privately_mint_private_note 1,280 8,792 594 (-3%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 8,792 230 (-3%) 14,720 11,294 (+1%) 524,288 393
Token:transfer 1,312 8,792 1,741 (-2%) 14,720 12,964 (+2%) 524,288 393
AuthRegistry:set_authorized (avm) 19,226 N/A N/A 91,264 1,356 (+4%) N/A N/A
FPC:prepare_fee (avm) 26,668 N/A N/A 91,328 2,818 (-1%) N/A N/A
Token:transfer_public (avm) 42,918 N/A N/A 91,328 3,821 (-1%) N/A N/A
AuthRegistry:consume (avm) 33,104 N/A N/A 91,264 2,807 (-6%) N/A N/A
FPC:pay_refund (avm) 36,833 N/A N/A 91,296 23,049 (-4%) N/A N/A
Benchmarking:create_note 1,344 8,792 496 (+6%) N/A N/A N/A N/A
SchnorrAccount:verify_private_authwit 1,280 8,792 40.4 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 8,792 1,448 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 8,792 1,980 (-1%) 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 65.7 (-4%) 13,790
GasToken:set_portal ⚠️ 24.6 (+81%) 3,339
Token:constructor 89.5 (-3%) 23,692
FPC:constructor 60.8 (-5%) 13,592
GasToken:mint_public 49.6 (-1%) 10,158
Token:mint_public ⚠️ 51.6 (-90%) 19,034
Token:assert_minter_and_mint ⚠️ 169 (+199%) 12,925
AuthRegistry:set_authorized 29.5 (-2%) 7,812
FPC:prepare_fee 102 (-6%) 15,062
Token:transfer_public ⚠️ 43.1 (+35%) 31,218
FPC:pay_refund 124 (-10%) 25,260
Benchmarking:increment_balance 2,192 15,267
Token:_increase_public_balance 54.0 (-3%) 15,006
FPC:pay_refund_with_shielded_rebate 112 (-17%) 26,347

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.156 (-3%)

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.3 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.598 0.516 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 47.9 (-1%) 76.9 (+1%) 132 247 471
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.489 (-1%) 0.472 (+1%) 0.452 0.447 0.438
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.1 (-1%) 111 (-1%) 182 354 694
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.500 (-1%) 0.499 0.479 (-1%) 0.480 0.476
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 72.8 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.518 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 | |
| - | |

@sirasistant sirasistant merged commit e431b6f into master Jul 4, 2024
91 checks passed
@sirasistant sirasistant deleted the arv/align_reset_variants branch July 4, 2024 13:46
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.

3 participants