109 Commits
Author SHA1 Message Date
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
Kyle AltendorfandGitHub 2eb3633bcb json.dumps(indent=2) (#17714) 2024-03-18 10:26:13 -07:00
Kyle AltendorfandGitHub 3d984f5db4 match manage clvm build indent to 2 spaces like prettier.io (#17713) 2024-03-18 09:45:32 -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
Earle LoweandGitHub 48e4039e58 Update black to 24.1.1 and update source as needed (#17499)
* Update source to black 24 spec

* update black to 24.1.1

* update pylint to ignore multiple-statements

* update test file

* black updates

* format updates

* Update test_network_protocol_files.py

* Update test_network_protocol_files.py
2024-03-13 11:08:19 -07:00
Arvid NorbergandGitHub eb543fd888 transition FullBlock and BlockRecord to rust (#17525)
* use rust version of FullBlock and UnfinishedBlock

* use rust type for BlockRecord
2024-02-20 13:11:31 -08:00
Kyle AltendorfandGitHub 714c4d1985 move run_full_sync() to tests/ (#17268)
* move `run_full_sync()` to `tests/`

* update mypy exclusions
2024-01-10 09:32:04 -06:00
Kyle AltendorfandGitHub 09048aedc8 move run_json_block() to tests/ (#17269) 2024-01-10 09:30:27 -06:00
Kyle AltendorfandGitHub 04f59ff1dc move tools/legacy_keyring.py to chia/legacy/keyring.py (#17252)
* move `tools/legacy_keyring.py` to `chia/legacy/keyring.py`

* init
2024-01-09 14:09:56 -06:00
Arvid NorbergandGitHub a457fa28e0 Optional atom fixes (#17040) 2023-12-12 13:07:08 -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
Arvid NorbergandGitHub f863326d87 harmonize SerializedProgram with Program (#16694) 2023-10-26 15:55:10 -05:00
Amine KhaldiandGitHub a420d8ea0c Simplify add_block_batch by making it take PeerInfo instead of WSChiaConnection (#16692) 2023-10-26 10:33:45 -05:00
Kyle AltendorfandGitHub 90c1441af0 apply pyupgrade --py38-plus --keep-runtime-typing (#14646) 2023-10-24 12:01:23 -05:00
Kyle AltendorfandGitHub f1059bcb44 @dataclass FullNode to avoid risks of instances without attributes set (#1332) 2023-10-03 14:33:19 -05:00
Arvid NorbergandGitHub 0c56e8f7af Better timestamps on simulated chains (#16326) 2023-09-15 21:00:08 -05:00
Kyle AltendorfandGitHub 36070fb19a more (more) uint*() (#16324) 2023-09-15 11:35:21 -05:00
Kyle AltendorfandGitHub ebcf74d9d9 improve dataclasses.replace() usage to improve hint checking (#16286) 2023-09-13 10:25:13 -05:00
Almog De PazandGitHub d966f3f9e6 Add bad peak cache (#16027)
* add and check bad peak hash

* move check

* refactor, add tests, change cache to Dict

* pr fixes

* fix bad f-string

* refactor chip-0013 errors

* limit cache size, add size to constants

* test cache invalidation fix invalidation bug

* fix off by one

* move cache size to config

* remove bt conf override

* use get_peers_with_peak

* fix expected exception in test_soft_fork4_activation
2023-08-30 13:27:22 -05:00
Arvid NorbergandGitHub 7b0bea4043 various typing fixes (#15899)
* add blspy-stubs to improve mypy

* various typing fixes

* avoid cast

* use ValueError exception instead of assert when aborting picking a wallet key
2023-08-17 19:10:40 -05:00
Arvid NorbergandGitHub f8db204b5c revive test-full-sync benchmark (#16088)
fixup test-full-sync benchmark
2023-08-17 12:50:41 -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
Kyle AltendorfandGitHub 42a6d1afa6 remove support for Python 3.7 (#14611)
* remove support for Python 3.7

* python_requires=">=3.8, <4"

* 3.8.1+

* catchup

* remove todos handled in https://github.com/Chia-Network/chia-blockchain/pull/15755
2023-07-14 12:49:58 -05:00
Adam KellyandGitHub 4b77fb3dd1 Make output of manage_clvm more readable on failure (#15658) 2023-06-30 13:42:24 -05:00
Kyle AltendorfandGitHub 03943a0e51 allow tests/tools/test_full_sync.py::test_full_sync_test to run on 3.7 (#15570)
* allow tests/tools/test_full_sync.py::test_full_sync_test to run on 3.7

* drop dirs_exist_ok=

* more

* less
2023-06-21 18:14:34 -05:00
Arvid NorbergandGitHub 621c75e4ba Fork infrastructure (#15299)
* remove softfork-logic for 1.7 softfork (which has already activated)

* add new constants for soft-fork3, hard-fork and the other plot-filter adjustments
2023-05-18 20:20:11 -05:00
Matt HauffandGitHub eab43eb800 Add Chialisp pretty printer to pre-commit (#15008)
* Add chialispp port to pre-commit

* Lint files
2023-05-09 14:46:41 -05:00
Kyle AltendorfandGitHub 7f7bce8677 help= not short_help= (#15076)
* help= not short_help=

* oops

* more

* more
2023-05-03 00:29:13 -05:00