back to top

Gas Usage Analysis on Dune – Part 2 (Blog)

Fueling Gas Spells on Dune – Part 2: Decoding Optimism’s L2 Fee Architecture

By [Author Name] – March 4 2026

The Dune analytics team released the second installment of its “Fueling Gas Spells” series this week, turning the spotlight on Optimism, one of the leading Optimistic roll‑up solutions on Ethereum. Building on the L1‑focused overview published in part 1, the new blog post walks developers through the mechanics of gas pricing on Optimism, outlines recent protocol upgrades that have trimmed costs, and shares a ready‑to‑run SQL spell for calculating total transaction fees on the network.


What is an L2 and why Optimism matters

Layer‑2 (L2) solutions are designed to alleviate the scalability bottleneck inherent to Ethereum’s base layer. By processing transactions off‑chain and only periodically anchoring compressed batch data to the L1 ledger, L2s retain Ethereum’s security guarantees while delivering higher throughput and lower latency. Optimistic roll‑ups—such as Optimism and Arbitrum—use a “sequencer” that aggregates dozens to hundreds of transactions, posts a succinct proof to L1, and relies on a dispute window to ensure correctness.

Fee composition on Optimism

Unlike the native L1 fee model, Optimism’s cost structure is split into two distinct components:

Component Calculation Key Characteristics
L1 data fee ((\text{gas used}_{\text{call data}} + \text{fixed overhead}) \times \text{dynamic overhead} \times \text{L1 base fee}) Mirrors post‑EIP‑1559 pricing on Ethereum; the fixed overhead is set at 2 100 gas units, while the dynamic overhead (fee scalar) acts as a cushion against sudden spikes on L1.
L2 execution fee (\text{L2 gas used} \times \text{L2 gas price}) L2 gas prices are deliberately low (≈ 0.001 Gwei by default), making this part almost negligible in practice.

The blog notes that any surplus collected via the dynamic overhead is funneled to the “Citizens’ House” public‑goods fund, a mechanism that has been fixed at a scalar of 1 since April 2022.

Impact of recent upgrades

A March 24 2022 protocol enhancement introduced Zlib‑based batch compression for the data posted to L1. While the compression does not alter the fee formula itself, it reduced the volume of calldata by roughly 30‑40 %, translating into a noticeable dip in transaction costs. Dune’s visualisation of this change—captured in a chart by community analyst Msilb7—shows a clear inflection point in gas consumption after the upgrade.

The “gas spell” in practice

Dune Analytics simplifies fee calculations through a dedicated l1_fees column that automatically folds in the fixed and dynamic overheads together with the current base fee. The authors provide a concise SQL snippet that aggregates both L1 and L2 components:

sql
SELECT
‘optimism’ AS blockchain,
l1_fees + (tx.gas_used * tx.gas_price) AS total_tx_fee
FROM optimism.transactions tx;

Running this query against the “Optimism gas fees” spell (linked in the blog) yields a real‑time ledger of transaction costs, starting from the network’s “Regenesis” on 11 Nov 2021—a milestone that delivered full EVM equivalence.

The spell’s open‑source nature means contributors can extend the dataset to cover pre‑Regenesis periods or add supplemental metrics, simply by submitting a pull request to the Dune Spellbook repository.

Analysis

The deep dive underscores a few broader trends in the Ethereum L2 ecosystem:

  1. Fee transparency through analytics platforms – By exposing the exact formulae and providing ready‑made queries, Dune lowers the barrier for developers and auditors to verify cost assumptions, a vital step as L2 adoption widens.
  2. Protocol‑level cost reductions – The Zlib compression upgrade illustrates how modest engineering changes can produce sizable economic benefits without altering user‑facing fee models.
  3. Public‑goods funding mechanisms – The fee scalar’s redirection of excess funds to community projects reflects a growing ethos of “gas as a civic contribution” within L2 designs.

Key Takeaways

  • Optimism’s fees are a blend of L1 data costs and negligible L2 execution charges. The dominant expense is the calldata posted to Ethereum.
  • Post‑EIP‑1559 pricing and a static overhead of 2 100 gas units shape the L1 data fee. A dynamic overhead factor, set to 1, safeguards against volatile L1 fee spikes.
  • Compression of batch data (Zlib) cut transaction fees by up to 40 % after the March 2022 upgrade, confirming the impact of on‑chain data optimization.
  • Dune’s l1_fees column and the provided SQL spell enable instantaneous fee reporting for any Optimism transaction after Regenesis.
  • The spell is open source; community contributions can broaden its scope to include earlier network phases or new analytics.

The series will continue with a focus on Arbitrum in the upcoming “Fueling Gas Spells” installment, promising a comparative look at Optimistic roll‑up fee structures across Ethereum’s leading L2s.

For further reading, consult the Optimism blog on EVM equivalence, the Dune Spellbook repository, and the curated list of Dune‑based analytics dashboards linked in the original post.



Source: https://dune.com/blog/gas-spells-part-2

Exit mobile version