core: only check sendernoeoa in non fake mode (#23424)
This commit is contained in:
committed by
GitHub
parent
c368f728c1
commit
d02c605367
@ -74,7 +74,7 @@ type Message interface {
|
||||
Value() *big.Int
|
||||
|
||||
Nonce() uint64
|
||||
CheckNonce() bool
|
||||
IsFake() bool
|
||||
Data() []byte
|
||||
AccessList() types.AccessList
|
||||
}
|
||||
@ -212,8 +212,9 @@ func (st *StateTransition) buyGas() error {
|
||||
}
|
||||
|
||||
func (st *StateTransition) preCheck() error {
|
||||
// Make sure this transaction's nonce is correct.
|
||||
if st.msg.CheckNonce() {
|
||||
// Only check transactions that are not fake
|
||||
if !st.msg.IsFake() {
|
||||
// Make sure this transaction's nonce is correct.
|
||||
stNonce := st.state.GetNonce(st.msg.From())
|
||||
if msgNonce := st.msg.Nonce(); stNonce < msgNonce {
|
||||
return fmt.Errorf("%w: address %v, tx: %d state: %d", ErrNonceTooHigh,
|
||||
@ -222,11 +223,11 @@ func (st *StateTransition) preCheck() error {
|
||||
return fmt.Errorf("%w: address %v, tx: %d state: %d", ErrNonceTooLow,
|
||||
st.msg.From().Hex(), msgNonce, stNonce)
|
||||
}
|
||||
}
|
||||
// Make sure the sender is an EOA
|
||||
if codeHash := st.state.GetCodeHash(st.msg.From()); codeHash != emptyCodeHash && codeHash != (common.Hash{}) {
|
||||
return fmt.Errorf("%w: address %v, codehash: %s", ErrSenderNoEOA,
|
||||
st.msg.From().Hex(), codeHash)
|
||||
// Make sure the sender is an EOA
|
||||
if codeHash := st.state.GetCodeHash(st.msg.From()); codeHash != emptyCodeHash && codeHash != (common.Hash{}) {
|
||||
return fmt.Errorf("%w: address %v, codehash: %s", ErrSenderNoEOA,
|
||||
st.msg.From().Hex(), codeHash)
|
||||
}
|
||||
}
|
||||
// Make sure that transaction gasFeeCap is greater than the baseFee (post london)
|
||||
if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) {
|
||||
|
Reference in New Issue
Block a user