* Fixes to test_long_sync_untrusted_break
* Address bugbot comments re ip address string
* Remove commented out debug code
* Apply suggestions from bugbot
* increase WEIGHT_PROOF_RECENT_BLOCKS in the test constants, to make it more robust
* improve error message when WEIGHT_PROOF_RECENT_BLOCKS is too small
* fix test_wallet_blockchain.py
* fix test_wallet_node.py
* fix test_wallet_sync.py
* reduce use of pool_reward_puzzle_hash feature of BlockTools, since it's not supported by v2 plots
* the BlockTools feature to ask for a specific pool puzzle hash are not supported by v2 proofs. v2 plots only have pool contract puzzle hash
<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->
The modules `chia.protocols` and `chia.server` form a dependency loop.
This change at least removes the direct dependency of `chia.protocols`
on `chia.server`.
### Purpose:
<!-- Does this PR introduce a breaking change? -->
### Current Behavior:
### New Behavior:
<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->
### Testing Notes:
<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->
* Standardize the `Wallet` API for `generate_signed_transaction`
* Some test fixes
* Fix `create_tandem_xch_tx`
* Fix the other `create_tandem_xch_tx`s
* More test fixes
* More test fixes
* Bad fix from last time
* add some validation of fork_info in Blockchain.add_block(). This would have caught the bug introduced in main a while ago
* simplify add_blocks_in_batches
Simplify add_block_batch.
1. No need to accept AugmentedBlockchain and reconstruct it again.
2. No need to return both success and an unused optional error.
* fix trusted wallet sync on deep reorg
* handle long sync exception case in finish sync
* fix_wallet_sync_test
* fix test_long_sync_wallet
* reconnect only untrusted node in test
* fix long_sync test, update only on finish_sync()
* revert add_blocks_in_batches
* types
* fix flakey test_long_reorg_nodes_and_wallet
* explicitly collect api methods instead of later using getattr
* api as a class itself
* tidy
* fixup
* tidier
* and...
* fixup
* oops
* mm
* hum
* fixup
* monkey patching helper
* ...
* tidy
* back to instances
* fix
* self-patch
* duplicate original request attributes
* Update chia/_tests/wallet/sync/test_wallet_sync.py
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
* test that `@metadata.request()` fails on repeated request type
* ...
---------
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
* make pre_validate_multi_processing() return futures, rather than the awaited and joined results from the thread jobs. This is crucial to allow the validaion jobs to run concurrently with the database interaction in the main thread
* Split up the add_block_batch() function into 3 parts, preparing them to be pipelined in long-sync
* pass AugmentedBlockchain into pre_validate_multiprocessing() and prevalidate_blocks(), to support the augmented blockchain to outlive a single batch
* pipeline pre-validation in sync_from_forkpoint()
* optimize the common case of _reconsider_peak(), to avoid one database lookup
* address review comments
* rename filter_blocks() -> skip_blocks(). It's is only relevant at the start of the sync, add comment and assert
* refactor
* minor fixes
* fix_tests
* add finish sync to add_blocks_in_batches
* add_blocks_in_batches updates wallets
* test fixes
* fix condition in add_block
* add known block to cache
* restore comment
* remove init file from log dir
* fix failed reorg test
* revert known block info change
* assert height in cat test
* wait for wallet height in nft test
* assert sync all height for all wallets
* test_cat_creation assert height
* rename vars
* assert height in process states
* combine current sub slot iterations, current difficulty and previous ses block into ChainState, to make it easier to pass around and update
* address review comments
* address review comments. rename ChainState -> ValidationState. add more comments
* refactor pre_validate_blocks_multiprocessing
* fix condtion
* get diff and ssi from blocks
* works_with_skip_ses
* add default
* propegate_to_header_validation
* pass data between batches
* remove redundant code
* merge fix
* remove optionals and refactor tests
* only use cache
* merge fix
* fix test
* dont traverse if we have prev sub epoch block
* return bad_prev error if block is missing
* mandetory param names
* clean
* fix_benchmark_test
* use ... in BlockInfo protocol
* move prev_block_hash() from BlockchainInterface into BlockRecordsProtocol to transition find_fork_point_in_chain() and lookup_fork_chain() to use the more narrow protocol to lookup the chain
* the WalletBlockchain doesn't need to implement the full BlockchainInterface, but just BlockRecordsProtocol
* remove unused GeneratorBlockCacheInterface and BlockDict
* add unit test for BlockCache
* turn BlockchainInterface into a proper Protocol, to allow mypy to check it
* split out a subset of BlockchainInterface into BlockRecordsInterface
* separate BlockCache into the (simple) production use case and the (complex) test use case of mocking a blockchain object
* Add the concept of 'action scopes'
* Add `WalletActionScope`
* Fix CATWallet pending_change calculation
* Add action_scope: WalletActionScope to all tx endpoints
* Add usage of action scope throughout wallet codebase
* Add the concept of 'action scopes'
* pylint and test coverage
* add try/finally
* add try/except
* Undo giving a variable a name
* Fix CRCAT test
* Fix trade tests
* Fix cat test
* Fix miscellaneous test
* Fix miscellaneous test
* Fix miscellaneous test
* pylint
* Add auto claim test coverage
* Take advantage of extra_spends
* Fix tests
* test fixes
* pylint
* Add the concept of 'action scopes'
* Add `WalletActionScope`
* Fix CATWallet pending_change calculation
* Add action_scope: WalletActionScope to all tx endpoints
* Add the concept of 'action scopes'
* pylint and test coverage
* add try/finally
* add try/except
* Undo giving a variable a name
* Fix CRCAT test
* Fix trade tests
* Fix cat test
* Fix miscellaneous test
* Fix miscellaneous test
* Fix miscellaneous test
* Add auto claim test coverage
* drop in merkle set from rust
* add test of non-inclusion
* migrate sync_utils to use chia_rs
* remove unused import
* flake8 fixes
* mypy fix
* more lint fixes
* isort
* remove old merkle_set.py
* make test proof of exlcusion more explicit
* covnert test_merkle_set to use chia_rs MerkleSet
* isort again