Skip to content

Conversation

@SkandaBhat
Copy link
Contributor

@SkandaBhat SkandaBhat commented Dec 9, 2025

Fixes #76.

Notable changes

  • Require a state provider factory for all build_payload APIs so builders can fetch parent-scoped state correctly.
  • Added a convenience alias pub type ProviderFactory<P> = Arc<dyn traits::ProviderFactoryBounds<P>> to standardize the factory type across call sites.
  • Moved the state_by_block_hash lookup into BlockContext::new so payload construction always uses the parent block’s state.

@SkandaBhat SkandaBhat marked this pull request as draft December 10, 2025 11:38
Copy link
Member

@julio4 julio4 left a comment

Choose a reason for hiding this comment

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

I guess this works but it would be better to not have to store the factory in the block context. We already have all the information we need in the base state to build the payload.

But if there's no other easy ways to do it then this is good!

@SkandaBhat
Copy link
Contributor Author

@julio4 One other approach is to wrap the base_state provider in a StateProviderFactory + ChainSpecProvider wrapper right before calling default_ethereum_payload so we don’t have to carry the factory around. The tradeoff is increased surface area inside ethereum module since we need to maintain implementations for StateProviderFactory (latest, pending etc)

@SkandaBhat SkandaBhat marked this pull request as ready for review December 10, 2025 19:17
@julio4
Copy link
Member

julio4 commented Dec 11, 2025

@julio4 One other approach is to wrap the base_state provider in a StateProviderFactory + ChainSpecProvider wrapper right before calling default_ethereum_payload so we don’t have to carry the factory around. The tradeoff is increased surface area inside ethereum module since we need to maintain implementations for StateProviderFactory (latest, pending etc)

Yes agree, I tried this before but wasn't convinced. I think your solution looks nice for the time being!

@SkandaBhat
Copy link
Contributor Author

Clippy fails because of latest rust version 1.92 changing the rules. Fixed it in #100

@SkandaBhat SkandaBhat requested a review from julio4 December 13, 2025 09:31
@julio4 julio4 merged commit 4a50ae0 into flashbots:main Dec 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: reuse reth default_ethereum_payload for Ethereum

2 participants