并行执行:Monad 如何突破传统 EVM 体系

marsbitPublicado a 2024-09-25Actualizado a 2024-09-26

介绍

Gmonad,欢迎再次深入探讨 ValiDAO!今天,我们将探讨@monad_xyz。尽管细节仍然很少,但我们已尽力收集所有相关信息,并在一篇技术文章中呈现已知信息。如果你在过去一年中上过加密货币推特,你肯定见过 Molandak。但你可能会想:这种炒作从何而来?Monad 到底是什么?Monad 受欢迎只是因为他们有一个非常可爱的吉祥物吗?让我们来一探究竟吧!

Monad

简而言之,Monad 是一个高性能的第 1 层区块链,拥有完整的 EVM 字节码兼容性和无数其他链级优化,使其成为一条非常快速的链。这些优化主要围绕自定义和并行执行、新的共识算法以及称为MonadDB 的自定义状态数据库。通过这些优化,Monad 声称(我们相信)可以实现 10,000 TPS 和单槽终结性,同时保持对验证者的相对较低的硬件要求。

MonadSource: DeSpread, Monad

并行执行

目前,大多数 EVM 实现(例如以太坊及其第 2 层解决方案上的实现)都以串行方式执行任务,迫使网络一次验证一个进程。与这种顺序执行方式不同,并行执行是指利用多个线程和处理器同时运行多个操作。Monad 利用乐观并行执行,假设事务可以并发执行,而无需事先意识到潜在的输入/输出冲突。但它是如何工作的呢?该过程包括几个步骤:

  1. 同时执行多个交易。
  2. 执行后检查是否存在冲突。
  3. 撤销任何检测到的冲突交易。
  4. 按顺序重新执行有冲突的事务。

与以太坊类似,区块内的交易保持线性顺序,Monad 以并行方式执行这些交易,并具有相同的顺序排序的安全保证。交易从一个共同的状态点开始,生成记录输入和输出的待处理结果。这些结果根据原始交易定义提交,然后系统按顺序检查交易及其待处理结果。如果这些输入和输出影响其他交易及其待处理结果,则重新执行,这仅当输入因另一个并行交易的输出而改变时才会发生。为了更好地解释这一点,让我们举一个涉及两个辛勤工作的厨师的例子。厨师 A 正在做沙拉(事务 A),厨师 B 正在做汤(事务 B),其中厨师 B 的任务取决于厨师 A,因为他们想使用一些切碎的蔬菜来做汤。厨师 A 开始切蔬菜,但突然决定中途改变蔬菜类型(可能是因为他们收到了新的指示)。现在,厨师 B 要使用的蔬菜不同了。由于厨师 B 的汤依赖于厨师 A 切碎的蔬菜,这种变化意味着厨师 B 必须重新评估并重新执行部分任务,调整汤以适应新配料。

Monad这种涉及重新执行交易的共识方式非常高效,因为交易的依赖项和输入都是从并行执行中缓存的。这意味着每个交易可能会执行两次:一次并行执行,第二次可能以串行方式执行。Monad 的方法与 Solana 的并行执行方法不同,主要区别在于 Solana 使用访问列表来预先确定哪些交易可以同时执行。它要求交易指定它们将与之交互的状态部分,为每个交易创建访问列表。之后,具有不重叠访问列表的交易可以并行执行,而具有冲突的交易则按顺序处理。在 Monad 的情况下,所有交易都可以并行执行,不兼容的交易则按顺序重新执行。

MonadDB

MonadDB 解决了区块链执行中的一个关键瓶颈:状态访问。传统的区块链系统难以实现高效的状态管理,尤其是在检索存储在磁盘上的智能合约数据时。这个问题严重影响了交易处理速度和整体系统性能,严重限制了大多数当前区块链的性能。

区块链中的状态访问过程涉及检索剩余合约数据,例如用于交换操作的代币余额。在数据库中检索此信息可能非常耗时,每次访问通常需要 10 到 20 微秒。仅仅并行计算而不优化状态访问只能带来微不足道的改进;挑战在于同时优化计算和状态检索。

为了解决这些限制,Monad 开发了 MonadDB,这是一个定制的键值存储,针对以太坊 Merkle 树数据和高效状态管理进行了优化。MonadDB 利用现代硬件功能(包括固态硬盘 (SSD) 和多核处理器)来最大限度地提高性能。它利用 SSD 的全部带宽并支持异步输入/输出 (I/O),采用 Linux 上的 io_uring 等技术来提高运营效率。

