Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Declare command timeout #87

Closed
tevrat-aksoy opened this issue Aug 22, 2022 · 4 comments
Closed

Declare command timeout #87

tevrat-aksoy opened this issue Aug 22, 2022 · 4 comments

Comments

@tevrat-aksoy
Copy link

Environment information

  • ape and plugin versions:
$ ape --version
# 0.4.0

$ ape plugins list
# Installed Plugins:
  starknet    0.4.0a0
  solidity    0.4.0
  hardhat     0.4.0
  cairo       0.4.0a0
  • Python Version:Python 3.9.13
  • OS: linux

What went wrong?

Please include information like:

  • When provider.declare() command is used ServerDisconnectedError: Server disconnected error is received. If I use declare for different contract with lesser LOC, there is no problem. Timeout default value should be increased for contracts with high loc.

    def declare(name: str) -> int:
        project = ape.project.get_contract(contract)
        return project.provider.declare(project).class_hash
    
Output:
self = <aiohttp.client_proto.ResponseHandler object at 0x7f30ca3b42e0>

    async def read(self) -> _T:
        if not self._buffer and not self._eof:
            assert not self._waiter
            self._waiter = self._loop.create_future()
            try:
               await self._waiter
               aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

../../.cache/pypoetry/virtualenvs/sithswap-jcoMElJJ-py3.9/lib/python3.9/site-packages/aiohttp/streams.py:616: ServerDisconnectedError
INFO     starknet_stdout_subprocessProviderLogger:providers.py:1064 b'[2022-08-22 11:37:25 +0300] [28700] [INFO] 127.0.0.1 - - [22/Aug/2022:11:37:25 +0300] "GET / HTTP/1.1" 404 232 "-" "Python-urllib/3.9"\n'
INFO     starknet_stdout_subprocessProviderLogger:providers.py:1064 b'[2022-08-22 11:37:38 +0300] [28700] [INFO] 127.0.0.1 - - [22/Aug/2022:11:37:38 +0300] "GET / HTTP/1.1" 404 232 "-" "Python-urllib/3.9"\n'
INFO     starknet_stdout_subprocessProviderLogger:providers.py:1064 b'[2022-08-22 11:38:10 +0300] [28647] [CRITICAL] WORKER TIMEOUT (pid:28700)\n'
INFO     starknet_stdout_subprocessProviderLogger:providers.py:1054 * Listening on http://127.0.0.1:8545/ (Press CTRL+C to quit)
===================================================== short test summary info =====================================================
ERROR tests/cairo/test_SithSwapV1Factory.py::test_factory - aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.

@antazoey
Copy link
Member

Do you know if there is a way to do this yet in Starknet.py?

@tevrat-aksoy
Copy link
Author

Sorry, I don't know. We didnt have this problem until 2 weeks ago and tests were working fine. We updated the dependencies a few days ago and started to get this error.

@antazoey
Copy link
Member

I tried to reproduce by generating and using an 8000 line contract in a declare. It seems to work for me. I wonder if there is anything else specific besides LOC that could be affecting this?

@tevrat-aksoy
Copy link
Author

I tried the same test in the virtual environment with ape test command and test passed. We use poetry to call ape commands, this issue could be related to our setup. Sorry for taking your time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants