From e41244d7d15e53e7e4518d48096a040965525705 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 7 May 2024 13:56:55 +0200 Subject: [PATCH] Update gasestimator.go --- eth/gasestimator/gasestimator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eth/gasestimator/gasestimator.go b/eth/gasestimator/gasestimator.go index 46796595e5..ac3b59e97e 100644 --- a/eth/gasestimator/gasestimator.go +++ b/eth/gasestimator/gasestimator.go @@ -81,7 +81,9 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin available.Sub(available, call.Value) } if opts.Config.IsCancun(opts.Header.Number, opts.Header.Time) && len(call.BlobHashes) > 0 { - blobBalanceUsage := new(big.Int).SetInt64(int64(len(call.BlobHashes)) * params.BlobTxBlobGasPerBlob) + blobGasPerBlob := new(big.Int).SetInt64(params.BlobTxBlobGasPerBlob) + blobBalanceUsage := new(big.Int).SetInt64(int64(len(call.BlobHashes))) + blobBalanceUsage.Mul(blobBalanceUsage, blobGasPerBlob) blobBalanceUsage.Mul(blobBalanceUsage, call.BlobGasFeeCap) if blobBalanceUsage.Cmp(available) >= 0 { return 0, nil, core.ErrInsufficientFunds