Commit Graph
5218 Commits
Author SHA1 Message Date
Arvid NorbergandGitHub f1dcd36c2a In main chain (#9550)
* add in_main_chain column to full_blocks table

* add test for block_store in_main_chain

* test block_store invariant
2021-12-17 14:37:45 -08:00
Kyle AltendorfandGitHub 499d01a6c5 Extend the use of AmountWithPuzzlehash(TypedDict) and more uint64() (#9563) 2021-12-17 14:36:48 -08:00
dustinfaceandGitHub 2ab146bf2d plotting|tests|github: Fix and test re-loading/removal of plots where we missed the keys (#9578)
* 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
2021-12-17 14:36:29 -08:00
Arvid NorbergandGitHub 9de8235691 extend chia init to support initializing an (experimental) v2 blockchain database (#9599) 2021-12-17 14:35:43 -08:00
Mariano SorgenteandGitHub 2f86d0eee1 Ms.fix puzzle store (#9606)
* Fix puzzle store to 100 addresses

* Remove unnecessary function call

* Lint
2021-12-17 14:34:27 -08:00
234d121c2a chia|tests|pre-commit: Add missing __init__.py files (#8758)
* chia|tests: Add missing `__init__.py` files

* check and create needed __init__.py files via pre-commit

* plotting|tests: Handle `mypy` issues introduced by the `main` rebase

* pre-commit: Run `build-init-files.py` more verbose

* tests: Ignore `__pycache__` folders in `build-init-files.py`

* Update tests/build-init-files.py

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

* Update tests/build-init-files.py

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

* tests: Add shebang, make executable, add description

To `tests/build-init-files.py`

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-12-16 18:52:46 -08:00
dustinfaceandGitHub 08b5d68f2c tests: Move the expected_result_matched assignment out of the loop (#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`
2021-12-16 18:52:32 -08:00
dustinfaceandGitHub aabc54bb53 plotting|tests: Fix try/except in PlotManager._refresh_task (#9588)
* 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.
2021-12-16 15:14:34 -08:00
dustinfaceandGitHub a68ffecea1 plotting|tests: Fix and test removal of invalid plots (#9587)
* plotting: Drop from `failed_to_open_filenames` if the plot was removed

* tests: Test removal from `failed_to_open_filenames`
2021-12-16 15:14:12 -08:00
Kyle AltendorfandGitHub 7af4a58b63 DaemonProxy request IDs should be hinted as strings (#9584) 2021-12-16 15:13:41 -08:00
Arvid NorbergandGitHub fa3b90a089 simplify test_block_store (#9594) 2021-12-16 14:53:27 -08:00
Arvid NorbergandGitHub b554b0bfa3 simplify test_block_compression (#9590) 2021-12-16 09:44:10 -08:00
Kyle AltendorfandGitHub 1ec2fc1526 Fix new complaints from mypy 0.920 (#9586) 2021-12-15 17:52:25 -08:00
dustinfaceandGitHub 5496dc1971 tests: Call stop_refreshing in the test_environment fixture (#9567) 2021-12-15 15:27:37 -08:00
Arvid NorbergandGitHub 31bb2c987a remove block_records table, use the full_blocks table instead (with a new column) (#9510) 2021-12-15 15:25:00 -08:00
Kyle AltendorfandGitHub 64c433b615 Make sure to fail CI when unable to get madMAx version (#9573)
* Make sure to fail CI when unable to get madMAx version

* fail more
2021-12-15 10:00:36 -06:00
Chris MarslenderandGitHub a6ddf1bd36 Add token to Azure to get around github rate limits for anonymous users (#9576) 2021-12-15 09:46:09 -06:00
dustinfaceandGitHub 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
Chris MarslenderandGitHub fc0b1dd7a4 Crawler retry db on lock (#9562)
* 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
2021-12-14 18:01:45 -08:00
Arvid NorbergandGitHub a3c79c939d use zstd compression for full blocks (#9492) 2021-12-13 22:44:29 -08:00
xchdata.ioandGitHub 41ff79a86c Properly assign keyring observer to instance field (#9556) 2021-12-13 22:41:51 -08:00
JeffandGitHub 30a0ff02bc Restore peer_db_path and wallet_peers_path config keys/values for downgrading from a newer install. (#9557) 2021-12-13 22:01:14 -08:00
dustinfaceandGitHub 47c02aabd2 tests: Rework callback expectation checks with PlotRefreshTester (#9505) 2021-12-13 08:41:24 -08:00
Earle LoweandGitHub 7d801144ea Add TLS version to collected crawler stats (#9534) 2021-12-13 08:40:22 -08:00
Kyle AltendorfandGitHub 8bbbc7f9d8 Fix odd string format (#9508)
I would like to just have a list of strings instead of splitting, but let's at least have it be a clean string for now.
2021-12-13 08:39:36 -08:00
Arvid NorbergandGitHub 2801d96477 unify the name we use for strict/safe mode (#9545)
* 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
2021-12-13 08:38:35 -08:00
Arvid NorbergandGitHub 5076348f2d when validating blocks in the blockchain, we don't use strict-mode (safe mode) (#9544) 2021-12-11 15:20:09 -08:00
Matt HauffandGitHub c6637455b3 Added sorting functionality to /get_transactions (#9278)
* Added sorting functionality to /get_transactions

* Added comment about reversals

* Add determinism and clean up reversal

* Change default back to 50
2021-12-10 15:19:58 -08:00
Kyle AltendorfandGitHub bc2ae4bcbd Add pre-commit to dev dependencies (#9512) 2021-12-10 15:01:31 -08:00
Kyle AltendorfandGitHub 4ab1a8a798 Correct coin hints type hint to bytes (#9493)
* Correct coin hints type hint to bytes

* Update full_node.py
2021-12-10 15:01:09 -08:00
Kyle AltendorfandGitHub 44b4d69ad7 Fix some hints (#9484)
* Fix some hints

* remove unused import

* correct AmountWithPuzzlehash.amount to be uint64
2021-12-10 15:00:43 -08:00
Kyle AltendorfandGitHub 5eeec865e9 stub and use SizedBytes.fromhex() until upstream is released (#9458)
* stub SizedBytes.fromhex() until upstream is released

https://github.com/python/typeshed/pull/6201

* black

* more

* more

* more

* more

* more

* import TYPE_CHECKING via from

* more

* more

* catch up
2021-12-10 14:59:49 -08:00
William Blanke c2b229596b updated gui to NEXT 6dfbc2da694672d706959c521698fcc41e8997e4 2021-12-10 09:20:44 -08:00
dustinfaceandGitHub 8e6b7afa79 tests: Some cleanups after #9306 and #9409 (#9503)
* tests: Drop `None` check and compare the events directly

* tests: Drop unused `TestRefreshResult`
2021-12-10 09:18:51 -08:00
Mariano SorgenteandGitHub 99adab1b83 Do not included reversed blocks in get_blocks response if flag is provided (#9141)
* Do not included reversed blocks in get_blocks response

* Do not break RPC by changing the default behaviour, but instead add a flag.
2021-12-10 09:18:02 -08:00
Juraj OršulićandGitHub 9ec44cc2ac Fix comment typo in the standard wallet puzzle (#9346) 2021-12-10 09:17:06 -08:00
Chris MarslenderandGitHub 772e607681 always update best timestamp even if we weren't able to connect to keep track of gossiped peers properly (#9538) 2021-12-10 09:16:17 -08:00
Arvid NorbergandGitHub 35cab7cea2 Block store benchmark (#9520)
* include SubEpochSummary objects

* make header_hashes authentic. include benchmarks of lookups on block_store as well
2021-12-09 15:38:59 -08:00
dustinfaceandGitHub 8487372a4d build_scripts: Only copy win_code_sign_cert.p12 if we have secrets (#9516)
PRs from forked `chia-blockchain` repos don't have the cert available 
which leads to the installer step to fail, see 
https://github.com/Chia-Network/chia-blockchain/runs/4465950001

Follow-up for #9506.
2021-12-09 08:23:19 -06:00
Chris MarslenderandGitHub 313cf27eee Installer Fixes - New UI (#9506)
* Update to node 16

* Install lerna globally. Lerna clean, and comment out audit:fix for now since it doesn't work with Lerna (see https://github.com/lerna/lerna/issues/1663)

* Global lerna in build mac as well

* Test building the gui package, instead of from the root

* Build installer from the gui package and copy daemon folder to the correct place

* Pass executable name / options.name to linux installers

* Move installers to the root of blockchain-gui

* Fix winstaller

* Latest NEXT

* Update to latest UI

* Copy signing cert for windows to proper location
2021-12-08 15:39:01 -07:00
William Blanke 9217993282 updated GUI to NEXT 2c236bf0f4a32b718ec6f8a243e07736f7a555f3 2021-12-08 10:40:06 -08:00
William Blanke 7f9a09fe90 updated gui to 381bf48332f6ae0af6703af0636f272c5cf8c357 2021-12-07 12:01:34 -08:00
Earle LoweandGitHub e78fef5003 Set the permissions of chrome-sandbox (#9421)
* Set the permissions of chrome-sandbox

Testing to see if setting the permissions of chrome-sandbox prior to packaging works, or if an RPM post-install script is needed

* use rpm attr to set file permissions

* whitespace fixup
2021-12-07 09:58:05 -08:00
dustinfaceandGitHub ad7b549cbd plotting|tests: Catch exceptions in the plot manager thread (#9409)
Without this the plot manager thread silently dies on exceptions and
refreshing just stops. This change leads to refreshing reset and a error
log on exceptions.
2021-12-07 09:57:24 -08:00
Geoff WalmsleyandGitHub a085d26670 added get_coin_records_by_parent_ids to spend_sim (#9438)
* added get_coin_records_by_parent_ids to spend_sim

* fix linting errors
2021-12-07 09:56:37 -08:00
8db6ee540d [v2] Remove is_peak field (#9487)
* remove is_peak field, instead, store the peak hash in a single place

* Update chia/full_node/block_store.py

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

* Update chia/full_node/block_store.py

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

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-12-07 09:55:49 -08:00
Kyle AltendorfandGitHub 475514db0b fix a hint issue by just removing an _ (#9482) 2021-12-07 07:57:39 -08:00
Kyle AltendorfandGitHub 9a6ab80f68 rename variable to avoid hint confusion (#9474)
Earlier in the function `peak_hash` is used and is detectible as
`bytes32`.  At this location it is assigned from an `Any` hinted
value thus leaving `bytes32` as a valid, although inaccurate,
hint.  Renamed to avoid this collision of uses.  When we ban `Any`
we will end up dealing with this.
2021-12-07 07:57:03 -08:00
Kyle AltendorfandGitHub c5902841de Just use bytes32() some more (#9472)
* Just use bytes32() some more

* black

* more
2021-12-07 07:55:48 -08:00
Kyle AltendorfandGitHub 406253f782 Adjust compress_root() to return bytes32 (#9470) 2021-12-07 07:55:04 -08:00