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

sdk: introduce trait based StorageAPI (wip) #12157

Closed
wants to merge 11 commits into from
Closed

sdk: introduce trait based StorageAPI (wip) #12157

wants to merge 11 commits into from

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Oct 29, 2024

closes #11243

tldr: each chain needs to write/read their own blocks. Eg. Not all chains may want Ommers as part of a block. These components are spread across different tables and need to be assembled.

Creating the PR to initiate a discussion. I think the first question is how to pass this from ProviderFactory<N> to DatabaseProvider. Right now it takes <TX, Spec> as generics. #11872 Adds a new StateCommittment generic. If we add a storage one, it's too much. Thoughts?

some options:

  • unify Spec and Storage under yet another Node trait ? What about SC?
  • pass N/NodeTypes from ProviderFactory (proposed here with DatabaseProvider2)
  • just add Storage generic
  • methods that require assembling a block take ChainStorageReader

@joshieDo joshieDo added A-db Related to the database C-discussion A discussion about the direction and design of the project A-sdk Related to reth's use as a library labels Oct 29, 2024
@joshieDo joshieDo force-pushed the joshie/sto branch 3 times, most recently from e730428 to 0ac0c92 Compare October 29, 2024 12:36
@jenpaff
Copy link
Collaborator

jenpaff commented Oct 29, 2024

closes #11243

tldr: each chain needs to write/read their own blocks. Eg. Not all chains may want Ommers as part of a block. These components are spread across different tables and need to be assembled.

Creating the PR to initiate a discussion. I think the first question is how to pass this from ProviderFactory<N> to DatabaseProvider. Right now it takes <TX, Spec> as generics. #11872 Adds a new StateCommittment generic. If we add a storage one, it's too much. Thoughts?

some options:

  • unify Spec and Storage under yet another Node trait ? What about SC?
  • pass N/NodeTypes from ProviderFactory (proposed here with DatabaseProvider2)
  • just add Storage generic
  • methods that require assembling a block take ChainStorageReader

how confident are you with our existing tests to make sure we're not breaking anything with this? I know there's been quite a bit of work around it

@joshieDo joshieDo force-pushed the joshie/sto branch 2 times, most recently from 901d3ed to daa9a18 Compare October 29, 2024 13:21
@joshieDo
Copy link
Collaborator Author

although the trait would be introduced in this PR, it wouldnt actually be used afaik. Primitive traits still need more work. So it should not break anything

@mattsse
Copy link
Collaborator

mattsse commented Oct 29, 2024

yeah this progress will flag all the things that we need to do first to get unblocked

@joshieDo joshieDo force-pushed the joshie/sto branch 8 times, most recently from bb20578 to 04252ad Compare November 6, 2024 12:55
@joshieDo joshieDo force-pushed the joshie/sto branch 3 times, most recently from d0b1e96 to e7e88a4 Compare November 6, 2024 14:10
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 A-sdk Related to reth's use as a library C-discussion A discussion about the direction and design of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce trait based storage API
4 participants