Skip to content

fix: set z_perm and lookup_inverses for proving key in ECCVM and Translator - #5558

Closed
lucasxia01 wants to merge 1 commit into
masterfrom
lx/fix-uninit-polys
Closed

lucasxia01 wants to merge 1 commit into
masterfrom
lx/fix-uninit-polys

Conversation

@lucasxia01

Copy link
Copy Markdown
Contributor

Please read contributing guidelines and remove this line.

@lucasxia01 lucasxia01 self-assigned this Apr 3, 2024
@AztecBot

AztecBot commented Apr 3, 2024

Copy link
Copy Markdown
Collaborator

Benchmark results

No metrics with a significant change found.

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 eb73d20e 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,424 6,424
l1_rollup_execution_gas 585,745 585,757 585,757
l2_block_processing_time_in_ms 1,305 4,633 (-3%) 8,927 (-4%)
note_successful_decrypting_time_in_ms 224 (-7%) 570 (+1%) 1,009 (-6%)
note_trial_decrypting_time_in_ms 28.3 (-39%) 78.0 (+7%) 27.5 (-18%)
l2_block_building_time_in_ms 11,649 (-2%) 42,518 (-3%) 85,060
l2_block_rollup_simulation_time_in_ms 6,958 (-2%) 24,094 (-3%) 47,948 (+1%)
l2_block_public_tx_process_time_in_ms 4,655 (-2%) 18,297 (-3%) 36,879 (-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,719 (+3%) 27,576 (+1%)
note_history_successful_decrypting_time_in_ms 1,333 2,639 (+12%)
note_history_trial_decrypting_time_in_ms 46.2 (-61%) 146 (+28%)
node_database_size_in_bytes 18,587,728 35,037,264
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 180 (-1%) 44,379 26,164
private-kernel-ordering 162 (-1%) 50,830 39,325
base-parity 4,362 (+5%) 128 311
root-parity 1,185 (+3%) 1,244 311
base-rollup 14,451 (-1%) 116,608 861
root-rollup 49.4 4,359 725
private-kernel-inner 219 (-1%) 71,745 26,164
public-kernel-app-logic 119 (-2%) 47,696 40,661
public-kernel-tail 162 (-1%) 53,372 13,269
merge-rollup 10.1 (+8%) 2,568 861
public-kernel-teardown 118 (+2%) 47,696 40,661
public-kernel-setup 117 (+2%) 47,696 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 9.99 16.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.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.581 (-1%) 0.494 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 46.9 (-2%) 71.8 (-2%) 225 (-3%) 449 848 (-4%) 1,698 (-3%) 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.480 (-2%) 0.441 (-2%) 0.410 (-3%) 0.419 0.403 (-4%) 0.405 (-3%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 55.4 (+1%) 106 (-2%) 334 (-1%) 669 1,285 (-4%) 2,575 (-2%) 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.486 (+1%) 0.478 (-1%) 0.453 (-1%) 0.460 0.443 (-4%) 0.445 (-3%) 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.6
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.536 (-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 40,549 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,725 (-2%) 1,090 (-1%) 5,491 (+1%)
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 576 (-1%) 461 (+7%) 1,076 (+1%) 590 (-3%) 1,765 (+1%) 595 (+1%)

@ludamad

ludamad commented Apr 3, 2024

Copy link
Copy Markdown
Contributor

Just running msan on this to see if we progress

@ledwards2225

Copy link
Copy Markdown
Contributor

I don't have full context here but is it clear why any of the tests were passing prior to this fix?

@lucasxia01

Copy link
Copy Markdown
Contributor Author

I don't have full context here but is it clear why any of the tests were passing prior to this fix?

Not sure. I think it would be useful to look into though.

@ledwards2225

Copy link
Copy Markdown
Contributor

@lucas Ok so turns out the additions in this PR are redundant (and in the case of z_perm, doubly redundant). In the constructor, the prover polys and pkey polys are linked via share(), so for example when prover_polynomials.lookup_inverses is populated, the key version is updated automatically since they point to the same coefficients in memory. Same goes for z_perm. (Actually compute_permutation_grand_products also explicitly sets these two equal to each other so its already done a second time unnecessarily).

@ledwards2225

Copy link
Copy Markdown
Contributor

Turns out this wasn't needed. See #5681

@ludamad
ludamad deleted the lx/fix-uninit-polys branch August 22, 2024 15:20
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.

5 participants