揭秘区块链中的速度之王——Solana

Odaily星球日报Опубліковано о 2024-06-09Востаннє оновлено о 2024-06-09

Анотація

Solana 是最快区块链,日均真实TPS达1,054。EVM兼容链的性能瓶颈在于交易执行和虚拟机设计。Solana 通过 PoH、Gulf Stream、流水线、Sealevel、Turbine 和 TowerBFT 等技术实现高吞吐量。

一份性能报告

CoinGecko 于 5 月 17 日发布的 《Fastest Chains》报告中显示,Solana 是大型区块链中速度最快的,最高日均真实 TPS 达到 1, 054 (已经去除了投票交易),Sui 是第二快的区块链,最高日均真实 TPS 达到 854 ,BSC 排名第三,但达到的真实 TPS 还不到 Sui 的一半。

揭秘区块链中的速度之王——Solana

从这份报告可以看出,性能最好的 Solana 和 Sui 都是非 EVM 兼容的区块链,更进一步, 8 个非 EVM 兼容区块链的平均真实 TPS 为 284 , 17 个 EVM 兼容区块链和以太坊 Layer 2 的平均 TPS 仅为 74 ,非 EVM 兼容区块链的性能是 EVM 兼容区块链的 4 倍左右。

本文将会探讨 EVM 兼容区块链的性能瓶颈,并揭开 Solana 的性能之道

EVM 兼容区块链的性能瓶颈

揭秘区块链中的速度之王——Solana

首先,我们泛化 EVM 区块链到一般区块链。一般区块链想要提升 TPS,一般有如下几种做法:

  • 提升节点性能:通过堆硬件资源去提升节点性能,节点的硬件要求会影响去中心化程度,例如以太坊推荐配置,Cpu 4 核,内存 16 G,网络带宽 25 Mbps,普通用户级设备都能达到,去中心化程度较高;Solana 推荐配置相对更高 Cpu 32 核,内存 128 G,网络带宽 1 Gbps,专业级设备才能达到,去中心化程度一般;

  • 改进底层协议:包括网络协议、密码学、存储等,改进区块链底层协议不改变区块链自身的属性,也不影响区块链的运行规则,可以直接提升区块链的性能,但底层技术关注度低,目前研究领域没有重大突破;

  • 扩大区块:增加区块的大小可以包含更多的交易,进而提高区块链的交易吞吐量,例如比特币现金(BCH)将区块从 1 MB 扩大到 8 MB,之后扩展到 32 MB。但扩大区块的同时也会增大传播延迟引发安全威胁, 比如导致分叉可能性增大和 DDoS 攻击;

  • 共识协议:共识协议保证了区块链各个节点对于区块链的状态更新达成一致,是区块链最重要的一重安全门,已经用于区块链的共识机制有 PoW、PoS、PBFT 等。为了满足可扩展性的需求,一般高性能公链都会改进共识协议,并结合自身特殊机制,例如 Solana 基于 PoH 的共识机制,Avalanche 基于雪崩的共识机制;

  • 交易执行:交易执行只关心单位时间内处理的交易或计算任务数量,以太坊等区块链采用串行方式执行区块中的智能合约交易,在串行执行中,CPU 的性能瓶颈是非常明显的,严重制约了区块链的吞吐量。一般高性能公链都会采用并行执行的方式,有的还会提出更利于并行的语言模型来构建智能合约,例如 Sui Move。

对于 EVM 区块链而言,由于限定了虚拟机,即交易的执行环境,因此最大的挑战在于交易执行。EVM 主要有两个性能问题:

  • 256 位:EVM 设计成一台 256 位的虚拟机,目的是为了更易于处理以太坊的哈希算法,它会明确产生 256 位的输出。然而,实际运行 EVM 的计算机则需要把 256 位的字节映射到本地架构来执行,一个 EVM 操作码会对应多个本地操作码,从而使得整个系统变得非常低效和不实用;

  • 缺少标准库:Solidity 中没有标准库,必须自己用 Solidity 代码实现,虽然 OpenZeppelin 使这一情况得到一定改善,他们提供了一个 Solidity 实现的标准库(通过将代码包含在合约中或是以 delegatecall 的形式调用部署好的合约),但是 EVM 字节码的执行速度远不如预编译好的标准库。

如果站在执行优化的角度,EVM 还存在两大不足:

  • 难以做静态分析:区块链中的并行执行意味着同时处理不相关的交易,把不相关的交易看作互不影响的事件。实现并行执行主要挑战是确定哪些交易是不相关的,哪些是独立的,目前部分高性能公链会预先对交易做静态分析,EVM 的动态跳转(dynamic jumps)机制导致代码很难被静态分析;

  • JIT 编译器不成熟:JIT 编译器(Just In Time Compiler)是现代虚拟机常用的优化手段,JIT 最主要的目标是把解释执行变成编译执行。在运行时,虚拟机将热点代码编译成与本地平台相关的机器码,并进行各种层次的优化。目前虽然有 EVM JIT 的项目,但还处于实验阶段,不够成熟。

因此从虚拟机的选择上,高性能公链更多采用的是基于 WASM, eBPF 字节码或 Move 字节码的虚拟机,而非 EVM。例如 Solana 使用自己独特的虚拟机 SVM 和基于 eBPF 的字节码 SBF。

Fastest Chains:Solana

揭秘区块链中的速度之王——Solana

Solana 因其 PoH(Proof of History )机制以及低延迟高吞吐量而闻名,是最著名的“以太坊杀手”之一。

PoH 的核心是一个类似于可验证延迟函数(VDF)的简单哈希算法。Solana 使用一个序列预映像抵抗的哈希函数(SHA-256)实现,该函数持续运行,用一次迭代的输出作为下一次的输入。这个计算在每个验证者的单个核心上运行。

揭秘区块链中的速度之王——Solana

虽然序列生成是顺序和单线程的,但验证可以并行进行,从而在多核系统上实现高效的验证。虽然哈希速度存在上界,但硬件改进可能提供额外的性能提升。

揭秘区块链中的速度之王——Solana

Solana 共识流程

PoH 机制作为可靠且无需信任的时间源,在网络内创建可验证且有序的事件记录。基于 PoH 的计时允许 Solana 网络以预定且透明的方式轮换领导者。这种轮换以固定的时间间隔进行,为 4 个槽(slot),每个槽目前设置为 400 毫秒。这种领导者轮换机制确保每个参与的验证者都有公平的机会成为领导者,是 Solana 网络维护去中心化和安全的重要机制,防止任何单个验证者在网络上获得过多的权力。

揭秘区块链中的速度之王——Solana

每个槽的时间段,领导者提出一个新块,其中包含从用户收到的交易。领导者验证这些交易,打包成一个区块,然后将该块广播到网络的其余验证者。这种提议和广播区块的过程称为区块生产,网络中的其他验证者必须对区块的有效性进行投票。验证者检查区块的内容,确保交易有效并遵守网络规则。如果一个区块获得了绝大多数权益权重的投票,则该区块被视为已确认。此确认过程对于维护 Solana 网络安全和防止双花至关重要。

当前领导者的时间段结束,网络不会停止或等待区块确认,而是会移动到下一个时间段,为后续领导者提供区块生产的机会,整个过程重新开始。这种方法可确保 Solana 网络保持高吞吐量并保持弹性,即使某些验证者遇到技术问题或离线也是如此。

Solana 性能之道

由于 Solana 网络可以提前确认领导者,因此 Solana 不需要公共内存池来保存用户的交易。当用户提交交易时,RPC 服务器将其转换为 QUIC 数据包,并立即将其转发领导者的验证者。这种方法被称为 Gulf Stream,它允许快速的领导者转换和交易的预执行,减少了其他验证者的内存负载。

Solana 的区块数据带入到内核空间,然后传递给 GPU 以进行并行签名验证,一旦 GPU 上验证了签名,数据就会传递给 CPU 进行交易执行,最后返回到内核空间做数据持久化。这种将数据划分为不同硬件部件的多个处理过程,称为流水线技术,能最大化硬件利用率,加快区块的验证和传输速度。

由于 Solana 的交易显式指定访问哪些账户,Solana 的交易调度器可以利用读写锁机制并行执行交易。Solana 交易调度器每个线程都有自己管理的队列,顺序且独立地处理交易,尝试锁定(读写锁)交易的账户并执行交易,账户冲突的交易会稍后执行。这种多线程并行执行技术称为 Sealevel。

领导者传播区块的过程,将 QUIC 数据包(可选地使用纠删码)划分为较小的数据包,并将它们分发给具有分层结构的验证者。这种技术称为 Turbine,主要是减少领导者的带宽使用。

验证者在投票过程中,使用一种针对分叉投票的共识机制。验证者无需等待投票即可继续进行区块生产;相反,区块生产者会持续监控有效的新投票,并实时将其纳入当前区块中。这种共识机制称为 TowerBFT,通过实时合并分叉投票,Solana 确保了更高效、更精简的共识流程,从而提高了整体性能。

针对区块的持久化过程,Solana 开发了 Cloudbreak 数据库,通过以特定方式对账户数据结构进行分区,以受益于顺序操作的速度并采用内存映射文件,从而最大限度地提高 SSD 的效率。

为减轻验证者负担,Solana 将数据存储从验证者转移到名为 Archiver 的节点网络。交易状态的历史记录被拆分为很多碎片,并使用纠删码技术。Archiver 用于存储状态的碎片,但不参与共识。

总结

Solana 的愿景是成为一个其软件按照硬件的速度扩展的区块链,因此 Solana 充分利用当今计算机中可用的所有 CPU、GPU 和带宽能力,以最大化性能,理论最大速度能达到 65, 000 TPS。

正是因为 Solana 的高性能和扩展性,让 Solana 成为处理高频交易和复杂智能合约的首选区块链平台,无论是年初的 DePIN/AI 赛道,还是近期火热的 Meme 赛道,Solana 都展现出巨大的潜力。

以太坊 ETF 推出后,Solana 也成为下一个 ETF 呼声最大的加密货币,尽管 SEC 仍将 Solana 列为证券,短时间内不会批准其他加密货币 ETF。但在加密市场,共识即价值,Solana 的共识或许正变得和比特币与以太坊一样坚不可摧。

Пов'язані матеріали

Micron Shuts Up the Bears, Makes India's 'Buffett' Regret: Sold Too Early, Missed Out on $2 Billion

Indian value investor Mohnish Pabrai, a disciple of Warren Buffett, revealed his costly mistake of selling shares in Micron Technology too early. He initially invested in 2017, holding it for six years and building a position as large as 77% of his portfolio, based on a thesis that the memory chip industry would consolidate into a stable oligopoly of Samsung, SK Hynix, and Micron. However, he sold his entire stake in September 2023, fearing oversupply after Samsung announced production expansion. Shortly after his exit, demand for high-bandwidth memory (HBM) surged with the rise of AI, and Micron's stock price skyrocketed over 15 times in two years. Pabrai estimates this premature sale cost him roughly $20 billion in potential gains. He expressed similar regret over selling his investment in SK Hynix too soon, stating he violated his own principle of holding companies forever. Reflecting on these errors, Pabrai emphasized his core investment checklist principles: avoiding leverage, focusing on the durability of a company's competitive moat, and assessing management's character. Despite these personal trading missteps, his long-term view on the remaining memory chip leaders remains bullish, advising current holders not to sell as "the party is just getting started." He concluded by sharing his philosophical outlook, prioritizing character over wealth, and his goal to donate his entire fortune before his passing.

marsbit1 год тому

Micron Shuts Up the Bears, Makes India's 'Buffett' Regret: Sold Too Early, Missed Out on $2 Billion

marsbit1 год тому

Mihoyo's Next Protagonist Is Her, Who Plays the Piano

Mihoyo, widely recognized for its hit game Genshin Impact, has long harbored a grander ambition: creating a virtual world where one billion people would want to live. While its character design is unparalleled, the company recognizes a fundamental limitation—these beloved virtual characters are not truly "alive." Their dialogue and actions are pre-scripted. This drive for authentic "living" characters has guided Mihoyo's strategic investments in cutting-edge fields like brain-computer interfaces, AI (including an early investment in MiniMax), and nuclear fusion. Following the release of ChatGPT in late 2022, co-founder Cai Haoyu stepped down from management to lead a new overseas AI venture, Anuttacon, focused on creating AI-driven virtual beings. Mihoyo's path has involved experimentation and iteration. Anuttacon's early project, *Whisper of the Stars*, showcased real-time AI conversation but revealed limitations in underlying language models. The team subsequently focused its resources on developing a sophisticated "emotional" large language model, distinct from purely utilitarian AI. Co-founder Liu Wei (Dawei) announced plans to invest up to 100 billion RMB in this AI pursuit. The first tangible product of this vision is *BSide: Olivia Lin*, a free Steam application featuring a piano-playing virtual companion. Unlike typical AI chatbots demanding constant interaction, Olivia Lin operates on a slower, more deliberate rhythm—responding to letters, playing user-submitted melodies, and serving as a desktop presence. This design emphasizes "lifelikeness" over exhaustive conversation, strategically working around current technological constraints while building a sense of authentic connection. The company's journey traces back to its name, "miHoYo," where "mi" pays homage to the virtual singer Hatsune Miku. For nearly two decades, fans have loved Miku, a character unaware of their devotion. Mihoyo's ultimate goal, now backed by massive investment and AI research, is to bridge that gap—to create virtual beings that can truly know they are loved.

marsbit1 год тому

Mihoyo's Next Protagonist Is Her, Who Plays the Piano

marsbit1 год тому

Citrini Research: Taking Stock of 5 Major Investment Themes Overshadowed by the AI Trade

Citrini Research identifies five under-the-radar investment themes potentially overshadowed by the dominant AI trade. With capital and analyst attention overwhelmingly focused on AI infrastructure, these overlooked areas present alpha opportunities as market dynamics shift. **Theme 1: Airlines** – Despite strong fundamentals, stocks like Delta and United have been penalized for 18 months due to macro concerns (tariff-inflation, oil prices), not profitability. A rebound is expected as these headwinds fade, aided by trends like premiumization and the 2026 World Cup. **Theme 2: Senior Housing** – A pure demographic play. The U.S. population over 80 is projected to grow 56% in the next decade, drastically outpacing supply. This creates a compelling need for facilities, benefiting REITs like Welltower and operators like Brookdale. **Theme 3: Live Events & Entertainment** – "Being there" is becoming a luxury. This sector has outperformed even tech over the past decade. Companies like TKO Group (WWE/UFC), Cinemark, and IMAX are capitalizing on demand for premium, in-person experiences. **Theme 4: Exchange Competition** – CME Group's ~98% monopoly in U.S. interest rate derivatives faces its first real challenge from FMX Futures Exchange. Backed by major Wall Street banks, FMX offers lower fees and margin savings. While CME's deep liquidity remains an advantage, FMX provides a competitive alternative. **Theme 5: Fintech Recovery** – Heavily sold off in 2026, fintech stocks like SoFi, Robinhood, and Upstart are showing signs of a rebound based on improving fundamentals—SoFi's stablecoin launch, Robinhood's transformation into a "financial super app," and Upstart's renewed AI lending narrative—rather than a change in sector outlook. The report advises maintaining some AI exposure but diversifying into these neglected "small themes" where mispricing exists due to a simple shortage of investor attention.

marsbit2 год тому

Citrini Research: Taking Stock of 5 Major Investment Themes Overshadowed by the AI Trade

marsbit2 год тому

21Shares Mid-Year Key Report: Bitcoin's Four-Year Cycle Remains Intact, Stablecoins and Tokenization Emerge as New Growth Engines

21Shares Mid-Year Report 2026: Bitcoin Cycle Intact, Stablecoins & Tokenization Emerge as New Engines This mid-year review assesses progress against 21Shares' ten predictions for 2026. While the overarching shift from narrative to fundamentals holds, performance varies. Key findings show Bitcoin's four-year cycle remains evident despite market maturation. Global crypto ETP AUM has declined to ~$140B, lagging the $400B target, though product innovation continues. Stablecoin supply surpassed $320B, demonstrating non-cyclical demand but falling short of the $1T forecast due to slower regulatory clarity. DeFi TVL, stalled at ~$140B, was hindered by major security incidents. Corporate crypto treasuries hold ~1.28M BTC ($100B), with consolidation pressuring weaker players. Prediction markets are on track, with $57.5B volume already surpassing half the $100B annual target. AI agent infrastructure is ready, but adoption is early. Ethereum L2 consolidation is underway, with the top 5 capturing nearly 90% of activity. Compliant token launches have a platform but lack mainstream volume. Tokenized RWAs total ~$31B on public chains, but institutional pipeline growth is strong. In summary, fundamentals like stablecoins, tokenization, and prediction markets are advancing, but targets require faster adoption or price appreciation. The market is maturing, yet cyclical patterns persist.

marsbit2 год тому

21Shares Mid-Year Key Report: Bitcoin's Four-Year Cycle Remains Intact, Stablecoins and Tokenization Emerge as New Growth Engines

marsbit2 год тому

Торгівля

Спот
Ф'ючерси
活动图片