aztec-packages icon indicating copy to clipboard operation
aztec-packages copied to clipboard

feat: prover node metrics

Open alexghr opened this issue 1 year ago • 1 comments

Tracks block proving duration

alexghr avatar Aug 20 '24 11:08 alexghr

Benchmark results

Metrics with a significant change:

  • protocol_circuit_simulation_time_in_ms (private-kernel-tail-to-public): 763 (-49%)
  • avm_simulation_time_ms (FeeJuice:set_portal): 9.58 (-33%)
  • avm_simulation_time_ms (Token:mint_public): 44.6 (-35%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 65.8 (+63%)
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,795 1,565 710 746 (-2%) 774 (+1%)
proof_construction_time_sha256_30_ms 11,555 3,092 1,380 1,432 1,466
proof_construction_time_sha256_100_ms 44,379 11,859 (-1%) 5,425 5,592 (+2%) 5,734 (-1%)
proof_construction_time_poseidon_hash_ms 79.0 (+1%) 34.0 34.0 57.0 (-3%) 87.0
proof_construction_time_poseidon_hash_30_ms 1,534 424 203 225 (-1%) 270
proof_construction_time_poseidon_hash_100_ms 5,664 1,517 675 (-1%) 737 (-1%) 748

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 4,324 7,844 14,852
l1_rollup_calldata_gas 49,696 92,464 177,656
l1_rollup_execution_gas 1,373,724 2,107,388 3,892,636
l2_block_processing_time_in_ms 250 447 (+1%) 823 (-1%)
l2_block_building_time_in_ms 8,977 17,459 34,827 (-1%)
l2_block_rollup_simulation_time_in_ms 8,976 17,459 34,827 (-1%)
l2_block_public_tx_process_time_in_ms 7,548 (-1%) 15,938 33,286 (-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 2,942 3,927 (+3%)
node_database_size_in_bytes 12,603,472 (-1%) 16,715,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 input_size_in_bytes output_size_in_bytes proving_time_in_ms
private-kernel-init 84.7 (-9%) 380 (+1%) 21,755 44,860 N/A
private-kernel-inner 173 (+1%) 682 (+2%) 72,566 45,007 N/A
private-kernel-reset-tiny 461 853 (+1%) 65,675 44,846 N/A
private-kernel-tail 195 157 (+5%) 50,686 52,257 N/A
base-parity 5.56 N/A 160 96.0 N/A
root-parity 35.2 N/A 73,948 96.0 N/A
base-rollup 2,755 N/A 189,136 664 N/A
root-rollup 40.0 N/A 58,173 716 N/A
public-kernel-setup 85.0 (+2%) N/A 105,085 71,222 N/A
public-kernel-app-logic 94.9 N/A 104,911 71,222 N/A
public-kernel-tail 550 N/A 410,534 16,414 N/A
private-kernel-reset-small 456 (+1%) N/A 66,341 45,629 N/A
private-kernel-tail-to-public :warning: 763 (-49%) 627 (+1%) 460,796 1,825 N/A
public-kernel-teardown 82.1 N/A 105,349 71,222 N/A
merge-rollup 20.2 (+1%) N/A 38,174 664 N/A
undefined N/A N/A N/A N/A 82,960 (+2%)

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms
ContractClassRegisterer:register 1,344 11,731 340 (-1%)
ContractInstanceDeployer:deploy 1,408 11,731 18.1 (-1%)
MultiCallEntrypoint:entrypoint 1,920 11,731 404 (-1%)
FeeJuice:deploy 1,376 11,731 391 (-2%)
SchnorrAccount:constructor 1,312 11,731 73.9 (-2%)
SchnorrAccount:entrypoint 2,304 11,731 408 (-1%)
Token:privately_mint_private_note 1,280 11,731 105 (-3%)
FPC:fee_entrypoint_public 1,344 11,731 29.3 (+15%)
Token:transfer 1,312 11,731 226 (-1%)
Benchmarking:create_note 1,344 11,731 85.9 (-1%)
SchnorrAccount:verify_private_authwit 1,280 11,731 27.3 (-1%)
Token:unshield 1,376 11,731 527 (-1%)
FPC:fee_entrypoint_private 1,376 11,731 701 (-1%)

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 55.9 (-10%) 7,739
FeeJuice:set_portal :warning: 9.58 (-33%) 2,354
Token:constructor 78.3 (-8%) 26,051
FPC:constructor 53.1 (-3%) 18,001
FeeJuice:mint_public 39.1 (+1%) 5,877
Token:mint_public :warning: 44.6 (-35%) 10,917
Token:assert_minter_and_mint :warning: 65.8 (+63%) 7,512
AuthRegistry:set_authorized 48.6 (+3%) 4,391
FPC:prepare_fee 233 7,043
Token:transfer_public 20.6 (+7%) 39,426
FPC:pay_refund 58.3 (-2%) 10,234
Benchmarking:increment_balance 930 6,563
Token:_increase_public_balance 40.7 (+3%) 8,433
FPC:pay_refund_with_shielded_rebate 63.6 (-1%) 10,783

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.164

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.17 3.84 (-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.113 0.109 (-2%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.6 17.6 (-3%) 30.2 (-2%) 58.9 114 (-2%)
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.111 0.102 (-3%) 0.0986 (-2%) 0.101 0.102 (-2%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.1 (-2%) 25.6 (-1%) 42.8 (-1%) 83.3 (+1%) 162 (-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.107 (-2%) 0.103 (-1%) 0.104 (-1%) 0.103 0.104
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.3 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 132 N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.105 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 64,779 668,997

Transaction size based on fee payment method

| Metric | | | - | |

AztecBot avatar Aug 20 '24 12:08 AztecBot