* 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
* cmds: Implement `chia beta` for the beta test program
* Unhide and document all `beta` subcommands
* Refactor all subcommands
* Introduce `chia beta configure`
* Introduce `chia beta status`
* Test all `chia beta` commands
* Use a separate file logger for beta logs
* Write the plotting call args to the log file
* Sort potential submissions
* Some refactoring around log file log handler creation
* JSON dump the plotting args
- `__tracebackhide__` provides more clear tracebacks on failure when writing assert-like helpers
- `coroutine` is the name of the type of object you get back after calling an async def
- no need to repeat the timing condition after it has already failed
* Remove mempool.additions
* Don't re run the program, and remove program from mempool item
* Removals only stores item ids, and stores a list
* Move pending cache down to prevent cache dos
* Separate validation from adding to pool, and remove mypy exceptions
* Fix bug with replacing
* Add to mypy
* Revert cbgui
* precommit fail
* Properly update the seen dict
* lint error
* Fix mempool bug
* Enable mypy for a bunch of files
* Update after merge with main
* 99/260 remaining
* Address comments
* Enable more mypy
* Merge conflict mypy file
* More fixes
* pytest.ini and cb-gui
* One more flake8 fix
* Flake8 and tests
* More test fixes
* isort
* Make LGTM happy
* Update chia/full_node/block_store.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update chia/full_node/full_node_store.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update chia/wallet/util/peer_request_cache.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Apply all suggestions from PR comments
* Revert cb-gui
* 100 back to 1000, minor tweaks
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Replace localhost with 127.0.0.1 in block tools config
* also make self_hostname fixture be 127.0.0.1
* Move config rewrite inside `automated_testing` conditional
(cherry picked from commit ec056f59b3)
* Remove mempool.additions
* Don't re run the program, and remove program from mempool item
* Removals only stores item ids, and stores a list
* Move pending cache down to prevent cache dos
* Separate validation from adding to pool, and remove mypy exceptions
* Fix bug with replacing
* Add to mypy
* Revert cbgui
* precommit fail
* Properly update the seen dict
* lint error
* Fix mempool bug
* Update after merge with main
* Address comments
* Replace localhost with 127.0.0.1 in block tools config
* also make self_hostname fixture be 127.0.0.1
* Move config rewrite inside `automated_testing` conditional
* optimize the block_store for the get_puzzle_and_solution_for_coin to not parse the full block. We just need the block generator and generator regs.
* optimize analyze-block
* address review comments
* coin interest optimization for trade records
* don't duplicate coin
* added a test
* migration test
* trade record replace test
* mypy fixes
* refactor to use coin_id
* return a set
* Add mariano54s spam filter changes (original PR is #11894)
* Add new spam_filter tests
* remove get_all_coins method and query db directly in test
* Add test to include case where everything gets filtered, even the first coin
* If filter threshold is <= 1, no need to run the filter
* add test of chia.wallet.wallet_coin_store.get_all_unspent_coins
* Add test case for receiving large coin after sending dust coin
* Add NFT test to spam wallet
* resolve merge conflicts with main
* remove unneeded coin store test
* Add black formatting
* split long comments into multiple lines
* Run black, second try
* Manually add black changes
* Black
Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
* introduce an UncurriedPuzzle class, containin the mod and args from a puzzle that has already been uncurried. Pass this around to functions that want to access the uncurried puzzle, to avoid uncurrying the same puzzle multiple times.
* use UncurriedPuzzle for get_inner_puzzle()
* annotate CAT outer puzzle driver
* add type annotation to transfer_program_puzzle
* add type annotations to singleton_outer_puzzle
* add type annotations to ownership_outer_puzzle
* add type annotations to metadata_outer_puzzle
* remove unused _asset_id field in puzzle drivers
* Generalize NFT offers
* Write tests for complex NFT1 offers
* Combine two loops
* isort
* Save one block farmed
* Increase timeouts
* black
* merge related fix
* add royalty calculation method and RPC
* flake8
* Fix the CLI for royalties
* royalty_pts -> royalty_percentage
* minor test fix
* util: Implement key label support for `FileKeyring` and `KeyringWrapper`
* Restrict trailing/leading whitespaces in the label
* Bump `MAX_LABEL_LENGTH` to 65
* Additional label tests
* Drop duplicated `KeychainFingerprintNotFound` definition
* Drop `TestDaemon` class
* Refactor response checks in `test_daemon.py`
* Make `test_mnemonic` and `test_fingerprint` global
I want to use them in some other tests in the parameterization.
* Create the daemon connection in the fixture, yield it with the keychain
* Use `KeyData` for the global key data
* disable the merkle_root regression test. It's expensive and we're already convinced there are no discrepancies between the old and the new implementation
* disable the exhaustive full block parser test
* util: Introduce `KeyData` and `_get_pk_and_entropy` -> `_get_key_data`
* Fix typos
* `include_secrets=False` in `delete_key_by_fingerprint`
* Use a variable for the mnemonic string in `KeyDataSecrets.__post_init__`