You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/en/developers/transaction-fees-on-scroll.mdx
+57-19Lines changed: 57 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,23 +81,29 @@ when the sequencer commits the data to L1.
81
81
82
82
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.
83
83
84
-
The data fee is based on multiple factors:
84
+
<Asidetype="note"title="Fee Calculation Changes">
85
+
The L1 data fee calculation has evolved through several network upgrades:
86
+
-**Pre-Curie**: Based on calldata gas costs
87
+
-**Curie**: Introduced blob-based data availability with `commitScalar` and `blobScalar`
88
+
-**Feynman**: Added compression penalty factor
89
+
-**Galileo**: Updated penalty calculation formula
90
+
</Aside>
91
+
92
+
#### Post-Curie Fee Calculation (Current)
85
93
86
-
- The bytes which are `zeros` and `nonzeros` of an RLP-encoded transaction with Signature
87
-
-`l1BaseFee` - Current base fee on the L1
88
-
-`overhead` - Additional gas overhead of a data commitment transaction
89
-
-`scalingFactor` - A scaling factor used to account for price spikes
90
-
-`PRECISION` - A constant used to scale the final fee
94
+
Since the [Curie upgrade](/technology/overview/scroll-upgrades/curie-upgrade), transaction data is stored in blobs, and the fee is calculated as:
91
95
92
-
The following steps are taken to calculate the L1 data fee:
1. Read three fields `l1BaseFee`, `overhead`, `scalar` from the `L1GasPriceOracle` contract. The slots for these fields in the contract are:
100
+
Where `PRECISION = 1e9`.
95
101
96
-
| Field | Slot |
97
-
| --------- | ---- |
98
-
| l1BaseFee | 1 |
99
-
| overhead | 2 |
100
-
| scalar | 3 |
102
+
#### Pre-Curie Fee Calculation (Legacy)
103
+
104
+
Before Curie, the fee was based on calldata gas costs:
105
+
106
+
1. Read three fields `l1BaseFee`, `overhead`, `scalar` from the `L1GasPriceOracle` contract.
101
107
102
108
2. Count the number of zero bytes and non-zero bytes from the transaction.
103
109
3. Calculate the L1 data fee, given `TX_DATA_ZERO_GAS = 4` and `TX_DATA_NON_ZERO_GAS = 16`[^eip-2028] and `PRECISION = 1e9`:
@@ -119,31 +125,63 @@ The following steps are taken to calculate the L1 data fee:
119
125
function overhead() external view returns (uint256);
120
126
```
121
127
122
-
Returns the current L1 fee overhead
128
+
Returns the current L1 fee overhead (used in pre-Curie fee calculation).
123
129
124
130
#### scalar
125
131
126
132
```solidity
127
133
function scalar() external view returns (uint256);
128
134
```
129
135
130
-
Returns the current l1 fee scalar
136
+
Returns the current L1 fee scalar (used in pre-Curie fee calculation).
131
137
132
138
#### l1BaseFee
133
139
134
140
```solidity
135
141
function l1BaseFee() external view returns (uint256);
136
142
```
137
143
138
-
Returns the latest known l1 base fee
144
+
Returns the latest known L1 base fee.
145
+
146
+
#### l1BlobBaseFee
147
+
148
+
```solidity
149
+
function l1BlobBaseFee() external view returns (uint256);
150
+
```
151
+
152
+
Returns the latest known L1 blob base fee (introduced in Curie upgrade).
153
+
154
+
#### commitScalar
155
+
156
+
```solidity
157
+
function commitScalar() external view returns (uint256);
158
+
```
159
+
160
+
Returns the current L1 commit fee scalar (introduced in Curie upgrade).
161
+
162
+
#### blobScalar
163
+
164
+
```solidity
165
+
function blobScalar() external view returns (uint256);
166
+
```
167
+
168
+
Returns the current L1 blob fee scalar (introduced in Curie upgrade).
169
+
170
+
#### penaltyFactor
171
+
172
+
```solidity
173
+
function penaltyFactor() external view returns (uint256);
174
+
```
175
+
176
+
Returns the current compression penalty factor (introduced in Feynman upgrade).
139
177
140
178
#### getL1Fee
141
179
142
180
```solidity
143
181
function getL1Fee(bytes memory data) external view returns (uint256);
144
182
```
145
183
146
-
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.
184
+
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).
147
185
148
186
**Returns:** L1 fee that should be paid for the transaction
149
187
@@ -157,9 +195,9 @@ Computes the L1 portion of the fee based on the size of the RLP encoded input tr
157
195
function getL1GasUsed(bytes memory data) external view returns (uint256);
158
196
```
159
197
160
-
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.
198
+
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.
161
199
162
-
**Returns:** Amount of L1 gas used to publish the transaction.
200
+
**Returns:** Amount of L1 gas used to publish the transaction (0 post-Curie).
Copy file name to clipboardExpand all lines: src/content/docs/en/technology/chain/blocks.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ The block header in Scroll mirrors the structure of Ethereum's. However, certain
30
30
|`extraData`| Signature by the block's signer, followed by arbitrary additional data. |
31
31
|`mixHash`| Always 0. |
32
32
|`nonce`| Always 0. |
33
-
|`baseFee`|Currently empty in Scroll because we haven't enabled the EIP-1559. |
33
+
|`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. |
Copy file name to clipboardExpand all lines: src/content/docs/en/technology/chain/transactions.mdx
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,14 @@ A transaction is a cryptographically signed message that initiates a state trans
14
14
15
15
## Transaction Type
16
16
17
-
Currently, Scroll supports three types of transactions.
17
+
Currently, Scroll supports four types of transactions.
18
18
19
19
- Pre-EIP-155 Transaction: This is to support the [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470) contract.
20
20
- Legacy Transaction (refer to [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
21
+
-[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.
21
22
-`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.
22
23
23
-
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.
24
+
Note that [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)access list transactions are not yet supported on Scroll.
Copy file name to clipboardExpand all lines: src/content/docs/es/technology/chain/blocks.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ La block header en Scroll refleja la estructura de Ethereum. Sin embargo, alguno
30
30
|`extraData`| Datos arbitrarios adicionales. |
31
31
|`mixHash`| Siempre 0. |
32
32
|`nonce`| Siempre 0. |
33
-
|`baseFee`|Actualmente vacío en Scroll porque no hemos activado el EIP-1559. |
33
+
|`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. |
- 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.
21
22
- 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.
22
23
23
-
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.
24
+
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.
Copy file name to clipboardExpand all lines: src/content/docs/tr/technology/chain/blocks.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Scroll'daki blok başlığı Ethereum'un yapısını yansıtır. Ancak blok baş
30
30
|`extraData`| Bloğu imzalayan kişinin imzası ve ardından isteğe bağlı ek veriler. |
31
31
|`mixHash`| Her zaman 0. |
32
32
|`nonce`| Her zaman 0. |
33
-
|`baseFee`|Scroll'da EIP-1559'u etkinleştirmediğimiz için şu anda boş. |
33
+
|`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. |
Copy file name to clipboardExpand all lines: src/content/docs/tr/technology/chain/transactions.mdx
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,14 @@ import TransactionBatching from "../_images/batching.png"
14
14
15
15
## İşlem tipi
16
16
17
-
Şu anda Scroll üç tür işlemi desteklemektedir.
17
+
Şu anda Scroll dört tür işlemi desteklemektedir.
18
18
19
19
- EIP-155 Öncesi İşlem: Bu, [Singleton Factory](https://eips.ethereum.org/EIPS/eip-2470) sözleşmesini desteklemek içindir.
20
20
- Eski Tip İşlem (bkz. [EIP-155](https://eips.ethereum.org/EIPS/eip-155))
21
+
-[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.
21
22
-`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.
22
23
23
-
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.
24
+
Unutmayın ki [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930)erişim listesi işlemleri henüz Scroll'da desteklenmemektedir.
0 commit comments