【雙語】SUI, Aptos, and Vara: A Parallelization Comparison并行化比較

Parallelization plays a crucial role in optimizing the performance of blockchain systems, enabling faster transaction processing and improved scalability. This article provides a comparative analysis of three blockchain platforms — Vara, SUI, and Aptos — with respect to their parallelization techniques. Furthermore, the article delves into Gear Protocol’s distinctive approach to parallelization, emphasizing its benefits and potential impact on the future of distributed computing.

并行化在優(yōu)化區(qū)塊鏈系統(tǒng)的性能方面起著至關(guān)重要的作用,可實(shí)現(xiàn)更快的交易處理和更高的可擴(kuò)展性。本文對(duì)三個(gè)區(qū)塊鏈平臺(tái)(Vara、SUI 和 Aptos)的并行化技術(shù)進(jìn)行了比較分析。此外,本文還深入探討了 Gear Protocol 獨(dú)特的并行化方法,強(qiáng)調(diào)了其優(yōu)勢(shì)和對(duì)分布式計(jì)算未來的潛在影響。
Parallelization Techniques in Blockchain Systems
區(qū)塊鏈系統(tǒng)中的并行化技術(shù)

Two primary approaches to achieving parallelization in blockchain systems are sharding and parallel execution:
在區(qū)塊鏈系統(tǒng)中實(shí)現(xiàn)并行化的兩種主要方法是分片和并行執(zhí)行:

  1. Sharding: Sharding involves dividing the state space of a blockchain into multiple segments, known as shards. Each shard operates independently but enables cross-shard communication, thereby allowing for the parallel execution of transactions. This technique significantly enhances overall system efficiency.
    分片:分片涉及將區(qū)塊鏈的狀態(tài)空間劃分為多個(gè)段,稱為分片。每個(gè)分片獨(dú)立運(yùn)行,但支持跨分片通信,從而允許并行執(zhí)行事務(wù)。這種技術(shù)顯著提高了整體系統(tǒng)效率。

  2. Parallel Execution: Parallel execution is achieved by identifying and concurrently processing independent transactions. Transactions are considered independent if they do not read from or write to the same data. This approach leverages multiple CPU cores or GPUs for parallel processing, thereby accelerating transaction throughput.
    并行執(zhí)行:并行執(zhí)行是通過識(shí)別并發(fā)處理獨(dú)立事務(wù)來實(shí)現(xiàn)的。如果事務(wù)不讀取或?qū)懭胂嗤臄?shù)據(jù),則它們被視為獨(dú)立事務(wù)。這種方法利用多個(gè) CPU 內(nèi)核或 GPU 進(jìn)行并行處理,從而加快事務(wù)吞吐量。

SUI’s Account-based vs. Aptos’ Object-based Approach
SUI 的基于帳戶的方法與 Aptos 的基于對(duì)象的方法

Both SUI and Aptos strive for parallel execution but employ distinct strategies. SUI necessitates explicit specificity in code, while Aptos introduces a developer-friendly Block-STM. Aptos' approach, however, may face challenges as concurrent transactions with the same memory read-write can invalidate transactions, raising concerns about network robustness and efficiency. These differences complicate contract development and necessitate increased effort to optimize transaction parallelization.
SUI 和 Aptos 都努力并行執(zhí)行,但采用不同的策略。SUI 需要在代碼中明確特定性,而 Aptos 引入了對(duì)開發(fā)人員友好的 Block-STM。然而,Aptos 的方法可能會(huì)面臨挑戰(zhàn),因?yàn)榫哂邢嗤瑑?nèi)存讀寫的并發(fā)事務(wù)可能會(huì)使事務(wù)無效,從而引發(fā)對(duì)網(wǎng)絡(luò)健壯性和效率的擔(dān)憂。這些差異使合同開發(fā)復(fù)雜化,并且需要更加努力地優(yōu)化交易并行化。

Aptos distinguishes itself by utilizing Block-STM (Software Transactional Memory), which provides a better developer experience. In this approach, the system distributes transactions in each block across processor threads during execution according to a pre-set order. It assumes no dependencies between nodes and validates all transactions. If a transaction invalidates memory locations modified by preceding transactions, it is invalidated. While this enhances parallel execution, Block-STM introduces potential limitations and necessitates additional error-handling measures.
Aptos 通過利用 Block-STM(軟件事務(wù)內(nèi)存)來區(qū)分自己,它提供了更好的開發(fā)人員體驗(yàn)。在這種方法中,系統(tǒng)在執(zhí)行過程中根據(jù)預(yù)設(shè)的順序在處理器線程之間分配每個(gè)塊中的事務(wù)。它假設(shè)節(jié)點(diǎn)之間沒有依賴關(guān)系,并驗(yàn)證所有事務(wù)。如果事務(wù)使先前事務(wù)修改的內(nèi)存位置無效,則該事務(wù)將失效。雖然這增強(qiáng)了并行執(zhí)行,但 Block-STM 引入了潛在的限制,并需要額外的錯(cuò)誤處理措施。

How Vara Network’s Parallelization Approach Enhances Developer Experience
Vara Network 的并行化方法如何增強(qiáng)開發(fā)人員體驗(yàn)

Vara, built on the Gear Protocol, offers a unique parallelization approach that significantly enhances the developer experience. The Gear Protocol’s architecture relies on the Actor model, which is one of its flagship features. In this model, users, programs, and network entities act as actors that engage in message exchanges. Each program has a dedicated, isolated memory and maintains its own state without sharing it.
Vara 基于 Gear 協(xié)議構(gòu)建,提供了一種獨(dú)特的并行化方法,可顯著增強(qiáng)開發(fā)人員的體驗(yàn)。Gear Protocol 的架構(gòu)依賴于 Actor 模型,這是其旗艦功能之一。在此模型中,用戶、程序和網(wǎng)絡(luò)實(shí)體充當(dāng)參與消息交換的參與者。每個(gè)程序都有一個(gè)專用的隔離內(nèi)存,并在不共享的情況下保持自己的狀態(tài)。

When a program receives a message, it can modify its private state, generate a reply (another message) to another program or user, or create a new actor altogether. This design facilitates sharding within the Gear networks. The Actor model provides a cohesive framework for parallel and distributed computing, ensuring a unified approach. Due to actors having private states, the system achieves infinite sharding with the introduction of new programs.
當(dāng)一個(gè)程序收到一條消息時(shí),它可以修改其私有狀態(tài),生成對(duì)另一個(gè)程序或用戶的回復(fù)(另一條消息),或者完全創(chuàng)建一個(gè)新的參與者。這種設(shè)計(jì)有助于在 Gear 網(wǎng)絡(luò)內(nèi)進(jìn)行分片。Actor 模型為并行和分布式計(jì)算提供了一個(gè)內(nèi)聚框架,確保了統(tǒng)一的方法。由于參與者具有私有狀態(tài),因此系統(tǒng)通過引入新程序?qū)崿F(xiàn)了無限分片。

The Parallelization Summary: Actor Model Advantages
并行化摘要:Actor 模型的優(yōu)點(diǎn)

Comparing the parallelization approaches in blockchain networks reveals distinct characteristics in Vara, SUI, and Aptos. In the Actor model, message communications occur asynchronously. However, in synchronous programming languages like Solana, SUI, and Aptos, dApp developers must design their business logic sequentially, waiting for each preceding step to complete. Each distinct business logic section must be completed within a single block.
比較區(qū)塊鏈網(wǎng)絡(luò)中的并行化方法可以揭示 Vara、SUI 和 Aptos 的不同特征。在 Actor 模型中,消息通信是異步發(fā)生的。但是,在 Solana、SUI 和 Aptos 等同步編程語言中,dApp 開發(fā)人員必須按順序設(shè)計(jì)他們的業(yè)務(wù)邏輯,等待前面的每個(gè)步驟完成。每個(gè)不同的業(yè)務(wù)邏輯部分都必須在單個(gè)塊中完成。

Asynchronous programming eliminates these limitations, allowing developers to address different system components (actors) in parallel without waiting for responses from previous messages. Messages related to a single workflow or business logic can be processed and completed in different blocks, even if they are temporally distant.
異步編程消除了這些限制,使開發(fā)人員能夠并行處理不同的系統(tǒng)組件(參與者),而無需等待先前消息的響應(yīng)。與單個(gè)工作流或業(yè)務(wù)邏輯相關(guān)的消息可以在不同的塊中處理和完成,即使它們?cè)跁r(shí)間上相距遙遠(yuǎn)。

Vara, leveraging the Gear Protocol, presents an inherently sharded system with asynchronous messaging capabilities, thanks to the Actor model. While per-CPU parallelization implementation is forthcoming, Vara’s design ensures isolated program execution, minimizing conflicts and allowing for future error-handling enhancements. For more details, one can refer to Gear Protocol’s documentation.
Vara 利用 Gear 協(xié)議,借助 Actor 模型,提出了一個(gè)具有異步消息傳遞功能的固有分片系統(tǒng)。雖然每個(gè) CPU 并行化實(shí)現(xiàn)即將到來,但 Vara 的設(shè)計(jì)確保了隔離的程序執(zhí)行,最大限度地減少了沖突,并允許未來的錯(cuò)誤處理增強(qiáng)功能。有關(guān)更多詳細(xì)信息,可以參考 Gear Protocol 的文檔。

Vara Network’s Benefits on Scalability, Efficiency, and Flexibility
Vara Network 在可擴(kuò)展性、效率和靈活性方面的優(yōu)勢(shì)

