← Crypto 货币与协议

Reasons to have higher L1 gas limits even in an L2-heavy Ethereum

即使在 L2 级以太坊中也需要更高的 L1 Gas 限制的原因
2025-02-14  ·  ---  ·  原文

One important near-term debate in the Ethereum roadmap is the question of how much to increase the L1 gas limit.

以太坊路线图中近期的一个重要争论是 L1 Gas 限制增加多少的问题。

Recently, the L1 gas limit was increased from 30 million to 36 million, increasing capacity by 20%.

近期,L1 Gas 上限从 3000 万增加到 3600 万,容量增加 20%。

Many support following up with much larger increases in the near future.

许多人支持在不久的将来继续大幅上涨。

These increases are made safe by recent and upcoming improvements in technology: efficiency improvements to Ethereum clients, reduced need to store old history due to EIP-4444 (see roadmap ), and later on stateless clients .

最近和即将到来的技术改进使这些增长变得安全:以太坊客户端的效率提高,由于 EIP-4444(请参阅路线图)而减少了存储旧历史记录的需要,以及后来的无状态客户端。

However, before we go down this path, it's important to ask a question: in the context of the rollup-centric roadmap , are higher L1 gas limits the right thing to do in the long term?

然而,在我们走这条路之前,重要的是要问一个问题:在以汇总为中心的路线图的背景下,从长远来看,更高的 L1 Gas 限制是正确的做法吗?

Gas limits are easy to increase, but difficult to decrease - and even if you do decrease them later, the consequences to centralization may well be permanent.

Gas 限额很容易增加,但很难减少 - 即使您后来确实减少了它们,对中心化的影响也可能是永久性的。

We do not want to end up with the centralization risks of heavy L1 usage without actually being sure that we will benefit from that usage.

我们不希望在没有真正确定我们会从这种使用中受益的情况下,最终面临大量使用 L1 的中心化风险。

This post will argue that, even in a world where most usage and applications are on L2, there is value in significantly scaling, because it enables simpler and more secure patterns of application development .

这篇文章将论证,即使在大多数使用和应用程序都在 L2 上的世界中,显着扩展也是有价值的,因为它可以实现更简单、更安全的应用程序开发模式。

This post will not attempt to argue for or against a claim that more applications in general should be on L1 even in the long term.

这篇文章不会试图争论或反对这样一种说法:即使从长远来看,更多的应用程序通常应该放在 L1 上。

Rather, the goal is to argue that eg.

相反,目标是论证例如。

~10x scaling on L1 has long-term value regardless of the outcome of that debate.

无论这场辩论的结果如何,L1 上大约 10 倍的扩展都具有长期价值。

One of the core value propositions of a blockchain is censorship resistance : if a transaction is valid, and you have the funds to pay a market-rate fee, you should be able to reliably get that transaction included onchain, quickly.

区块链的核心价值主张之一是抗审查性:如果交易有效,并且您有资金支付市场费率费用,那么您应该能够快速、可靠地将该交易包含在链上。

In some cases, censorship resistance is needed even on short timescales: if you have a position in a defi protocol, and prices are changing very quickly, then even a 5 minute delay in getting a transaction included could be enough to get you liquidated .

在某些情况下,即使在很短的时间范围内,也需要抵制审查:如果您在 defi 协议中拥有头寸,并且价格变化非常快,那么即使延迟 5 分钟才能将交易纳入其中,也足以让您被清算。

The staker set of the L1 is highly decentralized , making it very difficult to censor a transaction for more than a few slots.

L1 的质押者集是高度去中心化的,因此很难审查多个时段的交易。

There are proposals to improve this property of Ethereum even further, guaranteeing censorship resistance even in cases where eg.

有人建议进一步改善以太坊的这一特性,即使在以下情况下也能保证审查制度的抵抗力。

block building is highly centralized and outsourced.

区块建设是高度集中和外包的。

L2s, on the other hand, rely on either a much more concentrated set of block producers, or a centralized sequencer, which can easily choose to censor users.

另一方面,L2 依赖于一组更加集中的区块生产者,或者依赖于一个集中的排序器,后者可以轻松选择审查用户。

Some L2s (eg.

一些 L2(例如

see Optimism , Arbitrum documentation) do have a force-inclusion mechanism to allow users to submit transactions directly through the L1.

参见 Optimism 、Arbitrum 文档)确实有强制包含机制,允许用户直接通过 L1 提交交易。

Hence, the practical value of the censorship resistance guarantee is dependent on (i) L1 fees being sufficiently low, and (ii) L1 having enough space that users can send bypass transactions even if an L2 censors a large number of users en masse.

因此,抗审查保证的实际价值取决于 (i) L1 费用足够低,以及 (ii) L1 有足够的空间,即使 L2 集体审查大量用户,用户也可以发送旁路交易。

We can do some math to compute how expensive it is to actually use the force-inclusion mechanism.

我们可以做一些数学计算来计算实际使用强制包含机制的成本是多少。

First, let's state some assumptions, which we will also reuse in other sections:

首先,让我们陈述一些假设,我们也将在其他部分中重用这些假设:

Given these assumptions, today bypassing censorship would cost 120000 * 15 * 10**-9 * 2500 = $4.5 .

考虑到这些假设,今天绕过审查制度将花费 120000 * 15 * 10**-9 * 2500 = $4.5 。

To push it below our target, we would need to scale L1 by 4.5x (though note that this is a very rough estimate, because elasticity is so hard to estimate, and even absolute usage levels are hard to estimate).

为了使其低于我们的目标,我们需要将 L1 扩展 4.5 倍(但请注意,这是一个非常粗略的估计,因为弹性很难估计,甚至绝对使用水平也很难估计)。

Often, users will need to move assets from one L2 to another.

通常,用户需要将资产从一个 L2 移动到另一个 L2。

For commonly-traded high-volume assets, the most practical way to do this is intent protocols such as ERC-7683 .

对于常见交易量大的资产,最实用的方法是 ERC-7683 等意图协议。

Only a small number of market makers need to actually do direct movements from one L2 to another; everyone else simply trades against the market makers.

只有少数做市商需要实际从一个 L2 直接转移到另一个 L2;其他人只是与做市商进行交易。

For low-volume assets or NFTs, however, this is not possible, and so to move such assets from one L2 to another, individual users would need to send transactions through L1.

然而,对于小批量资产或 NFT,这是不可能的,因此要将此类资产从一个 L2 转移到另一个 L2,个人用户需要通过 L1 发送交易。

Today, a withdrawal costs ~250,000 L1 gas and a deposit another 120,000 L1 gas .

如今,提款需要花费约 250,000 L1 气体,存入则需要另外 120,000 L1 气体。

Theoretically, this flow can be optimized quite a bit.

理论上,这个流程可以优化很多。

To move an NFT eg.

例如移动 NFT。

from Ink to Arbitrum, the underlying ownership of the NFT has to be transferred from the Ink bridge to the Arbitrum bridge on L1.

从 Ink 到 Arbitrum,NFT 的底层所有权必须从 Ink 桥转移到 L1 上的 Arbitrum 桥。

This is a storage operation and costs only ~5000 gas.

这是一个存储操作,仅花费约 5000 天然气。

Everything else is "just" calls and proofs and with the right logic can be made cheap; let's say a total cost of 7500 gas.

其他一切都“只是”调用和证明,只要逻辑正确,就可以变得便宜;假设总成本为 7500 汽油。

Our ideal goal is $0.05, so this implies a need to scale 5.5x.

我们的理想目标是 0.05 美元,因此这意味着需要扩展 5.5 倍。

Alternatively, we can analyze more directly based on capacity.

或者,我们可以更直接地根据容量进行分析。

Suppose that each user needs to do a cross-L2 transfer of an NFT (or rare ERC20) on average once a month.

假设每个用户平均每月需要进行一次 NFT(或罕见的 ERC20)的跨 L2 转账。

Ethereum's total gas capacity for a month is 18000000 * (86400 * 30 / 12) = 3.88 trillion , or enough for 518 million such transfers.

以太坊一个月的总 Gas 容量为 18000000 * (86400 * 30 / 12) = 3.88 万亿,或者足以进行 5.18 亿次此类转账。

