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: Use simulated circuit for tiny reset #7442

Merged
merged 2 commits into from
Jul 11, 2024
Merged

Conversation

sirasistant
Copy link
Collaborator

No description provided.

@AztecBot
Copy link
Collaborator

AztecBot commented Jul 11, 2024

Benchmark results

Metrics with a significant change:

  • proof_construction_time_sha256_100_ms (16): 5,473 (-17%)
  • protocol_circuit_simulation_time_in_ms (private-kernel-reset-tiny): 298 (-77%)
  • avm_simulation_time_ms (Token:transfer_public): 30.3 (-47%)
  • protocol_circuit_proving_time_in_ms (base-parity): 1,395 (-31%)
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,769 (+1%) 1,556 (+1%) 709 (+1%) 748 (+1%) 774
proof_construction_time_sha256_30_ms 11,873 (-2%) 3,169 (+1%) 1,415 1,450 (+1%) 1,474
proof_construction_time_sha256_100_ms 44,105 (+1%) 11,880 (+1%) ⚠️ 5,473 (-17%) 5,431 5,407 (-9%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 (-3%) 58.0 (-2%) 88.0 (+1%)
proof_construction_time_poseidon_hash_30_ms 1,526 (+1%) 420 (+1%) 201 (+1%) 230 (+4%) 267 (+1%)
proof_construction_time_poseidon_hash_100_ms 5,660 (+1%) 1,532 (+1%) 683 (+1%) 743 (+2%) 742 (-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 708 708 708
l1_rollup_calldata_gas 6,600 6,594 6,576
l1_rollup_execution_gas 583,062 583,207 583,340
l2_block_processing_time_in_ms 763 (+2%) 1,412 (-1%) 2,695
l2_block_building_time_in_ms 13,154 (-1%) 25,954 (-1%) 50,959 (+1%)
l2_block_rollup_simulation_time_in_ms 13,154 (-1%) 25,954 (-1%) 50,958 (+1%)
l2_block_public_tx_process_time_in_ms 11,026 (-1%) 23,608 (-1%) 48,595 (+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 6,977 (-2%) 9,869
node_database_size_in_bytes 12,431,440 16,445,520
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 116 (-2%) 412 (+3%) 21,732 54,085 N/A N/A N/A N/A
private-kernel-inner 230 720 (-1%) 81,199 54,264 N/A N/A N/A N/A
private-kernel-tail 1,123 (-1%) 2,526 (-3%) 61,808 61,554 N/A N/A N/A N/A
base-parity 6.49 824 (-1%) 160 96.0 ⚠️ 1,395 (-31%) 12,676 3.00 131,072
root-parity 108 (+1%) 117 (-2%) 64,860 96.0 48,986 12,676 3.00 4,194,304
base-rollup 4,234 4,922 (-1%) 180,315 632 49,078 (+2%) 13,476 28.0 4,194,304
root-rollup 152 124 (+2%) 51,261 652 41,741 (-1%) 13,412 26.0 4,194,304
public-kernel-setup 196 (-2%) 2,417 (-2%) 112,536 80,310 22,862 118,916 3,323 2,097,152
public-kernel-app-logic 150 (-1%) 3,336 (+1%) 112,536 80,310 10,153 (-2%) 118,916 3,323 1,048,576
public-kernel-tail 895 27,868 (+1%) 409,413 10,046 71,827 24,868 384 8,388,608
private-kernel-reset-tiny ⚠️ 298 (-77%) 1,018 77,007 53,954 N/A N/A N/A N/A
private-kernel-tail-to-public 6,929 (-1%) 2,917 (-1%) 777,415 1,632 N/A N/A N/A N/A
public-kernel-teardown 141 (-3%) 3,350 (+1%) 112,536 80,310 22,951 (+1%) 118,916 3,323 2,097,152
merge-rollup 57.4 (-4%) N/A 33,566 632 N/A N/A N/A N/A
undefined N/A N/A N/A N/A 159,932 (-1%) 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,312 9,344 396 (-2%) N/A N/A
ContractInstanceDeployer:deploy 1,376 9,344 25.4 (+1%) N/A N/A
MultiCallEntrypoint:entrypoint 1,888 9,344 631 N/A N/A
GasToken:deploy 1,344 9,344 566 N/A N/A
SchnorrAccount:constructor 1,280 9,344 429 (-1%) N/A N/A
SchnorrAccount:entrypoint 2,272 9,344 766 (+1%) N/A N/A
Token:privately_mint_private_note 1,248 9,344 498 (-2%) N/A N/A
FPC:fee_entrypoint_public 1,312 9,344 101 (-2%) N/A N/A
Token:transfer 1,280 9,344 1,472 N/A N/A
AuthRegistry:set_authorized (avm) 19,222 N/A N/A 95,392 2,109 (-1%)
FPC:prepare_fee (avm) 26,664 N/A N/A 95,456 2,853 (-2%)
Token:transfer_public (avm) 42,914 N/A N/A 95,456 3,271
AuthRegistry:consume (avm) 33,100 N/A N/A 95,424 2,804 (-1%)
FPC:pay_refund (avm) 36,829 N/A N/A 95,424 11,029 (-2%)
Benchmarking:create_note 1,312 9,344 427 N/A N/A
SchnorrAccount:verify_private_authwit 1,248 9,344 41.7 N/A N/A
Token:unshield 1,344 9,344 1,189 (-1%) N/A N/A
FPC:fee_entrypoint_private 1,344 9,344 1,563 (-1%) 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 98.4 (-3%) 13,790
GasToken:set_portal 10.8 (-20%) 3,339
Token:constructor 125 (-5%) 23,692
FPC:constructor 92.7 (+2%) 13,592
GasToken:mint_public 81.0 10,158
Token:mint_public 335 (-10%) 19,034
Token:assert_minter_and_mint 50.3 (-3%) 12,925
AuthRegistry:set_authorized 44.7 (-13%) 7,812
FPC:prepare_fee 105 (-24%) 15,062
Token:transfer_public ⚠️ 30.3 (-47%) 31,218
FPC:pay_refund 146 (-2%) 25,260
Benchmarking:increment_balance 1,341 15,267
Token:_increase_public_balance 18.7 (+11%) 15,006
FPC:pay_refund_with_shielded_rebate 182 (+1%) 26,347

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.160

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.7 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.599 0.512 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 48.2 (+1%) 75.6 131 245 468
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.492 (+1%) 0.465 0.451 0.444 0.437
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 59.5 111 183 (+1%) 352 692
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 0.481 (+1%) 0.477 0.474
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 72.7 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 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 76,837 667,838

Transaction size based on fee payment method

| Metric | |
| - | |

@sirasistant sirasistant requested a review from LeilaWang July 11, 2024 15:24
@sirasistant sirasistant enabled auto-merge (squash) July 11, 2024 15:31
@sirasistant sirasistant merged commit f79a7c0 into master Jul 11, 2024
92 checks passed
@sirasistant sirasistant deleted the arv/tiny_simulated branch July 11, 2024 16:16
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