Skip to content

[CHIA-3205] unify test constants on the ones used by BlockTools #19768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented Jun 26, 2025

Purpose:

Any test that uses the test blockchains must match test constants with BlockTools, since it generates those test chains.
It minimizes the risk of diversion by using a single set of test constants.

Here are the BlockTools's constants: https://github.com/Chia-Network/chia-blockchain/blob/main/chia/simulator/block_tools.py#L129

Note

BlockTools is actually considered "production" code, since it's part of the simulator, which is a supported developer tool.

This adds another dependency from the tests to production code, which is fine.

This alters DIFFICULTY_STARTING from 2^9 -> 2^10 for the tests.

Current Behavior:

BlockTools has its own test_constants and all tests have their own.

New Behavior:

BlockTools and test share the same test constants.

@arvidn arvidn added Changed Required label for PR that categorizes merge commit message as "Changed" for changelog Tests Changes to tests labels Jun 26, 2025
@arvidn arvidn changed the title unify test constants on the ones used by BlockTools [CHIA-3205] unify test constants on the ones used by BlockTools Jun 26, 2025
@arvidn arvidn marked this pull request as ready for review June 26, 2025 19:23
@arvidn arvidn requested a review from a team as a code owner June 26, 2025 19:23
@arvidn arvidn requested a review from almogdepaz June 26, 2025 19:23
Copy link

Pull Request Test Coverage Report for Build 15909222920

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 48 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-0.03%) to 91.317%

Files with Coverage Reduction New Missed Lines %
chia/daemon/client.py 1 74.72%
chia/plotters/plotters.py 1 90.94%
chia/rpc/rpc_server.py 1 88.54%
chia/consensus/blockchain.py 2 94.48%
chia/server/node_discovery.py 2 80.32%
chia/timelord/timelord.py 2 80.79%
chia/full_node/full_node.py 4 87.96%
chia/full_node/weight_proof.py 4 90.6%
chia/plotters/madmax.py 6 44.58%
chia/_tests/core/util/test_lockfile.py 25 77.31%
Totals Coverage Status
Change from base Build 15908298283: -0.03%
Covered Lines: 101760
Relevant Lines: 111312

💛 - Coveralls

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 Tests Changes to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant