Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Jul 9, 2024
1 parent 0b09f9f commit 9dba1da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions grovedb/src/operations/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ use crate::operations::proof::util::{element_hex_to_ascii, hex_to_ascii};

#[derive(Debug, Clone, Copy, Encode, Decode)]
pub struct ProveOptions {
/// This tells the proof system to decrease the available limit of the query
/// by 1 in the case of empty subtrees. Generally this should be set to
/// true. The case where this could be set to false is if there is a
/// known structure where we know that there are only a few empty
/// subtrees.
///
/// !!! Warning !!! Be very careful:
/// If this is set to `false` then you must be sure that the sub queries do
/// not match many trees, Otherwise you could crash the system as the
/// proof system goes through millions of subtrees and eventually runs
/// out of memory
pub decrease_limit_on_empty_sub_query_result: bool,
}

Expand Down
5 changes: 5 additions & 0 deletions merk/src/proofs/query/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ pub fn verify(bytes: &[u8], expected_hash: MerkHash) -> CostResult<Map, Error> {

#[derive(Copy, Clone, Debug)]
pub struct VerifyOptions {
/// When set to true, this will give back absence proofs for any query items
/// that are keys. This means QueryItem::Key(), and not the ranges.
pub absence_proofs_for_non_existing_searched_keys: bool,
/// Verifies that we have all the data. Todo: verify that this works
/// properly
pub verify_proof_succinctness: bool,
/// Should return empty trees in the result?
pub include_empty_trees_in_result: bool,
}

Expand Down

0 comments on commit 9dba1da

Please sign in to comment.