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: add TaskSpawner to spawn validation requests as blocking #12543

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ftupas
Copy link
Contributor

@ftupas ftupas commented Nov 14, 2024

This pr does the following:

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.

ty,

smol suggestion

Comment on lines 394 to 397
let (tx, rx) = oneshot::channel();
let this = self.clone();

self.task_spawner.spawn_blocking(Box::pin(async move {
Copy link
Collaborator

Choose a reason for hiding this comment

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

great

Comment on lines 394 to 396
let (tx, rx) = oneshot::channel();
let this = self.clone();

Copy link
Collaborator

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

Self::debug_trace_raw_block(self, rlp_block, opts.unwrap_or_default())
.await
.map_err(Into::into)

Copy link
Contributor Author

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::

@mattsse mattsse added the A-rpc Related to the RPC implementation label Nov 15, 2024
@ftupas ftupas force-pushed the feat/spawn-validation-requests-as-blocking branch from ac8c19b to c234678 Compare November 15, 2024 14:37
@ftupas ftupas requested a review from mattsse November 15, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spawn validation requests as blocking
2 participants