Commit Graph
30 Commits
Author SHA1 Message Date
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
Kyle AltendorfandGitHub 30c4ef2689 use chia_rs directly for consensus constants (#19301) 2025-02-21 10:03:17 -08:00
Amine KhaldiandGitHub ae2de64171 CHIA-2215 Annotate run_block.py (#19128)
Annotate run_block.py.
2025-01-13 13:20:04 -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 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
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
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
Kyle AltendorfandGitHub 09048aedc8 move run_json_block() to tests/ (#17269) 2024-01-10 09:30:27 -06:00
Arvid NorbergandGitHub a457fa28e0 Optional atom fixes (#17040) 2023-12-12 13:07:08 -06:00
Arvid NorbergandGitHub f863326d87 harmonize SerializedProgram with Program (#16694) 2023-10-26 15:55:10 -05:00
Arvid NorbergandGitHub 57d1974ef3 fix flake8 warnings (#15897) 2023-07-31 09:46:49 -05:00
Matt HauffandGitHub 217e81f478 Move some puzzles out of chia.wallet.puzzles (#15822) 2023-07-24 10:39:16 -05:00
e5b94d34a0 Chialisp file extensions (#14996)
* Rename chialisp file extensions

* Add pre-commit check for .clvm files

* Delete sha256tree files

* remove hash files in favor of central dictionary

* Add check for missing files like hex and hash entries

* Enhance clsp pre-commit check

* Actually check hash matches

* Update tools/manage_clvm.py

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

* Update tools/manage_clvm.py

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

* Fix Windows file writing

* Fix setup.py package_data fields

* Load hash dict at runtime

* Move away from exception pattern

* Bad equality check

* Minor fixes

* remove trailing whitespace fix

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-04-18 11:27:17 -05:00
Kyle AltendorfandGitHub ff5ef6e073 remove leading newlines from indented code blocks (#14653)
* remove leading newlines from indented code blocks

* catch another one
2023-02-23 21:53:48 -06:00
Arvid NorbergandGitHub 68c9aafc0a move SerializedProgram to its own file (#14391)
* move SerializedProgram into its own file (to fixup type annotations)

* fix type annotations for SerializedProgram

* fixup import statements for new SerializedProgram module
2023-01-27 17:20:23 -06:00
Louis BettensandGitHub 5ee4c398bf do not compile ChiaLisp at import time (#13609)
* do not compile CL at import time

Similar idea as #13478 but for the `load_serialized_clvm` function.

Fixes #11257 for me

* do not compile ChiaLisp at import time in wallet
2022-10-13 11:32:51 -07:00
Kyle AltendorfandGitHub 3b084a165b configure isort to add the future annotations import (#13327)
* configure isort to add the future annotations import

* apply the new isort setting

* remove type ignores for new mypy (#13539)

https://pypi.org/project/mypy/0.981/

* another
2022-09-30 03:40:22 -05:00
Arvid NorbergandGitHub ddcae129d5 fix run_block to actually pass in the chialisp_deserialization program, as required by consensus (#13238) 2022-09-08 13:47:20 -05:00
Arvid NorbergandGitHub 1b5f45a7d3 introduce an UncurriedPuzzle class (#13211)
* introduce an UncurriedPuzzle class, containin the mod and args from a puzzle that has already been uncurried. Pass this around to functions that want to access the uncurried puzzle, to avoid uncurrying the same puzzle multiple times.

* use UncurriedPuzzle for get_inner_puzzle()
2022-08-30 11:29:40 -05:00
Arvid NorbergandGitHub f562d96535 uncurry the puzzle once instead of 3 times (#12781) 2022-08-04 23:16:04 -05:00
Arvid NorbergandGitHub 92a5f38a86 remove soft fork logic at height 2300000 (#12563)
* remove soft fork logic at height 2300000. The whole chain can be validated with the post-soft-fork rules. Remove testing of pre-soft-fork rules

* fix test_full_sync
2022-08-01 17:32:53 -05:00
Kyle AltendorfandGitHub 34eed9a3bc more isort (#11401) 2022-05-05 08:17:38 -07:00
Arvid NorbergandGitHub 21fb6f260e transition to using chia_rs module (#11094) 2022-04-08 09:37:10 -07:00
Arvid NorbergandGitHub fe77c69018 run_generator2 rust call and compact conditions data structure (#8862)
* use run_generator2 rust call and compact spend bundle conditions data structure pervasively.

* address review comments
2022-04-04 11:53:13 -07:00
8aeefdec02 Fix running blocks with generators that use back-references (#10102)
* Fix running blocks with generators that use back-references

* Update tools/run_block.py

Co-authored-by: Thomas Pytleski <pytlesk4@gmail.com>

Co-authored-by: Thomas Pytleski <pytlesk4@gmail.com>
2022-02-07 16:03:56 -08:00
Laser CatandGitHub ec92f4b680 fix: update run_block.py (#10014)
* fix: update run_block.py

- add asset id
- add parent directory to load transactions_generator_ref_list from a directory

* fix: remove un used import

* fix: Call to function ref_list_to_args with too few arguments; should be no fewer than 2.

* core: remove unused function

* fix: missed a conflict, opps

* core: remove unused import

* fix: linting
2022-02-03 10:29:00 -08:00
Arvid NorbergandGitHub 3d063fea8f remove the GeneratorArgs type, and instead include the heights and generator programs as separate lists in BlockGenerator. The heights are not necessary when validating blocks, so this makes it easier to omit them in that case. The heights are only used when generating/farming a block. (#10006) 2022-01-31 18:49:39 -08:00
b8ada1ceb7 introduce restrictions on generators at a specific height (#9957)
* introduce restrictions on generators at a specific height. disallow division on negative numbers and disallow redundant leading zeros on integer condition arguments (produced by a generator)

* use SOFT_FORK_HEIGHT constant

* there is no need to specify height when validating block in block_creation

* Update tests/core/full_node/test_mempool.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-01-28 12:29:11 -08:00
Arvid NorbergandGitHub 5ebcd82c58 simplify run_block() (#9962)
* more tests

* only run the generator once, in run_block(). Prior to this patch, we run it once per spent coin + 1
2022-01-26 16:44:30 -08:00
Earle LoweandGitHub d7cd3fe2cb run block tool updates (#9807)
* run block tool updates

* pylint fixes

* Add tests

* Update workflows for new tests

* Updates based on comments
2022-01-25 07:44:13 -08:00