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): add storage address kernel opcode #6863

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

IlyasRidhuan
Copy link
Contributor

Please read contributing guidelines and remove this line.

Copy link
Contributor Author

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

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

@IlyasRidhuan IlyasRidhuan force-pushed the 06-04-feat_avm_add_storage_address_kernel_opcode branch from 529ab98 to f8f15dd Compare June 4, 2024 12:08
@IlyasRidhuan IlyasRidhuan marked this pull request as ready for review June 4, 2024 12:08
@AztecBot
Copy link
Collaborator

AztecBot commented Jun 4, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_witness_generation_time_in_ms (base-parity): 849 (-52%)
  • protocol_circuit_witness_generation_time_in_ms (root-parity): 62.8 (+30%)
  • protocol_circuit_proving_time_in_ms (base-rollup): 79,685 (+22%)
  • protocol_circuit_proving_time_in_ms (root-parity): 39,964 (+17%)
  • protocol_circuit_proving_time_in_ms (public-kernel-tail): 185,564 (+21%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 24,222 (+24%)
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,727 1,547 707 (-1%) 765 (-1%) 776
proof_construction_time_sha256_30_ms 11,950 3,203 (+2%) 1,418 1,442 1,475 (+1%)
proof_construction_time_sha256_100_ms 44,812 11,729 5,433 5,383 5,356
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,520 420 203 229 (-2%) 269 (+1%)
proof_construction_time_poseidon_hash_100_ms 5,765 1,562 (-1%) 726 767 (-2%) 799 (+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
l1_rollup_calldata_size_in_bytes 1,412 1,412
l1_rollup_calldata_gas 9,464 9,454
l1_rollup_execution_gas 608,000 607,990
l2_block_processing_time_in_ms 694 (-1%) 1,285
l2_block_building_time_in_ms 22,253 45,550
l2_block_rollup_simulation_time_in_ms 22,126 45,205
l2_block_public_tx_process_time_in_ms 18,993 (-1%) 41,804

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,918 (+1%) 8,460
node_database_size_in_bytes 9,506,896 12,775,504
pxe_database_size_in_bytes 9,242 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 485 (-2%) 12,447 (+2%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 405 954 (-8%) 49,624 (+8%) 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 576 (-1%) 2,657 (-7%) 51,636 (+7%) 96,545 68,261 11,648 297 2,097,152
base-parity 6.63 (+1%) ⚠️ 849 (-52%) 2,685 (-4%) 128 64.0 2,208 2.00 131,072
root-parity 49.2 (-1%) ⚠️ 62.8 (+30%) ⚠️ 39,964 (+17%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 5,904 (-2%) 2,362 ⚠️ 79,685 (+22%) 119,738 756 3,648 47.0 4,194,304
root-rollup 110 (-2%) 75.7 (+22%) ⚠️ 24,222 (+24%) 25,309 620 3,456 41.0 1,048,576
public-kernel-app-logic 563 (-1%) 3,570 (+3%) 43,900 (+14%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,126 (-1%) 24,622 (+4%) ⚠️ 185,564 (+21%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 582 (-1%) 1,995 (-8%) 46,372 (+9%) 120,737 64,614 89,536 2,731 2,097,152
public-kernel-setup 658 (-1%) 2,706 (+1%) 42,813 (+14%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-teardown 571 (+1%) 3,474 (-3%) 44,768 (+14%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 29.8 (-1%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 8,825 (+1%) 102,430 (+13%) 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 (-1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 41.3 (-3%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,767 (-2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,417 (-3%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,813 16,768 53,247 (+5%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,552 (-7%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,025 (-9%) 16,768 10,716 (+4%) 524,288 457
Token:transfer 1,376 9,944 5,295 (-3%) 16,768 52,472 (+8%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,406 (+1%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.5 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,929 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,796 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 (-1%) 16.9 (-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.601 (-1%) 0.517 (-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.3 (-1%) 76.2 (-1%) 134 (+1%) 246 466 (-1%) 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.493 (-1%) 0.470 (-1%) 0.459 (+1%) 0.447 0.436 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 57.9 (-1%) 112 (-1%) 183 (-1%) 351 624 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.499 (-1%) 0.503 (-1%) 0.485 0.480 0.467 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A 58.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 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.548 (-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 79,470 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@Maddiaa0 Maddiaa0 merged commit 19aba3e into master Jun 4, 2024
89 checks passed
@Maddiaa0 Maddiaa0 deleted the 06-04-feat_avm_add_storage_address_kernel_opcode branch June 4, 2024 13:01
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