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

Add possibility to store nodes of the tree (MapStore) #9

Closed
liamsi opened this issue Sep 7, 2020 · 1 comment
Closed

Add possibility to store nodes of the tree (MapStore) #9

liamsi opened this issue Sep 7, 2020 · 1 comment

Comments

@liamsi
Copy link
Member

liamsi commented Sep 7, 2020

Also reuse stored hashes instead of recomputing them each time.

Copying the related review comment here:

There are other changes that we may need to make to the underlying merkletree implementation that may not be mergeable upstream. For example, we should probably change the implementation to store key=>value pairs of nodes in the tree using the same interface as the SMT MapStore, so that we can plug in other MapStores like an IPFS-based one, and reuse the same code: https://github.com/lazyledger/smt-ipfs-mapstore

This is something that needs to be investigated a bit though, as from my understanding the NebulousLabs merkletree library I think may compute the root on demand and doesn't keep around any of the old nodes in memory. Alternatively, it may be possible to implement this MapStore storage functionality within the NMT library, which uses the MapStore as "cache", and only invokes the NebulousLabs merkletree library to recompute roots if the node data is unavailable in the MapStore.

related to: #6

@liamsi
Copy link
Member Author

liamsi commented Feb 9, 2021

#16 is sufficient to store the nodes on IPFS. Will close this one for now. There is another issue about storing the inner nodes in memory here: #17.

@liamsi liamsi closed this as completed Feb 9, 2021
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

1 participant