As the first Layer-1 standalone network built on the Gear Protocol, Vara Network harnesses the inherent power of parallelization and the Actor model to achieve remarkable scalability and efficiency. With Vara Network, developers benefit from integrating the Actor model, enabling asynchronous messaging and unlocking new possibilities for dApps. By employing individual isolated memory spaces per program, Vara Network eliminates the complexities associated with specifying data access, allowing developers to focus on building robust applications without the burden of manual optimization.
作為第一個(gè)基于 Gear 協(xié)議構(gòu)建的 Layer-1 獨(dú)立網(wǎng)絡(luò),Vara Network 利用并行化的固有能力和 Actor 模型實(shí)現(xiàn)了卓越的可擴(kuò)展性和效率。借助 Vara Network,開發(fā)人員可以從集成 Actor 模型中受益,從而實(shí)現(xiàn)異步消息傳遞并為 dApp 解鎖新的可能性。通過為每個(gè)程序采用單獨(dú)的隔離內(nèi)存空間,Vara Network 消除了與指定數(shù)據(jù)訪問相關(guān)的復(fù)雜性,使開發(fā)人員能夠?qū)W⒂跇?gòu)建強(qiáng)大的應(yīng)用程序,而無需手動(dòng)優(yōu)化。

The upcoming implementation of per-CPU parallelization exemplifies Vara Network’s commitment to ongoing development. This enhancement further optimizes message processing on Gear nodes, maximizing the potential for parallel execution and bolstering the network’s overall performance.
即將實(shí)現(xiàn)的每 CPU 并行化體現(xiàn)了 Vara Network 對(duì)持續(xù)開發(fā)的承諾。此增強(qiáng)功能進(jìn)一步優(yōu)化了 Gear 節(jié)點(diǎn)上的消息處理,最大限度地提高了并行執(zhí)行的潛力,并增強(qiáng)了網(wǎng)絡(luò)的整體性能。

By pushing the boundaries of what is possible in blockchain networks, Vara Network opens new horizons for dApps, enabling them to achieve unparalleled scalability, efficiency, and flexibility. To explore Vara Network and its capabilities, visit vara-network.io and discover how the layer-1 network is transforming the blockchain landscape.
通過突破區(qū)塊鏈網(wǎng)絡(luò)的可能性界限,Vara Network 為 dApp 開辟了新的視野,使他們能夠?qū)崿F(xiàn)無與倫比的可擴(kuò)展性、效率和靈活性。要探索 Vara Network 及其功能,請(qǐng)?jiān)L問 vara-network.io 并了解第 1 層網(wǎng)絡(luò)如何改變區(qū)塊鏈格局。

Parallel Computations Techniques
并行計(jì)算技術(shù)

Parallel computations in blockchain can be achieved via:
區(qū)塊鏈中的并行計(jì)算可以通過以下方式實(shí)現(xiàn):

  1. Sharding: Sharding breaks the state space into N parts, each operating independently while remaining open to cross-shard communications.
    分片:分片將狀態(tài)空間分解為N個(gè)部分,每個(gè)部分獨(dú)立運(yùn)行,同時(shí)保持對(duì)跨分片通信的開放性。

  2. Parallel Execution: This is achieved by identifying independent transactions and executing them simultaneously. Two transactions are separate if they don’t read from or write to the same data. Regardless of the order of execution, the result will be the same. This method can be parallelized using different CPU cores or GPUs.
    并行執(zhí)行:這是通過識(shí)別獨(dú)立事務(wù)并同時(shí)執(zhí)行它們來實(shí)現(xiàn)的。如果兩個(gè)事務(wù)不讀取或?qū)懭胂嗤臄?shù)據(jù),則它們是獨(dú)立的。無論執(zhí)行順序如何,結(jié)果都是相同的??梢允褂貌煌?CPU 內(nèi)核或 GPU 并行化此方法。

Solana and SUI are similar in transaction execution, although data is stored as accounts on Solana and as objects on SUI. dApps need to specify which accounts or objects they wish to interact with in their function calls so that the VM can run an analysis to determine independent transactions, adding complexity to contract development.
Solana 和 SUI 在事務(wù)執(zhí)行上相似,盡管數(shù)據(jù)在 Solana 上存儲(chǔ)為賬戶,在 SUI 上存儲(chǔ)為對(duì)象。dApp 需要指定他們希望在函數(shù)調(diào)用中與哪些賬戶或?qū)ο筮M(jìn)行交互,以便 VM 可以運(yùn)行分析以確定獨(dú)立的交易,這增加了合約開發(fā)的復(fù)雜性。

