-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: add TaskSpawner
to spawn validation requests as blocking
#12543
feat: add TaskSpawner
to spawn validation requests as blocking
#12543
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty,
smol suggestion
crates/rpc/rpc/src/validation.rs
Outdated
let (tx, rx) = oneshot::channel(); | ||
let this = self.clone(); | ||
|
||
self.task_spawner.spawn_blocking(Box::pin(async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great
crates/rpc/rpc/src/validation.rs
Outdated
let (tx, rx) = oneshot::channel(); | ||
let this = self.clone(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what I'd like to here is is wrap the entire function into a spawn_blocking call, effectively duplicating the function: trait + native and then the trait function just calls Self::
for example
reth/crates/rpc/rpc/src/debug.rs
Lines 938 to 940 in 870ffae
Self::debug_trace_raw_block(self, rlp_block, opts.unwrap_or_default()) | |
.await | |
.map_err(Into::into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha updated so that we wrap the entire function into a spawn_blocking
call and calling it using Self::
ac8c19b
to
c234678
Compare
This pr does the following:
task_spawner
to theValidationApiInner
structvalidate_builder_submission_v3
andvalidate_builder_submission_v4