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

Light-client concurrency model #167

Closed
gterzian opened this issue Mar 9, 2020 · 7 comments
Closed

Light-client concurrency model #167

gterzian opened this issue Mar 9, 2020 · 7 comments
Labels
light-client Issues/features which involve the light client

Comments

@gterzian
Copy link

gterzian commented Mar 9, 2020

Place to discuss "how we want to run" the light-client.

Currently it seems like we use a single thread, and then use a Tokio basic-scheduler to block on results for futures via

https://github.com/interchainio/tendermint-rs/blob/5c3aff6ab1835f0e4db6215c9deaad6a12c10062/tendermint-lite/src/main.rs#L22

Discussion started at #125 (review)

@gterzian gterzian mentioned this issue Mar 9, 2020
5 tasks
@liamsi
Copy link
Member

liamsi commented Mar 11, 2020

ref #172, #171, #173

@gterzian
Copy link
Author

It looks like a single-threaded tokio runtime is a good idea for now? Then we can use a threaded runtime later if there is a need for parallellism somewhere, and spawn additional tasks, as opposed to using await in the "current task" everywhere?

@liamsi
Copy link
Member

liamsi commented Mar 11, 2020

Sounds reasonable to me. There might be some need for parallellism in what requests headers and what verifies those. These could be separate tasks. And there are likely a few other tasks that could be parallelised.

@brapse
Copy link
Contributor

brapse commented Mar 11, 2020

I have some suggestions coming by weeks end sorry for the delay! 🙏

@tarcieri
Copy link
Contributor

It seems like there's a lot of potential for parallelization. If you'd like some inspiration, check out how Zebrad implements batch verification for Ed25519 signatures.

Here's a plot of the performance improvements they saw:

image

@romac romac changed the title Ligth-client concurrency model Light-client concurrency model Mar 24, 2020
@romac romac added the light-client Issues/features which involve the light client label May 25, 2020
@ebuchman
Copy link
Member

ebuchman commented Jun 2, 2020

For the initial version of this ala https://github.com/informalsystems/tendermint-rs/milestone/1 we will do everything synchronously and revisit concurrency and batch verification down the road.

@brapse
Copy link
Contributor

brapse commented Jun 9, 2020

Will close for now and create issues for specific component concurrency concerns.

@brapse brapse closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
light-client Issues/features which involve the light client
Projects
None yet
Development

No branches or pull requests

6 participants