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

feat: increasing MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, removing hack #6739

Conversation

benesjan
Copy link
Contributor

Increasing limit after discussion on slack.

Copy link
Contributor Author

benesjan commented May 29, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @benesjan and the rest of your teammates on Graphite Graphite

@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • app_circuit_witness_generation_time_in_ms (MultiCallEntrypoint:entrypoint): 1,727 (+18%)
  • app_circuit_witness_generation_time_in_ms (SchnorrAccount:constructor): 1,445 (+46%)
  • app_circuit_witness_generation_time_in_ms (SchnorrAccount:entrypoint): 2,679 (+26%)
  • app_circuit_witness_generation_time_in_ms (Token:privately_mint_private_note): 1,578 (+38%)
  • app_circuit_witness_generation_time_in_ms (Token:transfer): 4,953 (+22%)
  • app_circuit_witness_generation_time_in_ms (Benchmarking:create_note): 1,410 (+47%)
  • app_circuit_witness_generation_time_in_ms (Token:unshield): 3,789 (+16%)
  • app_circuit_proving_time_in_ms (Token:transfer): 58,081 (+25%)
  • protocol_circuit_witness_generation_time_in_ms (root-parity): 89.7 (+88%)
  • protocol_circuit_proving_time_in_ms (private-kernel-init): 14,599 (+21%)
  • protocol_circuit_proving_time_in_ms (private-kernel-inner): 48,306 (+23%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail-to-public): 106,915 (+17%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail): 43,184 (+18%)
  • protocol_circuit_proving_time_in_ms (public-kernel-tail): 185,319 (+20%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 22,534 (+16%)
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,732 1,555 709 746 767
proof_construction_time_sha256_30_ms 11,442 3,076 1,379 1,426 1,457
proof_construction_time_sha256_100_ms 43,750 11,765 5,494 5,556 5,356
proof_construction_time_poseidon_hash_ms 236 80.0 58.0 90.0 148
proof_construction_time_poseidon_hash_30_ms 5,745 1,564 722 797 792
proof_construction_time_poseidon_hash_100_ms 11,374 3,044 1,371 1,419 1,436

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 1,412 1,412 1,412
l1_rollup_calldata_gas 9,464 9,476 9,452
l1_rollup_execution_gas 616,105 616,117 616,093
l2_block_processing_time_in_ms 1,285 (-2%) 4,791 (-2%) 9,529 (-1%)
l2_block_building_time_in_ms 46,568 (+1%) 185,048 (+1%) 370,900 (+2%)
l2_block_rollup_simulation_time_in_ms 46,392 (+1%) 184,389 (+1%) 369,589 (+2%)
l2_block_public_tx_process_time_in_ms 25,037 (+1%) 104,937 (+1%) 215,276 (+2%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 9,466 (-1%) 14,521
node_database_size_in_bytes 14,479,440 21,307,472
pxe_database_size_in_bytes 18,071 29,868

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 135 (+2%) 481 (-4%) ⚠️ 14,599 (+21%) 20,630 64,614 89,536 2,731 524,288
private-kernel-inner 412 (+1%) 964 (-4%) ⚠️ 48,306 (+23%) 92,318 64,614 89,536 2,731 2,097,152
private-kernel-tail 588 (+1%) 2,708 (-10%) ⚠️ 43,184 (+18%) 96,541 77,732 11,648 297 2,097,152
base-parity 6.49 (-2%) 1,268 (-1%) 2,872 128 64.0 2,208 2.00 131,072
root-parity 49.3 (-1%) ⚠️ 89.7 (+88%) 50,147 (+14%) 27,084 64.0 2,720 18.0 2,097,152
base-rollup 795 (+10%) 2,417 (+4%) 85,794 (+15%) 119,734 756 3,648 47.0 4,194,304
root-rollup 110 (-2%) 76.4 (+19%) ⚠️ 22,534 (+16%) 25,297 620 3,456 41.0 1,048,576
public-kernel-app-logic 552 (+3%) 3,640 (+13%) 52,802 (+9%) 106,341 (+1%) 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,129 (+1%) 25,307 (+6%) ⚠️ 185,319 (+20%) 401,002 7,646 11,648 297 8,388,608
private-kernel-reset-small 595 (+1%) 2,266 (+2%) 49,290 (+8%) 120,733 64,614 89,536 2,731 2,097,152
merge-rollup 28.8 N/A N/A 16,534 756 N/A N/A N/A
public-kernel-setup 657 N/A N/A 106,341 (+1%) 86,550 N/A N/A N/A
public-kernel-teardown 557 (-1%) N/A N/A 106,341 (+1%) 86,550 N/A N/A N/A
private-kernel-tail-to-public N/A 8,417 (-2%) ⚠️ 106,915 (+17%) N/A N/A 116,768 3,582 4,194,304

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 9,944 472 N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 41.6 (-1%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 ⚠️ 1,727 (+18%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 ⚠️ 1,445 (+46%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 ⚠️ 2,679 (+26%) 16,768 53,315 (+9%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 ⚠️ 1,578 (+38%) N/A N/A N/A N/A
Token:transfer 1,376 9,944 ⚠️ 4,953 (+22%) 16,768 ⚠️ 58,081 (+25%) 2,097,152 457
Benchmarking:create_note 1,344 (+2%) 9,944 ⚠️ 1,410 (+47%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 241 (+7%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.2 (-7%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 ⚠️ 3,789 (+16%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,663 (+15%) N/A N/A N/A N/A

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 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 (-1%) 17.0 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.604 (-1%) 0.521 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 48.4 (-1%) 76.4 246 (-1%) 478 925 (-2%) 1,836 (-1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.495 (-1%) 0.471 0.446 (-1%) 0.446 0.439 (-1%) 0.438 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 58.0 (-1%) 113 (-1%) 354 (-1%) 703 1,379 (-1%) 2,749 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 106 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.502 (-1%) 0.505 (-1%) 0.480 (-1%) 0.482 0.477 (-1%) 0.477 (-1%) N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 62.6 (-1%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 107
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.555 (-1%)

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 84,050 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@benesjan benesjan force-pushed the 05-29-feat_increasing_max_public_data_update_requests_per_call_removing_hack branch from 62a84c6 to a179be0 Compare May 30, 2024 06:20
@benesjan benesjan changed the base branch from 05-29-refactor_cleanup_after_outgoing to master May 30, 2024 06:20
@benesjan benesjan marked this pull request as ready for review May 30, 2024 06:20
@benesjan benesjan enabled auto-merge (squash) May 30, 2024 06:55
@benesjan benesjan merged commit d5550c6 into master May 30, 2024
90 of 121 checks passed
@benesjan benesjan deleted the 05-29-feat_increasing_max_public_data_update_requests_per_call_removing_hack branch May 30, 2024 07:05
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