Skip to content

feat(traverse): add iterative memoized DAG traversal - #1222

Open
sneaxhuh wants to merge 1 commit into
ipfs:mainfrom
sneaxhuh:feat/memoized-dag-walk
Open

sneaxhuh wants to merge 1 commit into
ipfs:mainfrom
sneaxhuh:feat/memoized-dag-walk

Conversation

@sneaxhuh

Copy link
Copy Markdown

Problem

Repeated traversals of shared DAGs repeat work. Recursive caching risks deep paths and double-counting overlapping descendants.

Fix

Add an opt-in iterative MemoizedWalker with exact distinct-node aggregation. Existing Traverse behavior is unchanged.

Testing

Traversal tests and Go vet pass, including a 50,000-node chain, randomized DAGs, cache fetch counts, errors, cancellation, and benchmarks.

Companion Kubo PR: ipfs/kubo#11088 (update and CI pending).

@sneaxhuh
sneaxhuh marked this pull request as ready for review October 19, 2026 08:06
@sneaxhuh
sneaxhuh requested a review from a team as a code owner October 19, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant