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

feat: load root from store #32

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Conversation

quake
Copy link
Member

@quake quake commented Oct 27, 2022

In the current code we need to store the root in an extra place in order to build the tree from the store, for example:

  1. https://github.com/godwokenrises/godwoken/blob/ad898e7a9821df3e627737d32865bec85bf1a753/crates/store/src/mem_pool_state.rs#L105-L112

  2. https://github.com/quake/smt-rocksdb-store/blob/d265fbddbf26c7808619d3a21d5a8d9f66d31c56/examples/rpc_server_multi_tree.rs#L93-L96

But actually the root can be loaded and computed automatically by loading store root branch, this PR added a new fn new_with_store to resolve this issue

@quake quake requested review from jjyr and TheWaWaR October 27, 2022 12:21
@quake quake merged commit 0c76bbe into nervosnetwork:master Oct 28, 2022
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.

3 participants