Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Patch upstream changes for modular block handler #50

Merged
merged 1 commit into from
May 1, 2023

Conversation

rahulksnv
Copy link

Upstream PR: paritytech#14014

Note: this would break compilation on subspace repo. autonomys/subspace#1393 would need to be submitted to fix the build

@rahulksnv rahulksnv requested a review from nazar-pc April 28, 2023 21:57
Copy link
Member

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Makes sense

@nazar-pc nazar-pc merged commit 9cf7812 into subspace-v4 May 1, 2023
@nazar-pc nazar-pc deleted the rsub/upstream-14014 branch May 1, 2023 13:56
}

/// Run [`BlockRequestHandler`].
pub async fn run(mut self) {
async fn process_requests(&mut self) {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change this from &mut self to mut self?

Copy link
Author

Choose a reason for hiding this comment

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

You meant the other way I guess. This is for size determination with the trait, otherwise:


error[E0161]: cannot move a value of type `dyn BlockServer<TBl>`
   --> client/service/src/builder.rs:793:3
    |
793 |         block_server.run().await;
    |         ^^^^^^^^^^^^^^^^^^ the size of `dyn BlockServer<TBl>` cannot be statically determined

Do you see an issue with this?

Copy link
Member

Choose a reason for hiding this comment

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

I was just curious in Subspace PR why it was necessary and it lead me here. No significant concerns in this case, but changing mut self to &mut self in general does have implications because often async functions are actually not always ready for this. If you had some accumulator before while then there would be a problem.

Copy link
Author

Choose a reason for hiding this comment

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

I see, can you give more details or example? Are you referring to capturing the reference in a closure?

Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants