chia-blockchain/chia/protocols/harvester_protocol.py

181 lines
4.3 KiB
Python
Raw Normal View History

from __future__ import annotations
2019-11-18 07:49:39 +03:00
from dataclasses import dataclass
2022-04-20 21:37:05 +03:00
from typing import List, Optional, Tuple
2019-11-18 07:49:39 +03:00
from chia_rs import G1Element, G2Element
2019-11-18 07:49:39 +03:00
from chia.types.blockchain_format.proof_of_space import ProofOfSpace
from chia.types.blockchain_format.sized_bytes import bytes32
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-08 03:10:44 +03:00
from chia.util.ints import int16, uint8, uint32, uint64
from chia.util.streamable import Streamable, streamable
2019-07-22 16:01:23 +03:00
"""
2019-11-14 00:04:29 +03:00
Protocol between harvester and farmer.
Note: When changing this file, also change protocol_message_types.py, and the protocol version in shared_protocol.py
"""
2019-07-22 16:01:23 +03:00
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
@streamable
@dataclass(frozen=True)
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
class PoolDifficulty(Streamable):
difficulty: uint64
sub_slot_iters: uint64
pool_contract_puzzle_hash: bytes32
@streamable
@dataclass(frozen=True)
class HarvesterHandshake(Streamable):
farmer_public_keys: List[G1Element]
pool_public_keys: List[G1Element]
2019-07-22 16:01:23 +03:00
@streamable
@dataclass(frozen=True)
class NewSignagePointHarvester(Streamable):
2019-07-22 16:01:23 +03:00
challenge_hash: bytes32
2020-10-30 09:45:37 +03:00
difficulty: uint64
2020-11-25 12:43:47 +03:00
sub_slot_iters: uint64
2020-11-20 09:16:32 +03:00
signage_point_index: uint8
sp_hash: bytes32
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
pool_difficulties: List[PoolDifficulty]
filter_prefix_bits: uint8
2019-07-22 16:01:23 +03:00
@streamable
@dataclass(frozen=True)
class NewProofOfSpace(Streamable):
challenge_hash: bytes32
2020-12-03 16:49:14 +03:00
sp_hash: bytes32
2020-10-30 09:45:37 +03:00
plot_identifier: str
2019-07-30 09:54:26 +03:00
proof: ProofOfSpace
2020-11-20 09:16:32 +03:00
signage_point_index: uint8
2019-07-22 16:01:23 +03:00
@streamable
@dataclass(frozen=True)
class RequestSignatures(Streamable):
2020-10-30 09:45:37 +03:00
plot_identifier: str
2020-12-03 16:49:14 +03:00
challenge_hash: bytes32
sp_hash: bytes32
2020-10-28 09:53:17 +03:00
messages: List[bytes32]
2019-07-25 13:01:56 +03:00
@streamable
@dataclass(frozen=True)
class RespondSignatures(Streamable):
2020-10-30 09:45:37 +03:00
plot_identifier: str
2020-12-03 16:49:14 +03:00
challenge_hash: bytes32
sp_hash: bytes32
local_pk: G1Element
farmer_pk: G1Element
2020-10-28 09:53:17 +03:00
message_signatures: List[Tuple[bytes32, G2Element]]
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
@streamable
@dataclass(frozen=True)
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
class Plot(Streamable):
filename: str
size: uint8
plot_id: bytes32
pool_public_key: Optional[G1Element]
pool_contract_puzzle_hash: Optional[bytes32]
plot_public_key: G1Element
file_size: uint64
time_modified: uint64
compression_level: Optional[uint8]
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
@streamable
@dataclass(frozen=True)
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
class RequestPlots(Streamable):
pass
@streamable
@dataclass(frozen=True)
Pools mainnet (#7047) * added clarifying comments * WIP test * added WIP test * Refine genesis challenge. Remove unnecessary pool_puzzle function * Sign spend. Remove create_member_spend. Rename state transition function to create_travel_spend * Rename create_member_spend to create_travel_spend * Add singleton id logging * Enhance logging for debugging * renaming * rephrase inside the puzzle * fixed signing and added some support functions * Fix issue with announcement * Progress spending the singleton * Fix arguments to pool_state_to_inner_puzzle call * Fix arguments to pool_state_to_inner_puzzle * Improve error message when wallet is not running * Remove misleading message about missing wallet process, when problem is the farmer by making poolnft command error out earlier * Fix parent coin info bug * Multiple state transitions in one block * Lint * Remove assert * Fix incorrect p2_singleton_ph calculation (thanks nil00) * Update waiting room puzzle to accept genesis_challenge * Update calls to create_waiting * Go to waiting state from committed state * Augment debug_spend_bundle * fix 2 bugs in wallet * Fix lint * fix bad_agg_sig bug * Tests and lint * remove breakpoint * fix clvm tests for new hexs and hashs * Fixed a bug in the coin store that was probably from merging. (#6577) * Fixed a bug in the coin store that was probably from merging. * The exception doesn't need to be there * CI Lint fix * Added lifecycle tests for pooling drivers (#6610) * Ms.poolabsorb (#6615) * Support for absorbing rewards in pools (untested) * Style improvements * More work on absorb * Revert default root and remove log * Revert small plots * Use real sub slot iters * Update types * debug1 * Fix bugs * fix output of agg sig log messages * Make fewer calls to pw_status in test * remove old comment * logging and state management * logging * small bug fix & rename for accuracy * format * Fix types for uncurry function * lint * Update test to use exceptions * Change assumptions about self-pooling in lifecycle test * Install types for mypy * Revert "Install types for mypy" This reverts commit a82dcb712a6a97b8789b17c98cac8eafaffe90f5. * install types for mypy * install types for mypy * More keys * Remove flags requiring interactive prompts * Change initial spend to waiting room if self-pooling * lint * lint * linting * Refactor test * Use correct value in log message * update p2_singleton_or_delated_puzhash * initial version of pool wallet with p2_singleton_or_delay * run black formatting * fix rebase wonkiness * fix announcement code in p2_singleton_or_delayed * removed redundant defaulting standardised hexstr handling * lint fixes * Fixed pool lifecycle tests to current standards, but discovered tests are not validating signatures * Signatures validate on this test now although the test still does not check it. * Lint fix * Fixed plotnft show and linting errors * fixed failing farmer/harvester rpc test * lint fix * Commenting out some outdated tests * Updated test coverage * lint fix * Some minor P2singleton improvements (#6325) * Improve some debugging tools. * Tidy pool clvm. * Use `SINGLETON_STRUCT`. Remove unused `and` macro. * Use better name `SINGLETON_MOD_HASH`. * Finish lifecycle test suite. * Fixing for merge with chia-blockchain/pools_delayed_puzzle (#72) Co-authored-by: Matt Hauff <quexington@gmail.com> * Default delay time was being set incorrectly * Extracted get_delayed_puz_info_from_launcher_spend to driver code * Ms.taproot plot2 (#6692) * Start work on adding taproot to new plots * Fix issue in block_tools * new test-cache * Lint * DID fixexs * Fix other tests * Python black * Fix full node store test * Ensure block index <= 128 bits. * fix test_pool_config test * fix comments in pool_config and in chialisp files * self_pool -> pool -> self_pool * Implement leaving pools * Fix conflicts with main via mini-rebase * Fixup rebase mistakes * Bring in Mariano's node discovery chagnes from pools.dev * Fix adapters - Thanks Richard * build tests * Add pools tests * Disable DID tests * farmer|protocol: Some renaming related to the pool protocol * farmer: Use `None` instead of `{}` and add local `pool_state` * protocol|farmer: Introduce and use `PoolErrorCode` * rename: `pool_payout_instructions` -> `payout_instructions` * refactor: `AuthenticationKeyInfo` -> `authentication_key` * refactor: Move `launcher_id` up * rename: Some variable name changes * rename: `points_balance` -> `points` * format: Squash aggregation into one line * farmer: Make `update_pool_state` public * farmer: Print traceback if `update_pool_state` fails * farmer: Periodically call `GET /pool_info`, add `_pool_get_pool_info` * farmer: Add `authentication_token_timeout` to `pool_state` Fetch it from `GET /pool_info` * protocol|farmer: Implement support for `GET|POST|PUT /farmer` * farmer: Make use of `GET|POST /farmer` - To make the farmer known by the pool - To update local balance/difficulty from the pool periodically * farmer|protocol: Adjust `POST /partial` to match the latest spec * farmer: Hash messages before signing * pools: Drop unused code * farmer: Fix aggregation of partial signatures * farmer: support self pooling, don't pool if url=="" * wallet: return uint64 for delay time, instead of bytes * pool: add error code for delay time too short * farmer: cleaner logging when no connection to pool * farmer: add harvester node id to pool protocol * Rename method (test fix) and lint fix * Change errors to warnings (pool communication) * Remove pool callbacks on a reorg * farmer: Continue earlier when no pool URL is provided * farmer: Print method in log * farmer: Handle exceptions for all pool endpoint calls * farmer|protocol: Keep track of failed requests to the pool * farmer: Fix typo which caused issue with pooling * wallet: simplify solution_to_extra_data * tests: Comment out DID tests which are not working yet * Remove DID Wallet test workflows * Return launcher_id when creating Pool Wallet * Name p2_singleton_puzzle_hash correctly * Improve 'test_singleton_lifecycle_fast.py'. * Make test more robust in the face of asynchronous adversity * Add commandline cmds for joining and leaving pools * Fix poolnft leave params * Remove redundant assignment brought in from main * Remove unneeded code * Style and parsimony * pool_puzzles: Check was wrong, and bad naming * format: Fix linting * format: Remove log and rename variable * pool-wallet: Fix self pooling with multiple pool wallets. Don't remove interested puzzle_hash * gui: Use pools branch * format: fix lint * Remove ununsed code, improve initial_pool_state_from_dict * farmer: Instantly update the config, when config file changes * format: Speed up loading of the authentication key * logging: less annoying logging * Test pool NFT creation directly to pool * Test switching pools without self-farming in between * lint * pooling: Use integer for protocol version (#6797) * pooling: Use integer for protocol version * pooling: Fix import * Update GUI commit * Ms.login2 (#6804) * pooling: Login WIP * pooling: add RPC for get_link * dont use timeout * pooling: rename to get_login_link * format: remove logging * Fix SES test * Required cli argument Co-authored-by: almog <almogdepaz@gmail.com> * farmer|protocols: Rename `current_difficulty` for `POST /partial` (#6807) * Fix to farm summary * Use target_puzzlehash param name in RPC call * Pool test coverage (#6782) * Improvement in test coverage and typing * Added an extra absorb to the pool lifecycle test (only works when merged with https://github.com/Chia-Network/chia-blockchain/pull/6733) * Added new drivers for the p2_singleton puzzles * Added new tests and test coverage for singletons * organize pools testing directory * black formatting * black formatting in venv * lint fix * Update CI tests * Fixing tests post rebase * lint fix * Minor readability fix Co-authored-by: matt <matt@chia.net> * farmer: Drop `target_puzzle_hash` from `GET /farmer` and `GET /login` (#6816) * Allow creation of PlotNFTs in self-farming state * gui: Fix install with more RAM (#6821) * Allow implicit payout_address in self-pool state, improve error messages and param ergonomics * print units in non-standard wallets correctly * Fix farmer import * Make syncing message in CLI more intuitive like the GUI * Fix linting and show header hash instead of height * gui: Update to 725071236eff8c81d5b267dc8eb69d7e03f3df8c * Revert "Merge" This reverts commit 23a1e688c5fb4f72983fd896d4933336a365fe38, reversing changes made to a850246c6f4de4d2eb65c4ac1d6023431f3ba7e9. * Revert "Revert "Merge"" This reverts commit 680331859f5dc404cca9c2ff8f4a61df374db125. * Treat tx_record as Dict. Refactor tx submission * Also add passed-in coin spends when processing new blocks in reconsider_peak * Test utilities had moved * Fix import of moved block_tools * Potentially fix yaml * Previously didn't take the right part of this change * Add -y flag, improve commandline plotnft handling * Fix typo * Add -y flag to plotnft create * pool_wallet: Restore from DB properly * wallet: ignore bad pool configs * Reduce memory * pool_wallet: Add claim command * pool_wallet: Set transaction records to confirmed * wallet: Fix bug in transaction cache * Formatting and remove log * pool_wallet: CLI balance and improvements to plotnft_funcs.py * pool_wallet: Simplify, and fix issue with double submission * pool_wallet: Fix tests * pool_wallet: Don't allow switching before relative lock height * update gui * change to 3000 mem * Correct sense of -y flag for self-pooling * cli: Display payout instructions for pool * pool_wallet: Don't create massive transactions * cli: Improvements to plotnft * pool_wallet: Get correct pool state * pool_wallet: Use last transaction block to prevent condition failure * Add block height for current state * Add outstanding unconfirmed transactions to pw_status * Refine command line plotnft show pending transactions * Fix tests by using the correct output from pw_status * Try to fix windows build * Print expected leave height * label pool urls * pool_wallet: Don't include pool 1.75 rewards in total * wallet: Add RPC and CLI for deleting unconfirmed transactions for a wallet * pool_wallet: If farming to a pool, show 0 balance in wallet * pool_wallet: Show error message if invalid state, in CLI * pool_wallet: Don't allow switching if there are pending unconfirmed transactions * tests: Clean up pool test logging * tests: Fix lint * Changed the pool innerpuzzes (#6802) * overload solutions for pool_innerpuz parameters * Fix tests for reduced size puzzles * deleted messy deprecated test * Fix lint. * fix bug where spend types were the wrong way around * merge with richard's lint fix * fix wallet bug remove unnecessary signature add defun-inline for clarity * Swap to defun for absorb case Use cons box for member innerpuz solution * fix if statement for cons box p1 * remove unnecessary solution arg * quick innerpuz fix to make tests pass * Switch to key-value pairs Undo cons box solution in pool_member inner puzzle * fix singleton lifecycle test * added some comments to calrify the meaning on "ps" * lint fix * reduce label size, search for label when reconstructing from solution * no need to keep looping if `p` found * lint fix * Removed unecessary defun-inline and changed hyphens to underscores * Changed created_coin_value_or_0 to an inline function * Changed morph_condition to an inline function * Added a comment for odd_cons_m113 * Rename output_odd and odd_output_found * Add inline functions to document the lineage proof values * Stager two rewrite * Added an ASSER_MY_AMOUNT to p2_singleton_or_delayed * Extract truth functionality to singleton_truths.clib * Fix tree hashes * Changed truths to a struct rather than a list. * fix test_singletons update did_innerpuz * recompile did_innerpuz * fix a log error * Renamed variable and factored out code per @richardkiss * lint fix * switch launcher extra_data to key_value pairs * fix parsing of new format of extra_data in launcher solution * fix broken test for new launcher solution format * remove bare raise Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: Matt Hauff <quexington@gmail.com> * Also add passed-in coin spends when processing new blocks in reconsider_peak (#6898) Co-authored-by: Adam Kelly <aqk> * Moved debug_spend_bundle and added it to the SpendBundle object (#6840) * Moved debug_spend_bundle and added it to the SpendBundle object * Remove problematic typing * Add testnet config * wallet: Memory would get corrupted if there was an error (#6902) * wallet: Memory would get corrupted if there was an error * wallet: Use block_record * wallet: Add records in a full fork too * wallet: remove unnecessary arguments in CC and DID * add to cache, revert if transaction fails Co-authored-by: Yostra <straya@chia.net> * Improve comment * pool_wallet: Fix driver bug * wallet: Fix memory corruption * gui: Update to latest * Increase memory size * tests: Add test for absorbing from pool * small fix in solution_to_extra_data * Fixed incorrect function name * pooling: Fix EOS handling in full node * [pools.testnet9]add post /partial and /farmer header (#6957) * Update farmer.py add post header * Update farmer_api.py add post header * Update chia/farmer/farmer.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Update chia/farmer/farmer_api.py Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Fix lint and cleanup farmer.py * farmer: Fix linting issues (#7010) * Handle the case of incorrectly formatted PoolState data returned from inner singleton * wallet: Resubmit transaction if not successful, rename to new_transaction_block_callback (#7008) * Fix lint in pool_puzzles * pooling: Fix owner private key lookup, and remove unnecessary argument * pooling: Clear target state on `delete_unconfirmed_transactions` * Lint * Fix non-deterministic test * Slight cleanup clvm driver code (#7028) * Return None when a deserialized CLVM structure does not fit the expected format of var-value pair for singleton data * lint Co-authored-by: Adam Kelly <aqk> * Revert "Add testnet config" This reverts commit 98124427241b8a268fbab43ac116887c89e9974f. Co-authored-by: matt <matt@chia.net> Co-authored-by: Adam Kelly <aqk@aqk.im> Co-authored-by: Mariano Sorgente <sorgente711@gmail.com> Co-authored-by: Matt Hauff <quexington@gmail.com> Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com> Co-authored-by: Adam <aqk@Adams-MacBook-Pro.local> Co-authored-by: Adam Kelly <aqk> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: xdustinface <xdustinfacex@gmail.com> Co-authored-by: almog <almogdepaz@gmail.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: Earle Lowe <e.lowe@chia.net> Co-authored-by: arvidn <arvid@libtorrent.org> Co-authored-by: willi123yao <willi123yao@gmail.com> Co-authored-by: arty <art.yerkes@gmail.com> Co-authored-by: William Blanke <wjb98672@gmail.com> Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com> Co-authored-by: Chris Marslender <chrismarslender@gmail.com> Co-authored-by: Yostra <straya@chia.net> Co-authored-by: DouCrazy <43004977+lpf763827726@users.noreply.github.com>
2021-06-30 00:21:25 +03:00
class RespondPlots(Streamable):
plots: List[Plot]
failed_to_open_filenames: List[str]
no_key_filenames: List[str]
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-08 03:10:44 +03:00
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncIdentifier(Streamable):
timestamp: uint64
sync_id: uint64
message_id: uint64
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncStart(Streamable):
identifier: PlotSyncIdentifier
initial: bool
last_sync_id: uint64
plot_file_count: uint32
harvesting_mode: uint8
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-08 03:10:44 +03:00
def __str__(self) -> str:
return (
f"PlotSyncStart: identifier {self.identifier}, initial {self.initial}, "
f"last_sync_id {self.last_sync_id}, plot_file_count {self.plot_file_count}, "
f"harvesting_mode {self.harvesting_mode}"
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-08 03:10:44 +03:00
)
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncPathList(Streamable):
identifier: PlotSyncIdentifier
data: List[str]
final: bool
def __str__(self) -> str:
return f"PlotSyncPathList: identifier {self.identifier}, count {len(self.data)}, final {self.final}"
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncPlotList(Streamable):
identifier: PlotSyncIdentifier
data: List[Plot]
final: bool
def __str__(self) -> str:
return f"PlotSyncPlotList: identifier {self.identifier}, count {len(self.data)}, final {self.final}"
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncDone(Streamable):
identifier: PlotSyncIdentifier
duration: uint64
def __str__(self) -> str:
return f"PlotSyncDone: identifier {self.identifier}, duration {self.duration}"
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncError(Streamable):
code: int16
message: str
expected_identifier: Optional[PlotSyncIdentifier]
def __str__(self) -> str:
return f"PlotSyncError: code {self.code}, count {self.message}, expected_identifier {self.expected_identifier}"
@streamable
@dataclass(frozen=True)
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-08 03:10:44 +03:00
class PlotSyncResponse(Streamable):
identifier: PlotSyncIdentifier
message_type: int16
error: Optional[PlotSyncError]
def __str__(self) -> str:
return f"PlotSyncResponse: identifier {self.identifier}, message_type {self.message_type}, error {self.error}"