-
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
[Storehouse - Bootstrap] Validate checkpoint root hash #4825
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4825 +/- ##
==========================================
- Coverage 55.81% 54.99% -0.82%
==========================================
Files 938 876 -62
Lines 87074 82124 -4950
==========================================
- Hits 48597 45165 -3432
+ Misses 34804 33513 -1291
+ Partials 3673 3446 -227
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
looks good.
cmd/execution_builder.go
Outdated
@@ -1114,6 +1114,30 @@ func (exeNode *ExecutionNode) LoadGrpcServer( | |||
), nil | |||
} | |||
|
|||
func validateCheckpointRootHash(logger zerolog.Logger, bootstrapDir, filename string, expectedCommit flow.StateCommitment) error { |
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.
We'll need this on ANs too. can this go somewhere the AN bootstrap could access?
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.
I refactored in CheckpointHasRoot so that AN can reuse it
9fd5c32
to
6844f8f
Compare
[]*node.Node{ns[0], ns[1]}, | ||
[]*node.Node{ns[2]}, |
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.
Fix linting
Co-authored-by: Peter Argue <89119817+peterargue@users.noreply.github.com>
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.
looks good. I got this working along with my changes in #4830 on localnet
This PR added a
CheckpointHasRootHash
to be used by both AN and EN for validating that the trie hash of the root checkpoint matches with the sealed state commitment.It is useful that when bootstrapping AN or EN with pebble based register store, the checkpoint to import into pebble is matches with the root seal. We can now check using the
CheckpointHasRootHash
method.