docs(trie): revealed sparse trie invariants (#11825)

This commit is contained in:
Roman Krasiuk
2024-10-17 10:03:25 +02:00
committed by GitHub
parent e828b34ed1
commit e3e83b7e71

View File

@@ -69,6 +69,13 @@ impl SparseTrie {
}
/// The representation of revealed sparse trie.
///
/// ## Invariants
///
/// - The root node is always present in `nodes` collection.
/// - Each leaf entry in `nodes` collection must have a corresponding entry in `values` collection.
/// The opposite is also true.
/// - All keys in `values` collection are full leaf paths.
#[derive(PartialEq, Eq)]
pub struct RevealedSparseTrie {
/// All trie nodes.