* port 0 to fix flakiness
* Try fixing setup_full_system
* Try fixing setup_full_system, and lint
* More attempts to fix
* No more calls to get random ports in setup_nodes
* Revert accidental changes
* Timelord extra arg
* Try with port 0
* Fix daemon test, and lint
* Try without 0.0.0.0
* Back to 0.0.0.0
* Try a few timelord changes to get test running
* Increase timeout again
* Use the correct interface to get the port
* INFO logging to debug issue
* Revert "INFO logging to debug issue"
This reverts commit 7c379e5cca.
* Fix advertised port log
* Add extra log
* Logging back
* Rollback the timelord changes
* Try port 0 timelord
* Revert "Try port 0 timelord"
This reverts commit 4997faf3b2.
* Try full green, change ordering
* Remove unused var
* speed up simulation and cleanup
* Now try without the port config
* Fix a flaky call to get_event_loop
* Try getting the port dynamically
* No dynamic port
* Try changing the ordering
* Try adding a sleep
* Back to what works
* Timelord before vdf clients
* Dynamic port for 1st timelord
* Revert "Dynamic port for 1st timelord"
This reverts commit 0f322a15b7.
* Revert "Timelord before vdf clients"
This reverts commit 3286c34696.
* Revert "Back to what works"
This reverts commit 30380dffb7.
* Revert "Try adding a sleep"
This reverts commit 9212b665a6.
* Revert "Try changing the ordering"
This reverts commit a62597d70d.
* Revert "No dynamic port"
This reverts commit 5d2e15749b.
* Revert "Try getting the port dynamically"
This reverts commit ef9cd75679.
* Revert "Fix a flaky call to get_event_loop"
This reverts commit 01a000fdfb.
* Try one to 0
* Just not 0
* Don't get port dynamically
* Cleanup a bit
* Fix
* Some cleanup work
* Some cleanup work
* Fix daemon test
* Cleanup
* Remove arguments
* make recurse_jsonify() work directly on types, circumventing the dataclasses.asdict() step. This enables simpler integration of non dataclasses into the Streamable and JSON protocols
* add benchmark for Streamable.to_json_dict()
* When prompting to unlock the keyring during daemon launch, it's possible
that the daemon websocket connection will timeout before the user has
entered their passphrase. We can't quickly detect that the connection
has timed-out, so instead we now reconnect after collecting the
passphrase, unlock the keyring, and then close the old connection.
* mypy fix
* Switch to using asyncio.loop.run_in_executor to collect the passphrase on its own thread.
* Use a new ThreadPoolExecutor configured with 1 worker thread.
* add exact match and best exact match algorithms
* optimize algorithm further
this might be good.
* lint
* fix bad logic
* add final algorithms
* delete lint
* oops
* Update coin_selection.py
* simplify and fix knapsack algoritm
* simplify code and correct logic
* make it way better.
* clarify comments and check for edge cases.
* add comments and stuff
* improve coin selection
addressed comments
Thanks!
* add coin_selection rpc tests.
* clean up and add new unit tests
* undo test changes
* add extra test cases
* move coin_selection to its own function and switch to it for cat and main wallet.
* add cat tests
* lint
* make function align with standards
also removed test
* make test better
* add proper types
* Improve code clarity
* wallet: fix coin selection bugs
* wallet: add an assert just in case
* tests: add some sleeps to reduce flakiness
* Isort
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* fix bad merge
* lint
* fix tests
* address aforementioned changes.
* remove wallet test
* isort
* more tests and fixes
* lint
* rename to amount for coin selection rpc
* fix incase we have no smaller coins
* fix tests + lint
* re add asserts
* oops
missed me.
* lint
* fix test
* Squashed commit of the following:
commit 34a2235de5
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Apr 13 10:09:42 2022 -0400
clarify comment
commit adbf7f4f94
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Tue Apr 12 20:27:05 2022 -0400
linty lint
commit 5ebc1ac9fd
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Tue Apr 12 20:17:19 2022 -0400
add failure test and final changes
commit 7e5a21b4c2
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Tue Apr 12 19:35:18 2022 -0400
add descriptions and slim down code
commit 31c95b916d
Merge: d7b91295bd9b0ef5f3
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Mon Apr 11 10:12:05 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit d7b91295b5
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Sun Apr 10 20:31:09 2022 -0400
lint
commit 30dc7c0ab4
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Sun Apr 10 20:25:52 2022 -0400
fix tests
commit 6c8c2e4874
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 15:06:00 2022 -0400
remove duplicate code.
commit 9f79b6f304
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 15:01:10 2022 -0400
address more concerns
commit 67c1b3929f
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 12:59:05 2022 -0400
fix logic error
commit 2d19a53245
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Thu Mar 31 11:47:52 2022 -0400
simplify and de duplicate code
commit 6ab1cc79bb
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 21:34:50 2022 -0400
add function and select individual coin
commit 582c17aa8d
Merge: ce2165942618fbaeba
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 21:14:37 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit ce21659429
Merge: 16aabb3fd6daba28db
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:53:21 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit 16aabb3fd5
Merge: 0b9fc28452286fe426
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:49:02 2022 -0400
Merge branch 'jack-cat-coinselection' into jn_coinselection_dust
commit 0b9fc28455
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:38:12 2022 -0400
lint
commit 62e74c72f4
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 20:34:22 2022 -0400
fix logic and tests
commit e738f44320
Author: Jack Nelson <jack@jacknelson.xyz>
Date: Wed Mar 30 18:52:05 2022 -0400
deal with dust and add tests
* make sure that we do not use any dust
* minor change
* address concerns
* adjust comments
* adjust comment
Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Uses the new `from_bytes_unchecked` method in blspy, to improve performance
* Update test
* Fix merge conflict
* Use from_bytes_unchecked in post_init and from_json
* More uniform code
* simplify SizedBytes and StructStream
* lint
* super() !!!
* do not pass parameter up to super().__init__()
* Update chia/util/struct_stream.py
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
* parse fixed-width int data from class name
* add int512 and uint128 .from_bytes(), test .parse() failures
* test serialization against struct.pack()
* use typing_extensions for final
* override ignore
* stop using struct for StructStream
oh the irony
* fixup .to_bytes() to accept parameters again for where we use that
* bring back signed parameter
* format
* adjust tests for new exception
* eliminate custom coding for uint128 and int512
* tidy
* remove unused StructStream.PACK attribute
* add direct tests for parse_metadata_from_name()
* stricter hinting
* remove no-longer-needed typeshed work-around
* apply strict type checking to all touched files
* remove StructStream override of .to_bytes()
* tidy
* types touchup
* add unused parameter comments
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
Co-authored-by: wjblanke <wjb98672@gmail.com>
* Resend transactions
* Don't recheck transactions more frequently than timeout
* Add wallet resend parameter to config, move timeout code out of tx store, but close to call site
* Add a test for wallet transaction resend
* Add test for wallet retry
* isort new files for precommit and update workflows
* Use correct fixture name
* LGTM - remove unused import
Co-authored-by: Earle Lowe <e.lowe@chia.net>
* Mypy for consensus dir (Except blockchain.py)
* Finish up consensus folder mypy
* Lint
* isort
* lint
* awaitable over coroutine
* less Any
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Test plot sync start and disconnect while a sync is in progress
* Drop `Receiver._lock`, instead wait for `Receiver.sync_active` to clear
* Properly stop the sender and plot manager refreshing on disconnect
* Poll faster, drop the log
* Reset `_sync_id` at the very end of `_finalize_sync`
* Move wallet RPC test setup into a fixture
* Fix `mypy` issues
* Enable `isort`
* Move `tx_in_mempool` out and reuse it instead of `tx_in_mempool_2`
* Introduce `get_confirmed_balance` and `get_unconfirmed_balance`
* Use `pytest.raises`
* Only test with an untrusted full node
* Introduce `generate_funds`
* Drop sleeps and create less blocks
* Recover trusted/untrusted sync parameterization
* Some work on hints
* More cleanup and test_generator_tools
* Change relevant calls
* More refactor and cleanup
* More refactor
* Small fix
* Create wrapper object PeakPostProcessingResult
* Lint and small fix
* Fix a hint bug
* Fix hint update_wallets
* Fix test_full_sync
* pre-commit
* Start with PR review comments
* More efficient iteration
* Remove tx_removals_additions_and_hints
* Revert mozilla ca
* Fix issue with startup
* farmer: Adjust notifications from the farmer to the UI
- Only send the data for the harvester which actually sent an update
- Notify for each loaded batch during initial loading
* Enable improved farmer/harvester GUI
* farmer|rpc|tests: Implement paginated harvester plot endpoints
* Simplify filtering
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Let the API handle the exceptions
* Simplify the other filtering too
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Simplify count assertions
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Refactor `is_filter_match` to `plot_matches_filter`
And just convert to `Plot` in tests.
* Move `chia.util.misc.KeyValue` to `chia.rpc.farmer_rpc_api.FilterItem`
* Rename `peer_id` to `node_id` to be match `get_harvesters_{summary}`
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* util: Implement `Paginator` class as interface to access a list by pages
* Be less restrictive about page sizes and refactor tests
* Make the pages based of 0 instead of 1 and some more test refactoring
* More tests
* Adjust workflows after rebase
* Introduce `Paginator.create`
* `<=` instead of `- 1`
* farmer|rpc: Always add `last_sync_time` in `Receiver.to_dict`
This changes the resonse of `get_harvesters` and
`get_harvesters_summary` to always include that field with value
`None`/`null` if the receiver is not yet synced.
* plot_sync: Add sync state to dict in `Receiver.to_dict`
* Add `total_plot_size` to `Receiver.to_dict`
* Refactor sync object assertions
* Access `_current_sync` directly
* Generate `syncing` data outside
* lookup coins in large batches, rather than one at a time, in block_body_validation
* make get_coin_records use the cache. and make the blockchain change tracking also use the new batch lookup
* make building the sql query a bit more elegant
* fix assert
* fix test_blockchain assert tests
* add type annotation
* await aiosqlite.Cursor.execute() immediately
* Remove warning about CHIA_ROOT being set when running init
* Update to still output the CHIA_ROOT if set, but not instruct the user to remove it
* Store chia_root in a var
* daemon: Iterate over a copy of `websockets`
Currently when it fails to send the response to one websocket it skips
the next websocket in list becaue we remove from the list while
iterating.
* util: Iterate over a copy of `peers_with_peak`
Currently when a peer is closed it skips the check for the next peer in
the list becaue we remove from the list while iterating.