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): basic AVM-ACVM interoperability #5593

Closed

Conversation

fcarreiro
Copy link
Contributor

@fcarreiro fcarreiro commented Apr 5, 2024

Makes it possible to call external public calls to/from AVM/ACVM.

Modified conversions to support most things except nested call tracking.

Copy link
Contributor Author

fcarreiro commented Apr 5, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

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

@fcarreiro fcarreiro changed the title wip feat(avm): basic AVM-ACVM interoperability Apr 5, 2024
@fcarreiro fcarreiro requested a review from Maddiaa0 April 5, 2024 16:02
@fcarreiro fcarreiro force-pushed the fc/avm-simulator-interoperability branch from a044121 to 0d29922 Compare April 5, 2024 16:07
@fcarreiro fcarreiro force-pushed the fc/avm-env-header branch from 9c4eee1 to 46bd9b9 Compare April 5, 2024 16:08
@fcarreiro fcarreiro force-pushed the fc/avm-simulator-interoperability branch from 0d29922 to 68b544b Compare April 5, 2024 16:08
@AztecBot
Copy link
Collaborator

AztecBot commented Apr 5, 2024

Benchmark results

Metrics with a significant change:

  • tx_sequencer_processing_time_ms (2): 439 (-19%)
  • note_trial_decrypting_time_in_ms (8): 74.7 (+94%)
  • note_trial_decrypting_time_in_ms (32): 111 (+166%)
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.

Values are compared against data from master at commit d531b259 and shown if the difference exceeds 1%.

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 676 676 676
l1_rollup_calldata_gas 6,412 6,400 6,412
l1_rollup_execution_gas 585,745 585,733 585,745
l2_block_processing_time_in_ms 1,283 (-7%) 4,768 (+1%) 9,251 (-2%)
note_successful_decrypting_time_in_ms 171 (-28%) 602 (-5%) 1,019
note_trial_decrypting_time_in_ms ⚠️ 74.7 (+94%) ⚠️ 111 (+166%) 35.5 (-9%)
l2_block_building_time_in_ms 11,906 43,095 (-1%) 84,276 (-1%)
l2_block_rollup_simulation_time_in_ms 7,129 24,478 46,993 (-1%)
l2_block_public_tx_process_time_in_ms 4,740 (-2%) 18,493 (-2%) 37,041 (-1%)

L2 chain processing

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

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 14,489 27,540 (-1%)
note_history_successful_decrypting_time_in_ms 1,326 (+3%) 2,441 (-1%)
note_history_trial_decrypting_time_in_ms 71.1 (-44%) 115 (+7%)
node_database_size_in_bytes 18,604,112 35,004,496
pxe_database_size_in_bytes 29,859 59,414

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 179 (-1%) 44,377 26,164
private-kernel-ordering 160 (-1%) 50,830 39,325
base-parity 4,190 (-1%) 128 311
root-parity 1,203 (+9%) 1,244 311
base-rollup 14,376 116,608 861
root-rollup 49.7 4,359 725
private-kernel-inner 216 (-1%) 71,744 26,164
public-kernel-app-logic 119 47,695 40,661
public-kernel-tail 162 (-1%) 53,372 13,269
merge-rollup 10.3 (+1%) 2,568 861
public-kernel-teardown 119 (+1%) 47,695 40,661
public-kernel-setup 118 47,695 40,661

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.1 16.1 (+1%) 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.8 31.6 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.585 0.497 (+1%) 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 45.8 72.3 230 447 878 (+1%) 1,731 (-1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 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.470 0.445 0.420 0.417 0.417 (+1%) 0.415 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 54.1 107 337 664 (+1%) 1,312 2,611 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 105 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.477 0.481 0.458 0.455 0.455 0.454 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 61.3
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 109
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.534

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 40,548 501,142

Transaction size based on fee payment method

Metric native fee payment method fpc_public fee payment method fpc_private fee payment method
tx_with_fee_size_in_bytes 905 1,161 1,377

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 1,742 (+2%) 1,075 (-1%) 5,425
Metric 1 public data writes 2 public data writes 3 public data writes 4 public data writes 5 public data writes 8 public data writes
tx_sequencer_processing_time_ms 571 ⚠️ 439 (-19%) 1,087 (+1%) 537 (+2%) 1,784 (+1%) 598 (+1%)

@fcarreiro fcarreiro closed this Apr 5, 2024
@fcarreiro fcarreiro deleted the fc/avm-simulator-interoperability branch April 9, 2024 09:39
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.

2 participants