Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate more efficient storage and access of Indexed Merkle Tree snapshots #3535

Open
alexghr opened this issue Dec 4, 2023 · 1 comment

Comments

@alexghr
Copy link
Contributor

alexghr commented Dec 4, 2023

In #3468 and #3504 we've added tree snapshots to access historical data in contracts. The snapshots for an indexed tree store a copy of the tree structure at every snapshots point (basically every block). This does produce a valid snapshot but it is not very space-efficient because the tree leaves are modified on every insert (in order to maintain the sorted linked-list).

Look for a more efficient way of storing this data, potentially trading off storage needs for more hashing needs when accessing historical data (e.g. like we did for append only trees).

Also consider adding indexes so that queries regarding historical leaves are answered efficiently.

@sirasistant
Copy link
Contributor

Also consider adding indexes so that queries regarding historical leaves are answered efficiently.

In the case of indexed trees we'd need an efficient way (akin of the standard_indexed_tree implementation done in https://github.com/AztecProtocol/aztec-packages/pull/3530/files#diff-035dc3bdb3ff63fe6f604fa8895674ecf6673c3f330af5caf4b1bee34543aecfR133) to resolve findIndexOfPreviousKey

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

No branches or pull requests

2 participants