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

refactor: rework the pool server classes #328

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

dancoombs
Copy link
Collaborator

No description provided.

src/cli/rpc.rs Outdated Show resolved Hide resolved
Comment on lines +339 to +364
ServerRequestKind::AddOp { entry_point, op, origin } => {
match self.get_pool(entry_point) {
Ok(mempool) => {
let mempool = Arc::clone(mempool);
tokio::spawn(async move {
let resp = match mempool.add_operation(origin, op).await {
Ok(hash) => Ok(ServerResponse::AddOp { hash }),
Err(e) => Err(e.into()),
};
if let Err(e) = req.response.send(resp) {
tracing::error!("Failed to send response: {:?}", e);
}
});
continue;
},
Err(e) => Err(e),
}
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the only long running task, so we need to spawn it to make space for the actor thread to continue processing requests.

Copy link
Collaborator

@dphilipson dphilipson left a comment

Choose a reason for hiding this comment

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

Looks good! Some early comments since this is a draft.

src/op_pool/server/mod.rs Outdated Show resolved Hide resolved
src/op_pool/server/remote/client.rs Outdated Show resolved Hide resolved
src/common/handle.rs Outdated Show resolved Hide resolved
src/op_pool/server/remote/client.rs Outdated Show resolved Hide resolved
@dancoombs dancoombs force-pushed the danc/simplify-local-remote branch from 49809d9 to 0412b5c Compare August 29, 2023 15:27
@dancoombs dancoombs linked an issue Aug 29, 2023 that may be closed by this pull request
@dancoombs dancoombs force-pushed the danc/pool-stream branch 7 times, most recently from 4ec2ff7 to 3e21b0e Compare September 1, 2023 23:03
Base automatically changed from danc/pool-stream to feat/local-server September 1, 2023 23:12
@dancoombs dancoombs force-pushed the danc/simplify-local-remote branch 2 times, most recently from 23c3285 to f489dca Compare September 2, 2023 00:12
@dancoombs dancoombs marked this pull request as ready for review September 2, 2023 00:20
Copy link
Collaborator

@dphilipson dphilipson left a comment

Choose a reason for hiding this comment

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

Incredible work! Looks good to me.

src/op_pool/server/local.rs Outdated Show resolved Hide resolved
src/op_pool/server/local.rs Show resolved Hide resolved
Copy link
Collaborator

@0xfourzerofour 0xfourzerofour left a comment

Choose a reason for hiding this comment

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

Really good work on on this

src/builder/bundle_sender.rs Show resolved Hide resolved
@dancoombs dancoombs force-pushed the danc/simplify-local-remote branch from f489dca to 49dd555 Compare September 7, 2023 18:10
@dancoombs dancoombs merged commit bcb3c44 into feat/local-server Sep 7, 2023
5 checks passed
@dancoombs dancoombs deleted the danc/simplify-local-remote branch September 7, 2023 18:16
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.

Revisit LocalPoolServer interface
3 participants