Commit Graph
67 Commits
Author SHA1 Message Date
Arvid NorbergandGitHub f15d0047a2 Move spend_sim.py into tests (#18743)
* move spend_sim into tests

* use run_block_generator2() instead of get_name_puzzle_conditions() in CostLogger. It's only used to compute the cost of a spend bundle, in tests.
2024-10-22 12:08:40 -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
Amine KhaldiandGitHub 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 KhaldiandGitHub 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 NorbergandGitHub 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
Matt HauffandGitHub a6fca99e6f Remove chia.clvm.singleton (#18163)
Remove chia.clvm.singleton
2024-06-17 11:58:20 -05:00
RigidityandGitHub 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
Kyle AltendorfandGitHub 2eb3633bcb json.dumps(indent=2) (#17714) 2024-03-18 10:26:13 -07:00
Sebastjan TrepcaandGitHub b5146462eb Hint support for SpendSim (#17490)
* added support for hints

* test + mypy fix

* black fix and typo

* test coverage
2024-02-15 13:16:27 -08:00
Amine KhaldiandGitHub a07058cad1 Fix a typo in primary key creation in SpendSim's block_data (#17533)
Fix a typo in primary key creation in SpendSim's block_data.
2024-02-10 13:17:51 -08:00
Amine KhaldiandGitHub a6827c2e92 Singleton fast forward (#16919)
Initial iteration of singleton fast forward.
2024-01-26 13:20:42 -08:00
Amine KhaldiandGitHub c58baa6850 Explicitly check that mempool manager's peak (optional) is not None in SimClient's push_tx (#17404)
Explicitly check that mempool_manager's peak (optional) is not None in SimClient's push_tx.
2024-01-25 16:45:34 -08:00
Arvid NorbergandGitHub 57a59abde0 remove redundant cost field in NPCResults (#17167) 2024-01-02 10:45:23 -07: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 NorbergandGitHub 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
Kyle AltendorfandGitHub 4f55ffb1eb add SpendSim.managed() (#16889) 2023-12-05 13:31:13 -06:00
Amine KhaldiandGitHub 3c91881324 Fix propagating spent coins IDs to the mempool on successful generator bundle creation in SpendSim's farm_block (#16918) 2023-11-22 09:08:19 -06:00
Arvid NorbergandGitHub c0deb18405 remove special case logic for soft-fork 3 activation (#16819) 2023-11-21 17:06:17 -06:00
Amine KhaldiandGitHub 02bda86e8e Fix SimBlockRecord construction w.r.t. prev_transaction_block_hash (#16882) 2023-11-21 13:04:48 -06:00
Arvid NorbergandGitHub ca85e485e6 transition away from __bytes__ conversion for fixed-size integers (#16701) 2023-10-31 16:57:17 -05:00
Arvid NorbergandGitHub fe8ae58650 Get block spends (#16451) 2023-10-10 10:14:21 -05:00
Arvid NorbergandGitHub 1d8d476056 drop support for database schema v1 (#15895)
* don't run tests with database schema v1

* remove support for database schema v1 from BlockStore

* remove support for database schema v1 from CoinStore

* remove support for database schema v1 from HintStore

* remove support for v1 BlockStore schema from blockchain reorg logic

* remove support for database schema v1 from BlockHeightMap

* run block store tests both with and without the cache

* add test with empty blockchain for BlockHeightMap

* fix typo
2023-08-03 14:18:33 -05:00
Arvid NorbergandGitHub f0cb47baef remove softfork2 logic (#15793) 2023-08-01 11:28:16 -05:00
Arvid NorbergandGitHub 1e534d0281 pass consensus constants into get_name_puzzle_conditions(). (#15736)
pass consensus constants into get_name_puzzle_conditions(). This is required for tests that use alternate constants, such as fork activation heights
2023-07-11 09:52:49 -05:00
Arvid NorbergandGitHub 1d06adc9a6 forward flags in get_puzzle_and_solution_for_coin() (#15708)
support backrefs in the clvm serialization passed in- and out of get_puzzle_solution()
2023-07-07 18:08:15 -05:00
dustinfaceandGitHub 9e9c75912f full_node: Refactor get_puzzle_and_solution_for_coin (#15323) 2023-05-17 17:34:33 -05:00
Amine KhaldiandGitHub cf44101bc6 Use "item" instead of "spend" in mempool's items functions names (#15103)
Use "item" instead of "spend" in mempool's items functions names.

With this we're consistent with mempool's internal items map (_items) and _row_to_item as well as the return types.
2023-04-24 12:45:37 -06:00
e5b94d34a0 Chialisp file extensions (#14996)
* Rename chialisp file extensions

* Add pre-commit check for .clvm files

* Delete sha256tree files

* remove hash files in favor of central dictionary

* Add check for missing files like hex and hash entries

* Enhance clsp pre-commit check

* Actually check hash matches

* Update tools/manage_clvm.py

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

* Update tools/manage_clvm.py

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

* Fix Windows file writing

* Fix setup.py package_data fields

* Load hash dict at runtime

* Move away from exception pattern

* Bad equality check

* Minor fixes

* remove trailing whitespace fix

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2023-04-18 11:27:17 -05:00
Amine KhaldiandGitHub f278d9ccf8 Simplify create_bundle_from_mempool's handling of removals (#15056)
Simplify create_bundle_from_mempool's handling of removals.

They're already taken care of by aggregation.
2023-04-17 16:34:22 -05:00
Amine KhaldiandGitHub 8afba0814d Remove no longer needed cost_per_byte cases (#14850)
Remove no longer needed cost_per_byte cases.
2023-03-24 18:29:50 -05:00
Arvid NorbergandGitHub 8dbfc4840a enable soft-fork2 conditions (incl. ASSERT_BEFORE) (#14733)
* enable soft-fork2

* add blockchain (consensus) test for time-lock conditions (non-ephemeral spend)

* introduce new soft-fork rule to compare ASSERT_SECONDS_* conditions against the previous transaction block's timestamp (to be consistent with ASSERT_HEIGHT_* conditions)

* bump chia_rs. This updates the mempool rules to disallow relative height- and time conditions on ephemeral coin spends

* implement assert_before in mempool_check_time_locks. Extend ephemeral coin test in blockchain with assert_before conditions

* implement support for assert_before conditions in compute_assert_height()

* support assert-before in mempool

* add timelock rule

* address review comments
2023-03-23 11:30:10 -05:00
Arvid NorbergandGitHub e195d268fb simplify the mempool filter to only pass in the spend_bundle name (#14665)
simplify the mempool filter to only pass in the spend_bundle name. That's the only thing we use
2023-02-27 12:57:32 -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
Amine KhaldiandGitHub 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 NorbergandGitHub ed8cee2b4b Mempool private implementation (#14593)
* fix test asserts to not require the same object, just the same value

* make Mempool's implementation private and give it a public interface

* fixup test that used to count fee *levels* but now count transactions
2023-02-22 12:26:04 -06:00
Matt HauffandGitHub 59e389968e Add cost logging to CLVM tests as fixture (#14444) 2023-02-10 15:13:45 -06:00
Matt HauffandGitHub 97230ca3b0 Add a way to import a SpendSim and SimClient as a contextmanager (#14434) 2023-01-31 19:22:06 -06:00
Amine KhaldiandGitHub 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
dustinfaceandGitHub 42f6a883ae isort: Remove the remaining exceptions and sort the related files (#14124) 2022-12-13 17:10:55 -06:00
Adam KellyandGitHub 30feeaa45e Avoid calling spend_bundle.name() twice (#14109) 2022-12-13 00:32:55 -06:00
Amine KhaldiandGitHub 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 KellyandGitHub 5cbc415589 Preserve correct MempoolItem block height when rebuilding mempool (#13951) 2022-11-21 16:28:48 -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
Kyle AltendorfandGitHub 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
Kyle AltendorfandGitHub 8ed283a821 make DBWrapper2 handle more connection setup (#13510)
* make DBWrapper2 handle more connection setup

* fixup

* make create_connection() both await'able and async with'able

* recover logging
2022-09-26 11:17:20 -05:00
Arvid NorbergandGitHub 98adae20f2 use get_puzzle_and_solution_for_coin() from chia_rs (#13315) 2022-09-07 02:41:40 -05:00
Mariano SorgenteandGitHub 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 NorbergandGitHub 163552b8d9 Implement generator_for_single_coin() in python instead of clvm and apply quex' optimization to only computing the puzzle hash if the parent and amount matches (#13237) 2022-08-30 16:30:34 -05:00
Arvid NorbergandGitHub 1fddb7aef1 add new_transaction() to DBWrapper2 which creates a nested transaction, and make write_db() just add writes to the existing transaction (#12275) 2022-07-15 21:07:43 -05:00
Kyle AltendorfandGitHub 749162d9fe hint chia.clvm.spend_sim (#11819)
* hint chia.clvm.spend_sim

* adjust comments

* undo

* Created typo corrected to create
2022-06-29 04:34:41 -05:00