|
Sei is a general-purpose, open-source L1 blockchain dedicated to digital asset trading. Sei V2 adopts an optimistic concurrency approach, making it more developer-friendly. In optimistic concurrency mode, smart contracts can seamlessly execute in parallel without developers needing to declare their resources in advance. This means the chain optimistically runs all transactions in parallel. However, when conflicts occur (i.e., multiple transactions access the same state), the blockchain keeps track of each conflicting transaction's impact on specific storage components.
The Sei blockchain uses an "Optimistic Concurrency Control (OCC)" mechanism to execute transactions. Concurrent transaction processing occurs when multiple transactions are active in the system simultaneously. This transaction processing consists of two stages: execution and validation.
During the execution stage, transactions are optimistically processed, with all read/write operations temporarily stored in a specific transaction store. Subsequently, each transaction enters the validation stage, where the information in the temporary storage operations is checked against the state changes made by previous transactions. If transactions are independent, they will run in parallel. If one transaction reads data that has been modified by another transaction, a conflict arises. Sei's parallel system identifies each conflict by comparing the transaction's read dataset with the latest state changes in the multi-version store (indexed by transaction order). Sei then re-executes and revalidates instances at the conflict positions. This is an iterative process involving execution, validation, and rerunning to resolve conflicts. |
|