Hence, if Ethereum wanted to serve the whole world (eg.

因此,如果以太坊想服务全世界(例如。

take Facebook's user count of 3.1 billion ), it would need to expand capacity by ~6x, and that's if that's the only thing L1 was for.

以 Facebook 的用户数量 31 亿为例,它需要将容量扩大约 6 倍,而这也是 L1 唯一的用途。

One of the important properties that L2s have, that "alt L1s" do not, is the ability to exit to the L1 if the L2 breaks.

L2 具有“替代 L1”所不具备的重要特性之一,即如果 L2 损坏,能够退出到 L1。

What if all users are not able to get out within a one-week window?

如果所有用户无法在一星期内退出怎么办?

In optimistic rollups, this may actually be fine: a single honest actor can prevent bad state roots from being confirmed indefinitely.

在乐观汇总中,这实际上可能没问题:一个诚实的参与者可以防止不良状态根源被无限期地确认。

In plasma systems, however, there is often a need to get out within one week if data becomes unavailable.

然而,在等离子系统中,如果数据不可用,通常需要在一周内退出。

And even in optimistic rollups, a hostile governance upgrade gives users a 30 day timeline (see: stage 2 definition ) to withdraw their assets.

即使在乐观汇总中,敌意的治理升级也会为用户提供 30 天的时间表(请参阅:第 2 阶段定义)来撤回其资产。

What does this imply?

这意味着什么?

Well, suppose that a single Plasma chain breaks, and an exit costs 120000 gas.

好吧,假设一条 Plasma 链断裂,退出需要花费 120000 个 Gas。

How many users will be able to exit within a week?

一周内有多少用户能够退出?

We can compute: 86400 * 7 / 12 * 18000000 / 120000 = 7.56 million users.

我们可以计算出:86400 * 7 / 12 * 18000000 / 120000 = 756 万用户。

If it's an optimistic rollup with a hostile 30-day-delayed governance upgrade, that increases to 32.4 million users.

如果这是一个乐观的汇总,并进行了 30 天延迟的治理升级,那么用户数量将增加到 3240 万。

Conceivably, you could create a mass-exit protocol that allows many users to exit at the same time.

可以想象,您可以创建一个批量退出协议,允许许多用户同时退出。

Suppose that we push efficiency to the limit, and you only need to do one single SSTORE and a little more (so, 7500 gas) per user.

假设我们将效率推向极限,并且您只需要为每个用户执行一个 SSTORE 和多一点(即 7500 Gas)。

Then, the two numbers increase to 121 million and 518 million , respectively.

然后,这两个数字分别增加到 1.21 亿和 5.18 亿。

Sony has an L2 on Ethereum today .

索尼如今在以太坊上拥有 L2。

Sony's Playstation has about 116 million monthly active users .

索尼的 Playstation 每月约有 1.16 亿活跃用户。

If all those users were to become Soneium users, then Ethereum today would not be scalable enough to support a mass exit event.

如果所有这些用户都成为 Soneium 用户,那么今天的以太坊的可扩展性将不足以支持大规模退出事件。

However, if we implement much more clever mass exit protocols, it just barely would be.

然而,如果我们实施更聪明的大规模退出协议,那就几乎不可能了。

If we want to avoid technically complex hash-commit protocols, we may want to have space for 7500 gas per asset .

如果我们想避免技术上复杂的哈希提交协议,我们可能希望每个资产有 7500 个 Gas 的空间。

I currently have 9 assets of significant value on my primary wallet on Arbitrum; if you take that as an estimate, then L1 potentially needs to scale by ~9x.

我目前在 Arbitrum 的主钱包上有 9 项具有重要价值的资产;如果您以此作为估计,那么 L1 可能需要扩展约 9 倍。

The other concern for users is that even if they can scale safely, they would lose a lot of money to very high gas costs.

用户的另一个担忧是,即使他们可以安全地扩展,他们也会因高昂的天然气成本而损失大量资金。

Let's analyze the gas costs, using both present-day and "ideal" costs for an exit:

让我们使用当前的退出成本和“理想”的退出成本来分析天然气成本:

The problem with these estimates, however, is that in a mass exit situation, everyone would be trying to exit at the same time , and so gas costs would be significantly higher.

然而,这些估计的问题在于,在大规模退出的情况下,每个人都会试图同时退出,因此天然气成本会明显更高。

We have seen entire days where the L1's average daily gas cost goes above 100 gwei.

我们已经看到 L1 的平均每日 Gas 成本整天超过 100 gwei。

If we take 100 gwei as a baseline, then we get a withdrawal cost of $1.88, implying a need for L1 to scale 1.9x to handle exits affordably (under $1).

如果我们以 100 gwei 作为基准,那么我们的提现成本为 1.88 美元,这意味着 L1 需要扩展 1.9 倍才能以经济实惠的方式处理退出(低于 1 美元)。

Note also that if you want users to be able to exit all their assets at once, without needing technically complex hash-commit protocols, then that may imply 7500 gas per asset., then withdrawal costs increase to either $2.5 or $16.8, depending on your parameters, with corresponding implications to how much L1 needs to scale to keep withdrawals affordable.

另请注意,如果您希望用户能够立即退出所有资产,而不需要技术上复杂的哈希提交协议,那么这可能意味着每个资产需要 7500 个 Gas。那么提款成本会增加到 2.5 美元或 16.8 美元,具体取决于您的参数,相应地影响 L1 需要扩展多少才能使提款负担得起。

Many tokens are being launched on L2s today.

今天,许多代币都在 L2 上推出。

This has an underrated security concern: if an L2 goes through a hostile governance upgrade, then an ERC20 launched on that L2 could start issuing an unlimited number of new tokens, and there would be no way to stop those tokens from leaking into the rest of the ecosystem.

这存在一个被低估的安全问题:如果 L2 经历了恶意的治理升级,那么在该 L2 上启动的 ERC20 可能会开始发行无限数量的新代币,并且无法阻止这些代币泄漏到生态系统的其他部分。

If a token is issued on L1, the consequences of one L2 going astray are mostly bounded to that L2.

如果在 L1 上发行代币,那么一个 L2 误入歧途的后果大多与该 L2 相关。

Over 200,000 ERC20 tokens have been launched on L1 so far.

迄今为止,L1 上已推出超过 200,000 个 ERC20 代币。

Supporting even 100x that would be feasible.

甚至支持 100 倍也是可行的。

However, for launching ERC20s on L1 to be a popular option, it needs to be cheap.

然而,要在 L1 上推出 ERC20 成为一种流行的选择,它需要便宜。

Let's take eg.

让我们以例如。

the Railgun token (a major privacy protocol ).

Railgun 令牌(一种主要的隐私协议)。

Here is its deployment transaction.

这是它的部署事务。

It cost 1.647 million gas, which is $61.76 under our assumptions.

它花费了 164.7 万天然气,根据我们的假设,这是 61.76 美元。

For a company, this cost is fine as-is.

对于一家公司来说,这个成本照原样来说就很好了。

In principle, this could be optimized a lot, especially for projects that launch lots of tokens with the same logic.

原则上,这可以进行很多优化,特别是对于以相同逻辑发行大量代币的项目。

However, even if we get the cost down to 120000 gas, it's still $4.5.

然而,即使我们将成本降低到 120000 Gas,它仍然是 4.5 美元。

If we give ourselves the goal of eg.

如果我们给自己设定一个目标,例如。

bringing Polymarket to L1 (at least asset issuance; trading can still happen on L2s), and we want lots of micro-markets happening, then following our target goal above of $0.25, we would need to scale L1 by ~18x.

将 Polymarket 引入 L1(至少是资产发行;交易仍然可以在 L2 上进行),并且我们希望出现大量微型市场,然后按照我们高于 0.25 美元的目标,我们需要将 L1 规模扩大约 18 倍。

Keystore wallets are a type of wallet that has modifiable verification logic (for changing keys, signature algorithms, etc) that automatically propagates across all L2s.

密钥库钱包是一种具有可修改验证逻辑(用于更改密钥、签名算法等)的钱包,可自动在所有 L2 之间传播。

The verification logic sits on L1, and L2s use synchronous reads (eg.

验证逻辑位于 L1,L2 使用同步读取(例如

L1SLOAD , REMOTESTATICCALL ) to read the logic.

L1SLOAD 、 REMOTESTATICCALL )来读取逻辑。

Keystore wallets can be done with the verification logic on an L2, but this adds a lot more complexity .

密钥库钱包可以通过 L2 上的验证逻辑来​​完成,但这会增加很多复杂性。

Suppose that each user needs to do a key change or account upgrade operation once a year, and we have 3.1 billion users.

假设每个用户每年需要进行一次密钥更改或帐户升级操作,我们有31亿用户。

If each operation costs 50,000 gas, then we get a gas consumption per slot of 50000 * 3100000000 / (31556926 / 12) ~= 59 million , about 3.3x the current target.

如果每个操作花费 50,000 个 Gas,那么我们得到每个槽的 Gas 消耗量为 50000 * 3100000000 / (31556926 / 12) ~= 5900 万,大约是当前目标的 3.3 倍。

We could optimize very hard, but making key chance operations initiated on L2, but stored on L1 (credit the Scroll team for this idea).

我们可以非常努力地优化,但在 L2 上启动关键机会操作,但存储在 L1 上(这一想法归功于 Scroll 团队)。

This would reduce gas consumption to potentially a storage write and a little more (let's once again say 7500 gas), which would allow keystore updates to be made with about half of Ethereum's current gas capacity.

这将减少潜在的存储写入的 Gas 消耗量以及更多(让我们再次假设 7500 Gas),这将允许使用以太坊当前 Gas 容量的大约一半来进行密钥库更新。

From this perspective, a 1.1x increase would be sufficient to make keystore wallets sufficiently affordable.

从这个角度来看,1.1 倍的增长足以使密钥库钱包变得足够实惠。

For cross-L2 interoperability to be fast and general-purpose and trustless, we need L2s to frequently post to L1, so that they can be directly aware of each other's state.

为了使跨 L2 互操作性快速、通用且无需信任,我们需要 L2 经常向 L1 进行发布,以便它们可以直接了解彼此的状态。

To get optimally low latency, L2s need to commit to L1 every slot.

为了获得最佳的低延迟,L2 需要将每个时隙提交给 L1。

With today's technology (ZK-SNARKs), this is a cost of ~500,000 per L2, and so Ethereum would only be able to support 36 L2s (compare: L2beat tracks about 150 , including validiums and optimiums).

使用当今的技术(ZK-SNARK),每个 L2 的成本约为 500,000,因此以太坊只能支持 36 个 L2(比较:L2beat 跟踪大约 150 个,包括验证和优化)。

But what's more important is that it is too economically unviable to do this: at an approximate long-term average gas price of 15 gwei and an ETH price of $2500, the cost per year of submitting is 500000 * 15 * 10**-9 * (31556926 / 12) * 2500 = $49M per year .

但更重要的是,这样做在经济上太不可行:以大约 15 gwei 的长期平均 Gas 价格和 2500 美元的 ETH 价格计算,每年提交的成本为 500000 * 15 * 10**-9 * (31556926 / 12) * 2500 = $49M 每年。

If we used aggregation protocols , the cost could again drop, in the limit perhaps about 10,000 gas per submission because the aggregation mechanism is somewhat more complex than just updating a single storage slot.

如果我们使用聚合协议,成本可能会再次下降,每次提交的限制可能约为 10,000 Gas,因为聚合机制比仅仅更新单个存储槽要复杂一些。

This would make submission cost about $1M per year per L2.

这将使每个 L2 每年的提交成本约为 100 万美元。

Ideally, we want submitting to L1 every slot to be a no-brainer.

理想情况下,我们希望将每个槽都提交给 L1 是理所当然的。

Doing that would again require significant L1 capacity increases.

这样做将再次需要显着增加 L1 容量。

$100k per year is a reasonably small cost for an L2 team, $1m per year is not.

对于 L2 团队来说,每年 10 万美元的成本相当小,但每年 100 万美元则不然。

Keep in mind that the first and second columns are additive, eg.

请记住,第一列和第二列是相加的,例如。

if keystore wallet operations are taking up half the current gas consumption, there needs to be enough space to run an L2 mass exit on top of that .

如果密钥库钱包操作占用了当前 Gas 消耗的一半,则需要有足够的空间来运行 L2 大规模退出。

Additionally, keep in mind once again that the cost-based estimates are extremely approximate.

此外,请再次记住,基于成本的估算是非常近似的。

Demand elasticity (how much gas costs respond to gas limit changes, especially in the long run) are very hard to estimate, and on top of that there is a lot of uncertainty in how the fee market will evolve even given a fixed level of usage.

需求弹性(多少 Gas 成本对 Gas 限制变化做出反应,尤其是从长远来看)很难估计,最重要的是,即使使用量固定,费用市场将如何演变也存在很大的不确定性。

Altogether, this analysis shows that there is significant value to ~10x scaling of L1 gas even in an L2-dominated world.

总而言之,该分析表明,即使在 L2 主导的世界中,将 L1 气体缩放约 10 倍也具有重要价值。

This in turn implies that short-term L1 scaling that can be done in the next 1-2 years is valuable regardless of what the long-term picture ends up looking like.

这反过来意味着,无论长期情况如何,未来 1-2​​ 年内可以完成的短期 L1 扩展都是有价值的。

中文为机器翻译,仅供参考。