There exists a plethora of consensus protocols in literature. The reason is that there is no one-size-fits-all solution, since every protocol is unique and its performance is directly tied to the deployment settings and workload configurations. Some protocols are well suited for geographical scale environments, e.g., leaderless, while others provide high performance under workloads with high contention, e.g., single leader-based. Thus, existing protocols seldom adapt to changing workload conditions. To overcome this limitation, we propose Spectrum, a consensus framework that is able to switch consensus protocols at run-time, to enable a dynamic reaction to changes in the workload characteristics and deployment scenarios. With this framework, we provide transparent instantiation of various consensus protocols, and a completely asynchronous switching mechanism with zero downtime. We assess the effectiveness of Spectrum via an extensive experimental evaluation, which shows that Spectrum is able to limit the increase of the user perceived latency when switching among consensus protocols.
Modern Byzantine fault-tolerant state machine replication (BFT) protocols involve about 20,000 lines of challenging C++ code encompassing synchronization, networking and cryptography. They are notoriously difficult to develop, test and prove. We present a new abstraction to simplify these tasks. We treat a BFT protocol as a composition of instances of our abstraction. Each instance is developed and analyzed independently. To illustrate our approach, we first show how our abstraction can be used to obtain the benefits of a state-of-the-art BFT protocol with much less pain. Namely, we develop AZyzzyva, a new protocol that mimics the behavior of Zyzzyva in best-case situations (for which Zyzzyva was optimized) using less than 24 of the actual code of Zyzzyva. To cover worst-case situations, our abstraction enables to use in AZyzzyva any existing BFT protocol, typically, a classical one like PBFT which has been tested and proved correct. We then present Aliph, a new BFT protocol that outperforms previous BFT protocols both in terms of latency (by up to 30 ) and throughput (by up to 360 ). The development of Aliph required two new instances of our abstraction. Each instance contains less than 25 of the code needed to develop state-of-the-art BFT protocols.