Commit Graph

151 Commits

Author SHA1 Message Date
wjblanke
442a83e968
change lite wallet peers from 5 to 3 (#9994) 2022-01-28 19:17:14 -08:00
Yostra
ca84fa9f8d
Sync improvements (#9974)
* stash

* change log level

* stash changes

* cat tests

* add node id chia show

* make max sibscribe items configurable

* lint

* add logs for limits

* paralelize incluzion valdiation, don't diconnet from remote peers until local peer in synced

* wallet rate limit

* test log lvl, trusted, black

* only validation under semaphore

* flake mypy trade test

* reduce flakyness

* merge fix

* rename

* linting

* validate parallel, apply serial

* reduce falkyness

* lint

* Fix CAT tests

* black

* flaky test, total amount

* fix cat test

* skip existing state

* skip existing

* try other caches

* flake8

Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: William Blanke <wjb98672@gmail.com>
2022-01-28 19:16:47 -08:00
Chris Marslender
cbbdb6510a
Adding additional data to RPCs for metrics (#9945)
* Add "metrics" as an additional destination for get_blockchain_state changes

* Add compact/uncompact blocks to get_blockchain_state

* Add total mempool cost to blockchain state

* Add hint count to blockchain state

* Add info about max cost, block_cost, and block_fees

* Add mempool min fee to blockchain state

* Add dict for mempool fee estimates

* dont start key with number

* Move max block cost to blockchain state

* Add generic exception logging util

* Catch/log any exceptions in counting hints

* Fix inconsistent key

* Assert row is not none

* Move block count metrics to a new endpoint

* report on block instead of unfinished_block for metrics

* Mark the block event with bool for if transaction block or not

* Add some basic tests for counting hints

* Add some basic tests on counting compact/uncompact blocks

* Fix lint

* Add k-size

* Add timestamp

* Add header_hash + height
2022-01-27 18:42:49 -08:00
Arvid Norberg
2bb591c681
default log rotation to 50 MB (instead of 20) and make it configurable (#9986) 2022-01-27 15:54:20 -08:00
Matt Hauff
0c8727f469
Remove wallet-only as a service group (#9935) 2022-01-26 17:21:08 -08:00
Yostra
b08c904ebf
migration (#9948) 2022-01-26 17:19:42 -08:00
Arvid Norberg
a501c53228
default new installs to use v2 blockchain database schema (#9951)
* default new installs to use v2 blockchain database schema. Leave an option to initialize a v1 database

* rename default database file to say v2
2022-01-26 17:14:05 -08:00
Mariano Sorgente
4708db1b2c
Set reserved cores to 0 (#9790)
* Set reserved cores to 0

* Change reserved cores to 0.

* Remove wallet config since it's unused
2022-01-23 21:52:10 -08:00
Kyle Altendorf
5f4e39480e
Fix streamable for Python 3.10 (#9918) 2022-01-23 21:44:51 -08:00
Mariano Sorgente
f0a6189f2d
Move BLS validation to other processes during sync (#9746)
* 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)
2022-01-20 14:50:41 -08:00
Matt Hauff
2e3c054c3a
Add remaining offer code to main (#9886)
* Add remaining offer code to main

* Fix compression test

Co-authored-by: Jeff <paninaro@gmail.com>
2022-01-20 14:49:31 -08:00
Kyle Altendorf
2acf03e850
Default connect_to_unknown_peers to True (#9864) 2022-01-18 20:17:44 -08:00
Arvid Norberg
93d967525b
revert allow-upgrades configuration option. It makes it significantly more complicated to do proper database migrations (#9768) 2022-01-13 14:53:27 -08:00
Chris Marslender
516f5639db
Add testnet10 config (#9805)
* Add testnet10 config

* Add testnet10 to missed files

Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
2022-01-13 13:13:05 -08:00
Yostra
89f15f591c
Merge standalone wallet into main (#9793)
* wallet changes from pac

* cat changes

* pool tests

* pooling tests passing

* offers

* lint

* mempool_mode

* black

* linting

* workflow files

* flake8

* more cleanup

* renamed

* remove obsolete test, don't cast announcement

* memos are not only bytes32

* trade renames

* fix rpcs, block_record

* wallet rpc, recompile settlement clvm

* key derivation

* clvm tests

* lgtm issues and wallet peers

* stash

* rename

* mypy linting

* flake8

* bad initializer

* flaky tests

* Make CAT wallets only create on verified hints (#9651)

* fix clvm tests

* return to log lvl warn

* check puzzle unhardened

* public key, not bytes. api caching change

* precommit changes

* remove unused import

* mypy ci file, tests

* ensure balance before creating a tx

* Remove CAT logic from full node test (#9741)

* Add confirmations and sleeps for wallet (#9742)

* use pool executor

* rever merge mistakes/cleanup

* Fix trade test flakiness (#9751)

* remove precommit

* older version of black

* lint only in super linter

* Make announcements in RPC be objects instead of bytes (#9752)

* Make announcements in RPC be objects instead of bytes

* Lint

* misc hint'ish cleanup (#9753)

* misc hint'ish cleanup

* unremove some ci bits

* Use main cached_bls.py

* Fix bad merge in main_pac (#9774)

* Fix bad merge at 71da0487b9

* Remove unused ignores

* more unused ignores

* Fix bad merge at 3b143e7050

* One more byte32.from_hexstr

* Remove obsolete test

* remove commented out

* remove duplicate payment object

* remove long sync

* remove unused test, noise

* memos type

* bytes32

* make it clear it's a single state at a time

* copy over asset ids from pacr

* file endl linter

* Update chia/server/ws_connection.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-01-13 12:08:32 -08:00
Arvid Norberg
c143b71c22
log the synchronous mode used to open the blockchain database in (#9781) 2022-01-11 15:32:05 -08:00
Kyle Altendorf
e498a406a0
Make the hard coded 2 reserved cores configurable (#9709)
* Make the hard coded 2 reserved cores configurable

* add missing reserved_cores parameters

* add missing reserved_cores parameters
2022-01-10 20:58:29 -08:00
Kyle Altendorf
7af4a58b63
DaemonProxy request IDs should be hinted as strings (#9584) 2021-12-16 15:13:41 -08:00
Kyle Altendorf
1ec2fc1526
Fix new complaints from mypy 0.920 (#9586) 2021-12-15 17:52:25 -08:00
xchdata.io
41ff79a86c
Properly assign keyring observer to instance field (#9556) 2021-12-13 22:41:51 -08:00
Jeff
30a0ff02bc
Restore peer_db_path and wallet_peers_path config keys/values for downgrading from a newer install. (#9557) 2021-12-13 22:01:14 -08:00
Kyle Altendorf
8bbbc7f9d8
Fix odd string format (#9508)
I would like to just have a list of strings instead of splitting, but let's at least have it be a clean string for now.
2021-12-13 08:39:36 -08:00
Kyle Altendorf
44b4d69ad7
Fix some hints (#9484)
* Fix some hints

* remove unused import

* correct AmountWithPuzzlehash.amount to be uint64
2021-12-10 15:00:43 -08:00
Kyle Altendorf
5eeec865e9
stub and use SizedBytes.fromhex() until upstream is released (#9458)
* stub SizedBytes.fromhex() until upstream is released

https://github.com/python/typeshed/pull/6201

* black

* more

* more

* more

* more

* more

* import TYPE_CHECKING via from

* more

* more

* catch up
2021-12-10 14:59:49 -08:00
Kyle Altendorf
c5902841de
Just use bytes32() some more (#9472)
* Just use bytes32() some more

* black

* more
2021-12-07 07:55:48 -08:00
Kyle Altendorf
406253f782
Adjust compress_root() to return bytes32 (#9470) 2021-12-07 07:55:04 -08:00
Kyle Altendorf
b998193c7e
create and use SizedBytes.from_hexstr() (bytes32) (#9467)
* create and use SizedBytes.from_hexstr() (bytes32)

* another

* more

* more
2021-12-07 07:54:26 -08:00
Arvid Norberg
70d31a8c68
V2 database framework (#9442)
* fix block_store benchmark linting issues

* basic support for database versioning

* update benchmark to run v1 and v2
2021-12-03 13:52:10 -08:00
Kyle Altendorf
8291f0221a
Make the sized bytes types hint compatible (#9369)
* Rework sized bytes for type hinting compatibility

* add a bunch of type: ignores

* this will be handled elsewhere

* noqa E501 instead of changing code

* normalize comment plurality

* @classmethod

* Revert "@classmethod"

This reverts commit 95db80e339.

* add ignore in benchmarks

* just E501 again...

* add some new type: ignores
2021-12-02 09:43:39 -08:00
Florin Chirica
ae8bdbc3c7
Windows blueboxing. (#8394)
* Windows bluebox.
2021-12-01 11:32:49 -08:00
Gregory
025c45f0b5
Chia Seeder (#8991)
* initial hack

* crawler

* add pytz

* Checkpoint.

* Catch some bugs.

* Localhost dig working.

* Checkpoint: return only high quality nodes.

* Statistics.

* Try improving finding reliable nodes.

* Bug.

* Move db to memory.

* Timestamp in the last 5 days.

* Increase crawl parameters, 180+ connections per sec.

* Bug.

* Optimize for DNS traffic.

* Prepare for hosting.

* Minimum height.

* Typo.

* Try catch everything.

* dnslib.

* Add db, format code.

* nits.

* No connections for the dns server.

* Rename src -> chia

* Fix some issues with v1.1

* Crawler task pool.

* Optimize closing connections.

* Split crawler and dns server.

* Install instructions.

* Catch startup bug.

* Try a big timeout for lock aquire.

* lint.

* Lint.

* Initial commit extended stats.

* Simplify code.

* Config.

* Correct stats.

* Be more restrictive in crawling.

* Attempt to fix stats bug.

* Add other peers port to config.

* Update README for the config.

* Simplify crawl task.

* Fix bug on restarts.

* Prevent log spamming.

* More spam prevention.

* Fix bug.

* Ipv6 (#1)

* Enable ipv6.

* Fix bug.

* Use numeric codes for QTYPE.

* ANY working.

* More spam prevention.

* Try to improve IPv6 selection.

* Log IPv6 available.

* Try to crawl more aggresive for v6.

* rename dns.py to crawler_dns.py so it doesn't conflict with imported package names

* Remove pytz package off dependencies

* Tidy-up ws_connection.py

* Fix spelling

* Reinstate chia-blockchain readme, with additional lines pertaining to the DNS introducer & crawler

* More detailed info in the README wrt Chia Seeder

* Nit

* More memetic naming of Chia Seeder

* Nit

* Add entry points

* Add entry in packages

* Patch some methods on the upstream server

* Update peer record fields

* Standard library imports first

* Crawler API check

* Reconcile crawl store

* Account for crawler_db_path in config

* Await crawl store load DB and load reliable peers

* Updates to crawler

* Rename to dns_server

* Crawler-specific overrides for the chia server

* Edit comment

* Undo changes to ChiaServer in view of crawler-specific overrides introduced in previous commit

* Nit

* Update service groups

* Expand name maps, mostly

* Fix the init config

* Remove unused import

* total_records unused at this stage

* Remove ios_reliable in peer_reliability table

* Remove row[20] entry

* Split overly long line

* Fix

* Type hint for ns_records

* Reconcile mismatch btw type int and uint64

* Type annotations in crawler

* Check whether crawl store is set

* Remove upnp_list

* Lint

* Chia Seeder CLI

* Lint

* Two white spaces

* 3rd party package import

* Cleaner way to handle overrides for ChiaServer method

* Address linter warnings

* Rename

* Nits

* Fix

* Change port #

* Most chia_seeder commands up and running

* Rename

* Progress of sorts

* Fix

* Improve legibility

* Fix naming

* Fix setup.py

* Lint

* None -> ''

* Remove whitespace

* Rename

* Log ipv6 better. (#9227)

* Log ipv6 better.

* Lint.

* -

* Undo GUI changes

* Another attempt

* GUI changes

Co-authored-by: Yostra <straya@chia.net>
Co-authored-by: Florin Chirica <fchirica96@gmail.com>
Co-authored-by: Chris Marslender <chrismarslender@gmail.com>
2021-11-27 18:30:25 -08:00
dustinface
a95dfba70b
plotting|util|tests: Introduce chia.util.generator_tools.list_to_batches (#9304)
* plotting|util: Introduce `chia.util.generator_tools.list_to_batches`

* tests: Test `list_to_batches` in  `test_list_to_batches.py`

* util|tests: Return an empty iterator for empty input lists

* tests: Test list sizes from 1-10 in `test_valid`
2021-11-24 11:27:31 -08:00
Arvid Norberg
aacdc03188
Sql index changes (#9349)
* make the is_peak index smaller

* condition database updates on a configuration option

* drop unused coin_spent index

* drop redundant index on primary key

Co-authored-by: neurosis69 <83925572+neurosis69@users.noreply.github.com>
2021-11-23 13:23:07 -08:00
Kyle Altendorf
1073f9d5dd
mypy: warn_unused_ignores = true (and remove some) (#9085)
* mypy: warn_unused_ignores = true (and remove some)

* catch up

* type checking tweaks

* precommit uses mypy --no-warn-unused-ignores

* revert a bit

* precommit explanatory comment

* Update .pre-commit-config.yaml

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-11-23 12:44:53 -08:00
Chris Ross
2c4aaa1ec9
Resolve v6 addresses (#8861)
* Address deficiency discussed in #8552, add ability to resolve to IPv6
addresses for hostnames.

* If there is no prefer_ipv6 in the config, set it True (per @hoffmang9)
and write it back to config.yaml

* Pass prefer_ipv6 flag to get_host_addr, which required a little digging
for it in a few places that call get_host_addr.

* Update a couple things for consistency

* Move the load_config into Wallet's __init__ so it doesn't get called so
many times as it would in has_full_node.

* Pass None into get_host_addr if there's no preference in config, so we have only that one place where the coded default lives.  also fix an oversight where we were building a PeerInfo from a PeerInfo in some cases.

* Change the default here to match the default coded into util/network.py.  It seems that github testers can't handle trying to use IPv6 and this may be easier for average users (sadly)

* A test to see if manually creating the server on :: (IP6_ANY) lets tests connect to localhost with IPv6 on

* Revert back to IPv4 default and remove the override inserted into
TCPSite for testing.

* Don't test for ip6-localhost, as it's not on all systems.

* Bah.  Forced formatting of commented code...

* Add a type annotation for the addrset variable

* If we don't quote the socket enums, pylint gets upset because it has issues figuring out where/how they're defined.  So, quote them here.

Co-authored-by: Chris Ross <cross+chia@distal.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2021-11-22 14:34:03 -08:00
Jeff
c4e14f5c78
Peer db new serialization (#9079)
* Serialize/deserialize peer data alongside existing sqlite implementation (to be removed)

* Simplified AddressManagerStore. No longer uses sqlite and is no longer async.

* Removed aiosqlite usage from AddressManagerStore.
Added PeerStoreResolver class to determine the appropriate location for "peers.dat"
Updated initial-config.yaml to include "peers_file_path" default, replacing "peer_db_path" (similar change for "wallet_peers_path")

* Minor comment changes/additions

* Added migration from sqlite peer db.
Made AddressManagerStore's serialization async as it was right at the edge of blocking for too long.

* Minor tweaks to checking for migration

* Removed AddressManagerSQLiteStore class scaffolding

* makePeerDataSerialization now returns bytes instead of a PeerDataSerialization object

* Async file I/O for write_file_async using aiofiles
Added more tests

* Separate out the synchronous part of move_file

* Renamed write_file to files since we're opening up the capabilities a bit

* Update references to write_file

* Renamed test_write_file to test_files

* Tests covering move_file and move_file_async

* Minor refinements to behavior and tests

* Use aiofiles for reading peers.dat

* Added missing mypy typing info for aiofiles. Also added types-PyYAML to dev_dependencies so that `mypy chia tests` doesn't require running with --install-types

* Add types-aiofiles to the linting workflow

* Directory perms can now be passed into write_file_async.
Added an explicit f.flush() followed by os.fsync() after writing the temp file contents.
2021-11-19 11:12:58 -08:00
Mariano Sorgente
8a028c3594
Ms.mempool locking (#9050)
* 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>
2021-11-04 09:29:05 -07:00
Jeff Cruikshank
911d26d3a8
Enable keyring passphrase support by default. Can be disabled by setting the CHIA_PASSPHRASE_SUPPORT env variable to false. (#8864) 2021-10-22 09:03:27 -07:00
Mariano Sorgente
8f3ea9c81b
Update old comment on streamables (#8872)
* Update old comment on streamables

* Apply suggestions from code review

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>
2021-10-19 10:37:31 -07:00
Arvid Norberg
732fb51fe0
add alternative to pkm_pairs_for_conditions_dict() which is a bit more straigh-forward and returns the public keys and messages in the forms we need them to validate them. This is a step towards simplifying the conditions data structures (#8128) 2021-10-19 06:26:53 -07:00
Arvid Norberg
1f893907b9
make db_sync setting default to FULL. Extend the configuration to cover all of OFF, NORMAL and OFF (#8836) 2021-10-16 09:02:18 -07:00
Jeff Cruikshank
3864f750b4
Backend changes to support passphrase hints and additional GUI passphrase support (#8779)
* Expose GUI option to save passphrase (where available)
Prevent GUI from showing the option to remove migrated keys

* Backend support for getting/setting the passphrase hint. The hint data is stored in keyring.yaml in the clear.

* CLI support for showing/setting/removing the passphrase hint

* Tests for setting/retrieving passphrase hints

* Squelch LGTM false positive

* Fixed issue when running without passphrase support enabled

* CLI updates based on feedback

* Initialize passphrase_hint earlier.

* Minor restructuring to address linter complaint.
2021-10-13 10:36:10 -07:00
Jeff Cruikshank
ab7d07ad30
Renamed chia.util.ssl to avoid conflicting with aiohttp's ssl import. (#8805)
Removed hacky sys.path reordering in dump_keyring.py
2021-10-12 13:59:29 -07:00
Jeff Cruikshank
b1fda8f9a8
Fixes cherry-picked from fix_keyring_tests. (#8766)
* Fixes cherry-picked from fix_keyring_tests.

* Logging for the failing test_using_legacy_cryptfilekeyring test

* See if reordering the tests makes a difference.

* Revert "See if reordering the tests makes a difference."

This reverts commit b53807880b.

* Log changes to the _configure_legacy_backend patch

* Fixed patching

* Checking if something isn't cleaned up properly

* Revert "Checking if something isn't cleaned up properly"

This reverts commit ce995ba773.

* Revert "Fixed patching"

This reverts commit 66a70a16ff.

* Revert "Log changes to the _configure_legacy_backend patch"

This reverts commit 26791a40b7.

* Revert "Logging for the failing test_using_legacy_cryptfilekeyring test"

This reverts commit 4fd4873565.

* Move test_keyring_wrapper.py into a standalone test

* Small refactorings/changes per feedback
2021-10-08 11:02:46 -07:00
Arvid Norberg
61a513869d
make synchronous mode in sqlite database connections configurable (#8753)
* make synchronous mode in sqlite database connections configurabel. Default to enabling synchronous mode, leaving the door open for a more sophisticated heuristic in the future

* Update chia/util/db_synchronous.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Update chia/util/initial-config.yaml

Co-authored-by: Nino Uzelac <uzelac.nino@gmail.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: Nino Uzelac <uzelac.nino@gmail.com>
2021-10-08 06:13:06 -07:00
Jeff Cruikshank
26d23b9279
Keyring windows (#8465)
* Fix to allow migration of keys on macOS

* Fixed file_keyring synchronization test failures on macOS.
Fixed sporadic test failures on macOS when fsevents are delivered for the keyring after deletion.
TempKeyring-based tests now patch supports_os_passphrase_storage() to return False.

* Fixed LGTM issues

* Re-added the cleaning up temp keychain statement. This is being removed in a separate PR.

* Windows keyring passphrase support

* Test tweaks for Windows (mostly to support my slow VM)

* Linter fixes

* Restored prompt_for_passphrase() function which was accidentally removed during a rebase.

* Added CHIA_PASSPHRASE_SUPPORT env variable to allow more testing
2021-10-05 09:59:53 -07:00
Earle Lowe
7fdd0b2fd7
Improved mempool validation and test (#8652) 2021-09-30 16:07:22 -07:00
Jeff Cruikshank
1254d4decd
In rare cases where os.replace fails, retry using shutil.move. (#8589)
* In rare cases where os.replace() fails, retry using shutil.move. Seen on some Windows installs.

* Catch the PermissionError specifically
2021-09-24 13:24:03 -07:00
Jeff Cruikshank
a70082f29a
macOS keyring.yaml support (#8292)
* Added 'service' as a Keychain ctor param. Removed 'testing'

* Detect existing keys in the Mac Keychain

* Fix to allow migration of keys on macOS

* Added dump_keyring.py tool to show decrypted contents of keyring.yaml

* Prompt to save passphrase to macOS keychain

* Master passphrase retrieval/removal from the macOS Keychain.
Fixed typos.

* Warn if errSecInteractionNotAllowed is detected when accessing the macOS Keychain

* Fixed file_keyring synchronization test failures on macOS.
Fixed sporadic test failures on macOS when fsevents are delivered for the keyring after deletion.
TempKeyring-based tests now patch supports_os_passphrase_storage() to return False.

* TempKeyring mocks-out legacy_keyring setup to allow tests to succeed on macOS (which could find existing keys in the Keychain)

* Fixed pylint error

* Use with_name instead of with_stem (which is new to Python 3.9)

* Fixed keychain tests that started prompting for the keyring passphrase.

* Fixed LGTM issues

* Re-added the cleaning up temp keychain statement. This is being removed in a separate PR.

* Linter fixes

* Fixed keyring assignment on macOS when passphrase support is disabled.

* Include 'can_save_passphrase' flag in keyring_status response

* More linter fixes

* Fixed determination of the user_passphrase_is_set flag. This was returning true for a newly created keyring without any keys (or passphrase set)

* Removed the tidy_passphrase function per feedback

* Added some comments based on feedback

* Update chia/cmds/passphrase_funcs.py

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>

Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
2021-09-24 10:32:57 -07:00
Oliver
b72f2c50af
Fix edge case with negative input (#8529) 2021-09-22 10:45:26 -07:00