-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2323: ChainDB: optimise chain selection for forks r=mrBliss a=mrBliss Fixes #1223. When a block fits onto a fork, we construct the fragment all the way going back to the immutable tip instead of just a `ChainDiff` to the most recent intersection with the current chain. For example, when switching to a fork that requires rolling back 2 blocks, previously, we'd construct a fragment containing `k` headers. Now, we'll construct a `ChainDiff` with rollback = 2 and a fragment of 2 headers. * `VolDB`: introduce `ReversePath` and `computeReversePath` which lazily computes a path through the VolatileDB. By using these paths everywhere, we no longer have to think about looking things up in the VolatileDB. * `VolDB`: let `isReachable` return a `ChainDiff` of `HeaderFields` instead of a list of hashes going all the way back to the immutable tip. This `ChainDiff` of `HeaderFields` can later be translated to a `ChainDiff` of `Header`s. * `VolDB`: add `extendWithSuccessors` that will extend a `ChainDiff` of `HeaderFields` with its successors, using `candidates`. * Add property tests for `isReachable`, which helped catch a tricky corner case involving EBBs. * `VolDB`: rewrite `computePath` using `computeReversePath`. * We can now use `RealPoint`s instead of `HeaderHash`s in many functions and types: `IteratorBlockGCed`, `ChainDB.Iterator`s, `VolDB.Path`, some trace events, etc. We don't yet take advantage of the `RealPoint` in the implementation of `ChainDB.Iterator`s. Co-authored-by: Thomas Winant <[email protected]>
- Loading branch information
Showing
37 changed files
with
1,177 additions
and
510 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
Oops, something went wrong.