From 80cd4a18818d06df115970405d73103d7db4bf28 Mon Sep 17 00:00:00 2001 From: gajinder Date: Sun, 3 Nov 2024 09:26:19 +0530 Subject: [PATCH] apply feedback --- EIPS/eip-7742.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/EIPS/eip-7742.md b/EIPS/eip-7742.md index d9a2017809d4a5..6bfc1166d7ed4c 100644 --- a/EIPS/eip-7742.md +++ b/EIPS/eip-7742.md @@ -81,9 +81,15 @@ Furthermore `get_base_fee_per_blob_gas` as specified by [EIP-4844](./eip-4844.md ```python +def calc_excess_blob_gas(parent: Header) -> int: + parent_target_blob_gas = parent.target_blob_count * GAS_PER_BLOB + if parent.excess_blob_gas + parent.blob_gas_used < parent_target_blob_gas: + return 0 + else: + return parent.excess_blob_gas + parent.blob_gas_used - parent_target_blob_gas + def get_base_fee_per_blob_gas(header: Header) -> int: update_fraction = BLOB_BASE_FEE_UPDATE_FRACTION_PER_TARGET_BLOB * header.target_blob_count - return fake_exponential( MIN_BASE_FEE_PER_BLOB_GAS, header.excess_blob_gas, @@ -91,13 +97,13 @@ def get_base_fee_per_blob_gas(header: Header) -> int: ) ``` -Rest the specification of EIP-4844 is not changed +Rest of the [EIP-4844](./eip-4844.md) specification is not changed ### Block construction To kickstart block construction, CL will now provide EL a target and a maximum blob count. These values should be used to ensure the correct number of blobs are included in any constructed payload, and to ensure that the blob base fee accounting is correctly done as specified above. -For a genesis block with no existing parent, the value should be set according to the agreed specification for the target blob count given by that genesis block's protocol rule set. +For a genesis block with no existing parent, the value should be set according to the agreed specification for the target blob count given by that genesis block's protocol rule set. For the purposes of this EIP, the target blob count at genesis is set equivalent to [EIP-4844](./eip-4844.md)'s `TARGET_BLOB_GAS_PER_BLOCK`. ## Rationale