Commit Graph
81 Commits
Author SHA1 Message Date
pengbanban 3d916bd25d chore: fix some comments (#18485)
Signed-off-by: pengbanban <pengbanban@aliyun.com>
2024-09-13 10:52:32 -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
Amine Khaldi 4d225bed35 CHIA-1291 Switch mempool TX prevalidation to the Rust version (#18557)
Switch mempool TX prevalidation to the Rust version.
2024-09-05 22:17:23 +08:00
Amine Khaldi 8129b41473 CHIA-210 Introduce WalletSpendBundle and use it across code related to wallets (#18264)
Introduce WalletSpendBundle and use it across code related to wallets.
2024-08-30 21:36:26 +08:00
Arvid Norberg 6dceabe2d3 [CHIA-691] simplify MempoolItem (#18143)
make MempoolItem and InternalMempoolItem contain the SpendBundleConditions directly, rather than the NPCResult. A mempool item is guaranteed to be valid, so the error state of NPCResult will never be engaged anyway.
2024-07-08 09:44:49 -07:00
Kyle Altendorf 3061cd83d7 remove some pylint ignores (#18140) 2024-06-18 14:24:30 -05:00
Matt Hauff 3637bd33c6 Delete chia.util.misc (#18170)
* Move VersionedBlob to chia.util.streamable

* Move format_bytes to chia.cmds.cmds_util

* Move format_minutes to chia.cmds.cmds_util

* Move prompt_yes_no to chia.cmds.cmds_util

* Move get_list_or_len to from chia.plot_sync.receiver

* Move validate_directory_writable to chia.cmds.cmds_util

* Move *termination_signals to test_services

* Move UInt*Range to chia.util.streamable

* Create chia.util.batches

* Create chia.server.signal_handlers

* Create chia._tests.util.split_managers

* Move ValuedEvent to chia.types.transaction_queue_entry

* Move available_logical_cores to chia.util.cpu

* Move caller_file_and_line to chia._tests.util.misc

* Move satisfies_hint to chia._tests.wallet.test_singleton_lifecycle_fast
2024-06-18 08:27:17 -05:00
Rigidity de75f058dd CHIA-194: CHIP-0026 Mempool Updates (#17980)
* Initial draft of mempool updates [skip ci]

* More implementation work, but capability issue [skip ci]

* Temp (will probably revert)

* Get first test passing

* Setup spent coin tests

* Add unrelated test data to make tests better

* Refactor test

* Finish testing

* Update tests

* Include removal reason and block inclusion tests

* Remove unnecessary dict

* Add missing message to test

* Fix after rebase

* Broadcast support from node for mempool updates

* Remove redundant code

* Use new_block

* Filter and early return suggestions

* Reword comments on PeakPostProcessingResult

* Improve mempool fn name and doc comment

* Bump wallet protocol version

* Add ratelimits

* Add tests for querying mempool items

* Asserts and more tests

* Add peers for spend bundle tests
2024-06-06 10:59:44 +01:00
a58cc334a4 clvm mypie (#16898)
* clvm mypie

* update exclusions

* wip

* some

* undo for now

* more

* more

* drop the program usage in datalayer tests

* ignore tree hash errors

* ignore enough in _sexp_replace...

* again

* almost

* Fix test_singleton.py

* dl fixup

* did fixup

* touchup

* nft fixup

* fixup tests

* Revert "fixup tests"

This reverts commit 5df1a705ec.

* or this i guess

* blah

* Fix get_owner_did

* tidy

* blah

* `.as_atom()`

* `.as_int()`

* Update chia/wallet/nft_wallet/nft_puzzles.py

* `rrrff`

* stop using `CastableType`

* undo stuff around using `CastableType`

* `announcement_assertions: List[Program]`

* Update chia/types/blockchain_format/program.py

* more

* clvm==0.9.10

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
Co-authored-by: Matt <quexington@gmail.com>
2024-05-22 12:28:07 -05:00
Kyle Altendorf a89222a428 move tests (#17209)
* prep

* verify source and installed tests match

* move

* remove move script
2024-03-14 10:19:20 -07:00
Arvid Norberg c932324ec0 Bump chia rs 0.5.2 (#17505)
* bump chia_rs to 0.5.2

* specify the correct fixed-width integer types for rust bindings
2024-02-08 09:04:26 -08:00
Amine Khaldi a6827c2e92 Singleton fast forward (#16919)
Initial iteration of singleton fast forward.
2024-01-26 13:20:42 -08:00
Kyle Altendorf 384c14615a move benchmarks/util.py to tests/util/benchmarks.py (#17251) 2024-01-10 09:30:00 -06:00
Amine Khaldi c431c6675c Merge commit '507899ff19b0d0bbe14bc7ed8a192f5ad0bc7aa2' into checkpoint/main_from_release_2.1.4_507899ff19b0d0bbe14bc7ed8a192f5ad0bc7aa2 2023-12-23 00:24:41 +01:00
Arvid Norberg 507899ff19 Mempool multifetch (#17139)
* update type annotation for CoinStore.get_coin_records to support both List and Set

* update the mempool to fetch multiple coin records per query

* optimize the slow-path of updating the mempool by fetching all coin records up-front, in a single sql query
2023-12-22 16:29:39 -06:00
Arvid Norberg ace61bf774 add benchmark for loading test chains (#16775) 2023-11-27 10:20:57 -06:00
Kyle Altendorf 3caa0754cc add DBWrapper2.managed() (#16880) 2023-11-22 13:48:01 -06:00
Arvid NorbergandKyle Altendorf 30fb9f3d00 avoid redundant list->set and set->list conversions (#16855)
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-11-22 09:02:33 -06:00
Arvid Norberg 64d6fb56a6 simplify the interface to mempool_manager.new_peak() (#16787)
simplify the interface to mempool_manager.new_peak() to just take the spent coin IDs rather than full NPCResult objects
2023-11-07 10:40:16 -08: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
Kyle Altendorf 90c1441af0 apply pyupgrade --py38-plus --keep-runtime-typing (#14646) 2023-10-24 12:01:23 -05:00
Arvid Norberg 2d7cd8428b remove CHIP-13 and SOFT_FORK4 (#16320) 2023-09-13 14:51:12 -05:00
Arvid Norberg efcbc0ea4a fixup block store and coin store benchmarks (#15946) 2023-08-08 02:25:59 -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
Arvid Norberg 849166361d bump chia_rs dependency to 0.2.9 (#15760) 2023-07-13 23:19:46 -05:00
Florin Chirica 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
Amine Khaldi 7e50f5e0b0 Merge commit '03943a0e51413f1f7fbd1f9ff852fe7259c0658e' into checkpoint/main_from_release_1.8.2_03943a0e51413f1f7fbd1f9ff852fe7259c0658e 2023-06-27 20:18:36 +01: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
dustinface 5e0b8bb1ec util: Drop chia.util.chunks and use chia.util.to_batches instead (#15418) 2023-06-09 16:35:31 -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
Arvid Norberg 2b62f168f6 extend mempool-benchmark (#15038) 2023-04-17 15:44:06 -05:00
Kyle Altendorf b839dfa0c1 update black to 23.3.0 (#14537)
* unpin black

* Update setup.py

* Update .pre-commit-config.yaml

* black

* black

* 23.3.0

* cleanup
2023-04-04 12:50:58 -05:00
Arvid Norberg 39d5283f1a add benchmark that tests the mempool over a long time (#14728)
add benchmark that tests the mempool over a long time, churning transactions
2023-03-20 13:16:21 -05:00
Arvid NorbergandAdam Kelly 4ed31c50d5 Bump chia rs 0.2.4 (#14758)
* 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>
2023-03-07 15:29:54 -06:00
Kyle Altendorf 2d44e510b6 hint_benchmarks (#14738) 2023-03-06 11:50:44 -06:00
Arvid Norberg 9e8dae67b2 Bump chia_rs to 0.2.3. and ASSERT_MY_BIRTH_* (#14720)
* 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
2023-03-03 15:12:37 -06: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
Amine Khaldi b019fe5962 Introduce BlockRecordProtocol as a subset of BlockRecord that the mempool manager uses for peak (#14628)
* 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.
2023-02-23 01:04:47 -06:00
Arvid Norberg 1a722be39b extend and improve the mempool benchmark (#14635) 2023-02-22 12:12:08 -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
Amine Khaldi cd4874c584 create_bundle_from_mempool() doesn't need to be async (#14114)
create_bundle_from_mempool() doesn't need to be async.
2022-12-13 17:11:12 -06:00
Adam Kelly 30feeaa45e Avoid calling spend_bundle.name() twice (#14109) 2022-12-13 00:32:55 -06:00
Amine Khaldi 0cfd19f38d Simplify the mempool manager instantiation by not making it depend on a coin store (#14015)
* Explore simplifying the mempool manager instantiation.

* Address reviews.
2022-11-29 12:18:09 -06:00
Adam Kelly 5cbc415589 Preserve correct MempoolItem block height when rebuilding mempool (#13951) 2022-11-21 16:28:48 -06:00
Adam Kelly 73e9d15cf7 Fee estimation. (#13645) 2022-10-18 09:12:22 -05: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
Mariano SorgenteandKyle Altendorf 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
Mariano Sorgente 8ef4c980b3 Ms.mempool simplify (#13314)
* 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
2022-09-06 12:32:03 -05:00
Arvid Norberg f295d8899b add benchmark for MempoolManager.add_spendbundle (#12780)
* add benchmark for MempoolManager.add_spendbundle

* log warning if pre_validate_spendbundle takes too long
2022-08-09 18:29:00 -05:00
Arvid Norberg 5ae87189c4 Rust coin (#11807)
* use rust implementation of Coin class, from chia_rs

* bump chia_rs dependency
2022-06-13 07:21:04 -05:00