Trait CommitmentAccessor

Source
pub trait CommitmentAccessor<C: Commitment>: MetadataAccessor {
    // Required method
    fn get_commitment(&self, table_ref: &TableRef, column_id: &Ident) -> 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§

Source

fn get_commitment(&self, table_ref: &TableRef, column_id: &Ident) -> C

Return the full table column commitment

Implementors§

Source§

impl<C: Commitment> CommitmentAccessor<C> for QueryCommitments<C>

§Panics

Panics if the commitment for the table or column cannot be found.

Source§

impl<CP: CommitmentEvaluationProof> CommitmentAccessor<<CP as CommitmentEvaluationProof>::Commitment> for OwnedTableTestAccessor<'_, CP>

§Panics

Will panic if the table_ref is not found in self.tables, or if the column_id is not found in the inner table for that reference,indicating that an invalid column reference was provided.

Source§

impl<CP: CommitmentEvaluationProof> CommitmentAccessor<<CP as CommitmentEvaluationProof>::Commitment> for TableTestAccessor<'_, CP>

§Panics

Will panic if the table_ref is not found in self.tables, or if the column_id is not found in the inner table for that reference,indicating that an invalid column reference was provided.