Skip to content

Conversation

rakita
Copy link
Member

@rakita rakita commented Nov 19, 2024

Handle becomes list of traits.

Context:

  • goes full generic on every field (Tx/Cfg/Block/Journal/Db/Chain).
  • It is flattened. There is no InnerEvmContext and other things. It is easier to use

EvmWiring got removed.

cargo depgraph --no-default-features --workspace-only --exclude example-block-traces,example-contract-deployment,example-database-components,example-database-ref,example-uniswap-get-reserves,example-uniswap-v2-usdc-swap | dot -Tpng > graph.png
Graph generated by the command above:
graph

Dependency graph took a good shape. Still needs a lot of cleanup but the major things look really good

  • Split between context and context-interface and handler and handler-interface
  • How Handler uses context-interface and not the context.
  • Small pending things that would make this even better:
    • revm-state/revm-bytecode needs to be included from database-interface/context-interface
    • Interpreter needs to be split, dependency is on InterpreterResult
    • Precompiles needs to be split, dependency is on precompile result.
  • Thing that i am unsure yet, should i introduce revm-ethereum and revm-context and revm-handler are ethereum specific. Not an important decision, and goal should be to clean/merge this asap as it is massive.

Copy link
Contributor

github-actions bot commented Nov 21, 2024

Valgrind Results:

==4437== Cachegrind, a cache and branch-prediction profiler
==4437== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==4437== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==4437== Command: target/release/revme bench snailtracer
==4437== 
--4437-- warning: L3 cache found, using its data for the LL simulation.
Running snailtracer example!
elapsed: 1.911738104s
==4437== 
==4437== I   refs:      464,099,580
==4437== I1  misses:          4,472
==4437== LLi misses:          4,063
==4437== I1  miss rate:        0.00%
==4437== LLi miss rate:        0.00%
==4437== 
==4437== D   refs:      212,988,726  (134,965,094 rd   + 78,023,632 wr)
==4437== D1  misses:        341,450  (    201,855 rd   +    139,595 wr)
==4437== LLd misses:        136,171  (      3,912 rd   +    132,259 wr)
==4437== D1  miss rate:         0.2% (        0.1%     +        0.2%  )
==4437== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==4437== 
==4437== LL refs:           345,922  (    206,327 rd   +    139,595 wr)
==4437== LL misses:         140,234  (      7,975 rd   +    132,259 wr)
==4437== LL miss rate:          0.0% (        0.0%     +        0.2%  )

@rakita rakita changed the title feat: Restucturing Handler and Context feat: Restucturing Part7 Handler and Context rework Nov 21, 2024
Comment on lines -314 to -317
if cfg.is_balance_check_disabled() {
// Add transaction cost to balance to ensure execution doesn't fail.
account.info.balance = account.info.balance.saturating_add(balance_check);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was removed. I re-added it in #2286

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.

2 participants