Documentation Index
Fetch the complete documentation index at: https://seilabs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Sei’s consensus mechanism, often referred to as Twin Turbo Consensus, represents a suite of optimizations designed to achieve exceptionally low block finality times, targeting approximately 400 milliseconds. This rapid finality is not achieved through a completely novel consensus algorithm but rather through significant enhancements to the underlying Tendermint Byzantine Fault Tolerant (BFT) consensus engine, aggressive configuration tuning, and tight integration with Sei’s parallel execution layer and SeiDB storage system. The goal is to provide near-instant transaction confirmation, enabling a new class of high-performance decentralized applications, particularly those built for the EVM.Core Concept: Pipelined & Parallelized Consensus
The key to achieving sub-second finality lies in aggressively optimizing and parallelizing the standard BFT consensus flow. While traditional Tendermint proceeds through distinct rounds of propose, prevote, precommit, and commit somewhat sequentially for each block height, Sei’s approach heavily pipelines these operations and integrates them closely with parallel transaction execution. This optimized flow involves several key enhancements:- Aggressive Timeout Configuration: Sei utilizes heavily tuned Tendermint consensus parameters. Configuration settings (e.g.,
UnsafeProposeTimeoutOverride,UnsafeCommitTimeoutOverride) enforce much shorter durations for block proposal, voting, and commit rounds compared to standard Tendermint configurations, directly contributing to the sub-second target block time. Faster gossip propagation for consensus messages further reduces communication latency between validators. - Intelligent Mempool Management & Transaction Preparation: Even before a block proposal is formally initiated for height
H, validators can begin processing transactions intended for that block. This involves collecting transactions from the network, decoding them concurrently (DecodeTransactionsConcurrently), analyzing potential state dependencies (GenerateEstimatedWritesets), and potentially pre-fetching required state data from SeiDB. This “pre-consensus” preparation minimizes the work needed once the actual proposal for heightHarrives. - Optimized BFT Rounds with Parallel Execution Integration: The critical optimization is the deep integration with Sei’s parallelization engine. When a validator receives a block proposal for height
H, it doesn’t necessarily wait for the prevote/precommit rounds to complete before starting execution. Instead:- The block’s transactions are dispatched to the parallel execution engine (
ProcessTXsWithOCC,DeliverTxBatch). - Transaction execution proceeds optimistically and concurrently using multiple worker goroutines, managed via mechanisms like
CacheMultiStorefor state buffering. - Simultaneously, the validator participates in the standard BFT prevote and precommit voting rounds for the proposed block
H.
- The block’s transactions are dispatched to the parallel execution engine (
- Rapid Finalization and Commit: Because transaction execution overlaps significantly with the consensus voting process, the time delta between achieving 2/3+ precommits for block
Hand having the resulting state changes ready for commitment is drastically reduced. Once consensus is reached, the validated state changes buffered during parallel execution are efficiently committed to the underlying SeiDB storage layer, leveraging its high I/O capabilities.
Pre-Consensus (TX Preparation)
- Transaction Collection & Analysis
- State Prefetching (SeiDB)
Optimized BFT Consensus (Voting & Concurrent Execution)
- Block Proposal Reception & Initial Validation
- BFT Voting (Prevote/Precommit)
- Parallel TX Execution (Optimistic)
Performance Impact for EVM Developers
This highly optimized consensus flow translates directly into tangible benefits:- Near-Instant Finality: The ~400ms target block time means transactions achieve probabilistic finality almost immediately, confirmed within a single block. Deterministic finality typically follows within two blocks (~800ms). This eliminates the long confirmation waits common on other chains.
- Responsive Applications: The low latency transforms the user experience. Interactions feel instantaneous, bridging the gap between decentralized applications and traditional web services.
- Advanced Use Cases: The speed enables applications previously impractical on-chain, such as high-frequency trading components, real-time price oracles critical for stable DeFi, and responsive on-chain games.
- Efficient Multi-Step Operations: Complex DeFi workflows (e.g., approve-swap-stake) that involve multiple transactions can execute in sequence within roughly a second, boosting capital efficiency and simplifying user interactions.
Leveraging Fast Finality in Solidity
The rapid block times enable and encourage specific development patterns: 1. Minimal Confirmation Waits: Off-chain applications and scripts should rely on just one block confirmation (txResponse.wait(1)) for probabilistic finality, significantly speeding up application logic that depends on transaction inclusion.
- Short-Duration Auctions/Votes: Contracts can define processes that resolve within seconds or minutes, using
block.numberfor precise timing based on the ~400ms block interval. - High-Frequency Oracles: Oracles can push updates much more frequently (e.g., every few seconds, corresponding to a small number of blocks), providing fresher data to DeFi protocols.