-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store: use a BTreeMap for RecentCachedBlocks
This commit significatly alters the design of RecentCachedBlocks. Thes most prominent changes are: 1. We don't require a `.set_chain_head` call anymore. Block insertion and chain head update attempt are now the same thing. 2. We don't evict all items in the cache anymore every time the chain head advances. 3. Unlike the previous data structure, we are now limited to storing a contiguous range of blocks in the cache. This is not really a drawback (as the cache contents will usually be identical, i.e. the last N blocks before the chain head), but it's worth pointing out.
- Loading branch information
Showing
1 changed file
with
111 additions
and
72 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