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

refactor(Execution): Granular handles create/call,call_return,insert_call_outcome #1024

Merged
merged 8 commits into from
Jan 29, 2024

Conversation

rakita
Copy link
Member

@rakita rakita commented Jan 29, 2024

Added more granular handler for execution. Splitting of the call flow into:

  • call that returns FrameOrResult. if it is Frame, frame is pushed to stack, if it is result, insert_call_output is called.
  • call_return that is called only when call frame is returned, it pops the frame from stack, consumes it and returns FrameResult
  • insert_call_output This is called always (except the last frame), the tip frame is used to apply the call frame result.

This similar flow is made for crate calls.

create_first_frame is removed, call/create is used, and first_frame_return is renamed last_frame_return. Last frame return is still needed as insert_call_output applies the change to frame while we need to transform the FrameResult to return outside to Evm.

This change is aligned with #996 where I want frame actions to be generic and set in the Handler.

This makes the Inspector not override handlers but just wrap them, this allows more composition of handlers where for example Optimism does not need to think about this and makes the Inspector more generic and usable

Copy link
Contributor

github-actions bot commented Jan 29, 2024

Valgrind Results:

==4218== Cachegrind, a cache and branch-prediction profiler
==4218== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==4218== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==4218== Command: target/release/snailtracer
==4218== 
--4218-- warning: L3 cache found, using its data for the LL simulation.
Snailtracer Host+Interpreter benchmark (2.1s) ...            not enough samples
==4218== 
==4218== I   refs:      463,564,743
==4218== I1  misses:         23,524
==4218== LLi misses:          2,906
==4218== I1  miss rate:        0.01%
==4218== LLi miss rate:        0.00%
==4218== 
==4218== D   refs:      237,389,306  (160,565,582 rd   + 76,823,724 wr)
==4218== D1  misses:        323,601  (    183,799 rd   +    139,802 wr)
==4218== LLd misses:        137,540  (      4,061 rd   +    133,479 wr)
==4218== D1  miss rate:         0.1% (        0.1%     +        0.2%  )
==4218== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==4218== 
==4218== LL refs:           347,125  (    207,323 rd   +    139,802 wr)
==4218== LL misses:         140,446  (      6,967 rd   +    133,479 wr)
==4218== LL miss rate:          0.0% (        0.0%     +        0.2%  )

@rakita rakita merged commit 5767e6d into main Jan 29, 2024
24 of 25 checks passed
@rakita rakita deleted the granular_execution_handlers branch January 29, 2024 20:03
@github-actions github-actions bot mentioned this pull request Jan 29, 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.

1 participant