Skip to content

Commit

Permalink
Merge pull request #67 from testinprod-io/pcw109550/l1-overhead
Browse files Browse the repository at this point in the history
Include overhead in the L1GasUsed for receipts
  • Loading branch information
ImTei authored Jun 12, 2023
2 parents 849ce1a + e1b4f23 commit 7512c2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/types/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ func (r Receipts) DeriveFields(config *chain.Config, hash libcommon.Hash, number
rollupDataGas := tx.RollupDataGas().DataGas(time, config) // Only fake txs for RPC view-calls are 0.

r[i].L1GasPrice = l1Basefee.ToBig()
r[i].L1GasUsed = new(big.Int).SetUint64(rollupDataGas)
// GasUsed reported in receipt should include the overhead
r[i].L1GasUsed = new(big.Int).Add(new(big.Int).SetUint64(rollupDataGas), overhead.ToBig())
r[i].L1Fee = L1Cost(rollupDataGas, l1Basefee, overhead, scalar).ToBig()
r[i].FeeScalar = feeScalar
}
Expand Down

0 comments on commit 7512c2b

Please sign in to comment.