排序器(Sequencer)的原理、现状及未来

Odaily星球日报Published on 2024-01-18Last updated on 2024-01-18

Abstract

那么什么是排序器(Sequencer),它在Layer2中又是如何工作的?中心化排序器所面临的问题有哪些?同时排序器未来将如何发展?本文将深入探讨这些问题。

目前 Layer 2 主要的收入来源是用户在 Rollup 上进行交易时所给的 Gas 费,只要再减去 Layer 2 向 Layer 1 提交数据时所交的 Gas 费,剩下的几乎就是纯利润。如下图所示,粗略统计,OP Mainnet 2023 年 6-12 月利润大约为 523 万美元,Arbitrum 利润全年为 1650 万美元,zkSync Era 2023 年 3-12 月利润为 2224 万美元。

排序器(Sequencer)的原理、现状及未来

实现如此巨大的利润背后的秘密是什么呢?其实这与他们唯一运行着的排序器有很大的关系。

那么,什么是排序器(Sequencer),它在 Layer 2 中又是如何工作的?中心化排序器所面临的问题有哪些?同时排序器未来将如何发展?本文将深入探讨这些问题。

排序器(Sequencer)的原理

Sequnencer,中文译为排序器或定序器,它是 Layer 2 中非常关键的角色。其主要功能为接收来自 Layer 2 用户的交易并对其进行执行,最后将对交易排序和压缩后形成的批处理(Batch)提交到 Layer 1 中。

排序器(Sequencer)的原理、现状及未来

或许这样说还是比较抽象,接下来笔者将以具体的例子来类比。以往当用户在以太坊上发生交易时,我们可以形象地看作是自己开车去城里(以太坊)办事,当交易高峰期来临时堵车这样的事情就自然会发生,这时候用户除了等以外,就只能多付点钱让外援(指的是验证者)来接你,不然没有任何办法。

解决堵车问题在现实中有很多种方案,比如发展公共交通、扩宽车道、多修几条路、错峰限号出行等,而 Layer 2 就是以太坊的公共交通方案,排序器(Sequencer)便是公交车师傅。公交车师傅告诉大家,你们不用亲自开车进城了,只要给我一些服务费(比自己开车的费用低)保证给大家送到目的地,这样既省钱又省力。同时为了最大化利用公交车内的空间,公交车师傅一般会把人尽可能的装满才发车,还会对乘客进行指挥、重新排列,例如两个胖子之间可以夹一个瘦子,使车内乘客“严丝合缝”。

了解完这个流程,我们再来回答一些大家关注的问题。

谁可以运行排序器呢?

有几种常见的方案:

  • 中心化的排序器

这种方案则是 Layer 2 团队亲自或指定某个组织唯一运行排序器,因为这种方式效率很高成本却很低,所以是 Layer 2 团队最喜欢的方案;

当然还有其他的方案来决定谁可以运行排序器,笔者将在“去中心化排序器”一节中详细介绍。

  • 完全无许可的排序器

意味着任何人都可以对交易进行排序并提交到 Layer 1 上。但是这种方案虽然看似简单公平,但也有明显的缺点,毕竟排序器并不等于 Layer 1 的矿工或验证者,它们并不提高最终的安全性,只是向主链提交批处理(Batch)。即使多个参与者同时提交批处理(Batch),最后也只有一个会被收录,这就导致了其他排序器的计算资源和 Gas 被大量浪费;

排序器是按什么标准排序呢?

通常来讲有两种排序方式,一个是先到先服务,类似于先上公交车的人可以先占座,先发出的交易也会被先排序;第二个方式是按 Gas 费排序,如果有的用户对自己的交易很急,他可以多给排序器一些钱,那么这时排序器就会优先打包他的交易而不管先来后到。

主流的 Layer 2 多采用第一种方式,但是不管第一种还是第二种本质上也只是符合常理罢了,对于如何排序其实 Layer 2 是没有硬性规定的。排序器甚至可以随心所欲地排序,就像公交车师傅可以拒绝某人上车也可以提前给自己的亲戚朋友占座一样,虽然不符合常理。

排序器可以作恶吗?又该如何防止呢?

理论上排序器可以作恶。

排序器的权力其实非常大,他可以故意撤销某人的交易然后谎报其已经成功了,或者也可以在众多交易中夹杂一个恶意交易(例如将用户在 Layer 2 的资产转移到自己的地址)来使自己获利。

但是,为了防止排序器可能的作恶行为,不同的 Layer 2 也有不同的约束方式。Optimistic Rollup 采用欺诈证明的方式,即首先乐观的认为排序器是诚实的,在争议期内(通常为一周)如果没有验证者证明排序器提交到 Layer 1 的数据有误,那么其提交的数据将永远无法更改;ZK Rollup 则采用的是有效性证明,即对于排序器发布的批处理(Batch)都会进行第一时间的验证,验证通过后交易就会在 Layer 1 得到最终确认,没有争议期。

排序器(Sequencer)的原理、现状及未来

Starknet 排序器运行图

现状:中心化排序器引发的问题

目前主流的 Layer 2 例如 OP Mainnet、Arbitrum One、Starknet 及 zkSync Era 都采用的是中心化排序器方案,由官方或附属组织运行着排序器,例如 Optimism 基金会运行着 OP Mainnet 的排序器、Offchain Labs 运行着 Arbitrum One 的排序器等。

中心化排序器对于 Layer 2 项目来说具有许多好处,例如便于管理、提高效率并且还能赚取一定的收入。虽然它们几乎都承诺会维护用户的利益,不会作恶(现阶段严格按照先到先服务的排序标准),但是中心化排序器依然引起许多用户的担心。

抗审查性弱

排序器由单一的一个中心化实体来运行,那么其抗审查性是无法与 Layer 1 中成千上万的验证者或矿工相比的。团队可能会因为法规的要求而剔除一些交易,或者因为某些原因将一些交易列入黑名单等。尽管目前大多数 Layer 2 都设计了机制,使用户能够绕过排序器直接向 Layer 1 提交交易,但是用户依然需要付出额外的成本。

排序器(Sequencer)的原理、现状及未来

用户自行提交交易的方案(来源:L 2B EAT)

弱活跃性

弱活性也可以理解为单点故障。相比于一秒成千上万的交易请求,一个中心化的排序器因为硬件等原因无法同时处理这么多请求,当一个排序器过载而又没有其他备用排序器时就会引起整个系统宕机,例如 Arbitrum 发放空投时就出现过一段时间的宕机。

获取不当的 MEV 收益

MEV 全称为 Maximal Extractable Value,即最大可提取价值,是指矿工/验证者通过操纵交易(添加、删除、重排交易)所能够获取的额外收益。虽然通常情况下它们会按照 Gas 费从高到低进行排序决定交易被纳入区块的顺序,但一旦监控到有重大利润出现时,矿工可以通过在区块中添加交易、删除交易或改变交易顺序以获取除出块奖励以外的收益,通俗理解就是“即当选手又当裁判”。

在 Layer 2 中,排序器也和 Layer 1 的矿工/验证者类似有着操纵交易顺序的权力。虽然排序器由 Layer 2 团队运行,但本质上我们依然无法完全相信他们,尤其是像 OP Mainnet 使用的还是私有内存池(为用户暂存交易的地方,等待排序器处理),这就相当于是在进行黑箱操作,尽管其声称这样做的原因是为了防止其他人监控交易而获取不当的 MEV 收益。

Sequencer 的未来

主流的 Layer 2 (OP Mainnet、Arbitrum One、Starknet、zkSync Era)也并非没有意识到中心化排序器带来的问题。所以它们都提出了自己的去中心化排序器方案。

不过目前仅还体现在官方文档或白皮书中,似乎相比与将自己的权力和收益分散,它们现在更专注于打造自己的核心竞争力(网络性能、生态建设)。

去中心化排序器

以下笔者将简单介绍几种去中心化排序器的方案:

  • 地理去中心化

这是一种简单粗暴的方式,将几个排序器发布在全球不同的地理位置,并由声誉良好且利益相关的公司/组织运行。他们可以通过轮换的方式来决定谁在一段时期内进行交易排序。虽然依然具有问题,但比起单一的中心化排序器,这种方案还是具有更好的抗审查性和活性。

  • 排序器拍卖

Rollup 可以通过智能合约直接进行排序器拍卖。任何人都可以竞标排序器运行权。这样的拍卖对每个区块进行,也可以针对某一时间段。当然,最后获胜的一方仍要质押一定的保证金,以便在他们作恶时可以对他们进行处罚。同时,拍卖所得的资金 Rollup 也可以进行有效的分配。

  • 领导者选举

此方案为任何人都可以将代币(ETH 或 Layer 2 原生代币)质押到 Layer 2 的智能合约中,每一个提交批处理(Batch)的排序者都从这些质押者中随机抽取(抽中概率也可以与质押金额成正比)。

  • Based Rollup

