Commit Graph
130 Commits
Author SHA1 Message Date
Amine KhaldiandGitHub 428e26cf5b Explore bringing back v2 plot pool keys support (#20388)
Explore bringing back v2 plot pool keys support.
2026-01-08 09:17:56 -08:00
8315f62ae6 Import check_time_locks() and CoinRecord (#19848)
* initial commit

* fix int to bool map

* another int bool map

* cast error to Err class

* cast to Err in a couple other places

* remaining couple

* ruff

* inline coinstore bool

* typing fixes

* import directly from rust and remove legacy file

* fix lingering ref to coinrecord

* another outdated import

* ruff

* typping fix

* minor simplifications

* Fix test

* fix import merge

* address comments

* undo coin_store change

---------

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
Co-authored-by: Matt <quexington@gmail.com>
2025-11-26 12:48:42 -08:00
Arvid NorbergandGitHub 9242a5cf4d remove use of pool_reward_puzzle_hash in full_node_simulator (#20294) 2025-11-25 11:59:36 -08:00
Matt HauffandGitHub 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
cac84b5e05 Simplify BlockStore (#19880)
* Simplify `BlockStore`

* Update chia/full_node/block_store.py

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>

---------

Co-authored-by: Arvid Norberg <arvid.norberg@gmail.com>
2025-07-31 20:35:54 -05:00
a125e7b690 Create CoinStoreProtocol to remove a dependencies on chia.full_node from chia.consensus (#19741)
* `CoinStoreProtocol`

* Remove `.get_all_coins`

* Apply suggestions from code review

Uses `...` instead of values.

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

* Add `.is_empty` to protocol

* Improve test fixture stuff

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-06-30 16:05:40 -07:00
Richard KissandGitHub a803d18c3b The chia.protocols module no longer depends upon chia.server. (#19636)
<!-- Merging Requirements:
- Please give your PR a title that is release-note friendly
- In order to be merged, you must add the most appropriate category
Label (Added, Changed, Fixed) to your PR
-->
<!-- Explain why this is an improvement (Does this add missing
functionality, improve performance, or reduce complexity?) -->

The modules `chia.protocols` and `chia.server` form a dependency loop.
This change at least removes the direct dependency of `chia.protocols`
on `chia.server`.

### Purpose:

<!-- Does this PR introduce a breaking change? -->

### Current Behavior:

### New Behavior:

<!-- As we aim for complete code coverage, please include details
regarding unit, and regression tests -->

### Testing Notes:

<!-- Attach any visual examples, or supporting evidence (attach any
.gif/video/console output below) -->
2025-05-29 09:24:29 -07:00
Richard KissandGitHub 44643084b0 Move augmented_chain.py and prev_transaction_block.py to chia/consensus (#19587) 2025-05-08 15:11:31 -05:00
Amine KhaldiandGitHub 6824b11ba0 CHIA-2743 Synchronous block generator creation (#19505)
Synchronous block generator creation.
2025-04-24 10:24:42 -05: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
Matt HauffandGitHub a6a5a35c7d [CHIA-1251] Add puzzle hash generation to action scopes (#19283)
* (squash) Add puzzle hash generation to action scopes

* Add comment for unused/last_index
2025-04-03 15:34:07 -05:00
Arvid NorbergandGitHub a7a81a567f cache get_unspent_lineage_info() (#19335)
* no need to pass get_unspent_lineage_info_from_puzzle_hash function into create_bundle_from_mempool(), we already have it as a member now

* cache results from get_lineage_info_for_puzzle_hash()
2025-03-04 09:05:41 -08:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35: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 482d83788d Standardize the Wallet API for generate_signed_transaction (#19209)
* Standardize the `Wallet` API for `generate_signed_transaction`

* Some test fixes

* Fix `create_tandem_xch_tx`

* Fix the other `create_tandem_xch_tx`s

* More test fixes

* More test fixes

* Bad fix from last time
2025-02-05 15:12:16 -07:00
Matt HauffandGitHub c99492cc19 [CHIA-773] Swap out Payment for CreateCoin (#19144)
* Swap out `Payment` for `CreateCoin`

* Fix mypy-exclusions

* tweak
2025-01-27 08:22:29 -07:00
Arvid NorbergandGitHub bc065b5d52 add some validation of fork_info in Blockchain.add_block() (#18981)
* add some validation of fork_info in Blockchain.add_block(). This would have caught the bug introduced in main a while ago

* simplify add_blocks_in_batches
2024-12-10 10:30:43 -07:00
Almog De PazandGitHub 35c83753aa Unconfirmed tx cache - CHIA-785 (#18422)
* unconfirmed_tx_cache

* fix types in test

* fix already included check
2024-12-10 06:38:53 -07:00
Kyle AltendorfandGitHub 29da4a3b57 put None at the end in Unions - incoming RUF036 (#18905) 2024-11-21 14:56:39 -07:00
6c90a76b56 Tighten up ruff ignore list (#18837)
* Tighten up ruff ignore list

* Okay that fix was indeed unsafe

* enable type-name-incorrect-variance

* enable literal-membership

* enable non-augmented-assignment

* enable useless-return

* enable global-variable-not-assigned

* -

* fixup

* Clean up roff.toml from annotations

* use ignore instead of explicit re-export

* use more descriptive names

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-11-12 12:19:31 -07:00
Arvid NorbergandGitHub 06b2447f6c [CHIA-1655] simplify pre_validate_blocks_multiprocessing() (#18836)
simplify pre_validate_blocks_multiprocessing() by making it pre-validated one block at a time. That's how we use it in production code anyway
2024-11-12 08:57:02 -07:00
Arvid NorbergandGitHub 6ceaec4477 [CHIA-1562] move signature validation into run_block_generator() (#18812)
* use run_block_generator() directly in block creation, to compute the final cost of the block we're creating. This lets us avoid validating the signature (to save time) and run in mempool mode

* always validate signatures in run_block_generator().

* remove PreValidationResult.validated_signature and instead defer to the inner SpendBundleConditions field
2024-11-06 10:57:03 -07:00
Earle LoweandGitHub 7dd1324420 Await self_is_synced() (#18772)
Update full_node_simulator.py
2024-11-06 08:51:38 -07:00
Arvid NorbergandGitHub 2df931bf87 [CHIA-1566] pipeline block validation in sync_from_fork_point() (#18703)
* make pre_validate_multi_processing() return futures, rather than the awaited and joined results from the thread jobs. This is crucial to allow the validaion jobs to run concurrently with the database interaction in the main thread

* Split up the add_block_batch() function into 3 parts, preparing them to be pipelined in long-sync

* pass AugmentedBlockchain into pre_validate_multiprocessing() and prevalidate_blocks(), to support the augmented blockchain to outlive a single batch

* pipeline pre-validation in sync_from_forkpoint()

* optimize the common case of _reconsider_peak(), to avoid one database lookup

* address review comments

* rename filter_blocks() -> skip_blocks(). It's is only relevant at the start of the sync, add comment and assert
2024-10-25 08:38:23 -07:00
Arvid NorbergandGitHub 8c72d22edf move add_blocks_in_batches() out of tests (#18750)
move add_blocks_in_batches() out of tests, since the node simulator depends on it
2024-10-23 08:50:08 -05:00
Almog De PazandGitHub a80d779fe6 refactor full_node add_block (#18584)
* refactor

* minor fixes

* fix_tests

* add finish sync to add_blocks_in_batches

* add_blocks_in_batches updates wallets

* test fixes

* fix condition in add_block

* add known block to cache

* restore comment

* remove init file from log dir

* fix failed reorg test

* revert known block info change

* assert height in cat test

* wait for wallet height in nft test

* assert sync all height for all wallets

* test_cat_creation assert height

* rename vars

* assert height in process states
2024-10-22 12:14:18 -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 e7241ebfe0 simplify passing around difficulty, sub slot iterators and prev_ses_block (#18660)
* combine current sub slot iterations, current difficulty and previous ses block into ChainState, to make it easier to pass around and update

* address review comments

* address review comments. rename ChainState -> ValidationState. add more comments
2024-10-07 11:09:15 -07:00
1e8c999c09 multiprocess_validation refactor (#18541)
* slightly simplify call to pre_validate_blocks_multiprocessing. batch size is always 4, check_filter is always True. Remove the member function wrapper around it in Blockchain, to prepare for being able to pass wrapped blockchains into it

* address review comments

* Apply suggestions from code review (addendum).

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-09-23 09:48:11 -07:00
Almog De PazandGitHub b6faed828f clean add block and prevalidation (#18569)
* add_block ssi not optional

* pass ses block to prevalidaiton

* fix tests

* covrage

* move parma
2024-09-11 09:41:32 -07:00
Matt HauffandGitHub 126a8a2d83 [CHIA-1115] Optimize create_coins_with_amounts a bit (#18470)
* Optimize `create_coins_with_amounts` a bit

* Just generate new for each conflicting amount
2024-08-15 09:07:49 -07:00
723636b471 [CHIA-1092] Port test_cat_wallet.py to WalletTestFramework (#18439)
* temp

* Port `test_cat_creation`

* Port `test_cat_creation_unique_lineage_store`

* Delete `...reuse_address` test

* Port `test_get_wallet_for_asset_id`

* Port `test_cat_doesnt_see_eve`

* Port `test_cat_max_amount_send`

* Port `test_cat_hint`

* Port `test_cat_change_detection`

* Name test amount and fees in test_cat_creation.

* Use set_remainder for first test

* Match the ValueError we're expecting in test_cat_max_amount_send.

* Comment.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-08-14 09:25:01 -07:00
Matt HauffandGitHub 8bc332f95e [CHIA-1037] Add TXConfig to action scopes (#18406)
* Add TXConfig to action scopes

* Fix DID test

* Fix CR-CAT method

* Fix NFT offer test
2024-08-07 11:27:13 -07:00
Matt HauffandGitHub 055588914e [CHIA-714] Add usage of action scope throughout wallet codebase (#18128)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add action_scope: WalletActionScope to all tx endpoints

* Add usage of action scope throughout wallet codebase

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Fix miscellaneous test

* Fix miscellaneous test

* Fix miscellaneous test

* pylint

* Add auto claim test coverage

* Take advantage of extra_spends

* Fix tests

* test fixes

* pylint
2024-07-17 12:17:16 -07:00
Matt HauffandGitHub 4ffb6dfa6f [CHIA-713] Add action_scope: WalletActionScope to all tx endpoints (#18127)
* Add the concept of 'action scopes'

* Add `WalletActionScope`

* Fix CATWallet pending_change calculation

* Add action_scope: WalletActionScope to all tx endpoints

* Add the concept of 'action scopes'

* pylint and test coverage

* add try/finally

* add try/except

* Undo giving a variable a name

* Fix CRCAT test

* Fix trade tests

* Fix cat test

* Fix miscellaneous test

* Fix miscellaneous test

* Fix miscellaneous test

* Add auto claim test coverage
2024-07-16 11:06:01 -07:00
Arvid NorbergandGitHub b4290a2f2f [CHIA-786] remove the original block compression (#18209)
remove the original form block compression, now that the hard fork has activated and we serialize CLVM in a more efficient way
2024-07-09 12:16:51 -07:00
Arvid NorbergandGitHub 605e3b8982 [CHIA-615] make BLSCache a proper class (#18053)
* make BlsCache a proper class, rather than a global dict with helper functions

* make the BLS cache a member of the FullNode, rather than a global variable

* add test for BAD_AGGREGATE_SIGNATURE when using the BLS cache
2024-05-31 13:57:20 -05:00
Matt HauffandGitHub aefe7fdf28 Observer Mode (#17792)
* Observer Mode

* Address comments by @altendky

* Change RPC default and fix test coverage

* Add test coverage for rpc marshaller

* Fix @marshal util to return proper transactions
2024-05-07 13:39:25 -07:00
835c1f8924 Port tests/wallet/test_wallet.py to WalletTestFramework (#17687)
* Port test_wallet_coinbase

* Port test_wallet_make_transaction

* Port test_wallet_reuse_address

* Port test_wallet_clawback_claim_auto

* Port test_wallet_clawback_clawback

* Port test_wallet_clawback_sent_self

* Port test_wallet_clawback_claim_manual

* Port test_wallet_clawback_reorg

* Rebase fixes and flakiness improvements

* Port test_get_clawback_coins

* Port test_clawback_resync

* Port test_wallet_coinbase_reorg

* Port test_wallet_make_transaction_hop

* Port test_wallet_make_transaction_with_fee

* Port test_wallet_make_transaction_with_memo

* Port test_wallet_create_hit_max_send_amount

* Port test_wallet_prevent_fee_theft

* Port test_wallet_tx_reorg

* Port test_address_sliding_window

* Port test_sign_message

* Port test_wallet_transaction_options

* Remove unneeded check_balances call.

* Introduce tx_amount and use it across test_wallet_clawback_claim_auto.

* Reapply b79ecd2 (got lost in the recent merge).

* Minor improvements to test_wallet_clawback_clawback:

* Introduce tx_amount and test_fees and use them to clarify test conditions.
* Remove no longer needed json.dumps(resp) call.
* Remove unneeded dict() call on a {} constructed dictionary.

* Remove accidental change (addendum to bebc87f).

* More tx_amount and test_fees.

* Remove no longer needed json import.

* Remove unneeded dict() calls on {} constructed dictionaries.

* Introduce tx_amount2 in test_clawback_resync and clarify state transitions.

* Clarify state transitions in test_wallet_make_transaction_hop.

* Simplify transaction_has_failed.

* Just some consistency.

* Remove unneeded check_balances calls.

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
2024-03-20 09:08:00 -07:00
Earle LoweandGitHub 48e4039e58 Update black to 24.1.1 and update source as needed (#17499)
* Update source to black 24 spec

* update black to 24.1.1

* update pylint to ignore multiple-statements

* update test file

* black updates

* format updates

* Update test_network_protocol_files.py

* Update test_network_protocol_files.py
2024-03-13 11:08:19 -07:00
58cf78de04 Wallet Block Tools (#17580)
* Remove consensus logic in part from wallet tests

* Fix simulation test

* Test coverage

* test coverage

* Improve handling of block_list_input in WalletBlockTools's get_consecutive_blocks.

* Update tests/wallet/conftest.py

Co-authored-by: Arvid Norberg <arvid@libtorrent.org>

* Address comments by @arvidn

---------

Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
Co-authored-by: Arvid Norberg <arvid@libtorrent.org>
2024-03-12 13:50:21 -07:00
Matt HauffandGitHub 536a96241d Various test flakiness fixes (#17650) 2024-03-05 10:53:48 -08:00
Matt HauffandGitHub c6f1a57c56 Unify transaction pushing (#17458)
* Don't autopush transactions by default anywhere

* Remove ignore_max_send_amount

* Use TXConfig instead of pending_transactions for coin exclusion in spend_clawback_coins

* Unify transaction pushing into a single method

* Address offline comments by @emlowe

* Rework max send amount to be based on coin quantity rather than amount

* Inadvertent changes

* Test fixes

* Inadvertent change

* Bad import?

* Inadvertent changes?

* readd missing test
2024-02-05 10:34:47 -08:00
Amine KhaldiandGitHub a6827c2e92 Singleton fast forward (#16919)
Initial iteration of singleton fast forward.
2024-01-26 13:20:42 -08:00
Kyle AltendorfandGitHub 5484024ef3 move time_out_assert() family back to tests (#16846) 2023-11-16 11:20:18 -06:00
Matt HauffandGitHub bf4cdf22a5 Port VC lifecycle tests to WalletTestFramework (#16292) 2023-11-03 08:30:59 -05:00
Matt HauffandGitHub 0d1318932c Enhancements to WalletTestFramework (#16291) 2023-10-05 16:16:38 -05:00
Matt HauffandGitHub d29acde27a Make the standard wallet return List[TransactionRecord] (#16360) 2023-09-19 15:28:20 -05:00