This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Optimize block log usage #7785
Merged
Merged
Optimize block log usage #7785
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0954b8e
emit accepted block before updating block_log lib since accepted bloc…
heifner 63ff4f8
Optimize getting block id from block log
heifner 7c92091
Fix read_block_id_by_num to use block_header
heifner 8d74eac
Merge branch 'develop' into opt-block-log
heifner 4e5c7da
Changed last_irreversible_block_num to call get_block_id_for_num and …
heifner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we change the contents of this method to just call get_block_id_for_num?
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 think I agree with Brian, It was fixed IIRC in 1.8.x but we used to have a situation where the LIB was not guaranteed to be in the block-log (it was still in the fork DB due to a slow pruning process). Even with that fixed, this method (as-spoke) tightly couples to the expectation that the block-log always contains the LIB and I can think of several reasons why we'd want to break that assumption in the future. (like throwing block.log writes to a background thread).
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.
Moved the check for id in tapos block summary to
get_block_id_for_num
since might as well have that optimization there and modifiedlast_irreversiable_block_id
to callget_block_id_for_num
.