Introduction
SeiDB is a specialized database system designed to optimize blockchain state storage for the Ethereum Virtual Machine (EVM). It addresses fundamental performance constraints in traditional blockchain storage systems with optimizations that target the EVM’s specific state access patterns. This page explains the technical design and main components of SeiDB.Core technical design
Traditional blockchain databases store state in structures optimized for cryptographic verification, not for transaction execution speed. SeiDB uses a hybrid architecture that keeps cryptographic verifiability and also speeds up state access. The design goals include:- Minimizing storage slot access latency even at peak load
- Maximizing state operation throughput for both reads and writes
- Enabling parallel execution for non-conflicting state operations
- Maintaining consistent performance under variable workloads
System architecture
SeiDB implements a multi-layered architecture optimized for EVM state management: SeiDB coreEVM cache system
Query processor
Storage engine
Merkle trie optimizer
Storage indexer
LSM-tree manager
Concurrency control
Version manager
I/O scheduler
Ethereum compatibility layer
EVM-optimized storage engine
The storage engine is the foundation of SeiDB and its biggest departure from traditional blockchain state databases. Standard Ethereum implementations use a single Merkle Patricia Trie for all storage. SeiDB instead uses a hybrid approach that combines cryptographic verification with performance optimizations from modern database systems. The main techniques include:- Enhanced Merkle Patricia Trie: The implementation keeps the cryptographic properties that consensus validation requires and also addresses performance bottlenecks. SeiDB’s node caching greatly reduces I/O overhead. A priority retention system keeps hot nodes in memory. It analyzes access frequency and recency patterns across multiple blocks.
- Incremental state root calculation: The system uses specialized techniques that avoid recalculating entire trie branches when only leaf nodes change. This method speeds up finalization for blocks whose transactions affect different state areas. The calculation reuses intermediate hash values from unchanged subtrees. The system can then derive the state root quickly, even after thousands of storage modifications.
- Direct storage slot indexing: SeiDB maps composite keys (address + slot) to their storage location. This technique reduces lookup complexity from O(log n) to near-constant time for most operations. The indexing system stays consistent through a dual-update mechanism that modifies both the index and the underlying trie atomically.
- Account-level optimizations: The system applies different strategies to external accounts (user wallets) and contract accounts. Contract accounts get specialized treatment with code caching and execution context preservation. The code caching mechanism relies on contract bytecode being immutable after deployment. It keeps frequently accessed contracts in memory, with custom deserialization to minimize runtime overhead.
- Optimized Bloom filters: The storage engine speeds up negative lookups (checks for non-existent keys) during contract execution. These filters use multi-layer filtering, sized dynamically to the active working set, to minimize false positives during typical workloads.
Multi-level cache architecture
The caching system has multiple specialized caches, each optimized for particular EVM access patterns. General-purpose databases, by contrast, use uniform caching strategies. The system includes:- Hot slot cache: This component keeps frequently used storage slots in memory. It uses a frequency-recency hybrid eviction policy tuned for blockchain workloads. This adaptive approach gets better hit rates than static caching policies. The cache separates frequently accessed slots from burst-access slots to prevent cache thrashing during high-intensity operations.
- Account state cache: This cache keeps complete information for recently accessed addresses, including code, balance, nonce, and metadata. It uses predictive loading, based on transaction analysis, to improve hit rates during smart contract interactions. The predictive engine analyzes calldata patterns and historical interaction graphs to preload contract accounts that are likely to be accessed.
- Execution context cache: This specialized cache preserves partial execution environments for frequently called contracts. When the same contract executes repeatedly with similar call patterns, this contextual caching reduces setup overhead compared to cold execution. The context includes pre-validated jump destinations, resolved address references, and warmed storage slots.
Concurrency management
SeiDB’s concurrency control system uses optimistic concurrency control (OCC), adapted specifically for the EVM’s state access patterns. The system applies semantic knowledge of common smart contract behavior to minimize conflicts. The transaction execution process follows these steps:- The system analyzes transaction targets, calldata patterns, and historical access data to create an initial dependency graph.
- Transactions without overlapping state dependencies execute in parallel, in isolated worker threads.
- The system monitors the actual storage accesses during execution and compares them with the predictions to identify conflicts.
- When conflicts occur, the system re-executes only the minimal conflict sets, in sequential order.
I/O optimization
SeiDB implements storage I/O optimizations designed specifically for blockchain workloads. These workloads typically involve append-heavy state changes. The main optimization techniques include:- Log-structured storage: The system organizes state into multiple levels. Recent changes stay in memory, and older state moves to progressively larger but slower storage tiers. This architecture turns random writes into sequential operations to improve write throughput. The storage layer keeps a memory-resident delta table that captures recent modifications. It periodically flushes these changes to persistent storage in optimized batches.
- Priority-based I/O scheduling: The I/O subsystem prioritizes operations based on whether they are on the critical path. State reads that transaction validation requires get the highest priority. State updates come next, and background operations get the lowest priority. The scheduler also batches operations: it combines multiple small I/O operations into larger, more efficient ones.
- State versioning: SeiDB uses multi-version concurrency control designed for the block-based execution model of blockchains. Each block creates a new state version. Versions use full state snapshots at epoch boundaries and delta encoding for the blocks in between. The versioning system supports point-in-time queries against historical state. Differential storage and periodic compaction keep the storage overhead minimal.
- Configurable persistence: The database has adjustable durability guarantees, based on node type and network requirements. The options range from fully synchronous writes to asynchronous persistence with periodic checkpoints. The configuration system lets operators make explicit tradeoffs between performance and durability, based on the role of their node in the network.
Performance characteristics
SeiDB is designed for substantial performance improvements over traditional EVM state implementations. The architecture aims to improve both throughput and latency across various operation types.The performance characteristics in this section are design targets, not verified benchmarks. Actual performance will vary with hardware configuration, workload patterns, and network conditions. Production deployments should run their own benchmarks to validate performance in their specific environment.
Storage operation throughput
SeiDB is designed to significantly improve throughput across all major categories of storage operations, particularly storage reads and account lookups. These improvements come from the architecture, not from hardware scaling, and the performance gains apply to all operation types.Latency profile
The system is designed to keep latency consistently low across different load conditions, from low to peak usage. For applications that need predictable performance, this stable latency is one of SeiDB’s most significant advantages. The system aims to keep response times relatively stable even at high load. Traditional implementations, by contrast, may show severe latency spikes during high network activity.Optimization patterns
If you understand certain storage access patterns, you can take full advantage of SeiDB’s architecture. Existing contracts work without modification, but contracts designed with these patterns perform even better.Localized storage access
SeiDB’s caching mechanisms work best when related data is stored in localized regions:Contention reduction
Smart contracts that handle high transaction volumes benefit from storage designs that minimize contention on storage locations:Technical integration
EVM compatibility
SeiDB keeps complete compatibility with the Ethereum protocol specifications while it improves performance:- Full support for all EVM opcodes and precompiled contracts
- Identical state transition logic to standard Ethereum implementations
- Consistent gas cost model for all operations
- Complete compatibility with JSON-RPC API endpoints
Deployment configurations
SeiDB’s architecture supports various deployment configurations optimized for different node roles:- Validator nodes prioritize state consistency and durability through synchronous I/O operations and redundant state verification
- API service nodes optimize for query throughput and low-latency responses with larger cache allocations and specialized read paths
- Archive nodes use specialized storage strategies for efficient historical state access, including custom indexing for time-based queries
- Light clients benefit from optimized state proof generation with compact inclusion proofs for partial state verification