-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The idea is to change the instruction-emitting parts of the `Follower` abstraction to be aware of the tentative chain. Concretely, we now use `getCurrentChainByType` instead of `readTVar cdbChain` in two occasions: 1. When we are rolling forward from an in-memory point, which is the most relevant case for pipelining (as pipelining is only relevant when the follower is at the tip of our chain). This change is crucial: If we erroneously would use the selected chain in a tentative follower, rolling forward from the tentative point would result in us jumping back to the immutable DB as the tentative header is never part of the selected chain, which would then trigger an error as the tentative header is never in the immutable DB. 2. When rolling forward from a point in the immutable DB, when we are about to switch to the in-memory fragment. In most cases, the choice will be irrelevant here, except for this rare scenario (data loss in the VolDB): `cdbChain` could be empty, and the tentative header could be set, in which case we can roll forward tentative followers which are at the tip of the immutable DB. We leave follower forwarding (triggered via `MsgFindInteresct`) untouched as pipelining is only concerned with up-to-date peers.
- Loading branch information
Showing
3 changed files
with
46 additions
and
52 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