Skip to content

Commit

Permalink
Fix eth call (#3618)
Browse files Browse the repository at this point in the history
* added isFake

* using isFake instead of checkNonce

* Revert "using isFake instead of checkNonce"

This reverts commit 6a202bb.

* Revert "added isFake"

This reverts commit 2c48024.

* only checking EOA if we are checking for Nonce
  • Loading branch information
enriavil1 authored and Alexey Sharp committed Mar 15, 2022
1 parent 3557346 commit 5ae3309
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions core/state_transition.go
Expand Up @@ -249,15 +249,15 @@ func (st *StateTransition) preCheck(gasBailout bool) 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 (EIP-3607)
if codeHash := st.state.GetCodeHash(st.msg.From()); codeHash != emptyCodeHash && codeHash != (common.Hash{}) {
// common.Hash{} means that the sender is not in the state.
// Historically there were transactions with 0 gas price and non-existing sender,
// so we have to allow that.
return fmt.Errorf("%w: address %v, codehash: %s", ErrSenderNoEOA,
st.msg.From().Hex(), codeHash)
// Make sure the sender is an EOA (EIP-3607)
if codeHash := st.state.GetCodeHash(st.msg.From()); codeHash != emptyCodeHash && codeHash != (common.Hash{}) {
// common.Hash{} means that the sender is not in the state.
// Historically there were transactions with 0 gas price and non-existing sender,
// so we have to allow that.
return fmt.Errorf("%w: address %v, codehash: %s", ErrSenderNoEOA,
st.msg.From().Hex(), codeHash)
}
}

// Make sure the transaction gasFeeCap is greater than the block's baseFee.
Expand Down

0 comments on commit 5ae3309

Please sign in to comment.