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 provider bounds #12857

Merged
merged 9 commits into from
Nov 26, 2024
Merged

feat: relax provider bounds #12857

merged 9 commits into from
Nov 26, 2024

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Nov 25, 2024

Based on #12855

This PR relaxes bounds for database providers and BlockchainProvider2 wrapping up their abstraction over body and transaction. Legacy BlockchainProvider is still bounded by concrete EthPrimitives through TreeNodeTypes trait.

We still need Block = reth_primitives::Block bounds for execution, engine and rpc types, so those bounds. are moved above from providers to those components.

To fit into current providers and rpc structure, I've extended BlockBody with Ethereum-specific withdrawals and ommers methods. It might make sense to decouple them at some point to clean up the abstraction

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm otherwise

@@ -30,9 +31,18 @@ pub trait BlockBody:
/// Ordered list of signed transactions as committed in block.
type Transaction: Transaction;

/// Ommer header type.
type Header;
Copy link
Member

Choose a reason for hiding this comment

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

lets rename this to Ommer or similar in that case? for clarity

@onbjerg onbjerg added the C-debt Refactor of code section that is hard to understand or maintain label Nov 26, 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.

lgtm

Base automatically changed from klkvr/primitives-provider to main November 26, 2024 12:26
@klkvr klkvr added this pull request to the merge queue Nov 26, 2024
Merged via the queue into main with commit 2ce7417 Nov 26, 2024
41 checks passed
@klkvr klkvr deleted the klkvr/provider-abstraction branch November 26, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants