Commit Graph
21 Commits
Author SHA1 Message Date
Matt Hauff 40db4635a8 [LABS-245] Enable PEP604 Ruff rules (#20269)
* Enable PEP604 Ruff rules

* Fix harcoded signature in test

* Hack CLVMStreamable test with note to fast follow
2025-11-18 12:34:00 -08:00
Kyle Altendorf fcd20ce543 more chia_rs directly (#19520)
* more `chia_rs` directly

* maybe

* undo, kinda
2025-04-21 14:05:05 -05:00
Kyle Altendorf 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 Altendorf d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
Kyle Altendorf 9075a50aeb use chia_rs directly for weight proof (#19315) 2025-02-26 09:27:27 -08:00
Kyle Altendorf 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
Almog De Paz 59583e75ef Assert height to hash in contains block (#19136)
* add assertions

* use_height_if_available

* use try_block_record

* fix recursion

* handle none

* remove assert

* remove assert

* use try in wallet blockchain

* fix height o and height to hash in augmented

* get_correct_block_for_fork

* remove debug code

* use try_block_record

* check main chain againt undelying blockchain

* pass augmented in tests

* lint

* revert changes to wallet blockchain

* remove redundant comment

* lint

* remove debug message

* revert bad merge

* make height mandatory

* make height mandatory

* use try_block_record

* fix unfinished test

* remove from hh, test contains block

* fix test

* fix mock and cache
2025-02-11 07:18:52 -07:00
Kyle Altendorf 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 Norberg ef4f526dfc AugmentedBlockchain (#18535)
* remove dead code

* introduce AugmentedBlockchain, implementing the BlocksProtocol and can include 'additional blocks', useful for validating batches of blocks where we need to pretend the previous blocks in the batch are valid while validating the later blocks

* simplify pre_validate_blocks_multiprocessing by using AugmentedBlockchain

* address review comments
2024-09-11 08:04:18 -05:00
Arvid Norberg 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
Arvid Norberg d5c36e38ac BlockchainInterface cleanups (#18522)
* use ... in BlockInfo protocol

* move prev_block_hash() from BlockchainInterface into BlockRecordsProtocol to transition find_fork_point_in_chain() and lookup_fork_chain() to use the more narrow protocol to lookup the chain

* the WalletBlockchain doesn't need to implement the full BlockchainInterface, but just BlockRecordsProtocol

* remove unused GeneratorBlockCacheInterface and BlockDict

* add unit test for BlockCache
2024-08-27 23:58:19 +08:00
Arvid Norberg 700a67344b BlockchainInterface as a protocol (#18486)
* turn BlockchainInterface into a proper Protocol, to allow mypy to check it

* split out a subset of BlockchainInterface into BlockRecordsInterface

* separate BlockCache into the (simple) production use case and the (complex) test use case of mocking a blockchain object
2024-08-23 01:02:43 +08:00
Arvid Norberg 038f5e8fb7 Fix deep reorgs (#16594) 2023-11-15 10:51:04 -06:00
Kyle Altendorf 095b9c337e adjustments for new mypy (#13859)
* adjustments for new mypy

* assert something
2022-11-07 17:38:40 -06: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
olivernyc c699a2a20e Fix misleading argument name (#12180) 2022-07-05 18:49:27 -05:00
Mariano SorgenteandKyle Altendorf d1e445fac2 Ms.mypy consensus (#11403)
* 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>
2022-05-12 15:21:47 -07:00
89f15f591c Merge standalone wallet into main (#9793)
* wallet changes from pac

* cat changes

* pool tests

* pooling tests passing

* offers

* lint

* mempool_mode

* black

* linting

* workflow files

* flake8

* more cleanup

* renamed

* remove obsolete test, don't cast announcement

* memos are not only bytes32

* trade renames

* fix rpcs, block_record

* wallet rpc, recompile settlement clvm

* key derivation

* clvm tests

* lgtm issues and wallet peers

* stash

* rename

* mypy linting

* flake8

* bad initializer

* flaky tests

* Make CAT wallets only create on verified hints (#9651)

* fix clvm tests

* return to log lvl warn

* check puzzle unhardened

* public key, not bytes. api caching change

* precommit changes

* remove unused import

* mypy ci file, tests

* ensure balance before creating a tx

* Remove CAT logic from full node test (#9741)

* Add confirmations and sleeps for wallet (#9742)

* use pool executor

* rever merge mistakes/cleanup

* Fix trade test flakiness (#9751)

* remove precommit

* older version of black

* lint only in super linter

* Make announcements in RPC be objects instead of bytes (#9752)

* Make announcements in RPC be objects instead of bytes

* Lint

* misc hint'ish cleanup (#9753)

* misc hint'ish cleanup

* unremove some ci bits

* Use main cached_bls.py

* Fix bad merge in main_pac (#9774)

* Fix bad merge at 71da0487b9

* Remove unused ignores

* more unused ignores

* Fix bad merge at 3b143e7050

* One more byte32.from_hexstr

* Remove obsolete test

* remove commented out

* remove duplicate payment object

* remove long sync

* remove unused test, noise

* memos type

* bytes32

* make it clear it's a single state at a time

* copy over asset ids from pacr

* file endl linter

* Update chia/server/ws_connection.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

Co-authored-by: Matt Hauff <quexington@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2022-01-13 12:08:32 -08:00
Almog De Paz c4c14939a5 Sync faster (#7665)
* better concurrency for sync_from_fork_point

* dedup code in wallet

* revert

* lint

* lint

* logs

* lint

* lint

* error handling, async bug fix

* lint

* break fetch if bath failed coroutine

* remove outdated comment

* consolidate duplicate code

* consolidate duplicate code

* notify wallet after each batch

* typo

* add try/catch/finally

* typing, check stale peer

* comment on worker shutdown
2021-08-18 18:26:38 -07:00
Almog De Paz 3277058372 optional no_tx_filter (#4560)
* add no_tx option to get_header_blocks_in_range

* add type

* get_header_block_by_height no_tx_filter

* double negetive

* add param name

* param name

* change filter to false

* test header hash

* lint
2021-05-13 10:29:53 -07:00
Richard Kiss f2b577dda1 git mv src chia 2021-04-04 21:41:39 -07:00