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: relax BodyStage bounds #12539

Merged
merged 2 commits into from
Nov 14, 2024
Merged

feat: relax BodyStage bounds #12539

merged 2 commits into from
Nov 14, 2024

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Nov 14, 2024

Changes in this PR:

  • Trim BlockBody to only what's required right now and implement it for BlockBody
  • Implement ToCompact for TransactionSigned through conversion to TransactionSignedNoHash. The clone should be cheap enough and should be cleaned up soon by Remove TransactionSignedNoHash type #12471
  • Add Body AT to BlockWriter and set it to primitive block body in current implementation.
  • Remove concrete requirement of Body = reth_primitives::BlockBody for BodyStage. This allows the stage to be used for any block bodies as long as the db provider can write them to database

Next step would be to replace Body AT for BlockWriter implementation with Block from primitives and delegate writing it to database to ChainStorageWriter from #11243

Comment on lines +1061 to +1062
#[cfg(any(test, feature = "reth-codec"))]
impl reth_codecs::Compact for TransactionSigned {
Copy link
Collaborator

Choose a reason for hiding this comment

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

imo this makes sense

especially if we do

#12471

this also isn't more expensive because this just does the clone somewhere else

Copy link
Collaborator

Choose a reason for hiding this comment

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

this makes sense for now imo

it's easier to gradually add them back,

could you open an issue with the removed code snippet so we have it at hand and can track what else we might want to add?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, tracking in #12544

@mattsse mattsse added the A-sdk Related to reth's use as a library label Nov 14, 2024
@klkvr klkvr added this pull request to the merge queue Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@klkvr klkvr added this pull request to the merge queue Nov 14, 2024
Merged via the queue into main with commit 77e687c Nov 14, 2024
40 checks passed
@klkvr klkvr deleted the klkvr/generic-bodies-stage branch November 14, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants