diff --git a/EIPS/eip-4844.md b/EIPS/eip-4844.md index 8d3eff0378bf4a..d81f9d4f18e97e 100644 --- a/EIPS/eip-4844.md +++ b/EIPS/eip-4844.md @@ -234,9 +234,9 @@ def get_origin(tx: SignedBlobTransaction) -> Address: ### Header extension -The current header encoding is extended with a new 256-bit unsigned integer field `blobs`. This is the running +The current header encoding is extended with a new 256-bit unsigned integer field `excess_blobs`. This is the running total of excess blobs included on chain since this EIP was activated. If the total number of blobs is below the -average, `blobs` is capped at zero. +average, `excess_blobs` is capped at zero. The resulting RLP encoding of the header is therefore: @@ -258,16 +258,18 @@ rlp([ mix_digest, nonce, base_fee, - blobs + excess_blobs ]) ``` -The value of `blobs` can be calculated using the parent header and number of blobs in the block. +The value of `excess_blobs` can be calculated using the parent header and number of blobs in the block. ```python -def calc_excess_blobs(parent: Header, blobs: int) -> int: - adjusted = parent.blobs + blobs - return adjusted - min(TARGET_BLOBS_PER_BLOCK, adjusted) +def calc_excess_blobs(parent: Header, new_blobs: int) -> int: + if parent.excess_blobs + new_blobs < TARGET_BLOBS_PER_BLOCK: + return 0 + else: + return parent.excess_blobs + new_blobs - TARGET_BLOBS_PER_BLOCK ``` ### Beacon chain validation @@ -344,13 +346,10 @@ def get_intrinsic_gas(tx: SignedBlobTransaction, pre_state: ExecState) -> int: return intrinsic_gas def get_blob_gas(header: Header) -> int: - if header.blobs == 0: - return 0 - else: - return fake_exponential( - header.blobs, - GASPRICE_UPDATE_FRACTION_PER_BLOB - ) + return fake_exponential( + header.excess_blobs, + GASPRICE_UPDATE_FRACTION_PER_BLOB + ) ``` ### Networking