Commit Graph

865 Commits

Author SHA1 Message Date
Mariano Sorgente
23158c656e
Fix issue with missing coins (#11338)
* raise error when request fails

* Gather when cancelling sync

* Increase timeout

* Increase timeout even more
2022-04-27 14:07:41 -07:00
Mariano Sorgente
7630d220f5
Optimize BLS verification when public key is repeated (#11318)
* Optimize BLS verification when public key is repeated

* Fix accidental commit

* Lint

* Fix isort

* Address comments
2022-04-27 11:38:48 -07:00
Jack Nelson
bfb488b1b9
undo 9130 (#10278) 2022-04-25 16:05:35 -07:00
dustinface
c0f3d4d231
daemon|util: Don't remove from list while iterating (#11208)
* daemon: Iterate over a copy of `websockets`

Currently when it fails to send the response to one websocket it skips 
the next websocket in list becaue we remove from the list while 
iterating.

* util: Iterate over a copy of `peers_with_peak`

Currently when a peer is closed it skips the check for the next peer in 
the list becaue we remove from the list while iterating.
2022-04-22 10:55:57 -07:00
Chris Marslender
7b838239a9
Additional metrics (#11271)
* Remove _set_state_changed_callback from harvester_api.py as its never actually called

In rpc/rpc_server.py:318, what is actually called is rpc_server.rpc_api.service._set_state_changed_callback, so the version of this in harvester.py is what is actually used

* Remove duplicate initial value for state_changed_callback in init

* _state_changed -> state_changed so it can be called from harvester_api as well

* Add farming info state_changed event from harvester

* Add time to farming_info event

* Add [pre_]validation_time to block event

* Remove unused set_state_changed_callback on full_node_api. This is actually called on full_node_rpc_api.service

* Remove unused set_state_changed_callback on crawler_api. This is actually called on crawler_rpc_api.service (crawler)

* Remove unused set_state_changed_callback on farmer_api. This is actually called on farmer_rpc_api.service (farmer), not the api itself

* Add state changed event for submitting a partial

* Lint fixes
2022-04-22 10:53:03 -07:00
Kyle Altendorf
48bb002d95
have pyinstaller check platlib for dll's, not ROOT (#11120) 2022-04-21 17:01:17 -07:00
dustinface
7d11d54f89
plotting: Enable isort (#11135) 2022-04-21 17:00:00 -07:00
Earle Lowe
cb98258a8e
Check observer addresses (#11259) 2022-04-21 16:59:11 -07:00
dustinface
2f477bb937
harvester: Tweak get_plots RPC (#11246) 2022-04-21 16:58:35 -07:00
Adam Kelly
8d510157d9
Improve detection of disconnected websocket between services (#11069) 2022-04-20 11:46:51 -07:00
Sebastjan Trepca
fb6c537cfb
Use log formatter to avoid serialisation (#11184)
* avoid serialisation in logging

* avoid serialisation in logging

* Revert "avoid serialisation in logging"

This reverts commit 4a2b447396.
2022-04-20 11:45:30 -07:00
dustinface
21a968bec2
cmds: Only call is_running endpoint once in async_start (#11221) 2022-04-20 11:44:27 -07:00
dustinface
553e46ab6d
harvester: Use a set instead of a list to speed up availability checks (#11204) 2022-04-20 11:43:31 -07:00
Arvid Norberg
73cd386b87
optimize Program.curry() (#11162)
* optimize Program.curry()

* Add a comment for this curry implementation

* optimize Program.curry()

* Add comment

Co-authored-by: arty <art.yerkes@gmail.com>
2022-04-20 11:43:15 -07:00
dustinface
cd9beaca0b
wallet: Some rollback fixes (#11149)
* Set `in_transaction` for `set_finished_sync_up_to`

* Call `clean_block_records` based on `in_transaction`

* Don't pop wallets in `reorg_rollback`, do it after it was commited
2022-04-20 11:42:58 -07:00
Adam Kelly
b224e1dda6
Print MempoolInclusionStatus as string when reporting mempool inclusion status (#11133) 2022-04-20 11:39:38 -07:00
Adam Kelly
d1f68daa0f
Correct "Older block not found" error message (#11130) 2022-04-20 11:38:29 -07:00
dustinface
ee3bf4f866
farmer: Enable isort (#11128) 2022-04-20 11:37:46 -07:00
dustinface
38cc36ca5f
harvester: Enable isort (#11127) 2022-04-20 11:37:05 -07:00
Kyle Altendorf
1088801e73
Remove code related to no-longer-used websockets library (#11123)
* Remove logging tweak for no-longer-used websockets library

Follow up after https://github.com/Chia-Network/chia-blockchain/pull/10611.

* Update pylintrc

* Update test_daemon.py
2022-04-20 11:18:42 -07:00
dustinface
ab282b5282
wallet: Drop unused WalletStateManager.get_derivation_index (#11110) 2022-04-20 11:14:48 -07:00
Earle Lowe
a0c3c31125
Expose transaction sorting options to CLI (#11090) 2022-04-20 11:13:26 -07:00
dustinface
f27cba07b0
farmer: Introduce UPDATE_POOL_INFO_FAILURE_RETRY_INTERVAL (#11076)
Retry to load the pool info with a 2 minutes interval if it failed.
2022-04-20 11:13:07 -07:00
Kyle Altendorf
6287c83928
Correct wallet CLI sent/received indication (#11006)
* Correct wallet CLI sent/received indication

* extract dict to reusable global scope, plus a function
2022-04-20 11:12:32 -07:00
Jack Nelson
ca4881ff3e
Fix incorrect return in "rollback_to_block" (#10954)
* Add comments and fix a coin subscription bug

* Updated rollback test

* simplify test

* expand test

Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
2022-04-20 11:12:00 -07:00
dustinface
cf1a328e03
wallet: Fix CATLineageStore creation in create_new_cat_wallet (#10791)
* Implement `test_cat_creation_unique_lineage_store()`

Make sure creating CAT wallets leads to unique lineage stores.

* Fix `CATLineageStore` creation in `create_new_cat_wallet`

We currently create the `CATLineageStore` before the new asset id exists
which leads to all CATs created by `create_new_cat_wallet` using the
same lineage store table:
`lineage_proofs_0000000000000000000000000000000000000000`.

* Create `CATLineageStore` in `generate_issuance_bundle`
2022-04-20 11:10:52 -07:00
Arvid Norberg
743758c788
apply stricter mempool conditions (no garbage at the end of condition arguments). Fixup test (#10737) 2022-04-20 11:10:30 -07:00
Florin Chirica
370ecd4f98
Fix timelord closing. (#10630) 2022-04-20 11:10:05 -07:00
dustinface
79cbadf987
streamable: Enable isort + more mypy (#10539)
* isort: Fix `streamable.py` and `test_streamable.py`

* mypy: Drop `streamable.py` and `test_streamable.py` form exclusion

And fix all the mypy issues.

* Fix `pylint`

* Introduce `ParseFunctionType` and `StreamFunctionType`

* Use `object` instead of `Type[Any]` for `is_type_*` functions

* Some `Any` -> `object`

* Use `typing.overload` for `recurse_jsonify`

* Move some comments

* Drop `Union`, use `Literal` properly

* Explicitly ignore the return of `f_type.parse`

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

* Merge two `recurse_jsonify` overloads

* Typing for the base definition of `recurse_jsonify`

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-04-20 11:09:41 -07:00
dustinface
1e7703fe6a
plotting|tests|setup: Improve PlotManager cache (#9903)
* plotting|tests: Extend the lifetime of plot data cache entries

* plotting|tests: Add `prover` and `farmer_public_key` to the cache

* plotting: Missing type hints in `Cache` and `CacheEntry`

* setup: Bump `chiapos` to 1.0.10

* plotting: Move cache classes into `chia.plotting.cache`

* plotting: Introduce `CacheEntry.from_disk_prover`

* Make `Cache` a dataclass

* `staticmethod` -> `classmethod`

* Store cache data as `bytes` in `DiskCache`
2022-04-20 11:08:35 -07:00
Kyle Altendorf
a663ece4c3
fix ssl context creation for server vs. client side (#11134) 2022-04-20 11:05:52 -07:00
Chris Marslender
10f7bcde5c
Add start_crawler and start_seeder to pyinstaller config (#11205) 2022-04-18 15:58:44 -05:00
wjblanke
a99c3be36b
Revert "derivation from just a master public key (#11140)" (#11143)
This reverts commit db536c615a.
2022-04-13 07:21:46 -07:00
Yostra
db536c615a
derivation from just a master public key (#11140) 2022-04-12 10:29:36 -07:00
Matt Hauff
151fd6476a
rebase and more fixes (#10885) 2022-04-12 10:15:33 -07:00
Mariano Sorgente
9ff3fc993f
Ms.plot load perf2 (#10978)
* 2.7 seconds -> 0.45 seconds

* Merge

* Work on create_plots refactor

* Try to fix tests

* Try to fix tests

* Use new functions

* Fix block_tools by adding dir

* Extra argument

* Try to fix cyclic import

* isort

* Drop warning

* Some cleanups around `exclude_final_dir` and directory adding

* Cleanup `min_mainnet_k_size` checks

* Drop unrelated changes

* Fixes after rebase

* Fix cyclic import

* Update tests/block_tools.py

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

* Update tests/block_tools.py

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

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-04-11 09:16:01 -07:00
Yostra
0e9c917119
Expose farm_block RPC for simulator (#10830)
* expose farm block api to RPC for simulator

* lint

* pre-commit lint
2022-04-10 21:18:18 -07:00
dustinface
a48fd43100
streamable: Simplify and force correct usage (#10509)
* streamable: Merge `strictdataclass` into `Streamable` class

* tests: Test not supported streamable types

* streamable: Reorder decorators

* streamable: Simplify streamable decorator and force correct usage/syntax

* streamable: Just move some stuff around in the file

* streamable: Improve syntax error messages

* mypy: Drop `type_checking.py` and `test_type_checking.py` from exclusion

* streamable: Use cached fields instead of `__annotations__`

This is now possible after merging `__post_init__` into `Streamable`

* Introduce `DefinitionError` as `StreamableError`

* `/t` -> `    `
2022-04-08 18:29:32 -07:00
Mariano Sorgente
2f9e718073
Ms.fast test blockchain (#11051)
* more work on test blockchain

* Optimize test_blockchain.py

* Fix weight proof bug

* Rename variable

* first rc_sub_slot hash bug

* New plots

* try with a new ID

* Run without cache

* Address test blocks and plots preparation.

* Update constant in test_compact_protocol().

* Update this constant too.

* Revert accidental altering of the gui submodule in ae7e3295f280a591e76c4dffdea75fb74ea5de6f.

* Fix benchmark test

* Revert mozilla-ca change

* Rebase on main

Co-authored-by: almog <almogdepaz@gmail.com>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2022-04-08 09:57:59 -07:00
Adam Kelly
7cd23b0077
Fix the case of claiming a large number of coins (#11038)
* Fix the case of claiming a large number of coins with a fee from a pool wallet

* Revert change to unrelated test

* Set PoolWallet.DEFAULT_MAX_CLAIM_SPENDS to 300

* A few review improvements
2022-04-08 09:57:08 -07:00
Arvid Norberg
21fb6f260e
transition to using chia_rs module (#11094) 2022-04-08 09:37:10 -07:00
dustinface
ded9f68583
chia|tests|github: Implement, integrate and test plot sync protocol (#9695)
* protocols|server: Define new harvester plot refreshing protocol messages

* protocols: Bump `protocol_version` to `0.0.34`

* tests: Introduce `setup_farmer_multi_harvester`

Allows to run a test setup with 1 farmer and mutiple harvesters.

* plotting: Add an initial plot loading indication to `PlotManager`

* plotting|tests: Don't add removed duplicates to `total_result.removed`

`PlotRefreshResult.removed` should only contain plots that were loaded
properly before they were removed. It shouldn't contain e.g. removed
duplicates or invalid plots since those are synced in an extra sync step
and not as diff but as whole list every time.

* harvester: Reset `PlotManager` on shutdown

* plot_sync: Implement plot sync protocol

* farmer|harvester: Integrate and enable plot sync

* tests: Implement tests for the plot sync protocol

* farmer|tests: Drop obsolete harvester caching code

* setup: Add `chia.plot_sync` to packages

* plot_sync: Type hints in `DeltaType`

* plot_sync: Drop parameters in `super()` calls

* plot_sync: Introduce `send_response` helper in `Receiver._process`

* plot_sync: Add some parentheses

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

* plot_sync: Additional hint for a `Receiver.process_path_list` parameter

* plot_sync: Force named parameters in `Receiver.process_path_list`

* test: Fix fixtures after rebase

* tests: Fix sorting after rebase

* tests: Return type hint for `plot_sync_setup`

* tests: Rename `WSChiaConnection` and move it in the outer scope

* tests|plot_sync: More type hints

* tests: Rework some delta tests

* tests: Drop a `range` and iterate over the list directly

* tests: Use the proper flags to overwrite

* test: More missing duplicates tests

* tests: Drop `ExpectedResult.reset`

* tests: Reduce some asserts

* tests: Add messages to some `assert False` statements

* tests: Introduce `ErrorSimulation` enum in `test_sync_simulated.py`

* tests: Use `secrects` instead of `Crypto.Random`

* Fixes after rebase

* Import from `typing_extensions` to support python 3.7

* Drop task name to support python 3.7

* Introduce `Sender.syncing`, `Sender.connected` and a log about the task

* Add `tests/plot_sync/config.py`

* Align the multi harvester fixture with what we do in other places

* Update the workflows

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-04-07 17:10:44 -07:00
Mariano Sorgente
4c9a0edc64
Increases the probability of connecting to local trusted node (#10633) 2022-04-07 09:24:59 -07:00
Kronus91
ffd3b19315
Add /cat_get_unacknowledged API for accessing unknown CATs (#10382)
* Add /cat_get_unacknowledged API for accessing unknown CATs

* Reformat & fix cast issue

* Integration tested & add unit test

* Handle optional uint32

* Reformat

* Reformat

* Reformat

* Merge PR 10308

* Reformat

* Fix concurrent issue

* Add state change notification

* rename API

* Fix failing tests

* Updated state_change name

Co-authored-by: Jeff Cruikshank <jeff@chia.net>
2022-04-07 09:22:59 -07:00
dustinface
c8468bea07
wallet: Improve logging in create_more_puzzle_hashes (#10761)
* wallet: Improve logging in `create_more_puzzle_hashes`

It's pretty spammy currently when scanning puzzle hashes.

* scan -> create, Scanning -> Creating

* `scanning_msg` -> `creating_msg`
2022-04-07 09:21:08 -07:00
dustinface
0917d0ae78
wallet: Drop puzzles/genesis_checkers.py and related puzzles (#10790)
Its all duplicated code and puzzles as far as i can tell, see 
`chia/wallet/puzzles/tails.py`.
2022-04-07 09:19:37 -07:00
Jeff
d35c414c09
Set keychain_proxy to None in await_closed() to support reinitialization (#11075)
* Set keychain_proxy to None in await_closed() to support reinitialization.

* Added `shutting_down` param to _await_closed() to control whether the keychain_proxy is closed.
2022-04-06 20:14:49 -07:00
Jeff
bb57ccffa9
Improve handling of unknown pending balances (likely change from addi… (#10984)
* Improve handling of unknown pending balances (likely change from adding a maker fee).
Minor improvement for fingerprint selection -- enter/return selects the logged-in fingerprint.

* Minor output formatting improvements when showing offer summaries.
Minor wallet key selection improvements.
Added tests for print_offer_summary

* Linter fixes

* isort fix

* Coroutine -> Awaitable

* Removed problematic fee calculation from get_pending_amounts per feedback.
2022-04-05 16:09:00 -07:00
Jack Nelson
9b7d7d2555
Remove websockets dependency & do some refactoring (#10611)
* remove old ws
2022-04-05 10:19:09 -07:00
Kyle Altendorf
d87b8ac087
simplify some header hash getting and assertions (#11007) 2022-04-05 08:54:38 -07:00