From 58a1b82e0771ec7fd46f1c8004359aefc8f0c24f Mon Sep 17 00:00:00 2001 From: arvidn Date: Wed, 22 Oct 2025 10:26:32 +0200 Subject: [PATCH] fix issue in BlockTools where transaction_generator was (incorrectly) used as a proxy for whether the block was a TX block or not. Also improve error messages for plot sizes as well as the minimum plot size for v2 plots on testnet (which also affects our simulations in CI) --- chia/_tests/core/custom_types/test_proof_of_space.py | 8 ++++---- chia/simulator/block_tools.py | 4 ++-- chia/types/blockchain_format/proof_of_space.py | 8 ++++---- chia/util/initial-config.yaml | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/chia/_tests/core/custom_types/test_proof_of_space.py b/chia/_tests/core/custom_types/test_proof_of_space.py index 7bddd83d3696..dbef94aee35d 100644 --- a/chia/_tests/core/custom_types/test_proof_of_space.py +++ b/chia/_tests/core/custom_types/test_proof_of_space.py @@ -66,7 +66,7 @@ def b32(key: str) -> bytes32: plot_size=PlotSize.make_v1(31), plot_public_key=G1Element(), pool_public_key=G1Element(), - expected_error="Plot size is lower than the minimum", + expected_error="Plot size (31) is lower than the minimum (32)", ), ProofOfSpaceCase( id="Higher than maximum plot size", @@ -74,7 +74,7 @@ def b32(key: str) -> bytes32: plot_size=PlotSize.make_v1(51), plot_public_key=G1Element(), pool_public_key=G1Element(), - expected_error="Plot size is higher than the maximum", + expected_error="Plot size (51) is higher than the maximum (50)", ), ProofOfSpaceCase( id="Different challenge", @@ -115,7 +115,7 @@ def b32(key: str) -> bytes32: plot_size=PlotSize.make_v2(0), plot_public_key=G1Element(), pool_public_key=G1Element(), - expected_error="Plot size is lower than the minimum", + expected_error="Plot size (0) is lower than the minimum (28)", ), ProofOfSpaceCase( id="v2 plot size 34", @@ -123,7 +123,7 @@ def b32(key: str) -> bytes32: plot_size=PlotSize.make_v2(34), plot_public_key=G1Element(), pool_public_key=G1Element(), - expected_error="Plot size is higher than the maximum", + expected_error="Plot size (34) is higher than the maximum (32)", ), ProofOfSpaceCase( id="Not passing the plot filter v2", diff --git a/chia/simulator/block_tools.py b/chia/simulator/block_tools.py index 77b8ed9f0811..6de49430f842 100644 --- a/chia/simulator/block_tools.py +++ b/chia/simulator/block_tools.py @@ -980,7 +980,7 @@ def get_consecutive_blocks( available_coins.remove(rem) available_coins.extend(new_gen.additions) - if full_block.transactions_generator is not None: + if full_block.is_transaction_block(): tx_block_heights.append(full_block.height) prev_tx_height = full_block.height @@ -1274,7 +1274,7 @@ def get_consecutive_blocks( available_coins.remove(rem) available_coins.extend(new_gen.additions) - if full_block.transactions_generator is not None: + if full_block.is_transaction_block(): tx_block_heights.append(full_block.height) prev_tx_height = full_block.height diff --git a/chia/types/blockchain_format/proof_of_space.py b/chia/types/blockchain_format/proof_of_space.py index cb1f63128963..d2cb5aab2600 100644 --- a/chia/types/blockchain_format/proof_of_space.py +++ b/chia/types/blockchain_format/proof_of_space.py @@ -76,20 +76,20 @@ def check_plot_size(constants: ConsensusConstants, ps: PlotSize) -> bool: if size_v1 is not None: assert ps.size_v2 is None if size_v1 < constants.MIN_PLOT_SIZE_V1: - log.error("Plot size is lower than the minimum") + log.error(f"Plot size ({size_v1}) is lower than the minimum ({constants.MIN_PLOT_SIZE_V1})") return False if size_v1 > constants.MAX_PLOT_SIZE_V1: - log.error("Plot size is higher than the maximum") + log.error(f"Plot size ({size_v1}) is higher than the maximum ({constants.MAX_PLOT_SIZE_V1})") return False return True size_v2 = ps.size_v2 assert size_v2 is not None if size_v2 < constants.MIN_PLOT_SIZE_V2: - log.error("Plot size is lower than the minimum") + log.error(f"Plot size ({size_v2}) is lower than the minimum ({constants.MIN_PLOT_SIZE_V2})") return False if size_v2 > constants.MAX_PLOT_SIZE_V2: - log.error("Plot size is higher than the maximum") + log.error(f"Plot size ({size_v2}) is higher than the maximum ({constants.MAX_PLOT_SIZE_V2})") return False if (size_v2 & 1) == 1: log.error("Plot size is odd") diff --git a/chia/util/initial-config.yaml b/chia/util/initial-config.yaml index cccce94a5b06..050c1eb2b348 100644 --- a/chia/util/initial-config.yaml +++ b/chia/util/initial-config.yaml @@ -20,7 +20,7 @@ network_overrides: &network_overrides GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af" testnet0: MIN_PLOT_SIZE_V1: 18 - MIN_PLOT_SIZE_V2: 20 + MIN_PLOT_SIZE_V2: 18 GENESIS_CHALLENGE: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc" GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af" @@ -34,7 +34,7 @@ network_overrides: &network_overrides GENESIS_PRE_FARM_POOL_PUZZLE_HASH: 3ef7c233fc0785f3c0cae5992c1d35e7c955ca37a423571c1607ba392a9d12f7 MEMPOOL_BLOCK_BUFFER: 10 MIN_PLOT_SIZE_V1: 18 - MIN_PLOT_SIZE_V2: 20 + MIN_PLOT_SIZE_V2: 18 NETWORK_TYPE: 1 SUB_SLOT_ITERS_STARTING: 67108864 # Forks activated from the beginning on this network @@ -52,7 +52,7 @@ network_overrides: &network_overrides GENESIS_PRE_FARM_POOL_PUZZLE_HASH: 08296fc227decd043aee855741444538e4cc9a31772c4d1a9e6242d1e777e42a MEMPOOL_BLOCK_BUFFER: 10 MIN_PLOT_SIZE_V1: 18 - MIN_PLOT_SIZE_V2: 20 + MIN_PLOT_SIZE_V2: 18 NETWORK_TYPE: 1 SUB_SLOT_ITERS_STARTING: 67108864 HARD_FORK_HEIGHT: 3693395