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: new private bridge flow #8068

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

sklppy88
Copy link
Contributor

Please read contributing guidelines and remove this line.

Copy link
Contributor Author

sklppy88 commented Aug 19, 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 @sklppy88 and the rest of your teammates on Graphite Graphite

@sklppy88 sklppy88 changed the title refactor: portal managers in cli feat: new private bridge flow Aug 19, 2024
@AztecBot
Copy link
Collaborator

AztecBot commented Aug 19, 2024

Benchmark results

Metrics with a significant change:

  • protocol_circuit_witness_generation_time_in_ms (base-parity): 303 (-50%)
  • protocol_circuit_proving_time_in_ms (root-parity): 27,207 (-16%)
  • protocol_circuit_proving_time_in_ms (public-kernel-teardown): 15,830 (-18%)
  • protocol_circuit_proving_time_in_ms (root-rollup): 24,407 (-16%)
  • app_circuit_proving_time_in_ms (Token:transfer_public (avm)): 9,319 (-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,780 1,563 (+1%) 696 (-1%) 774 775 (+1%)
proof_construction_time_sha256_30_ms 11,894 3,193 1,429 (+1%) 1,445 1,472 (-1%)
proof_construction_time_sha256_100_ms 44,351 12,593 (+1%) 5,703 (+1%) 5,598 (+1%) 5,516
proof_construction_time_poseidon_hash_ms 79.0 34.0 34.0 59.0 88.0 (+1%)
proof_construction_time_poseidon_hash_30_ms 1,534 421 200 226 (-2%) 268
proof_construction_time_poseidon_hash_100_ms 5,673 1,535 678 (-1%) 722 (+1%) 754 (+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 16 txs
l1_rollup_calldata_size_in_bytes 4,324 7,844 14,852
l1_rollup_calldata_gas 49,696 92,450 177,716
l1_rollup_execution_gas 1,294,359 2,042,081 3,869,386
l2_block_processing_time_in_ms 244 (-5%) 445 (-1%) 832 (+3%)
l2_block_building_time_in_ms 9,648 (-1%) 18,873 37,565 (-1%)
l2_block_rollup_simulation_time_in_ms 9,648 (-1%) 18,872 37,565 (-1%)
l2_block_public_tx_process_time_in_ms 8,035 (-1%) 17,017 35,660

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 3,006 (+1%) 3,859 (-1%)
node_database_size_in_bytes 12,689,488 16,916,560
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 proof_size_in_bytes num_public_inputs size_in_gates
private-kernel-init 99.4 (-3%) 410 (+4%) 21,846 44,858 N/A N/A N/A N/A
private-kernel-inner 167 724 (+4%) 72,545 45,005 N/A N/A N/A N/A
private-kernel-tail 679 (+2%) 787 (+6%) 52,710 52,256 N/A N/A N/A N/A
base-parity 6.05 (+1%) ⚠️ 303 (-50%) 160 96.0 1,088 (-4%) 13,188 19.0 65,536
root-parity 109 (+1%) 114 (-7%) 69,084 96.0 ⚠️ 27,207 (-16%) 13,188 19.0 4,194,304
base-rollup 2,973 5,656 187,824 664 83,855 (-14%) 14,020 45.0 16,777,216
root-rollup 97.1 (+1%) 102 (-16%) 54,525 716 ⚠️ 24,407 (-16%) 13,988 44.0 4,194,304
public-kernel-setup 90.5 (-1%) 2,750 (-3%) 103,782 71,222 14,996 (-15%) 129,220 3,645 2,097,152
public-kernel-app-logic 106 4,166 (-1%) 103,598 71,222 8,559 (-14%) 129,220 3,645 1,048,576
public-kernel-tail 572 (+1%) 29,849 (-6%) 409,190 16,414 91,516 (-12%) 34,308 679 16,777,216
private-kernel-reset-tiny 182 (-2%) 869 (+5%) 68,621 44,750 N/A N/A N/A N/A
private-kernel-tail-to-public 2,676 (-1%) 1,583 (+5%) 931,564 1,697 N/A N/A N/A N/A
public-kernel-teardown 86.3 4,207 104,005 71,222 ⚠️ 15,830 (-18%) 129,220 3,645 2,097,152
merge-rollup 60.0 (+1%) N/A 35,742 664 N/A N/A N/A N/A
undefined N/A N/A N/A N/A 65,717 (-3%) N/A N/A N/A

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
ContractClassRegisterer:register 1,344 11,731 342 N/A N/A
ContractInstanceDeployer:deploy 1,408 11,731 18.2 N/A N/A
MultiCallEntrypoint:entrypoint 1,920 11,731 477 N/A N/A
FeeJuice:deploy 1,376 11,731 385 (-4%) N/A N/A
SchnorrAccount:constructor 1,312 11,731 177 N/A N/A
SchnorrAccount:entrypoint 2,304 11,731 543 (+3%) N/A N/A
Token:privately_mint_private_note 1,280 11,731 221 N/A N/A
FPC:fee_entrypoint_public 1,344 11,731 24.7 (+4%) N/A N/A
Token:transfer 1,312 11,731 410 (+2%) N/A N/A
AuthRegistry:set_authorized (avm) 18,491 N/A N/A 146,400 2,277 (+5%)
FPC:prepare_fee (avm) 22,958 N/A N/A 146,464 2,614 (+2%)
Token:transfer_public (avm) 61,614 N/A N/A 146,464 ⚠️ 9,319 (-16%)
AuthRegistry:consume (avm) 41,719 N/A N/A 146,432 4,845 (-11%)
FPC:pay_refund (avm) 26,227 N/A N/A 146,432 4,657 (-6%)
Benchmarking:create_note 1,344 11,731 174 (+4%) N/A N/A
SchnorrAccount:verify_private_authwit 1,280 11,731 27.5 (+1%) N/A N/A
Token:unshield 1,376 11,731 632 (+1%) N/A N/A
FPC:fee_entrypoint_private 1,376 11,731 823 N/A N/A

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 93.4 (-1%) 8,139
FeeJuice:set_portal 10.6 (-26%) 2,362
Token:constructor 129 (+2%) 31,107
FPC:constructor 92.7 (-1%) 22,380
FeeJuice:mint_public 79.0 (+1%) 6,150
Token:mint_public 94.5 (+2%) 11,720
Token:assert_minter_and_mint 80.9 (-12%) 8,028
AuthRegistry:set_authorized 8.53 (+16%) 4,537
FPC:prepare_fee 288 (-5%) 8,812
Token:transfer_public 26.6 (-24%) 47,374
FPC:pay_refund 64.0 (+6%) 12,114
Benchmarking:increment_balance 1,024 7,450
Token:_increase_public_balance 10.3 (-2%) 8,960
FPC:pay_refund_with_shielded_rebate 138 (+1%) 12,663

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.156 (-7%)

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.99 (+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 (+1%) 0.113 (+3%) 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 (+1%) 17.7 31.1 (+1%) 58.6 (-1%) 114 (+1%)
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 (+1%) 0.103 0.101 (+1%) 0.101 (-1%) 0.103 (+2%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.4 (+1%) 25.7 (+1%) 43.7 (+1%) 82.1 (-3%) 162 (+1%)
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.109 (+1%) 0.103 0.102 (-3%) 0.102 (-3%) 0.102 (+1%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.5 (+1%) 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.107 (+2%) 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,756 668,997

Transaction size based on fee payment method

| Metric | |
| - | |

@sklppy88 sklppy88 force-pushed the ek/feat/add-get-l1-to-l2-message-witness-to-pxe-and-cli branch from 7848b84 to 2f4383a Compare August 20, 2024 07:56
@sklppy88 sklppy88 force-pushed the ek/feat/add-get-l1-to-l2-message-witness-to-pxe-and-cli branch 2 times, most recently from ec0d502 to 158515a Compare August 20, 2024 14:44
@sklppy88 sklppy88 force-pushed the ek/feat/add-get-l1-to-l2-message-witness-to-pxe-and-cli branch from 158515a to aad1faf Compare August 20, 2024 15:22
@sklppy88 sklppy88 force-pushed the ek/feat/add-get-l1-to-l2-message-witness-to-pxe-and-cli branch 2 times, most recently from 7c408e8 to 1a7e48a Compare August 20, 2024 20:11
Base automatically changed from ek/feat/add-get-l1-to-l2-message-witness-to-pxe-and-cli to master August 20, 2024 22:45
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