Skip to content

Commit 60070fe

Browse files
internal/ethapi, graphql: correct comments about gas price logic (#27752)
1 parent 5c30541 commit 60070fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

graphql/graphql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func (t *Transaction) GasPrice(ctx context.Context) hexutil.Big {
277277
case types.DynamicFeeTxType:
278278
if block != nil {
279279
if baseFee, _ := block.BaseFeePerGas(ctx); baseFee != nil {
280-
// price = min(tip, gasFeeCap - baseFee) + baseFee
280+
// price = min(gasTipCap + baseFee, gasFeeCap)
281281
return (hexutil.Big)(*math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee.ToInt()), tx.GasFeeCap()))
282282
}
283283
}

internal/ethapi/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
14281428
result.GasTipCap = (*hexutil.Big)(tx.GasTipCap())
14291429
// if the transaction has been mined, compute the effective gas price
14301430
if baseFee != nil && blockHash != (common.Hash{}) {
1431-
// price = min(tip, gasFeeCap - baseFee) + baseFee
1431+
// price = min(gasTipCap + baseFee, gasFeeCap)
14321432
price := math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee), tx.GasFeeCap())
14331433
result.GasPrice = (*hexutil.Big)(price)
14341434
} else {

0 commit comments

Comments
 (0)