polkascan / py-substrate-interface

Python Substrate Interface
https://polkascan.github.io/py-substrate-interface/
Apache License 2.0
240 stars 114 forks source link

Submit extrinsic with wait_for_finalization flag set never returns if called by asyncio.to_thread #191

Closed khssnv closed 2 years ago

khssnv commented 2 years ago

SubstrateInterface.submit_extrinsic with wait_for_finalization flag set never returns if called by asyncio.to_thread.

Example

receipt = await asyncio.to_thread(
    substrate.submit_extrinsic,
    extrinsic,
    wait_for_inclusion=True,
    wait_for_finalization=True,
)
print("not reachable")

Environment

$ pip show substrate-interface 
Name: substrate-interface
Version: 1.2.0
$ python -V
Python 3.9.10
$ uname -a
Linux e14 5.13.0-28-generic #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Connection: websocket

khssnv commented 2 years ago

I tried to debug and can't reproduce the issue now. I will reopen it later if I can reproduce the problem.