EIP-3607: Reject transactions from senders with deployed code
Any transaction where tx.sender has a CODEHASH != EMPTYCODEHASH MUST be rejected as invalid, where EMPTYCODEHASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470. The invalid transaction MUST be rejected by the client and not be included in a block. A block containing such a transaction MUST be considered invalid.
This commit is contained in:
parent
4846405c0e
commit
a6f1ed30ee
|
@ -322,6 +322,18 @@ proc validateTransaction*(
|
|||
accountNonce=nonce
|
||||
return false
|
||||
|
||||
# EIP-3607 Reject transactions from senders with deployed code
|
||||
# The EIP spec claims this attack never happened before
|
||||
# Clients might choose to disable this rule for RPC calls like
|
||||
# `eth_call` and `eth_estimateGas`
|
||||
# EOA = Externally Owned Account
|
||||
let codeHash = roDB.getCodeHash(sender)
|
||||
if codeHash != EMPTY_SHA3:
|
||||
debug "invalid tx: sender is not an EOA",
|
||||
sender=sender.toHex,
|
||||
codeHash=codeHash.data.toHex
|
||||
return false
|
||||
|
||||
true
|
||||
|
||||
proc validateTransaction*(
|
||||
|
|
Loading…
Reference in New Issue