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

Add jsonrpsee client #1396

Closed
wants to merge 18 commits into from
Closed

Add jsonrpsee client #1396

wants to merge 18 commits into from

Conversation

OverOrion
Copy link
Contributor

No description provided.

@OverOrion
Copy link
Contributor Author

OverOrion commented Jul 20, 2023

Long story short the issue is that the JsonrpseeClient::new() function is calling an async private function (e.g., async new) in the background, but this function already gets called in a block_on fashion, so a panic happens:

thread 'tokio-runtime-worker' panicked at 'cannot execute `LocalPool` executor from within another executor: EnterError', /opt/rust/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.28/src/local_pool.rs:81:26

The substrate-api-client master has this issue fixed as the async constructor is public, but that commit was not backported to the .39 branch. Needless to say the moment an async function needs to be called then that async qualifier spreads like a virus, meaning that it would infect many parts of the codebase. To mitigate this I think a new entity which starts a new thread then runs the needed constructor should solve it. As easy it sounds it gets complicated because of the tokio runtime, which needs that the thread is not a simple std::thread, but a tokio one which has the necessary runtime in it.

I am currently working on this, will see tomorrow how it goes.

@OverOrion OverOrion closed this Jan 18, 2024
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.

2 participants