-
Notifications
You must be signed in to change notification settings - Fork 180
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
[Util] Find block ID by state commitment #5240
Conversation
@@ -65,6 +66,7 @@ func addCommands() { | |||
rootCmd.AddCommand(extract.Cmd) | |||
rootCmd.AddCommand(export.Cmd) | |||
rootCmd.AddCommand(checkpoint_list_tries.Cmd) | |||
rootCmd.AddCommand(checkpoint_trie_stats.Cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds the checkpoint trie stats to the util, which is useful to read the trie root hashes of a checkpoint file without reading the entire checkpoint file.
3b5e1e7
to
88a1928
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5240 +/- ##
==========================================
- Coverage 58.56% 55.56% -3.00%
==========================================
Files 899 995 +96
Lines 85536 95297 +9761
==========================================
+ Hits 50097 52955 +2858
- Misses 31743 38365 +6622
- Partials 3696 3977 +281
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8858b71
to
028ff6a
Compare
5f590aa
to
6326600
Compare
Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
6326600
to
f9bf295
Compare
This PR adds a command to util to find block ID by state commitment within a height range.
This is useful to know which block is the checkpoint for.
When recovering an execution node to an old state, we need to know which block is the checkpoint file for. The checkpoint file contains tries with state commitments as trie root hashes. However, the checkpoint file doesn't contain block information, it's difficult to know which blocks are the state commitments for. With this util command, we can specify a height range, and look up the block ID for a list of state commitments we read from the checkpoint file