Commit Graph

49 Commits

Author SHA1 Message Date
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
Arvid Norberg
f562d96535
uncurry the puzzle once instead of 3 times (#12781) 2022-08-04 23:16:04 -05:00
Arvid Norberg
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
Jack Nelson
0bc54ae08b
Move simulator test requirements over to new module (#12521)
* create new test.simulator module

to allow other packages to use the simulator without it crashing.
also tiny QOL fixes

* change user mode sim plot filter

Now only plots matching the user set fingerprint are loaded, this decreases the chance of user error.

* fix small oops in configure

* oops

* fix lint

* isort, who dis

* move folder over to chia/simulator

also change mypy settings again
2022-07-25 14:07:38 -05:00
Kyle Altendorf
90516263aa
remove chia.util.path.mkdir() (#10842)
* remove chia.util.path.mkdir()

* remove submodule change

* less tmpdir, more tmp_path
2022-06-08 10:24:40 -05:00
Arvid Norberg
3c2fc1947d
upgrade chia-rs to streamable support (#11503)
* upgrade chia-rs to streamable support

* bump chia_rs dependency
2022-06-01 12:56:11 -05:00
Arvid Norberg
969c2586f1
add checkpoint feature to test_full_sync (#11723) 2022-06-01 12:53:48 -05:00
Arvid Norberg
d346ef89f1
extend benchmark to make the db-sync mode and node-profiler configurable (#11647) 2022-05-31 15:37:20 -05:00
Arvid Norberg
3795a52152
fix some LGTM issues (#11453) 2022-05-12 15:17:24 -07:00
Mariano Sorgente
e0df18f85d
Ms.hint refactor (#11222)
* Some work on hints

* More cleanup and test_generator_tools

* Change relevant calls

* More refactor and cleanup

* More refactor

* Small fix

* Create wrapper object PeakPostProcessingResult

* Lint and small fix

* Fix a hint bug

* Fix hint update_wallets

* Fix test_full_sync

* pre-commit

* Start with PR review comments

* More efficient iteration

* Remove tx_removals_additions_and_hints

* Revert mozilla ca

* Fix issue with startup
2022-05-05 08:19:57 -07:00
Kyle Altendorf
34eed9a3bc
more isort (#11401) 2022-05-05 08:17:38 -07:00
Arvid Norberg
79034bb82e
improve generate_chain (#11242)
* improve generate_chain to have proper command line options. Make it include block references by default.

* fix shell linter
2022-04-27 11:43:33 -07:00
Arvid Norberg
f9c4f1f96d
add tool to measure CPU utilization of a process tree (#11264)
* add tool to measure CPU utilization of a process tree and plot it over time

* make collecing thread counters optional
2022-04-22 10:53:53 -07:00
Arvid Norberg
511c13e632
add tool to generate a blockchain with full blocks, as a benchmark (#11146) 2022-04-15 10:11:42 -07:00
Arvid Norberg
21fb6f260e
transition to using chia_rs module (#11094) 2022-04-08 09:37:10 -07:00
Arvid Norberg
492503f109
print average block rate at different block height windows (#11064) 2022-04-05 16:11:03 -07:00
Arvid Norberg
b377339372
fix memory leak in test_full_sync (#11004) 2022-04-05 08:53:12 -07:00
Arvid Norberg
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
Arvid Norberg
8ca0633d9f
fix test_full_sync.py to only feed the blocks in the main chain to the node (#10974) 2022-03-31 23:03:59 -07:00
Arvid Norberg
1bcf409ee1
single thread executor (#10919)
* add inline executor and an option to run single-threaded

* add option to run test_full_sync in single-thread mode, to include block validation in profiles. Also attempt to speed it up by disabling db_sync
2022-03-28 12:47:46 -07:00
dustinface
98971de9d5
pre-commit: Add a new hook to run isort (#8827)
* pre-commit: Add a new hook to run `isort`

* contributing: Add hint about `isort`

* add isort to dev deps, ignore existing .py files, use black profile

* long list to lines not comma delimited

* isort: Update and sort ignore list to match latest `main`

* add bash command line to generate isort extend skip list (#3)

* add bash command line to generate extend skip list

* tidy

* isort: More files to ignore after rebase

* tests: Fix `test_wallet_user_store.py` after rebase

* Some fixes after rebase

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-15 07:28:53 -08:00
Arvid Norberg
229eea9b55
Log slow block height (#10160)
* improve logging of blocks that are slow

* add profiler to test_full_sync

* Update tools/test_full_sync.py

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

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2022-02-14 12:51:21 -08:00
Adam Kelly
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
Kyle Altendorf
d404d0e92b
just put __init__.py files where we have .py files (plus subdirectories) (#10129)
* just put __init__.py files where we have .py files

* and the rest

* remove unused ignore
2022-02-07 13:16:13 -08:00
Arvid Norberg
13bf50833c
add tool to test adding every block from a blockchain database (#10076)
* add tool to test adding every block from a blockchain database, as a sanity check for a new version of the full node

* exercise full_node in artificial sync from scratch test

* add test exercising test_full_sync.py
2022-02-03 10:31:49 -08:00
Laser Cat
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 Norberg
c33dc256c8
update analyze_blockchain tool to read v2 blockchain databases (#9983)
* update analyze_blockchain tool to read v2 blockchain databases and introduce option to run all generators in mempool mode. Also update to use the new clvm_rs API

* update gnuplot file for the new output from analyze_blockchain.py
2022-02-02 10:39:21 -08:00
Arvid Norberg
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
Arvid Norberg
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 Norberg
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 Lowe
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
Arvid Norberg
b2ed21307b
add tool to analyze the chain from the blockchain database, and run all generator programs (#9616) 2021-12-21 10:20:17 -08:00