pub trait CommitmentAccessor<C: Commitment>: MetadataAccessor {
// Required method
fn get_commitment(&self, column: ColumnRef) -> C;
}
Expand description
Access commitments of database columns.
Verifier uses this information to process a query.
In pseudo-code, here is a sketch of how CommitmentAccessor
fits in
with the verification workflow:
verify(proof, query, commitment_database) {
if(!validate_query(query, commitment_database)) {
// if the query references columns that don't exist
// we should error here before going any further
return invalid-query()
}
commitment_database.reader_lock()
// we can't be updating commitments while verifying
accessor <- make-commitment-accessor(commitment_database)
verify_result <- verify-valid-query(proof, query, accessor)
commitment_database.reader_unlock()
return verify_result
}
Note: we assume that the query has already been validated so that we will only be accessing information about columns that exist in the database.
Required Methods§
Sourcefn get_commitment(&self, column: ColumnRef) -> C
fn get_commitment(&self, column: ColumnRef) -> C
Return the full table column commitment
Implementors§
impl<C: Commitment> CommitmentAccessor<C> for QueryCommitments<C>
§Panics
Panics if the commitment for the table or column cannot be found.
impl<CP: CommitmentEvaluationProof> CommitmentAccessor<<CP as CommitmentEvaluationProof>::Commitment> for OwnedTableTestAccessor<'_, CP>
§Panics
Will panic if the column.table_ref()
is not found in self.tables
, or if the column.column_id()
is not found in the inner table for that reference,indicating that an invalid column reference was provided.
impl<CP: CommitmentEvaluationProof> CommitmentAccessor<<CP as CommitmentEvaluationProof>::Commitment> for TableTestAccessor<'_, CP>
§Panics
Will panic if the column.table_ref()
is not found in self.tables
, or if the column.column_id()
is not found in the inner table for that reference,indicating that an invalid column reference was provided.