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.
This PR addresses #155 by adding public values to the definition of the
Chip
trait. The public values are considered as a separate trace, similarly to how preprocessed traces are handled. However, whereas for the preprocessed trace, the indexer commits to trace matrix and the prover provides opening proofs for queries, the verifier computes its own queries against the public trace.When implementing
Air<_, .., AB>
whenAB: AirBuilderWithPublicValues
, we are allowed to address rows of the public trace as with the ordinary trace and preprocessed trace when computing the constraints. The verifier performs polynomial interpolation of the public trace table (which should be short!) to obtain query values corresponding to the public trace columns, and uses these values when testing consistency between the quotient polynomial, the constraint polynomial, and the trace tables.In order to accommodate situations when the public trace is better thought of as a vector (i.e. we have a series of public values that is not indexed by row of the main trace), we implement the
PublicValues
trait forPublicRow
, a wrapper type around an ordinary vector. This treats thePublicRow
as a matrix with the same row repeated the appropriate number of times.The implementations of public values for the relevant Valida chips (namely:
ProgramROM
,StaticData
, andOutput
) are placeholders; they will be filled in in a future PR.