Delphi Digital:简析并行执行

币界网Publicado em 2024-08-16Última atualização em 2024-08-16

币界网报道:

作者:Delphi Digital,翻译:xiaozou

并行执行通常被誉为区块链扩容和大规模采用的关键,可能会吸引“数十亿用户”。

1、为什么要关心状态增长管理?

因为它会影响开发人员的体验、用户支付的费用以及验证者积累的奖励,所以,状态增长管理是所有L1的关键考虑因素。

对于并行化VM(虚拟机)来说,重要的是要注意到,只有不更新相同状态的交易才能并行运行。为了不发生冲突,交易必须是顺序排序的,这意味着如果50%的交易具有相同的状态,并行执行只对其余50%独立交易有利。

XKtPxs7ClVZZkUkXn5leU4zpUIrwQlQhabeLRSne.png

2、并行执行的两种主要类型

让我们来看一下并行执行的两种主要类型:

1)确定性(Deterministic)类型

通过预定义的访问列表映射交易依赖关系,VM跟踪对存储和余额的交易依赖关系,以防止状态冲突,如Solana和Sui所示。

2)乐观(optimistic)类型

此类并行执行在假定交易不会发生冲突的情况下并行运行或顺序再执行所有交易。此类做法不需要访问列表,从而简化了开发过程,收获了Monad、MegaETH、Aptos和Sei等公链的采用。

3、以太坊的顺序执行

运行以太坊验证者(validators)需要至少8GB RAM和2.8 GHz四核CPU。然而,EVM使用单核执行交易表明它并没有完全进行硬件优化。

nrTH9iutI3sHSbhXgdvWxIIFvdACJmBI9C6wILxg.png

EVM不能并行执行交易主要受以下两个因素限制:

  • 它缺乏一种机制来识别具有共享状态依赖关系的交易。

  • 它使用RockDB和Merkle Patricia Trees存储状态数据,并发读写比较复杂。

16Ddif15UYsSBiIlpY6gIEEQbnTqXyXb20G68pnv.png

单独的并行执行不足以维持网络使用。状态增长和状态访问是下一个扩容瓶颈。

并行执行的好处可能被夸大了,因为每区块只有部分选定交易才能并行执行。这在网络拥塞期间变得非常明显,因为依赖关系重叠会减少加速增益。下图所示区块20000006的速度提高了6倍,而区块20434947的速度只提高了1.7倍。

BVl0dYRXGjIlvL0afSomEMBXmLt8NInzV6MdUrka.jpeg

我们来看来自Ghost的数据,对2024年6月初的20M区块到20.1M区块之间的10万个区块的评估表明,顺序依赖关系最小的区块在并行处理情况下执行速度更快。

UUhZCaT7wg1V2uhdJMmIkvTRbj8NDYWCFq758oa1.jpeg

4、状态增长和状态访问问题

区块链的状态包括账户、各账户余额、nonces和合约信息。随着交易频繁以及新合约的出现,特别是在像ETH这样复杂的系统中,链状态在持续扩展。

sX9NZqhuw2EaZtmv16slwlkPbndLCjXW7WzaJYkl.png

5、状态管理的经济焦点

Solana、Sui或Aptos等公链使用状态租金(state rent)等机制,对最佳的状态增长管理提供经济激励。它们通过在交易期间向用户收取存储费,防止验证者和用户支付更高的存储成本。

6、状态管理的技术焦点

大多数技术方法都围绕着高效的数据库结构展开,这些数据库结构支持使用更优的Merkle树结构进行异步读写操作。

Delphi Digital研究员Muhammad Yusuf是这样说的:并行化是一个已决问题。各链将争相支持更强大的设置和更快的虚拟机。但要真正取得长期成果,就需要强劲的状态增长和准入管理机制。”

Leituras Relacionadas

Canada MSB, Why is it More Suitable for Teams Focused on Long-Term Payment Solutions?

**Canada MSB: Why Is It More Suitable for Teams Focused on Long-Term Payments?** Many crypto payment projects initially obtain a U.S. MSB registration for its cost-effectiveness and market recognition. However, as they scale operations, they often find it insufficient for sustainable, real-world payment business. This is where the Canadian MSB, regulated by FINTRAC, gains serious consideration. Unlike the U.S. framework, the Canadian MSB is not a "lightweight alternative" but a choice for projects committed to long-term, compliant operations, especially in B2B payments, cross-border settlements, and stablecoin transactions. **Key Distinctions:** The Canadian MSB emphasizes substantive, ongoing regulation. It requires establishing a full-fledged AML/CTF framework *before* launching operations, with continuous obligations for KYC, transaction monitoring, and reporting. This positions the holder as a regulated financial service provider from day one. **Operational Scope:** A properly structured Canadian MSB can support businesses like stablecoin/crypto payments and transfers, fiat-crypto exchange, B2B batch settlements, payment APIs for merchants, and underlying structures for services like crypto cards. **Strategic Advantages:** 1. **Bank & Partner Relations:** Its clear regulatory framework and operational requirements make it easier to explain compliance to banks and institutional partners, which is crucial for securing stable banking relationships. 2. **Centralized Path:** It offers a nationally unified system, avoiding the complexity and cost of navigating multiple U.S. state-level Money Transmitter Licenses (MTLs). 3. **Business Model Clarity:** It fosters long-term stability by requiring clear business structures, transparent fund flows, and real risk management from the outset, reducing future uncertainties. **Ideal Candidates:** The Canadian MSB is particularly suitable for B2B crypto payment platforms, cross-border stablecoin services, enterprise payment solutions, Web3 financial infrastructure projects, and teams building a "compliance benchmark" for sustainable growth. **Choosing Between U.S. and Canadian MSB:** The choice depends on the project's stage and goals. The **U.S. MSB** is better for **speed, initial validation, and early launch**. The **Canadian MSB** is better for **stability, substantive compliance, and long-term operation**, especially when serving B2B/enterprise clients and requiring reliable banking channels. In essence, while the Canadian MSB involves higher initial compliance rigor, it provides a more solid foundation for building a payment business that banks, partners, and regulators can accept over the long term.

marsbitHá 1h

Canada MSB, Why is it More Suitable for Teams Focused on Long-Term Payment Solutions?

marsbitHá 1h

Trading

Spot
Futuros
活动图片