Specifically; rather than using TX_BASE_COST
use POINT_EVALUATION_PRECOMPILE_GAS
and also enforce floor first so an individual blob cost shouldn’t stay under the cost of EL verification
So changing to
def calc_excess_blob_gas(parent: Header) -> int:
base_blob_fee = get_base_fee_per_blob_gas(parent) * GAS_PER_BLOB
base_verification_fee = parent.base_fee_per_gas * POINT_EVALUATION_PRECOMPILE_GAS
if base_verification_fee > base_blob_fee:
# Fee too low relative to execution cost
# increase, but not by more than a max fill would (e.g. div 3 for 6/9)
return parent.excess_blob_gas + parent.blob_gas_used // 3
if parent.excess_blob_gas + parent.blob_gas_used < TARGET_BLOB_GAS_PER_BLOCK:
# Below target usage; blob fee sufficiently high; reset excess
return 0
else:
# Above target usage; normal EIP-4844 excess gas logic
return parent.excess_blob_gas + parent.blob_gas_used - TARGET_BLOB_GAS_PER_BLOCK