与传统的高级键值存储(例如 LevelDB 或 RocksDB)不同,MonadDB 专门针对区块链相关的数据结构和访问模式而设计。这种专业化通过减少状态访问延迟实现了更高效的并行执行。MonadDB 显著缩短了状态检索所需的时间,大大改善了传统系统中通常的 10-20 微秒范围。

虽然 Monad 采用了高度专业化的设计方法,但 MonadDB 的架构强调性能和去中心化之间的平衡。它优化了效率,而不需要极端的硬件规格,目标是 32GB 的 RAM,这比其他一些高性能区块链的要求要低得多。这种策略与严重依赖增加 RAM 来缓解状态访问瓶颈的区块链形成了鲜明对比。

Monad该数据库与以太坊的状态结构保持完全兼容,从而能够高效重放以太坊的区块历史,通过执行以太坊测试套件和重放历史数据来确保这一点。

此外,MonadDB 补充了 Monad 的并行执行模型,有助于在处理过程中更快地验证交易输入和输出。高效状态访问和乐观执行之间的这种协同作用支持 Monad 实现每秒超过 10,000 笔交易的目标。

由于键值存储开发的专业性,MonadDB 的开发面临巨大挑战。此外,MonadDB 的细粒度状态访问允许系统区分合约状态的不同组成部分。例如,在 ERC20 代币合约中,影响各种用户余额的交易不会发生冲突。Monad 的这种细粒度方法有助于更有效地并行化交易。

冲突检测发生在尝试并行执行之后,在此期间系统会检查状态的哪些特定部分被访问或修改。然后识别冲突事务并按顺序重新执行,以鼓励更高效的状态访问,因为访问同一状态可以最大限度地减少昂贵的磁盘读取。

MonadBFT

MonadBFT 是 Monad 专有的拜占庭容错共识机制,基于 HotStuff 共识算法的修改版本。其主要目标是实现 1 秒的出块时间和单时隙终结性,重点是交易排序而不是执行。MonadBFT 集成了来自各种 BFT 研究论文的创新,包括分布式异步多领导者容错 (DAMFT) 共识。

该算法利用各种优化来提高共识效率。

  1. 流水线:该技术使各个共识阶段能够重叠,从而提高流程效率。
  2. 延迟执行:这种方法将区块提议与完整状态计算分开。领导者无需包含新的 Merkle 根,从而有更多时间简化执行和共识流程。
  3. 团队通过优化八卦层和点对点网络显著增强了分发机制。此优化侧重于高效广播提案,可能利用先进的树结构。
  4. 概率组装:这种方法减少了数据传输,从而提高了效率。
  5. 数据压缩:该算法采用压缩技术来最小化传输的数据量,包括乐观压缩和概率压缩。

Monad这些优化有几个优点:

  1. 增加执行预算:此功能允许在每个共识回合中有更多的时间执行交易。
  2. 提高资源利用率:提高区块生产过程中计算资源的使用效率。
  3. 减少网络开销:减少达成共识所需的数据传输。
  4. 增加吞吐量的潜力:优化旨在共同支持更高的交易量。

MonadBFT 的设计理念以利用拜占庭容错(BFT)共识的最新研究为中心,优先考虑性能同时确保安全性。

与通常将验证者数量上限设为 100 左右的 Cosmos 链不同,MoandBFT 对活跃验证者的数量没有任何限制。Monad 最初计划推出约 150 名验证者,随着时间的推移,这一数字将不断增长,从而促进更加去中心化的网络,同时保持高性能。

MonadBFT 采用优先 gas 拍卖方法,根据费用水平对交易进行优先排序,从高到低排列。这种方法有助于缩短出块时间并实现单槽最终性,从而实现 Monad 高效交易处理和高吞吐量的目标。

简单来说,MonadBFT 的设计选择包括高度优化的八卦层和对等网络、使用优化的树结构进行高效的提案广播以及概率组装和数据压缩技术的实现。这些选择减少了数据传输并提高了效率,从而有助于实现 Monad 的性能。

结论

