Don't miss Build Games$1M Builder Competition

Streaming Asynchronous Execution

Learn how Streaming Asynchronous Execution (SAE) decouples consensus from execution to achieve higher throughput and lower latency.

Streaming Asynchronous Execution (SAE) is a fundamental architectural change that decouples consensus from execution. By allowing these two critical processes to run concurrently, AvalancheGo can achieve significantly higher throughput without sacrificing security guarantees.

Specification: SAE is defined in ACP-194. The reference implementation is StreVM.

Summary

In traditional synchronous execution, a block must be fully executed before it can be accepted by consensus. SAE introduces a queue upon which consensus is performed, with a concurrent execution stream responsible for clearing the queue and reporting state roots to later consensus rounds.

Key benefits:

  • Concurrent processing: Consensus and execution no longer block each other
  • Reduced latency: Blocks are accepted faster
  • Bursty throughput: Transactions can be eagerly accepted
  • Future features: Enables encrypted mempools and real-time VRF

The Problem with Synchronous Execution

In synchronous execution models, the block lifecycle is tightly coupled:

This creates several bottlenecks:

  1. Context switching: Nodes constantly switch between consensus and execution work
  2. Latency accumulation: Execution time directly adds to block acceptance time
  3. Resource contention: CPU-intensive execution competes with network-intensive consensus
  4. Stop-the-world events: Database compaction or GC pauses affect both consensus and execution

How SAE Works

SAE separates the block lifecycle into distinct phases:

Block Lifecycle

PhaseDescription
ProposedBlock builder creates a block with transactions
ValidatedValidators check that transactions can eventually be paid for
AcceptedBlock is accepted by consensus and enqueued for execution
ExecutedBlock is executed by the concurrent execution stream
SettledExecution results are recorded in a later block

Lightweight Validation

Before accepting a block, validators perform lightweight validation to ensure all transactions can eventually be executed. This validation:

  • Checks sender balances against worst-case bounds
  • Verifies the maximum required base fee
  • Does not execute transactions or compute state

The worst-case bounds guarantee that transactions can pay for their fees, but do not guarantee that transactions won't revert or run out of gas during execution.

The Execution Queue

Once accepted, blocks enter a FIFO execution queue:

The block executor runs in parallel with consensus, constantly processing blocks from the queue.

Settlement

Executed blocks are settled when a later block includes their execution results. The settlement includes:

  • State root: The root hash after executing the block
  • Receipt root: Merkle root of all receipts since last settlement

A constant time delay (τ\tau seconds) ensures that sporadic execution slowdowns are amortized.

Technical Specification

Gas Charging

SAE introduces a new gas charging formula that accounts for the gas limit:

gC:=max(gU,gL/λ)g_C := \max(g_U, g_L / \lambda)

Where:

  • gCg_C = gas charged
  • gUg_U = gas used
  • gLg_L = gas limit
  • λ\lambda = limit factor (enforces minimum charge based on limit)

This prevents transactions from reserving large gas limits without paying proportionally.

Block Size Limits

The maximum block size is constrained by the settlement delay:

ωB:=Rτλ\omega_B := R \cdot \tau \cdot \lambda

Where:

  • ωB\omega_B = maximum block size (gas)
  • RR = gas capacity per second
  • τ\tau = settlement delay
  • λ\lambda = limit factor

Queue Size Limits

The execution queue has a maximum size to prevent unbounded growth:

ωQ:=2ωB\omega_Q := 2 \cdot \omega_B

Blocks that would exceed this queue size are considered invalid.

Performance Implications

Concurrent Execution Streams

The primary benefit is that "VM time" more closely aligns with wall time:

TimeSynchronousSAE
0-2sConsensusConsensus
1-5s-Execution (overlapping)
2-4sExecutionConsensus
3-7s-Execution (overlapping)
4-6sConsensus-
6-8sExecution-

In synchronous mode, consensus and execution alternate. In SAE, they overlap, increasing throughput.

Lean Execution Clients

SAE enables specialized execution-only clients that can:

  • Rapidly execute the agreed-upon queue
  • Skip expensive Merkle data structure computation
  • Provide accelerated receipt issuance

This is valuable for:

  • High-frequency trading applications
  • Custodial platforms monitoring deposits
  • Indexers tracking specific addresses

Amortized Overhead

Irregular events like database compaction are spread across multiple blocks instead of causing individual block delays.

Future Features

SAE provides a foundation for additional optimizations:

Encrypted Mempools

By performing execution after consensus sequencing, transactions can remain encrypted until their order is finalized. This reduces:

  • Front-running attacks
  • MEV extraction
  • Transaction censorship

Real-Time VRF

Consensus artifacts become available during execution, enabling:

  • Verifiable random functions during execution
  • Fair on-chain randomness
  • Gaming and lottery applications

These features are not yet implemented but require SAE as a prerequisite.

Implementation

StreVM

StreVM is the reference implementation of SAE for EVM blocks:

# StreVM is under active development
git clone https://github.com/ava-labs/strevm

StreVM is under active development. There are currently no guarantees about the stability of its Go APIs.

Integration with AvalancheGo

SAE integrates with AvalancheGo's existing architecture:

Is this guide helpful?