Documentation
¶
Overview ¶
Package validate walks the parent edges of a tapes store and reports DAG integrity problems: cycles (which cause Ancestry() to loop forever) and dangling parent references (parents pointing at nodes that no longer exist).
The check is intentionally structured around ParentRef tuples rather than full merkle.Node values so it stays cheap on large stores — the ent driver implementation projects only the hash and parent_hash columns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Report ¶
type Report struct {
// TotalNodes is the number of nodes considered by the check.
TotalNodes int
// Roots is the number of nodes whose parent_hash is NULL.
Roots int
// Cycles holds one entry per detected cycle. Each entry lists the
// hashes that form the cycle, in traversal order, with the repeated
// hash appended at the end so callers can render it as A → B → A.
Cycles [][]string
// Dangling holds nodes whose parent_hash points at a hash not present
// in the store.
Dangling []Dangling
}
Report summarizes the outcome of a store integrity check.
func Check ¶
Check runs the integrity check against the given lister and returns a Report. The lister must return every (hash, parent_hash) tuple in the store; it is expected to be implemented via storage.ParentRefLister.