* 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
* fix bug in make_test_conds() test utility
* bump chia_rs to 0.2.4, which preserves assert_seconds_relative 0 in parsing conditions. This allows for the 1.8.0 soft-fork to make the existing time-lock conditions stricter, > instead of >=. This is to match the existing ASSERT_HEIGHT_RELATIVE, which already is >
* fixup separating ENABLE_ASSERT_BEFORE from MEMPOOL_MODE
* Use a low value for SOFT_FORK2_HEIGHT during tests and cover the case before soft-fork2
---------
Co-authored-by: Adam Kelly <338792+aqk@users.noreply.github.com>
* bump chia_rs to version 0.2.3
* add new error codes for assert_my_birth_*
* add new condition codes for ASSERT_MY_BIRTH_*
* add logic for ASSERT_MY_BIRTH_* conditions
* Introduce BlockRecordProtocol as a subset of BlockRecord that the mempool manager uses for peak.
* Create BenchBlockRecord and use it for benchmarks/mempool.py.
* PR #14611 didn't land yet (keep 3.7 support for now).
* We don't need this guidance anymore.
* move SerializedProgram into its own file (to fixup type annotations)
* fix type annotations for SerializedProgram
* fixup import statements for new SerializedProgram module
* 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
* Remove mempool.additions
* Don't re run the program, and remove program from mempool item
* Removals only stores item ids, and stores a list
* Move pending cache down to prevent cache dos
* Separate validation from adding to pool, and remove mypy exceptions
* Fix bug with replacing
* Add to mypy
* Revert cbgui
* precommit fail
* Properly update the seen dict
* lint error
* Fix mempool bug
* Enable mypy for a bunch of files
* Update after merge with main
* 99/260 remaining
* Address comments
* Enable more mypy
* Merge conflict mypy file
* More fixes
* pytest.ini and cb-gui
* One more flake8 fix
* Flake8 and tests
* More test fixes
* isort
* Make LGTM happy
* Update chia/full_node/block_store.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update chia/full_node/full_node_store.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Update chia/wallet/util/peer_request_cache.py
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Apply all suggestions from PR comments
* Revert cb-gui
* 100 back to 1000, minor tweaks
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* Remove mempool.additions
* Don't re run the program, and remove program from mempool item
* Removals only stores item ids, and stores a list
* Move pending cache down to prevent cache dos
* Separate validation from adding to pool, and remove mypy exceptions
* Fix bug with replacing
* Add to mypy
* Revert cbgui
* precommit fail
* Properly update the seen dict
* lint error
* Fix mempool bug
* Update after merge with main
* Address comments
* make recurse_jsonify() work directly on types, circumventing the dataclasses.asdict() step. This enables simpler integration of non dataclasses into the Streamable and JSON protocols
* add benchmark for Streamable.to_json_dict()
* Mypy for consensus dir (Except blockchain.py)
* Finish up consensus folder mypy
* Lint
* isort
* lint
* awaitable over coroutine
* less Any
Co-authored-by: Kyle Altendorf <sda@fstab.net>
* streamable: Merge `strictdataclass` into `Streamable` class
* tests: Test not supported streamable types
* streamable: Reorder decorators
* streamable: Simplify streamable decorator and force correct usage/syntax
* streamable: Just move some stuff around in the file
* streamable: Improve syntax error messages
* mypy: Drop `type_checking.py` and `test_type_checking.py` from exclusion
* streamable: Use cached fields instead of `__annotations__`
This is now possible after merging `__post_init__` into `Streamable`
* Introduce `DefinitionError` as `StreamableError`
* `/t` -> ` `
* benchmarks: Implement benchmarks for streamable
* benchmarks: Collect iterations per time instead of time per iterations
* benchmarks: Add standard deviation to streamable benchs
* benchmarks: Add ns/iteration to streamable benchs
* benchmarks: Move object creation out or the runs loop
* benchmarks: Use `click.Choice` for `--data` and `--mode`
* benchmarks: Its µ
* benchmarks: Improve logging
* benchmarks: Drop unused code
* benchmarks: Use `process_time` as clock
* benchmarks: Add stdev `us/iterations %` + more precission
* benchmarks: Add `--live/--no-live` option to enable live results
* optimize get_block_generator()
* add a v1 compatible get_generator() to speed up get_block_generator() with v1 databases. Add test. Add error log in case generator_from_block() fails.
* speed up test_full_block_utils
* 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>
* simplify updating of proofs (when compacting them). This also saves two database lookups before the update
* fixup
* insert or ignore duplicate blocks
* when replacing a weight proof with a compact version, we do so by height. Rather than asking for all blocks at the specific height followed by a linear search for the one with the correct header hash, we can simply lookup the correct header hash and just look up that block. This simplifies the logic by dropping the looping over blocks.
* pass in header_hash to _replace_proof() to avoid the height-to-hash lookup