<!-- 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) -->
* no need to pass get_unspent_lineage_info_from_puzzle_hash function into create_bundle_from_mempool(), we already have it as a member now
* cache results from get_lineage_info_for_puzzle_hash()
* 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
* use run_block_generator() directly in block creation, to compute the final cost of the block we're creating. This lets us avoid validating the signature (to save time) and run in mempool mode
* always validate signatures in run_block_generator().
* remove PreValidationResult.validated_signature and instead defer to the inner SpendBundleConditions field
* 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
* slightly simplify call to pre_validate_blocks_multiprocessing. batch size is always 4, check_filter is always True. Remove the member function wrapper around it in Blockchain, to prepare for being able to pass wrapped blockchains into it
* address review comments
* Apply suggestions from code review (addendum).
---------
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
* temp
* Port `test_cat_creation`
* Port `test_cat_creation_unique_lineage_store`
* Delete `...reuse_address` test
* Port `test_get_wallet_for_asset_id`
* Port `test_cat_doesnt_see_eve`
* Port `test_cat_max_amount_send`
* Port `test_cat_hint`
* Port `test_cat_change_detection`
* Name test amount and fees in test_cat_creation.
* Use set_remainder for first test
* Match the ValueError we're expecting in test_cat_max_amount_send.
* Comment.
---------
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
* 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
* make BlsCache a proper class, rather than a global dict with helper functions
* make the BLS cache a member of the FullNode, rather than a global variable
* add test for BAD_AGGREGATE_SIGNATURE when using the BLS cache
* Port test_wallet_coinbase
* Port test_wallet_make_transaction
* Port test_wallet_reuse_address
* Port test_wallet_clawback_claim_auto
* Port test_wallet_clawback_clawback
* Port test_wallet_clawback_sent_self
* Port test_wallet_clawback_claim_manual
* Port test_wallet_clawback_reorg
* Rebase fixes and flakiness improvements
* Port test_get_clawback_coins
* Port test_clawback_resync
* Port test_wallet_coinbase_reorg
* Port test_wallet_make_transaction_hop
* Port test_wallet_make_transaction_with_fee
* Port test_wallet_make_transaction_with_memo
* Port test_wallet_create_hit_max_send_amount
* Port test_wallet_prevent_fee_theft
* Port test_wallet_tx_reorg
* Port test_address_sliding_window
* Port test_sign_message
* Port test_wallet_transaction_options
* Remove unneeded check_balances call.
* Introduce tx_amount and use it across test_wallet_clawback_claim_auto.
* Reapply b79ecd2 (got lost in the recent merge).
* Minor improvements to test_wallet_clawback_clawback:
* Introduce tx_amount and test_fees and use them to clarify test conditions.
* Remove no longer needed json.dumps(resp) call.
* Remove unneeded dict() call on a {} constructed dictionary.
* Remove accidental change (addendum to bebc87f).
* More tx_amount and test_fees.
* Remove no longer needed json import.
* Remove unneeded dict() calls on {} constructed dictionaries.
* Introduce tx_amount2 in test_clawback_resync and clarify state transitions.
* Clarify state transitions in test_wallet_make_transaction_hop.
* Simplify transaction_has_failed.
* Just some consistency.
* Remove unneeded check_balances calls.
---------
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
* Update source to black 24 spec
* update black to 24.1.1
* update pylint to ignore multiple-statements
* update test file
* black updates
* format updates
* Update test_network_protocol_files.py
* Update test_network_protocol_files.py
* Don't autopush transactions by default anywhere
* Remove ignore_max_send_amount
* Use TXConfig instead of pending_transactions for coin exclusion in spend_clawback_coins
* Unify transaction pushing into a single method
* Address offline comments by @emlowe
* Rework max send amount to be based on coin quantity rather than amount
* Inadvertent changes
* Test fixes
* Inadvertent change
* Bad import?
* Inadvertent changes?
* readd missing test