Batch-Schedule-Execute: On Optimizing Concurrent Deterministic Scheduling for Blockchains (Extended Version)
Yaron Hay, Roy Friedman
TL;DR
This paper addresses maximizing intra-block parallelism in blockchains while preserving deterministic state-machine replication. It introduces Batch-Schedule-Execute (BSX) and a generic ASMR framework that schedules transactions from a conflict graph to achieve sequentially deterministic execution, rather than relying on consensus-imposed total order. It proves NP-hardness for latency minimization and shows a tight equivalence to Graph Vertex Coloring in the homogeneous case, enabling optimal scheduling via minimal coloring (MCGBR); in heterogeneous cases, it demonstrates that coloring alone is insufficient and weighted coloring offers partial guidance. The work also proposes Level-Induced Graph Scheduling and tail-latency improvements through color reordering, and discusses a batched scheduler variant (BBR) as a practical alternative. Practically, these insights promise higher blockchain throughput and more predictable latency, while reducing susceptibility to adversarial block ordering, with applicability across various consensus models and execution environments.
Abstract
Executing smart contracts is a compute and storage-intensive task, which currently dominates modern blockchain's performance. Given that computers are becoming increasingly multicore, concurrency is an attractive approach to improve programs' execution runtime. A unique challenge of blockchains is that all replicas (miners or validators) must execute all smart contracts in the same logical order to maintain the semantics of State Machine Replication (SMR). In this work, we study the maximal level of parallelism attainable when focusing on the conflict graph between transactions packaged in the same block. This exposes a performance vulnerability that block creators may exploit against existing blockchain concurrency solutions, which rely on a total ordering phase for maintaining consistency amongst all replicas. To facilitate the formal aspects of our study, we develop a novel generic framework for Active State Machine Replication (ASMR) that is strictly serializable. We introduce the concept of graph scheduling and the definition of the minimal latency scheduling problem, which we prove to be NP-hard. We show that the restricted version of this problem for homogeneous transactions is equivalent to the classic Graph Vertex Coloring Problem, yet show that the heterogeneous case is more complex. We discuss the practical implications of these results.