Monad 正在积极重写和优化区块链网络的关键组件,以创建一个新的、高效的、可扩展的 Layer 1 区块链。该平台利用乐观的并行执行模型和自定义状态数据库 MonadDB 来增强交易处理。其共识机制 MonadBFT 可确保快速的出块时间和单槽最终性。Monad 的目标是实现每秒 10,000 笔交易的吞吐量,同时保持与以太坊虚拟机 (EVM) 的完全兼容性。这种方法旨在通过提供卓越的速度和高吞吐量来吸引来自 EVM 兼容链的流动性、开发人员和用户。

MonadBeneath the shimmering dance of the aurora borealis, Molandak encounters Wolf in the snow-covered wilderness of Iceland, where the night sky glows with ethereal light

Lecturas Relacionadas

Samsung Relies on Technology Cycles, SK Hynix on HBM, How Did Micron Win a Trillion-Dollar Market Cap?

Micron Technology, the third-largest memory chip maker alongside Samsung and SK Hynix, recently saw its market cap surpass $1 trillion. Founded in 1978 in Boise, Idaho, Micron survived brutal industry cycles while American peers and Japan's memory sector faltered. Its survival is attributed to a dual strategy: leveraging political and legal avenues for critical breathing room, coupled with relentless manufacturing cost control. Historically, Micron sought U.S. government intervention three times. In 1985, it filed an anti-dumping complaint against Japanese firms, leading to the U.S.-Japan Semiconductor Agreement. Ironically, this created an opening for Samsung, which later became its toughest competitor. In 2002, Micron turned "whistleblower" in a DRAM price-fixing investigation, escaping penalties while rivals were fined. In 2017, it sued China's Fujian Jinhua, contributing to its placement on a U.S. entity list, stifling a nascent competitor. However, a major strategic misstep occurred in 2013 with the acquisition of bankrupt Japanese firm Elpida. Integrating Elpida's mobile-DRAM-focused technology diverted resources, causing Micron to miss the critical early decade of development for High Bandwidth Memory (HBM)—the high-performance memory essential for AI chips like NVIDIA GPUs. By the time AI demand exploded in 2022, SK Hynix, which launched the first HBM in 2013, held about 85% of the HBM3 market, leaving Micron with roughly 3%. Micron now faces a triple squeeze. In the high-end HBM market, it lags significantly behind SK Hynix and Samsung. In the mid-to-low end DRAM market, it faces aggressive price competition from China's CXMT. Furthermore, a 2023 Chinese cybersecurity ban on its products slashed its revenue from China, a once-core market, from over 10% to just 7.1% by FY2025, causing it to exit China's data center server business. Beneath its political maneuvering lies Micron's core strength: exceptional manufacturing efficiency and cost control. Decades of engineering have yielded DRAM chips with a smaller cell area than rivals, meaning more chips per wafer and lower unit costs. This efficiency, not subsidies, has allowed it to withstand price wars. While political leverage bought time, Micron is now paying a "time debt" in the HBM race. It is racing to ramp up HBM3E production and develop HBM4, but catching up to competitors who started a decade earlier is a monumental challenge. Its future hinges on whether its expertise in cost control and political strategy can compensate for the lost time in a technology race where early-mover advantage is decisive.

链捕手Hace 21 min(s)

Samsung Relies on Technology Cycles, SK Hynix on HBM, How Did Micron Win a Trillion-Dollar Market Cap?

链捕手Hace 21 min(s)

New AMD Paper Overturns Conventional Wisdom: FP4 Training Instability's Cause Is Not Insufficient Randomness

AMD's new research challenges the conventional understanding of FP4 training instability. While reducing precision from FP8 to FP4 promises doubled computational throughput and is supported by new hardware like NVIDIA Blackwell and AMD MI350 series, training large language models natively with FP4 has been notoriously unstable, often attributed to insufficient stochasticity. The paper "Pretraining large language models with MXFP4 on Native FP4 Hardware" demonstrates successful end-to-end FP4 pre-training of Llama 3.1-8B on AMD MI355X GPUs using the MXFP4 format, achieving a 9-10% overall speedup over FP8. Crucially, it identifies the root cause of instability: not randomness, but the accumulation of *structural micro-scaling errors* along the sensitive weight gradient (Wgrad) path. Through controlled experiments, researchers found that quantizing the Wgrad operation to FP4 caused significant convergence degradation. Counterintuitively, common stochasticity-based mitigation techniques like stochastic rounding and randomized Hadamard transforms worsened performance. In contrast, applying a *deterministic* Hadamard transform successfully stabilized training by ensuring consistent error patterns, reducing the extra token cost from 26-27% to just 8-9%. This work has significant implications: 1) It provides a clear diagnostic for low-precision training instability, steering focus towards structural errors. 2) It pushes FP4 from a primarily inference-focused format into the realm of viable training. 3) It leverages the open OCP Microscaling (MX) standard, promoting cross-vendor compatibility. The research marks a critical step towards more economical large model training by further pushing the boundaries of low-precision computation.

marsbitHace 40 min(s)

New AMD Paper Overturns Conventional Wisdom: FP4 Training Instability's Cause Is Not Insufficient Randomness

marsbitHace 40 min(s)

Will ONDO's 'Tokenization Narrative' Change After Its CEO's Unexpected Passing?

Ondo Finance founder and CEO Nathan Allman has passed away unexpectedly. Allman, a Brown University graduate with a background in private credit and Goldman Sachs' digital asset team, was a key architect of Ondo's pivot from DeFi structured yield products to becoming a leading Real-World Asset (RWA) protocol. He drove the strategy to tokenize traditional financial assets like US Treasuries (OUSG), yield-generating dollar assets (USDY), and US stocks/ETFs (Ondo Global Markets) for on-chain accessibility. The company announced that President Ian De Bode, a former McKinsey partner with a strong institutional strategy and operations background, will succeed Allman as CEO. While Allman's sudden departure presents a near-term challenge, testing market confidence and Ondo's continuity, the project is seen as more than a founder-driven narrative. It has an established product suite and a management team with deep traditional finance experience. The long-term impact hinges on the new leadership's ability to execute. De Bode's expertise in compliance, distribution, and institutional partnerships aligns with RWA's next phase of scaling infrastructure. The core question is whether Ondo can maintain its product momentum and institutional relationships. Ondo's native ONDO token represents governance and RWA narrative value, not direct revenue from the underlying assets. Its future as a "top tokenization play" will depend on the team's continued delivery of product growth, asset scale, and real-world demand, moving beyond the initial emotional shock.

marsbitHace 1 hora(s)

Will ONDO's 'Tokenization Narrative' Change After Its CEO's Unexpected Passing?

marsbitHace 1 hora(s)

Bankless Co-founder's Confession on Selling Off ETH: Ethereum Did the Right Thing, but 'ETH as Money' Has No Future

Bankless co-founder David Hoffman recently sold his remaining ETH holdings, sparking debate within the Ethereum community. In a detailed explanation, Hoffman clarifies that his decision was not based on bearish sentiment towards Ethereum itself, which he remains highly optimistic about, but rather on the conclusion that the "ETH is Money" narrative has largely run its course. Hoffman argues that for ETH to achieve its envisioned status as global money, Ethereum needed to execute flawlessly across multiple layers—governance, technology, and market dominance—in a highly coordinated manner. He acknowledges Ethereum's significant successes and current justified valuation but suggests the window for a major revaluation based on this monetary narrative is closing. The post examines several challenges: the strong correlation between L1 chain activity/fees and native token value; the perceived failure of the "strong version" of crypto (user-owned, egalitarian systems) versus the rise of a "weak version" (efficient ledger technology for traditional finance); and the possibility that ETH's momentum as money was uniquely tied to the distorted conditions of the 2020-2021 period. Crucially, Hoffman highlights a structural tension: Ethereum is architected as a "giver, not a taker," providing critical infrastructure like secure block space and tokenization at cost. This ethos benefits the broader ecosystem (applications, L2s) but doesn't prioritize extracting maximum value for ETH itself. The "ETH is Money" thesis required Ethereum to win a war of overwhelming market dominance—a war its design philosophy refuses to explicitly fight. Therefore, while he sees continued immense success for the Ethereum network and its ecosystem (following a "fat application" theory where value accrues to apps and L2s), Hoffman finds it increasingly difficult to foresee a structural upward revaluation for the ETH asset based on the monetary narrative. His capital reallocation reflects a belief that this particular investment thesis has played out.

Odaily星球日报Hace 1 hora(s)

Bankless Co-founder's Confession on Selling Off ETH: Ethereum Did the Right Thing, but 'ETH as Money' Has No Future

Odaily星球日报Hace 1 hora(s)

Trading

Spot
Futuros
活动图片