* add local max subscription config
* add and use trusted wallet config
tests
* lint
* unused import
* break early
* dont break because we need to iterate for hints
* fix off by one
* lint
* Hold a ref to the fee estimator when the Mempool is destroyed and re-created. Unify the sharing of information between Mempool and MempoolManager
* Adjust tests to new Mempool create interface
* Store dynamic Mempool info in the FeeEstimator and static info in the Mempool
* Adjust tests
* Restore logging of block cost % calculation to use documented full block size
* Omit check for nil self.last_mempool_info
* Annotate Mempool members
* Add integration test for add_mempool_item
* Annotate types in BitcoinFeeEstimator class
* 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
* Return existing CAT wallet instead of raising
There's no reason to raise here, all the caller is looking for is an instance of the CATWallet that they're looking for and to create it if it doesn't exist.
* rename create_wallet_for_cat -> get_or_...
* Move wallet created noti inside of function
* remove redundant call
* Simplify addition_amount calculation in validate_spend_bundle() and remove unneeded COIN_AMOUNT_NEGATIVE and COIN_AMOUNT_EXCEEDS_MAXIMUM checks.
* Create a record for the test coin, return it from get_coin_record() and split the tests case by case.
* Add comments next to the unexpected error codes.
* Move the test block record into the fixture function.
* Make it explicit that we're not calling get_coin_record in these tests.
* Also test get_name_puzzle_conditions besides pre_validate_spendbundle.
* Revert testing get_name_puzzle_conditions besides pre_validate_spendbundle.
* dont wait for timeout on None response
* handle return msg by type
* remove empty line
* isort
* improve reply check
* use map to check reply, add has_capability helper
* fix has_capability
* unused import
* add new, optimized tx queue
* isort & fix starting index
* make faster
* fix order
* add comment, change to peer id, remove extra apis and change max size
* lint
* final lint fix
* change to simplequeue, get rid of task and change to cursor
* fix logic
* isort
* optimize cleanup
* add unit tests
* fix comments and switch to random
also add better spacing
* stupid mypy
* undo changes + stupid mypy
* fix tests, raise if full & seperate out peer_id
* get rid of class
* change to simulated tx queue entry
* add local high priority test & remove un necessary asserts
* change to better, faster check
* remove internal asserts
* cleanup test
* Update test_tx_processing_queue.py
<!-- 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
- Use the prompts below to provide information wherever applicable
-->
<!-- What is the purpose of the changes in this PR? -->
<!-- What is the current behavior?** (You can also link to an open issue
here) -->
<!-- What is the new behavior (if this is a feature change)? -->
<!-- Does this PR introduce a breaking change?** (What changes might
users need to make in their application due to this PR?) -->
<!-- Testing notes (is this code covered by tests, or equivalent manual
testing?) -->
<!-- Are there any visual examples to help explain this PR? (attach any
.gif/movie/console output below) -->
They are not yet discovered by `mypy` because we override `__getattr__`
here
b916275540/chia/server/ws_connection.py (L340)
which just returns a coroutine (`Any` by hint) for whatever attribute
you request.
This will be fixed in #14052.
* Add `-l` option to `install.sh` and use it for linux tests on CI
* Implement and test `tools/legacy_keyring.py`
* Update install.sh
Co-authored-by: Jeff <paninaro@gmail.com>
Co-authored-by: Jeff <paninaro@gmail.com>
* mixed rework around tx records and offer takes
* more
* wait for wallets
* process_transaction_records() -> process_transactions()
* correct to use new bundles= parameter a couple spots
* .process_transaction_records()
* .process_spend_bundles()
* always call close callback
* Some further explorations
* some more explorations
* Add delay while connections are closed in test
* Add a delay to make sure connections drain
* Update chia/server/server.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update tests/connection_utils.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* use log_exceptions context manager
* set close flag correctly
* Added callback type and other changes
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Delete DID wallet after transfer
* Adjust tests
* Fix merge
* Remove rl_wallet
* Fix tests
* Fix DID bugs
* Add tests
* Add additional spend for DID update
* Fix unit test
* Handle bugged DID
* Cover empty hint case
* Fix unnecessary DID deletion
* treat Semaphore._waiters as length zero when it is None
We access the `._waiters` private attribute of the Python asyncio
`Semaphore` class. This was changed in Python 3.10.8 (and other versions)
to be initialized to `None` instead of an empty deque. Our existing
unconditional length checks failed on the new `None` default. This seems
to block syncing.
https://github.com/python/cpython/pull/97020https://github.com/python/cpython/compare/v3.10.7..v3.10.8#diff-0fee1befb15023abc0dad2623effa93a304946796929f6cb445d11a57821e737
Reported traceback:
```python-traceback
2022-10-12T20:03:59.367 full_node full_node_server : INFO Connected with full_node {'host': '65.34.144.6', 'port': 8444}
2022-10-12T20:03:59.370 full_node full_node_server : ERROR Exception: object of type 'NoneType' has no len(), {'host': '65.34.144.6', 'port': 8444}. Traceback (most recent call last):
File "/home/summa/chia-blockchain/chia/server/server.py", line 598, in wrapped_coroutine
result = await coroutine
File "/home/summa/chia-blockchain/chia/full_node/full_node_api.py", line 114, in new_peak
waiter_count = len(self.full_node.new_peak_sem._waiters)
TypeError: object of type 'NoneType' has no len()
2022-10-12T20:03:59.371 full_node full_node_server : ERROR Exception: object of type 'NoneType' has no len() <class 'TypeError'>, closing connection {'host': '65.34.144.6', 'port': 8444}. Traceback (most recent call last):
File "/home/summa/chia-blockchain/chia/server/server.py", line 608, in api_call
response: Optional[Message] = await asyncio.wait_for(wrapped_coroutine(), timeout=timeout)
File "/usr/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
return await fut
File "/home/summa/chia-blockchain/chia/server/server.py", line 605, in wrapped_coroutine
raise e
File "/home/summa/chia-blockchain/chia/server/server.py", line 598, in wrapped_coroutine
result = await coroutine
File "/home/summa/chia-blockchain/chia/full_node/full_node_api.py", line 114, in new_peak
waiter_count = len(self.full_node.new_peak_sem._waiters)
TypeError: object of type 'NoneType' has no len()
2022-10-12T20:03:59.487 full_node full_node_server : INFO Connection closed: 65.34.144.6, node id: 506fe4c05ce6b72bb707471842e552307c7a547aa9ba981175db5c08fa3e47e6
```
* add LimitedSemaphore
* Return the CAT txn instead of the fee txn (if a fee is set)
* Commenting
* Test cases for cat_spend with and without a fee
* Check that the coin spend is a CAT spend
* Some simulation test CI hackery
* let me try this
* try this
* yet more attempts
* sigh
* some more attempts
* Adjusting test yaml
* directory != dir
* run a bunch of dups
* experiments
* correct len check
* minor simplifications
* undo test.yaml changes
* Use temp keyring and cleanup temp dirs
* Simplfied get_full_chia_simulator
* move empty_keyring fixture to conftest
* Update tests/simulation/test_start_simulator.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update tests/simulation/test_start_simulator.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* add max coin amount everywhere
* add excluded amounts to bare minimum
offers really does not need it passed.
* add excluded coin ids
* finish rpc stuff
* finalize commands
add coins command group & expand various coin selection methods
* fix argument processing & clean up code
* fix grammer
* small miss
* Update wallet_rpc_api.py
* fix test
* add combination command
* fix error
* move command group
* add new built in funcs for direct wallet coin searches.
* add get coin rpc
* add last command
* switch to pageable function
* fix args
* expand multi rpc call and tests
+ fix other things
* da lint
* add reverse coin sorting and ability to select coins
* Update wallet_state_manager.py
* fix types
* align with protocol
* fix asserts
* fix imports
* isort
* Update wallet_coin_store.py
* Update wallet_rpc_api.py
* more explicit and complete handling of api decorator data
* fix
* .message_class
* actually, those are different types...
* tweak
* simplify
* learn that functools.wraps copies random attributes
* hack the ~planet~ `@api_request` decorator
* R not T
* more future
* implementation detail renames
* minimal fixup for daemon signal handling regression
* test daemon shutdown response to signals
* positional
* test datalayer shutdown response to signals
* one parametrized test for the services
* colocate the daemon test
* drop sig
* add sendable_termination_signals
* oops, it was SIGTERM
* wait for the daemon
* process_transaction_records() -> process_transactions()
* split to process_transaction_records()/_spend_bundles()/_coin_spends()
* expand tests to have multiple transactions etc per repeat
* back to .process_transaction_records() for calls
* one line function defs
* chia keys show --json (display all keys as json)
* black (linting) chia keys show --json (display all keys as json)
* output a root object containing the keys array
* support key with empty label
* add test_show_json and test_show_mnemonic_json to test_keys
* chia keys show --json -- do not format json output
* tests/core/cmds/test_keys.py -- result.output.find(<value>) != -1
* tests/core/cmds/test_keys.py -- result.output.find(<value>) != -1 -- black
* Pass root_path in show_all_keys and fix tests
Co-authored-by: Jeff Cruikshank <jeff@chia.net>
* feat: enable `create_signed_transaction` for CATs and `push_transactions` endpoints
* test: add test cases for create_signed_transaction and push_transactions
* chore: add backwards compatibility
* fix: add `signed_txs` for standard `create_signed_transaction`
* chore: run linter
* feat: accepts `return_single_tx` argument as legacy compat
* fix: improve typing hints
* chore: improve typing
* fix: get rid of `nullcontext` for `python<3.10`
* test: farming more blocks before checking CAT balance
* test: use more robust `farm_transaction` method
* Add a try/except for individual coin states
* black
* Add a retry store
* Only retry for trusted and bug fixes
* lint
* tiny bad merge
* retry for untrusted too
* Only re-raise flaky exceptions in the WSM
* Add unit test
* Update to self.log.exception
* so that's what exception means
* Add an error log for missing peer
* import after merge
* isort
* bad merge
* Drop `get_full_node_connections` -> use `get_connections`
* Drop `connection_by_type`
I think the housekeeping required to have it isn't worth it since we
don't handle huge numbers of connections and `get_connections` should be
less enough overhead. Im open for complains though.
* convert datalayer to DBWrapper2 (all write)
* more read, less write
* remove unneeded connection managers
* and... close it
* data store now creates its own wrapper
* Drop unused hint DataLayer.batch_update_db_wrapper
* require named arguments for most of `DBWrapper2.create()`
* add a transactional reader as `DBWrapper2.reader()`
* contextlib.AbstractAsyncContextManager
* try a minimal test
* rework test to allow the read to finish so the write can finish the commit after that
* pylint disable
* WAL!!!
* more tests
* if TYPE_CHECKING for typing variable assignments
* future
* cover some more test cases
* configure isort to add the future annotations import
* apply the new isort setting
* remove type ignores for new mypy (#13539)
https://pypi.org/project/mypy/0.981/
* another
* mint from did
* fix did puzzle announcements
* clean up params and test
* mypy
* add RPC endpoint
* use rpc client for test
* test create spends in loop
* transfer to target
* fix lineage proof for transfers
* isolate block timing issue in test
* DID lineage proof
* test transfer to targets
* add exclude list to select_coins RPC
* coin json
* move tests to did wallet
* fix typing royalties
* cleanup tests
* DID_HRP to AddressType
* clvm compilation
* improve checks in rpc api
* move mint_from_did to nft wallet
* reduce number of blocks in tests
* forgot to remove mint function from did_wallet.py
* mypy
* validate NFT metadata and edition numbers in test
* fix puzzle announcements, refactor and comments
* make tests work with new RPC server settings
* create puzzle assertions for eve and transfer spends
* rename vars for mint numbering
* rename more edition -> mint variables
* remove DID owner from eve spend
* make coin announcement from did spend
* make transfer from eve spend
* corrections for address options in RPC
* simplify intermediate launchers
* announcments for xch xpend
* re-order announcements for xch spend
* test with fewer blocks
* skip off chain metadata test with IPFS
* add bulk mint puzzle and methods to nft wallet
* add rpc endpoints
* add tests
* don't skip off chain metadata test
* fix default case for xch_coin_list
* provide a skeleton hint protocol for rpc apis
* more
* more self.custom_get_connections = None
* fix RpcApiProtocol.service hinting
* catch up with RpcApiProtocol._state_changed()
* FullNode.server is now non-optional. 'ish
* drop another todo
* custom_get_connections -> get_connections
* just make get_connections() a mandatory method with a helper provided
* lots
* try again
* ._start_with_fingerprint()
* fill out the Service generic parameter in start scripts
* ... instead of pass
* add docstrings to the protocols
* remove no longer needed hasattr/not None checks
* remove outdated comment
* refactor Harvester._is_shutdown to ._shut_down
* add final coverage handling
* switch to development coverage
* correct url
* only run one directory for now
* only 3.10
* delete windows data for now
* drop the 35% failure point
* recover full test matrix
* Use regular coverage
* Update test.yml
* put coverage reporting into an artifact
* oops
* oopsy
* pytest-cov
* maybe
* maybe help out flakes
* farm the spend bundle...
* some more
* more funds for the did test?
* more...
* report chia/ and tests/ separately
* job_timeout = 45 for core
* tidy and disable diff-cover
* remove job_timeout = 45
* --rcfile=.coveragerc
* Update .github/workflows/test.yml
* revert time and blocks
* assert spend is in mempool, lower times and block count
* remove sleep
* lint
* up timeout
* cat test - farm blocks until spend is included
* add spend check for nft endpoints
* fix nft endpoint test
* remove unused code
* 4
Co-authored-by: almog <almogdepaz@gmail.com>
* make a WalletProtocol, defining the shared API of all wallets and fix type checking
* add protocol check for DataLayerWallet. remove outdated comment
* Extend `is_running` command to support checking multiple/all services
* Strip whitespace around service names.
Added tests for is_running()
* mypy
* Added `running_services` command to list all running services
Refactored `is_running` in terms of a common `is_service_running` fn
Added tests for the new/updated functions
* mypy
* Update chia/daemon/server.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update chia/daemon/server.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Removed option to specify specific services to query.
Addressed PR feedback.
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Hint to the ephemeral coin's innerpuzhash
* update datalayer rpc test reference offer blobs and trade ids
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* remove all references to RL wallet
* Missed one
* Some new references from main
* Fix is_transaction_confirmed
* mypy
* check for 'confirmed'
* Try again to fix is_transaction_confirmed
* remove from mypy.ini
* test passing on update nft store
* fix tests
* missed await
* fix formatting
* another test fix
* flaky test fix
* test fix
* cleanup
* nft count fix
* pr feedback fixes
* test fix