File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 20
20
from ethereum .utils .numeric import ceil32 , taylor_exponential
21
21
22
22
from ..blocks import Header
23
- from ..transactions import BlobTransaction , Transaction
23
+ from ..transactions import TX_BASE_COST , BlobTransaction , Transaction
24
24
from . import Evm
25
25
from .exceptions import OutOfGasError
26
26
@@ -305,7 +305,14 @@ def calculate_excess_blob_gas(parent_header: Header) -> U64:
305
305
if parent_blob_gas < TARGET_BLOB_GAS_PER_BLOCK :
306
306
return U64 (0 )
307
307
else :
308
- return parent_blob_gas - TARGET_BLOB_GAS_PER_BLOCK
308
+ target_blob_gas_price = Uint (
309
+ TARGET_BLOB_GAS_PER_BLOCK
310
+ ) * calculate_blob_gas_price (parent_header .excess_blob_gas )
311
+ base_blob_tx_price = TX_BASE_COST * parent_header .base_fee_per_gas
312
+ if base_blob_tx_price > target_blob_gas_price :
313
+ return parent_blob_gas // U64 (3 )
314
+ else :
315
+ return parent_blob_gas - TARGET_BLOB_GAS_PER_BLOCK
309
316
310
317
311
318
def calculate_total_blob_gas (tx : Transaction ) -> U64 :
You can’t perform that action at this time.
0 commit comments