* move SerializedProgram into its own file (to fixup type annotations)
* fix type annotations for SerializedProgram
* fixup import statements for new SerializedProgram module
* 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
* remove soft fork logic at height 2300000. The whole chain can be validated with the post-soft-fork rules. Remove testing of pre-soft-fork rules
* fix test_full_sync
* 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
* remove extra bt from as many tests as possible
max speed
* wallet bt tools removal
* fix error & add bt_tools to yield
* final changes
L bozo
* something funky going on
* fix issues
* a couple more fixes
* mypy happy
* damn lint
* Revert "something funky going on"
This reverts commit 1fcc9a34e1.
* 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
* 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
* more work on test blockchain
* Optimize test_blockchain.py
* Fix weight proof bug
* Rename variable
* first rc_sub_slot hash bug
* New plots
* try with a new ID
* Run without cache
* Address test blocks and plots preparation.
* Update constant in test_compact_protocol().
* Update this constant too.
* Revert accidental altering of the gui submodule in ae7e3295f280a591e76c4dffdea75fb74ea5de6f.
* Fix benchmark test
* Revert mozilla-ca change
* Rebase on main
Co-authored-by: almog <almogdepaz@gmail.com>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
* when going through a reorg, maintain all chain state until the very end, when the new fork has been fully validated and added
* when rolling back the chain, also rollback the height-to-hash map
* add tests
* Rename confusing fixtures, especially ones with the same name but different implementation
* revert premature fixture rename: two_wallet_nodes_start_height_1
* Consolidate test fixtures
* Remove unused test code
* Centralize fixture uses of setup_n_nodes
* Centralize fixure uses of setup_two_nodes
* Break up setup_nodes into setup_services, for individial services, and setup_nodes, for initializing different simulator configurations
* Sort imports
* remove event_loop() fixtures
* flake8
* flake8
* remove sys.exit() from daemon shutdown
* bump full node test timeout. a lot... to see.
* fixup some tests
* back to module scope event loop fixture for test_full_node.py
* Update test_full_node.py
* Iterator...
* for the whole directory
* some fixtures back to module scope for reduced runtime
* back to 40 minute workflow timeouts
* these are being addressed separately
* Use bt fixture
* rebase
* Use local_hostname
* flake8
* Remove set_shared_instance
* Remove unneeded comments
* Revert unrelated change
* Add back type signature - rebase issue
* Correct type for _configure_legacy_backend
* See what's going on during CI mypy run
* github workflows
* mypy typing
* Remove legacy Keyring create method
* Start daemon first
* Set chia-blockchain-gui to hash in main
* Fix two test files that were not importing self_hostname
* self_hostname fixture
* Convert all class fixtures to top level functions
* Use bt fixture
* rebase
* Use local_hostname
* Fix test_json (inheritance from unittest.TestCase)
* Use correct BlockTools fixture for test_simulation
* Pass bt fixture into cost calculation tests
* flake8
* Add missing parameters to test functions
* Fix from rebase issues
* Remove set_shared_instance
* Update comment
* Remove unneeded comments
* Remove unused code
* Remove unused code, run `multiprocessing.set_start_method("spawn")` at correct time.
* Revert unrelated change
* Set daemon_port. Teardown services in correct order.
BIG thanks to Mariano Sorgente for debugging help.
* Add back type signature - rebase issue
* Apply review fixes from Jeff
* Document why we need a later pytest-asyncio version
* Correct type for _configure_legacy_backend
* See what's going on during CI mypy run
* github workflows
* mypy typing
* Remove legacy Keyring create method
* Start daemon first
* Shutdown daemon coroutine properly
* Remove un-needed daemon_port argument
* Set chia-blockchain-gui to hash in main
* Remove connect_to_daemon_port
* Remove code that set "daemon_port" before calling `setup_daemon`
* Remove self_hostname fixture and extra self_hostname global
* Fix two test files that were not importing self_hostname
* self_hostname fixture
* Remove more unused test code
* Simplify fixture
* introduce restrictions on generators at a specific height. disallow division on negative numbers and disallow redundant leading zeros on integer condition arguments (produced by a generator)
* use SOFT_FORK_HEIGHT constant
* there is no need to specify height when validating block in block_creation
* Update tests/core/full_node/test_mempool.py
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* Try putting BLS in multiprocess
* Fix test
* Fix test again
* Fix test again ^ 2
* Don't use cache unless necessary, cleanup of unused code.
* WIP fixing tests
* Blockchain tests passing
* Remaining tests and lint
* More test fixes
* Fix full_node_rpc test
* Fix remaining tests
* Correct boolean
* Don't validate sig if CLVM fails. Also testing signature validation properly
* Simplify block prevalidation API and improve tests
* Fix logic error and remaining tests
* Update comments and change to AssertionError
* Try to improve CI performance
* Fix mempool test, try to fix test_blockchain performance
* Set default argument to fix test
* Fix DB conversion test
* Use cache for validating signatures (#9859)
* Use cache for validating signatures
* comments: fix typo
* Don't rerun the super slow part of the test (#9887)
* Prority locking to consensus
* Remove pstats
* Linting
* Do some stuff outside of lock
* Fix startup
* Add log timings
* Try some different locking
* Add limit
* catch excp
* CLVM inside lock
* Try using a semaphore instead
* use events for lock queue
* test
* Add logging for message types
* type
* remove seed
* check new peak waiters
* correct FullNodeAPI self.full_node.new_peak._waiters typo
* correct logging string typos
* only warn about new_peak Waiters if there is at least 1
* remove no-longer-accepted parameter to FullNode.peak_post_processing()
* only warn about respond_transaction Waiters if there is at least 1
* lint
* Change some constants
* Small fix and logging changes
* Put message types outside
* Change some log levels so we can test with info
* More logging
* Increase rate limits but decrease paralelism
* tweaks
* Log dropped tx
* Fix pool rpc test
* Test fixes
* Mempool optimization
* Remove from seen if fails
* Increase queue sizes
* Message types info
* More test and logging
* Small changes to networking just in case
* Decrease logging
* Decrease logging even further
* Decrease logging even further even further
* Decrease logging 3
* Transaction queue
* Don't cancel tasks or close connection
* Cancel tasks on disconnect (for shutdown purposed)
* Fix typo
* Catch cancelled
* Do multiple at a time
* More accurate farmer response time
* More efficiently create tasks
* Increase queue size and priority by fee
* Revert priority
* Don't re-request too many times for dropped TX
* Handle cancelled error so we don't go into a bad state
* Catch cancelled in syncing tasks
* Reduce new_peak_sem to improve performance
* Less bytes conversion
* Missing file, and 2 workers for CLVM
* Validate BLS in a new thread
* tests
* Change semaphore constants
* correct a cancellation triggered exception and assertion
* Fix send_transaction, dont use BaseException, fix tests
* Fix more tests
* only log transaction handler cancellation in debug
* typing in log
* move unfinished validation to diff proc
* it is asyncio.CancelledError
* Add a test for bad signature
* Fix more tests, reduce logging, lint
* One more lint
* blockchain tests, pass bytes directly, single call
* Try to fix rl_wallet failures
* Fix mempool test
* catch everything
* Don't test RL wallet
* Fix more tests and return error code
* Improve error handling in multiprocess
* Add pre-validation time
* Add pre-validation time in logs, and revert pytest.ini changes
* Add log correctly
* Ms.bls cache experiment (#9115)
* Logging for cache
* Less logging
* Return to original plan
* Clean up
* Remove coment
* Remove log
* formalize LockQueue shutdown
* Comments
* Fix blockchain test
* Improve cache
* Remove logs
* Fix sign_coin_spends
* Fix pool wallet
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Yostra <straya@chia.net>
* use a conftest.py for shared blockchain fixtures
* try delaying import
* Revert "try delaying import"
This reverts commit f86cc305b1.
* debug
* debug
* debug
* create the .chia dir for tests before creating a broken symlink
* go back
* delay more imports
* black
* provide an explanatory TODO
* Apply suggestions from code review
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
* fullnode related changes from wallet protocol and unharded derivation
* limit total subscriptions per peer
* reset counter on disconnect
* dict not a set
* check membership
* remove unused tests, lint
* no need to check announcements in python, it's all done in rust
* remove python condition parsing, use rust unconditionally
* no need to assert_my_amount, it's done in rust
* assert my puzzlehash is done in rust, no need to check it in python
* parent id is checked in rust, no need to do it in python
* my coin ID is checked in rust, no need to do it in python
* reorder condition checks to have to ones we won't see at the end
* no need for the RUST_CONDITION_CHECKER constant anymore
* update pool tests to use get_name_puzzle_condition
* agg sig conditions always take two args
* extend test a bit, add comment
* unit test agg sig parser where args list is not null terminated
* fix formatting
* Moved keyring handling into a KeyringWrapper class
* Update click to 8.0.x for prompt_required support
* Renamed KeyringWrapper to _KeyringWrapper
* Expose password management options on Linux
* CLI support for setting/removing a password
* Global option for specifying the master password
* Cache the password instead of setting on the context
* Password bootstrapping during chia init
* Tidying up _KeyringWraper's interface
* Initial pass migrating the legacy keyring contents
* Encryption/decryption of keyring.yaml contents
* FileKeyring backend encrypts with ChaCha20Poly1305
* Tightened up keyring migration and initialization
* Fixed issues identified by linters
* Remove root_path from Keychain
* Prevent double-migration if setting master passwd
* KeyringWrapper tests are mostly complete
* FileKeyring will now honor the service param
* Tests for get/set/delete password
* Formatting/commenting updates
* Writer lock support with tests - WIP
* keyring.yaml is now watched for modifications
* Reader/Writer lock for get/delete password
* Fixed linter issues
* Reader lock tests
* Formatting update
* Hook up CHIA_ROOT support for KeychainWrapper
* Quick fix to address test failures
* Fixed failures when existing legacy keyring exists
* Fixed test failures caused by reusing the same temp dir
* keyring.yaml now lives in ~/.chia_keys by default. Can be overridden with CHIA_KEYS_ROOT or --keys-root-path
* Fixed migration failure when setting a password (not using the default)
* KeyringWrapper now uses supports_keyring_password to determine if a FileKeyring should be used. Patched tests to work regardless of whether supports_keyring_password return False
* The daemon now takes a --have-gui option that will prevent calling check_keys() during startup. If the keyring is locked, we want the GUI to prompt for the password.
* Added is_keyring_locked RPC call
* Added 'unlock_keyring' RPC command
* Added KeychainProxy and KeychainServer to handle RPC messages related to keyring operations. WalletNode no longer directly accesses the Keychain class.
* Turn on macOS support for testing keyring passwords
* Fixed get_key_for_fingerprint to use the ocal keychain if the platform doesn't need to remotely access the daemon's keychain.
Fixed key reconstruction when sent over RPC.
* Farmer now accesses the keychain over RPC
* Fixes for linter issues and some restructuring to support tests that use setup_nodes.py
* Couple of fixes to unblock the GUI from launching when a keyring password is set
* Added a keychain RPC call for add_private_key()
* Added remaining keychain proxy RPC calls for delete_key_by_fingerprint and delete_all_keys
* Check for None when inspecting request arguments
* Run check_keys after unlocking the keyring when the daemon is launched via GUI
* Added check_keys RPC method.
Fixed deserialization of key entropy in get_all_private_keys. This was preventing the GUI from being able to show key details.
* Added get_first_private_key to keychain_server/proxy.
create_plots now uses the keychain proxy when launched from the daemon.
* Added a comment about KeychainProxy in chia plots check
* Workaround import conflict when importing from 'tests.*' due to fasteners name conflict
* Simulator now uses KeychainProxy if launched by the daemon.
KeychainServer/Proxy now takes keychain user/testing params for testing scenarios.
* Added "set_keyring_passphrase" RPC message
* Reworking KeychainProxy usage to handle local keychain tests and RPC keychain tests.
* Replace my prior usage of asyncio.run() with asyncio.get_event_loop().run_until_complete()
* Silencing file_keyring logging for the moment.
* Updated tests to use test keychains and appropriate BlockTools construction
BlockTools should now be created with create_block_tools(_async) to handle async scenarios.
Updated block_tools to be async compatible
Updated fasteners to fix installation of top-level 'tests' in site-packages
* Added 'remove_keyring_passphrase' RPC message to the daemon
Minor tweak to TempKeyring to default to some test params
* Fixed linter issues
* Remove flake8 ignore statement now that the fasteners module has been updated
* Some initial renaming changes: password -> passphrase
* Fixed wallet RPC issue where get_key_for_fingerprint wasn't awaited-upon.
Fixed legacy keyring initialization (for migration scenarios)
* Fixed improperly merged file
* Fixed linter issues.
More renaming.
* Updated spots that were still using an incorrect keychain call
* Renamed use_password_cache, obtain_current_password
* Renamed supports_keyring_password
* Renamed has_master_password
* Renamed has_cached_password, get_cached_master_password
* Linter fixes
* Renamed master_password_is_valid
* Renamed set_cached_master_password
* Renamed set_master_password
* Renamed remove_master_password
* Renamed has_cached_master_password
* Renaming in file_keyring and keyring_wrapper
Updated default keyring payload used for tests
* Renamed get_password
Other renaming updates
* Renamed set_password
Other renaming updates
* Renamed remaining password occurrences (where appropriate)
* password -> passphrase
* Added tests for setting an emoji and Japanese master passphrase
* Attempt to notify the daemon when a keyring passphrase is set/updated/removed
* Missed one password -> passphrase replacement.
* Fixed some file synchronization issues found when running tests on macOS
* Adjusted timeout values for test_writer_lock_reacquisition_failure for macOS.
* Removed logging statements previously added for debugging
* Prompt for keyring passphrase up-front when launching a service.
Changed --have-gui flag to --wait-for-unlock
* Updated set_keyring_passphrase RPC message to fix optional current_passphrase param when the keyring is using the default passphrase.
* Minor test cleanup to deduplicate some code.
* Fixed regression when setting a new master passphrase
* Minor refactoring and docs/commenting updates
* Renaming password -> passphrase went too far. Keyring backends use password terminology for compatibility with third party backends.
* Disabling macOS support (previously added for testing only)
* Disabling passphrase support in preparation for sending out the PR
* Fixed improper merge (vscode didn't save changes during rebase)
* Update chia/cmds/init_funcs.py
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
* skip_check_keys -> should_check_keys
* Shuffling some imports around to break cycles reported by LGTM
* Handle unlocking the daemon if it's already launched and waiting for unlock.
* Replaced uses_keychain_proxy decorator in farmer.py. Fixed async usage of get_reward_targets.
Linter/reformatting fixes
* Replaced uses_keychain_proxy decorator with a clearer method.
* Cleanup the temp keyring dir using shutil.rmtree()
* Restored self._root_path (had been changed to self.root_path)
* Minor cleanup
* ensure_keychain_proxy() now throws if connect_to_keychain_and_validate() fails
* Plot key resolution now yields a PlotKeys object which can be passed into create_plots.
De-indented test_invalid_icc_sub_slot_vdf to keep git blame tidy.
* Added 'keyring_status' daemon RPC message to support the GUI
* Minor changes relating to PR feedback
* Addressed more PR feedback (mostly type annotations)
* Commented-out macOS file keyring usage. This can be re-enabled for testing purposes.
* Addressed test failures that require multiple keyrings in the same process. Each TempKeyring will now set a custom KeyringWrapper instance.
* Fixed logic for communicating user_passphrase_is_set in the keyring_status RPC response.
* Updated type annotations and method signature for set_passphrase to expect a string instead of bytes.
* Fixed Wallet RPC tests
* Fixed full_node_store tests. BlockTools should be created using the create_block_tools(_async) function(s)
* Fixed test failures in test_pool_rpc
* Fixed test_daemon. After BlockTools.setup_plots is run, the config file needs to be re-read to refresh stale plot_directories.
* Suppressing LGTM false positives regarding passphrase leakage in CLI error output. Seems that LGTM sees MIN_PASSPHRASE_LEN as sensitive data.
* Second attempt at suppressing LGTM false positives
* Third attempt at addressing LGTM false positives
* Removed test_keyring_wrapper param from Keychain ctor. Test setup now sets the keyring_wrapper property directly.
* Reformatting
* More targeted update of the test config to refresh just the "plot_directories" value
* More LGTM suppressions
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
Co-authored-by: wjblanke <wjb98672@gmail.com>
* add test for ephemeral coins with relative time/height locks
* additional checks
* formatting
* rename parameter
* don't include condition in first spend
* move test into a better test class
* fixes
* formatting
* simplify test
* make ephemeral coin test not depend on wall clock. Make the initial transaction freeze test also not depend on wall clock. Add tests for ASSERT_SECONDS_ABSOLUTE
* formatting
* validate more aspects of conditions earlier, in the process clvm execution is offloaded to
* more tests
* use as_int() in SExp rather than int_from_bytes()
* put condition parser tests in its own test class
* capitalize module-scope variable
* abbreviate enum names in parse_condition_args
* use a more realistic cost per byte in test_rom
* merge parse_coin_id and parse_hash, since they are identical