bluealloy / revm

Ethereum Virtual Machine written in rust that is fast and simple to use
https://bluealloy.github.io/revm/
MIT License
1.5k stars 482 forks source link

feat(EOF): disallow ExtDelegateCall to legacy bytecode #1572

Closed rakita closed 3 weeks ago

rakita commented 3 weeks ago

From spec: https://github.com/ipsilon/eof/blob/main/spec/eof.md EXTDELEGATECALL to a non-EOF contract (legacy contract, EOA, empty account) is disallowed, and it returns 1 (same as when the callee frame reverts) to signal failure. Only initial gas cost of EXTDELEGATECALL is consumed (similarly to the call depth check) and the target address still becomes warm. We allow legacy to EOF path for existing proxy contracts to be able to use EOF upgrades.

It acts like revert.

github-actions[bot] commented 3 weeks ago

Valgrind Results:

==3903== Cachegrind, a cache and branch-prediction profiler
==3903== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==3903== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==3903== Command: target/release/snailtracer
==3903== 
--3903-- warning: L3 cache found, using its data for the LL simulation.
Running snailtracer example!
elapsed: 1.830873475s
==3903== 
==3903== I   refs:      427,038,325
==3903== I1  misses:          3,155
==3903== LLi misses:          2,797
==3903== I1  miss rate:        0.00%
==3903== LLi miss rate:        0.00%
==3903== 
==3903== D   refs:      204,076,894  (132,269,073 rd   + 71,807,821 wr)
==3903== D1  misses:        341,739  (    201,795 rd   +    139,944 wr)
==3903== LLd misses:        137,732  (      4,451 rd   +    133,281 wr)
==3903== D1  miss rate:         0.2% (        0.2%     +        0.2%  )
==3903== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==3903== 
==3903== LL refs:           344,894  (    204,950 rd   +    139,944 wr)
==3903== LL misses:         140,529  (      7,248 rd   +    133,281 wr)
==3903== LL miss rate:          0.0% (        0.0%     +        0.2%  )