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: avm unconstrained external call #6846

Merged
merged 23 commits into from
Jun 4, 2024
Merged

Conversation

IlyasRidhuan
Copy link
Contributor

Please read contributing guidelines and remove this line.

@IlyasRidhuan IlyasRidhuan changed the title Ir/06 02 vm external call feat: avm unconstrained external call Jun 3, 2024
@AztecBot
Copy link
Collaborator

AztecBot commented Jun 3, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_witness_generation_time_in_ms (private-kernel-init): 556 (+18%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail-to-public): 85,520 (-16%)
  • protocol_circuit_proving_time_in_ms (base-rollup): 65,510 (-18%)
  • protocol_circuit_proving_time_in_ms (root-parity): 33,952 (-16%)
  • protocol_circuit_proving_time_in_ms (public-kernel-setup): 37,586 (-16%)
  • protocol_circuit_proving_time_in_ms (public-kernel-app-logic): 39,269 (-17%)
  • protocol_circuit_proving_time_in_ms (public-kernel-teardown): 39,418 (-19%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 19,637 (-19%)
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,748 1,553 707 (+2%) 775 (+6%) 777
proof_construction_time_sha256_30_ms 11,979 (+2%) 3,164 (+1%) 1,407 1,432 1,462
proof_construction_time_sha256_100_ms 45,289 (+3%) 11,751 5,416 5,395 5,473 (+2%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 57.0 (-2%) 88.0
proof_construction_time_poseidon_hash_30_ms 1,529 (+1%) 421 (+1%) 202 227 267
proof_construction_time_poseidon_hash_100_ms 5,769 (+1%) 1,572 (+1%) 731 (+2%) 783 (+3%) 793

L2 block published to L1

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

Metric 4 txs 8 txs
l1_rollup_calldata_size_in_bytes 1,412 1,412
l1_rollup_calldata_gas 9,452 9,456
l1_rollup_execution_gas 607,988 607,992
l2_block_processing_time_in_ms 692 1,298
l2_block_building_time_in_ms 22,396 (+1%) 46,073
l2_block_rollup_simulation_time_in_ms 22,275 (+1%) 45,706
l2_block_public_tx_process_time_in_ms 19,132 (+1%) 42,266

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 5,953 (-1%) 8,515 (-1%)
node_database_size_in_bytes 9,510,992 12,763,216
pxe_database_size_in_bytes 7,774 15,127

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 ⚠️ 556 (+18%) 11,976 (-11%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 411 (+1%) 1,031 (+9%) 44,866 (-10%) 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 584 (+1%) 2,809 (-12%) 46,453 (-11%) 96,545 68,261 11,648 297 2,097,152
base-parity 6.53 1,773 (+6%) 2,574 (-9%) 128 64.0 2,208 2.00 131,072
root-parity 50.6 (+3%) 46.1 (-26%) ⚠️ 33,952 (-16%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 6,005 2,327 (-4%) ⚠️ 65,510 (-18%) 119,738 756 3,648 47.0 4,194,304
root-rollup 112 (+2%) 63.1 (-18%) ⚠️ 19,637 (-19%) 25,309 620 3,456 41.0 1,048,576
public-kernel-app-logic 572 3,589 ⚠️ 39,269 (-17%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,147 23,605 (-2%) 155,229 (-15%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 593 (+1%) 2,200 (+8%) 40,846 (-12%) 120,737 64,614 89,536 2,731 2,097,152
public-kernel-setup 672 (+2%) 2,680 (-4%) ⚠️ 37,586 (-16%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-teardown 573 (+1%) 3,546 (-3%) ⚠️ 39,418 (-19%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 33.1 (+6%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 8,665 (+6%) ⚠️ 85,520 (-16%) 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 463 N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 42.0 (+2%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,801 (+2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,455 (+2%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,830 (-1%) 16,768 50,560 (-8%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,646 (+5%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,132 (+5%) 16,768 10,045 (-10%) 524,288 457
Token:transfer 1,376 9,944 5,430 16,768 47,539 (-12%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,392 (-1%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.4 (+1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,897 N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,767 (-1%) 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 256 leaves 512 leaves 1024 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.4 17.1 (+1%) 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.7 N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.607 0.524 (+1%) 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.8 76.4 133 247 473 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 288 543 1,055 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.499 0.471 0.456 0.448 0.441 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 58.6 112 (-1%) 184 (+1%) 356 (+1%) 628 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 107 208 355 686 1,263 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.505 0.504 (-1%) 0.487 0.487 (+1%) 0.470 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A 59.1
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A 101
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A 0.552

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 79,470 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@Maddiaa0 Maddiaa0 merged commit 5a65ffc into master Jun 4, 2024
109 checks passed
@Maddiaa0 Maddiaa0 deleted the ir/06-02-vm_external_call branch June 4, 2024 10:17
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