Deutsch한국어 日本語中文EspañolFrançaisՀայերենNederlandsРусскийItalianoPortuguêsTürkçe
Portfolio TrackerSwapBuy CryptoCryptocurrenciesPricingWalletNewsEarnBlogNFTWidgetsCoinStats MidasDeFi Portfolio TrackerIntegrations24h ReportPress KitAPI Docs

OP Stack Ecotone Upgrade: Gas Cost Explained

1M ago
bullish:

1

bearish:

0

Background

On the high level, OP Stack mainly does three things:

  1. Sequencing, which generates and executes L2 blocks, but does not publish to L1 yet.
  2. Publishing L2 data and state commitment to L1.
  3. Deriving L2 states from published L2 data on L1.

Thus OP Stack transaction fees are made up of:

  1. L2 Execution Gas Fee : The cost to run the transaction on OP Stack (L2)
  2. L1 Data Fee: The cost of “rolling up” transactions into batches and submitting them to Ethereum (L1)

Or more formally:

Like Ethereum, OP Stack uses the EIP-1559 mechanism to set the base fee for transactions. The total price per unit gas(a.k.a gas price) that a transaction pays is the sum of the base fee and the optional additional priority fee.

Because OP Stack is EVM equivalent, the gas used by a transaction on OP Stack is exactly the same as the gas used by the same transaction on Ethereum. If a transaction costs 100,000 gas on Ethereum, it will cost 100,000 gas on OP Stack. The only difference is that the gas price on OP Stack is much lower than the gas price on Ethereum so you'll end up paying much less in ETH.

For this post, we’re more interested in the L1 Data Fee part, which hopefully will be greatly reduced after the Ecotone Upgrade.

Let’s quickly dive into the details.

Mechanism

Before Ecotone, OP Stack publishes L2 transactions using calldata. The derivation process will try to decode L2 data from calldata.

After Ecotone, OP Stack has the option to publish L2 transactions using blobs. The derivation process will try to decode L2 data from blobs, but will also fall back to decode from calldata for non-blob transactions.

Let’s take a closer look at the cost of L1 Data Fee before and after the Ecotone Upgrade.

Before Ecotone, a.k.a Bedrock

(Base Fee Scalar accounts for the efficiency gains from data compression and gas gap caused by asynchoronous publishing, and is configured via SystemConfig on L1.)

Refer to here for the implementation details and here for the constant values.

After Ecotone

Refer to here for the implementation details and here for the constant values.

Compare

Let’s substitute the formula for L1 Data Fee before and after Ecotone.

The diff is:

The ratio is:

If L1 Blob Base Fee is negligible compared with L1 Base Fee(which will be the case initially when blobs have few users), then:

Example

Let’s take this transaction as an example for bedrock:

Taking this transaction as an example for ecotone:

References

  1. https://docs.optimism.io/stack/transactions/fees
  2. https://specs.optimism.io/protocol/exec-engine.html#ecotone-l1-cost-fee-changes-eip-4844-da
  3. https://gov.optimism.io/t/upgrade-proposal-5-ecotone-network-upgrade/7669
  4. https://medium.com/@afterdark_labs/how-the-op-stack-works-what-happens-when-you-mint-a-base-day-one-nft-c5abbca37a25
  5. https://dune.com/haddis3/optimism-fee-calculator

If you have any questions, please join our community:


OP Stack Ecotone Upgrade: Gas Cost Explained was originally published in QuarkChain Official on Medium, where people are continuing the conversation by highlighting and responding to this story.

1M ago
bullish:

1

bearish:

0

Manage all your crypto, NFT and DeFi from one place

Securely connect the portfolio you’re using to start.