Commit Graph
138 Commits
Author SHA1 Message Date
Earle LoweandGitHub 3c79ec7dae Add types-psutil and drop mypy ignore for psutil (#20941) 2026-05-29 08:04:17 -07:00
Almog De PazandGitHub 79008d11d5 context for moduls and testing for cursor to use automatically (#20572)
* context fo cursor

* pass with docs refrence, fix line counts and some more and minor fixes

* lint

* pr comments

* fixes
2026-05-01 14:02:08 -05:00
matt-o-howandGitHub 11aec1926e Optimise pre-commit chialisp_pprint (#20670)
initial commit
2026-03-18 11:15:33 -05:00
Richard KissandGitHub 1444569c75 Remove deprecated Python analyze-chain.py (#20580)
Remove deprecated Python analyze-chain.py in favor of Rust version

Per Arvid: this tool was ported to Rust before the hard fork.
The Python version is unmaintained.

Made-with: Cursor
2026-03-05 11:32:19 -06:00
Earle LoweandGitHub 05094c27c9 context manager for BlockTools (#20326)
* context manager for BlockTools

* Missed one usage and fixed up Self import

* Ignore cleanup errors in tempdir cleanup for BlockTools

* Remove debug prints

* Fixed up sync blocktools and use @contextmanager

* Address review comments

* Add return type

* Empty commit for github

* Strange github things

* adjust order of finding ports
2025-12-15 09:49:12 -08: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
Adam KellyandGitHub 550fa6f199 Rename chialisp repo and update dependencies (#20154)
* Rename chialisp repo

* Rename chialisp repo
2025-10-17 06:23:32 -07:00
Arvid NorbergandGitHub 12948b8376 fix validate_rpcs. Run RPC compute heavy jobs in a thread pool (#19922) 2025-08-13 09:24:31 -07: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
Jack NelsonandGitHub 12712eaafb improve validate_rpcs.py (#19873)
add validation to test
2025-08-11 12:31:29 -07:00
Jack NelsonandGitHub a10df3b619 CHIA-3396 Remove Exception Catching from node RPC (#19825)
* remove extra exception catching

* clean up node errors + tests

* forgot to pre-commit

* address using pytest wrong

* clean up error handling

* seperate out pytest tests
2025-07-21 09:16:00 -07:00
Jack NelsonandGitHub 5c6c75c59d CHIA-2638 Full Node RPC Validation Tool (#19743)
* add rpc validation tool

still wip

* forgot to call function ....

* fix no sync error

* add comment

* Update validate_rpcs.py

* test slight modifications

* Update validate_rpcs.py

* try fixing time measuring

* fix stupidity

* make benchmark more precise

* fixes + optimizations

* Update validate_rpcs.py

* speed?

* Update validate_rpcs.py

* last tweak

* Address Minor Changes

renaming, simplifying loading

* change to task group

* Revert "change to task group"

This reverts commit 1416872bab.

* try super speedy code

(Pre commit isnt working)

* meant to remove

* add + rem seperate error cond

* loop through dropped blocks.

* rename to pipline and abandon retries

* revert changes to rpcs
2025-07-09 20:49:31 -05:00
Kyle AltendorfandGitHub 1224006bc9 more memoryview (#19759) 2025-06-25 09:46:24 -07:00
Kyle AltendorfandGitHub f054d339a1 unignore some ruff s rules (#19703) 2025-06-12 11:12:54 -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 1a0eb383dc Remove dependency chia.types so chia.util no longer depends on it (#19633)
* Move chia.util.full_block_utils to chia.full_node.full_block_utils

* chia.util.generator_tools => chia.consensus.generator_tools

* chia.util.vdf_prover => chia.simulator.vdf_prover

* Move 'chia.util.condition_tools' to 'chia.consensus'.
2025-05-27 09:03:23 -07:00
Richard KissandGitHub 44643084b0 Move augmented_chain.py and prev_transaction_block.py to chia/consensus (#19587) 2025-05-08 15:11:31 -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
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
Kyle AltendorfandGitHub 39c4c5fefc chia rs 0 22 0 (#19508)
* update chia_rs to 0.22.0

* remove use of `.SOFT_FORK6_HEIGHT`

* remove use of `ENABLE_KECCAK`

* remove `"SOFT_FORK6_HEIGHT"` literals

* delete more
2025-04-17 09:17:17 -05:00
timesinceandGitHub 09f48746de chore: fix some comments (#19493)
Signed-off-by: timesince <seekseat@icloud.com>
2025-04-11 09:23:21 -07:00
RigidityandGitHub 3118c1802e CHIA-2685: Enable keccak softfork in the wallet (#19481)
Enable keccak softfork in the wallet
2025-04-09 11:22:09 -07:00
Kyle AltendorfandGitHub ceff18cb2c correct tooling bugs i made (#19370)
* Update task_timing.py

* Update analyze_memory_profile.py
2025-03-12 09:48:31 -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
Kyle AltendorfandGitHub 30c4ef2689 use chia_rs directly for consensus constants (#19301) 2025-02-21 10:03:17 -08:00
Almog De PazandGitHub 26b0fbee8e move augmented to caller (#19161)
* move augmented to caller

* use undelying height_to_hash to check main chain
2025-01-27 13:12:10 -07:00
Amine KhaldiandGitHub 0df990ac7c CHIA-2222 Annotate analyze-chain.py (#19143)
Annotate analyze-chain.py.
2025-01-27 08:20:46 -07:00
Amine KhaldiandGitHub ae2de64171 CHIA-2215 Annotate run_block.py (#19128)
Annotate run_block.py.
2025-01-13 13:20:04 -07:00
Amine KhaldiandGitHub 9063e29810 CHIA-2020 Simplify add_block_batch (#19004)
Simplify add_block_batch.

1. No need to accept AugmentedBlockchain and reconstruct it again.
2. No need to return both success and an unused optional error.
2024-12-10 06:38:37 -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
Earle LoweandGitHub e07d1eb5de Use #!/usr/bin/env bash (#18762)
* Use #!/usr/bin/env bash

* Update setup-poetry.sh

* Use #!/usr/bin/env bash for shebang

* fix up typo for leading space

* For consistency fix up a few other scripts
2024-11-04 15:22:52 -07:00
Matt HauffandGitHub 2808ee2446 [CHIA-1681] Replace black with Ruff (#18813)
* Replace black with Ruff

* Change build_network_protocol_files.py
2024-11-04 15:22:18 -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 0e703e48e0 (Mostly) Replace flake8 with Ruff (#18801)
* Get flake8 config partially ready

* Mostly remove flake8 config

* Delete arithmetic whitespace ignore

* Delete unused program strings from tests

* Remove unnecessary noqas

* A couple more flake8 warnings
2024-11-01 09:55:16 -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 2df931bf87 [CHIA-1566] pipeline block validation in sync_from_fork_point() (#18703)
* make pre_validate_multi_processing() return futures, rather than the awaited and joined results from the thread jobs. This is crucial to allow the validaion jobs to run concurrently with the database interaction in the main thread

* Split up the add_block_batch() function into 3 parts, preparing them to be pipelined in long-sync

* pass AugmentedBlockchain into pre_validate_multiprocessing() and prevalidate_blocks(), to support the augmented blockchain to outlive a single batch

* pipeline pre-validation in sync_from_forkpoint()

* optimize the common case of _reconsider_peak(), to avoid one database lookup

* address review comments

* rename filter_blocks() -> skip_blocks(). It's is only relevant at the start of the sync, add comment and assert
2024-10-25 08:38:23 -07: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 837f0e2d47 bump chia_rs dependency (#18695)
bump chia_rs dependency and accomodate for changes to SpendBundleConditions and run_block_generator()
2024-10-11 13:43:31 -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
Arvid NorbergandGitHub d1844b6b15 CHIA-1101: update BlockGenerator type (#18508)
change the type of ref_list to List[bytes] instead of List[SerializedProgram]. Also, avoid passing the block generator twice to the worker process for validation
2024-08-23 01:08:27 +08:00
Arvid NorbergandGitHub ba9420b553 remove block_height_list from BlockGenerator (#18302)
* remove block_height_list from BlockGenerator. This field is only used when farming blocks, and we don't use it in production right now. We only use it in the tests, BlockTools. It has been updated with a cleaner and more direct way of setting the block reference list in new blocks

* test
2024-08-01 16:41:39 -07:00
Kyle AltendorfandGitHub 3061cd83d7 remove some pylint ignores (#18140) 2024-06-18 14:24:30 -05:00
66a8554211 Bump chia rs 0.10.0 (#18135)
* extend test_full_node

* bump chia_rs dependency to 0.10.0

* initialize new AGG_SIG_*_ADDITIONAL_DATA fields in ConsensusConstants. Increase end-to-end test coverage of validating message suffixes as it's moving to condition parsing

* remove validaton from pkm_pairs

* NO_RELATIVE_CONDITIONS_ON_EPHEMERAL is always enabled in chia_rs 0.10.0

* Update chia/_tests/core/full_node/test_conditions.py

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

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-06-11 20:17:49 -05:00
Arvid NorbergandGitHub a4c11433f9 bump chia_rs to 0.8.0 and update G1Element handling (#18037)
* bump chia_rs to 0.8.0 and update G1Element handling

* use real keys and signatures in mempool tests
2024-05-21 13:42:21 -05:00
Kyle AltendorfandGitHub abb0b04142 move shfmt execution from the super linter to pre-commit (#17913)
* move shfmt execution from the super linter to pre-commit

* actually apply...
2024-04-29 09:03:10 -07:00
8eb41c59d7 bump chia_rs to 0.7.0 (#17909)
* bump chia_rs to 0.7.0 and transition using sized ints and sized bytes from chia_rs

* transition StructStream to use the version from chia_rs

* Initial port of ConsensusConstants to Rust

* Revert max cost calculation to use int for now

* Remove SizedBytes, since it was moved to chia_rs

* Remove test_struct_stream, since it was moved to chia_rs

* use [0] * 100 instead of bytes(100)

* restore wallet_rpc_api, and make type hints match JsonDict (Any)

* fixup ConsensusConstants; restore return value of calculate_prefix_bits()

* fixup ConsensusConstants; construct int for intermedate cost values

* fixup ConsensusConstants; construct int for intermedate cost values

* fixup: transition StructStream to use the version from chia_rs

* revert changing type annotations for json dict

---------

Co-authored-by: Rigidity <me@rigidnetwork.com>
2024-04-26 08:06:25 -07:00