Delphi Digital:一文简析并行执行

币界网Pubblicato 2024-08-16Pubblicato ultima volta 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是这样说的:并行化是一个已决问题。各链将争相支持更强大的设置和更快的虚拟机。但要真正取得长期成果,就需要强劲的状态增长和准入管理机制。”

Letture associate

Stuck Polymarket: The Real Test After Riding the Traffic Boom Has Arrived

Polymarket, a leading prediction market platform, is facing significant technical challenges as its growth outpaces its current infrastructure on Polygon. Users are experiencing laggy transactions, unresponsive orders, and delayed confirmations, severely impacting the trading experience. In response, DeFi Engineering VP Josh Stevens outlined a comprehensive engineering overhaul. The plan includes reducing on-chain data delays, fixing order cancellation issues, rebuilding the central limit order book (CLOB), improving website performance, and developing a unified SDK and API. A major revelation was the ongoing "chain migration," indicating a potential move away from Polygon. The core issue is that Polymarket has evolved from a simple prediction market into a high-frequency trading platform, making Polygon's limitations—such as block space, gas fees, and block time—a ceiling for further growth. The migration is not just a simple chain switch but a fundamental rebuild of its trading system to support more complex products like perpetual contracts (Perps). This announcement has sparked competition among chains like Solana, Sui, and Algorand, all vying to host Polymarket. For Polygon, losing this key application, which contributes significantly to its gas fee revenue, would be a major setback. The real test for Polymarket is no longer attracting users but proving it can provide a stable, reliable trading environment that retains them.

Odaily星球日报36 min fa

Stuck Polymarket: The Real Test After Riding the Traffic Boom Has Arrived

Odaily星球日报36 min fa

Lowering Expectations for BTC's Next Bull Market

The author, Alex Xu, explains his decision to significantly reduce his Bitcoin holdings (from full to ~30% of his portfolio) during the current bull cycle, citing a lowered long-term outlook for BTC's price appreciation in the next cycle. He outlines six key reasons for this reduced expectation: 1. **Diminished Growth Drivers:** The narrative of exponential user adoption has largely played out with institutional ETF adoption. The next major growth phase—adoption by sovereign national reserves or central banks—seems unlikely in the near future. 2. **Personal Opportunity Cost:** More attractive investment opportunities have emerged in other assets, such as undervalued companies. 3. **Industry-Wide Contraction:** The broader crypto industry is struggling, with most Web3 business models (SocialFi, GameFi, DePIN) failing. This overall萧条 (depression) reduces the fundamental demand and consensus for Bitcoin. 4. **Strain on Major Buyer:** MicroStrategy, a major corporate buyer of BTC, faces rising financing expenses for its debt, which could slow its purchasing rate and create significant marginal pressure on the market. 5. **Increased Competition from Gold:** The emergence of "tokenized gold" has closed the functional gap (portability, divisibility) between physical gold and Bitcoin, offering a strong competitor in the non-sovereign store-of-value space. 6. **Security Budget Concerns:** The block reward halving continues to exacerbate the long-standing issue of funding Bitcoin's network security, with new fee source explorations like Ordinals and L2s largely failing. The author's decision to hold a significant (though reduced) position reflects a cautious, not bearish, outlook. He remains open to increasing his exposure if the fundamental reasons for his skepticism change or if new positive catalysts emerge.

marsbit1 h fa

Lowering Expectations for BTC's Next Bull Market

marsbit1 h fa

Can Iran 'Control' the Strait of Hormuz?

Iran has announced a comprehensive plan to assert control over the strategic Strait of Hormuz, a critical global oil shipping chokepoint. The proposed measures include requiring all vessels to obtain Iranian permission for passage, imposing fees for security, environmental protection, and navigation management—preferably paid in Iranian rials—and absolutely banning Israeli ships. Vessels from countries deemed hostile by Iran’s top security bodies may also be barred. Analysts suggest Iran’s motives are multifaceted: increasing pressure on the U.S. and Israel by leveraging control over oil transit to influence global prices and inflation; creating a new revenue stream, potentially exceeding $7.7 billion annually, to counter Western sanctions and support postwar reconstruction; and using transit permissions as bargaining chips in future negotiations, notably with the U.S. However, the plan faces significant practical and diplomatic challenges. Enforcing comprehensive interception and fee collection in the busy waterway, patrolled by international military forces, would be difficult. The U.S. has already countering with a blockade of Iranian ports and threats to intercept any ship paying fees, potentially strangling Iran’s oil exports and fee revenue. Broad international opposition, led by European and Gulf states, and legal controversies further complicate implementation. The proposal may ultimately serve more as a negotiating tactic than a feasible policy, with its execution remaining highly uncertain.

marsbit2 h fa

Can Iran 'Control' the Strait of Hormuz?

marsbit2 h fa

Trading

Spot
Futures
活动图片