reth icon indicating copy to clipboard operation
reth copied to clipboard

Discussion: how to refactor storage libraries

Open rakita opened this issue 2 years ago • 1 comments

The structure of storage related libraries are now:

  • crates
    • codecs
    • db
    • libmdbx-rs
    • interfaces (Database stuff becomes bigger and bigger, it probably deserves a standalone lib and moving them to the interface was not the greatest idea I though only the abstraction part is going to be here but this does not make a lot of sense now)
      • abstraction traits.
      • tables
      • provider
      • codecs impl

it can be refactored to:

  • crates:
    • storage:
      • libmdbx-rs
      • db (This would contains db traits from interfaces, and have a feature flag mdbx)
        • abstraction traits
        • tables
        • providers
        • codecs impl
      • codecs

Additionally, I would move the StageDb from reth-stages to providers to have all database-related operations in the same place.

rakita avatar Dec 05 '22 13:12 rakita

Supportive - we've talked about this before.

interfaces (Database stuff becomes bigger and bigger, it probably deserves a standalone lib and moving them to the interface was not the greatest idea I though only the abstraction part is going to be here but this does not make a lot of sense now

Yep that was my bad.

@brockelmore tried to use the db and had some thoughts too but the proposed structure sgtm.

gakonst avatar Dec 06 '22 15:12 gakonst

Was this closed in #371?

onbjerg avatar Dec 26 '22 01:12 onbjerg