Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(EOF): EXTCODECOPY,EXTCODESIZE,EXTCODEHASH eof support #1504

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

rakita
Copy link
Member

@rakita rakita commented Jun 10, 2024

Implement next lines of EOF spec:

  • When executed from a legacy contract, if the target account of EXTCODECOPY is an EOF contract, then it will copy up to 2 bytes from EF00, as if that would be the code.
  • When executed from a legacy contract, if the target account of EXTCODEHASH is an EOF contract, then it will return 0x9dbf3648db8210552e9c4f75c6a1c3057c0ca432043bd648be15fe7be05646f5 (the hash of EF00, as if that would be the code).
  • When executed from a legacy contract, if the target account of EXTCODESIZE is an EOF contract, then it will return 2.

https://github.com/ipsilon/eof/blob/main/spec/eof.md

closes #1483

Copy link
Contributor

github-actions bot commented Jun 10, 2024

Valgrind Results:

==3783== Cachegrind, a cache and branch-prediction profiler
==3783== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==3783== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==3783== Command: target/release/snailtracer
==3783== 
--3783-- warning: L3 cache found, using its data for the LL simulation.
Running snailtracer example!
elapsed: 1.812651512s
==3783== 
==3783== I   refs:      430,651,201
==3783== I1  misses:         39,305
==3783== LLi misses:          2,802
==3783== I1  miss rate:        0.01%
==3783== LLi miss rate:        0.00%
==3783== 
==3783== D   refs:      202,360,302  (131,535,623 rd   + 70,824,679 wr)
==3783== D1  misses:        341,733  (    201,913 rd   +    139,820 wr)
==3783== LLd misses:        137,827  (      4,330 rd   +    133,497 wr)
==3783== D1  miss rate:         0.2% (        0.2%     +        0.2%  )
==3783== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==3783== 
==3783== LL refs:           381,038  (    241,218 rd   +    139,820 wr)
==3783== LL misses:         140,629  (      7,132 rd   +    133,497 wr)
==3783== LL miss rate:          0.0% (        0.0%     +        0.2%  )

crates/revm/src/context/inner_evm_context.rs Outdated Show resolved Hide resolved
@rakita rakita merged commit 649b7c5 into main Jun 10, 2024
25 checks passed
@github-actions github-actions bot mentioned this pull request Jun 10, 2024
@rakita rakita deleted the rakita/eof_extcode_support branch June 10, 2024 15:31
This was referenced Jun 11, 2024
@github-actions github-actions bot mentioned this pull request Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

on EXTCODEHASH load bytecode and check if it is EOF
2 participants