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
We introduce a new [EIP-2718](./eip-2718.md) transaction, "blob transaction", where the `TransactionType` is `BLOB_TX_TYPE` and the `TransactionPayload` is the RLP serialization of the following `TransactionPayloadBody`:
The fields `chain_id`, `nonce`, `max_priority_fee_per_gas`, `max_fee_per_gas`, `gas_limit`, `value`, `data`, and `access_list` follow the same semantics as [EIP-1559](./eip-1559.md).
111
111
112
112
The field `to` deviates slightly from the semantics with the exception that it MUST NOT be `nil` and therefore must always represent a 20-byte address. This means that blob transactions cannot have the form of a create transaction.
113
113
114
-
The field `max_fee_per_data_gas` is a `uint256` and the field `blob_versioned_hashes` represents a list of hash outputs from `kzg_to_versioned_hash`.
114
+
The field `max_fee_per_blob_gas` is a `uint256` and the field `blob_versioned_hashes` represents a list of hash outputs from `kzg_to_versioned_hash`.
115
115
116
116
The [EIP-2718](./eip-2718.md)`ReceiptPayload` for this transaction is `rlp([status, cumulative_transaction_gas_used, logs_bloom, logs])`.
117
117
118
118
#### Signature
119
119
120
120
The signature values `y_parity`, `r`, and `s` are calculated by constructing a secp256k1 signature over the following digest:
The current header encoding is extended with two new 64-bit unsigned integer fields:
127
127
128
-
-`data_gas_used` is the total amount of data gas consumed by the transactions within the block.
129
-
-`excess_data_gas` is a running total of data gas consumed in excess of the target, prior to the block. Blocks with above-target data gas consumption increase this value, blocks with below-target data gas consumption decrease it (bounded at 0).
128
+
-`blob_gas_used` is the total amount of blob gas consumed by the transactions within the block.
129
+
-`excess_blob_gas` is a running total of blob gas consumed in excess of the target, prior to the block. Blocks with above-target blob gas consumption increase this value, blocks with below-target blob gas consumption decrease it (bounded at 0).
130
130
131
131
The resulting RLP encoding of the header is therefore:
132
132
@@ -149,44 +149,44 @@ rlp([
149
149
0x0000000000000000, # nonce
150
150
base_fee_per_gas,
151
151
withdrawals_root,
152
-
data_gas_used,
153
-
excess_data_gas,
152
+
blob_gas_used,
153
+
excess_blob_gas,
154
154
])
155
155
```
156
156
157
-
The value of `excess_data_gas` can be calculated using the parent header.
157
+
The value of `excess_blob_gas` can be calculated using the parent header.
158
158
159
159
```python
160
-
defcalc_excess_data_gas(parent: Header) -> int:
161
-
if parent.excess_data_gas+ parent.data_gas_used<TARGET_DATA_GAS_PER_BLOCK:
160
+
defcalc_excess_blob_gas(parent: Header) -> int:
161
+
if parent.excess_blob_gas+ parent.blob_gas_used<TARGET_BLOB_GAS_PER_BLOCK:
The block validity conditions are modified to include data gas checks (see the [Execution layer validation](#execution-layer-validation) section below).
189
+
The block validity conditions are modified to include blob gas checks (see the [Execution layer validation](#execution-layer-validation) section below).
190
190
191
191
The actual `data_fee` as calculated via `calc_data_fee` is deducted from the sender balance before transaction execution and burned, and is not refunded in case of transaction failure.
192
192
@@ -254,18 +254,18 @@ On the execution layer, the block validity conditions are extended as follows:
254
254
defvalidate_block(block: Block) -> None:
255
255
...
256
256
257
-
# check that the excess data gas was updated correctly
# ensure the total data gas spent is at most equal to the limit
289
-
assertdata_gas_used<=MAX_DATA_GAS_PER_BLOCK
288
+
# ensure the total blob gas spent is at most equal to the limit
289
+
assertblob_gas_used<=MAX_BLOB_GAS_PER_BLOCK
290
290
291
-
# ensure data_gas_used matches header
292
-
assert block.header.data_gas_used==data_gas_used
291
+
# ensure blob_gas_used matches header
292
+
assert block.header.blob_gas_used==blob_gas_used
293
293
294
294
```
295
295
@@ -387,22 +387,22 @@ However, the point evaluation happens inside a finite field, and it is only well
387
387
388
388
In the interest of not adding another precompile, we return the modulus and the polynomial degree directly from the point evaluation precompile. It can then be used by the caller. It is also "free" in that the caller can just ignore this part of the return value without incurring an extra cost -- systems that remain upgradable for the foreseeable future will likely use this route for now.
389
389
390
-
### Data gasprice update rule
390
+
### Blob gasprice update rule
391
391
392
-
The data gasprice update rule is intended to approximate the formula `data_gasprice = MIN_DATA_GASPRICE * e**(excess_data_gas / DATA_GASPRICE_UPDATE_FRACTION)`,
393
-
where `excess_data_gas` is the total "extra" amount of data gas that the chain has consumed relative to the "targeted" number (`TARGET_DATA_GAS_PER_BLOCK` per block).
394
-
Like EIP-1559, it's a self-correcting formula: as the excess goes higher, the `data_gasprice` increases exponentially, reducing usage and eventually forcing the excess back down.
392
+
The blob gasprice update rule is intended to approximate the formula `blob_gasprice = MIN_BLOB_GASPRICE * e**(excess_blob_gas / BLOB_GASPRICE_UPDATE_FRACTION)`,
393
+
where `excess_blob_gas` is the total "extra" amount of blob gas that the chain has consumed relative to the "targeted" number (`TARGET_BLOB_GAS_PER_BLOCK` per block).
394
+
Like EIP-1559, it's a self-correcting formula: as the excess goes higher, the `blob_gasprice` increases exponentially, reducing usage and eventually forcing the excess back down.
395
395
396
396
The block-by-block behavior is roughly as follows.
397
-
If block `N` consumes `X`data gas, then in block `N+1``excess_data_gas` increases by `X - TARGET_DATA_GAS_PER_BLOCK`,
398
-
and so the `data_gasprice` of block `N+1` increases by a factor of `e**((X - TARGET_DATA_GAS_PER_BLOCK) / DATA_GASPRICE_UPDATE_FRACTION)`.
397
+
If block `N` consumes `X`blob gas, then in block `N+1``excess_blob_gas` increases by `X - TARGET_BLOB_GAS_PER_BLOCK`,
398
+
and so the `blob_gasprice` of block `N+1` increases by a factor of `e**((X - TARGET_BLOB_GAS_PER_BLOCK) / BLOB_GASPRICE_UPDATE_FRACTION)`.
399
399
Hence, it has a similar effect to the existing EIP-1559, but is more "stable" in the sense that it responds in the same way to the same total usage regardless of how it's distributed.
400
400
401
-
The parameter `DATA_GASPRICE_UPDATE_FRACTION` controls the maximum rate of change of the blob gas price. It is chosen to target a maximum change rate of `e(TARGET_DATA_GAS_PER_BLOCK / DATA_GASPRICE_UPDATE_FRACTION) ≈ 1.125` per block.
401
+
The parameter `BLOB_GASPRICE_UPDATE_FRACTION` controls the maximum rate of change of the blob gas price. It is chosen to target a maximum change rate of `e(TARGET_BLOB_GAS_PER_BLOCK / BLOB_GASPRICE_UPDATE_FRACTION) ≈ 1.125` per block.
402
402
403
403
### Throughput
404
404
405
-
The values for `TARGET_DATA_GAS_PER_BLOCK` and `MAX_DATA_GAS_PER_BLOCK` are chosen to correspond to a target of 3 blobs (0.375 MB) and maximum of 6 blobs (0.75 MB) per block. These small initial limits are intended to minimize the strain on the network created by this EIP and are expected to be increased in future upgrades as the network demonstrates reliability under larger blocks.
405
+
The values for `TARGET_BLOB_GAS_PER_BLOCK` and `MAX_BLOB_GAS_PER_BLOCK` are chosen to correspond to a target of 3 blobs (0.375 MB) and maximum of 6 blobs (0.75 MB) per block. These small initial limits are intended to minimize the strain on the network created by this EIP and are expected to be increased in future upgrades as the network demonstrates reliability under larger blocks.
406
406
407
407
## Backwards Compatibility
408
408
@@ -421,7 +421,7 @@ By only broadcasting announcements for blob transactions, receiving nodes will h
421
421
allowing them to throttle throughput to an acceptable level.
422
422
[EIP-5793](./eip-5793.md) will give further fine-grained control to nodes by extending the `NewPooledTransactionHashes` announcement messages to include the transaction type and size.
423
423
424
-
In addition, we recommend including a 1.1x data gasprice bump requirement to the mempool transaction replacement rules.
424
+
In addition, we recommend including a 1.1x blob gasprice bump requirement to the mempool transaction replacement rules.
0 commit comments