-
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] Optimize finalized reader to use block id index #5175
Conversation
28959f5
to
e24c7d3
Compare
@@ -231,8 +231,8 @@ func (e *UnexecutedLoader) pendingUnexecutedBlocks(ctx context.Context, finalize | |||
// if the EN is dynamically bootstrapped, the finalized blocks at height range: | |||
// [ sealedRoot.Height, finalizedRoot.Height - 1] can not be retrieved from | |||
// protocol state, but only from headers | |||
func (e *UnexecutedLoader) getHeaderByHeight(height uint64) (*flow.Header, error) { | |||
func (e *UnexecutedLoader) getHeaderByHeight(height uint64) (flow.Identifier, 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.
func (e *UnexecutedLoader) getHeaderByHeight(height uint64) (flow.Identifier, error) { | |
func (e *UnexecutedLoader) getBlockIDByHeight(height uint64) (flow.Identifier, 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.
same question here about not using e.headers.BlockIDByHeight(height)
directly
@@ -89,8 +89,8 @@ func (e *UnfinalizedLoader) LoadUnexecuted(ctx context.Context) ([]flow.Identifi | |||
// if the EN is dynamically bootstrapped, the finalized blocks at height range: | |||
// [ sealedRoot.Height, finalizedRoot.Height - 1] can not be retrieved from | |||
// protocol state, but only from headers | |||
func (e *UnfinalizedLoader) getHeaderByHeight(height uint64) (*flow.Header, error) { | |||
func (e *UnfinalizedLoader) getHeaderByHeight(height uint64) (flow.Identifier, 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.
func (e *UnfinalizedLoader) getHeaderByHeight(height uint64) (flow.Identifier, error) { | |
func (e *UnfinalizedLoader) getBlockIDByHeight(height uint64) (flow.Identifier, error) { |
@@ -60,12 +60,12 @@ func (e *UnfinalizedLoader) LoadUnexecuted(ctx context.Context) ([]flow.Identifi | |||
// reload its block to execution queues | |||
// loading finalized blocks | |||
for height := lastExecuted + 1; height <= final.Height; height++ { | |||
header, err := e.getHeaderByHeight(height) | |||
finalizedID, err := e.getHeaderByHeight(height) |
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.
why not use e.headers.BlockIDByHeight
directly?
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5175 +/- ##
==========================================
+ Coverage 56.43% 56.49% +0.06%
==========================================
Files 981 979 -2
Lines 93113 93149 +36
==========================================
+ Hits 52551 52629 +78
+ Misses 36673 36618 -55
- Partials 3889 3902 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -231,8 +231,8 @@ func (e *UnexecutedLoader) pendingUnexecutedBlocks(ctx context.Context, finalize | |||
// if the EN is dynamically bootstrapped, the finalized blocks at height range: | |||
// [ sealedRoot.Height, finalizedRoot.Height - 1] can not be retrieved from | |||
// protocol state, but only from headers | |||
func (e *UnexecutedLoader) getHeaderByHeight(height uint64) (*flow.Header, error) { | |||
func (e *UnexecutedLoader) getHeaderByHeight(height uint64) (flow.Identifier, 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.
same question here about not using e.headers.BlockIDByHeight(height)
directly
This PR optimizes the FinalizedBlockIDAtHeight method of the FinalizedReader used by Storehouse