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

[rpc server]: change tokio::Handle::block_in_place to tokio::Handle::block_on #16

Open
2 tasks done
niklasad1 opened this issue Mar 30, 2023 · 0 comments
Open
2 tasks done
Labels
D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Comments

@niklasad1
Copy link
Member

niklasad1 commented Mar 30, 2023

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

paritytech/substrate#13384 (comment)

Request

We should change it to tokio::block_in_place here to tokio::block_on but that requires to fix other code that block in sync code.

If a caller is using block_on in some code that calls start_rpc_servers under the hood it will panic, it would end up with something similar as:

async fn f() -> usize {
    Handle::current().block_on(tokio::time::sleep(Duration::from_millis(10)));
    1
}

#[tokio::main]
async fn main() {
    Handle::current().block_on(f());
}

Solution

Change tokio::Handle::block_in_place to tokio::Handle::block_on but it requires to fix a bunch of tests and related code.

Are you willing to help with this request?

Yes!

@the-right-joyce the-right-joyce transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. and removed U4-some_day_maybe labels Aug 25, 2023
vanderian referenced this issue in gasp-xyz/polkadot-sdk Sep 19, 2023
helin6 pushed a commit to boolnetwork/polkadot-sdk that referenced this issue Feb 5, 2024
* Release branch polkadot-v0.9.38 (#1015)

* EIP-2539 (paritytech#15)

* Update shell.nix

* Read point from input

* Finish `BLS12377G1Add`

* Fix `BLS12377G1Add` output encode

* Finish `BLS12377G1Mul`

* Finish `BLS12377G1MultiExp`

* Finish `BLS12377G2Add`

* Finish `BLS12377G2Mul`

* Draft `eip-2539` implement

* Finish `BLS12377Pairing`

* Draft `eip-2539`

* Multiplication by the unnormalized scalar

* Rename serialize to write

* Test Cases

* Test Cases

* Rewrite read_fq

* Rename

* Doc and cleanup

* Tidy

* Tidy

* Tidy

* Only check point in subgroup for pairing

* Fmt

* Tests

* Typo

* Typo

* Fix conv

* Change err info

* Fmt

* EIP-2539 tests

* EIP-2539 tests

* Lint and test

* EIP-3026  (paritytech#16)

* Update shell.nix

* G1Add and G1Mul

* G1MultiExp

* G2Add

* G2Mul and G2MultiExp

* Bw6Pairing

* EIP-3026 tests

* EIP-3026 failure tests

* Fix lint

* Lint

* Lint and test

* Comment

* Deps order

* Fmt

* Lint

---------

Co-authored-by: Wei Tang <wei@pacna.org>
lexnv pushed a commit that referenced this issue Apr 3, 2024
liuchengxu added a commit to subcoin-project/polkadot-sdk that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D1-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Projects
Status: backlog
Development

No branches or pull requests

2 participants