这是近期在以太坊社区中产生的一种方案,即直接由以太坊的验证者来主导 Layer 2 交易的排序,完全取代 Layer 2 自己的排序器。当然,这个方案相比于前几种操作难度更高,且目前还有许多技术问题待解决。

共享排序器

去中心化排序器方案本质上探讨的是 Layer 2 如何下发排序器的运行权力,在这个过程中 Layer 2 团队依然是主导者。而共享排序器指的则是取消了单个 Layer 2 专属的排序器,多个 Layer 2 同用一个第三方排序器网络。

这样做有诸多好处,例如 Layer 2 之间的原子可组合性(不同的 Layer 2 交易在同一个内存池内)、防止 MEV 提取等。目前有许多项目正在建立一个共享排序器网络,如 Astria、Radius 和 Espresso 等。

总结与思考

消除单点故障和缓解系统性风险是加密精神之一,将排序器去中心的想法某种程度上也是基于这种精神的延伸。但是,如果我们从实际角度出发思考,去中心化排序器或共享排序器是否现在能完美缓解中心化排序器所引发的问题呢?笔者看来未必。

从 MEV 的角度上来说,拿以太坊举例,根据 Flashbots 的数据显示,自以太坊 The Merge 后,其统计的区块提议者(Proposer)已实现了 288829 ETH 的 REV 提取。(注:REV 为已经被提取过的 MEV)

这还只是 Flashbots 统计的不完全数据,可见 MEV 市场在无需许可的以太坊中有多么巨大。

排序器(Sequencer)的原理、现状及未来

良性适当的套利操作而产生的 MEV 有利于市场的稳定,但在巨大 MEV 利益的诱惑下而进行的恶意操作(例如三明治攻击),就会对整个网络产生不利影响。即使矿工自己不作恶,也会滋生出一个链下的勾结和贿赂市场。这显然违背了以太坊理念的初衷,也会严重伤害普通用户的利益,虽然目前以太坊也在寻找解决方案(例如将排序者与提议者分离),但短期内这样的情况依然存在。

以太坊目前 MEV 的格局是市场自发形成的,那么当 Rollup 的排序器同样放开和去中心化后,久而久之会不会也形成这样的市场格局呢?相比于信任 Rollup 团队而可能造成的单点故障,市场无序竞争后引发的混乱和另一种中心化也令人胆战。

同时,共享排序器虽然能使不同的 Rollup 在排序器层面具有了互操作性,但如果未来越来越多这样的第三方共享排序器被使用,本质上它们就成了一个控制多个 Rollup 的网络,其权力也会越来越大。那么,到时会不会又引发同样的中心化问题呢?我们是否又需要某种方案来去中心化共享排序器?这些问题都有待进一步的思考。

区块链的发展与去中心化是个漫长且困难的过程,排序器被人们关注的原因是因为它在整个 Rollup 中扮演着极其重要的角色。相信在未来经过不断的探索与努力,今天所面临的问题都会得到合适的解决。

参考资料:

【 1 】你不是真正的 Rollup

【 2 】MEV:从零和博弈走向三权分立

【 3 】对话 AltLayer、Scroll、Starknet 团队 | 共享排序器和 L2 共识

【 4 】optimistic-rollups-vs-zk-rollups

免责声明:本站所有内容可能涉及项目风险事项,仅供科普与参考之用不构成任何投资建议。请理性看待,树立正确的投资理念,提高防范风险意识。建议在交互与持有之前,综合考虑各种相关因素,包括但不限于个人购买目的以及风险承受能力等。版权须知:引用信息版权属于原媒体及作者。如未经鉴叔 J Club 同意,其他媒体、网站或个人不得转载本站文章,鉴叔 J Club 保留追究上述行为法律责任的权利。

Related Reads

NVIDIA CPU Advances, China's RISC-V Responds: Semiconductor Deep Dive - Part Four

