Utilizing Parallelism in Smart Contracts on Decentralized Blockchains by Taming Application-Inherent Conflicts

Péter Garamvölgyi, Yuxi Liu, Dong Zhou, Fan Long, Ming Wu

Abstract

While modern consensus protocols have significantly boosted blockchain throughput, transaction execution remains a persistent serial bottleneck. This research demonstrates that "application-inherent conflicts"—specifically global counters in smart contracts—are the primary obstacles to parallelization. We propose a suite of techniques to break these conflict chains, including partitioned counters and commutative instructions, alongside a novel deterministic scheduler (OCC-DA). Our evaluation on Ethereum mainnet traces shows that these methods can nearly double execution speedups, approaching theoretical optima without compromising network consensus.

Introduction

In account-based blockchains like Ethereum, transactions are traditionally executed sequentially. This serial execution is necessitated by the "state tree," a shared database where transactions often depend on the same "hot" variables, such as total supply counters or fee collector addresses. If Transaction A and Transaction B both update the same variable, they must run serially to ensure a deterministic final state across all nodes in the decentralized network.

Previous attempts at parallel execution have often yielded disappointing results. This paper identifies two primary gaps: the prevalence of bottleneck-inducing patterns in smart contract code and the non-deterministic nature of traditional parallel schedulers (like standard Optimistic Concurrency Control), which can lead to blockchain forks. We address these issues through a dual-layered approach targeting both application-level conflicts and system-level scheduling.

Methodology

Taming Application Conflicts

To mitigate contention at the application layer, we introduce two primary techniques:

  1. Partitioned Counters: Inspired by "sloppy counters" in the Linux kernel, we propose splitting a single global counter into multiple sub-counters. Writes are routed to different sub-counters based on the sender's address, drastically reducing direct contention on a single storage slot.
  2. Commutative EVM Instructions (CADD): We introduce a new "Commutative Add" instruction. Standard increments require a Read (SLOAD) followed by a Write (SSTORE), creating a hard dependency. CADD instead records the intent to add a value, allowing the virtual machine to apply these updates serially at the end of a block, thereby unblocking parallel execution during the main processing phase.
Illustration of how breaking dependency chains allows for more efficient parallel scheduling across multiple threads.

Deterministic Scheduling (OCC-DA)

We developed Optimistic Concurrency Control with Deterministic Aborts (OCC-DA) to ensure network-wide synchrony. Unlike standard OCC, which aborts transactions based on real-time execution overlaps, OCC-DA assigns specific "storage versions" to each transaction before execution. Because every node agrees on these version assignments upfront, they will all commit or abort the exact same transactions, maintaining perfect consensus.

Experimental Evaluation

The study utilized a massive dataset of historical Ethereum transaction traces from January 1, 2018, to May 28, 2018 (blocks #1 to #5,692,235). We modified an OpenEthereum node to track every contract storage access and used transaction gas costs as a proxy for execution time. Results were compared against an "optimal schedule" representing the theoretical maximum speedup limited only by inherent dependencies.

Results and Insights

The Impact of Conflict Resolution

A manual audit of 200 bottlenecked transaction batches revealed that 97% of conflicts were caused by simple counter increments or decrements. By addressing these through partitioned counters (even with a partition length of just 2), the average speedup on 32 threads jumped from 9.25x to 17.96x, nearing the theoretical optimum of approximately 20x.

Distribution of speedup bounds across the Ethereum mainnet dataset, showing significant potential for parallelism.

Determinism vs. Performance

A critical finding is that enforcing strict determinism via OCC-DA results in negligible performance loss. The deterministic scheduler achieved a 3.275x speedup on single blocks, nearly identical to the 3.287x achieved by non-deterministic models. This proves that safety and consensus do not require sacrificing execution speed.

Batching Effects

While block-by-block execution limits speedup to roughly 4x, processing transactions in larger batches (e.g., 30 blocks) significantly increases parallelism. Larger batches decrease the relative weight of individual slow transactions, allowing the system to better utilize multi-core hardware.

Conclusion

By combining application-level conflict resolution with deterministic parallel scheduling, we can significantly overcome the serial execution bottleneck in blockchains. Future work will focus on building a production-ready parallel EVM and exploring static analysis tools to automatically identify variables suitable for partitioned counters, potentially incentivizing "parallel-friendly" code through lower gas fees.

Summary updated

BibTeX
@inproceedings{garamvolgyi2022utilizing,
  author = {Péter Garamvölgyi and Yuxi Liu and Dong Zhou and Fan Long and Ming Wu},
  title = {{Utilizing Parallelism in Smart Contracts on Decentralized Blockchains by Taming Application-Inherent Conflicts}},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510086},
}
Figure