-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix issue with reported fork head vs retrieval of block from fork db #774
Merged
Conversation
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
…h net_plugin asking for a block that should be available but is not.
…db_head_block_id() which checks db mode.
greg7mdp
requested changes
Mar 3, 2023
greg7mdp
approved these changes
Mar 3, 2023
greg7mdp
reviewed
Mar 3, 2023
greg7mdp
reviewed
Mar 3, 2023
greg7mdp
reviewed
Mar 3, 2023
greg7mdp
reviewed
Mar 4, 2023
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.
Nice, it is getting cleaner. I left a couple more suggestions.
greg7mdp
approved these changes
Mar 4, 2023
linh2931
approved these changes
Mar 5, 2023
return my->fork_db.pending_head()->id; | ||
block_state_ptr controller_impl::fork_db_head() const { | ||
if( read_mode == db_read_mode::IRREVERSIBLE ) { | ||
// When in IRREVERSIBLE mode fork_db blocks are marked valid when they become irreversible so that |
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 like those comments!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When
IRREVERSIBLE
mode was added EOSIO/eos#4424 access to fork db head was added to controller, during the refactor of fork database EOSIO/eos#6624 access to fork db pending was added to deal with irreversible mode.This PR simplifies this interface by returning the expected values for fork db head according to
IRREVERSIBLE
mode or not. This conforms with the existing functionality offetch_block_state_by_number
which looks atIRREVERSIBLE
mode to determine what branch to search on.Not sure if this should be back-ported. We have not seen the test failure on previous versions. My guess is the performance improvements in 4.0 around not having to jump to the main thread to get blocks is causing this to be much more likely.
Resolves #772