Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fees and precompile updates
  • Loading branch information
Turupawn committed Jan 13, 2026
commit 51f9ffc74b1ca0db1e66cbe3866e04f331cdee9f
76 changes: 57 additions & 19 deletions src/content/docs/en/developers/transaction-fees-on-scroll.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,29 @@ when the sequencer commits the data to L1.

As mentioned, the `L1GasPriceOracle` is used to estimate the L1 gas fee given raw transaction data. This is a **push oracle**, updated by a relayer run by Scroll.

The data fee is based on multiple factors:
<Aside type="note" title="Fee Calculation Changes">
The L1 data fee calculation has evolved through several network upgrades:
- **Pre-Curie**: Based on calldata gas costs
- **Curie**: Introduced blob-based data availability with `commitScalar` and `blobScalar`
- **Feynman**: Added compression penalty factor
- **Galileo**: Updated penalty calculation formula
</Aside>

#### Post-Curie Fee Calculation (Current)

- The bytes which are `zeros` and `nonzeros` of an RLP-encoded transaction with Signature
- `l1BaseFee` - Current base fee on the L1
- `overhead` - Additional gas overhead of a data commitment transaction
- `scalingFactor` - A scaling factor used to account for price spikes
- `PRECISION` - A constant used to scale the final fee
Since the [Curie upgrade](/technology/overview/scroll-upgrades/curie-upgrade), transaction data is stored in blobs, and the fee is calculated as:

The following steps are taken to calculate the L1 data fee:
```javascript
l1Fee = (commitScalar * l1BaseFee + blobScalar * txDataLength * l1BlobBaseFee) / PRECISION
```

1. Read three fields `l1BaseFee`, `overhead`, `scalar` from the `L1GasPriceOracle` contract. The slots for these fields in the contract are:
Where `PRECISION = 1e9`.

| Field | Slot |
| --------- | ---- |
| l1BaseFee | 1 |
| overhead | 2 |
| scalar | 3 |
#### Pre-Curie Fee Calculation (Legacy)

Before Curie, the fee was based on calldata gas costs:

1. Read three fields `l1BaseFee`, `overhead`, `scalar` from the `L1GasPriceOracle` contract.

2. Count the number of zero bytes and non-zero bytes from the transaction.
3. Calculate the L1 data fee, given `TX_DATA_ZERO_GAS = 4` and `TX_DATA_NON_ZERO_GAS = 16`[^eip-2028] and `PRECISION = 1e9`:
Expand All @@ -119,31 +125,63 @@ The following steps are taken to calculate the L1 data fee:
function overhead() external view returns (uint256);
```

Returns the current L1 fee overhead
Returns the current L1 fee overhead (used in pre-Curie fee calculation).

#### scalar

```solidity
function scalar() external view returns (uint256);
```

Returns the current l1 fee scalar
Returns the current L1 fee scalar (used in pre-Curie fee calculation).

#### l1BaseFee

```solidity
function l1BaseFee() external view returns (uint256);
```

Returns the latest known l1 base fee
Returns the latest known L1 base fee.

#### l1BlobBaseFee

```solidity
function l1BlobBaseFee() external view returns (uint256);
```

Returns the latest known L1 blob base fee (introduced in Curie upgrade).

#### commitScalar

```solidity
function commitScalar() external view returns (uint256);
```

Returns the current L1 commit fee scalar (introduced in Curie upgrade).

#### blobScalar

```solidity
function blobScalar() external view returns (uint256);
```

Returns the current L1 blob fee scalar (introduced in Curie upgrade).

#### penaltyFactor

```solidity
function penaltyFactor() external view returns (uint256);
```

Returns the current compression penalty factor (introduced in Feynman upgrade).

#### getL1Fee

```solidity
function getL1Fee(bytes memory data) external view returns (uint256);
```

Computes the L1 portion of the fee based on the size of the RLP encoded input transaction, the current L1 base fee, and the various dynamic parameters.
Computes the L1 portion of the fee based on the size of the RLP encoded input transaction, the current L1 base fee, and the various dynamic parameters. The calculation method depends on the current network fork (pre-Curie, Curie, Feynman, or Galileo).

**Returns:** L1 fee that should be paid for the transaction

Expand All @@ -157,9 +195,9 @@ Computes the L1 portion of the fee based on the size of the RLP encoded input tr
function getL1GasUsed(bytes memory data) external view returns (uint256);
```

Computes the amount of L1 gas used for a transaction. Adds the overhead which represents the per-transaction gas overhead of posting the transaction and state roots to L1. Adds 74 bytes of padding to account for the fact that the input does not have a signature.
Computes the amount of L1 gas used for a transaction. After the Curie upgrade, this returns 0 since all transaction data is stored in blobs.

**Returns:** Amount of L1 gas used to publish the transaction.
**Returns:** Amount of L1 gas used to publish the transaction (0 post-Curie).

| Parameter | Description |
| --------- | ----------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/technology/chain/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The block header in Scroll mirrors the structure of Ethereum's. However, certain
| `extraData` | Signature by the block's signer, followed by arbitrary additional data. |
| `mixHash` | Always 0. |
| `nonce` | Always 0. |
| `baseFee` | Currently empty in Scroll because we haven't enabled the EIP-1559. |
| `baseFee` | The base fee for this block. Since the [Curie upgrade](/technology/overview/scroll-upgrades/curie-upgrade), Scroll uses EIP-1559 with the base fee set by the sequencer. |

## Block Time

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/en/technology/chain/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ A transaction is a cryptographically signed message that initiates a state trans

## Transaction Type

Currently, Scroll supports three types of transactions.
Currently, Scroll supports four types of transactions.

- Pre-EIP-155 Transaction: This is to support the [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470) contract.
- Legacy Transaction (refer to [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
- [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) Transaction (Type 2): Supported since the [Curie upgrade](/technology/overview/scroll-upgrades/curie-upgrade). Scroll uses a modified EIP-1559 fee market where the sequencer sets the L2 base fee based on the L1 base fee, and ETH is not burned.
- `L1MessageTx` Typed Transaction (Type: `0x7E`): This is a new [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) transaction introduced in Scroll as described below. This transaction type is for transactions initiated on L1.

Note that [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) and [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) transaction types are not supported in Scroll currently. Scroll will bring back these two transaction types in the future.
Note that [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) access list transactions are not yet supported on Scroll.

### L1 Message Transaction

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/es/technology/chain/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ La block header en Scroll refleja la estructura de Ethereum. Sin embargo, alguno
| `extraData` | Datos arbitrarios adicionales. |
| `mixHash` | Siempre 0. |
| `nonce` | Siempre 0. |
| `baseFee` | Actualmente vacío en Scroll porque no hemos activado el EIP-1559. |
| `baseFee` | La comisión base de este bloque. Desde la [actualización Curie](/technology/overview/scroll-upgrades/curie-upgrade), Scroll utiliza EIP-1559 con la comisión base establecida por el secuenciador. |

## Tiempo de bloque

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/es/technology/chain/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ Una transacción es un mensaje firmado criptográficamente que inicia una transi

## Tipo de Transacción

Actualmente, Scroll admite tres tipos de transacciones.
Actualmente, Scroll admite cuatro tipos de transacciones.

- Transacción Pre-EIP-155: Soporta el contrato [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470).
- Transacción Legacy (consulte [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
- Transacción [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) (Tipo 2): Soportada desde la [actualización Curie](/technology/overview/scroll-upgrades/curie-upgrade). Scroll utiliza un mercado de comisiones EIP-1559 modificado donde el secuenciador establece la comisión base de L2 basándose en la comisión base de L1, y el ETH no se quema.
- Transacción tipo `L1MessageTx` (Tipo: `0x7E`): Se trata de una nueva transacción [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) introducida en Scroll como se describe a continuación. Este tipo de transacción es para transacciones iniciadas en L1.

Ten en cuenta que los tipos de transacción [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) y [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) no están soportados actualmente en Scroll. Scroll incorporará estos dos tipos de transacción en el futuro.
Ten en cuenta que las transacciones de lista de acceso [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) aún no están soportadas en Scroll.

### Transacción de Mensajes en L1

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/tr/technology/chain/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Scroll'daki blok başlığı Ethereum'un yapısını yansıtır. Ancak blok baş
| `extraData` | Bloğu imzalayan kişinin imzası ve ardından isteğe bağlı ek veriler. |
| `mixHash` | Her zaman 0. |
| `nonce` | Her zaman 0. |
| `baseFee` | Scroll'da EIP-1559'u etkinleştirmediğimiz için şu anda boş. |
| `baseFee` | Bu bloğun taban ücreti. [Curie yükseltmesinden](/technology/overview/scroll-upgrades/curie-upgrade) bu yana Scroll, sıralayıcı tarafından belirlenen taban ücreti ile EIP-1559 kullanmaktadır. |

## Blok süresi

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/tr/technology/chain/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import TransactionBatching from "../_images/batching.png"

## İşlem tipi

Şu anda Scroll üç tür işlemi desteklemektedir.
Şu anda Scroll dört tür işlemi desteklemektedir.

- EIP-155 Öncesi İşlem: Bu, [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470) sözleşmesini desteklemek içindir.
- Eski Tip İşlem (bkz. [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
- [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) İşlemi (Tip 2): [Curie yükseltmesinden](/technology/overview/scroll-upgrades/curie-upgrade) bu yana desteklenmektedir. Scroll, sıralayıcının L1 taban ücretine göre L2 taban ücretini belirlediği ve ETH'nin yakılmadığı değiştirilmiş bir EIP-1559 ücret piyasası kullanır.
- `L1MessageTx` Tipi Belirli İşlem (Tip: `0x7E`): Bu, aşağıda açıklandığı gibi Scroll'da tanıtılan yeni bir [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) işlemidir. Bu işlem tipi L1'de başlatılan işlemler içindir.

Unutmayın ki [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) ve [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) işlem tipleri şu anda Scroll'da desteklenmemektedir. Scroll gelecekte bu iki işlem türünü geri getirecektir.
Unutmayın ki [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) erişim listesi işlemleri henüz Scroll'da desteklenmemektedir.

### L1 Mesaj İşlemi

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/zh/technology/chain/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Scroll 中的区块头映射了以太坊的结构。但是修改了区块头中
| `extraData` | 由区块的签名者签名,跟随任意附加数据。 |
| `mixHash` | 始终为 0。 |
| `nonce` | 始终为 0。 |
| `baseFee` | 目前在Scroll中为空,因为我们尚未启用 EIP-1559。 |
| `baseFee` | 此区块的基础费用。自 [Curie 升级](/technology/overview/scroll-upgrades/curie-upgrade)起,Scroll 使用 EIP-1559,基础费用由排序器设置。 |

## 区块时间

Expand Down
5 changes: 3 additions & 2 deletions src/content/docs/zh/technology/chain/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import TransactionBatching from "../_images/batching.png"

## 交易类型

目前,Scroll 支持三种类型的交易
目前,Scroll 支持四种类型的交易

- Pre-EIP-155 交易: 以支持 [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470) 合约。
- Legacy 交易 (参考 [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
- [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) 交易 (类型 2): 自 [Curie 升级](/technology/overview/scroll-upgrades/curie-upgrade)起支持。Scroll 使用修改版的 EIP-1559 费用市场,其中排序器根据 L1 基础费用设置 L2 基础费用,且 ETH 不会被销毁。
- `L1MessageTx` 类型交易 (类型: `0x7E`): 这是 Scroll 引入的一种新的 [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) 交易,如下所述。此交易类型适用于在 L1 上发起的交易。

请注意,Scroll 当前不支持 [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) 和 [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) 交易类型。Scroll 未来将会引入这两种交易类型
请注意,Scroll 当前不支持 [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) 访问列表交易

### L1 Message 交易

Expand Down