Skip to content

Commit 5592696

Browse files
committed
docs(aggregator.go): update comment to clarify intrinsic gas calculation does not encode EIP-3529 refund cap
1 parent a86a348 commit 5592696

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

pkg/processor/transaction/structlog_agg/aggregator.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,10 @@ func mapOpcodeToCallType(op string) string {
363363
// ExecutionResult into ReceiptGasUsed (post-refund) and BlockGasUsed (pre-refund),
364364
// but the receipt gas semantics that this formula depends on are unchanged.
365365
//
366-
// Formula from int_transaction_call_frame.sql:
367-
//
368-
// IF gas_refund >= receipt_gas / 4 THEN
369-
// intrinsic = receipt_gas * 5 / 4 - gas_cumulative (refund was capped)
370-
// ELSE
371-
// intrinsic = receipt_gas - gas_cumulative + gas_refund (uncapped)
366+
// The computed intrinsic gas value does not encode whether the EVM refund cap
367+
// (EIP-3529: max refund = gasUsed/5) was applied. It is up to the consumer of
368+
// this data to determine whether the cap was hit, using the gas_refund and
369+
// gas_used columns.
372370
func computeIntrinsicGas(gasCumulative, gasRefund, receiptGas uint64) uint64 {
373371
if receiptGas == 0 {
374372
return 0

0 commit comments

Comments
 (0)