Draft: Irmin layered store
Context
This MR aims to integrate Irmin layered store in the Tezos storage layer.
The layered store split the database into two independent layers: each layer can be managed independently or layers can be combined together in a single store. One layer, called the upper, is a read-write store used as a staging area for recent blocks that may not form a linear history yet; the second layer, called the lower, is a read-only store containing older blocks, once these are confirmed to be part of the chain. We propose an explicit, non-blocking freeze operation to move data from upper to lower. The full specification of the layered store (as well as the benchmarks below) are available here.
We benchmarked the layered store by running a tezos node on an already bootstrapped store: this ensures that blocks are validated at a slower pace than during bootstrapping, giving the freeze enough time to execute. In this benchmark, the freeze is called every 200 commits, and executes concurrently to the main thread - the red regions are the periods when the freeze is run. The x-axis represents the completed time for each block validation request (the completed in... in the logs of the node).

Checklist
-
We still need to figure out when to call the freeze and how to integrate it with a node that is bootstrapping.