mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-22 19:58:06 +00:00
3607: updated pseudocode, added diff (#3614)
* 3607: updated pseudocode, added diff * small change to test bot * undo previous change Co-authored-by: Alita Moore <alita.moore805@gmail.com>
This commit is contained in:
parent
d7efcd919f
commit
bd7f782a89
@ -74,14 +74,15 @@ A set of test cases can be found [here](https://github.com/ethereum/tests/pull/8
|
||||
## Reference Implementation
|
||||
|
||||
The following check must be added to the state transition checks after checking that the nonce of the sender is correct.
|
||||
```go
|
||||
```
|
||||
// Make sure the sender is an EOA
|
||||
if codesize := st.state.GetCodeSize(st.msg.From()); codesize != 0 {
|
||||
Set cs to the CodeSize of the sender account
|
||||
if cs is not 0 then
|
||||
return ErrSenderNoEOA
|
||||
}
|
||||
end if
|
||||
```
|
||||
|
||||
An implementation in go-ethereum can be found [here](https://github.com/ethereum/go-ethereum/pull/23002)
|
||||
An diff to implement EIP-3607 in go-ethereum can be found [here](../assets/eip-3607/geth.diff)
|
||||
|
||||
## Security Considerations
|
||||
|
||||
|
16
assets/eip-3607/geth.diff
Normal file
16
assets/eip-3607/geth.diff
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/core/state_transition.go b/core/state_transition.go
|
||||
index 18777d8d4..3b25155c6 100644
|
||||
--- a/core/state_transition.go
|
||||
+++ b/core/state_transition.go
|
||||
@@ -219,6 +219,11 @@ func (st *StateTransition) preCheck() error {
|
||||
st.msg.From().Hex(), msgNonce, stNonce)
|
||||
}
|
||||
}
|
||||
+ // Make sure the sender is an EOA
|
||||
+ if codesize := st.state.GetCodeSize(st.msg.From()); codesize != 0 {
|
||||
+ return fmt.Errorf("%w: address %v, codesize: %d", ErrSenderNoEOA,
|
||||
+ st.msg.From().Hex(), codesize)
|
||||
+ }
|
||||
// Make sure that transaction feeCap is greater than the baseFee (post london)
|
||||
if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) {
|
||||
if l := st.feeCap.BitLen(); l > 256 {
|
Loading…
x
Reference in New Issue
Block a user