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: Goblin recursive verifier #6753

Closed
wants to merge 5 commits into from
Closed

Conversation

ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented May 29, 2024

Introduces a Goblin recursive verifier with independent tests. This is a building block for the ClientIvc recursive verifier.

@ledwards2225 ledwards2225 self-assigned this May 29, 2024
Copy link
Collaborator

@AztecBot AztecBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: f6ee81b Previous: 2c8fc27 Ratio
nativeconstruct_proof_ultrahonk_power_of_2/20 5512.017666000005 ms/iter 5137.768213000001 ms/iter 1.07

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ludamad @codygunton

@maramihali maramihali self-assigned this May 30, 2024
@maramihali maramihali added the crypto cryptography label May 30, 2024
@AztecBot
Copy link
Collaborator

AztecBot commented May 30, 2024

Benchmark results

Metrics with a significant change:

  • app_circuit_witness_generation_time_in_ms (FPC:fee_entrypoint_public): 226 (-78%)
  • protocol_circuit_simulation_time_in_ms (base-rollup): 742 (-92%)
  • protocol_circuit_witness_generation_time_in_ms (base-parity): 1,261 (+19%)
  • protocol_circuit_witness_generation_time_in_ms (public-kernel-app-logic): 3,095 (-16%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail): 35,698 (-31%)
  • l2_block_public_tx_process_time_in_ms (8): 24,935 (-34%)
  • l2_block_public_tx_process_time_in_ms (32): 103,896 (-38%)
  • l2_block_public_tx_process_time_in_ms (64): 212,363 (-38%)
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,737 (+4%) 1,568 (+1%) 700 (+2%) 754 (+4%) 779 (+4%)
proof_construction_time_sha256_30_ms 11,776 (+7%) 3,149 (+2%) 1,411 (+6%) 1,452 (+5%) 1,479 (+4%)
proof_construction_time_sha256_100_ms 43,911 (+4%) 11,763 (+3%) 5,416 (+2%) 5,379 (+2%) 5,331 (+2%)
proof_construction_time_poseidon_hash_ms 78.0 (+3%) 34.0 34.0 (+3%) 58.0 (+5%) 88.0 (+4%)
proof_construction_time_poseidon_hash_30_ms 1,522 (+4%) 418 (+4%) 202 (+3%) 227 269 (+2%)
proof_construction_time_poseidon_hash_100_ms 5,740 (+3%) 1,569 (+3%) 726 (+3%) 763 (+2%) 791 (+3%)

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 1,412 1,412 1,412
l1_rollup_calldata_gas 9,440 9,476 9,476
l1_rollup_execution_gas 616,081 616,117 616,117
l2_block_processing_time_in_ms 1,283 4,795 9,537
l2_block_building_time_in_ms 46,281 (+6%) 182,992 (+6%) 365,559 (+6%)
l2_block_rollup_simulation_time_in_ms 46,100 (+6%) 182,322 (+6%) 364,228 (+6%)
l2_block_public_tx_process_time_in_ms ⚠️ 24,935 (-34%) ⚠️ 103,896 (-38%) ⚠️ 212,363 (-38%)

L2 chain processing

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

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 9,486 (+1%) 14,408
node_database_size_in_bytes 14,504,016 21,377,104
pxe_database_size_in_bytes 18,071 29,868

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 136 (+1%) 497 (+4%) 13,303 (+2%) 20,630 64,614 89,536 2,731 524,288
private-kernel-inner 408 (+1%) 995 (-7%) 42,518 (-14%) 92,318 64,614 89,536 2,731 2,097,152
private-kernel-tail 583 2,800 (+5%) ⚠️ 35,698 (-31%) 96,541 77,732 11,648 297 2,097,152
base-parity 6.58 (+2%) ⚠️ 1,261 (+19%) 2,914 (+2%) 128 64.0 2,208 2.00 131,072
root-parity 49.9 73.5 (+14%) 44,691 (+10%) 27,084 64.0 2,720 18.0 2,097,152
base-rollup ⚠️ 742 (-92%) 2,292 (-6%) 74,892 (-4%) 119,734 756 3,648 47.0 4,194,304
root-rollup 112 (+3%) 63.7 (-20%) 20,056 (-14%) 25,297 620 3,456 41.0 1,048,576
public-kernel-app-logic 538 (-5%) ⚠️ 3,095 (-16%) 48,065 (+6%) 105,253 (-3%) 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,126 (+1%) 24,017 (-3%) 154,757 (-15%) 401,002 (-1%) 7,646 11,648 297 8,388,608
private-kernel-reset-small 590 (+1%) 2,062 (+5%) 45,459 (-2%) 120,733 64,614 89,536 2,731 2,097,152
merge-rollup 28.8 (-4%) N/A N/A 16,534 756 N/A N/A N/A
public-kernel-setup 644 (-3%) N/A N/A 105,253 (-3%) 86,550 N/A N/A N/A
public-kernel-teardown 544 (-6%) N/A N/A 105,253 (-3%) 86,550 N/A N/A N/A
private-kernel-tail-to-public N/A 8,584 (-2%) 93,031 (-5%) 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 466 N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 42.2 (+3%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,713 (-3%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,463 (+3%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,625 (-4%) 16,768 49,369 (-10%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,631 (+4%) N/A N/A N/A N/A
Token:transfer 1,376 9,944 5,003 (-6%) 16,768 54,350 (+3%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,405 (+1%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 ⚠️ 226 (-78%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 77.5 N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,713 (-6%) N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,630 (-4%) 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 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.5 17.0 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.7 31.8 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.608 0.521 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 48.8 (+1%) 76.0 245 474 928 1,837 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 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.499 (+1%) 0.469 0.445 0.442 0.440 0.438 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 58.3 113 (+1%) 355 696 1,384 2,756 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 106 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.504 0.504 (+1%) 0.481 0.478 0.478 0.478 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 62.5
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 107
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.554

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 84,050 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@ledwards2225
Copy link
Contributor Author

Outdated / superseded by #6778

@codygunton codygunton deleted the lde/gob_rec_verifier branch September 14, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto cryptography
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants