以太坊大概并不太担心 “向下兼容” 的问题。几年前波卡生态也都是一路升级走过来的,重要的几个 DeFi 应用从 V1、V2 到 V3、V4 的迭代,用户几乎没有太多感知,何况没什么不能被改变的...
V 的这篇新博客里提到了 Apple 的 Rosetta 系统,精准地反应了出 Ethereum 主网若想把 EVM 换成其他 VM 将遭遇的技术挑战,本质上就像当年 Apple 舍弃 Intel、转向基于 Arm 架构的自研 M 系列芯片。 这到底难在哪儿? 我们之前说过,任何高级语言写出的代码,最终都得落到 某条指令集 上运行: - 如果你的电脑的CPU是 Intel/AMD 的,那么程序就按照 x86 指令集执行 - 如果是 Apple M 系列 芯片,程序最终会按 Arm 指令集在 CPU 上跑 然后Recall一下程序究竟是怎么来的? 程序员通过高级语言写完代码后,需要通过编译器,把它编译成“针对某操作系统、某指令集”的可执行文件。下载应用时你常见的 “Linux-x86”“macOS-x86”“macOS-Arm” 就在说明这一点,文件名后缀代表了目标指令集(为啥还有操作系统的事,下次可以说) 那Tim,代价是什么呢?😡 Apple 决定换芯那一刻,海量应用并没有现成的 编译好的Arm 版本,结果就是 macOS-x86 的程序根本无法原生跑在 M 芯片上。 怎么办?找个翻译:这便是 Rosetta 的由来。 Rosetta ,来自罗塞塔石碑。牛逼在于使用了三种古语言记录了同一内容,其中的古希腊语成为破解埃及象形文字的钥匙。同理,Rosetta主要在两套指令集之间充当“翻译层”,把 A 指令集 编译出的程序 动态或一次性转译成 B 指令集。这样之前的程序也能在使用了新的指令集的硬件上无缝运行。得益于“计算等价性”,转译后的程序输出完全一致,但是会消耗一部分的性能。 为什么现在很少再提 Rosetta?随着 M芯片系列生态成熟,开发者在更新应用时通常,会再编译一份 Arm 版本的程序。只有那些年代久远、无人维护的老软件,还得靠 Rosetta 托底。 所以,如果以太坊真要替换 EVM,基本得重走 Apple 的迁移之路: - 先造自己的 “Rosetta”,让旧合约字节码能在新 VM 上继续执行 - 再循序渐进地让新合约直接面向原生新 VM 编译 从铺设兼容层到最终覆盖全部旧合约,这条路依旧很长很长很长很长。
The content on this page is provided by third parties. Unless otherwise stated, OKX is not the author of the cited article(s) and does not claim any copyright in the materials. The content is provided for informational purposes only and does not represent the views of OKX. It is not intended to be an endorsement of any kind and should not be considered investment advice or a solicitation to buy or sell digital assets. To the extent generative AI is utilized to provide summaries or other information, such AI generated content may be inaccurate or inconsistent. Please read the linked article for more details and information. OKX is not responsible for content hosted on third party sites. Digital asset holdings, including stablecoins and NFTs, involve a high degree of risk and can fluctuate greatly. You should carefully consider whether trading or holding digital assets is suitable for you in light of your financial condition.