Commit Graph
28 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 fcdb8e4925 Manual fixes for upcoming Ruff pyupgrade push (#20213)
* Manual fixes

* Revert back to variable in type expression

* Fix streamable to handle UnionType
2025-11-03 09:16:42 -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
Amine KhaldiandGitHub 6824b11ba0 CHIA-2743 Synchronous block generator creation (#19505)
Synchronous block generator creation.
2025-04-24 10:24:42 -05:00
Amine KhaldiandGitHub 4d027d03e4 CHIA-2776 Simplify DB checks in invariant_check_mempool (#19526)
Simplify DB checks in invariant_check_mempool.
2025-04-21 14:05:24 -05:00
Amine KhaldiandGitHub 5121204c59 CHIA-2596 Simplify latest_singleton_coin checking in invariant_check_mempool (#19435)
Simplify latest_singleton_coin checking in invariant_check_mempool.
2025-03-26 13:11:29 -07:00
Arvid NorbergandGitHub 6358bab4c3 [CHIA-2383] improve FF mempool eviction (#19355)
* evict FF spends from the mempool if they become invalid with a new peak

* optimize fast-forward rebase in mempool new_peak()

* clean up tests, also test reversing spent coins in new_peak()

* extend mempool invariant check in tests

* fix typo in comment
2025-03-07 17:44:40 -06: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
ff3cf282c2 explicitly collect api methods instead of later using getattr (#18800)
* explicitly collect api methods instead of later using getattr

* api as a class itself

* tidy

* fixup

* tidier

* and...

* fixup

* oops

* mm

* hum

* fixup

* monkey patching helper

* ...

* tidy

* back to instances

* fix

* self-patch

* duplicate original request attributes

* Update chia/_tests/wallet/sync/test_wallet_sync.py

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>

* test that `@metadata.request()` fails on repeated request type

* ...

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-11-08 08:58:15 -07:00
Matt HauffandGitHub 73e4a5bbea [CHIA-1680] Finish replacing flake8 with Ruff (#18802)
* Apply ruff unsafe fixes

* Manually fix tuples with `as`

* Remove all references to flake8
2024-11-04 08:59:57 -07:00
Matt HauffandGitHub 6084112d48 [CHIA-1553] Replace pylint with ruff (#18759)
* Replace pylint with ruff

* poetry

* remove pylint

* Address comments by @altendky

* Undo formatting

* actually undo formatting
2024-10-25 15:55:37 -07:00
Arvid NorbergandGitHub 8c72d22edf move add_blocks_in_batches() out of tests (#18750)
move add_blocks_in_batches() out of tests, since the node simulator depends on it
2024-10-23 08:50:08 -05:00
Almog De PazandGitHub a80d779fe6 refactor full_node add_block (#18584)
* refactor

* minor fixes

* fix_tests

* add finish sync to add_blocks_in_batches

* add_blocks_in_batches updates wallets

* test fixes

* fix condition in add_block

* add known block to cache

* restore comment

* remove init file from log dir

* fix failed reorg test

* revert known block info change

* assert height in cat test

* wait for wallet height in nft test

* assert sync all height for all wallets

* test_cat_creation assert height

* rename vars

* assert height in process states
2024-10-22 12:14:18 -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
Arvid NorbergandGitHub e7241ebfe0 simplify passing around difficulty, sub slot iterators and prev_ses_block (#18660)
* combine current sub slot iterations, current difficulty and previous ses block into ChainState, to make it easier to pass around and update

* address review comments

* address review comments. rename ChainState -> ValidationState. add more comments
2024-10-07 11:09:15 -07:00
Almog De PazandGitHub 9559295725 refactor pre_validate_blocks_multiprocessing (#18469)
* refactor pre_validate_blocks_multiprocessing

* fix condtion

* get diff and ssi from blocks

* works_with_skip_ses

* add default

* propegate_to_header_validation

* pass data between batches

* remove redundant code

* merge fix

* remove optionals and refactor tests

* only use cache

* merge fix

* fix test

* dont traverse if we have prev sub epoch block

* return bad_prev error if block is missing

* mandetory param names

* clean

* fix_benchmark_test
2024-09-07 05:11:42 +08:00
Kyle AltendorfandGitHub eefca33875 Revert "Revert "Revert "CHIA-414 fixup datalayer benchmark""" (#18223)
Revert "Revert "Revert "CHIA-414 fixup datalayer benchmark"" (#18107)"

This reverts commit e87d51a993.
2024-06-21 15:32:39 -05:00
Amine KhaldiandGitHub e0c36e8afd CHIA-767 Simplify invariant_check_mempool (#18176)
Simplify invariant_check_mempool
2024-06-20 08:10:14 -05:00
Kyle AltendorfandGitHub e87d51a993 Revert "Revert "CHIA-414 fixup datalayer benchmark"" (#18107)
* Revert "Revert "CHIA-414 fixup datalayer benchmark" (#18054)"

This reverts commit b49eb0a892.

* repeats

* report coefficients

* hardcode timeout

* 5

* no benchmarks

* 0.6

* repeat name

* format_number()

* higher limits

* 10x

* tidy
2024-06-18 14:25:34 -05: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
Kyle AltendorfandGitHub a37ad22e11 introduce ComparableEnum for tests (#18108) 2024-06-05 11:02:19 +01:00
Kyle AltendorfandGitHub b49eb0a892 Revert "CHIA-414 fixup datalayer benchmark" (#18054)
Revert "CHIA-414 fixup datalayer benchmark (#17786)"

This reverts commit 50a5091345.
2024-05-21 20:49:35 -05:00
Kyle AltendorfandGitHub 50a5091345 CHIA-414 fixup datalayer benchmark (#17786)
* noisy first adjustment

* more

* big-o

* just test_benchmark_batch_insert_speed

* blah

* constant

* constant or linear with small slope

* blah

* Update test_data_store.py

* update limits

* slight tidy

* all benchmarks again
2024-05-21 13:41:50 -05:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Kyle Altendorf
480bba57ba build(deps-dev): bump mypy from 1.8.0 to 1.10.0 (#17984)
* build(deps-dev): bump mypy from 1.8.0 to 1.10.0

Bumps [mypy](https://github.com/python/mypy) from 1.8.0 to 1.10.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.8.0...v1.10.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

* adjust

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-05-09 08:56:50 -05:00
Kyle AltendorfandGitHub ed786e2f61 add foreign key delay (#17709)
* add foreign key delay

* handle non-`Row` foreign key error reports

* todos

* coverage

* rename to `foreign_key_enforcement_enabled=`
2024-03-27 09:14:57 -07:00
Kyle AltendorfandGitHub a89222a428 move tests (#17209)
* prep

* verify source and installed tests match

* move

* remove move script
2024-03-14 10:19:20 -07:00