Open masih opened 2 years ago
So the selector becomes a transform that can turn a DAG into a simple "depth" integer? Perhaps this could be implemented as an ADL, so interpretAs
a depth-finder
ADL that transforms an arbitrary DAG into an Int
node.
Understanding the shape of a DAG without having to download it is extremely beneficial in cases where the DAG is too large and or the transport of the entire DAG is too time-consuming. This is specifically true for blockchain-like DAGs that have a single link to previous, e.g. Network Indexer advertisement chain. For example, such a selector would allow storetheindex to efficiently estimate how far behind it is in processing advertisements of a provider without having to download the entire chain first.
Add the ability to get the depth of a DAG, recursing an edge from some given root with optional stop node.