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

Unused emitted_events and return_values in Private Kernel Circuit? #689

Closed
suyash67 opened this issue May 25, 2023 · 2 comments
Closed

Unused emitted_events and return_values in Private Kernel Circuit? #689

suyash67 opened this issue May 25, 2023 · 2 comments
Labels
C-protocol-circuits Component: Protocol circuits (kernel & rollup) T-question Type: Someone is asking a questions about something

Comments

@suyash67
Copy link
Contributor

We have emitted_events and return_values as a part of the PrivateCircuitPublicInputs:

std::array<fr, RETURN_VALUES_LENGTH> return_values = zero_array<fr, RETURN_VALUES_LENGTH>();
std::array<fr, EMITTED_EVENTS_LENGTH> emitted_events = zero_array<fr, EMITTED_EVENTS_LENGTH>();

The emitted_events are probably copied over to the OptionallyRevealedData struct in the PKC but the return_values aren't. Need to check if this a bug.

end.optionally_revealed_data = start.optionally_revealed_data;

std::array<fr, EMITTED_EVENTS_LENGTH> emitted_events = zero_array<fr, EMITTED_EVENTS_LENGTH>();

@suyash67 suyash67 added T-question Type: Someone is asking a questions about something C-protocol-circuits Component: Protocol circuits (kernel & rollup) labels May 25, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 May 25, 2023
@benesjan
Copy link
Contributor

emitted_events will be replaced in this PR.

@benesjan
Copy link
Contributor

benesjan commented Jun 5, 2023

The return values are being used as described by Mike on slack so this issue can be closed.

Mike's response on slack:

The return values of a private function call should be constrained by the private kernel circuit. At the very least, they’re the public inputs of the ‘private call’ proof which will be verified by the kernel circuit (when we do proper, non-simulated proofs).
I think the return values are also implicitly checked to be consistent (between the function making the call, and the called function) due to the fact the public inputs (which include the return values) are included in the call stack item hashes, which are pushed to the call stack in one kernel iteration, and then popped from the call stack in a later iteration.

@benesjan benesjan closed this as completed Jun 5, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Jun 5, 2023
@iAmMichaelConnor iAmMichaelConnor removed this from A3 Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-protocol-circuits Component: Protocol circuits (kernel & rollup) T-question Type: Someone is asking a questions about something
Projects
None yet
Development

No branches or pull requests

2 participants