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

db: fix datastore namespaces #2559

Merged
merged 2 commits into from
Dec 5, 2024
Merged

db: fix datastore namespaces #2559

merged 2 commits into from
Dec 5, 2024

Conversation

battlmonstr
Copy link
Contributor

@battlmonstr battlmonstr commented Dec 4, 2024

This is a preparation before adding DHII into datastore/mdbx. Everything inside datastore/mdbx should have the same namespace independent of silkworm::db. The silkworm::db contains DAL while datastore/mdbx contains the datastore implementation.

  • move top level datastore items to silkworm::datastore
  • move datastore/mdbx from silkworm::db to silkworm::datastore::kvdb, rename directory and library to kvdb
  • move items in datastore/etl to silkworm::datastore::etl

Note 1: a name "kvdb" is chosen to avoid a conflict with ::mdbx own namespace, and potential confusion, given that it will be more than just mdbx wrappers there.
Note 2: code that uses access_layer.hpp or stage.hpp will use aliases of ROTxn/RWTxn inside silkworm::db namespace.
This is done to avoid extra churn in code that we don't actively support.

@battlmonstr battlmonstr added erigon3 Erigon3 feature erigondb labels Dec 4, 2024
@battlmonstr battlmonstr requested a review from canepat December 4, 2024 15:22
Base automatically changed from pr/db_refac to master December 4, 2024 15:38
This is a preparation before adding DHII into datastore/mdbx.
Everything inside datastore/mdbx should have the same namespace independent of silkworm::db.
The silkworm::db contains DAL while datastore/mdbx contains the datastore implementation.

* move top level datastore items to silkworm::datastore
* move items in datastore/mdbx from silkworm::db to silkworm::sw_mdbx
* move items in datastore/etl to silkworm::etl

Note 1: a name "sw_mdbx" is chosen to avoid a conflict with ::mdbx own namespace.
Note 2: code that uses access_layer.hpp or stage.hpp will use aliases of ROTxn/RWTxn inside silkworm::db namespace.
    This is done to avoid extra churn in code that we don't actively support.
@battlmonstr battlmonstr marked this pull request as ready for review December 5, 2024 08:08
@battlmonstr battlmonstr enabled auto-merge (squash) December 5, 2024 08:08
@battlmonstr battlmonstr disabled auto-merge December 5, 2024 14:56
@battlmonstr battlmonstr enabled auto-merge (squash) December 5, 2024 15:04
@canepat canepat mentioned this pull request Dec 5, 2024
41 tasks
@battlmonstr battlmonstr merged commit 6f5db98 into master Dec 5, 2024
5 checks passed
@battlmonstr battlmonstr deleted the pr/dhii_mdbx branch December 5, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erigon3 Erigon3 feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants