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

Support recursive public function calls #430

Closed
spalladino opened this issue May 2, 2023 · 2 comments · Fixed by #533
Closed

Support recursive public function calls #430

spalladino opened this issue May 2, 2023 · 2 comments · Fixed by #533
Assignees

Comments

@spalladino
Copy link
Collaborator

spalladino commented May 2, 2023

At the moment, the sequencer only executes the topmost call stack item for a public function. We should keep running until we exhaust the call stack, similar to how the private kernel circuit works.

@spalladino spalladino added this to A3 May 2, 2023
@spalladino spalladino converted this from a draft issue May 2, 2023
@iAmMichaelConnor
Copy link
Contributor

Make sure to chat with @sirasistant who worked on private nested function calls a few weeks ago. :)

Edge case:

  • If, during execution of a tx, some function (fn A) is called more than once, then the same public state could be read / written-to more than once. The public kernel circuit will need to handle this, by identifying and removing duplicate state reads/transitions from its call stack. I think we chatted about this last week. It was a fiddly problem for private calls, but I think you've already solved it for public calls.

@spalladino
Copy link
Collaborator Author

@iAmMichaelConnor spoke with him earlier today. This seems to be very similar to how private nested functions call indeed, we'll just need to add an extra oracle call and process the call stack items in the sequencer.

However, calling from private to public may be a bit more interesting, since it requires changing the Tx object. I created a new issue to discuss that: #447.

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 a pull request may close this issue.

2 participants