Skip to main content

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 core

EVM cache system

Query processor

Storage engine

Merkle trie optimizer

Storage indexer

LSM-tree manager

Concurrency control

Version manager

I/O scheduler

Ethereum compatibility layer

Each component in this architecture addresses specific performance bottlenecks in traditional blockchain storage systems. The integrated design supports specialized optimization at each level and keeps the system cohesive.

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:
  1. The system analyzes transaction targets, calldata patterns, and historical access data to create an initial dependency graph.
  2. Transactions without overlapping state dependencies execute in parallel, in isolated worker threads.
  3. The system monitors the actual storage accesses during execution and compares them with the predictions to identify conflicts.
  4. When conflicts occur, the system re-executes only the minimal conflict sets, in sequential order.
For common operations such as token transfers, SeiDB applies specialized conflict handlers that understand operation semantics. The semantic analysis identifies token sender and recipient addresses from calldata and method signatures. This understanding reduces false conflicts for common ERC-20 token operations. The worker pool adjusts parallelism dynamically based on observed conflict rates. During periods with few conflicts, the system increases worker count to maximize throughput. When conflict rates rise, it reduces parallelism to avoid wasting resources on speculative execution that might need to be reverted. The scheduler has a feedback loop that monitors aborted transactions. The loop adjusts the parallelism factor within milliseconds after it detects a change in workload patterns.

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:
In the optimized version, related values cluster under common bucket keys. This organization matches SeiDB’s caching strategy, which loads entire buckets into memory as a unit. The pattern performs better than randomized access, particularly for operations that process many values in a single transaction.

Contention reduction

Smart contracts that handle high transaction volumes benefit from storage designs that minimize contention on storage locations:
The optimized contract shards the counter across time-based buckets. This greatly reduces contention when multiple transactions execute concurrently. SeiDB’s concurrency control system recognizes these sharded patterns and executes transactions that affect different shards in parallel. This approach increases throughput for high-volume contracts during peak load conditions.

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
Because of these compatibility guarantees, existing smart contracts, development tools, and infrastructure components work without modification. The system goes through extensive compatibility testing against the official Ethereum test suites. The tests verify that results are identical to the reference implementations.

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
Each configuration tunes the SeiDB components to specific requirements and keeps protocol compatibility. The configuration framework gives fine-grained control over cache sizes, worker pools, I/O policies, and persistence strategies to match the operational needs of different node types.