core: fix pre-check for account balance under EIP-1559#23244
Merged
fjl merged 6 commits intoethereum:masterfrom Jul 22, 2021
Merged
core: fix pre-check for account balance under EIP-1559#23244fjl merged 6 commits intoethereum:masterfrom
fjl merged 6 commits intoethereum:masterfrom
Conversation
rjl493456442
approved these changes
Jul 21, 2021
holiman
approved these changes
Jul 21, 2021
Contributor
holiman
left a comment
There was a problem hiding this comment.
LGTM, thanks @MariusVanDerWijden !
Contributor
| if st.gasFeeCap != nil { | ||
| balanceCheck = new(big.Int).SetUint64(st.msg.Gas()) | ||
| balanceCheck = balanceCheck.Mul(balanceCheck, st.gasFeeCap) | ||
| balanceCheck.Add(balanceCheck, st.value) |
Contributor
There was a problem hiding this comment.
Just FYI this change makes this comment stale
go-ethereum/core/state_transition.go
Line 267 in f68a68a
sidhujag
pushed a commit
to sidhujag/go-ethereum
that referenced
this pull request
Jul 28, 2021
When processing a transaction with London fork rules, EIP-1559 mandates checking that the sender must have sufficient balance to cover gas * gasFeeCap. In the EIP's pseudocode, this check happens after the value transferred by the transaction has already been deducted. However, in go-ethereum, the balance has not yet been updated when the check happens, and therefore needs to be added explicitly. Co-authored-by: Martin Holst Swende <martin@swende.se>
atif-konasl
pushed a commit
to frozeman/pandora-execution-engine
that referenced
this pull request
Oct 15, 2021
When processing a transaction with London fork rules, EIP-1559 mandates checking that the sender must have sufficient balance to cover gas * gasFeeCap. In the EIP's pseudocode, this check happens after the value transferred by the transaction has already been deducted. However, in go-ethereum, the balance has not yet been updated when the check happens, and therefore needs to be added explicitly. Co-authored-by: Martin Holst Swende <martin@swende.se>
9 tasks
This was referenced Sep 23, 2022
misterchenleiya
pushed a commit
to J1a-wei/go-ethereum
that referenced
this pull request
Jun 26, 2023
When processing a transaction with London fork rules, EIP-1559 mandates checking that the sender must have sufficient balance to cover gas * gasFeeCap. In the EIP's pseudocode, this check happens after the value transferred by the transaction has already been deducted. However, in go-ethereum, the balance has not yet been updated when the check happens, and therefore needs to be added explicitly. Co-authored-by: Martin Holst Swende <martin@swende.se>
misterchenleiya
pushed a commit
to J1a-wei/go-ethereum
that referenced
this pull request
Jun 26, 2023
core: fix pre-check for account balance under EIP-1559 (ethereum#23244) See merge request dongwei/blockchain-go-ethereum!3
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We need to account for the value transacted in the buyGas() stage, since it would otherwise
mean our check would be
assert balance >= maxFeePerGas * gasinstead of
assert balance >= tx.value + maxFeePerGas * gas