File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -284,9 +284,16 @@ def calculate_excess_blob_gas(parent_header: Header) -> U64:
284
284
excess_blob_gas: `ethereum.base_types.U64`
285
285
The excess blob gas for the current block.
286
286
"""
287
- parent_blob_gas = (
288
- parent_header .excess_blob_gas + parent_header .blob_gas_used
289
- )
287
+ # At the fork block, these are defined as zero.
288
+ excess_blob_gas = U64 (0 )
289
+ blob_gas_used = U64 (0 )
290
+
291
+ if isinstance (parent_header , Header ):
292
+ # After the fork block, read them from the parent header.
293
+ excess_blob_gas = parent_header .excess_blob_gas
294
+ blob_gas_used = parent_header .blob_gas_used
295
+
296
+ parent_blob_gas = excess_blob_gas + blob_gas_used
290
297
if parent_blob_gas < TARGET_BLOB_GAS_PER_BLOCK :
291
298
return U64 (0 )
292
299
else :
You can’t perform that action at this time.
0 commit comments