Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

feat!: Return entire unresolved Brillig opcode during oracle pause #194

Merged
merged 2 commits into from
Apr 13, 2023

Conversation

vezenovm
Copy link
Contributor

Related issue(s)

Resolves (link to issue)

Description

The ACVM pauses due to needing oracle outputs. When this was a singular opcode it was fine to simply return this oracle and then the ACVM caller can easily construct the new list of opcodes to be resolved. With Brillig we need the inputs and outputs of the brillig VM itself in order to process the opcode correctly. This PR adds the Brillig opcode as an unresolved opcode when we hit a Brillig oracle pause. This lets the ACVM caller to alter the brillig opcode without knowing or interacting with the encapsulating Brillig opcode's inputs and outputs.

Summary of changes

(Describe the changes in this PR. Point out breaking changes if any.)

Dependency additions / changes

(If applicable.)

Test additions / changes

(If applicable.)

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Additional context

(If applicable.)

@joss-aztec
Copy link
Contributor

I see your test assumes that the brillig opcode will be at the front of unresolved_opcodes, but that's not actually a guarantee right? E.g. solve might have first skipped some incomplete arithmetic expression. I think it would be better if the brillig oracle and brillig parent opcode were surfaced as a pair. (This would also help to disambiguate the relation supposing that the inner for loop happened to hit two separate brillig bytecodes containing oracles in the same sweep of opcode_to_solve.)

@joss-aztec joss-aztec merged commit 6e1b9f7 into kw/bytecode-vm Apr 13, 2023
@joss-aztec joss-aztec deleted the mv/return-unres-brillig branch April 13, 2023 10:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants