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

Get rid of client blocking in faucet #513

Open
polydez opened this issue Oct 7, 2024 · 1 comment
Open

Get rid of client blocking in faucet #513

polydez opened this issue Oct 7, 2024 · 1 comment

Comments

@polydez
Copy link
Contributor

polydez commented Oct 7, 2024

What should be done?

Currently we lock the client for the whole processing of get_tokens endpoint of faucet. This leads to sequential processing of requests instead of parallel despite the using multithreading asynchronous runtime. The task is to get rid of this blocking and make requests to the faucet work in parallel.

How should it be done?

The simplest solution would be to instantiate new client on each request. But we should extract at least building of faucet account ID to initialization stage of the faucet because it takes long time.

If even after refactoring account instantiation takes too long, we can improve this solution by introduction of client pool for already instantiated clients.

When is this task done?

When requests to get_tokens in faucet can work in parallel.

Additional context

See TODO here: https://github.com/0xPolygonMiden/miden-node/pull/511/files#diff-0fa2a05cdce31b7eeefc3ab0f1a1d7560016fbabf0b9baca3d182e3c3d47f646R58-R60

@polydez polydez changed the title Get rid of blocking of the client in faucet Get rid of client blocking in faucet Oct 7, 2024
@bobbinth
Copy link
Contributor

bobbinth commented Oct 7, 2024

I'm not sure we can parallelize this. In the end, all transactions against the faucet must be applied one-by-one (i.e., updates to the faucet account must be serialized).

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

No branches or pull requests

2 participants