-
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
core: balanceCheck
should always include msg.Value
#29762
Conversation
During
However, the balancecheck is a bit special. We have two "prices" for gas, the So the So the change you are proposing is not wrong per se, but afaict it is not required either. |
I think the semantic should be that: the user balance should be enough to cover both |
Yes. But there are two cases:
In the simple case, we can just charge money and everything is fine. It works or it does not. In the complicated case, we need to check (but not charge) a higher amount first. |
Yes there're two cases, and BTW, when will |
On legacy-transactions which has the old style gas pricing |
It seems for legacy tx, |
Right, might be only via |
It seems it's only possible to be nil when it goes to this branch, but in that case, |
I think the change here is correct. The code just looks very odd as-written, with |
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
It's a bit confusing to add msg.value into the balanceCheck within the conditional. No impact on block validation since GasFeeCap is always set when processing transactions.
It's a bit confusing to add msg.value into the balanceCheck within the conditional. No impact on block validation since GasFeeCap is always set when processing transactions.
Currently
balanceCheck
only includesmsg.Value
whenmsg.GasFeeCap!=nil
.I think
balanceCheck
should always includemsg.Value
no matter whethermsg.GasPrice
ormsg.GasFeeCap
is chosen as the effective gas price.