-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: edge cases causing bans during header/block sync (#3661)
Description --- Fixes the following edge cases: - base node reorg while streaming blocks (including the reorged block) sends an error message to the peer to let it know to resolve reorg using header sync. - lock add_block during header/block sync, sync protocols assume chain does not change while syncing - check the local chain metadata at the time the base node kicked into header sync to decide to ban Motivation and Context --- Fixes these erroneous ban conditions that were discovered during the recent stress test 1. Peer claimed an accumulated difficulty of 7632339559469659380317024 but validated difficulty was 7632339559469659380317024 <= local: 7632357293467858576437000. 2. Banned sync peer because Peer claimed an accumulated difficulty of 7880400444975439614055394 but validated difficulty was 0 <= local: 7880400444975439 3. Peer sent hash for block header we do not have. How Has This Been Tested? --- Not explicitly tested, simple test syncing base node to tip
- Loading branch information
Showing
18 changed files
with
253 additions
and
85 deletions.
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
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
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
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
Oops, something went wrong.