Commit Graph

158 Commits

Author SHA1 Message Date
Amine Khaldi
f085e94dec
Import BetaMetricsLogger only when needed (#17240)
Import BetaMetricsLogger only when needed.
2024-01-08 10:39:28 -06:00
Kyle Altendorf
b5a58e4998
enable ssl_context deprecation warning and fix it (#17127)
* enable ssl_context deprecation warning and fix it

* one case

* a few more

* yup

* one more
2024-01-02 17:07:31 -08:00
Arvid Norberg
95e5b97557
Use bls from chia rs (#16715)
* replace blspy imports with chia_rs imports for BLS types

* remove blspy-stubs, since we're dropping the blspy dependency. chia_rs has type stubs already
2023-11-07 09:06:52 -08:00
Kyle Altendorf
ffe20da303
fixup pylint confusion (#16716) 2023-11-03 11:35:37 -05:00
Don Kackman
975af7494b
[ADDED] Allow the daemon to use TLS v1.2 via config flag (#16747) 2023-11-01 11:53:58 -05:00
Amine Khaldi
c2fbd6ecf1
Make pylint ignore bare-except in this particular case, just like we do with flake8 (#16714) 2023-10-27 14:29:47 -07:00
Kyle Altendorf
fc0eda6178
refactor WebSocketServer.ping_task() to loop (#15408) 2023-10-27 12:03:48 -07:00
Kyle Altendorf
90c1441af0
apply pyupgrade --py38-plus --keep-runtime-typing (#14646) 2023-10-24 12:01:23 -05:00
Earle Lowe
5ea14326c9
Refactor daemon simulation test (#16081) 2023-10-04 12:16:13 -05:00
Izumi Hoshino
4278760924
Bladebit Hybrid disk mode (#16208) 2023-09-12 13:54:04 -05:00
Kyle Altendorf
1c5b469c5b
more ws message type awareness in the deamon (#15797) 2023-09-07 14:05:57 -05:00
William Allen
b475ad86f5
checkpoint: into main from release/2.0.1 @ 27ccd9a86d (#16266)
Source hash: 27ccd9a86d
Remaining commits: 1
2023-09-06 13:35:04 -05:00
Kyle Altendorf
353f12d5a3
commonize signal setup (#13568)
* commonize signal setup

* add signal setup for async handlers

* future

* Update misc.py

* catch up

* logging

* missed one

* context manager and waiting for signal handlers to complete

* correct logging

* fixup

* fixup
2023-09-06 13:01:11 -05:00
Amine Khaldi
a91f90b36b
Merge commit '27ccd9a86dab07f665820e1ed2e6a6e76c059c72' into checkpoint/main_from_release_2.0.1_27ccd9a86dab07f665820e1ed2e6a6e76c059c72 2023-09-06 17:23:35 +01:00
Earle Lowe
27ccd9a86d
Fix issue with GUI and chia plotters when making compressed plots (#16232)
* don't pass in no-direct-downloads on false

* Remove no-direct-downloads

* Remove no-direct-downloads
2023-09-05 15:46:11 -05:00
Jeff
c85baab9f6
Add get_public_key and get_public_keys daemon RPCs (#16156) 2023-08-28 10:18:38 -05:00
Izumi Hoshino
914505f945
Fixed an issue where chiapos recognized t2 as required option (#16020) 2023-08-14 11:20:56 -05:00
Earle Lowe
231bc4638d
Use 'Completed writing plot' as the magic final words for cudaplot (#16011) 2023-08-10 21:06:01 -05:00
Izumi Hoshino
b772ac91db
Added cuda and plot compression support for bladebit 3 (#15774)
* Added cuda and plot compression support for bladebit 3

* Update chia/plotters/bladebit.py

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>

* Update chia/plotters/bladebit.py

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>

* Fixed issues

* Fixed lint error

---------

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
2023-07-18 12:33:42 -05:00
Izumi Hoshino
dd1fbeb040
Added get_keys_for_plot daemon server API (#15772)
* Added `get_keys_for_plot` daemon server API

* Fixed isort error

* Added assertion code

* Added tests

* Fixed flake8 error

* Applied review suggestion

* Added test cases for daemon client

* Renamed `get_keys_for_plot` -> `get_keys_for_plotting`
2023-07-18 12:26:48 -05:00
Jeff
e4312344d0
add get_wallet_addresses RPC for deriving wallet addresses (#15668)
* add get_wallet_addresses RPC for deriving wallet addresses

* tests for get_wallet_addresses

* linter fix

* fix tests

* use datacases

* update monkeypatched function based on feedback
2023-07-05 18:04:17 -05:00
Jeff
fa6f3f67d0
support calling daemon commands from chia rpc CLI (#15584)
* add daemon as a callable service

* re-adding "get_routes" command

* added a test for get_routes

* linter fix

* reformatted with black

* addressed PR feedback
2023-06-28 18:38:53 -05:00
Kyle Altendorf
8f34146654
add Command protocol for daemon (#15592)
* add Command protocol for daemon

* remove get routes for now

* oops
2023-06-23 12:58:14 -05:00
Earle Lowe
46a244ae09
daemon plotter RPC tests (#15291)
* daemon plotter RPC tests

* remove debug cruft

* Add stop_plotting test

* Add stop_plotting test

* Fix up test

* Remove specific test_mode and adjust tests

* Fix madmax test and add a couple minor tests

* cleanup unused code

* Updates based on code suggestions
2023-06-13 17:27:48 -05:00
Kyle Altendorf
70a8874ba5
copy connection set to iterate while pinging (#15407) 2023-05-31 11:34:30 -05:00
Earle Lowe
e7d858ef65
Remove unused function from daemon service (#15209)
Daemon doesn't use this function
2023-05-08 20:48:44 -05:00
Justin England
72697119b8
close daemon client even for a BaseException in acquire_connection_to_daemon() (#14867)
<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->
### Purpose:

As is this would not close the daemon if a BaseException were raised.
For example `KeyboardInterrupt` or `asyncio.CancelledError` (on 3.8+).

<!-- Does this PR introduce a breaking change? -->
### Current Behavior:



### New Behavior:



<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->
### Testing Notes:



<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->
2023-04-11 14:50:45 -06:00
Kyle Altendorf
562e791ddb
avoid consuming exceptions while closing the daemon 2023-03-29 21:31:01 -04:00
dustinface
3e76f78e37
daemon: Fix removal while iterating over connections set (#14887) 2023-03-25 00:28:25 -05:00
Kyle Altendorf
c33a57f7fb
close daemon client even for a BaseException in acquire_connection_to_daemon() 2023-03-21 08:19:13 -04:00
Kyle Altendorf
c4c165eabd
avoid AttributeError when shutting down plotting (#3954)
* Remove valid # type: ignore

A user ran into an exception on this line that mypy should have caught.  Let's see what it says.

```python-traceback
2021-05-06T07:31:41.595 full_node full_node_server        : ERROR    Exception , exception Stack: Traceback (most recent call last):
  File "chia\server\server.py", line 356, in start_client
  File "aiohttp\client.py", line 763, in _ws_connect
  File "aiohttp\client.py", line 521, in _request
  File "aiohttp\connector.py", line 535, in connect
  File "aiohttp\connector.py", line 892, in _create_connection
  File "aiohttp\connector.py", line 1032, in _create_direct_connection
  File "aiohttp\connector.py", line 969, in _wrap_create_connection
  File "asyncio\base_events.py", line 949, in create_connection
  File "asyncio\selector_events.py", line 473, in sock_connect
concurrent.futures._base.CancelledError

2021-05-06T07:31:45.016 daemon asyncio                    : ERROR    Task exception was never retrieved
future: <Task finished coro=<kill_service() done, defined at chia\daemon\server.py:833> exception=AttributeError("'list' object has no attribute 'pid'")>
Traceback (most recent call last):
  File "chia\daemon\server.py", line 841, in kill_service
  File "chia\daemon\server.py", line 805, in kill_process
AttributeError: 'list' object has no attribute 'pid'
2021-05-06T07:32:09.965 full_node full_node_server        : ERROR    Exception:  <class 'concurrent.futures._base.CancelledError'>, closing connection None. Traceback (most recent call last):
  File "chia\server\server.py", line 531, in api_call
  File "asyncio\tasks.py", line 435, in wait_for
concurrent.futures._base.CancelledError

2021-05-06T07:33:20.573 full_node full_node_server        : ERROR    Exception , exception Stack: Traceback (most recent call last):
  File "chia\server\server.py", line 356, in start_client
  File "aiohttp\client.py", line 763, in _ws_connect
  File "aiohttp\client.py", line 521, in _request
  File "aiohttp\connector.py", line 535, in connect
  File "aiohttp\connector.py", line 892, in _create_connection
  File "aiohttp\connector.py", line 1032, in _create_direct_connection
  File "aiohttp\connector.py", line 969, in _wrap_create_connection
```

* fix plotter service killing

* just make it always be a list of processes for all services

* catch up tests

* Update chia/daemon/server.py
2023-03-09 04:22:38 -06:00
Earle Lowe
6e140f24fb
simplify and improve daemon connection handling (#14662)
* simplify daemon connection handling

* Add tests

* return list of service names during removal

* set remove raises KeyError

* Better test type hints

* Add types and code refactor

* fix test typos

* small type adjustments

* test code improvements

* Better error handling for bad json

* handle proper but unexpected JSON values

* Update chia/daemon/server.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* test improvements

* check for empty thing equivalence

* Improved logging for ConnectionReset

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-03-06 12:49:38 -06:00
dustinface
fe321ea488
daemon: Fix server shutdown / wait for it (#14674)
* Create the shutdown event inside `WebSocketServer.__init__`

* Rename `WebSocketServer.start` to `run` and make it a contextmanager
2023-02-28 11:43:24 -06:00
Kyle Altendorf
0940b5920a
hint and dataclass chia.daemon.keychain_server (#14686)
* hint and dataclass chia.daemon.keychain_server

* we will update mypy.ini later
2023-02-28 03:04:34 -06:00
Earle Lowe
0a0c8920ff
Add a daemon heartbeat setting to config.yaml (#13886)
* make daemon heartbeat configurable and increase default

* Fix up daemon rpc test

* Fix dumb error with parameters

* Restore formatting

* Various updates from feedback

* Update tests/core/test_daemon_rpc.py

use config value for heartbeat

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* black fixes

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-01-06 11:55:20 -06:00
Izumi Hoshino
b37f2009bd
Made it able to RAM plot with bladebit2 (#13833) 2022-11-30 12:09:30 -06:00
Jeff
ca536d7002
Display key labels when making a wallet key selection (#13936)
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-11-22 15:34:53 -06:00
dustinface
2e2c297a80
util: Remove legacy keyring support (#13398) 2022-11-18 10:33:18 -06:00
dustinface
e1f4fa8d79
isort: Remove all chia.daemon exceptions and sort the related files (#13941) 2022-11-18 01:29:18 -06:00
Almog De Paz
ac2203eda8
Refactor test utils for import availability outside of repo (#13880)
* refactor for import availability outside of repo

* refactor for import availability outside of repo

* small revert

* newline

* fix imports

* fix pre-commit issues

* types issort, adapt mypy ignore

* redundant imports

* move files from util to simulator

* run pre_commit

* remove setup_nodes/keyring from isort.cfg

* fix asyncio import
2022-11-15 18:51:05 -06:00
Kyle Altendorf
09f89c0257
create tasks for stopping services (#13848)
(cherry picked from commit 3384714f2e3e0bdc8c3d3741027e9e4fb69a6002)
(cherry picked from commit 855b5d1a96)
2022-11-10 14:03:42 -06:00
Jeff
7b781cbf12
add_private_key now returns the fingerprint of the added key (#13814)
* add_private_key now returns the fingerprint of the added key
Updated tests

* Addressed feedback

* Update tests/core/daemon/test_daemon.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-11-05 17:49:29 -05:00
dustinface
9dad485771
daemon: Use WebServer (#13571) 2022-10-03 14:44:05 -05:00
Kyle Altendorf
0b3201635d
minimal fixup for daemon signal handling regression (#13570) 2022-09-30 17:49:42 -05:00
Kyle Altendorf
3b084a165b
configure isort to add the future annotations import (#13327)
* configure isort to add the future annotations import

* apply the new isort setting

* remove type ignores for new mypy (#13539)

https://pypi.org/project/mypy/0.981/

* another
2022-09-30 03:40:22 -05:00
Izumi Hoshino
e40772a0bf
Added support for --no-t1-direct and --no-t2-direct (#13526) 2022-09-26 09:20:40 -05:00
Izumi Hoshino
a2b6a9b5f3
Cmj.bladebit (#11187)
* Making source code cleaner

* Cleaned up `install_plotter.py`

* Now `$CHIA_ROOT/plotters/bladebit` is searched first then bundled bladebit

* Fixed a lint error

* WIP: Implement bladebit update/checkout feature

* Enable to specify git branch/tag/commit on bladebit installation

* Modify arguments display order

* Added `chia plotters version` command

* Fixed lint errors

* Fixed lint error 2

* Implemented `chia plotters bladebit2` and handling for its options

* Fixed typo

* Fixed a lint error

* Added comment

* Added missing plotter arguments

* Fixed LGTM warning

* Fixed wrong typing

* Fixed a lint error

* Fixed an issue where `None` was evaluated as an empty string

* Support bladebit2 plotting from web request

* Updated response of `get_plotters` API for upcoming `bladebit2`

* Fixed bladebit2 argument handling

* Modified progress dict

* Added --no-cpu-affinity option to bladebit1

* Fixed a minor error

* Fixed an error where `chia plotters version` failed

* Fixed an issue where building bladebit2 failed

* Fixed an issue where bladebit2 stopped working if `--cache` option was set

* Updated branch for bladebit2

* Fixed an issue where plotting with madmax/bladebit failed for Python < 3.8 on Windows

* Now `chia plotters install madmax|bladebit2` should work on RedHat like OSes

* Fixed a wrong yum package name

* Added yum packages required for Bladebit2

* Changed the way to update bladebit

* Implemented option handling for madmax as well as bladebit

* Fixed a lint error

* Fixed a minor issue

* Fixed LGTM warning

* Applied changes for bladebit 2.0.0-alpha-2

* Fixed a lint error

* Trying to fix windows pre-commit error

* Fixed isort error
2022-09-23 19:42:37 -05:00
Almog De Paz
39bdffa547
handle errors during shutdown (#12604)
* remove redundant var
dont throw to "Errors" in shutdown
check for missing service name

* typo's
2022-09-21 22:49:31 -05:00
Kyle Altendorf
accf6fd824
separate process global setup for daemon (#13400) 2022-09-16 17:49:51 -05:00
Kyle Altendorf
6ba2922ce1
less cast() in keychain server (#13465) 2022-09-16 16:22:21 -05:00