402 Commits
Author SHA1 Message Date
b8beca685c Remove dead code with no remaining callers (#21277)
Deletes five functions/classes with zero references (verified repo-wide
including tests) and the test-only FullNodeStore.remove_unfinished_block,
whose own TODO asked for its removal. The one test caller now exercises
the production cleanup method clear_unfinished_blocks_below instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-24 08:36:32 -05:00
Arvid NorbergandGitHub 433424f4ab [CHIA-4356] New full block format and cost model (#21249) 2026-08-19 07:51:29 -07:00
Almog De PazandGitHub efc13fa8ca Block validation fast fail (#21213) 2026-08-12 08:46:12 -07:00
Almog De PazandGitHub 0bfc2252bf [CHIA-3815] activate predictable V2 plot filter (#21091) 2026-08-03 14:00:47 -07:00
Arvid NorbergandGitHub 621265b9c4 bump chia-rs to 0.46.0 (#21117)
* bump chia_rs to 0.46.0

* support new FullBlock and UnfinishedBlock format

* remove v2 plot filter constants. the v2 plot filter is being replaced
2026-07-29 13:25:58 -05:00
Arvid NorbergandGitHub fe15e9ee6f [CHIA-4326] enable redundant expressions check in mypy (#21143)
* fix type annotation in configure.py and init.py

* enable mypy redundant-expr and remove redundant expressions
2026-07-29 09:37:24 -05:00
6d5b52062b Slim CoinStoreProtocol down to the methods consensus uses (#21168)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:40:33 -07:00
b966c5c96b Add BlockStoreProtocol; drop consensus dependency on chia.full_node (#21169)
* Add BlockStoreProtocol; drop consensus dependency on chia.full_node

Co-authored-by: Cursor <cursoragent@cursor.com>

* Assert isinstance directly on bc.block_store

Review feedback: drop the intermediate block_store assignment; mypy
narrows the attribute expression after the isinstance assert.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:40:06 -07:00
Almog De PazandGitHub 013b739af6 [CHIA-3814] wire V2 filter challenge through signage points and validation (#21084) 2026-07-27 10:32:09 -07:00
359497ac2b Remove unused BlockHeightMapProtocol (#21167)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 07:39:15 -07:00
Amine Khaldi 67ddbb8578 Merge commit '715953bc5a20a7bac4a2462368d513cc9ef7f5aa' into checkpoint/main_from_release_2.7.2_715953bc5a20a7bac4a2462368d513cc9ef7f5aa 2026-07-10 14:42:21 +01:00
715953bc5a Checkpoint Merge (#21106)
Co-authored-by: Almog De Paz <almogdepaz@gmail.com>
Co-authored-by: Amine Khaldi <amine.khaldi@reactos.org>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Zachary Brown <z.brown@chia.net>
2026-07-09 12:32:45 -05:00
Almog De PazandGitHub 4033069f60 [CHIA-4230] refactor pre_sp_tx_block (#20909)
* fix_pre_sp_tx

* lint

* refactor

* comment

* comment

* lint

* update test_cache ref
2026-06-29 09:59:32 -05:00
Zachary BrownandGitHub af81194343 Set testneta MIN_PLOT_SIZE_V1 to 18 for initial sync (#21003)
Set testneta MIN_PLOT_SIZE_V1 to 18 for sync from height 0

Testneta shares early chain history with testnet11 where smaller v1 plots
are valid. New installs and existing nodes without a config override were
using the mainnet default of 32 and failing INVALID_POSPACE during initial
sync.
2026-06-11 09:53:01 +01:00
Arvid NorbergandGitHub d7afd16321 Bump chia rs 0.44.0 (#20923)
* bump chia_rs

* updates to use and report any error message reported back from chia_rs

* bump test cache

* pass testnet to the proof-of-space functions

* review comments
2026-05-27 12:50:10 -05:00
Arvid NorbergandGitHub 783fa71de4 [CHIA-4225] support treating old consensus constant names as the new ones (#20928)
support treating old consensus constant names as the new ones
2026-05-22 10:29:17 -05:00
Amine Khaldi 60324086f9 Merge commit '7080538f7d944b9a3e4cd12bcd9b6bb61f46018b' into checkpoint/main_from_release_2.7.1_7080538f7d944b9a3e4cd12bcd9b6bb61f46018b 2026-05-21 17:58:24 +01:00
Almog De PazandGitHub b2af3c7a8c [CHIA-3647] Wp v2 (#20340)
* add mmr manager

* sub epoch summary challenge tree

* validation/block creation

* Timelord/old weight proofs

* move merkle ro util

* handle tests

* move HF check out of SE creation

* remove type check skip

* missing test param

* fix off by one and SE bounderies

* better handle ses bounderies

* use compute_merkle_set_root, revert MerkleTree mv

* pr comments

* add test, minor fixes

* mmr rolleback no checkpoints, some pr comments

* documentation, pr fixes

* calculate mmr to block with fork

* aggregate blocks from hardfork

* simplify get_fork_height

* fix mmr root to TL

* mmr tests

* handle genesis by hash

* fail if we cant calculate correct challenge

* tests, edge cases

* pr comments, input validation, tests

* pr_comments

* [CHIA-3647] Wp v2 pos2 (#20483)

* augmented with gap handeling
* Bumped BLOCKS_AND_PLOTS_VERSION to 0.45.14

* rename to compute, explicit arg names

* pass corrent slot numbers

* asserts, tests

* mmr_tests

* lint

* remove unused

* remove unused, add blocks/plots to config

* pr fixes

* fix fork descision for send to TL

* add_mmr_hash_error

* add_assert

* optimize_post_hard_fork2

* update_chains_fix_constructor
2026-05-19 19:45:38 -05:00
7080538f7d 2.7.1 Checkpoint Merge (#20887)
* Checkpoint Merge

Co-authored-by: Almog De Paz <almogdepaz@gmail.com>
Co-authored-by: Zachary Brown <z.brown@chia.net>

* Add a timeout during node shutdown

* Revert "Add a timeout during node shutdown"

This reverts commit ab57da71fb.

* Replace test_add_transaction_seen_before_validation with simpler version

The previous version of this test was the sole cause of a CI hang on the
2.7.1-checkpoint branch (confirmed by bisection). It used the heavyweight
wallet_nodes fixture, a real peer connection, and a backgrounded task driving
add_transaction, all of which left orphaned async work during fixture teardown
under pytest-xdist on CI runners.

The replacement keeps the same regression coverage for SEC-111 (tx must be
marked in-flight before pre_validate_spendbundle) but does so with:
- the lightweight one_node_one_block fixture
- pytest.MonkeyPatch.context() instead of manual attribute swap
- two asyncio.Events to deterministically gate validation
- asyncio.wait_for on both the gate and the final task to fail fast

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Almog De Paz <almogdepaz@gmail.com>
Co-authored-by: Zachary Brown <z.brown@chia.net>
Co-authored-by: Earle Lowe <e.lowe@chia.net>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 18:53:31 -05:00
Arvid NorbergandGitHub 7a745dc1a3 Bump chia_rs to 0.42.1 (#20846)
* bump chia_rs to 0.42.1

* update calls to check_time_locks
2026-05-01 09:41:02 -05:00
Amine KhaldiandGitHub 216331028d CHIA-4170 CHIA-4168 Improve proof of space unfinished block handling (#20787)
Improve proof of space unfinished block handling.
2026-04-29 10:18:37 -05:00
Arvid NorbergandGitHub 38bb6d358d PriorityThreadPoolExecutor (#20742)
* add PriorityThreadPoolExecutor, use a dedicated thread for high priority work, to minimize latency

* use PriorityThreadPoolExecutor to validate UnfinishedBlocks and FullBlocks

* make MempoolManager use the new priority thread pool

* make FullNodeRpcApi use the new FullNode thread pool

* make FullNodeAPI use the new thread pool. This is mostly used for servicing the Wallet protocol. trusted wallets have higher priority (lower nice) and untrusted wallets have the lowest priority

* add instrumentation to PrioritizedThreadPoolExecutor
2026-04-15 09:30:04 -05:00
Arvid NorbergandGitHub e13a230207 Bump chia_rs to 0.42.0 (#20749)
* bump chia_rs to 0.42.0

* implement cost-per-spend after 3.0 hard fork

* update difficulty

* disable test_empty_sub_slots_epoch for HARD_FORK_3_0 as it seems we don't get any overflow blocks

* cache solve_proof() and get_qualities_for_challenge() results for tests
2026-04-15 09:29:17 -05:00
Arvid NorbergandGitHub b5c5fc5d47 move NPCResults into tests (#20723)
move NPCResults into tests, and remove its use in production code. We have SpendBundleConditions which captures the non-error state of NPCResult
2026-03-26 15:26:53 -05:00
Almog De PazandGitHub 7d3abb5bd6 read_only_augmented_blockchain (#20656)
* read_only_augmented

* test refactor

* Gap handling on read only (#20665)

init_augmented_close_gap
2026-03-24 16:14:12 -05:00
Arvid NorbergandGitHub 25c3f0dcab Update chia_rs dependency. (#20700)
* Update chia_rs dependency. This version introduces condition costs in the hard
fork. So the tests that compute block costs are being updated to match these
cost rules. It also introduces a spend limit in the 2.7.0 soft fork, and the
mempool is updated to not produce blocks exceeding this limit.

* ensure both MAX_SPENDS_PER_BLOCK checks are covered by the test
2026-03-20 11:01:52 -05:00
Arvid NorbergandGitHub c0c64d7e04 [CHIA-3963 CHIA-3955] early check of proof of space in a few places (#20685)
early check of proof of space in a few places
2026-03-19 11:46:20 -05:00
Arvid NorbergandGitHub e10d9aed56 bump chia_rs dependency to 0.40.0 (#20666) 2026-03-17 10:43:37 -05:00
dfc750b159 PoS2 integration [CHIA-3649][CHIA-3657][CHIA-3732][CHIA-3666] (#20414)
* bump chia_rs and make appropriate adjustments. The v2 PoS format has changed. There is no quality proof scan filter
bump test-cache blocks and test-plots

* add support for creating v2 plots in block_tools

* separate test chains into v1-plots, v1- and v2-mixed plots, and v2-only plots (after phase-out)

* (temporarily) disable running some tests with the 3.0 hard fork, until we fix them

* fix test_blockchain.py for the 3.0 hard fork chains

* Now that we have more test chains to run tests over (for PoS2), we'll need more time to run all the tests, on CI.

* remove comment about validating v2 plot cache entries when loading them. We can revisit this if it becomes a problem

* review

* fix tests

* fix long reorg

* readd todo

* remove usless todo

* fix comment

* long_reorg

* assert case exercised

* todo

* bump blocks-and-plots-version

* update lockfile

* fix overflow handling in test helper

* fix

* address cursor comments

* skip a few select tests on CI, to speed it up

---------

Co-authored-by: almogdepaz <almogdepaz@gmail.com>
2026-02-18 17:42:45 -06:00
Amine Khaldi 72f0cd6d09 Merge commit '3a43a87ece9ed482980d03382b65aa2ebe4dfbcc' into checkpoint/main_from_release_2.6.0_3a43a87ece9ed482980d03382b65aa2ebe4dfbcc 2026-02-16 19:29:46 +01:00
Amine Khaldi b175bdf4ee Merge commit '8f8d27aca479cb1456899acf7a4127aa06d4763f' into checkpoint/main_from_release_2.6.0_8f8d27aca479cb1456899acf7a4127aa06d4763f 2026-02-09 11:50:50 +01:00
Arvid NorbergandGitHub 3a43a87ece push out testnet 11 activation of soft-fork 8 (#20473) 2026-02-04 16:01:08 -08:00
Arvid NorbergandGitHub 8f8d27aca4 push out testnet11 soft fork activation height by 8 days (40000 blocks) (#20445) 2026-01-28 09:52:56 -08:00
Amine Khaldi 301fa2c143 Merge commit '4e364606227ab2eead3d0fc7a0c8c8030715326c' into checkpoint/main_from_release_2.6.0_4e364606227ab2eead3d0fc7a0c8c8030715326c 2026-01-23 11:14:40 +01:00
Almog De PazandGitHub 4e36460622 get_flags, fix pre_sp_tx_block, test CHIA-3861 (#20400)
* get_flags, fix pre_sp_tx_block, test

* genesis case for get_flags

* block height for flags below fork
2026-01-15 09:37:48 -08:00
Amine Khaldi e6017089cd Merge commit 'b7b3638fcc281a82296c1ae1df82e7765bd93384' into checkpoint/main_from_release_2.5.8_b7b3638fcc281a82296c1ae1df82e7765bd93384 2026-01-15 16:05:31 +01:00
Arvid NorbergandGitHub b7b3638fcc bump chia_rs to 0.35.1 (#20393) 2026-01-09 12:07:51 -08:00
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
Almog De PazandGitHub 6b8202cd6a Augmented usage fix (#20361)
* pass augmented into test_utils

* add invariant

* remove redundant check

* check prev is in underlying

* fix check for genesis

* use try_block_recoed

* tests

* use assertion error
2026-01-05 09:36:21 -08:00
Arvid NorbergandGitHub 64b2c8d034 update expected_plot_size() to match the latest proof of space format (#20350) 2025-12-15 09:45:49 -08:00
Arvid NorbergandGitHub 426590feaf bump chia_rs and update uses of RewardChainBlock and SubEpochSummary (#20304) 2025-12-03 10:27:55 -08:00
Arvid NorbergandGitHub dcd296975d relax PoS validation in weight proofs (#20298)
* relax proof-of-space validation in weight proofs. make it height agnostic

* fix typo in block_tools logging. hoist calculations out of the block_tools PoS loop

* make the plot-filter schedule safe in proof-of-space validation as part of weight proofs

* review comments
2025-12-02 10:15:28 -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 b7723252df v2 plots only support pool contract puzzle hash (#20145) 2025-11-21 09:45:56 -08:00
Arvid NorbergandGitHub 70b182e9c7 [CHIA-3805] reduce use of pool_reward_puzzle_hash feature of BlockTools (#20277)
* reduce use of pool_reward_puzzle_hash feature of BlockTools, since it's not supported by v2 plots

* the BlockTools feature to ask for a specific pool puzzle hash are not supported by v2 proofs. v2 plots only have pool contract puzzle hash
2025-11-21 09:44:53 -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
Arvid NorbergandGitHub 38d2d9f2d0 make sure to pass in the correct previous transaction block height (#20237)
* make sure to pass in the correct previous transaction block height to get_flags_for_height_and_constants()

* review comments
2025-11-14 16:29:51 -06:00
Almog De PazandGitHub ab53414e2a fix tx block refrences in blocktools (#20239)
* fix tx block refrences in blocktools

* fix patch in test

* use pre_sp_block_height fix load_block_list

* rename

* fix params

* remove redundant param
2025-11-12 11:45:44 -07:00
Arvid NorbergandGitHub 5664516dda Bump chia rs 0.34.0 (#20226)
bump chia_rs to 0.34.0
2025-11-10 17:02:10 -07:00
Almog De PazandGitHub 54e915b723 prev_tx_before_sp (#20235)
* prev_tx_before_sp

* update wp to avoid crash

* fix genesis test

* comment

* comments, var names

* check to throw correct error
2025-11-10 11:14:04 -07:00