* use context managers for database cursor objects, to ensure they are closed. Also stream results back from cursors, rather than reading the full list of results up-front
* Update chia/full_node/block_store.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
If you currently cancel the test during the plot setup phase it just
removes the whole directoy and with it all the test plots for no good
reason. At least in my opinion its just annoying. Sure, you can clone
the `test-cache` repo and copy them over if this happens but i still
think its better to just merge this PR :)
* tests: Allow to use custom keys in `BlockTools.new_plot`
* tests: Create three plots with `G1Element()` as farmer/pool key
But not add them as default plots. Just to have plots in the test cache with different keys from
within and outside the keychain for plot loading tests.
create
* test|github: Bump `test-cache` version to `0.28.0`
* plotting: Drop plots from `no_key_filenames` after the keys appeared
* plotting: Drop plots from `no_key_filenames` if the plot was removed
* tests: Test loading of plots where we miss the keys
* plotting: Use `x.copy()` instead of `list(x)`
* plotting: Add a comment about the missing keys plot removal
* tests: Fix after #9595
* tests: Move the `expected_result_matched` assignment out of the loop
This issue was introduced in #9505 and leads to false positives as soon
as there was one of the attributes in `PlotRefreshResult` checked to be
valid followed by an invalid one.
* tests: Fix `test_invalid_plots`
* plotting: Fix try/except in `PlotManager._refresh_task`
* tests: Move the start refreshing call into `PlotRefreshTester` ctor
It being in `run()` before where it was called every test iteration lead
to not detecting an issue with the try/except introduced in #9409. See
ee1dd1912f4678d7b960b670473bd4b3ffbd890b for the fix.
* 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`
* Remove initial writes to DB, since there is nothing new to write at this point
Both of these methods are called later after each crawler iteration. The lines being deleted write all the same data back to the DB right after the initial data was loaded FROM the DB in the "create" method call, which is a waste of time, especially for mainnet where there are hundreds of thousands of records to write back
* Add additional logs around DB writes
* Add a retry around writing to the DB in case something else has a lock on the DB
Metrics processes read from this DB periodically and sometimes things time out just right and we get a lock exception. Without this retry, we'd hit the other exception handler which doesn't allow the loop to continue
* unify the name we use for the special mode we run CLVM in, when accepting transactions into the mempool. We currently call this, strict mode, safe mode, safe and unsafe. Neither of these names are very descriptive. This patch renames this mode to mempool-mode
* import as