Skip to content

Commit

Permalink
Fix effective gas price calculation (#2303)
Browse files Browse the repository at this point in the history
6351612 introduced the bug by
accidentally losing the negation in `if
!s.b.ChainConfig().IsLondon(bigblock)`. This results in wrong
`effectiveGasPrice` values to be returned from the RPC. The actually
transferred fees are correct.
  • Loading branch information
karlb authored Apr 24, 2024
1 parent 8c10ff2 commit 8943a5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2135,7 +2135,7 @@ func generateReceiptResponse(ctx context.Context, backend Backend, receipt *type
fields["from"], _ = types.Sender(signer, tx)
fields["to"] = tx.To()
// Assign the effective gas price paid
if backend.ChainConfig().IsLondon(new(big.Int).SetUint64(blockNumber)) {
if !backend.ChainConfig().IsLondon(new(big.Int).SetUint64(blockNumber)) {
fields["effectiveGasPrice"] = hexutil.Uint64(tx.GasPrice().Uint64())
} else {
// var gasPrice *big.Int = new(big.Int)
Expand Down

0 comments on commit 8943a5d

Please sign in to comment.