80 Commits
Author SHA1 Message Date
Kyle AltendorfandGitHub 5484024ef3 move time_out_assert() family back to tests (#16846) 2023-11-16 11:20:18 -06:00
b1bdbc40ab use anyio for tests (#16738)
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2023-11-01 13:04:27 -05:00
Earle LoweandGitHub 5ea14326c9 Refactor daemon simulation test (#16081) 2023-10-04 12:16:13 -05:00
88e2761a5c merge listen into advertised_port as None (#15024)
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2023-10-03 20:24:04 -05:00
Matt HauffandGitHub d29acde27a Make the standard wallet return List[TransactionRecord] (#16360) 2023-09-19 15:28:20 -05:00
Kyle AltendorfandGitHub 36070fb19a more (more) uint*() (#16324) 2023-09-15 11:35:21 -05:00
Kyle AltendorfandGitHub ebcf74d9d9 improve dataclasses.replace() usage to improve hint checking (#16286) 2023-09-13 10:25:13 -05:00
Matt HauffandGitHub 13eaf1fd10 Refactor simulator setups from async generators to context managers (#16126) 2023-09-12 10:01:28 -05:00
Kyle AltendorfandGitHub a61c0961a7 @pytest.mark.limit_consensus_modes (#16148)
* `@pytest.mark.plain_consensus_only`

* add reasons

* tidy

* report them all

* remove unneeded usage

* not quite, but adjusting

* mark the test

* backup

* todos for fixtures for now

* maybe...

* limit_consensus_modes

* allow (and specify) multiple modes to limit to

* remove exploratory fixture implementation
2023-08-28 16:59:48 -05:00
Matt HauffandGitHub a545e6a8a7 Introduce TXConfig and CoinSelectionConfig (#15666)
* Explore TXConfig

* test fixes

* more test fixs

* more test fixs

* Make TXConfig a CoinSelectionConfig subclass

* Move RPC config loading into decorator

* Fix mempool performance test

* Fix wallet sync test

* Fix streamable

* Forgot send_transaction_multi

* Remove potentially_inside_lock change

* Add .override to config object

* A few fixes from review

* Get create_message_spend working with tx_config.reuse_puzhash

* pylint and rebase fixes

* Add tests for CMD loaders

* Add RPC client and tests for cancel_offers endpoint

* Add some coverage

* Fix did test

* Add DID test coverage

* add tests for TXConfig & CoinSelectionConfig

* Add reuse_puzhash to dl wallet test

* Add reuse puzhash to dl_wallet test

* Add test coverage to wallet sync test

* Add more tests for TXConfig

* Add tests for coin_funcs.py

* Add some wallet_funcs tests

* Bad merge

* Fix bad test

* condense cmd tests

* test coverage ignore

* merge fix

* Undo GUI change

* Remove a couple of unused tx_endpoints

* Changes due to (#15846)

* Merge fixes

* new=True

* Fix the coins tests

* Fix DID tests

* Fix NFT tests

* Fix VC tests

* Fix wallet tests

* Delete now uneccessary tests

* Fix bad change
2023-08-18 14:03:37 -05:00
Arvid NorbergandGitHub e3f3a540e3 Parallel CI (#16071)
* run CI jobs in parallel by default

* run cat_wallet tests in serial

* run simulation tests in serial
2023-08-17 12:16:26 -05:00
Amine KhaldiandGitHub 4cf2bc9813 Unify test_create_coins_with_amounts() versions into one (#15738)
Unify test_create_coins_with_amounts() versions into one.
2023-07-12 11:22:01 -05:00
Amine KhaldiandGitHub fbe7daa32e Convert blockchain_constants's consensus_mode param into a fixture and use it to skip some simulation related tests in HARD_FORK_2_0 mode (#15384)
* 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.
2023-05-26 11:31:14 -05:00
Kyle AltendorfandGitHub 2ed75d47f3 more mypy platforms in ci (#12299)
* more mypy platforms in ci

* check not checks

* oh yeah, activate...

* add 3.11

* adjust job names

* actually use the right python version for install

* adjust for 3.7 hinting support

* exclude macos 3.7 and macos arm 3.8

* back to 3.8 for now

* major_dot_minor

* oops

* move ignore comments for 3.7

* and more
2023-04-27 09:51:18 -05:00
dustinfaceandGitHub 18e88e8476 types: Use IPAddress instead of str in PeerInfo (#14167)
* Use `IPAddress` instead of `str` in `PeerInfo`

* Add comment about `get_host_addr`
2023-02-22 12:03:41 -06:00
dustinfaceandGitHub 0e309d6c6b tests: Merge some fixtures and drop other redundant ones (#14629)
* 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
2023-02-21 18:37:33 -06:00
Geoff WalmsleyandGitHub 443875e945 Enable setting time between blocks in full node sim (#14310)
remove the reset on time_per_block in full node sim
2023-01-19 15:32:46 -06:00
Kyle AltendorfandGitHub 55f5e371b3 Block and transaction processing helpers (#11535)
* 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
2022-12-19 16:40:58 -06:00
dustinfaceandGitHub 80419cb4f0 tests: Use the self_hostname fixture in more places (#14067) 2022-12-08 11:33:40 -06:00
xdustinface 0cdce83b57 isort: Remove all tests exceptions and sort the related files 2022-12-05 02:06:00 +01:00
Almog De PazandGitHub f85bc15d4b setup services refactor (#13905)
* always return service

* adjust setup_simulators_and_wallets

* adjust setup_simulators_and_wallets

* refactor setup_simulators_and_wallets
add setup_simulators_and_wallets_service

* revert unneeded change

* fix broken fixtures

* lint, fix data_rpc init_wallet_and_node

* fix two_wallet_nodes fixture

* fix two_nodes_sim_and_wallets_services fixture

* fix one_wallet_node_and_rpc fixture

* lint
2022-11-16 20:40:03 -06:00
Almog De PazandGitHub ac2203eda8 Refactor test utils for import availability outside of repo (#13880)
* refactor for import availability outside of repo

* refactor for import availability outside of repo

* small revert

* newline

* fix imports

* fix pre-commit issues

* types issort, adapt mypy ignore

* redundant imports

* move files from util to simulator

* run pre_commit

* remove setup_nodes/keyring from isort.cfg

* fix asyncio import
2022-11-15 18:51:05 -06:00
dustinfaceandGitHub 8e2e51a8c8 Add optional outbound parameter to get_connections (#13879) 2022-11-15 17:40:16 -06:00
738238f698 Minor Simulation CI test adjustments (#13612)
* 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>
2022-10-26 20:26:05 -05:00
Kyle AltendorfandGitHub 4a54e49e10 process_transaction_records() -> process_transactions() (#13629)
* 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
2022-10-19 17:42:20 -05:00
Kyle AltendorfandGitHub 3b084a165b configure isort to add the future annotations import (#13327)
* 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
2022-09-30 03:40:22 -05:00
Kyle AltendorfandGitHub bbd032e1c9 embrace click 8 (#13559)
* click==8.1.3, black==22.8.0

* black

* click option creator hinting

* ignores for to-be-resolved issue

* remove unused import
2022-09-29 11:24:36 -05:00
Amine Khaldi 5440cc61bb Merge commit '105f02993f943f758b8f3276b94c9d0781006877' into checkpoint/long_lived_atari_from_main_105f02993f943f758b8f3276b94c9d0781006877 2022-08-23 13:59:19 +01:00
Amine Khaldi 8e65ceebc2 Merge commit '0dd5391f40df3414180d2df716fe1d9c2d02767f' into checkpoint/long_lived_atari_from_main_0dd5391f40df3414180d2df716fe1d9c2d02767f 2022-08-22 19:50:04 +01:00
Amine Khaldi 2836dd9574 Merge commit 'e5297f411d716b384e0514fd57aeb8536eda0527' into checkpoint/long_lived_atari_from_main_e5297f411d716b384e0514fd57aeb8536eda0527 2022-08-19 19:51:55 +01:00
Kyle Altendorf 3a4b886e6a simpler... 2022-08-18 11:59:17 -04:00
Kyle AltendorfandGitHub fb4ecd6926 tweak zero-farming-amount test 2022-08-18 11:34:54 -04:00
Amine Khaldi a8efa403de Merge commit 'c62a17358a1484f47447dbf27f13d52b005203d1' into checkpoint/long_lived_atari_from_main_c62a17358a1484f47447dbf27f13d52b005203d1 2022-08-15 18:19:53 +01:00
Amine Khaldi 34d6197890 Merge commit '0bc54ae08b6655ec5242a8b21460d34b5e4a38c6' into checkpoint/long_lived_atari_from_main_0bc54ae08b6655ec5242a8b21460d34b5e4a38c6 2022-08-15 13:55:39 +01:00
Kyle Altendorf 2b8db4bf53 fixup 2022-08-10 18:39:54 -04:00
Amine Khaldi 9585241286 Merge commit '7fda9596afa22e5eada462a6e9c9a9c550517ec0' into checkpoint/long_lived_atari_from_main_7fda9596afa22e5eada462a6e9c9a9c550517ec0 2022-08-10 15:48:22 +01:00
Amine Khaldi b11352a97e Unify SimulatorsAndWallets and remove extra bt from datalayer related tests. 2022-08-08 22:08:27 +01:00
Jack NelsonandGitHub 105f02993f Move simulator tests over to new file, to allow other programs to use it (#12759)
* Separate test file at Cameron's request

this lets other tools easily use these tests

* fix accidental text duplication
2022-08-05 13:52:39 -05:00
0dd5391f40 Simulator Final touches (#12703)
* add new rpc and add tests.

I added, get_all_blocks rpc, and expanded the get_all_puzzle_hashes rpc.

* lint pass

* update plot directory for simulator

* return peak height on new block farm

* expand test coverage

* fix plot directory craziness

* simulator sync override

* Add new simulator networktype

* add logging to simulator

* Fix race condition, mempool and confirm

* add reorg seed

* farm block if block 0 sim & fix unsynced for sim

* lint

* oops i forgot to lint

* switch to detecting simulator in network type

also remove inline genesis generation

* fix config loading to use correct variable

Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
2022-08-05 01:23:18 -05:00
dustinfaceandGitHub e5297f411d util: Unify lockfile handling (#12541)
* util: Unify lockfile handling

This patch:
- Renames `util.lock.lock_by_path` to `util.lock.lock_path` and improves it by using `FileLock`
- Unifies all places where we create lock files to use `chia.util.lock.lock_path`
- Changes the daemon lockfile from `start-daemon.launching` to `daemon.lock` like we have it with all `<service>.lock` in the `run` folder
- Drops the `fastener` dependency

* Move the not keyring related sync tests into `test_lockfile.py`
2022-08-04 12:59:39 -05:00
Jack NelsonandGitHub c62a17358a Last new simulator rpc's (#12549)
* add coin rpc's

* finish coin rpc's

* mac lint pass

* Add both block reversion RPC's

* Mac Lint pass

* add tests

* add last tests

* small issue, oops

* quick sql change

* allow developer customization to sim tests

add automated_testing values

* fix camel case

* mac lint pass

* address nitpicks 😄
2022-07-29 12:21:25 -05:00
Jack NelsonandGitHub 0bc54ae08b Move simulator test requirements over to new module (#12521)
* create new test.simulator module

to allow other packages to use the simulator without it crashing.
also tiny QOL fixes

* change user mode sim plot filter

Now only plots matching the user set fingerprint are loaded, this decreases the chance of user error.

* fix small oops in configure

* oops

* fix lint

* isort, who dis

* move folder over to chia/simulator

also change mypy settings again
2022-07-25 14:07:38 -05:00
Jack NelsonandGitHub 7fda9596af Replace existing simulator config & Fix simulator (#12072)
* redesign simulator config loader

* edit initial config file and use it in start_simulator

also final lint cleanup

* small change

* aarggggghhhh

LINTTTTTTTTTTTTTTTT

* fix lint for the last time

DAMN END OF LINE

* Add Types & change port

* fix config loading for tests

* change config options

remove unnecessary options & change ports back

* Add additional config options for old simulator

* Get working simulator & implement the requirements

i hope my code makes sense:)

* remove extra part of config

* fix config typos

* add callback for autofarm

we can call this to tell the node to farm a block

* add auto farm rpc to simulator

* add plot_directory to config

add separate plot dir to avoid issues where the plot dir is shared with tests and an assert fails

* remove port from config

no longer needed due to existing gui simulator being broken

* switch to dedicated plot creation function

* modify api for greater block customization

Added block type option & amount of block option

* disable auto farm for tests

breaks them all ;)
Also made sure to run autofarm while a transaction is in mempool if the mode was just changed

* change farm_block for the better

* clean up autofarm

remove unnecessary optional

* update create block tools and allow additional plot creation tweaks

& do requested fixes

* change to k18's

* minor nitpick

* testing some changes

stop reading these descriptions, just ask me on keybase

* change plot directory name stuff

* add editing of root level keys

* use config_overrides

* update plot info

* re separate create_block_tools

* revert some changes as requested

change back get_plot_dir & undo change to asyncio.run

* replace unnessary catch while adding plot locations

switch to better if logic

* combine simulator_bt function into main

fix block_tools logic too

* fix lint

windows bad

* test auto_farming

* remove change that causes more harm then good

* move test over and unflake it

* make test do the bare minimum

* add proper block waiting or wait avoidance

* fix failing test

* add new rpc client & a small fix

* add new test & add some minor changes to start_sim to support it

New test tests whole user facing simulator with real keychain, gui and daemon.

* merge fixes

* update block-cache version

CHANGE TO MY USER, REVERT THIS LATER

PLS REVERT BEFORE MERGE

fix version

* Revert "update block-cache version"

This reverts commit 3afbbc5f51.

* block args from reaching simulator

* clean up test plot creation

* remove extra bt's being called

this reduces load time

* fix stupid bug

* damn lint

* Revert "remove extra bt's being called"

This reverts commit f78debcc26.

* Revert "clean up test plot creation"

This reverts commit d006a1a196.

* align with 12204

* rename RPC's for clarity

* disable cache error when not running in automated mode

* update tests with new rpc's

oops i forgor

* finalize sim api

* something funky going on

* Revert "something funky going on"

This reverts commit afa1ddde27.

* fix config

* add get_farming_ph rpc

* remove random simulation thing, why are we even using this.

* update tests

* simplify test code & fix lint

* lol one of my own pr's broke another one of my pr's

git funny
2022-07-15 20:49:40 -05:00
+6 7e3e18bdfd Catchup/long lived atari from release 1.4.0 46ebed37d8 (#11648)
* Resend transactions (#11167)

* 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>

* less except -> false (#10219)

* less except -> false

* establish_connection() and .perform_handshake() can just return None

* remove more pointless, and no wrong, assertions

* Write python version error to stderr (#11239)

Co-authored-by: wjblanke <wjb98672@gmail.com>

* simplify SizedBytes and StructStream (#11429)

* 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>

* Allow services to set a non-default max request body size limit (#11516)

* updated bls to 13 (#11529)

* reduce the redundant computations of coin_ids in block_body_validation (#11530)

* add test for streamable -> json conversion (#11527)

* add test for streamable -> json conversion

* fixup test

* Uses the new `from_bytes_unchecked` method in blspy, to improve perfo… (#11463)

* 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

* rename test files that are missing test_ prefix (#10712)

* rename test files that are missing test_ prefix

* update mypy and isort excludes

* skip test_get_host_addr6() in GitHub Actions under macOS

* rebuild workflows

* Coin Selection Refactor With CAT Coin Selection Refactor  (#9975)

* 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: d7b91295b d9b0ef5f3
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: ce2165942 618fbaeba
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: 16aabb3fd 6daba28db
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: 0b9fc2845 2286fe426
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>

* rebuild workflows (#11543)

* remove the cache from CoinStore. It appears the cost of maintaining the cache outweighs the gains. (#11540)

* Keep daemon websocket alive during keyring unlock (#11371)

* 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.

* Support searching derived addresses on testnet. (#11449)

* Support searching derived addresses on testnet.

* Added tests

* Optimize code to not perform useless subgroup checks (#11546)

* Optimize code to not perform useless subgroup checks

* Revert less important optimizations

* hints and strict type checking for test_wallet (#11541)

* hints and strict type checking for test_wallet

* fixup

* flip flop

* disable pytest-monitor by default (#11507)

* disable pytest-monitor by default

* take 2

* make recurse_jsonify() work directly on types (#11537)

* 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()

* tests: Split up and improve `test_wallet_rpc.py` (#11552)

This breaks up the one big test into 

```
test_send_transaction
test_create_signed_transaction
test_create_signed_transaction_with_coin_announcement
test_create_signed_transaction_with_puzzle_announcement
test_send_transaction_multi
test_get_transactions
test_get_transaction_count
test_cat_endpoints
test_offer_endpoints
test_key_and_address_endpoints
```

Note that there is still much more room for improvements. Also the 
following tests can still be split up more:

```
test_get_transactions
test_cat_endpoints
test_offer_endpoints
test_key_and_address_endpoints
```

* Remove unneeded uint64() intermediate in CAT wallet (#11575)

* Get get_args() and get_origin() from typing_extensions (#11571)

* Get get_args() and get_origin() from typing_extensions

* Update streamable.py

* cleanup

* Fix several flaky tests (#11576)

* Increase some of the timeouts to reduce flakiness

* Experiment with CI for flakiness

* Force more runs

* Add argument name

* Fix flaky mempool test

* Attempt to fix another flaky test

* Fix wallet retry test

* Missing arg

* Lint

* Increase benchmark test time

* Debug

* Debug

* Simplify retry test

* Lint

* More lint

* Return false instead of assert

* No need to check disconnect twice (since we don't break, this was flaky)

* Remove useless changes

* Accidental changes revert

* Accidental changes revert 2

* Accidental changes revert 3

* Revert fixture

* Fix a few additional flaky tests (#11597)

* Fix a few additional flaky tests

* Lint

* Update tests/core/full_node/stores/test_full_node_store.py

Co-authored-by: Jeff <jeff@chia.net>

* Fix merge conflict

* Remove unnecessary function

Co-authored-by: Jeff <jeff@chia.net>

* Bind port 0 to fix race condition when grabbing available ports (#11578)

* 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

* restore missing hints being stored as None (instead of 0-length bytes) (#11568)

* Coin simplification (#11567)

* factor out as_list() from Coin into free function. Remove unused name_str() from Coin. Minor optimization of hash_coin_ids() for common case.

* extend Coin unit test

* test installer on fedora:36, drop 33

* add tests.util.misc.assert_maximum_duration for benchmark assertions (#11589)

* add tests.util.misc.assert_maximum_duration for benchmark assertions

* fix some imports

* more

* lint

* correct duration

* hint fixup

* rename to caller_file_and_line()

* set default timer to thread_time()

* extract gc manager and default to disabling

* self calibrate overhead

* wrap none-ness behind .results() method

* add messages

* from __future__ import annotations

* yield out self

* final from typing_extensions

* split it

* just use Future

* tweak

* tweak

* correction in loosely hint checked file

* all future indexing in hints

* union for the hints

* rename

* assert_runtime()

* another rename...

* message -> label

* label all results with test names

* oops

* early return from _set_spent function (#11594)

* check for removals before calling function

* move condition to function

* remove redundant condition (#11582)

* fix built-in profiler to work for mac (#11590)

* Bump actions/setup-python from 2 to 3 (#10949)

* Bump actions/setup-python from 2 to 3

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixup templates for python@v3

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>

* avoid cancelling release/** and long_lived/** (#11519)

* tests: Some adjustments in `test_offer_endpoints` (#11558)

This is a follow up after #11552 which basically used the initial parts 
of `test_cat_endpoints` to make `test_offer_endpoints` working. Now this 
PR drops a lot of the stuff we can assume to be not needed in this test 
because its tested in `test_cat_endpoints` and it adds some general 
improvments to it.

* async sleep and require connection reset error for DoS test (#11612)

* fix jsonify bool

* Remove is not None and length assertion in select_coins() (#11569)

* Remove is not None and length assertion in select_coins()

The `coins is not None` check seems unneeded since `select_coins()` is hinted to return `Set[Coin]`.  The length requirement needlessly restricts from being able to request a zero amount.  Either situation would either trigger an exception in the next assert, or trigger the assert itself for non-zero amounts requested.

* also remove from cat_wallet.py

* new port 0 stuff

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Evan Graham <me@luakt.net>
Co-authored-by: wjblanke <wjb98672@gmail.com>
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
Co-authored-by: Mariano Sorgente <3069354+mariano54@users.noreply.github.com>
Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
Co-authored-by: Jeff <jeff@chia.net>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: neurosis69 <83925572+neurosis69@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gene Hoffman <hoffmang@hoffmang.com>
Co-authored-by: William Allen <wallentx@users.noreply.github.com>
2022-05-26 18:11:21 -07:00
Kyle Altendorf 0a8ae6352a fixup create coins tests 2022-05-25 16:26:19 -04:00
Mariano SorgenteandGitHub 817baa3096 Bind port 0 to fix race condition when grabbing available ports (#11578)
* 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
2022-05-23 08:13:49 -07:00
Kyle Altendorf b6c5babba3 Merge commit 'd154105a6b35f94649f15bca4e3fb8a11a39e70e' into atari-merge_main_d154105a6b35f94649f15bca4e3fb8a11a39e70e 2022-04-19 22:44:02 -04:00
Amine KhaldiandGitHub a2fa8dda01 Prepare test blocks and plots only for tests that need them. This saves us a couple more hours of CI running time. (#10975) 2022-04-05 10:34:57 -07:00
Kyle Altendorf 80e10d1822 fix indentation of a fixture definition 2022-03-25 20:37:02 -04:00
Kyle Altendorf 6fc66009c6 Merge commit 'bf2976a2a9dfdd1b71db48030ef79a4a571feae0' into atari-merge_main_bf2976a2a9dfdd1b71db48030ef79a4a571feae0 2022-03-25 17:13:28 -04:00