* better handling of offer status and failed txs
* 5 retries before tx is marked failed
* increase test timeouts
* fixed test
* require only difference vs whole fee
* polish + fee coins kick in only if we're missing fee
* Stop sending change to a new address
* Fix bug
* Add config & unit tests
* Resolve comments
* Refine based on the requirements
* Change config to str
* Disable addr reuse for unit test since the hardcode offer doesn't compatible with it
* Cover offer trade
* Add unit test and RPC support
* Add reuse option for cli
* Enhance unit test
* Fix unit test
* Add unit tests for create_bundle_from_mempool().
* Factor out some shared code into a function.
* Add a variation for sending transactions in reverse order.
* Split some logic into functions.
* Refactor setting up the mempool with coins as well as big cost spend bundle handling.
* Remove valid # type: ignore
A user ran into an exception on this line that mypy should have caught. Let's see what it says.
```python-traceback
2021-05-06T07:31:41.595 full_node full_node_server : ERROR Exception , exception Stack: Traceback (most recent call last):
File "chia\server\server.py", line 356, in start_client
File "aiohttp\client.py", line 763, in _ws_connect
File "aiohttp\client.py", line 521, in _request
File "aiohttp\connector.py", line 535, in connect
File "aiohttp\connector.py", line 892, in _create_connection
File "aiohttp\connector.py", line 1032, in _create_direct_connection
File "aiohttp\connector.py", line 969, in _wrap_create_connection
File "asyncio\base_events.py", line 949, in create_connection
File "asyncio\selector_events.py", line 473, in sock_connect
concurrent.futures._base.CancelledError
2021-05-06T07:31:45.016 daemon asyncio : ERROR Task exception was never retrieved
future: <Task finished coro=<kill_service() done, defined at chia\daemon\server.py:833> exception=AttributeError("'list' object has no attribute 'pid'")>
Traceback (most recent call last):
File "chia\daemon\server.py", line 841, in kill_service
File "chia\daemon\server.py", line 805, in kill_process
AttributeError: 'list' object has no attribute 'pid'
2021-05-06T07:32:09.965 full_node full_node_server : ERROR Exception: <class 'concurrent.futures._base.CancelledError'>, closing connection None. Traceback (most recent call last):
File "chia\server\server.py", line 531, in api_call
File "asyncio\tasks.py", line 435, in wait_for
concurrent.futures._base.CancelledError
2021-05-06T07:33:20.573 full_node full_node_server : ERROR Exception , exception Stack: Traceback (most recent call last):
File "chia\server\server.py", line 356, in start_client
File "aiohttp\client.py", line 763, in _ws_connect
File "aiohttp\client.py", line 521, in _request
File "aiohttp\connector.py", line 535, in connect
File "aiohttp\connector.py", line 892, in _create_connection
File "aiohttp\connector.py", line 1032, in _create_direct_connection
File "aiohttp\connector.py", line 969, in _wrap_create_connection
```
* fix plotter service killing
* just make it always be a list of processes for all services
* catch up tests
* Update chia/daemon/server.py
* clarify test with unknown condition opcode
* fix bug in mempool_manager test_ephemeral_timelock
* simplify test_blockchain test_ephemeral_timelock by factoring out the with_garbage parameter
* 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>
* bump chia_rs to version 0.2.3
* add new error codes for assert_my_birth_*
* add new condition codes for ASSERT_MY_BIRTH_*
* add logic for ASSERT_MY_BIRTH_* conditions
* implement Mempool using an in-memory sqlite database
* remove_from_pool with empty list is a no-op
* the order is not important in get_coin_records_by_puzzle_hash() or get_block_spends()
* use format string in log statement
* make MempoolItem not streamable, to improve performance of creating objects
* user shorter names for constants in test_mempool.py
* fix typo in test_ephemeral_timelock in mempool test. The conditions should only be applied to the ephemeral coin, not the coin creating it
* use shorter names in test-ephemeral-coin test parameters
* use shorter names in TestConditions to make the test easier to read
* user shorter names in test_blockchain test_ephemeral_timelock, to make the test easier to read
* extend test_ephemeral_timelock to cover soft-fork 2
* extend test_conditions to cover soft-fork 2
* 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`
* Introduce BlockRecordProtocol as a subset of BlockRecord that the mempool manager uses for peak.
* Create BenchBlockRecord and use it for benchmarks/mempool.py.
* PR #14611 didn't land yet (keep 3.7 support for now).
* We don't need this guidance anymore.
* Make `WalletNode.set_sync_mode` an `asynccontextmanager`
* Only fetch the height if debug logs are enabled
* `yield` the start height of the sync context in `set_sync_mode`.
* fix test asserts to not require the same object, just the same value
* make Mempool's implementation private and give it a public interface
* fixup test that used to count fee *levels* but now count transactions
* make conditions_for_solution able to parse untrusted CLVM structures
* demote as_atom_list() to be a test-only function in test_rom.py, which is the only place it's used now
* 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
* Check Wallet DB integrity
* Update command line help
* Improve duplicate DerivationPath index error message
* Move tests to chia/tests
* lint
* py init file
* Print WalletType names
* Don't complain about wallets not having derivation entries that don't need them
* Validate addresses used in order
* Update tests with new error output
* Fix check_addresses_used_contiguous in the case when the last address of the previous wallet was unused
* Augment mempool's total_mempool_fees to int as it shouldn't be limited by type Mojos.
* Add an assert to make sure the total mempool fees are correct.
* Only deal with the relevant subset of the MempoolItem (which is SpendBundle here).
* get_items_not_in_filter() doesn't need to be async.
* Use len(items) instead of counter for the limit check.
* Update tests to reflect the improvements.