Account for blob gas in an Ethereum transaction
A rollup batch can consume two kinds of gas. A ledger that multiplies execution gas by its price alone understates the cost of a blob transaction.
Reconcile both receipt fields
For a type-3 receipt, convert the execution and blob quantities to integers. In an illustrative one-blob receipt, let execution use 50,000 gas at 10 gwei and blob gas use 131,072 units at 2 wei.
fee = gasUsed × effectiveGasPrice + blobGasUsed × blobGasPrice
50000 × 10000000000 + 131072 × 2 = 500000000262144
The total is 500,000,000,262,144 wei. A blob fee cap on the signed transaction bounds a price the sender is willing to pay. Use the actual blob price for a historical invoice.
Keep blob data availability separate
The transaction body carries versioned hashes that identify blob commitments. Fetching the execution transaction gives those identifiers. Retrieving the blob payload itself requires a data source that still retains it. eips.ethereum.org EIP-4844