Skip to content

Conversation

@arvidn
Copy link
Contributor

@arvidn arvidn commented Nov 21, 2025

Purpose:

This is a follow-up to #20277
Reducing more use of the pool_reward_puzzle_hash feature in BlockTools. This isn't supported for v2 plots.

The current test picks the first reward coin, which happens to be the pool reward. Changing this coin to the farmer reward has some consequences. First of all, we need to use find_reward_coin() to pick the coin with the puzzle hash we expect, instead of just picking the first one.

The cost of spending the pool reward is 1 byte higher than the farmer reward. This is because the pool reward is 1'750'000'000, whereas the farmer reward is only 25'000'000.
It requires one byte less to be encoded. The cost of bytes in the generator is 12000 per byte. There are two tests that check the cost of the puzzle, whose cost is now 12000 less.

Current Behavior:

The initial_blocks() function redirects both farmer rewards and pool rewards into the test wallet.

New Behavior:

The initial_blocks() function only redirects farmer rewards into the test wallet. Thus making the test compatible with v2 plots.

@arvidn arvidn added Changed Required label for PR that categorizes merge commit message as "Changed" for changelog Tests Changes to tests labels Nov 21, 2025
@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 19575112224

Details

  • 93 of 96 (96.88%) changed or added relevant lines in 12 files are covered.
  • 21 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-0.001%) to 90.776%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/_tests/core/full_node/test_full_node.py 17 18 94.44%
chia/consensus/block_creation.py 1 2 50.0%
chia/simulator/block_tools.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
chia/introducer/introducer.py 1 81.9%
chia/_tests/core/util/test_lockfile.py 1 90.78%
chia/timelord/timelord_api.py 1 93.02%
chia/wallet/wallet_node.py 1 86.83%
chia/data_layer/data_layer.py 2 85.73%
chia/farmer/farmer_api.py 2 95.04%
chia/server/node_discovery.py 2 81.22%
chia/full_node/full_node.py 3 87.01%
chia/timelord/timelord.py 3 71.62%
chia/introducer/introducer_api.py 5 81.48%
Totals Coverage Status
Change from base Build 19573333039: -0.001%
Covered Lines: 102424
Relevant Lines: 112660

💛 - Coveralls

@arvidn arvidn force-pushed the test-conditions-pool-reward branch from 61a855a to 63cd893 Compare November 21, 2025 18:26
…d, for its tests. This prepares this test to work with v2 plots, since they don't support redirecting the pool reward
@arvidn arvidn force-pushed the test-conditions-pool-reward branch from 63cd893 to 11a2cde Compare November 23, 2025 10:06
@arvidn arvidn marked this pull request as ready for review November 23, 2025 10:50
@arvidn arvidn requested a review from a team as a code owner November 23, 2025 10:50
@arvidn arvidn requested a review from almogdepaz November 23, 2025 10:51
Copy link
Contributor

@wjblanke wjblanke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aok

@arvidn arvidn added the ready_to_merge Submitter and reviewers think this is ready label Nov 25, 2025
@TheLastCicada TheLastCicada merged commit 7b3a773 into main Nov 25, 2025
689 of 779 checks passed
@TheLastCicada TheLastCicada deleted the test-conditions-pool-reward branch November 25, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changed Required label for PR that categorizes merge commit message as "Changed" for changelog ready_to_merge Submitter and reviewers think this is ready Tests Changes to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants