-
Notifications
You must be signed in to change notification settings - Fork 20.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth/gasestimator: include blobs in virtual balance computation #29703
Conversation
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need another check for balance > blobBalanceUsage
here, otherwise it could go negative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! Which one of the following options would you use for the error?
- Using
core.ErrInsufficientFunds
as error, keepinginsufficient funds for gas * price + value
as description, - Using
core.ErrInsufficientFunds
as error, changing description toinsufficient funds for gas * price + blobGas * blobGasPrice + value
as description, - creating and using a new error,
ErrEip4844InsufficientFunds
withinsufficient funds for gas * price + blobGas * blobGasPrice + value
as description ?
I guess option 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added option 1/ for now, let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…eum#29703) Fixes ethereum#29702 Co-authored-by: Felix Lange <fjl@twurst.com>
…eum#29703) Fixes ethereum#29702 Co-authored-by: Felix Lange <fjl@twurst.com>
Fix for the bug descripted on #29702 -- I no longer see the bug.
I am new to go-ethereum codebase, so I may have missed things, please tell me :-)
Also, would you like some test with it?