Introduction to Layer1: Understanding the Highlights of Sei Network v2 in Plain Language
Sei Network, a parallel processing public chain designed for trading, launched its token and mainnet in August this year, causing a wave of excitement in the market. Recently, Jayendra Jog, the founder of Sei Labs, announced the upcoming release of Sei v2, which will integrate EVM, optimize parallel processing mechanisms, and improve ledger storage structures.
Table of Contents
Toggle
What is Sei Network?
Sei for Trading
Sei Parallel Processing Mechanism
Sei v2 Update Direction
Virtual Machine: EVM Support
Original Design: Sei v1 uses CosmWasm virtual machine
Key Update: Sei v2 will support EVM integration
Optimizing Sei Parallel Processing Mechanism
Original Design: Sei v1 requires contract-defined resource scopes
Key Update: Sei v2 simplifies contract parallel execution mechanism
Optimizing Ledger Storage Structure: SeiDB
Original Design: Sei v1 stores large amounts of state data
Key Update: Sei v2 separates ledger structure
Consensus Mechanism
Sei competes in the mainstream chain market
Sei Network has a clear market positioning, providing an efficient environment for trading virtual assets. In addition to common tokens, virtual assets also include NFTs, social graphs, and game props. By providing a dedicated underlying environment for trading, Sei aims to create the best user experience.
Types of Virtual Asset Trading
(Source)
Virtual asset trading is not limited to cryptocurrencies, making it the most widely demanded feature in the online world. The team believes that the most successful Web3 applications involve trading attributes:
Indirect Trading: Most on-chain users trade virtual assets using platforms like Uniswap and OpenSea.
Direct Trading: Projects directly involved in trading, mostly games or NFT projects like Axie Infinity or BAYC.
Therefore, the demand for trading is ever-present and is an important aspect of Web3’s future. To establish the best trading network, efficient environments need to be provided. Sei achieves this goal through its parallel chain processing design and consensus mechanism.
Sei Network mainnet has been live for over 3 months, and according to official data, the network currently achieves an average of 20,000 TPS and 390 milliseconds of finality confirmation. The team claims it is the most efficient network in the industry, thanks to its innovative parallel processing mechanism.
When transactions on the Sei blockchain do not involve the same resources (addresses), all transactions can be processed in parallel without the need to order them. This improves network efficiency.
When evaluating a blockchain project, there are three main aspects to consider: ledger structure, consensus mechanism, and virtual machine. Along with Sei’s unique parallel processing mechanism, it becomes clear how Sei v2’s updates differ.
Key Updates for Sei Network v2
(Source)
Founder Jayendra Jog stated that Sei v2 is only adding new features and will not affect existing functionality. Users and developers do not need to perform any additional operations for this update.
The main proposals for Sei v2 include three updates:
EVM support
Optimizing parallel processing mechanism
Optimizing ledger storage structure
This update is expected to be completed in the first quarter of 2024.
Sei is built using Cosmos SDK and utilizes the CosmWasm virtual machine component provided by it. CosmWasm is a virtual machine component designed specifically for the Cosmos ecosystem, named after its underlying WebAssembly (Wasm) technology. Any blockchain built using Cosmos SDK can incorporate CosmWasm without adjusting existing logic.
WebAssembly supports multiple common programming languages, including Rust, C, C++, etc. Therefore, if you are a Rust developer, you can easily write smart contracts on CosmWasm. Sei attracted developers outside the Cosmos ecosystem.
However, the Sei Labs team found that although there was high developer participation, they were missing out on the Ethereum Virtual Machine (EVM) ecosystem. EVM is the virtual machine used by most existing industry applications and products. Losing this ecosystem would hinder Sei’s rapid development at this stage, as existing Ethereum projects cannot fork into the Sei ecosystem.
To address this, the team created a dedicated codebase called Core Sei Binary, incorporating EVM RPC and a dedicated interface for Geth nodes, allowing EVM transactions to seamlessly interact with the Sei network.
Geth was chosen because of its relative stability. Jayendra Jog stated that currently 80% of Ethereum nodes use Geth, and it supports complete EVM bytecode compatibility. This means developers can fully replicate contracts from other EVMs and run them on Sei.
Sei Network v2 Key Updates
(Source)
Sei v2 will also use EVM RPC, allowing users to easily use wallets like Metamask, and developers can continue using tools like Foundry, Remix, and Hardhat.
Therefore, Sei v2 will enable composability between EVM and Cosmwasm transactions. Sei’s Geth has a pre-compiler that allows calling of Cosmwasm contracts, and Sei’s wasmd module can also invoke EVM contracts in reverse. This will make assets within Sei’s ecosystem more valuable.
In the original Sei Network, developers had to learn how to “annotate contract resource usage” to enable parallel processing of transactions. When writing contracts on Sei, developers needed to define the resources and independence that the contract might access so that Sei could quickly determine resource independence and decide whether to execute transactions in parallel or in order.
To execute contracts in parallel, developers needed to identify the resources (including querying contracts) accessed during execution and write the resource scope in JSON format on-chain. This created complications for developers and increased entry barriers and security concerns.
Sei v2 will optimize the parallel processing mechanism, eliminating the need for developers to manually define dependency relationships. It will handle parallelization automatically, reducing the burden on developers.
The new parallel processing mechanism will execute all transactions uniformly. If conflicts in resource usage are detected, the network will reevaluate the order and reprocess them.
Sei v2 Automates Handling of Resource Overlap
(Source)
If transactions involve different accounts, for example, Alice transferring to Bob while Carol transfers to Dave, and there are no overlapping dependency relationships, these transactions will be processed in parallel. If transactions involve the same accounts, for example, both Alice and Bob transferring to Carol, they will need to be rerun in order.
However, this design may raise concerns. In the worst case scenario, if all transactions involve dependencies and need to be rerun in order, rerunning these transactions will increase execution time by 30% compared to the original sequential execution. Fortunately, according to Ethereum’s historical data, only about 15% of transactions have overlapping resources that require rerunning in order. Therefore, the team believes that Sei’s overall performance will still be significantly improved.
However, Sei has another issue. It stores the entire IAVL tree permanently in the distributed ledger. Due to fast finality and parallel processing design, frequent recording of global state changes leads to rapid growth in the overall network ledger size.
The cost of parallel processing is recording many invalid intermediate state data. According to the RFC proposed by the Sei team, for example, on the atlantic-2 testnet, 25 GB of data stored by an atlantic-2 node only contains 10 GB of meaningful transaction information, indicating low disk space utilization efficiency for the node.
Due to data expansion, Sei node disk usage grows rapidly. The disk usage of an atlantic-2 archival node increases by over 150 GB per day and over 1 TB per week. As the chain state continues to grow, the storage growth rate will also increase (become faster).
This leads to several issues:
The maintenance cost of nodes will become increasingly high.
Database operations will become slower.
RPC nodes cannot run for long periods due to disk filling up quickly.
With the addition of v2’s back-and-forth processing and revalidation parallel processing design, the overall network state changes more frequently, resulting in a significant increase in state data volume.
Sei v2 addresses these issues by optimizing the storage mechanism to prevent excessive state data growth and improve the speed of reading data for all nodes.
Sei v2 splits the state storage ledger into two types, called SeiDB:
State Commitment (SC): Records MemIAVL tree information.
State Store (SS): Records complete information.
With the improvements in SeiDB, verification nodes only need to record SC ledger information, while complete state information is recorded by the SS layer. Transmission is first placed in a write-ahead log without immediate transmission, allowing asynchronous occurrence of state storage, improving efficiency by not affecting block generation.
Sei v2 Reduces Growth Burden on Verification Node Data
(Source)
Through the improvement of SeiDB, Sei’s performance has been improved in various aspects. This includes a 100-fold improvement in block submission time, compressing daily data generation from 100 GB to 5 GB, and a 10-fold improvement in catch-up time for full nodes or nodes requiring data synchronization.
Sei Network v2 has not changed its original consensus mechanism and still maintains the Twin Turbo design. By improving the Cosmos consensus interface Tendermint ABCI, block confirmation time is significantly reduced.
Sei v2 introduces the EVM virtual machine, optimizes parallel processing mechanisms, and improves distributed ledger storage mechanisms. The goal is to enhance the user experience for developers, nodes, and users, thereby increasing its ecosystem’s influence.
However, based on the three months of operation, it was discovered that Sei’s parallel transaction processing, high TPS, and fast finality come at the cost of increased state data volume, resulting in higher hardware requirements for nodes. The team made compromises by separating the ledger structure, sacrificing decentralization to improve efficiency.
Overall, Sei has the potential to compete with other Ethereum killers if the above updates can be effectively implemented. We look forward to seeing the team’s progress with the updates next year.
(This article is not investment advice)
Cosmos
CosmWASM
Layer1
Sei