Skip to content

Commit 9100007

Browse files
sebastianstgeoknee
andcommitted
Jovian: DA footprint block limit
Co-authored-by: George Knee <[email protected]>
1 parent 8895ba9 commit 9100007

File tree

3 files changed

+299
-0
lines changed

3 files changed

+299
-0
lines changed
80.9 KB
Loading
79.1 KB
Loading
Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
# Jovian: DA Footprint Block Limit
2+
3+
| | |
4+
| ------------------ | -------------------------------------------------- |
5+
| Author | _Sebastian Stammler_ |
6+
| Created at | _2025-08-12_ |
7+
| Initial Reviewers | _TBD_ |
8+
| Need Approval From | _TBD_ |
9+
| Status | _Draft<!--/ In Review / Implementing Actions / Final-->_ |
10+
11+
## Purpose
12+
13+
Evaluate proposal to add a DA footprint block limit to mitigate DA spam and prevent priority fee auctions from occurring.
14+
This proposal is an alternative to [Custom Calldata Floor Gas](https://github.com/ethereum-optimism/design-docs/pull/294),
15+
avoiding the need to change individual transaction gas mechanics at all.
16+
17+
## Summary
18+
19+
A DA footprint block limit is introduced to mitigate DA spam and prevent priority fee auctions. By tracking DA footprint
20+
of transactions alongside gas, this approach adjusts the block gas limit to account for high estimated DA usage without
21+
altering individual transaction gas mechanics. Preliminary analysis shows minimal impact on most blocks on production
22+
networks like Base or OP Mainnet.
23+
24+
## Problem Statement + Context
25+
26+
<!-- Describe the specific problem that the document is seeking to address as well
27+
as information needed to understand the problem and design space.
28+
If more information is needed on the costs of the problem,
29+
this is a good place to that information. -->
30+
31+
The current L1 cost model doesn't account for *limited L1 data availability (DA) throughput*.
32+
This can lead to network congestion for batchers if the throughput on L2s surpasses that of L1 blob space, or if blob
33+
space is congested for other reasons.
34+
35+
Current L1 throughput is 6 blobs per block at target with a max of 9 blobs per block.
36+
This is approx. `128 kB * 6 / 12 s = 64 kB/s` or `96 kB/s`, resp. The L1 cost is proportional to the L1 origin’s base
37+
fee and blob base fee. But Most OP Stack chains have gas targets high enough to accept far more than 128kb of calldata
38+
per (2s) block. So the calldata floor cost doesn't nearly limit calldata throughput enough to prevent.
39+
40+
The current countermeasure for high DA throughput that's being deployed on production networks is batcher throttling.
41+
When a network is throttled at the builder policy-level, however, its base fee can dive and lead to priority fee
42+
auctions and other unwanted user experience issues.
43+
44+
Also see the design doc [Custom Calldata Floor Gas](https://github.com/ethereum-optimism/design-docs/pull/294) for a
45+
more detailed analysis of the same problem and context and a similar solution.
46+
47+
## Proposed Solution
48+
49+
A _DA footprint block limit_ is introduced to limit the total amount of estimated compressed transaction data that can
50+
fit into a block. The base fee update rules take this new total DA footprint into account, so the base fee market isn't
51+
broken like for policy-level throttling solutions.
52+
53+
The main idea is to introduce a new _DA footprint_ resource that is tracked next to gas, and limit it by the same
54+
block gas limit. This is inspired by the
55+
[Multidimensional Gas Metering](https://ethresear.ch/t/a-practical-proposal-for-multidimensional-gas-metering/22668)
56+
design, but the regular gas isn't touched, like in this design for L1 Ethereum.
57+
58+
Similarly to the regular gas usage of transaction calldata, we calculate a transaction’s _DA footprint_ by taking
59+
its RLP-encoding, calculate the compressed transaction DA usage estimation from
60+
[Fjord](https://specs.optimism.io/protocol/fjord/exec-engine.html#fjord-l1-cost-fee-changes-fastlz-estimator)
61+
and multiply it by a factor, the _DA footprint gas scalar_, to get to the transaction’s DA footprint.
62+
63+
```python
64+
da_usage_estimate = max(minTransactionSize, intercept + fastlzCoef*fastlzSize / 1e6)
65+
da_footprint = da_usage_estimate * da_footprint_gas_scalar
66+
```
67+
68+
Here, `fastlzSize` is the length of the FastLZ-compressed RLP-encoding of a transaction.
69+
70+
Now when evaluating whether a transactions still fits into a block, we take the maximum over the two resources, regular
71+
total gas use of all transactions, and new total DA footprint, and see if this max is still below the block gas limit.
72+
The Multidimensional Gas Metering design introduces a new block field `gas_metered` to differentiate it from `gas_used`
73+
as the sum total of all transaction's gas used. However, it is proposed to just repurpose a block's `gas_used` field to
74+
hold the maximum over both resources' totals:
75+
76+
77+
```python
78+
block.gas_used = max(sum(tx.gas_used), sum(tx.da_footprint if tx.type != DepositTxType))
79+
```
80+
81+
A block's total DA footprint only takes non-Deposit transactions into account, because Deposit transactions aren't part
82+
of batches, so they don't contribute to a block's DA usage.
83+
84+
This definition has the advantage that the base fee update mechanics just keep working, now taking into account high
85+
total block DA footprint.
86+
87+
The `da_footprint_gas_scalar` is comparable to the calldata floor cost. If it's set to a higher value, say 400, you
88+
can expect _roughly_ a 1/10 of incompressible calldata to fit into a block compared to only limiting it by
89+
transaction gas usage alone. If the block is mostly low-calldata transactions that use much more regular gas than DA
90+
footprint, this new mechanism wouldn’t have any effect. This is the case for the vast majority of blocks.
91+
92+
### DA footprint gas scalar
93+
94+
I propose to make the DA footprint gas scalar parameter configurable via the `SystemConfig`. The next Ethereum hardfork
95+
[Fusaka](https://eips.ethereum.org/EIPS/eip-7607) introduces
96+
[Blob Parameter Only Hardforks (EIP-7892)](https://eips.ethereum.org/EIPS/eip-7892) and it is hard to estimate how
97+
quickly blob parameters and the number and throughput of OP Stack chains will evolve over the next months, so it is hard
98+
to set a well-informed constant now that will keep being a good constant for the foreseeable future.
99+
100+
However, I propose to set a DA footprint gas scalar value of `800` as a sane default that should have minimal impact on
101+
existing and future chains, while protecting the OP Stack ecosystem from DA spam attacks because throughput of random
102+
data would be reduced by roughly a factor of 20 compared to what is currently allowed by a block's floor gas limit
103+
alone. See also the next section for an analysis of the impact of different gas scalars on various OP Stack chains.
104+
105+
### Impact on OP Stack Chains
106+
107+
We back-tested the estimated impact of a DA footprint block limit on Base, OP Mainnet, WorldChain, Unichain, Ink, Soneium,
108+
Mode with various gas scalars and found that the vast majority of blocks wouldn't be affected, even with a high gas scalar
109+
value of 800. The full analysis can be found in our
110+
[op-analytics](https://github.com/ethereum-optimism/op-analytics/tree/main/notebooks/adhoc/jovian_analysis) repository.
111+
112+
For each chain, the analysis took the following approach. A random 1% of blocks were sampled from a recent 120 day
113+
period (4/29 - 8/26). Then for each block, the DA footprint was estimated by calculating the FastLZ-based DA usage
114+
estimation for each transaction, and then taking the total sum. This was then compared to the block's gas limit and gas
115+
usage to see if the block would have been impacted by a DA footprint limit. If the DA footprint was below the block's gas
116+
usage, then there wouldn't have been any impact, since the new block gas usage would be defined as the max over the
117+
total transaction gas usages and DA footprints. If it went over the gas usage, but not gas limit, then the impact would
118+
only have been that the new block gas usage would have been set higher (so the base fee may have potentially increased
119+
faster), but the block still wouldn't have been limited. Only if the DA footprint also went over the gas limit, would it
120+
have limited that block's transactions to a smaller DA footprint. For those blocks, we also looked at the
121+
distribution of the excess DA footprint as an indicator of how much those blocks would have been limited.
122+
123+
The following tables show, for each analyzed chain, the resulting statistics.
124+
* *Scalar*: DA footprint gas scalar value.
125+
* *Effective Limit*: The DA usage limit that the given gas scalar would imply (`block_gas_limit / da_footprint_gas_scalar`), in estimated compressed bytes.
126+
* *Exceeding Limit*: Number and percent of blocks for which the total DA footprint exceeds the gas limit. Those blocks
127+
would have been limited to include fewer transactions.
128+
* *Exc. Gas Usage*: Number and percent of blocks for which the total DA footprint exceeds the total gas usage. For those blocks, the `block.gas_used`
129+
field would equal the total block DA footprint instead of the total transaction gas used.
130+
* *Avg. Utilization*: Average utilization of DA footprint resource.
131+
* *Max Utilization*: Maximum utilization of DA footprint resource.
132+
133+
#### OP Mainnet
134+
135+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/op_random_2025-04-29_2025-08-26.html):**
136+
_Sample Size:_ `51,840` blocks
137+
138+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
139+
| -------|-----------------|-----------------|----------------|------------------|-----------------|
140+
| 160 | 250,000 | 0 | 0 | 1.1% | 44.8% |
141+
| 400 | 100,000 | 1 (0.00%) | 3 (0.01%) | 2.8% | 112.1% |
142+
| 600 | 66,666 | 2 (0.00%) | 17 (0.03%) | 4.1% | 168.2% |
143+
| 800 | 50,000 | 10 (0.02%) | 47 (0.09%) | 5.5% | 224.2% |
144+
145+
![OP Mainnet (random) DA size estimation distribution](./assets/da-footprint-block-limit/OPM-random-DA-distribution.png)
146+
147+
**[Top 1 Percentile Calldata Usage](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/op_top_percentile_2025-04-29_2025-08-26.html):**
148+
_Sample Size:_ `52,165`
149+
150+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
151+
|--------|-----------------|-----------------|----------------|------------------|-----------------|
152+
| 160 | 250,000 | 0 | 0 | 1.1% | 40.0% |
153+
| 400 | 100,000 | 0 | 1 | 2.7% | 99.9% |
154+
| 600 | 66,666 | 4 (0.01%) | 8 (0.02%) | 4.1% | 149.9% |
155+
| 800 | 50,000 | 17 (0.03%) | 23 (0.04%) | 5.5% | 199.8% |
156+
157+
158+
#### Base
159+
160+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/base_random_2025-04-29_2025-08-26.html):**
161+
_Sample Size:_ `51,840`
162+
163+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
164+
|--------|-----------------|-----------------|----------------|------------------|-----------------|
165+
| 160 | 937,500 | 0 | 0 | 2.3% | 40.7% |
166+
| 400 | 375,000 | 1 (0.00%) | 8 (0.0%) | 5.8% | 101.8% |
167+
| 600 | 250,000 | 11 (0.02%) | 204 (0.4%) | 8.7% | 152.8% |
168+
| 800 | 187,500 | 44 (0.08%) | 339 (0.7%) | 11.6% | 203.7% |
169+
170+
![Base (random) DA size estimation distribution](./assets/da-footprint-block-limit/Base-random-DA-distribution.png)
171+
172+
173+
**[Top 1 Percentile Calldata Usage](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/base_top_percentile_2025-04-29_2025-08-26.html):**
174+
_Sample Size:_ `52,318`
175+
176+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
177+
|--------|-----------------|-----------------|-----------------|------------------|-----------------|
178+
| 160 | 937,500 | 0 | 0 | 4.4% | 39.2% |
179+
| 400 | 375,000 | 0 | 21 (0.0%) | 11.1% | 98.0% |
180+
| 600 | 250,000 | 107 (0.20%) | 399 (0.8%) | 16.6% | 147.0% |
181+
| 800 | 187,500 | 516 (0.99%) | 1451 (2.8%) | 22.1% | 196.1% |
182+
183+
#### Ink
184+
185+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/ink_random_2025-04-29_2025-08-26.html):**
186+
_Sample size:_ `103,680`
187+
188+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
189+
|--------|-----------------|-----------------|----------------|------------------|-----------------|
190+
| 160 | 187,500 | 0 | 0 (0.0%) | 0.3% | 52.7% |
191+
| 400 | 75,000 | 2 (0.00%) | 1480 (1.4%) | 0.8% | 131.9% |
192+
| 600 | 50,000 | 2 (0.00%) | 3534 (3.4%) | 1.2% | 197.8% |
193+
| 800 | 37,500 | 2 (0.00%) | 4203 (4.1%) | 1.7% | 263.7% |
194+
195+
#### Unichain
196+
197+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/unichain_random_2025-04-29_2025-08-26.html):**
198+
_Sample Size:_ `103,679`
199+
200+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
201+
|--------|-----------------|-----------------|------------------|------------------|-----------------|
202+
| 160 | 187,500 | 0 | 0 | 0.8% | 20.5% |
203+
| 400 | 75,000 | 0 | 407 (0.4%) | 2.0% | 51.2% |
204+
| 600 | 50,000 | 0 | 623 (0.6%) | 3.0% | 76.8% |
205+
| 800 | 37,500 | 1 (0.00%) | 1111 (1.1%) | 4.1% | 102.4% |
206+
207+
208+
#### Soneium
209+
210+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/soneium_random_2025-04-29_2025-08-26.html):**
211+
_Sample Size:_ `51,840`
212+
213+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
214+
|--------|-----------------|-----------------|----------------|------------------|-----------------|
215+
| 160 | 250,000 | 0 | 0 (0.0%) | 1.0% | 14.7% |
216+
| 400 | 100,000 | 0 | 20 (0.0%) | 2.5% | 36.8% |
217+
| 600 | 66,666 | 0 | 700 (1.4%) | 3.8% | 55.2% |
218+
| 800 | 50,000 | 0 | 2360 (4.6%) | 5.0% | 73.6% |
219+
220+
#### Mode
221+
222+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/mode_random_2025-04-29_2025-08-26.html):**
223+
_Sample Size:_ `51,840`
224+
225+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
226+
|--------|-----------------|-----------------|------------------|------------------|-----------------|
227+
| 160 | 187,500 | 0 | 0 | 0.3% | 3.1% |
228+
| 400 | 75,000 | 0 | 50 (0.1%) | 0.7% | 7.7% |
229+
| 600 | 50,000 | 0 | 412 (0.8%) | 1.0% | 11.6% |
230+
| 800 | 37,500 | 0 | 433 (0.8%) | 1.3% | 15.5% |
231+
232+
233+
#### WorldChain
234+
235+
**[Random Sampling](https://htmlpreview.github.io/?https://github.com/ethereum-optimism/op-analytics/blob/main/notebooks/adhoc/jovian_analysis/notebooks/saved_output_html/worldchain_random_2025-04-29_2025-08-26.html):**
236+
_Sample Size:_ `51,840`
237+
238+
| Scalar | Effective Limit | Exceeding Limit | Exc. Gas Usage | Avg. Utilization | Max Utilization |
239+
|--------|-----------------|-----------------|----------------|------------------|-----------------|
240+
| 160 | 225,000 | 0 | 0 | 1.5% | 19.6% |
241+
| 400 | 90,000 | 0 | 10 (0.0%) | 3.8% | 49.1% |
242+
| 600 | 60,000 | 0 | 63 (0.1%) | 5.7% | 73.7% |
243+
| 800 | 45,000 | 0 | 78 (0.2%) | 7.7% | 98.2% |
244+
245+
#### Conclusion
246+
247+
It can be seen that, for all chains, for the vast majority of blocks, there would have been no impact since the DA footprint was smaller
248+
than even the gas usage. This is good, because it means that a DA footprint would only impact a small minority of
249+
blocks, and therefore be nearly imperceptible to most users. But since the limit is in place for every block, it would
250+
still protect against worst-case high-throughput incompressible DA spam, which is the objective.
251+
252+
It can furthermore be seen that even a smaller fraction of blocks would have been limited by a DA footprint limit,
253+
showing that under normal usage scenarios (no incompressible DA spam), a DA footprint limit has a neglegible impact on
254+
chains.
255+
256+
### Resource Usage
257+
258+
<!-- What is the resource usage of the proposed solution?
259+
Does it consume a large amount of computational resources or time? -->
260+
261+
Additional resource usage for block builders or verifiers is considered negligible, because the estimated DA usage of
262+
transactions are already calculated since Fjord and the other calculations are trivial, only involving basic arithmetic.
263+
264+
### Single Point of Failure and Multi Client Considerations
265+
266+
<!-- Details on how this change will impact multiple clients. Do we need to plan for changes to both op-geth and op-reth? -->
267+
268+
## Failure Mode Analysis
269+
270+
<!-- Link to the failure mode analysis document, created from the fma-template.md file. -->
271+
272+
## Impact on Developer Experience
273+
<!-- Does this proposed design change the way application developers interact with the protocol?
274+
Will any Superchain developer tools (like Supersim, templates, etc.) break as a result of this change? -->
275+
276+
* No impact expected on users or tooling simulating individual transactions. In particular, no impact on wallets
277+
expected.
278+
* The invariant is broken that the sum total of all transactions' _gas used_ is the block's _gas used_.
279+
If a block's total DA footprint is larger than the total transaction gas usage, the block's gas used field will be set
280+
to the larger total DA footprint instead. This may impact some analytics-based services like block explorers and those
281+
services need to be educated about the necessary steps to adapt their services to this new calculation of the block gas
282+
used.
283+
284+
## Alternatives Considered
285+
286+
<!-- List out a short summary of each possible solution that was considered.
287+
Comparing the effort of each solution -->
288+
289+
* [Custom Calldata Floor Gas](https://github.com/ethereum-optimism/design-docs/pull/294) - introduces customization of
290+
the calldata floor cost. Comparable effects, but changes gas mechanics of individual transactions.
291+
* [L1 congestion fee](https://github.com/ethereum-optimism/design-docs/pull/312) - only proposal that could partially
292+
mitigate the L1 inclusion lag but is more complex to implement and harder to model and forecast the impact on
293+
production networks. It also doesn't set a hard cap on DA footprint throughput, but relies on market incentives
294+
to drive down calldata use during (modeled) congestion.
295+
296+
## Risks & Uncertainties
297+
298+
<!-- An overview of what could go wrong.
299+
Also any open questions that need more work to resolve. -->

0 commit comments

Comments
 (0)