Commit Graph
5861 Commits
Author SHA1 Message Date
Amine Khaldi 9ff36d9689 CHIA-945 Remove no longer needed TestWalletKeyValStore class (#18327)
Remove no longer needed TestWalletKeyValStore class.
2024-07-30 12:28:46 -07:00
Matt Hauff d260e816f0 [CHIA-1033] Fix flaky pool RPC test (#18369)
Fix flaky pool RPC test
2024-07-30 12:28:33 -07:00
earl c0a2db44dc Send harvester version in pool partial header (#18167)
This commit adds just the 'chia-farmer-version' and
'chia-harvester-version' headers and is a reduced version of the
following original commits by Felix Brucker:

    commit 0e51984c06
    Date:   Fri Mar 29 15:59:48 2024 +0700

    Rename header prefix from `x-` to `chia-`

    commit 2bdc4de2f0
    Date:   Wed Mar 27 17:13:42 2024 +0700

    Add test and fix missing version on dummy harvester peer

    commit 15f3feae85
    Date:   Wed Dec 13 22:34:38 2023 +0530

    Add additional partial headers
2024-07-29 13:18:10 -07:00
Matt Hauff 6a5d84d17d [CHIA-1024] Fix wallet observer mode log in while non-observer keys are present (#18361)
Fix wallet observer mode log in while non-observer keys are present
2024-07-29 13:17:47 -07:00
Matt Hauff 2c2b0f4e1a [CHIA-1032] Add a config slot in action scopes and use it for wallets (#18365)
* Add a config slot in action scopes and use it for wallets

* Simplify tx_endpoint a bit

* pylint
2024-07-29 11:24:06 -07:00
Almog De PazandEarle Lowe 1c1e030e1e refactor new_peak_timelord (#16881)
* refactor new_peak_timelord

* fix test

* improve test assertions

* lint

* return after skipping peak

* improve comments

* limit condition to a diff of one block

* remove log

* refactor test

* better conditions
consider overflows as well

* pre commit

* test with overflow

* add test for EOS case

* lint

* comment

* prefer lower iterations peaks

* test full node receiving same weight lower iterations

* lint

* fix reorg test, lint

* fix block tools bug

* use signage point param in test

* use signage point param for overflows as well

* remove unused case

* fix block_tools condition

* lint

* lint

* Add check for peak not none in test

---------

Co-authored-by: Earle Lowe <e.lowe@chia.net>
2024-07-29 11:23:39 -07:00
Earle Lowe 65e888f245 CHIA-590: Add in connect timeout to DL http download (#18339)
* Add in connect timeout to DL http download

* Update mock function

* Consolidate to using aiohttp.ClientTimeout

* Revert "Consolidate to using aiohttp.ClientTimeout"

This reverts commit db3e77c101.

* Consolidate to using aiohttp.ClientTimeout

* Fix up default value with proper use of default_factory
2024-07-24 10:32:42 -07:00
Adam Kelly 5462631d99 CHIA-942 Use launcher_id as the primary key when updating (current) pool config. (#18341)
Use launcher_id as the primary key when updating (current) pool config.
Add an error diagnostic for the case where updating fails due to the supplied closure.
2024-07-22 12:30:54 -07:00
Matt Hauff 8fcfd20d88 [CHIA-958] In cmd class framework: help -> short_help (#18334)
help -> short_help
2024-07-18 09:39:29 -07:00
Matt Hauff a44d4e15ca [CHIA-959] Conform to CHIP-0029 (#18333)
* Conform to CHIP-0029

* fix test
2024-07-18 09:39:14 -07:00
Chris Marslender b14d912d3c Crawler Loop Fix + Test Improvements (#18329)
* Change a bunch of info logs back to warning in crawler, since crawlers are typically run in warning mode, to avoid the info log connection spam

* Ensure that the crawler loop ONLY doesn't start when in tests

* Rename the crawler service to crawler_service_no_loop, so defaults can also be tested WITH a loop

* Test crawler loop modes

* Add message when we received state chaged callback

* Add log to indicate crawling has started and how many peers we're crawling
2024-07-17 12:17:42 -07:00
Matt Hauff 055588914e [CHIA-714] Add usage of action scope throughout wallet codebase (#18128)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add action_scope: WalletActionScope to all tx endpoints

* Add usage of action scope throughout wallet codebase

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Fix miscellaneous test

* Fix miscellaneous test

* Fix miscellaneous test

* pylint

* Add auto claim test coverage

* Take advantage of extra_spends

* Fix tests

* test fixes

* pylint
2024-07-17 12:17:16 -07:00
Chris Marslender f48660c7be Add testneta to initial config (#18324) 2024-07-17 12:16:42 -07:00
Matt Hauff 4ffb6dfa6f [CHIA-713] Add action_scope: WalletActionScope to all tx endpoints (#18127)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add action_scope: WalletActionScope to all tx endpoints

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Fix miscellaneous test

* Fix miscellaneous test

* Fix miscellaneous test

* Add auto claim test coverage
2024-07-16 11:06:01 -07:00
Michael TaylorandKyle Altendorf a4da91a86d Changed: Enhance DataLayer Plugin Registration System for Improved Third-Party Integration (#17711)
* feat: load plugins from file

* feat: add tests

* feat: add file based datalayr plugin support

* fix: isort

* match mozilla-ca repo with main

* chore: fix linting

* add additional test coverage

* Update chia/util/misc.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* move utility to datalayer folder

* fix lint

* use PluginRemote schema

* remove check

* remove check

* Update chia/data_layer/util/plugin.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* load plugin using yaml.safe_load instead of json.load

* add default value to headers if doesnt exist

* fix: syntax error

* add log exception

* Update chia/data_layer/util/plugin.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-07-16 11:05:11 -07:00
Florin Chirica 74b7f1b946 DL Increase test RPC timeout (#17893) 2024-07-16 11:04:59 -07:00
Chris Marslender 2c36263c24 Update all selected_network config values when setting up simulator (#17998)
Add more selected network configs for simulator
2024-07-16 11:04:49 -07:00
Rigidity eed8f21679 Remove ALERTS_URL and CHIA_ALERTS_PUBKEY (#18027) 2024-07-16 11:04:32 -07:00
Chris Marslender 8b01fdcfa8 Add prune old peers functionality for crawler (#18310)
* Add prune old peers functionality for crawler to keep the database size and write times under control

* Add test

* Make starting the crawler loop optional for tests. Test the pruning of old peers

* Fix lint issues
2024-07-16 08:19:09 -07:00
Kyle Altendorf 7de41fc9b4 tidy import aiosqlite as aiosqlite (#18278) 2024-07-15 13:36:01 -07:00
SpaceFarmers.io d5c1bb9ede Trusted wallet peer enhancements (#17872)
* Show trusted (wallet) peers

* Warn when the subscription limit has been reached

* Revert: (39022fe) Warn when the subscription limit has been reached
2024-07-15 12:37:31 -07:00
peicuiping 2dbd5b3b67 chore: remove repetitive words (#17996) 2024-07-15 12:36:59 -07:00
Matt Hauff 064d34f184 [CHIA-738] Add a better clawback auto claim test and fix related issue (#18141)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Add auto claim test coverage
2024-07-12 12:29:09 -07:00
Arvid Norberg 2ff9c876b5 [CHIA-902] default flags for Program.run() and Program.run_with_cost() (#18287)
make plain Program.run() and Program.run_with_cost() default to enabling all the most recent features, and to disallow unknown opcodes (i.e. strict mode). To have full control of which features are enabled, introduce a run2() function
2024-07-12 12:28:41 -07:00
Kyle Altendorf e785c7bfc6 less tree_id (#18130) 2024-07-11 13:45:13 -07:00
Kyle Altendorf cf7b54966e root hash, does None mean empty or unspecified? (#18244)
* mark some cases where a none root hash means unspecified, not empty

* propagate, hint for help tracking, etc

* cp

* enum trick

* tidy

* tidy

* fixup
2024-07-11 13:44:36 -07:00
Matt Hauff d6761cda37 [CHIA-712] Fix CATWallet pending_change calculation (#18126)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test
2024-07-11 11:23:15 -07:00
Starttoaster d88ef3b769 checkpoint: into main from release/2.4.2 @ bcbc7a7b50 (#18289)
Source hash: bcbc7a7b50
Remaining commits: 4
2024-07-10 17:54:48 -07:00
6d9219b0c4 CHIA-597: Use poetry for package management (#11057)
* preliminary setup with poetry

* don't worry about locking the poetry env for the exploration right now

* recover black config in pyproject.toml

* install.sh for linting workflow

* pull chiavdf version from poetry in install-timelord.sh

* activate etc in upload and lint workflow

* debug poetry show output on macos

* update to clvm-tools 0.4.4

* add back setproctitle

* catchup deps

* lock

* allow 3.10

* debug

* make Install.ps1 use poetry as well

* -ErrorAction Ignore

* more todo about python version selection

* make install-timelord.sh modifications more posix compliant

* gitignore .penv* and .venv* as well

* remove requirements.penv.txt

* get artifact check requirements from poetry

* fix .gitignore for venv symlink

* separate out poetry setup

* :

* comment out code to be worked on

* setup poetry for dependency check

* ignore new poetry symlink

* chia_rs==0.1.4

* a few updates

* some missed updates `:[`

* update some types libs

* fix extras

* activate

* just use `python` somewhere

* for windows

* less symlinking for windows

* oops

* s

* more

* # shellcheck disable=SC2086

* activate action

* more python version

* lock up

* include ipython (for python >=3.8)

* add miniupnpc extra

* add poetry-dynamic-versioning

* type it out

* better match dev versioning

* catch up and delete setup.py again

* lock

* add pytest-cov

* .penv/bin/poetry

* .venv for windows activation

* update pytest-xdist

* install upnp extra

* upnp

* quote

* maybe update some deps

* mandatory and string

* oops

* slighty tidy

* debug pip list

* debug

* pybind11 maybe instead?

* remove pip install debugging

* debug without upnp nor pypi.chia.net

* chiavdf==1.0.8

* bring back upnp

* re-enable upnp

* diagnostic exception reraise

* .exe?

* diagnostics

* .cmd...?

* light tidy

* more cleanup

* make dependency check script not cwd dependent for finding the poetry env

* correct sh substitution

* lock

* coverage 7

* todo cleanup

* poetry update

* interesting

* windows too

* support non-editable install via scripts again

* oops

* again

* sheesh

* fixup

* more

* more

* Update dependencies

* various pre-commit linter updates

* add pyupgrade to extras list

* use priority=supplemental instead of secondary

* Add in some missing deps

* update setuptools and pyinstaller to match main

* venv->.venv

* lint fixes

* update a few packages for 3.12 support

* get zstd from chia resource for python 3.12

* Adjustments to dynamic versioning

* experiments with versioning

* test fixes

Signed-off-by: Earle Lowe <e.lowe@chia.net>

* fixup last commit

* include upnp as extra when installing on windows

* include mozilla-ca as a package for the cacert.pem file

* some windows tweaks

* use SPECPATH as anchor path in pyinstaller.spec file

* Add lxml as dev dependency

* Fixup typo in lxml version

* Update some packages to resolve GH vuln reports

* Update more packages to resolve GH vulns

* Ignore pylint license in depedency checker

* match installation of the dynamic version plugin on windows

* Fix issues with setting windows environment and use pip to install plugin per poetry docs recommendation

* properly apply non-editable option with -i

* use -f with ln to remove existing file as needed

* use shell=true for subprocess to help windows run chia if it's a .cmd

* Update .coveragerc

* use shutil.which() to find chia executable in a cross platform way

* mypy fixes

* Address conflicts for numpy based on python version

* Update lock file

* Remove troublesome reference to pypi source

* Add TODOs for manual install of poetry-dynamic-versioning plugin

* Use poetry dynamic versioning to figure out the version rather than setuptools_scm

* Update .github/workflows/reflow-version.yml

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update .github/workflows/test-single.yml

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Update urllib3

* Attempts to get dynamic versioning to output something semver

* more versioning finangling

* lint pyproject.toml

* Update certifi

---------

Signed-off-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Earle Lowe <30607889+emlowe@users.noreply.github.com>
2024-07-10 08:47:11 -07:00
Amine Khaldi d46076eecb Merge commit 'bcbc7a7b50cf1a3a81b7548e602412ea2167f26f' into checkpoint/main_from_release_2.4.2_bcbc7a7b50cf1a3a81b7548e602412ea2167f26f 2024-07-10 16:47:04 +01:00
Matt Hauff ebf747b3ae [CHIA-839] Refactor KeywringWrapper/FileKeyring for better ergonomics (#18275)
* `.get_passphrase` -> `.keyring.get_key()`

* `.set_password` -> `.keyring.set_key`

* `.delete_passphrase` -> `.keyring.delete_key`

* `.*_label` -> `.keyring.*_label`

* Introduce DecryptedKeyringData

* Fix bad assumption

* Fix tests

* Pre-commit

* Pivot key storage to external metadata for forwards compatibility

* typo & passphrase -> key
2024-07-09 12:17:11 -07:00
Arvid Norberg b4290a2f2f [CHIA-786] remove the original block compression (#18209)
remove the original form block compression, now that the hard fork has activated and we serialize CLVM in a more efficient way
2024-07-09 12:16:51 -07:00
Starttoaster 15a8275267 checkpoint: into main from release/2.4.1 @ 4b2f9f0c7e (#18276)
Source hash: 4b2f9f0c7e
Remaining commits: 2
2024-07-09 09:53:58 -07:00
Matt Hauff 6d03354859 [CHIA-683] Drop unknown tables when resetting wallet sync DB (#18222)
Drop unknown tables when resetting wallet sync DB
2024-07-09 09:53:17 -07:00
Amine Khaldi e7eefd97c6 Merge commit '4b2f9f0c7e7e575dd266c238a017b9856b254a1f' into checkpoint/main_from_release_2.4.1_4b2f9f0c7e7e575dd266c238a017b9856b254a1f 2024-07-09 11:30:43 +01:00
Jack Nelson c0d5b9b097 CHIA-818 Add Soft Fork options to simulator config (#18247)
add fork options to simulator CHIA-818
2024-07-08 13:17:13 -07:00
Arvid Norberg 956894dbd0 use rust version of SpendBundle (#17430) 2024-07-08 09:47:28 -07:00
Almog De Paz 3cecc27dd2 ad.fee_estimation_fixes (#18262) 2024-07-08 09:45:03 -07:00
Arvid Norberg 6dceabe2d3 [CHIA-691] simplify MempoolItem (#18143)
make MempoolItem and InternalMempoolItem contain the SpendBundleConditions directly, rather than the NPCResult. A mempool item is guaranteed to be valid, so the error state of NPCResult will never be engaged anyway.
2024-07-08 09:44:49 -07:00
Arvid Norberg 260c7a363a [CHIA-786] simplify hard-fork consensus rules (#18208)
the hard fork has activated. From now on we can simplify some of the updated consensus rules to apply unconditionally to block height
2024-07-05 09:52:03 -07:00
Florin Chirica 25154a1045 [CHIA-883] Fix duplicate connection log spam. (#18268)
* [CHIA-883] Fix duplicate connection log spam.

* Add old condition too as a safety margin.
2024-07-05 09:50:17 -07:00
Florin Chirica e6dbaef4c1 [CHIA-885] Send different uncompact buckets to blueboxes. (#18263)
* Send different uncompact buckets to blueboxes.

* Lint.

* Add sleep interval before continue
2024-07-05 09:49:57 -07:00
Florin Chirica 9b5053b732 [CHIA-884] Fix timelord log spam. (#18267) 2024-07-05 09:49:29 -07:00
Amine Khaldi bd750f9e94 CHIA-817 Properly order HARD_FORK_2_0 and SOFT_FORK_4 in ConsensusMode (#18242)
Properly order HARD_FORK_2_0 and SOFT_FORK_4 in ConsensusMode.
2024-07-03 09:22:46 -07:00
Amine Khaldi 8141fe40e2 CHIA-826 Simplify get_items_by_coin_id and make it return an iterator (#18255)
Simplify get_items_by_coin_id and make it return an iterator.
2024-07-03 09:22:25 -07:00
Amine Khaldi 7245d47c77 CHIA-843 Simplify add_to_pool around DB operations (#18259)
Simplify add_to_pool around DB operations.
2024-07-03 09:22:13 -07:00
Matt Hauff bcbc7a7b50 [CHIA-819] Fix 12-word mnemonic support in keychain (#18246)
Fix 12 word mnemonic support in keychain
2024-06-26 09:22:48 -07:00
Florin ChiricaandKyle Altendorf 9e1a4dceb7 CHIA-732 Optimize min height leaf. (#18123)
* Optimize min height leaf.

* Lint.

* Lint.

* Add tests.

* Lint.

* Lint.

* Parametrize test.

* Lint.

* Update chia/data_layer/data_store.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Address review comments.

* Report all hashes.

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-06-26 09:22:15 -07:00
c25eeb08f7 [CHIA-504] Add support for external signers (PLEASE SQUASH) (#18199)
* Repin hsms

* Add to sdist only allowed list

* Signer protocol tweaks

* Convert wallet RPC client to deserialized types

* Introduce @tx_out_cmd decorator

* Make execute_signing_instructions RPC

* Add transport layer support

* Add signer commands

* Rework wallet execute_signing_instructions

* Inadvertent merge changes

* Fix signer command tests

* Try a different approach: recursive flattening

* Bump hsms

* Add comments

* Test coverage

* Coverage ignores

* Remove inadvertent time traveler

* Bring in lost time traveler

* pylint

* Attempt to make qr test less flaky

* Actually test coverage ignore

* Small refactor for test coverage

* transport -> translation

* missed one

* transport -> translation

* Fix asdict error

* coverage

* Forgoe rotation testing for now

* Test coverage

* jsonify_unsigned_txs -> full_jsonify

* Move a class

* Add better type checking to framework

* explicitly state kwargs on _CommandParsingStage

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Address comments by @altendky

* Consolidate add_private_key and add_public_key

* Consolidate get_key_for_fingerprint and get_public_key_for_fingerprint

* Test fix

* Merge fix

* Bad merge

* Bad merge

* oops

* pylint

* Tweak keychain_proxy.get_key_for_fingerprint

* Fix wallet RPC test?

* pragma: no cover

* Redesign clvm_streamable

* Fix test imports

* black

* fix one more test

* Address comments by @altendky

* Test coverage

* bytes32

* Better CLI mnemonic check

* Use functools.partial

* Rename full jsonify to chip 29

* whoops missed a couple

* Better CLI mnemonic check

* black

* pylint

* Missed one

* black

* Farm at least one block

* Revert last change and fix 0 block farming

* black

* bad merge

* Merge fix

* Inadvertent changes

* Inadvertent changes

* Syncronize with quex.tx_out_decorator2

* These are no longer dictionaries.

* Use new clvm_streamable pattern

* Fix offer endpoint

* Add @tx_out_cmd decorator

* Bump ecdsa version

* Fix @marshal util to return proper transactions

* Add get_public_key

* port `chia wallet send` to @tx_out_cmd

* merge fix of puzzle hash derivation

* Port `chia wallet coins` to @tx_out_cmd

* Port chia wallet clawback to @tx_out_cmd

* Port `chia wallet take/cancel_offer` to @tx_out_cmd

* Port `chia wallet did ...` to @tx_out_cmd

* Port `chia wallet nft ...` to @tx_out_cmd

* Port `chia wallet notifications send` to @tx_out_cmd

* Port `chia wallet vcs ...` to @tx_out_cmd

* Port `chia dao ...` to @tx_out_cmd

* Exclude data layer and plotnft functions

* [no ci]

* Address comments by @AmineKhaldi

* Fix rpc util

* add test for BSTLSigningInstructions

* [UNDO] d9c6f54398

* [UNDO] 7fc1d2adfd

* [UNDO] 23c9ee8549

* [UNDO] aacc9f0228

* [UNDO] 548465403b

* Undo unintentional changes

* Stuff that's not part of this

* More stuff that doesn't belong

* One last thing that doesn't belong

* Unintentional change

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-06-26 09:21:33 -07:00
Amine Khaldi b705350a9e CHIA-801 Cover AGG_SIG_ME_ADDITIONAL_DATA in message construction for test_agg_sig_illegal_suffix (#18235)
Cover AGG_SIG_ME_ADDITIONAL_DATA in message construction for test_agg_sig_illegal_suffix.
2024-06-25 11:52:09 -07:00