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] Fix storage snapshot #5107

Merged
merged 6 commits into from
Dec 5, 2023
Merged

Conversation

zhangchiqing
Copy link
Member

@zhangchiqing zhangchiqing commented Dec 5, 2023

This PR fixes an issue in creating the storage snapshot for ingestion engine

@@ -430,8 +430,8 @@ func (e *Engine) executeBlock(
}

snapshot := e.execState.NewStorageSnapshot(*executableBlock.StartState,
executableBlock.ID(),
executableBlock.Block.Header.Height,
executableBlock.Block.Header.ParentID,
Copy link
Member Author

Choose a reason for hiding this comment

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

This was wrong, when executing a block, the storage snapshot should be it's parent block, instead of the block itself, which has not been executed.

@@ -44,3 +45,23 @@ func (r *FinalizedReader) FinalizedBlockIDAtHeight(height uint64) (flow.Identifi
func (r *FinalizedReader) BlockFinalized(h *flow.Header) {
r.lastHeight.Store(h.Height)
}

func (r *FinalizedReader) BlockProcessable(h *flow.Header, qc *flow.QuorumCertificate) {
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure if there is another way to simply.

@zhangchiqing zhangchiqing marked this pull request as ready for review December 5, 2023 00:50
@zhangchiqing zhangchiqing requested review from koko1123, janezpodhostnik and sideninja and removed request for ramtinms December 5, 2023 00:51
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (0c0a54d) 56.33% compared to head (6e5d624) 59.14%.

Files Patch % Lines
module/finalizedreader/finalizedreader.go 20.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5107      +/-   ##
==========================================
+ Coverage   56.33%   59.14%   +2.81%     
==========================================
  Files         960      662     -298     
  Lines       90468    55132   -35336     
==========================================
- Hits        50963    32610   -18353     
+ Misses      35722    20230   -15492     
+ Partials     3783     2292    -1491     
Flag Coverage Δ
unittests 59.14% <20.00%> (+2.81%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@koko1123 koko1123 left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks for the tests!

@zhangchiqing zhangchiqing added this pull request to the merge queue Dec 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 5, 2023
@zhangchiqing zhangchiqing added this pull request to the merge queue Dec 5, 2023
Merged via the queue into master with commit 9c7f9d0 Dec 5, 2023
54 checks passed
@zhangchiqing zhangchiqing deleted the leo/fix-storage-snapshot branch December 5, 2023 20:49
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.

4 participants