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

[Storehouse - Bootstrap] Refactor checkpoint reader with WithFile #4815

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

zhangchiqing
Copy link
Member

@zhangchiqing zhangchiqing commented Oct 13, 2023

This PR extracts a withFile function to be used for handling file opening and closing when reading checkpoint files.

Addressing review comment from #4811 (comment)

if err != nil {
return fmt.Errorf("cannot read sub trie node count: %w", err)
}
nodesCount, expectedSum, err := readSubTriesFooter(f)
Copy link
Member Author

@zhangchiqing zhangchiqing Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to review these changes with "Hide Whitespace" option on:

image

if err != nil {
return fmt.Errorf("cannot read sub trie node count: %w", err)
}
nodesCount, expectedSum, err := readSubTriesFooter(f)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to review these changes with "Hide Whitespace" option on

@@ -738,3 +738,24 @@ func closeAndMergeError(closable io.Closer, err error) error {

return merr.ErrorOrNil()
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a comment explaining what it does?

Base automatically changed from leo/read-trie-root-hash-from-checkpoint to master October 16, 2023 21:16
@zhangchiqing zhangchiqing added this pull request to the merge queue Oct 17, 2023
Merged via the queue into master with commit d953312 Oct 17, 2023
35 of 36 checks passed
@zhangchiqing zhangchiqing deleted the leo/with-file branch October 17, 2023 17:17
@zhangchiqing zhangchiqing changed the title Refactor checkpoint reader with WithFile [Storehouse - Bootstrap] Refactor checkpoint reader with WithFile Oct 27, 2023
This pull request was closed.
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