core: check if sender is EOA (#23303)

This adds a check to verify that a sender-account does not have code, which means that the codehash is either `emptyCodeHash` _OR_ not present. The latter occurs IFF the sender did not previously exist, a situation which can only occur with zero cost gasprices.
This commit is contained in:
Martin Holst Swende
2021-08-07 19:38:18 +02:00
committed by GitHub
parent d3e3a460ec
commit 0658712f65
6 changed files with 91 additions and 16 deletions

View File

@@ -87,4 +87,7 @@ var (
// ErrFeeCapTooLow is returned if the transaction fee cap is less than the
// the base fee of the block.
ErrFeeCapTooLow = errors.New("max fee per gas less than block base fee")
// ErrSenderNoEOA is returned if the sender of a transaction is a contract.
ErrSenderNoEOA = errors.New("sender not an eoa")
)