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

Notes created in public setup/teardown phases break notes created in private #4958

Closed
Tracked by #4998
alexghr opened this issue Mar 5, 2024 · 0 comments · Fixed by #5129
Closed
Tracked by #4998

Notes created in public setup/teardown phases break notes created in private #4958

alexghr opened this issue Mar 5, 2024 · 0 comments · Fixed by #5129
Assignees

Comments

@alexghr
Copy link
Contributor

alexghr commented Mar 5, 2024

Currently notes created in the setup or teardown phases are tracked as "non revertible" by the public kernel and when the two accumulator get recombined for the base rollup note hashes get mixed up (i.e. a note created in teardown will become the first note hash in the recombined array). This breaks note hashing because in private notes are hashed with a nonce derived from their location in the notes hash array.

@github-project-automation github-project-automation bot moved this to Todo in A3 Mar 5, 2024
@alexghr alexghr self-assigned this Mar 6, 2024
@just-mitch just-mitch added this to the ITN - Fees milestone Mar 6, 2024
alexghr added a commit that referenced this issue Mar 13, 2024
This PR adds start/end side effect counters to private & public context
inputs.

This solves #4958 by assigning the correct side effect counters to notes
created in setup/teardown so that when they're recombined into a single
array they can be sorted in order of creation. A few e2e tests were also
added to validate the change.

Next steps:
- track public storage reads and writes as side effects in Noir
(currently done in parallel, in TS)
- validate a call's side effects are in between its start and end
counters in the private and kernels
- when calling a public function, the public context should update its
`context.side_effect_counter` to the called function's
`end_side_effect_counter + 1` (just like the private context)
- rename `call_context.side_effect_counter` to just
`call_context.counter`

Fix #4958 
Fix #5185
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Mar 13, 2024
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 a pull request may close this issue.

2 participants