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(db): move reth-db-api::encode and decode to reth-db-serialization #10822

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nkysg
Copy link
Contributor

@nkysg nkysg commented Sep 11, 2024

Closes #10821. ref #10081 .

follow up move compress to reth-db-serialization

@nkysg nkysg marked this pull request as draft September 11, 2024 06:18
@nkysg nkysg changed the title refactor: move reth-db-api::encode and decode to reth-codecs move reth-db-api::encode and decode to reth-codecs Sep 11, 2024
@nkysg nkysg marked this pull request as ready for review September 11, 2024 07:59
@nkysg nkysg changed the title move reth-db-api::encode and decode to reth-codecs feat(db): move reth-db-api::encode and decode to reth-codecs Sep 11, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I see, this separates the trait from the db-api

I think this makes sense, wdyt @joshieDo
although the encode/decode traits are specifically intended for database, but since the crate is named codec this seems like an appropriate location I think

crates/storage/codecs/src/lib.rs Outdated Show resolved Hide resolved
@mattsse mattsse added the A-db Related to the database label Sep 11, 2024
@joshieDo
Copy link
Collaborator

Imo, I don't think they should move to codecs. They're inherently db-traits which can be fulfilled by codec(s).

maybe another crate db-serialization or smth like that?

@nkysg
Copy link
Contributor Author

nkysg commented Sep 11, 2024

I see this A codec is a device or computer program that encodes or decodes a data stream or signal, so I move to reth-codecs crate. You can discuss then decide to move which crate.

@joshieDo
Copy link
Collaborator

joshieDo commented Sep 11, 2024

reth-codecs in my view is for actual codecs and their impl. Compact is the only one there, but it could have others(as it had in the past) bincode, etc.

these traits do not implement any codec. they are database specific traits. moving to a "generic" reth-codecs crate does seem the right move
edit: moving to a "generic" reth-codecs crate does not seem the right move.

@nkysg nkysg force-pushed the update_codec branch 4 times, most recently from 42cb18b to c88195c Compare September 15, 2024 12:06
@nkysg nkysg requested a review from mattsse September 15, 2024 13:37
@nkysg
Copy link
Contributor Author

nkysg commented Sep 15, 2024

reth-codecs in my view is for actual codecs and their impl. Compact is the only one there, but it could have others(as it had in the past) bincode, etc.

these traits do not implement any codec. they are database specific traits. moving to a "generic" reth-codecs crate does seem the right move edit: moving to a "generic" reth-codecs crate does not seem the right move.

add crate db-serialization as your suggestion. PTAL @joshieDo

@nkysg nkysg changed the title feat(db): move reth-db-api::encode and decode to reth-codecs feat(db): move reth-db-api::encode and decode to reth-db-serialization Sep 15, 2024
@nkysg nkysg force-pushed the update_codec branch 3 times, most recently from 7376f1d to 1fd6735 Compare September 19, 2024 14:49
@nkysg
Copy link
Contributor Author

nkysg commented Sep 22, 2024

@mattsse ping. PTAL

move shared_key, account, storage_shared_key to reth-db-models

add mod encode, decode

add crate reth-db-serialization
@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database S-stale This issue/PR is stale and will close with no further activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move reth-db-api::encode and decode to reth-db-serialization
3 participants