Commit Graph
1052 Commits
Author SHA1 Message Date
Jude Allred 274c5a8ae4 Tidy rpc_errors.py and remove the (as-yet) unused error codes 2026-02-11 14:22:35 -05:00
Jude Allred 9b40409e86 Narrow PR to only provide structured logs for full_node_rpc_api 2026-02-11 14:09:35 -05:00
Jude Allred 05d8276921 Dead code elimination 2026-02-11 13:41:01 -05:00
Jude Allred a75e591f7e Use RpcError.simple everywhere we can 2026-02-11 13:41:01 -05:00
Jude Allred 28ad73bb80 PR iterations -- Tidy structured error type.
-- rename structuredError.structuredMessage to message
-- remove the legacy 'message' field from structuredError.data, allow the top level 'error' string to preserve that for us.
-- remove the 'originalError' field from structuredError
-- rename structured_errors to rpc_errors
2026-02-11 13:41:00 -05:00
Jude Allred abe4bb3b21 Add a missing structured error in a location introduced during rebase 2026-02-11 13:41:00 -05:00
Jude Allred b196d4f2ab Handle an empty error message edge case 2026-02-11 13:41:00 -05:00
Jude Allred 8f11d892ff Use structured RPC errors 2026-02-11 13:40:56 -05:00
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
Kyle AltendorfandGitHub 7a26610e8f less pre-inting for ints (#19853) 2025-07-23 13:18:04 -07:00
Kyle AltendorfandGitHub 25e240f456 log the route when an RPC API server handler fails (#19718) 2025-06-25 10:47:28 -07:00
60e4f85515 [CHIA-1314] Port pooling RPC endpoints to @marshal decorator (#19683)
* Port `pw_join_pool`

* fix tests

* fix moar tests

* Port `pw_self_pool`

* Fix test

* Port `pw_absorb_rewards`

* Port `pw_status`

* Simplifications.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2025-06-25 09:47:03 -07:00
Kyle AltendorfandGitHub 32ca9c0804 by service not layer (#19715)
* by service not layer

* monkey patch fixup
2025-06-16 14:31:51 -07:00
Richard KissandGitHub 4f03890871 chia/full_node/signage_point.py -> chia/consensus/signage_point.py (#19706) 2025-06-12 11:14:27 -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
Arvid NorbergandGitHub 2b7a453e38 promote block-creation setting to user-facing (#19545)
* make the mempool block creation more configurable

* update tests to cover both block creation functions
2025-06-02 10:39:04 -05: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
c0410e97ec Bump chia rs >=0.24, <0.25 (#19615)
* bump chia_rs

* update db_graftroot test

* update SerializedProgram and Program use, to accommodate new chia_rs interface

* review comments

* review comments

---------

Co-authored-by: Matthew Howard <m.o.howard97@gmail.com>
2025-05-29 09:24:08 -07:00
Earle LoweandGitHub 7f20df6214 Add some checks when trying to join the same pool already joined (#18822)
* Add some checks when trying to join the same pool already joined

* Add test to test the specific cli case

* Remove line added during debugging

* Add test

* misc updates

* remove cli test

* final tests for joining same pool again

* Update check from code review

* update test framework

* Use click.ClickException for error

* Add check for wallet synced up front as the first thing checked for joining a pool

* Add test for unsynced RPC call
2025-04-28 12:22:51 -07:00
Amine KhaldiandGitHub 6824b11ba0 CHIA-2743 Synchronous block generator creation (#19505)
Synchronous block generator creation.
2025-04-24 10:24:42 -05:00
Earle LoweandGitHub a1e695e896 Allow DIDs from other wallets with NIL recovery lists (#19469)
* Somewhat hacky workaounds for DIDs from other wallets

* cannot use set as not hashable

* Add a couple tests

* Change DIDCoinData to use bytes instead of bytes32

* Remove some unused code

* Remove some more unused code

* Make the alternate recovery did spendable I think

* Use Optional[bytes32] for DIDCoinData to show the list should be 32 bytes or nothing (where nothing is the NIL program)

* Replace specific test with parameterization of other tests to get more testing of the Alternate DIDs

* Empty commit for github

* minor formatting change

* No need to cast to bytes since as_atom returns bytes
2025-04-23 09:28:48 -05:00
Kyle AltendorfandGitHub fcd20ce543 more chia_rs directly (#19520)
* more `chia_rs` directly

* maybe

* undo, kinda
2025-04-21 14:05:05 -05:00
Arvid NorbergandGitHub 88d3fefa69 validate block generator created by the debug RPC (#19519)
* validate block generator created by the debug RPC

* address missing test coverage

* more logging. Don't limit block cost by cost header in test RPC
2025-04-21 10:21:49 -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
Matt HauffandGitHub 9bc5741924 [CHIA-1162] Port test_nft_bulk_mint.py to WalletTestFramework (#19442)
* Port `test_nft_mint_from_did`

* Port `test_nft_mint_from_did_rpc`

* Collapse a test into a parametrization

* Ruff cleanup

* Port `test_nft_mint_from_did_multiple_xch`

* Port `test_nft_mint_from_xch`

* Port `test_nft_mint_from_xch_rpc`

* Port `test_nft_mint_from_xch_multiple_xch`

* Remove unnecessary DID code from XCH mint tests

* Collapse multiple tests into parametrization

* Collapse multiple tests into parametrization (and test fixes!)

* Collapse multiple tests into parametrization
2025-04-16 11:25:14 -05:00
Kyle AltendorfandGitHub 46aa20a1ce use chia_rs directly for spend bundle conditions (#19470) 2025-04-07 10:25:05 -07:00
Matt HauffandGitHub 85a44bb4ab [CHIA-2636] Remove direct secret key access from pool wallet (#19446)
* Remove direct secret key access from pool wallet

* Remove now unusued cache

* Some hardcoded test fixes

* More test fixes

* Add comment
2025-04-03 15:34:14 -05:00
Matt HauffandGitHub a6a5a35c7d [CHIA-1251] Add puzzle hash generation to action scopes (#19283)
* (squash) Add puzzle hash generation to action scopes

* Add comment for unused/last_index
2025-04-03 15:34:07 -05:00
Arvid NorbergandGitHub 7aa76bc116 [CHIA-2540] Compute block cost (#19397)
* predict exact block cost, instead of re-running the generator

* fixup workflow for test-bundles

* fixup

* review comments
2025-04-02 09:37:45 -05:00
Arvid NorbergandGitHub cf17f20ccf [CHIA-2052] Compressed blocks (#19270)
* introduce create_block_generator2() to mempool, which picks transactions and compresses them incrementally, allowing us to fill blocks even when compressing

* improve test, comment and pragma no cover

* fix mempool test

* simplify item selection logic in create_block_generator2()

* add test coverage of timeout in create_block_generator2()

* address review comments

* fixup
2025-03-27 12:42:46 -05:00
Arvid NorbergandGitHub 9147629b78 NewBlockGenerator as an extension of BlockGenerator (#19390) 2025-03-19 11:37:16 -07:00
a194dd60e9 CHIA-2378: Add CLI commands to import, export, and benchmark the mempool (#19271)
* Add CLI commands to import and export the mempool, and benchmark block creation

* Unused import

* Remove old RPC

* Fix mypy

* Address some comments

* use create_block_generator()

* Ruff

* Address comments

---------

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
2025-03-18 17:09:02 -07:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Earle LoweEarle LoweKyle Altendorf
d7e2358a32 build(deps): bump ruff from 0.8.5 to 0.9.6 (#19260)
* build(deps): bump ruff from 0.8.5 to 0.9.6

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.5 to 0.9.6.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.8.5...0.9.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Update source to ruff 0.9.6

* Apply suggestions from code review

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Earle Lowe <30607889+emlowe@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-02-27 09:53:34 -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
Matt HauffandGitHub ccfa35cab8 [CHIA-2369] Legacy-ify DAOs (#19266)
Legacy-ify DAOs
2025-02-20 11:05:30 -07:00
Matt HauffandGitHub 33de50c0a1 Bring VCWallet.generate_signed_transaction into conformity (#19234)
* Standardize the `Wallet` API for `generate_signed_transaction`

* Some test fixes

* Fix `create_tandem_xch_tx`

* Fix the other `create_tandem_xch_tx`s

* More test fixes

* More test fixes

* Bad fix from last time

* Bring `VCWallet.generate_signed_transaction` into conformity with other wallets

* Bad default
2025-02-11 09:06:46 -07:00
Matt HauffandGitHub 482d83788d Standardize the Wallet API for generate_signed_transaction (#19209)
* Standardize the `Wallet` API for `generate_signed_transaction`

* Some test fixes

* Fix `create_tandem_xch_tx`

* Fix the other `create_tandem_xch_tx`s

* More test fixes

* More test fixes

* Bad fix from last time
2025-02-05 15:12:16 -07:00
Matt HauffandGitHub 0c9509f9fc Remove old offer guards (#19167) 2025-01-27 08:24:32 -07:00
Matt HauffandGitHub c99492cc19 [CHIA-773] Swap out Payment for CreateCoin (#19144)
* Swap out `Payment` for `CreateCoin`

* Fix mypy-exclusions

* tweak
2025-01-27 08:22:29 -07:00
Matt HauffandGitHub 5e0d6a4463 [CHIA-2192] Add singleton records to action scopes (#19138)
* Add singleton_records to action scopes

* Extract SingletonRecord to its own file

* Fix test_lifecycle

* Fix wallet action scope test mock
2025-01-27 08:19:54 -07:00
matt-o-howandGitHub 8bb8a1b730 Migrate puzzles away from load_clvm to import from chia_puzzles_py (#19055)
* add dependency for chia_puzzles_py

* migrate cat and dao wallets to new repo

* migrate did wallet

* more migration and deduplication

* change singleton launcher hash import in rpc

* stop importing singleton launcher from nft_puzzles in nft_wallet

* remove SINGLETON_LAUNCHER_PUZZLE import from nft_puzzles

* remove unused import

* ruff check and fix

* use graftroot dl offers from chia_puzzles_py

* get rid of more non explicit exports

* remove circular dependency

* ruff check

* migrate py files in puzzles to use chia_puzzles_py

* fix import

* fix more imports

* migrate clawback wallet and fix typo (requires version update of chia_puzzles_py)

* delete puzzles and separate nft puzzles from puzzle_utils

* use 0.19.1 version of chia_puzzles_py

* more nft puzzle detangling

* use latest chia_puzzles_py and migrate pools

* ruff fixes

* delete pool puzzles folder

* remove load_clvm from test_singleton and test_singleton_lifecycle_fast

* mypy fixes

* ruff fixes

* remove manage_clvm check precommit hook

* update version

* update chia_puzzles dependency to 0.19.4

* remove full_node puzzles

* remove test for condition codes

* change generator type to SerializedProgram

* remove remaining load_clvms that can be factored out

* delete consensus puzzles

* fix test_singleton_lifecycle_fast

* cast debug_spend_bundle coin name to bytes32

* ruff debug_spend_bundle

* update chia-puzzles and fix typo

* fix line endings

* fix typo in ROM_BOOTSTRAP_GENERATOR references

* remove bytes32 cast from debug_spend_bundle

* update chia-puzzles-py dependency to version 0.20.1 and refactor ACS_TRANSFER_PROGRAM initialization

* remove unused puzzle files

* singleton_top_layer exports hashs now which are imported from chia_puzzles

* remove .get_tree_hash() in favor of importing the hash

* remaining hash imports

* regenerate poetry.lock and pyproject.toml from main

* import singleton launcher hash from explicit export

* import SINGLETON_LAUNCHER_HASH from chia.wallet.singleton in test_pool_rpc.py

* import SINGLETON_MOD_HASH from chia.wallet.puzzles.singleton_top_layer in test_pool_puzzles_lifecycle.py

* poetry lock --no-update post-rebase

* re-regenerate lock file --no-update

* fix rebased block_tools
2025-01-17 09:58:16 -07:00
Izumi HoshinoandGitHub 3e8b3b5999 Fixed an issue where cancelling NFT offer did not cancel other offers… (#19129)
Fixed an issue where cancelling NFT offer did not cancel other offers with the NFT
2025-01-13 11:46:26 -07:00
Kyle AltendorfandGitHub 1062ab4ef2 move tx endpoint into wallet-specific code (#19116) 2025-01-10 10:21:18 -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
JsewillandGitHub a7bd676bea Minor grammatical correction in wallet_rpc_api.py (#18955)
changed "is not belong" to "does not belong" in the `did_find_lost_did` endpoint when `derivation_record is None`, in wallet_rpc_api.py.
2024-12-20 12:29:19 -07:00
Matt HauffandGitHub 60b6224f0d Remove unnecessary action_scope edit (#19066)
* Remove unnecessary action_scope edit

* Actually pass selected coins through

* oops
2024-12-19 11:33:11 -07:00
Matt HauffandGitHub be0a77db7d [CHIA-1316] Port VC Endpoints to @marshal decorator (#18970)
* Port `vc_mint`

* Port `vc_spend`

* Port `vc_revoke`

* Port `vc_get`

* Port `vc_get_list`

* Port `vc_add_proofs`

* Port `vc_get_proofs_for_root`

* address comments by @altendky
2024-12-12 09:01:29 -07:00
Matt HauffandGitHub 215327a6f7 [CHIA-1933] Remove get_new methods from CATWallet (#18965)
* Remove `get_new` methods from cat wallet

* Fix an instance in `tails.py`

* Fix an instance in `tails.py`

* Fix `test_dao_wallets.py`

* Test coverage
2024-12-04 11:20:57 -07:00
Earle LoweandGitHub 7c01e3c483 CHIA-1730: port chia plotnft to @chia_commands framework (#18833)
* chia plotnft CLI improvements

* use CliRpcConnectionError

* add check to show

* fix typo

* Update plotnft CLI to newer framework

* Fix help cut-paste error

* add test using new framework

* some minor fixes

* use click.Choice for pool/local option

* some click options

* Some more plotnft cli tests

* drop test_pool_cmdline from mypy-exclusions

* mypy fixes

* several fixes

* Add leave test

* join tests

* more join tests

* missing await

* Try setting config

* use root_path from NeedsWalletRPC

* linting

* Some cleanup

* Add claim tests

* Improved tests

* refactor some test code

* Add inspect tests

* Skip bad test for now

* Add in change payout tests

* quoting error

* Add test for get_login_link

* Add in a few negative tests for join

* Few more tests

* Experment with clirunner env overrides

* put back chia_root into context dict

* Some cleanup and one more test

* maybe final test

* some updates

* some dedup and reorg of test code

* run trusted and untrusted paramertization

* make reuse puzhash stuff work

* Add in required mock object for test_update_pool_config_new_config

* rearrange code per review comment - limit use of NeedsWalletRPC to chia_command

* Add in plotnft click parsing tests

* added ability to pass in obj to runner invoke

* Add in some more test cases

* fix up create issues with config

* Add in couple more test cases for error conditions

* Minor code cleanup

* Use long options for readability, minor code cleanup

* Use config file for farmer rpc port

* simplify code

* Add testing for prompt cases

* Add mocking for default_root_path

* context cleanup

* temp debugging output

* patch the proper object

* move some wallet fixtures into top level conftest and remove conftest import

* merge to origin/main
2024-12-03 12:33:52 -07:00