-
Notifications
You must be signed in to change notification settings - Fork 94
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
Support Omitted Blocks #98
Conversation
Pull Request Test Coverage Report for Build 3382
💛 - Coveralls |
@@ -49,7 +49,7 @@ func (h *ReconcilerHelper) BlockExists( | |||
ctx context.Context, | |||
block *types.BlockIdentifier, | |||
) (bool, error) { | |||
_, err := h.blockStorage.GetBlock(ctx, block) | |||
_, err := h.blockStorage.GetBlock(ctx, types.ConstructPartialBlockIdentifier(block)) | |||
if err == nil { |
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.
nit: feels like it's more idiomatic to evaluate if err != nil
first
_, err := h.blockStorage.GetBlock(ctx, types.ConstructPartialBlockIdentifier(block))
if err != nil {
if errors.Is(err, storage.ErrBlockNotFound) {
return false, nil
}
return false, err
}
return true, nil
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.
Although I agree it is more idiomatic to do if err != nil
first, I think it is more preferable to avoid nesting conditionals.
Blocked by: coinbase/mesh-sdk-go#91
This PR adds support for storing omitted blocks and for querying blocks by only index or only hash (previously had to provide both block hash and index).
Warning
This PR changes how data is persisted to storage. When you upgrade, you will need to delete any cache you were using previously.
Changes
syncer
to support omitted blocks (Support Omitted Blocks mesh-sdk-go#91)