Aptos adopts a different approach that provides a better developer experience by eliminating the need to specify which data to access in a transaction. Aptos employs Block-STM (Software Transactional Memory), where transactions in every block follow a preset order and are distributed across processor threads during execution. The blockchain assumes no dependencies between nodes, executing all transactions while recording memory locations modified by each transaction. If a transaction accesses memory locations altered by preceding transactions, it will be invalidated.
Aptos 采用了一種不同的方法,通過消除指定在事務(wù)中訪問哪些數(shù)據(jù)的需要,提供了更好的開發(fā)人員體驗(yàn)。Aptos 采用 Block-STM(軟件事務(wù)內(nèi)存),其中每個(gè)塊中的事務(wù)都遵循預(yù)設(shè)順序,并在執(zhí)行過程中分布在處理器線程之間。區(qū)塊鏈假設(shè)節(jié)點(diǎn)之間沒有依賴關(guān)系,執(zhí)行所有交易,同時(shí)記錄每筆交易修改的內(nèi)存位置。如果事務(wù)訪問了被先前事務(wù)更改的內(nèi)存位置,則該事務(wù)將失效。

One of Gear Protocol’s key features is the Actor model for communications. Users, programs, and other network entities act as actors that exchange messages. Programs have isolated memory and do not share their state. The result of a message received by a program can lead to a change in the program’s private state, a reply to another program or user, or the creation of another actor.
Gear Protocol 的主要特性之一是用于通信的 Actor 模型。用戶、程序和其他網(wǎng)絡(luò)實(shí)體充當(dāng)交換消息的參與者。程序具有隔離的內(nèi)存,并且不共享其狀態(tài)。程序接收到的消息的結(jié)果可能會(huì)導(dǎo)致程序的私有狀態(tài)發(fā)生變化、對(duì)另一個(gè)程序或用戶的回復(fù),或者創(chuàng)建另一個(gè)參與者。

This inherently enables sharding within Gear networks. The Actor model provides a unified design for parallel and distributed computing. Due to actors having private states, the system is infinitely sharded with new programs.
這本質(zhì)上可以在 Gear 網(wǎng)絡(luò)內(nèi)實(shí)現(xiàn)分片。Actor 模型為并行計(jì)算和分布式計(jì)算提供了統(tǒng)一的設(shè)計(jì)。由于參與者具有私有狀態(tài),因此系統(tǒng)被新程序無限分片。

Message communications in the Actor model are asynchronous. In synchronous programming (Solana, SUI, Aptos), a dApp developer must design business logic sequentially, waiting for the completion of the previous step. The distinct business logic part must be completed within a single block. Asynchronous programming removes this limitation, allowing developers to address different system components (actors) in parallel, not waiting for a response from the previous message. Messages related to a single workflow can be finalized in different blocks, even if they are temporally distant.
Actor 模型中的消息通信是異步的。在同步編程(Solana、SUI、Aptos)中,dApp開發(fā)人員必須按順序設(shè)計(jì)業(yè)務(wù)邏輯,等待上一步的完成。不同的業(yè)務(wù)邏輯部分必須在單個(gè)塊中完成。異步編程消除了這一限制,允許開發(fā)人員并行處理不同的系統(tǒng)組件(參與者),而無需等待前一條消息的響應(yīng)。與單個(gè)工作流相關(guān)的消息可以在不同的塊中完成,即使它們?cè)跁r(shí)間上相距遙遠(yuǎn)。

Unlike SUI, Gear dApp developers do not need to specify which objects to address for optimal transaction parallelization, as this is managed by the protocol thanks to individual isolated memory spaces per program.
與 SUI 不同,Gear dApp 開發(fā)人員不需要指定要尋址哪些對(duì)象以實(shí)現(xiàn)最佳事務(wù)并行化,因?yàn)檫@是由協(xié)議管理的,這要?dú)w功于每個(gè)程序的獨(dú)立隔離內(nèi)存空間。

Conclusion?結(jié)論
SUI’s system sharding can be achieved if dApp developers manage it effectively. Aptos ensures parallel per-CPU execution with subsequent error handling due to the shared state, which can potentially reduce the effectiveness of parallel computations. Gear, with its infinitely sharded system by design and asynchronous messages enabled by the Actor model, offers per-CPU parallelization for isolated programs without conflicts and with future error handling enhancements.
如果 dApp 開發(fā)人員有效地管理它,SUI 的系統(tǒng)分片是可以實(shí)現(xiàn)的。Aptos 確保每個(gè) CPU 并行執(zhí)行,并由于共享狀態(tài)而進(jìn)行后續(xù)錯(cuò)誤處理,這可能會(huì)降低并行計(jì)算的效率。Gear 憑借其無限分片系統(tǒng)的設(shè)計(jì)和 Actor 模型支持的異步消息,為無沖突的隔離程序提供每 CPU 并行化,并具有未來的錯(cuò)誤處理增強(qiáng)功能。

本文使用 文章同步助手 同步

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容