-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shovel: bugfix. reorg may halt progress until restart
The process for handling a reorg is as follows: 1. Shovel task gets latest remote block 2. Shovel task gets latest local block 3. Shovel decides which blocks to process 4. Shovel uses (cached) jrpc2 client to download blocks 5. Shovel checks downloaded chain with latest local hash for reorg 6. If reorg then delete local (and all indexed data for that block) 7. GOTO 1 The problem is that in step 4 may keep a block that has been removed from the global chain around in memory so that subsequent requests are given the removed block and therefore all new blocks are unable to be connected. This commit introduces the concept of maxreads for a block/header cache at which point the blocks/header will be removed from the cache. This solves the problem for the cache's existence (we want concurrent integrations to reuse data if they can) and ensures that bad data doesn't stay too long. In the case of a bad block in the cache, it will be there for a few requests and then Shovel will re-download the data and continue making progress.
- Loading branch information
1 parent
64c35e8
commit c20d328
Showing
2 changed files
with
74 additions
and
5 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