Commit Graph

81 Commits

Author SHA1 Message Date
Kyle Altendorf
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 Norberg
a457fa28e0
Optional atom fixes (#17040) 2023-12-12 13:07:08 -06:00
Kyle Altendorf
fbdb27bef1
managers for services (#16670) 2023-11-16 19:21:12 -06:00
Arvid Norberg
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 Norberg
f863326d87
harmonize SerializedProgram with Program (#16694) 2023-10-26 15:55:10 -05:00
Amine Khaldi
a420d8ea0c
Simplify add_block_batch by making it take PeerInfo instead of WSChiaConnection (#16692) 2023-10-26 10:33:45 -05:00
Kyle Altendorf
90c1441af0
apply pyupgrade --py38-plus --keep-runtime-typing (#14646) 2023-10-24 12:01:23 -05:00
Kyle Altendorf
f1059bcb44
@dataclass FullNode to avoid risks of instances without attributes set (#1332) 2023-10-03 14:33:19 -05:00
Arvid Norberg
0c56e8f7af
Better timestamps on simulated chains (#16326) 2023-09-15 21:00:08 -05:00
Kyle Altendorf
36070fb19a
more (more) uint*() (#16324) 2023-09-15 11:35:21 -05:00
Kyle Altendorf
ebcf74d9d9
improve dataclasses.replace() usage to improve hint checking (#16286) 2023-09-13 10:25:13 -05:00
Almog De Paz
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 Norberg
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 Norberg
f8db204b5c
revive test-full-sync benchmark (#16088)
fixup test-full-sync benchmark
2023-08-17 12:50:41 -05:00
Arvid Norberg
57d1974ef3
fix flake8 warnings (#15897) 2023-07-31 09:46:49 -05:00
Matt Hauff
217e81f478
Move some puzzles out of chia.wallet.puzzles (#15822) 2023-07-24 10:39:16 -05:00
Kyle Altendorf
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 Kelly
4b77fb3dd1
Make output of manage_clvm more readable on failure (#15658) 2023-06-30 13:42:24 -05:00
Kyle Altendorf
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 Norberg
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 Hauff
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 Altendorf
7f7bce8677
help= not short_help= (#15076)
* help= not short_help=

* oops

* more

* more
2023-05-03 00:29:13 -05:00
Kyle Altendorf
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 Hauff
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 Norberg
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
Matt Hauff
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 Altendorf
014a7b34d4
Update tools/manage_clvm.py
Co-authored-by: Matt Hauff <quexington@gmail.com>
2023-04-07 14:04:23 -04:00
Kyle Altendorf
4dfa8c294f
correct broken exit codes from manage_clvm.py 2023-04-07 12:57:13 -04:00
Kyle Altendorf
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
dustinface
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
Arvid Norberg
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 Norberg
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 Altendorf
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 Altendorf
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
dustinface
42f6a883ae
isort: Remove the remaining exceptions and sort the related files (#14124) 2022-12-13 17:10:55 -06:00
dustinface
b916275540
tools: Implement and test tools/legacy_keyring.py (#13947)
* Add `-l` option to `install.sh` and use it for linux tests on CI

* Implement and test `tools/legacy_keyring.py`

* Update install.sh

Co-authored-by: Jeff <paninaro@gmail.com>

Co-authored-by: Jeff <paninaro@gmail.com>
2022-12-03 23:31:51 -06:00
Arvid Norberg
53a570ebe1
Add option to analyze-chain to validate block signatures (#13917) 2022-11-16 13:59:21 -06:00
Almog De Paz
ac2203eda8
Refactor test utils for import availability outside of repo (#13880)
* refactor for import availability outside of repo

* refactor for import availability outside of repo

* small revert

* newline

* fix imports

* fix pre-commit issues

* types issort, adapt mypy ignore

* redundant imports

* move files from util to simulator

* run pre_commit

* remove setup_nodes/keyring from isort.cfg

* fix asyncio import
2022-11-15 18:51:05 -06:00
dustinface
8e2e51a8c8
Add optional outbound parameter to get_connections (#13879) 2022-11-15 17:40:16 -06:00
dustinface
d3e1698cc8
util: Some cleanups for the memory profiler (#13809)
* Make `CallInfo` and `Frame` a `dataclass` and move them to the top level

* Use `click` in `memory_profiler.py`

* Move `mem_profile_task` into `chia.util.profiler`

* Move `chia.util.memory_profiler.py` to `tools/analyze_memory_profile.py`

* Implement `Frame.add`
2022-11-09 14:17:43 -06:00
dustinface
50d148eadd
Cleanup WSChiaConnection imports/usage (#13868) 2022-11-08 10:10:59 -06:00
Louis Bettens
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 Altendorf
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
Kyle Altendorf
bbd032e1c9
embrace click 8 (#13559)
* click==8.1.3, black==22.8.0

* black

* click option creator hinting

* ignores for to-be-resolved issue

* remove unused import
2022-09-29 11:24:36 -05:00
Richard Kiss
42406f9e96
Recompress generators (#13376)
* Add `start`. Speed start-up. Format better.

* Add `--call` argument to invoke other python code.
2022-09-29 11:24:07 -05:00
Kyle Altendorf
a20ee08fce
only compile clvm for developers (#13478)
* only compile clvm for developers

* retain existing behavior for backwards compatibility

* tests/check_clvm.py becomes tools/manage_clvm.py check (and add build subcommand)

* trigger recompilation in pytest runs
2022-09-27 11:21:54 -05:00
Arvid Norberg
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 Norberg
0d78058daa
optimize get_block_store (#13263)
* optimize the block_store for the get_puzzle_and_solution_for_coin to not parse the full block. We just need the block generator and generator regs.

* optimize analyze-block

* address review comments
2022-09-03 01:34:05 -05:00
Arvid Norberg
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