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: project restructuring Part1 #1776

Merged
merged 18 commits into from
Sep 18, 2024
Merged

feat: project restructuring Part1 #1776

merged 18 commits into from
Sep 18, 2024

Conversation

rakita
Copy link
Member

@rakita rakita commented Sep 16, 2024

Docs pending,

Roughly looks like this:

    stateDiagram-v2
        database --> db_traits
        bytecode --> primitives
        bytecode --> gas
        db_state --> bytecode
        gas --> specs
        db_traits --> db_state
        specs --> primitives
        interpreter --> bytecode
        interpreter --> gas
        context --> wiring
        context --> db_traits
        wiring --> specs
        wiring --> primitives
        wiring --> db_traits
        handler --> precompile_interface
        handler --> context
        handler --> wiring
        handler --> interpreter
        precompile_interface --> context
        revm --> database
        revm --> precompiles
        revm --> handler
        revm --> wiring
        revm --> specs
        revm --> primitives
        precompiles --> precompile_interface
        inspector --> revm
        optimism --> revm
        revme --> revm
        revme --> statetest
        statetest --> revm
Loading

remv-test removed, all crates paths are in workspace and renamed without revm_ prefix ( revm_primitives to primitives).

Crates split that look good are.

  • primitives: Wrapper around primitiv types, U256/Bytes/B256/keccak256/Address etc.
  • specification: Have Hardfork type and all EIP constants and Eip2930 and EIP7702 types. If needed last two can be split in separate repo.
  • bytecode: Contain bytecodes.
  • state: Account,AccountInfo etc.
  • database: All implementations on interface crate.
    • database_interface: Database/DatabaseRef
  • Wiring: Bloated but contains default Env and all Block/Tx traits.

Revm/Interpreter/Wiring is going to be tackled in Part2.

Copy link
Contributor

github-actions bot commented Sep 17, 2024

Valgrind Results:

==4407== Cachegrind, a cache and branch-prediction profiler
==4407== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==4407== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==4407== Command: target/release/revme bench snailtracer
==4407== 
--4407-- warning: L3 cache found, using its data for the LL simulation.
Running snailtracer example!
elapsed: 1.850564014s
==4407== 
==4407== I   refs:      429,379,382
==4407== I1  misses:          4,957
==4407== LLi misses:          4,145
==4407== I1  miss rate:        0.00%
==4407== LLi miss rate:        0.00%
==4407== 
==4407== D   refs:      205,674,960  (133,128,774 rd   + 72,546,186 wr)
==4407== D1  misses:        346,379  (    203,691 rd   +    142,688 wr)
==4407== LLd misses:        142,392  (      7,265 rd   +    135,127 wr)
==4407== D1  miss rate:         0.2% (        0.2%     +        0.2%  )
==4407== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==4407== 
==4407== LL refs:           351,336  (    208,648 rd   +    142,688 wr)
==4407== LL misses:         146,537  (     11,410 rd   +    135,127 wr)
==4407== LL miss rate:          0.0% (        0.0%     +        0.2%  )

@rakita rakita marked this pull request as ready for review September 18, 2024 13:14
@rakita rakita merged commit 3e5a307 into main Sep 18, 2024
27 checks passed
@rakita rakita deleted the rakita/restructure branch September 18, 2024 13:17
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