Commit Graph
41 Commits
Author SHA1 Message Date
Arvid NorbergandGitHub 426590feaf bump chia_rs and update uses of RewardChainBlock and SubEpochSummary (#20304) 2025-12-03 10:27:55 -08:00
Kyle AltendorfandGitHub 8bba60158d use now allowed randbytes and other helpers (#19838) 2025-07-21 08:55:55 -07:00
Kyle AltendorfandGitHub fcd20ce543 more chia_rs directly (#19520)
* more `chia_rs` directly

* maybe

* undo, kinda
2025-04-21 14:05:05 -05:00
Kyle AltendorfandGitHub 1911044e97 use chia_rs directly for more types (#19475)
* use chia_rs directly for more types

* more more

* undo submodule change...
2025-04-18 11:45:44 -05:00
Kyle AltendorfandGitHub c57dea6512 use chia_rs directly for reward chain block (#19336) 2025-03-04 09:04:38 -08:00
Kyle AltendorfandGitHub dd01af2c2b use chia_rs directly for pool target (#19332) 2025-03-03 09:34:02 -08:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
Kyle AltendorfandGitHub fb6b78ef07 use chia_rs directly for foliage (#19308) 2025-02-25 11:33:25 -08:00
Kyle AltendorfandGitHub e446d6b726 use chia_rs directly for sized ints (#19303)
* use chia_rs directly for sized ints

* Update data_layer_rpc_api.py
2025-02-24 14:33:09 -08: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
Kyle AltendorfandGitHub 3b6f547d45 bytes zeros (#18475)
* `ZERO_32`

* `bytes(\d+)\(\[0\] \* \1\)`

* `bytes(\d+)\(b"\\(x00|0)" \* \1\)`

* `bytes(\d+)\(b"0" \* \1\)`

* Revert "`bytes(\d+)\(b"0" \* \1\)`"

This reverts commit 2d629dcb0a.
2024-10-22 12:07:07 -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 1947d99e4f Refactor get_block_generator() (#18531)
* refactor get_block_generator() to prepare for easier composing of a layered blockchain class

* make get_block_generator() part of the interface to the blockchain rather than an independent, free function passed in the validation. This keeps the view of the blockchain more focused to a single class.

* add test for get_block_generator

* add unit test for Blockchain.lookup_block_generators()

* address review comments

* address review comments
2024-09-07 01:49:51 +08: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
Kyle AltendorfandGitHub 384c14615a move benchmarks/util.py to tests/util/benchmarks.py (#17251) 2024-01-10 09:30:00 -06:00
Kyle AltendorfandGitHub 3caa0754cc add DBWrapper2.managed() (#16880) 2023-11-22 13:48:01 -06:00
Arvid NorbergandGitHub 2d7cd8428b remove CHIP-13 and SOFT_FORK4 (#16320) 2023-09-13 14:51:12 -05:00
Arvid NorbergandGitHub efcbc0ea4a fixup block store and coin store benchmarks (#15946) 2023-08-08 02:25:59 -05:00
Florin ChiricaandGitHub e84bdb0b30 Add fields to BlockRecord. (#15695)
* Add fields to BlockRecord.

* Lint.

* Checkpoint refactor.

* Lint.

* Optimize get_block_records_by_hash.

* Lint.

* Coverage.

* Optimize v1 get_block_record.

* Trailing space.

* Remove async with await.

* Default 400.

* Address review comment.
2023-07-12 12:47:02 -05:00
Kyle AltendorfandGitHub 2d44e510b6 hint_benchmarks (#14738) 2023-03-06 11:50:44 -06: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
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 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
87a3e93cc4 Ms.mypy enable (#13320)
* 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>
2022-09-08 12:57:15 -05:00
Kyle AltendorfandGitHub 34eed9a3bc more isort (#11401) 2022-05-05 08:17:38 -07:00
Arvid NorbergandGitHub a100dda37e new DBWrapper supporting concurrent readers (#10166)
* new DBWrapper supporting concurrent readers

* adress review comments

* fixup default database version, when file doesn't exist

* remove unused argument
2022-03-28 11:58:00 -07:00
Arvid NorbergandGitHub 656d7d94d8 fix type annotations for FullBlock.header_hash and FullBlock.prev_header_hash (#10909) 2022-03-27 12:20:30 -07:00
dustinfaceandGitHub cdf48f7b29 benchmarks: Implement benchmarks for streamable (#10388)
* 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
2022-02-24 10:19:57 -08:00
Arvid NorbergandGitHub 34159d3529 optimize get_block_generator() (#10104)
* 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
2022-02-17 07:32:29 -08:00
Arvid NorbergandGitHub 0464265734 use monotonic clock in benchmarks (#10242) 2022-02-15 14:42:51 -08:00
Kyle AltendorfandGitHub 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 NorbergandGitHub 7fb7a916ee Simplify FullNode._replace_proof (#10049)
* 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
2022-02-01 22:31:47 -08:00
Mariano SorgenteandGitHub 6e37b74742 Change compact block (#10011)
* Change compact block

* Also recent blocks

* Add bill's rollback code

* Fix v2 issue

* Fix v2 issue blockchain

* Fix tests
2022-01-28 19:19:10 -08:00
Arvid NorbergandGitHub f1dcd36c2a In main chain (#9550)
* add in_main_chain column to full_blocks table

* add test for block_store in_main_chain

* test block_store invariant
2021-12-17 14:37:45 -08:00
Arvid NorbergandGitHub 35cab7cea2 Block store benchmark (#9520)
* include SubEpochSummary objects

* make header_hashes authentic. include benchmarks of lookups on block_store as well
2021-12-09 15:38:59 -08:00
Arvid NorbergandGitHub 546011381d fix mypy issues in benchmark/block_store.py (#9457) 2021-12-05 09:36:52 -08:00
Arvid NorbergandGitHub 70d31a8c68 V2 database framework (#9442)
* fix block_store benchmark linting issues

* basic support for database versioning

* update benchmark to run v1 and v2
2021-12-03 13:52:10 -08:00
Kyle AltendorfandGitHub 8291f0221a Make the sized bytes types hint compatible (#9369)
* Rework sized bytes for type hinting compatibility

* add a bunch of type: ignores

* this will be handled elsewhere

* noqa E501 instead of changing code

* normalize comment plurality

* @classmethod

* Revert "@classmethod"

This reverts commit 95db80e339.

* add ignore in benchmarks

* just E501 again...

* add some new type: ignores
2021-12-02 09:43:39 -08:00
Arvid NorbergandGitHub a75b639adf fix typo in block_store benchmark (and missing clvm generator field) (#9433) 2021-12-01 11:31:31 -08:00
Arvid NorbergandGitHub fdaadc1ff9 add benchmark for block_store (#9425)
* add benchmark for block_store

* use random instead of secrets
2021-11-30 15:56:11 -08:00