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

fix: actually start proof verifier #8332

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

alexghr
Copy link
Contributor

@alexghr alexghr commented Sep 2, 2024

Please read contributing guidelines and remove this line.

@alexghr alexghr merged commit 6f180fc into alphanet Sep 2, 2024
3 checks passed
@alexghr alexghr deleted the ag/proof-verifier-extras branch September 2, 2024 16:26
Copy link
Contributor

github-actions bot commented Sep 2, 2024

Changes to circuit sizes

Generated at commit: 184bcfb6dc0a69d4a7c28fb61920ac72fbf49e4e, compared to commit: 63fe954b3e681685a165f678eb68f65edf7ad0d3

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_app_logic -78,229 ✅ -26.56% +1,199,149 ❌ +201.16%
public_kernel_tail -10,135 ✅ -1.01% -11,954 ✅ -0.13%
private_kernel_tail_to_public -440 ✅ -1.17% -76 ✅ -0.13%
private_kernel_inner -1,088 ✅ -2.18% -275 ✅ -0.41%
private_kernel_init -802 ✅ -2.80% -424 ✅ -1.09%
public_kernel_setup -1,725 ✅ -0.80% -38,976 ✅ -2.13%
public_kernel_teardown -77,752 ✅ -26.35% -118,780 ✅ -6.20%
private_kernel_reset -24,458 ✅ -20.89% -45,829 ✅ -8.80%
private_kernel_reset_full_inner -24,459 ✅ -22.21% -45,831 ✅ -9.33%
private_kernel_reset_big -25,226 ✅ -28.80% -36,190 ✅ -12.08%
private_kernel_reset_medium -25,610 ✅ -35.25% -31,369 ✅ -16.63%
private_kernel_reset_small -25,802 ✅ -39.58% -28,959 ✅ -21.75%
private_kernel_reset_tiny -25,898 ✅ -42.14% -27,754 ✅ -26.29%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_app_logic 216,339 (-78,229) -26.56% 1,795,259 (+1,199,149) +201.16%
public_kernel_tail 995,023 (-10,135) -1.01% 9,373,298 (-11,954) -0.13%
private_kernel_tail_to_public 37,122 (-440) -1.17% 57,044 (-76) -0.13%
private_kernel_inner 48,931 (-1,088) -2.18% 66,676 (-275) -0.41%
private_kernel_init 27,819 (-802) -2.80% 38,460 (-424) -1.09%
public_kernel_setup 214,252 (-1,725) -0.80% 1,794,998 (-38,976) -2.13%
public_kernel_teardown 217,364 (-77,752) -26.35% 1,795,982 (-118,780) -6.20%
private_kernel_reset 92,596 (-24,458) -20.89% 474,833 (-45,829) -8.80%
private_kernel_reset_full_inner 85,690 (-24,459) -22.21% 445,153 (-45,831) -9.33%
private_kernel_reset_big 62,353 (-25,226) -28.80% 263,436 (-36,190) -12.08%
private_kernel_reset_medium 47,044 (-25,610) -35.25% 157,219 (-31,369) -16.63%
private_kernel_reset_small 39,387 (-25,802) -39.58% 104,212 (-28,959) -21.75%
private_kernel_reset_tiny 35,560 (-25,898) -42.14% 77,798 (-27,754) -26.29%

@AztecBot
Copy link
Collaborator

AztecBot commented Sep 2, 2024

Benchmark results

