mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Fix: eth_estimateGas with blobs fails when capped by limited funds
This commit is contained in:
parent
86a1f0c394
commit
f83fe44326
1 changed files with 5 additions and 0 deletions
|
|
@ -80,6 +80,11 @@ 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))
|
||||
blobBalanceUsage.Mul(blobBalanceUsage, call.BlobGasFeeCap)
|
||||
available.Sub(available, blobBalanceUsage)
|
||||
}
|
||||
allowance := new(big.Int).Div(available, feeCap)
|
||||
|
||||
// If the allowance is larger than maximum uint64, skip checking
|
||||
|
|
|
|||
Loading…
Reference in a new issue