Commit Graph

19 Commits

Author SHA1 Message Date
Izumi Hoshino
5c76f50117
Farmer now returns missing signage points (#15765)
* Farmer now returns missing signage points

* Added test

* Fixed lint error

* Ignored strange pylint behavior

* Fixed lint error

---------

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2023-07-18 21:04:03 -05:00
Izumi Hoshino
85d14f561a
Added compression level and harvesting mode to harvester protocol/mes… (#15776)
* Added compression level and harvesting mode to harvester protocol/messages

* Added test

* Fixed lint error
2023-07-18 16:24:56 -05:00
Izumi Hoshino
e772e4ff69
Improved pool stats handling (#15764)
* Improved pool stats handling

* Minor update

* Made `increment_pool_stats` free function

* Updated `increment_pool_stats` function args

* Fixed isort issue

* WIP: Adding test cases

* Fixed lint error

* Fixed lint error 2

* Fixed lint error 3

* Added test case
2023-07-17 15:39:00 -05:00
Arvid Norberg
cecda28e84
Plot filter hard fork (#15336)
* update passed_plot_filter() to take the filter size rather than consensus constants. This allows the filter size to change by block height. make verify_and_get_quality_string() take either the height or filter size

* Add some filter_prefix_bits tests on test blocks.

* Add some filter_prefix_bits tests on simulated farmer and harvester.

* Cache filter prefix bits by challenge chain signage point hash and use that for the the lookups. This allows us to perform plot filter validation.

* Add more cases to verify_and_get_quality_string() unit tests.

* Add some tests for Farmer's respond_signatures.

* Apply Kevin's suggestion to simplify the check for passing plot filter.

* Apply Kevin's suggestions to simplify some test checks and fix a couple typos.

* Apply Kevin's suggestion to send peak height instead of filter prefix bits as part of NewSignagePoint.

* Remove no longer needed filter prefix bit related logic and make height non optional in verify_and_get_quality_string().

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2023-07-12 10:26:23 -05:00
dustinface
49140b2b3c
server: Introduce ApiProtocol (#15466)
* server: Introduce `ApiProtocol`

* genericize (#5)

* `ApiProtocol.api_ready` -> `ApiProtocol.ready()`

* Add `ApiProtocol.log` and give APIs separate loggers

* Fix `CrawlerAPI`

* Drop some unrelated removals

* Fix some of the generic hinting

* Revert some changes in `timelord_api.py`

* Fix `CawlerAPI` readiness

* Fix hinting

* Get some `CrawlerAPI` coverage

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-06-13 20:12:25 -05:00
Amine Khaldi
37d87c99c1
Annotate test_farmer_harvester.py (#15350) 2023-05-23 06:08:12 -05:00
dustinface
a7e7b9a290
server: Rework config peer resolving and connection handling (#14997)
merging as the snyk issue is confirmed a false positive
2023-04-14 15:22:24 -06: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
dustinface
7c9fb654a3
server|tests: Delay the harvester -> farmer connection in some tests (#12862)
* Introduce `Service.add_peer`

* Delay the harvester/farmer connection in some tests to avoid flakiness
2022-08-10 04:57:34 -05:00
dustinface
aa0e996ac5
util: Drop partially implemented BIP39 passphrase support (#12748) 2022-08-06 09:50:33 -05:00
Jack Nelson
0bc54ae08b
Move simulator test requirements over to new module (#12521)
* create new test.simulator module

to allow other packages to use the simulator without it crashing.
also tiny QOL fixes

* change user mode sim plot filter

Now only plots matching the user set fingerprint are loaded, this decreases the chance of user error.

* fix small oops in configure

* oops

* fix lint

* isort, who dis

* move folder over to chia/simulator

also change mypy settings again
2022-07-25 14:07:38 -05:00
Jack Nelson
bd5d4b1392
remove extra bt from as many tests as possible ( speed up tests) (#12290)
* remove extra bt from as many tests as possible

max speed

* wallet bt tools removal

* fix error & add bt_tools to yield

* final changes

L bozo

* something funky going on

* fix issues

* a couple more fixes

* mypy happy

* damn lint

* Revert "something funky going on"

This reverts commit 1fcc9a34e1.
2022-07-13 03:57:32 -05:00
dustinface
7142ebcae7
tests: Consolidate farmer/harvester fixtures (#11513)
* tests: Consolidate farmer/harvester fixtures

* Fixup after #11578
2022-05-25 15:15:49 -07:00
dustinface
7ed610bc84
test: Give setup_farmer and setup_harvester a separate chia root (#11408)
* test: Give `setup_farmer` and `setup_harvester` a separate chia root

* test: Wait for `last_sync_time` in `get_harvesters_{summary}`

To make sure the first sync from the harvester to the farmer is done 
before we check plot counts.
2022-05-02 19:32:37 -07:00
Amine Khaldi
a2fa8dda01
Prepare test blocks and plots only for tests that need them. This saves us a couple more hours of CI running time. (#10975) 2022-04-05 10:34:57 -07:00
Adam Kelly
37843ee044
Change name to order of returned values. Enforce mandatory naming and inclusion of start_services parameter (#10769) 2022-03-17 08:39:30 -07:00
Adam Kelly
ff324095cc
Remove block tools and keychain globals (#10358)
* Use bt fixture

* rebase

* Use local_hostname

* Fix test_json (inheritance from unittest.TestCase)

* Use correct BlockTools fixture for test_simulation

* Pass bt fixture into cost calculation tests

* flake8

* Add missing parameters to test functions

* Fix from rebase issues

* Remove set_shared_instance

* Update comment

* Remove unneeded comments

* Remove unused code

* Remove unused code, run `multiprocessing.set_start_method("spawn")` at correct time.

* Revert unrelated change

* Set daemon_port. Teardown services in correct order.
    BIG thanks to Mariano Sorgente for debugging help.

* Add back type signature - rebase issue

* Apply review fixes from Jeff

* Document why we need a later pytest-asyncio version

* Correct type for _configure_legacy_backend

* See what's going on during CI mypy run

* github workflows

* mypy typing

* Remove legacy Keyring create method

* Start daemon first

* Shutdown daemon coroutine properly

* Remove un-needed daemon_port argument

* Set chia-blockchain-gui to hash in main

* Remove connect_to_daemon_port

* Remove code that set "daemon_port" before calling `setup_daemon`

* Remove self_hostname fixture and extra self_hostname global

* Fix two test files that were not importing self_hostname

* self_hostname fixture

* Remove more unused test code

* Simplify  fixture
2022-03-10 11:06:49 -08:00
Arvid Norberg
ce533879e2
run pytest in strict asyncio mode. add missing @pytest.mark.asyncio (#10230) 2022-02-16 11:01:04 -05:00
dustinface
b76b75f317
farmer|server|tests: Fix for farmer service crash if the keychain is empty (#9515)
* farmer: Run a start background task to wait if there are no keys yet

* farmer: Run the handshake in a background task if there are no keys yet

* tests: Yield the service in farmer/harvester setups

* tests: Introduce `start_service` in farmer/harvester setups

* server: Make `ChiaServer` and `Service` restartable

* tests: Test the delayed start/handshake in `test_farmer_harvester.py`

* tests: Move `test_farmer_harvester.py` to `tests/core/farmer_harvester`

Attempt to avoid issues due to the global block tools / shared keychain 
between tests

* farmer: Return `bool` in `Farmer.setup_keys`

* tests: Add `__init__.py` to `tests/farmer_harvester`
2021-12-14 18:03:59 -08:00