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

Fix hardhat network stability #702

Closed
cristiam86 opened this issue Dec 9, 2024 · 3 comments · Fixed by #704
Closed

Fix hardhat network stability #702

cristiam86 opened this issue Dec 9, 2024 · 3 comments · Fixed by #704
Assignees
Labels

Comments

@cristiam86
Copy link
Collaborator

A race condition initializes Hardhat after the rest of the components. This causes the insert_transaction method to fail because there are no available accounts.
This also makes the finality window to crash and unable to recover.

 File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
jsonrpc-1             |     self._send_output(message_body, encode_chunked=encode_chunked)
jsonrpc-1             |   File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
jsonrpc-1             |     self.send(msg)
jsonrpc-1             |   File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
jsonrpc-1             |     self.connect()
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 279, in connect
jsonrpc-1             |     self.sock = self._new_conn()
jsonrpc-1             |                 ^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 214, in _new_conn
jsonrpc-1             |     raise NewConnectionError(
jsonrpc-1             | urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x74e9eb7f2c60>: Failed to establish a new connection: [Errno 111] Connection refused
jsonrpc-1             | 
jsonrpc-1             | The above exception was the direct cause of the following exception:
jsonrpc-1             | 
jsonrpc-1             | Traceback (most recent call last):
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
jsonrpc-1             |     resp = conn.urlopen(
jsonrpc-1             |            ^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
jsonrpc-1             |     retries = retries.increment(
jsonrpc-1             |               ^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
jsonrpc-1             |     raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
jsonrpc-1             |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             | urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='hardhat', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x74e9eb7f2c60>: Failed to establish a new connection: [Errno 111] Connection refused'))
jsonrpc-1             | 
jsonrpc-1             | During handling of the above exception, another exception occurred:
jsonrpc-1             | 
jsonrpc-1             | Traceback (most recent call last):
jsonrpc-1             |   File "/usr/local/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
jsonrpc-1             |     self.run()
jsonrpc-1             |   File "/usr/local/lib/python3.12/threading.py", line 1012, in run
jsonrpc-1             |     self._target(*self._args, **self._kwargs)
jsonrpc-1             |   File "/app/backend/consensus/base.py", line 568, in run_appeal_window_loop
jsonrpc-1             |     loop.run_until_complete(self._appeal_window())
jsonrpc-1             |   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
jsonrpc-1             |     return future.result()
jsonrpc-1             |            ^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/app/backend/consensus/base.py", line 586, in _appeal_window
jsonrpc-1             |     self.finalize_transaction(
jsonrpc-1             |   File "/app/backend/consensus/base.py", line 464, in finalize_transaction
jsonrpc-1             |     transactions_processor.create_rollup_transaction(transaction.hash)
jsonrpc-1             |   File "/app/backend/database_handler/transactions_processor.py", line 275, in create_rollup_transaction
jsonrpc-1             |     account = self.web3.eth.accounts[0]
jsonrpc-1             |               ^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/eth/eth.py", line 120, in accounts
jsonrpc-1             |     return self._accounts()
jsonrpc-1             |            ^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/module.py", line 111, in caller
jsonrpc-1             |     result = w3.manager.request_blocking(
jsonrpc-1             |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/manager.py", line 400, in request_blocking
jsonrpc-1             |     response = self._make_request(method, params)
jsonrpc-1             |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/manager.py", line 332, in _make_request
jsonrpc-1             |     return request_func(method, params)
jsonrpc-1             |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/middleware/base.py", line 56, in middleware
jsonrpc-1             |     return self.response_processor(method, make_request(method, params))
jsonrpc-1             |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/middleware/base.py", line 56, in middleware
jsonrpc-1             |     return self.response_processor(method, make_request(method, params))
jsonrpc-1             |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jsonrpc-1             |   File "/usr/local/lib/python3.12/site-packages/web3/middleware/base.py", line 56, in middleware
jsonrpc-1             |     return self.response_processor(method, make_request(method, params))
@mpaya5
Copy link
Contributor

mpaya5 commented Dec 9, 2024

There is a PR (#670) that includes changes to the Dockerfile.Hardhat. This issue also requires modifications to that file.

@cristiam86
Copy link
Collaborator Author

Let's address this issue as soon as possible please it is affecting the stability of the Studio; we will take care of the other PR after

Copy link
Contributor

🎉 This issue has been resolved in version 0.29.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants