This commit is contained in:
Mael Regnery 2026-02-25 21:58:34 -08:00 committed by GitHub
commit 1daf0f85da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -823,6 +823,13 @@ func (api *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockN
if err != nil {
return nil, err
}
if result.UsedGas > gomath.MaxInt64 {
rpcEthCallGasUsedHist.Update(gomath.MaxInt64)
} else {
rpcEthCallGasUsedHist.Update(int64(result.UsedGas))
}
if errors.Is(result.Err, vm.ErrExecutionReverted) {
return nil, newRevertError(result.Revert())
}

View file

@ -0,0 +1,21 @@
// Copyright 2025 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package ethapi
import "github.com/ethereum/go-ethereum/metrics"
var rpcEthCallGasUsedHist = metrics.NewRegisteredHistogram("rpc/gas_used/eth_call", nil, metrics.NewExpDecaySample(1028, 0.015))