Emergent Mind

Abstract

One of the main bottlenecks of blockchains is smart contract execution. To increase throughput, modern blockchains try to execute transactions in parallel. Unfortunately, however, common blockchain use cases introduce read-write conflicts between transactions, forcing sequentiality. We propose RapidLane, an extension for parallel execution engines that allows the engine to capture computations in conflicting parts of transactions and defer their execution until a later time, sometimes optimistically predicting execution results. This technique, coupled with support for a new construct for smart contract languages, allows one to turn certain sequential workloads into parallelizable ones. We integrated RapidLane into Block-STM, a state-of-the-art parallel execution engine used by several blockchains in production, and deployed it on the Aptos blockchain. Our evaluation shows that on commonly contended workloads, such as peer-to-peer transfers with a single fee payer and NFT minting, RapidLane yields up to $12\times$ more throughput.

Visualization of MVDelayedFields data structure for transactions, deferred objects, updates, values, and delta traversals.

Overview

  • The paper presents RapidLane, a method that uses deferred objects for optimistic parallel execution to enhance the performance of smart contracts on blockchain systems, reducing read-write conflicts and improving throughput significantly.

  • RapidLane integrates with Block-STM to log and compress deferred computations, applying them later as deltas to minimize synchronization overhead and improve efficiency, especially during high contention.

  • Empirical results demonstrate substantial performance improvements in various scenarios, such as sponsored transactions and NFT minting, showing throughput gains of up to 11.6x compared to sequential execution.

Deferred Objects to Enhance Smart Contract Programming with Optimistic Parallel Execution

Introduction to the Problem

Smart contracts have revolutionized the way we think about computations on the blockchain, enabling decentralized applications and various financial products. However, these advancements come at a cost: the execution of smart contracts often introduces bottlenecks in blockchain systems due to read-write conflicts, which force sequential transaction processing and thus limit throughput.

This paper introduces RapidLane, a novel method for enhancing smart contract performance by employing deferred objects to achieve optimistic parallel execution. The key idea is to defer conflicting computations and handle them later, thereby converting inherently sequential workloads into parallelizable ones.

Core Contributions

Deferred Objects

The main innovation here is the concept of deferred objects. These are special types of objects that allow computations to be logged and deferred, capturing updates in a way that they can be applied later. This eliminates immediate read-write conflicts between transactions.

Key operations supported by deferred objects include:

  • Create: Capture an initial object value.
  • Update: Log a function to be applied later.
  • Map and Combine: Create new deferred objects based on existing ones without reading current values.
  • Reveal: Extract the stored value, which could introduce conflicts and hence is best used sparingly.

Using deferred objects, developers can optimize their smart contracts by explicitly indicating which data is prone to conflicts and should be deferred. This can transform otherwise sequential operations into optimistically parallel ones.

Integrating with Block-STM

RapidLane has been integrated into Block-STM, a state-of-the-art parallel execution engine. Block-STM employs optimistic concurrency control and multi-versioning to allow speculative execution of transactions. However, when conflicts arise, it falls back to sequential re-execution.

RapidLane enhances this by:

  • Capturing Logs: Instead of re-executing the entire transaction, only the deferred parts are captured and logged.
  • Compressing Logs: Deferred computations are compressed to reduce replay overhead, making them efficient even during heavy contention.
  • Applying Deltas: These logs are transformed into deltas, which are then applied to the blockchain state during commit, ensuring minimal synchronization overhead.

Rolling Commit Mechanism

A novel "rolling commit" approach is introduced to replace the lazy commit method originally used by Block-STM. This fine-grained commit process ensures that transaction results can be committed incrementally, reducing long speculative chains and improving both performance and latency.

Strong Numerical Results

The paper presents compelling empirical evidence for the effectiveness of RapidLane:

  • Sponsored Transactions: Throughput increased up to 10.3x compared to traditional integer-based conflict handling.
  • Peer-to-Peer Transfers: Utilizing deferred objects allowed for 11.6x higher throughput when compared to sequential execution.
  • NFT Minting: Speedups of up to 10.1x for minting limited NFT collections using deferred objects, demonstrating outstanding performance in real-world use cases.

Implications and Future Developments

Practical Implications

  • Enhanced Throughput: By allowing parallel execution of otherwise sequential workloads, blockchains can reach much higher transaction rates, making them more competitive with traditional financial systems (e.g., Visa).
  • Developer Incentives: Current blockchain systems often leave no room for optimization incentives. With deferred objects, developers now have the means to explicitly avoid data conflicts, leading to more efficient smart contracts.
  • Ease of Use: Deferred objects add a convenient abstraction for managing highly contended data, which can be a game-changer for smart contract development.

Theoretical Implications

  • Concurrency Control: This approach provides fresh insights into optimistic concurrency control, showing how deferred execution can be leveraged without sacrificing the core properties of blockchain - determinism and decentralization.
  • Parallel Programming Models: Deferred objects introduce a novel parallel programming model which could inspire similar advancements in other domains such as databases or distributed systems.

Future Directions

Moving forward, several aspects could be explored to extend this research:

  • Generalized Abstractions: Expanding the types of deferred operations and objects supported.
  • Automated Analysis Tools: Creating toolchains that can automatically optimize smart contracts by identifying and converting sequential parts into deferred computations.
  • Cross-Platform Integration: Implementing similar techniques in different blockchain platforms to achieve broader adoption and further validate the approach.

In conclusion, RapidLane opens up exciting possibilities for scaling blockchain systems, combining sophisticated parallel execution techniques with practical and theoretical insights. By cleverly deferring conflicts, this method transforms the landscape of smart contract execution, paving the way for faster and more efficient blockchain applications.

Create an account to read this summary for free:

Newsletter

Get summaries of trending comp sci papers delivered straight to your inbox:

Unsubscribe anytime.