Commit Graph
278 Commits
Author SHA1 Message Date
Matt HauffandGitHub 40db4635a8 [LABS-245] Enable PEP604 Ruff rules (#20269)
* Enable PEP604 Ruff rules

* Fix harcoded signature in test

* Hack CLVMStreamable test with note to fast follow
2025-11-18 12:34:00 -08:00
Matt HauffandGitHub a803dc0fa6 [CHIA-3633] August 2025 pass of Ruff linting rules (#19929)
* Enable Ruff `PLR1704` (`redefined-argument-from-local`)

* Enable Ruff `PLR5501` (`collapsible-else-if`)

* Enable Ruff `PLW2901` (`redefined-loop-name`)

* bad change

* Enable Ruff `RUF043` (`pytest-raises-ambiguous-pattern`)

* Enable Ruff `RUF046` (`unnecessary-cast-to-int`)

* Enable Ruff `RUF052` (`used-dummy-variable`)

* Remove unused ignore `UP006`

* One mis-signaled regex

* Comments by @altendky

* bad change, my bad
2025-08-11 14:39:12 -07:00
6050235bdb [CHIA-3043] Add (hopefully) non-controversial ruff rules (#19684)
* Add (hopefully) non-controversial ruff rules

* mypy-exclusions.txt

* PIE

* Fix pre-commit?

* PYI

* RSE

* S + ignores

* Whitespace fix

* Re-add build-init-files.py

* Add comment about security ignores

* Update mypy-exclusions.txt

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

* Fix the executable status of build-init-files.py

* Set executable bit for tools/run_block.py and readd shebang

* Fix new errors

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-06-11 08:36:08 -07:00
Richard KissandGitHub a803d18c3b The chia.protocols module no longer depends upon chia.server. (#19636)
<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->

The modules `chia.protocols` and `chia.server` form a dependency loop.
This change at least removes the direct dependency of `chia.protocols`
on `chia.server`.

### Purpose:

<!-- Does this PR introduce a breaking change? -->

### Current Behavior:

### New Behavior:

<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->

### Testing Notes:

<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->
2025-05-29 09:24:29 -07:00
Kyle AltendorfandGitHub fcd20ce543 more chia_rs directly (#19520)
* more `chia_rs` directly

* maybe

* undo, kinda
2025-04-21 14:05:05 -05:00
Kyle AltendorfandGitHub 1911044e97 use chia_rs directly for more types (#19475)
* use chia_rs directly for more types

* more more

* undo submodule change...
2025-04-18 11:45:44 -05:00
07ccc77676 Add ContextManager to FullNodePeers (#19427)
* convert AddressManager to dataclass

* type annotations for default factory code

* convert FullNodePeers and FullNodeDiscovery into dataclasses

* make WalletPeers also a dataclass

* typing fixes

* fix type parameters for generic type "Queue"

* context manage FullNodePeers

* Update chia/full_node/full_node.py

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

* remove init=false

* add coverage for node_discovery

* refactor full_node_peers entering context

* clear() uses same code as init() for matrices

* Update chia/server/address_manager.py

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

* Add functools import to address_manager.py

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-04-04 11:34:59 -05:00
Matt HauffandGitHub ad46ee2301 [CHIA-2546] Refactor and add test for WSM puzzle hash endpoints (#19385)
refactor puzzle hash requests
2025-03-26 13:08:00 -07:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
Kyle AltendorfandGitHub e446d6b726 use chia_rs directly for sized ints (#19303)
* use chia_rs directly for sized ints

* Update data_layer_rpc_api.py
2025-02-24 14:33:09 -08:00
Kyle AltendorfandGitHub 30c4ef2689 use chia_rs directly for consensus constants (#19301) 2025-02-21 10:03:17 -08:00
RigidityandGitHub 8f484e6bc9 Name wallet protocol subscription messages consistently (#19132)
* Name wallet protocol subscription messages consistently

* fix changelog

* fix name in full_node_api

* missed a spot
2025-01-14 10:12:09 -07:00
Kyle AltendorfandGitHub 1ffa73e99e task referencer (#18914)
* put otherwise unheld tasks into the pit

* and the rest too

* cull less often

* task referencer

* private

* report unexpectedly unreferenced tasks

* also warn for automated catching in tests

* reporting task

* undo some

* fixup for 3.9

* ban asyncio.create_task

* oof

* simplify including using `Task.add_done_callback()` for culling
2025-01-02 10:13:51 -07:00
Almog De PazandGitHub 61703ce09a fix trusted wallet sync on deep reorg (#18831)
* fix trusted wallet sync on deep reorg

* handle long sync exception case in finish sync

* fix_wallet_sync_test

* fix test_long_sync_wallet

* reconnect only untrusted node in test

* fix long_sync test, update only on finish_sync()

* revert add_blocks_in_batches

* types

* fix  flakey test_long_reorg_nodes_and_wallet
2024-12-02 11:22:55 -07:00
Kyle AltendorfandGitHub 748c8cec8e # TODO: stop dropping tasks on the floor (#18866)
* # TODO: stop dropping tasks on the floor

* Update chia/_tests/core/data_layer/test_data_rpc.py

* no really, stop
2024-11-18 12:32:52 -07:00
Matt HauffandGitHub 604fc1feb0 [CHIA-1732] Add Ruff specific linting rules (#18845)
* Add Ruff specific linting rules

* Further tighten ignore list

* Address comments by @altendky

* One more comment @altendky
2024-11-14 15:58:12 -07:00
6c90a76b56 Tighten up ruff ignore list (#18837)
* Tighten up ruff ignore list

* Okay that fix was indeed unsafe

* enable type-name-incorrect-variance

* enable literal-membership

* enable non-augmented-assignment

* enable useless-return

* enable global-variable-not-assigned

* -

* fixup

* Clean up roff.toml from annotations

* use ignore instead of explicit re-export

* use more descriptive names

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-11-12 12:19:31 -07:00
Kyle AltendorfandGitHub 9c8557a1f8 Remove Python 3.8 support and update source to 3.9 standards (#18687)
* manual python 3.8 removals

* poetry

* pyupgrade

* black

* isort

* manually tidy imports

* work around shadowed type

* catch up build network protocol files for pyupgrade changes

* placate pylint

* re-enable 20.04

* placate flake8
2024-10-16 14:21:15 -07:00
Amine KhaldiandGitHub 8129b41473 CHIA-210 Introduce WalletSpendBundle and use it across code related to wallets (#18264)
Introduce WalletSpendBundle and use it across code related to wallets.
2024-08-30 21:36:26 +08:00
Matt HauffandGitHub fd5f794e2d [CHIA-1065] Set public key when you find private key in wallet node (#18405)
* Set public key when you find private key

* Add a test
2024-08-06 12:01:46 -07:00
Matt HauffandGitHub 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 HauffandGitHub 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
Matt HauffandGitHub 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
Matt HauffandGitHub 3637bd33c6 Delete chia.util.misc (#18170)
* Move VersionedBlob to chia.util.streamable

* Move format_bytes to chia.cmds.cmds_util

* Move format_minutes to chia.cmds.cmds_util

* Move prompt_yes_no to chia.cmds.cmds_util

* Move get_list_or_len to from chia.plot_sync.receiver

* Move validate_directory_writable to chia.cmds.cmds_util

* Move *termination_signals to test_services

* Move UInt*Range to chia.util.streamable

* Create chia.util.batches

* Create chia.server.signal_handlers

* Create chia._tests.util.split_managers

* Move ValuedEvent to chia.types.transaction_queue_entry

* Move available_logical_cores to chia.util.cpu

* Move caller_file_and_line to chia._tests.util.misc

* Move satisfies_hint to chia._tests.wallet.test_singleton_lifecycle_fast
2024-06-18 08:27:17 -05:00
Matt HauffandGitHub 44c6b44c46 [CHIA-302] Handle reorgs in data layer wallet (#17992)
* Handle reorgs in data layer wallet

* Update WalletNode.reset_sync_db

* Fix test

* Make new tables easily forwards compatible

* Use singleton_records table instead of launcher_confirmations

* Only select launcher_id
2024-05-15 09:52:34 -05:00
Matt HauffandGitHub aefe7fdf28 Observer Mode (#17792)
* Observer Mode

* Address comments by @altendky

* Change RPC default and fix test coverage

* Add test coverage for rpc marshaller

* Fix @marshal util to return proper transactions
2024-05-07 13:39:25 -07:00
Matt HauffandGitHub 6c1579c414 Do not return unexpected coins from get_coin_state (#17850)
* Do not return unexpected coins from get_coin_state

* Add test

* Add no cover comment

* Ban instead of skipping

* Do better

* Better exception message
2024-04-24 14:37:16 -07:00
Rigidity 4e625a54d4 Fall back to default values for peer file path 2024-03-29 20:19:17 -04:00
Felix BruckerandGitHub acaf7e0a3b Add use_delta_sync option (#17573)
* Add `use_delta_sync` option

* Use fixture for `use_delta_sync` bool param

* Add note in initial-config
2024-03-15 09:22:01 -07:00
Arvid NorbergandGitHub 036313fc7e remove support for migrating peers from legacy file format (#17517) 2024-02-20 13:11:00 -08:00
Arvid NorbergandGitHub fe89b5b782 undo some unnecessary int type casts (#17521)
* undo redundant type-casts from slots, SubEpochSummary and SubEpochData

* undo redundant type-casts from proof-of-space, reward chain and foliage types

* undo redundant type-casts from VDFInfo, VDFProof and ClassgroupElement

* remove unnecessary type annotation
2024-02-08 15:29:33 -08:00
Arvid NorbergandGitHub 51808b4ef7 Rust proof-of-space, reward chain and foliage types (#17218)
* use rust type for ProofOfSpace

* use rust types for Foliage

* use rust types for reward chain blocks
2024-01-10 15:42:31 -06:00
RigidityandGitHub 41047bddc8 Async connection close handlers (#17017) 2023-12-11 08:27:25 -06:00
Geoff WalmsleyandGitHub ceba39c672 remove singleton_store (#16868) 2023-11-21 09:45:10 -06:00
Kyle AltendorfandGitHub fbdb27bef1 managers for services (#16670) 2023-11-16 19:21:12 -06:00
Arvid NorbergandGitHub 95e5b97557 Use bls from chia rs (#16715)
* replace blspy imports with chia_rs imports for BLS types

* remove blspy-stubs, since we're dropping the blspy dependency. chia_rs has type stubs already
2023-11-07 09:06:52 -08:00
Kyle AltendorfandGitHub aaf081f69d explicit protocol checks against RpcServiceProtocol (#16710) 2023-10-27 12:03:15 -07:00
Kyle AltendorfandGitHub 90c1441af0 apply pyupgrade --py38-plus --keep-runtime-typing (#14646) 2023-10-24 12:01:23 -05:00
Matt HauffandGitHub ff59bc3e1f Add cache to wallet node preventing resend of processing TX (#16640) 2023-10-18 17:13:50 -05:00
75af6a98d8 Dao wallet (#16500)
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
Co-authored-by: Matthew Howard <m.o.howard97@gmail.com>
Co-authored-by: matt-o-how <48453825+matt-o-how@users.noreply.github.com>
Co-authored-by: Karlkim Suwanmongkol <karlkim@gmail.com>
Co-authored-by: Sebastjan Trepca <trepca@gmail.com>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-10-11 14:19:12 -05:00
Earle LoweandGitHub 4ba74c96ae Use network overrides for default port for WalletPeers (#16525) 2023-10-06 13:18:48 -05:00
Kyle AltendorfandGitHub 51d3bf018e Revert "Dao wallet" (#16465) 2023-10-01 11:57:09 -05:00
810df50bf6 Dao wallet (#15559)
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
Co-authored-by: Geoff Walmsley <geoffwalmsley@gmail.com>
Co-authored-by: Geoff Walmsley <5695735+geoffwalmsley@users.noreply.github.com>
Co-authored-by: Karlkim Suwanmongkol <karlkim@gmail.com>
Co-authored-by: Sebastjan Trepca <trepca@gmail.com>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-09-30 14:24:35 -05:00
Matt HauffandGitHub efff83e7be Add timelock information to Trades and Transactions (#15915) 2023-09-12 11:28:01 -05:00
dustinfaceandGitHub e9b5937dce wallet: Drop is_peer_synced / More cache usage (#16261) 2023-09-11 17:52:43 -05:00
dustinfaceandGitHub cd1d22d29b wallet: Fix and improve untrusted race caching (#16239) 2023-09-06 13:00:25 -05:00
dustinfaceandGitHub 4ee7fe27be wallet: Refactor new_peak in WalletStateManager and PoolWallet (#16262) 2023-09-06 12:59:55 -05:00
dustinfaceandGitHub 2e18f904dd wallet: Fix comment in WalletNode.validate_received_state_from_peer (#16037) 2023-08-24 12:38:05 -05:00
Amine Khaldi 54290f812a Merge commit '17659b80396c3e87fa60415a6ff3fcc2983c0b52' into checkpoint/main_from_release_2.0.0_17659b80396c3e87fa60415a6ff3fcc2983c0b52 2023-08-15 12:09:03 +01:00
Kronus91andGitHub 17659b8039 Fix clawback sender resync issue (#15853)
* Fix clawback sender resync issue

* enhance unit test

* Fix CI

* Add comment

* Fix unit test & revert changes

* Remove prints

* Resolve comments

* Resolve comments

* Remove check
2023-08-09 10:09:41 -05:00