chore: Oink takes directly populates an instance #8170
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Oink can be thought of as an "instance completer", i.e. when it is done running all of the data that comprises an instance has been created. Up until now the model was to pass oink a reference to a proving key. It would "complete" the proving key in place by populating some witness polynomials then explicitly return the rest of the data comprising an instance (relation_parameters etc.) in a custom struct like
OinkOutput
. The data from this output would then be std::move'd into an instance existing in the external scope.This PR simplifies this model by simply passing oink an instance (ProverInstance or VerifierInstance) which is "completed" in place throughout oink. IMO this is cleaner and clearer than the half-and-half approach of completing the proving key in place and explicitly returning other data. It also removes a ton of boilerplate for moving data in and out of an instance. I don't love the "input parameter treated as output parameter approach" but unless we refactor Honk/PG to construct proving_key instead of an instance, I think this is preferred. (In that case oink could take a proving_key and return a completed instance).