96 Commits
Author SHA1 Message Date
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
Kyle AltendorfandGitHub 2ed75d47f3 more mypy platforms in ci (#12299)
* more mypy platforms in ci

* check not checks

* oh yeah, activate...

* add 3.11

* adjust job names

* actually use the right python version for install

* adjust for 3.7 hinting support

* exclude macos 3.7 and macos arm 3.8

* back to 3.8 for now

* major_dot_minor

* oops

* move ignore comments for 3.7

* and more
2023-04-27 09:51:18 -05:00
Matt HauffandGitHub e2b16d4d3c Fix manage_clvm.py hash building and std libraries (#15075)
* manage_clvm.py edge cases

* @trepca suggestion fix
2023-04-19 12:06:27 -05:00
Arvid NorbergandGitHub 536830b09b Generator mod cleanup and simplification (#15055)
* remove unused run_generator_mempool() function

* move run_generator_unsafe() into the tests, which is the only place it's used

* remove (somewhat meaningless) setup_generator_args() and create_generator_args()

* remove unused GENERATOR_MOD in mempool_check_conditions.py

* remove redundant get_generator() function

* transition analyze-chain.py to use run_block_generator() and drop dependency on GENERATOR_MOD

* fixup type hints in test_rom.py

* fixup type hints in test_compression.py

* fixup type hints in test_generator_types.py
2023-04-18 16:30:10 -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
014a7b34d4 Update tools/manage_clvm.py
Co-authored-by: Matt Hauff <quexington@gmail.com>
2023-04-07 14:04:23 -04:00
Kyle AltendorfandGitHub 4dfa8c294f correct broken exit codes from manage_clvm.py 2023-04-07 12:57:13 -04: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
dustinfaceandGitHub c098ee9166 full_node: Rename some receive/respond prefixes to add (#14458)
* full_node: Rename `FullNode.resond_block` to `FullNode.add_bock`

The naming `respond_block` is confusing here imo, we have a full node
API method called `respond_block` but here in the `FullNode` class this
method is there to try adding a block to the full nodes's chain so i
think `add_block` is the better choice?

Also change the `respond_block: full_node_protocol.RespondBlock`
parameter to `block: FullBlock` which lets us get rid of many
`full_node_protocol.RespondBlock` wrappings.

* `FullNode.receive_block_batch` -> `FullNode.add_block_batch`

* `receive_unfinished_block` -> `add_unfinished_block` + change parameter

* `FullNode.respond_transaction` -> `FullNode.add_transaction`

* `FullNode.respond_end_of_sub_slot` -> `FullNode.add_end_of_sub_slot`

* `FullNode.respond_compact_vdf` -> `FullNode.add_compact_vdf`

* `respond_compact_proof_of_time` -> `add_compact_proof_of_time`

* `respond_transaction_semaphore` -> `add_transaction_semaphore`
2023-02-23 10:28:29 -06:00
Amine Khaldi cf147458e8 Merge commit '124961a355e6175037067a06f5f2ab18600dfdf1' into catchup/main_from_release_1.7.0_124961a355e6175037067a06f5f2ab18600dfdf1 2023-02-14 21:35:36 +01:00
d315097b2a full node optimizations (#14562)
implement async opt merge

Co-authored-by: William Allen <wallentx@users.noreply.github.com>
Co-authored-by: Florin Chirica <16658074+fchirica@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-02-13 22:34:31 -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
Kyle AltendorfandGitHub 026d4671af add cache to speed up manage_clvm/clvm_hex pre-commit check (#14177)
* add cache to speed up manage_clvm/clvm_hex pre-commit check

* Update tools/manage_clvm.py

* add version to cache along with handling of incorrect versions

* force skipping the cache in ci
2023-01-03 14:59:09 -06:00
Kyle AltendorfandGitHub d53f249e5c only send_to_all(), drop send_to_all_except() (#14229)
* only send_to_all(), drop send_to_all_except()

* catch up tools/ as well

* add default
2023-01-02 21:39:11 -06:00