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!: Separate public inputs from proof in acir composer #2618

Closed
wants to merge 45 commits into from

Conversation

kevaundray
Copy link
Contributor

@kevaundray kevaundray commented Oct 2, 2023

Related to #1315

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

@kevaundray
Copy link
Contributor Author

Orthogonal to this, Charlie noted that this PR continues the mix usage of camel case and snake case -- I'll run clang-fix in another PR because I can imagine that changing a lot of files that are unrelated to the topic at hand

@kevaundray
Copy link
Contributor Author

Coming back to this: error is possibly because we are reading the public inputs file when there are no public inputs. read_file has a if size < 0 condition which might be getting triggered

@Savio-Sou
Copy link
Member

Would this resolve #1315 (not just related to)?

@signorecello
Copy link
Contributor

Seems like this has approvals but needs conflict resolution… @kevaundray sorry to tag you again, but as expected we have people at EthOnline dealing with this…

@kevaundray
Copy link
Contributor Author

Seems like this has approvals but needs conflict resolution… @kevaundray sorry to tag you again, but as expected we have people at EthOnline dealing with this…

This should not be affecting people at EthOnline since I changed the interface to uncover any problems here: https://github.com/noir-lang/noir/blob/88682da87ffc9e26da5c9e4b5a4d8e62a6ee43c6/tooling/noir_js_types/src/types.ts#L17

They should receive a ProofData struct and can pull out the public inputs -- is this not the case?

@AztecBot
Copy link
Collaborator

AztecBot commented Oct 12, 2023

Benchmark 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 a3649df0 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,444 179,588 716,132
l1_rollup_calldata_gas 222,996 868,196 3,449,552
l1_rollup_execution_gas 842,083 3,595,304 22,204,921
l2_block_processing_time_in_ms 1,041 (+1%) 3,930 15,472 (-1%)
note_successful_decrypting_time_in_ms 329 (-1%) 1,000 (-3%) 3,885 (+2%)
note_trial_decrypting_time_in_ms ⚠️ 31.0 (-11%) 108 136 (-2%)
l2_block_building_time_in_ms 9,006 35,973 149,303 (-2%)
l2_block_rollup_simulation_time_in_ms 6,685 26,736 105,538 (-1%)
l2_block_public_tx_process_time_in_ms 2,278 (-1%) 9,111 (-2%) 43,121 (-5%)

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,504 (+1%) 31,953 (+2%)
note_history_successful_decrypting_time_in_ms 2,381 (+1%) 4,835 (+2%)
note_history_trial_decrypting_time_in_ms 123 (+2%) 147 (-1%)
node_database_size_in_bytes 1,651,753 1,195,334
pxe_database_size_in_bytes 27,188 54,187

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 43.8 56,577 14,745
private-kernel-ordering 21.3 20,137 8,089
base-rollup 853 631,605 811
root-rollup 38.0 4,072 1,097
private-kernel-inner 36.1 (-1%) 72,288 14,745
public-kernel-private-input 47.3 37,359 14,745
public-kernel-non-first-iteration 28.2 37,401 14,745
merge-rollup 0.928 (+6%) 2,592 873

Comment on lines +64 to +67
// One solution for this, is to have ACIR introduce the concept of a public output
// which would be different to the public input. A public input would be the public values
// which are inputted to the program and the public output would be the public values
// which are returned when the program terminates.
Copy link
Member

Choose a reason for hiding this comment

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

ACIR does have this concept. It calls the first public_parameters and the second return_values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should clarify that this would also be exposed as fields, so we can use it in this file

@ludamad
Copy link
Collaborator

ludamad commented Jan 18, 2024

@kevaundray what happened here?

@ludamad
Copy link
Collaborator

ludamad commented Feb 13, 2024

Closing after talking to Kev, this will be done in a more robust way by crypto team

@ludamad ludamad closed this Feb 13, 2024
@Savio-Sou
Copy link
Member

will be done in a more robust way by crypto team

Is there a soft ETA? (E.g. Next sprint, Q2, etc.)

@ludamad ludamad deleted the kw/separate-public-inputs branch August 22, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants