This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix ancient blocks sync #9531
Merged
Merged
Fix ancient blocks sync #9531
Changes from 14 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
5f38aa8
Log block set in block_sync for easier debugging
ascjones 5f219a4
logging macros
ascjones 8d7f742
Match no args in sync logging macros
ascjones 8f379ee
Add QueueFull error
ascjones f5d244e
Only allow importing headers if the first matches requested
ascjones f77c503
WIP
ascjones 0f3adb3
Test for chain head gaps and log
ascjones ad7bb2e
Calc distance even with 2 heads
ascjones 56747ef
Revert previous commits, preparing simple fix
ascjones 0eb8655
Reject headers with no gaps when ChainHead
ascjones 72783a2
Reset block sync download when queue full
ascjones 6f7c3c2
Simplify check for subchain heads
ascjones b4033f3
Add comment to explain subchain heads filter
ascjones 7d1bc76
Fix is_subchain_heads check and comment
ascjones 9588e5a
Prevent premature round completion after restart
ascjones 9b31755
Reset stale old blocks request after queue full
ascjones 8895cc6
Revert "Reject headers with no gaps when ChainHead"
ascjones 6e4a560
Add BlockSet to BlockDownloader logging
ascjones 6612f96
Reset OldBlocks download from last enqueued
ascjones e72ad14
Ignore expired Body and Receipt requests
ascjones 3d34ed5
Log when ancient block download being restarted
ascjones 3fe9c92
Only request old blocks from peers with >= difficulty
ascjones 757641d
Some logging and clear stalled blocks head
ascjones 54614c8
Revert "Some logging and clear stalled blocks head"
ascjones 39166d0
Reset stalled header if useless more than once
ascjones eea2f8d
Store useless headers in HashSet
ascjones d5d11c6
Merge branch 'master' into aj/fix-ancient-blocks-sync
ascjones 535dc63
Add sync target to logging macro
ascjones 68f26e8
Merge branch 'aj/fix-ancient-blocks-sync' into aj/ancient-blocks-rese…
ascjones 9e18c90
Don't disable useless peer and fix log macro
ascjones 409f3e8
Clear useless headers on reset and comments
ascjones df9f952
Use custom error for collecting blocks
ascjones 10fc545
Remove blank line
ascjones 8e7b813
Merge branch 'master' into aj/fix-ancient-blocks-sync
ascjones f0bb06d
Test for reset sync after consecutive useless headers
ascjones ec4adc0
Don't reset after consecutive headers when chain head
ascjones 9b5f21f
Delete commented out imports
ascjones 48e5483
Return DownloadAction from collect_blocks instead of error
ascjones a3409e3
Don't reset after round complete, was causing test hangs
ascjones 4a03042
Add comment explaining reset after useless
ascjones 4182c7a
Merge branch 'master' into aj/fix-ancient-blocks-sync
ascjones 0af4cf6
Replace HashSet with counter for useless headers
ascjones b8418e4
Refactor sync reset on bad block/queue full
ascjones 0ec672b
Add missing target for log message
ascjones 3bfc2ae
Merge branch 'master' into aj/fix-ancient-blocks-sync
ascjones e72d150
Fix compiler errors and test after merge
ascjones d77ac44
ethcore: revert ethereum tests submodule update
andresilva 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
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.
This is done to trigger resetting the sync right? Do you think we should return a different error type other than
BlockDownloaderImportError::Invalid
? (And also handle it inChainSync::collect_blocks
).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.
Yes I agree and I had previously done that. However my idea with this initial PR was to do the minimum amount to fix this bug.
However looks like this fix doesn't work entirely so I will add that back while waiting for another mainnet sync...