Metrics with a significant change:

  • avm_simulation_time_ms (Token:mint_public): 70.4 (+66%)
  • avm_simulation_time_ms (Token:assert_minter_and_mint): 40.4 (-40%)
  • avm_simulation_time_ms (AuthRegistry:set_authorized): 46.5 (+30%)
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,750 1,553 704 773 (+4%) 771 (+1%)
proof_construction_time_sha256_30_ms 11,787 3,178 (+1%) 1,412 (-1%) 1,433 (-1%) 1,462 (-1%)
proof_construction_time_sha256_100_ms 45,210 12,178 (+1%) 5,482 (+1%) 5,486 (+1%) 5,427 (+1%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 59.0 89.0 (+2%)
proof_construction_time_poseidon_hash_30_ms 1,526 422 203 224 (-1%) 267
proof_construction_time_poseidon_hash_100_ms 5,628 1,510 674 (-1%) 721 (-1%) 750

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,708 92,464 177,584
l1_rollup_execution_gas 1,383,149 2,130,873 3,958,032
l2_block_processing_time_in_ms 255 (+2%) 436 (-2%) 817 (-1%)
l2_block_building_time_in_ms 9,098 (-1%) 17,976 35,619
l2_block_rollup_simulation_time_in_ms 9,097 (-1%) 17,976 35,618
l2_block_public_tx_process_time_in_ms 7,688 (-1%) 16,434 34,067

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 2,924 (-3%) 3,743 (-3%)
node_database_size_in_bytes 12,685,392 (+1%) 16,715,856
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
private-kernel-init 96.1 (-1%) 401 (+5%) 21,673 44,858 N/A
private-kernel-inner 162 (-1%) 711 (+3%) 72,309 45,005 N/A
private-kernel-reset-tiny 500 904 (+4%) 65,974 44,844 N/A
private-kernel-tail 207 166 (+3%) 50,728 52,256 N/A
base-parity 5.58 (+1%) N/A 160 96.0 N/A
root-parity 33.4 (+1%) N/A 69,084 96.0 N/A
base-rollup 2,818 N/A 187,817 664 N/A
root-rollup 38.9 (+1%) N/A 54,525 716 N/A
public-kernel-setup 88.1 (+1%) N/A 103,760 71,222 N/A
public-kernel-app-logic 99.1 N/A 103,599 71,222 N/A
public-kernel-tail 576 (+1%) N/A 409,190 16,414 N/A
private-kernel-reset-small 498 (+2%) N/A 66,085 45,629 N/A
private-kernel-tail-to-public 1,064 (-10%) 660 (+4%) 492,960 1,697 N/A
public-kernel-teardown 86.0 N/A 104,005 71,222 N/A
merge-rollup 19.2 N/A 35,742 664 N/A
undefined N/A N/A N/A N/A 65,820 (-1%)

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms
ContractClassRegisterer:register 1,344 11,731 339
ContractInstanceDeployer:deploy 1,408 11,731 18.4
MultiCallEntrypoint:entrypoint 1,920 11,731 420
FeeJuice:deploy 1,376 11,731 389 (+1%)
SchnorrAccount:constructor 1,312 11,731 104 (-1%)
SchnorrAccount:entrypoint 2,304 11,731 432 (+1%)
Token:privately_mint_private_note 1,280 11,731 142 (+2%)
FPC:fee_entrypoint_public 1,344 11,731 26.9 (+1%)
Token:transfer 1,312 11,731 282 (+6%)
Benchmarking:create_note 1,344 11,731 103 (+4%)
SchnorrAccount:verify_private_authwit 1,280 11,731 27.5 (-1%)
Token:unshield 1,376 11,731 558 (-2%)
FPC:fee_entrypoint_private 1,376 11,731 759 (-1%)

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 53.7 (+2%) 8,139
FeeJuice:set_portal 10.5 (+11%) 2,362
Token:constructor 79.7 (-3%) 31,107
FPC:constructor 52.8 (-1%) 22,380
FeeJuice:mint_public 38.5 (+2%) 6,150
Token:mint_public ⚠️ 70.4 (+66%) 11,720
Token:assert_minter_and_mint ⚠️ 40.4 (-40%) 8,028
AuthRegistry:set_authorized ⚠️ 46.5 (+30%) 4,537
FPC:prepare_fee 241 (+3%) 8,812
Token:transfer_public 23.1 (-1%) 47,358
FPC:pay_refund 56.5 (+2%) 12,082
Benchmarking:increment_balance 957 7,450
Token:_increase_public_balance 38.3 8,960
FPC:pay_refund_with_shielded_rebate 67.5 12,631

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.158 (-4%)

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.21 (+1%) 3.92 (+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.115 (+2%) 0.111 (+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.8 (+2%) 18.2 (-1%) 33.0 (+6%) 59.4 (-1%) 113
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.114 (+2%) 0.106 (-1%) 0.107 (+7%) 0.102 (-1%) 0.103 (+2%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.5 26.2 44.5 (+2%) 83.0 (-1%) 165 (+2%)
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.111 0.106 (-1%) 0.108 (+2%) 0.103 (-1%) 0.105 (+4%)
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.5 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.106 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,779 668,997

Transaction size based on fee payment method

| Metric | |
| - | |

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