-
Notifications
You must be signed in to change notification settings - Fork 295
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
blockchain: Refactor to use new chain view. #1344
Merged
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
davecgh
force-pushed
the
blockchain_use_chainview
branch
2 times, most recently
from
July 9, 2018 22:41
c0b3429
to
60361d0
Compare
No issues encountered running on testnet. |
davecgh
force-pushed
the
blockchain_use_chainview
branch
from
July 10, 2018 05:23
60361d0
to
912fbd0
Compare
Been running smooth on testnet for a while now |
Ran for 5 days with no problems on testnet and mainnet. |
alexlyp
approved these changes
Jul 20, 2018
dajohi
approved these changes
Jul 20, 2018
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.
testnet2 miner ok
jrick
approved these changes
Jul 20, 2018
This refactors and simplifies the code in blockchain to use the new more efficient chain views. An overview of the logic changes are as follows: - Remove inMainChain from block nodes since that can now be efficiently determined by using the chain view - Track the best chain via a chain view instead of a single block node - Use the tip of the best chain view everywhere bestNode was used - Update chain view tip instead of updating best node - Remove height map and associated lock in favor of chain view - Use chain view NodeByHeight everywhere height map was used - Change reorg logic to use more efficient chain view fork finding logic - Change block locator code over to use more efficient chain view logic - Remove now unused block-index-based block locator code - Move BlockLocator definition to chain.go - Move BlockLocatorFromHash and LatestBlockLocator to chain.go - Update both to use more efficient chain view logic - Rework several functions to use chain view for main chain detection - fetchMainChainBlockByNode - BlockByHeight - MainChainHasBlock - findPreviousCheckpoint - IsCheckpointCandidate
davecgh
force-pushed
the
blockchain_use_chainview
branch
from
July 20, 2018 22:20
912fbd0
to
9ef7db9
Compare
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.
This requires #1338.
This refactors and simplifies the code in blockchain to use the new more efficient chain views.
An overview of the logic changes are as follows:
inMainChain
from block nodes since that can now be efficiently determined by using the chain viewbestNode
was usedNodeByHeight
everywhere height map was usedBlockLocator
definition tochain.go
BlockLocatorFromHash
andLatestBlockLocator
tochain.go
fetchMainChainBlockByNode
BlockByHeight
MainChainHasBlock
findPreviousCheckpoint
IsCheckpointCandidate
This is work towards #1145.