Validation II
In my previous blog post Validation I described Bitcoin Core’s validation architecture, and how validation work is split up into different phases. I ended it with a description of its current bottlenecks, and what I would like to see improved. Bitcoin Core is currently validating one block at a time. A global lock (cs_main) is applied over most of validation. This limits the amount of parallelism possible. In this article, I propose some techniques (treating blocks as the fundamental validation unit, creating non-blocking I/O interfaces, segregating coin lookups from validation and UTXO set mutation) to overcome this and provide good parallelism, while preserving Bitcoin Core’s constraints for running on low end hardware and supporting full block pruning.