feat(rpc): Convert state_at_block_id into async function#17954
Merged
Conversation
mattsse
approved these changes
Aug 20, 2025
Collaborator
mattsse
left a comment
There was a problem hiding this comment.
makes sense
most existing trace calls that were previously spawned on rayon pool do a lot of IO and should really be spawned on blocking
lwedge99
pushed a commit
to sentioxyz/reth
that referenced
this pull request
Sep 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up on #17924
This makes the existing
state_at_block_idasync, despite them not having any async call at the moment. This is a preparation for introducing asyncpending_statefunction and calling it inside this function.There are two places that previously used
spawn_tracingthat were replaced withspawn_blocking_io_fut.I haven't found a simple way to make
spawn_tracingaccept futures, nor am I sure that such thing makes sense. However, thecallplace is not really benefiting from using the rayon pool, which is whatspawn_tracingis used for. And the second place, thetraceAPI, might benefit from it, buttraceAPI is not affecting production path, hence it is not as speed critical.If we really wanted to keep
spawn_tracing, one idea is to also put the async call tostate_at_block_idoutside of the callback. This, however, causes a mysterioushigher-ranked lifetime error- I tried a few simple fixes unsuccessfully like:use<>StateProviderTraitObjWrapper