Table of Contents
Fetching ...

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.

Batch-Schedule-Execute: On Optimizing Concurrent Deterministic Scheduling for Blockchains (Extended Version)

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.
Paper Structure (73 sections, 23 theorems, 18 equations, 14 figures, 8 algorithms)

This paper contains 73 sections, 23 theorems, 18 equations, 14 figures, 8 algorithms.

Key Result

Theorem 5.1

$GBR$ is sequentially deterministic, assuming only valid schedules are used as input.

Figures (14)

  • Figure 1: The gap between scheduling a given block's transactions using consensus induced ordering vs. the maximal potential concurrency -- the former takes a linear number of execution steps while the latter only two.
  • Figure 2: An illustration of Active Replication.
  • Figure 3: A Flow-Chart of the main loop.
  • Figure 4: Conflicts Graph and Schedulers.
  • Figure 5: A vertical "flip" of (a), results in another (b) with the same block latency. The average & tail latencies are vastly different between the two.
  • ...and 9 more figures

Theorems & Definitions (35)

  • Definition 1: Conflicts [for Read and Write Operations]
  • Definition 2: Sequentially Deterministic
  • Definition 3: schedule and scheduling graph
  • Definition 4: Valid schedule
  • Theorem 5.1
  • Definition 5: Latency
  • Theorem 5.2: Latency Preservation of $GBR$
  • Lemma 5.1
  • Lemma 5.2
  • Lemma 5.3
  • ...and 25 more