* Cleanup seeder & mypy all files
holy crap mother of all tech debt this was horrid
* Make UDP Protocol class a dataclass & separate out functions.
* add TCP protocol class to DNS server
* Fix mypy types & other cleanup
also fix a couple bugs
* Add seeder and crawler tests
* change log levels
* re add db lock timeout
oops
* add edns & edns tests
* fix repeated shutdown on close signal
* fix binding to use both ipv6 and ipv4
whyyyyyyy
* add ipv6 and ipv4 tests + add ipv4 if windows
* Allow create_tandem_xch_tx to take a set of announcements
* Create potential announcement in correct arm of create_tandem_xch_tx
* Make does_coin_belong_to_wallet more robust
* Add match_hinted_coin to wallet protocol
* Add CROuterPuzzle
* Add conditions with fee announce.clsp
* Add CRCATWallet
* Add CLI support for CR-CATs
* Fix bug in CATOuterPuzzle
* Add SOFTFORK_HEIGHTS as an exportable variable from conftest
* Allow specifying num of blocks to farm to wallets_prefarm_services
* Add potential subclasses to cat wallet creation
* Integrate CR-CATs into offers
* Address comments by @geoffwalmsley
* Add CRCAT info to get_wallets
* Changes due to (#15846)
* don't run tests with database schema v1
* remove support for database schema v1 from BlockStore
* remove support for database schema v1 from CoinStore
* remove support for database schema v1 from HintStore
* remove support for v1 BlockStore schema from blockchain reorg logic
* remove support for database schema v1 from BlockHeightMap
* run block store tests both with and without the cache
* add test with empty blockchain for BlockHeightMap
* fix typo
* Extract `respond_signatures` logic
* Add `call_api_of_specific` method to `ChiaServer`
* Fix typehint for test fixture `farmer_one_harvester`
* Make test helper `add_dummy_connection` work with any node type
* Add `reply_types` to `request_signatures` of harvester
* Fix duplicate SP processing with multiple nodes
* Handle state in `request_signed_values`
* Add set typehint
* Add comment re `_process_respond_signatures()` usage
* Fix imports
* Fix wording to not confuse with SignedValues message
* Added `total_effective_plot_size` for `get_harvesters` RPC API
* Fixed lint error
* Change the type of `total_effective_plot_size` in Receiver to `int`
* Fixed lint error
* Fixed lint error 2
* Changed text
* Added test
* Fixed lint error
* Fixed lint error 2
* Fixed a test issue
* Added config.py to tests/cmds
* Test announcement condition limits for soft-fork 3
* run slow wallet-sync tests in plain mode only
---------
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
* add HARD_FORK_2_0 consensus_mode to run tests under hard-fork consensus rules
* hook up soft-fork and hard-fork changes in CLVM
* fix AGG_SIG_* garbage tests for the 2.0 hard-fork
* add test for unknown conditions with cost, which is a hard-fork feature
* add mempool tests for unknown conditions with cost
* add tests for the SOFTFORK condition
* fix benchmark to take LIMIT_ANNOUNCES into account
* don't parameterize the blockchain tests on DB version, in order to save CI time
* skip duplicate runs of stores tests based on the consensus mode (i.e. hard-fork or soft-fork testing), since the consensus rules don't affect the store classes. Right now, PLAIN is the only mode we have, but we're about to introduce HARD_FORK_2_0 and SOFT_FORK3 as new consensus modes in the tests
* server: Introduce `ApiProtocol`
* genericize (#5)
* `ApiProtocol.api_ready` -> `ApiProtocol.ready()`
* Add `ApiProtocol.log` and give APIs separate loggers
* Fix `CrawlerAPI`
* Drop some unrelated removals
* Fix some of the generic hinting
* Revert some changes in `timelord_api.py`
* Fix `CawlerAPI` readiness
* Fix hinting
* Get some `CrawlerAPI` coverage
---------
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Convert blockchain_constants's consensus_mode param into a fixture and use it to run daemon_simulation one at a time.
* Simulation test seems to support only one running at a time too.
make sure tests that use BlockTools use a single source of consensus constants. This is in preparations for being able to run tests with different sets of constants, e.g. the hard-fork constants
* remove softfork-logic for 1.7 softfork (which has already activated)
* add new constants for soft-fork3, hard-fork and the other plot-filter adjustments
* remove unused run_generator_mempool() function
* move run_generator_unsafe() into the tests, which is the only place it's used
* remove (somewhat meaningless) setup_generator_args() and create_generator_args()
* remove unused GENERATOR_MOD in mempool_check_conditions.py
* remove redundant get_generator() function
* transition analyze-chain.py to use run_block_generator() and drop dependency on GENERATOR_MOD
* fixup type hints in test_rom.py
* fixup type hints in test_compression.py
* fixup type hints in test_generator_types.py
* enable soft-fork2
* add blockchain (consensus) test for time-lock conditions (non-ephemeral spend)
* introduce new soft-fork rule to compare ASSERT_SECONDS_* conditions against the previous transaction block's timestamp (to be consistent with ASSERT_HEIGHT_* conditions)
* bump chia_rs. This updates the mempool rules to disallow relative height- and time conditions on ephemeral coin spends
* implement assert_before in mempool_check_time_locks. Extend ephemeral coin test in blockchain with assert_before conditions
* implement support for assert_before conditions in compute_assert_height()
* support assert-before in mempool
* add timelock rule
* address review comments
* fix bug in make_test_conds() test utility
* bump chia_rs to 0.2.4, which preserves assert_seconds_relative 0 in parsing conditions. This allows for the 1.8.0 soft-fork to make the existing time-lock conditions stricter, > instead of >=. This is to match the existing ASSERT_HEIGHT_RELATIVE, which already is >
* fixup separating ENABLE_ASSERT_BEFORE from MEMPOOL_MODE
* Use a low value for SOFT_FORK2_HEIGHT during tests and cover the case before soft-fork2
---------
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
* simplify daemon connection handling
* Add tests
* return list of service names during removal
* set remove raises KeyError
* Better test type hints
* Add types and code refactor
* fix test typos
* small type adjustments
* test code improvements
* Better error handling for bad json
* handle proper but unexpected JSON values
* Update chia/daemon/server.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* test improvements
* check for empty thing equivalence
* Improved logging for ConnectionReset
---------
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* full_node: Rename `FullNode.resond_block` to `FullNode.add_bock`
The naming `respond_block` is confusing here imo, we have a full node
API method called `respond_block` but here in the `FullNode` class this
method is there to try adding a block to the full nodes's chain so i
think `add_block` is the better choice?
Also change the `respond_block: full_node_protocol.RespondBlock`
parameter to `block: FullBlock` which lets us get rid of many
`full_node_protocol.RespondBlock` wrappings.
* `FullNode.receive_block_batch` -> `FullNode.add_block_batch`
* `receive_unfinished_block` -> `add_unfinished_block` + change parameter
* `FullNode.respond_transaction` -> `FullNode.add_transaction`
* `FullNode.respond_end_of_sub_slot` -> `FullNode.add_end_of_sub_slot`
* `FullNode.respond_compact_vdf` -> `FullNode.add_compact_vdf`
* `respond_compact_proof_of_time` -> `add_compact_proof_of_time`
* `respond_transaction_semaphore` -> `add_transaction_semaphore`
* Drop redundant fixtures in `test_dl_wallet.py`
* Drop `two_wallet_nodes_five_freeze`
Maybe im just not getting it but the `five_freeze` doesn't sound right
here to me and the fixture does the same as `two_wallet_nodes` so i
guess we can just drop it?
* Drop `wallet_and_node` fixture
* Drop both `wallet_node` fixtures
The one in `conftest.py` and the one in `test_dl_wallet.py`.
* Drop both `wallet_node` fixtures
The one in `conftest.py` and the one in `test_dl_wallet.py`.
* Drop `wallet_node_sim_and_wallet` fixture
* Drop `wallet_node_simulator` fixture
* Drop `one_wallet_node` fixture
* preliminary test_pool_rpc refactor
* remove todo
* handle some todos
* one more
* wait for wallets to sync in the fixtures
* drop an extra wallet
* drop unused function
* make daemon heartbeat configurable and increase default
* Fix up daemon rpc test
* Fix dumb error with parameters
* Restore formatting
* Various updates from feedback
* Update tests/core/test_daemon_rpc.py
use config value for heartbeat
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* black fixes
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Fixes the case when a fee estimation request is made before the FullNode has initialized a peak
* Clarify code by setting defaults early
* Only spawn one full node in test
* Block and transaction processing helpers
* flake8
* more and hints
* More
* separate tests of the simulator from tests using the simulator
* move fixture to conftest
* amounts are uint64
* remove unneeded while loop
* backoff instead of fixed sleep times
* .farm_blocks() only forces tx blocks when needed
* fix test_wallet_create_hit_max_send_amount
* fix test_wallet_tx_reorg
* fix test_address_sliding_window
* rename to farm_blocks_to_wallet
* rename to farm_rewards_to_wallet
* undo changes to protocol endpoints
* reword farm_blocks_to_wallet() loop
* rename process_blocks() to farm_blocks_to_puzzlehash() for now
* timeouts
* debug
* debug
* debug... for 3,7
* fix
* up timeout per block to 2 seconds
* increase transaction processing default timeout
* make debug maybe ok to leave around
* tidy
* intersperse sleeps again for wallet progression
* remove debug code
* review tidy
* cheat on uint64() type
* Update tests/simulation/test_simulator.py
* another import fix
* more fixes
* farm_blocks_to_puzzlehash
* more
* tweak
* fix the two-tx-blocks-instead-of-one dilemma
thanks to almog for figuring this out
* fix
* fixup
* rework since it was still broken on 3.7/3.8...
* oops
* yucky timeout
* more timeout
* cleanup todos
* add balance assertion after reorg before resubmission processing
* Apply suggestions from code review
* rename funds to expected_confirmed_balance
* catchup