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

rpcdaemon: move transaction/cursor hierarchy to db #2136

Merged
merged 7 commits into from
Jun 25, 2024

Conversation

canepat
Copy link
Member

@canepat canepat commented Jun 23, 2024

This PR moves almost all the code present in rpc module for accessing the data stores (i.e. database and snapshots) into the db module, specifically:

  • the class hierarchies rooted at rpc::ethdb::Transaction and rpc::ethdb::Cursor, capturing the abstractions to interact with local/remote transactions and cursors
  • the rpc/storage package, containing similar local/remote abstractions for block/header/body/transaction access layer
  • the rpc::state::LocalState and rpc::state::RemoteState, again local/remote modelling for silkworm::State implementations

This refactoring is driven by the following logic:

  • move all the code related to data store and data store access into the db module, because the KV interface defines remote access to the data stores (i.e. database and snapshots), so it's exposed from db
  • do this as a preliminary step before introducing support for "temporal" API subset of the KV

This work is not finished yet (some additional PR will follow) and should be considered as a starting point to further shaping the db module into a more cohesive, less coupled set of abstractions for data store access.

Extras

  • move clock_time facilities to infra
  • move remote/kv folder to kv folder
  • move composite_storage_key to db/util
  • remove many redundant namespace qualification

@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Jun 23, 2024
@canepat canepat changed the title Rpcdaemon move tx cursor hierarchy to db rpcdaemon: move transaction/cursor hierarchy to db Jun 23, 2024
@canepat canepat force-pushed the rpcdaemon_move_tx_cursor_hierarchy_to_db branch from 663b430 to d127444 Compare June 23, 2024 23:52
@canepat canepat force-pushed the rpcdaemon_move_tx_cursor_hierarchy_to_db branch from d127444 to 6a9f0f4 Compare June 24, 2024 07:35
@canepat canepat marked this pull request as ready for review June 24, 2024 08:14
@canepat canepat merged commit 60f8042 into master Jun 25, 2024
5 checks passed
@canepat canepat deleted the rpcdaemon_move_tx_cursor_hierarchy_to_db branch June 25, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants