Skip to content

feat: pass note as argument#4395

Closed
LHerskind wants to merge 1 commit intomasterfrom
lh/note-arg
Closed

feat: pass note as argument#4395
LHerskind wants to merge 1 commit intomasterfrom
lh/note-arg

Conversation

@LHerskind
Copy link
Contributor

@LHerskind LHerskind commented Feb 2, 2024

This pr is targeting to implement an example of passing a note in as an argument.

It is currently experience some issues. It can pass the note, but the header seems to invalidly populated. Part of it (the contract_address and storage_slot) are populated as expected, but the nonce and is_transient values does not make sense.

It does not fail the args_hash check, so it is unclear where exactly the issue is, but the values are not as expected. The initial witness and packed values both looked fine.

EDIT:
Figured the issue. The singleton::get_note is NOT returning the note in state, but instead the note that it is inserting to replace it. This means that the nonce have not yet been set and that the note is transient when checking, making it fail. If the test is done with

Copy link
Contributor Author

LHerskind commented Feb 2, 2024

@AztecBot
Copy link
Collaborator

AztecBot commented Feb 2, 2024

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 14dd0b88 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 128 txs
l1_rollup_calldata_size_in_bytes 45,636 180,516 720,036
l1_rollup_calldata_gas 222,432 871,104 3,465,804
l1_rollup_execution_gas 314,919 988,844 3,685,461
l2_block_processing_time_in_ms 1,165 (+1%) 4,363 (+1%) 17,266
note_successful_decrypting_time_in_ms 307 976 (+2%) 3,711 (+2%)
note_trial_decrypting_time_in_ms 19.8 (+22%) 110 (+24%) 146 (-1%)
l2_block_building_time_in_ms 17,832 (+1%) 70,090 281,901
l2_block_rollup_simulation_time_in_ms 13,060 51,579 207,963
l2_block_public_tx_process_time_in_ms 4,721 (+2%) 18,438 73,693

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 13,783 (-10%) 26,395 (-10%)
note_history_successful_decrypting_time_in_ms 2,551 (+8%) 4,907 (+7%)
note_history_trial_decrypting_time_in_ms 112 (-55%) 197 (-10%)
node_database_size_in_bytes 17,416,272 (+1%) 33,050,704
pxe_database_size_in_bytes 29,923 59,478

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 310 44,481 26,193
private-kernel-ordering 194 (+1%) 44,513 14,929
base-rollup 1,405 128,970 881
root-rollup 82.9 (+1%) 4,088 677
private-kernel-inner 416 71,640 26,193
public-kernel-private-input 240 32,615 26,193
public-kernel-non-first-iteration 239 32,657 26,193
merge-rollup 7.70 (+1%) 2,608 881

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 2 leaves 8 leaves 16 leaves 32 leaves 128 leaves 64 leaves 512 leaves 1024 leaves 2048 leaves 8192 leaves
batch_insert_into_append_only_tree_16_depth_ms 10.2 10.7 (-3%) 12.7 17.1 (+1%) 23.1 (+1%) 63.9 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.9 17.5 23.0 31.6 47.0 143 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.594 0.595 (-3%) 0.541 0.527 (+1%) 0.482 (+1%) 0.441 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A N/A N/A N/A 74.6 (+1%) 47.5 241 (+1%) 462 904 (+1%) 3,560 (+1%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A N/A N/A N/A 159 96.0 543 1,055 2,079 8,223
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A N/A N/A N/A 0.461 0.487 0.440 (+1%) 0.432 0.429 (+1%) 0.428
batch_insert_into_indexed_tree_20_depth_ms N/A N/A N/A N/A N/A 103 56.9 350 (+1%) 691 1,367 (+1%) 5,409
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A N/A N/A N/A 197 104 691 1,363 2,707 10,771
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A N/A N/A N/A 0.492 0.496 0.477 (+1%) 0.474 0.473 (+1%) 0.471
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A 56.6 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A 94.1 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A 0.577 N/A N/A N/A N/A N/A N/A N/A

Miscellaneous

Transaction sizes based on how many contracts are deployed in the tx.

Metric 0 deployed contracts 1 deployed contracts
tx_size_in_bytes 15,575 37,974

Transaction processing duration by data writes.

Metric 0 new commitments 1 new commitments
tx_pxe_processing_time_ms 548 1,226
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 0.521 (+1%) 573

Base automatically changed from lh/note_content_serialize to master February 5, 2024 10:19
@LHerskind
Copy link
Contributor Author

Figured the issue. The singleton::get_note is NOT returning the note in state, but instead the note that it is inserting to replace it. This means that the nonce have not yet been set and that the note is transient when checking, making it fail. If the test is done with

@LHerskind LHerskind closed this Feb 12, 2024
@ludamad ludamad deleted the lh/note-arg branch August 22, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants