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

chore: change the handling of sparse note arrays #6574

Closed
wants to merge 1 commit into from

Conversation

nventuro
Copy link
Contributor

Instead of returning a new array with the notes collapsed at the beginning, we instead require that the array returned by the oracle has that shape already. This makes the constrain function not change the value being constrained, which is useful for approaching #6543 via noir-lang/noir#4442.

@nventuro nventuro requested a review from sklppy88 May 21, 2024 19:09
@nventuro nventuro changed the title chore; change the handling of sparse note arrays chore: change the handling of sparse note arrays May 21, 2024
@nventuro nventuro enabled auto-merge (squash) May 21, 2024 19:23
@AztecBot
Copy link
Collaborator

Benchmark results

No base data found for comparison.

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 5,706 1,551 710 782 774

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 772 772 772
l1_rollup_calldata_gas 6,820 6,844 6,856
l1_rollup_execution_gas 587,360 587,384 587,396
l2_block_processing_time_in_ms 1,349 5,068 10,057
l2_block_building_time_in_ms 33,309 132,005 262,790
l2_block_rollup_simulation_time_in_ms 33,128 131,360 261,524
l2_block_public_tx_process_time_in_ms 20,445 83,013 165,279

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 15,147 28,288
node_database_size_in_bytes 21,336,144 38,064,208
pxe_database_size_in_bytes 29,868 59,425

Circuits stats

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

Circuit protocol_circuit_simulation_time_in_ms protocol_circuit_witness_generation_time_in_ms protocol_circuit_proving_time_in_ms protocol_circuit_input_size_in_bytes protocol_circuit_output_size_in_bytes protocol_circuit_proof_size_in_bytes protocol_circuit_num_public_inputs protocol_circuit_size_in_gates
private-kernel-init 158 3,656 21,707 19,985 61,999 86,720 2,643 1,048,576
private-kernel-inner 606 5,142 40,410 89,053 61,999 86,720 2,643 2,097,152
private-kernel-reset-small 576 2,702 23,781 117,961 61,999 86,720 2,643 1,048,576
private-kernel-tail 529 2,847 40,074 86,849 79,454 10,688 267 2,097,152
base-parity 7.56 895 4,373 128 64.0 2,208 2.00 131,072
root-parity 49.6 142 41,433 27,064 64.0 2,720 18.0 2,097,152
base-rollup 786 2,821 43,455 111,158 957 3,136 31.0 2,097,152
root-rollup 93.7 114 8,335 11,518 821 3,456 41.0 524,288
public-kernel-app-logic 244 208 761 96,978 85,095 116,448 3,572 4,096
public-kernel-tail 872 788 1,168 388,207 7,755 10,176 251 512
public-kernel-setup 228 266 901 138,309 85,095 116,448 3,572 4,096
public-kernel-teardown 233 265 1,118 143,320 85,095 116,448 3,572 4,096
merge-rollup 6.50 89.7 1,622 2,760 957 3,136 31.0 65,536
private-kernel-tail-to-public N/A 10,023 73,261 N/A N/A 116,960 3,588 4,194,304

Stats on running time collected for app circuits

Function app_circuit_proof_size_in_bytes app_circuit_proving_time_in_ms app_circuit_size_in_gates app_circuit_num_public_inputs
SchnorrAccount:entrypoint 16,128 49,245 2,097,152 437
Test:emit_nullifier 16,128 2,482 65,536 437
FPC:fee_entrypoint_public 16,128 8,573 524,288 437
FPC:fee_entrypoint_private 16,128 9,113 524,288 437
Token:unshield 16,128 50,261 2,097,152 437
SchnorrAccount:spend_private_authwit 16,128 2,680 131,072 437
Token:transfer 16,128 34,691 2,097,152 437

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 11.3 18.3 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.657 0.563 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 52.4 80.6 263 503 988 1,955 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.536 0.497 0.477 0.470 0.469 0.467 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 62.5 120 377 740 1,471 2,923 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.544 0.538 0.512 0.509 0.509 0.509 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 67.7
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 108
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.593

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,741 673,219

Transaction size based on fee payment method

| Metric | |
| - | |

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 29,392 4,260 98,758
Metric 0 public data writes 1 public data writes 2 public data writes 4 public data writes 8 public data writes
tx_sequencer_processing_time_ms 1,409 2,667 2,083 3,262 1,983

@nventuro
Copy link
Contributor Author

This is apparently a legitimate failure, I'm trying to understand what causes it.

@nventuro
Copy link
Contributor Author

An end-to-end test failed because we're filtering before checking for sparseness. We do want to filter, and because that happens in noir we can't rely on the oracle providing post-filter non-sparse values. So this approach won't work at all - closing this PR.

@nventuro nventuro closed this May 22, 2024
auto-merge was automatically disabled May 22, 2024 16:14

Pull request was closed

@nventuro nventuro deleted the nv/getter-sparse branch May 22, 2024 16:14
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.

3 participants