Skip to content

Commit 9b22385

Browse files
apply review feedback
Co-authored-by: Ansgar Dietrichs <[email protected]> Co-authored-by: lightclient <[email protected]>
1 parent 235b2e2 commit 9b22385

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

EIPS/eip-4844.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ def get_origin(tx: SignedBlobTransaction) -> Address:
234234

235235
### Header extension
236236

237-
The current header encoding is extended with a new 256-bit unsigned integer field `blobs`. This is the running
237+
The current header encoding is extended with a new 256-bit unsigned integer field `excess_blobs`. This is the running
238238
total of excess blobs included on chain since this EIP was activated. If the total number of blobs is below the
239-
average, `blobs` is capped at zero.
239+
average, `excess_blobs` is capped at zero.
240240

241241
The resulting RLP encoding of the header is therefore:
242242

@@ -258,16 +258,18 @@ rlp([
258258
mix_digest,
259259
nonce,
260260
base_fee,
261-
blobs
261+
excess_blobs
262262
])
263263
```
264264

265-
The value of `blobs` can be calculated using the parent header and number of blobs in the block.
265+
The value of `excess_blobs` can be calculated using the parent header and number of blobs in the block.
266266

267267
```python
268-
def calc_excess_blobs(parent: Header, blobs: int) -> int:
269-
adjusted = parent.blobs + blobs
270-
return adjusted - min(TARGET_BLOBS_PER_BLOCK, adjusted)
268+
def calc_excess_blobs(parent: Header, new_blobs: int) -> int:
269+
if parent.excess_blobs + new_blobs < TARGET_BLOBS_PER_BLOCK:
270+
return 0
271+
else:
272+
return parent.excess_blobs + new_blobs - TARGET_BLOBS_PER_BLOCK
271273
```
272274

273275
### Beacon chain validation
@@ -344,13 +346,10 @@ def get_intrinsic_gas(tx: SignedBlobTransaction, pre_state: ExecState) -> int:
344346
return intrinsic_gas
345347

346348
def get_blob_gas(header: Header) -> int:
347-
if header.blobs == 0:
348-
return 0
349-
else:
350-
return fake_exponential(
351-
header.blobs,
352-
GASPRICE_UPDATE_FRACTION_PER_BLOB
353-
)
349+
return fake_exponential(
350+
header.excess_blobs,
351+
GASPRICE_UPDATE_FRACTION_PER_BLOB
352+
)
354353
```
355354

356355
### Networking

0 commit comments

Comments
 (0)