NVIDIA is set to launch its new Vera AI data center CPU in China as early as August, with high pricing. While this move offers a new option, it highlights China's continued dependence on foreign-controlled Arm architecture. In response, the Chinese semiconductor industry is increasingly turning to RISC-V as a strategic alternative for achieving high-performance computing autonomy. The article explores the concept of the "impossible triangle" in CPU development—balancing prosperity, control, and autonomy—and posits that RISC-V's open-source, modular nature offers a unique path to achieving all three. While RISC-V is already dominant in embedded systems, the focus is now shifting to data centers and AI workloads. China has become a global hotspot for RISC-V development, driven by AI-driven compute demand, supply chain concerns from export controls, cost benefits of open-source, and strong policy support. Multiple Chinese companies have reportedly crossed the key performance threshold of 15 SPECint per GHz, a benchmark for entering the high-performance CPU club. Progress extends beyond single-core benchmarks. Companies are developing complete computing subsystems, including commercial-grade coherent network-on-chip (NoC) technology and server processors with up to 40 cores that strictly adhere to the RVA23 standard to ensure software compatibility. Real-world applications are emerging in areas like video transcoding and edge AI. However, significant challenges remain. The RISC-V ecosystem faces fragmentation, immature toolchains and verification processes, and gaps in single-core performance and energy efficiency compared to mature x86 and Arm architectures. The formidable software moat, epitomized by NVIDIA's CUDA, is a long-term hurdle. In conclusion, while RISC-V cannot immediately replace offerings like NVIDIA's Vera, it represents a viable long-term path for China to develop a self-sufficient, high-performance CPU ecosystem. The journey is acknowledged to be long and arduous, requiring sustained effort to overcome technical and ecosystem challenges.

marsbit3h ago

NVIDIA CPU Advances, China's RISC-V Responds: Semiconductor Deep Dive - Part Four

marsbit3h ago

My Coding Betting Dashboard is Profiting, but Polymarket is Truly Not a Good Place for 'Arbitrage'

The author built a custom monitoring dashboard for Polymarket, a prediction market platform, and tested it with $1,600, achieving over 30% returns. However, the core argument is that Polymarket is not a good venue for traditional arbitrage. The dashboard has two main sections: a "Portfolio Dashboard" for tracking active positions with key metrics like total capital, P&L, and a risk-control module using a tier system (T1, T2, T3), and an "Opportunity Watchlist" for monitoring markets. The article details a critical structural trap in binary markets: a bet with a high perceived probability of success still carries a 100% loss risk if wrong. The author's T1/T2/T3 system is designed to manage this by limiting position sizes based on conviction and time horizon, emphasizing that high confidence should not equal high concentration. A key insight is the danger of "pseudo-diversification"—betting on different markets driven by the same underlying variable. The author concludes that Polymarket offers few true low-risk, arbitrage opportunities. It is instead a high-risk environment where wins can create a false sense of mastery, leading to large losses. The platform is better viewed as a training ground for honing judgment through disciplined, framework-driven betting rather than a reliable income source. The tools help transform intuition into structured, rule-based decisions to mitigate the risk of catastrophic errors.

marsbit6h ago

My Coding Betting Dashboard is Profiting, but Polymarket is Truly Not a Good Place for 'Arbitrage'

marsbit6h ago

WeChat AI Card Hands-On Guide: Has the AI Shopping Era Arrived?

**"WeChat AI Card" Practical Test Guide: Has the Era of AI Shopping Arrived?** WeChat has officially launched the "AI Exclusive Card," a feature integrated into its Workbuddy AI assistant. This card is designed to handle payments for AI-initiated purchases. Our hands-on test reveals it's not yet a tool for fully autonomous AI shopping, but rather a controlled payment layer for AI agents. The AI Card functions as an isolated sub-wallet within WeChat Pay. Users must bind the card and transfer funds into it from their main wallet. Crucially, every transaction requires explicit user confirmation via smartphone scan; AI cannot spend autonomously. Currently accessible through the Workbuddy agent, the card targets specific digital consumption scenarios: purchasing paid content (reports, data), calling paid APIs/tools, and subscribing to services. Its design prioritizes security and control by separating funds and mandating approval for each payment. We tested a real-world scenario: ordering bubble tea via Workbuddy using a "Meituan Life Assistant" skill. The process encountered multiple hurdles: high "skill" usage costs (exceeding daily free credits), and most importantly, while a payment was successfully initiated, the AI purchased an incorrect product (a mismatched group-buy coupon instead of the desired drink). This highlights the current limitation: the **AI Card only solves the payment step**. The broader challenge lies in the **AI agent's execution chain**—accurately understanding intent, navigating third-party platforms, selecting the right product, and ensuring proper fulfillment. The payment succeeded, but the purchase failed to meet the user's need. In conclusion, the WeChat AI Exclusive Card is a cautious, early-step experiment in AI commerce. It provides a secure, user-controlled payment method for agent interactions but is not yet capable of reliable, end-to-end complex purchases. For now, it's best used for low-value, low-risk digital services with careful user verification at each step. The vision of AI handling complete shopping tasks remains a work in progress.

marsbit9h ago

WeChat AI Card Hands-On Guide: Has the AI Shopping Era Arrived?

marsbit9h ago

Trading

Spot
Futures
活动图片