diff --git a/chia/_tests/core/consensus/test_pot_iterations.py b/chia/_tests/core/consensus/test_pot_iterations.py index 6dcf1ecea066..d115c07d1d4d 100644 --- a/chia/_tests/core/consensus/test_pot_iterations.py +++ b/chia/_tests/core/consensus/test_pot_iterations.py @@ -114,7 +114,7 @@ def test_win_percentage(self): quality = std_hash(slot_index.to_bytes(4, "big") + k.to_bytes(1, "big") + bytes(farmer_index)) # TODO: todo_v2_plots required_iters = calculate_iterations_quality( - constants, quality, PlotSize.make_v1(k), difficulty, sp_hash, uint64(100000000), uint32(0) + constants, quality, PlotSize.make_v1(k), difficulty, sp_hash ) if required_iters < sp_interval_iters: wins[k] += 1 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 ed8520f36051..1223bcb9ef0b 100644 --- a/chia/_tests/core/custom_types/test_proof_of_space.py +++ b/chia/_tests/core/custom_types/test_proof_of_space.py @@ -5,7 +5,7 @@ from typing import Optional import pytest -from chia_rs import G1Element, PlotSize, ProofOfSpace +from chia_rs import G1Element, ProofOfSpace from chia_rs.sized_bytes import bytes32, bytes48 from chia_rs.sized_ints import uint8, uint32 @@ -156,6 +156,7 @@ def test_verify_and_get_quality_string(caplog: pytest.LogCaptureFixture, case: P assert len(caplog.text) == 0 if case.expected_error is None else case.expected_error in caplog.text +@pytest.mark.skip("v2 plots") @datacases( ProofOfSpaceCase( id="v2 plot are not implemented", @@ -242,12 +243,9 @@ def test_can_create_proof(self, prefix_bits: int, seeded_random: random.Random) @pytest.mark.parametrize("height,expected", [(0, 3), (5496000, 2), (10542000, 1), (15592000, 0), (20643000, 0)]) -@pytest.mark.parametrize("plot_size", [PlotSize.make_v1(32), PlotSize.make_v2(28)]) -def test_calculate_prefix_bits_clamp_zero(height: uint32, expected: int, plot_size: PlotSize) -> None: +def test_calculate_prefix_bits_clamp_zero(height: uint32, expected: int) -> None: constants = DEFAULT_CONSTANTS.replace(NUMBER_ZERO_BITS_PLOT_FILTER_V1=uint8(3)) - if plot_size.size_v2 is not None: - expected = constants.NUMBER_ZERO_BITS_PLOT_FILTER_V2 - assert calculate_prefix_bits(constants, height, plot_size) == expected + assert calculate_prefix_bits(constants, height) == expected @pytest.mark.parametrize( @@ -264,9 +262,6 @@ def test_calculate_prefix_bits_clamp_zero(height: uint32, expected: int, plot_si (20643000, 5), ], ) -@pytest.mark.parametrize("plot_size", [PlotSize.make_v1(32), PlotSize.make_v2(28)]) -def test_calculate_prefix_bits_default(height: uint32, expected: int, plot_size: PlotSize) -> None: +def test_calculate_prefix_bits_default(height: uint32, expected: int) -> None: constants = DEFAULT_CONSTANTS - if plot_size.size_v2 is not None: - expected = DEFAULT_CONSTANTS.NUMBER_ZERO_BITS_PLOT_FILTER_V2 - assert calculate_prefix_bits(constants, height, plot_size) == expected + assert calculate_prefix_bits(constants, height) == expected diff --git a/chia/_tests/core/farmer/test_farmer_api.py b/chia/_tests/core/farmer/test_farmer_api.py index dc2c9b50b00c..9842b3511a2c 100644 --- a/chia/_tests/core/farmer/test_farmer_api.py +++ b/chia/_tests/core/farmer/test_farmer_api.py @@ -46,7 +46,7 @@ async def test_farmer_ignores_concurrent_duplicate_signage_points( assert ProtocolMessageTypes(response).name == "harvester_handshake" sp = farmer_protocol.NewSignagePoint( - std_hash(b"1"), std_hash(b"2"), std_hash(b"3"), uint64(1), uint64(1000000), uint8(2), uint32(1), uint32(0) + std_hash(b"1"), std_hash(b"2"), std_hash(b"3"), uint64(1), uint64(1000000), uint8(2), uint32(1) ) await gather( farmer_api.new_signage_point(sp), diff --git a/chia/_tests/core/test_farmer_harvester_rpc.py b/chia/_tests/core/test_farmer_harvester_rpc.py index 0052e5471eeb..7c3ee66b27e5 100644 --- a/chia/_tests/core/test_farmer_harvester_rpc.py +++ b/chia/_tests/core/test_farmer_harvester_rpc.py @@ -131,7 +131,7 @@ async def have_signage_points() -> bool: return len(await farmer_rpc_client.get_signage_points()) > 0 sp = farmer_protocol.NewSignagePoint( - std_hash(b"1"), std_hash(b"2"), std_hash(b"3"), uint64(1), uint64(1000000), uint8(2), uint32(1), uint32(0) + std_hash(b"1"), std_hash(b"2"), std_hash(b"3"), uint64(1), uint64(1000000), uint8(2), uint32(1) ) await farmer_api.new_signage_point(sp) @@ -241,7 +241,7 @@ async def test_farmer_get_pool_state( pool_dict[key].insert(0, before_24h) sp = farmer_protocol.NewSignagePoint( - std_hash(b"1"), std_hash(b"2"), std_hash(b"3"), uint64(1), uint64(1000000), uint8(2), uint32(1), uint32(0) + std_hash(b"1"), std_hash(b"2"), std_hash(b"3"), uint64(1), uint64(1000000), uint8(2), uint32(1) ) await farmer_api.new_signage_point(sp) client_pool_state = await farmer_rpc_client.get_pool_state() diff --git a/chia/_tests/farmer_harvester/test_farmer.py b/chia/_tests/farmer_harvester/test_farmer.py index fa5a0f125fda..f76484e131e4 100644 --- a/chia/_tests/farmer_harvester/test_farmer.py +++ b/chia/_tests/farmer_harvester/test_farmer.py @@ -571,7 +571,6 @@ async def test_farmer_new_proof_of_space_for_pool_stats( sub_slot_iters=case.sub_slot_iters, signage_point_index=case.signage_point_index, peak_height=uint32(1), - last_tx_height=uint32(0), ) pos = ProofOfSpace( challenge=case.plot_challenge, @@ -712,7 +711,6 @@ def create_valid_pos(farmer: Farmer) -> tuple[farmer_protocol.NewSignagePoint, P sub_slot_iters=case.sub_slot_iters, signage_point_index=case.signage_point_index, peak_height=uint32(1), - last_tx_height=uint32(0), ) pos = ProofOfSpace( challenge=case.plot_challenge, diff --git a/chia/_tests/farmer_harvester/test_farmer_harvester.py b/chia/_tests/farmer_harvester/test_farmer_harvester.py index bd3a4b0edbb4..d56ea60be339 100644 --- a/chia/_tests/farmer_harvester/test_farmer_harvester.py +++ b/chia/_tests/farmer_harvester/test_farmer_harvester.py @@ -228,7 +228,6 @@ def create_sp(index: int, challenge_hash: bytes32) -> tuple[uint64, farmer_proto uint64(1000000), uint8(index), uint32(1), - uint32(0), ) return time, sp diff --git a/chia/_tests/farmer_harvester/test_filter_prefix_bits.py b/chia/_tests/farmer_harvester/test_filter_prefix_bits.py index 1d965c2603a5..b159809e69cb 100644 --- a/chia/_tests/farmer_harvester/test_filter_prefix_bits.py +++ b/chia/_tests/farmer_harvester/test_filter_prefix_bits.py @@ -121,7 +121,6 @@ def state_has_changed() -> bool: sub_slot_iters=uint64(1000000), signage_point_index=uint8(2), peak_height=peak_height, - last_tx_height=uint32(0), ) await farmer_api.new_signage_point(sp) await time_out_assert(5, state_has_changed, True) diff --git a/chia/_tests/farmer_harvester/test_third_party_harvesters.py b/chia/_tests/farmer_harvester/test_third_party_harvesters.py index 690ce85e7aa2..2e3eeb5f74ae 100644 --- a/chia/_tests/farmer_harvester/test_third_party_harvesters.py +++ b/chia/_tests/farmer_harvester/test_third_party_harvesters.py @@ -364,7 +364,6 @@ def prepare_sp_and_pos_for_fee_test( sub_slot_iters=uint64(0), signage_point_index=uint8(0), peak_height=uint32(1), - last_tx_height=uint32(0), ) pos = harvester_protocol.NewProofOfSpace( diff --git a/chia/_tests/util/network_protocol_data.py b/chia/_tests/util/network_protocol_data.py index 7e0ca731697c..796256cd5c18 100644 --- a/chia/_tests/util/network_protocol_data.py +++ b/chia/_tests/util/network_protocol_data.py @@ -63,7 +63,6 @@ uint64(8265724497259558930), uint8(194), uint32(1), - uint32(0), ) proof_of_space = ProofOfSpace( @@ -795,8 +794,7 @@ uint8(148), bytes32(bytes.fromhex("b78c9fca155e9742df835cbe84bb7e518bee70d78b6be6e39996c0a02e0cfe4c")), [pool_difficulty], - uint32(0), - uint32(0), + uint8(9), ) new_proof_of_space = harvester_protocol.NewProofOfSpace( diff --git a/chia/_tests/util/protocol_messages_bytes-v1.0 b/chia/_tests/util/protocol_messages_bytes-v1.0 index 0d9160933489..30d2eacdab5d 100644 Binary files a/chia/_tests/util/protocol_messages_bytes-v1.0 and b/chia/_tests/util/protocol_messages_bytes-v1.0 differ diff --git a/chia/_tests/util/protocol_messages_json.py b/chia/_tests/util/protocol_messages_json.py index c89601f7c90e..dbc48e209290 100644 --- a/chia/_tests/util/protocol_messages_json.py +++ b/chia/_tests/util/protocol_messages_json.py @@ -12,7 +12,6 @@ "sub_slot_iters": 8265724497259558930, "signage_point_index": 194, "peak_height": 1, - "last_tx_height": 0, "sp_source_data": None, } @@ -2160,8 +2159,7 @@ "pool_contract_puzzle_hash": "0xc9423123ea65e6923e973b95531b4874570dae942cb757a2daec4a6971753886", } ], - "peak_height": 0, - "last_tx_height": 0, + "filter_prefix_bits": 9, } new_proof_of_space_json: dict[str, Any] = { diff --git a/chia/_tests/weight_proof/test_weight_proof.py b/chia/_tests/weight_proof/test_weight_proof.py index 45ef2406aa21..0fb103e26048 100644 --- a/chia/_tests/weight_proof/test_weight_proof.py +++ b/chia/_tests/weight_proof/test_weight_proof.py @@ -47,8 +47,6 @@ async def load_blocks_dont_validate( cc_sp, block.height, difficulty, - sub_slot_iters, - uint32(0), # prev_tx_block(blocks, prev_b), todo need to get height of prev tx block somehow here ) assert required_iters is not None diff --git a/chia/consensus/block_header_validation.py b/chia/consensus/block_header_validation.py index 9fb5174a8d8b..76be52c70b59 100644 --- a/chia/consensus/block_header_validation.py +++ b/chia/consensus/block_header_validation.py @@ -20,7 +20,7 @@ from chia.consensus.blockchain_interface import BlockRecordsProtocol from chia.consensus.deficit import calculate_deficit from chia.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch -from chia.consensus.get_block_challenge import final_eos_is_already_included, get_block_challenge, prev_tx_block +from chia.consensus.get_block_challenge import final_eos_is_already_included, get_block_challenge from chia.consensus.make_sub_epoch_summary import make_sub_epoch_summary from chia.consensus.pot_iterations import ( calculate_ip_iters, @@ -506,8 +506,6 @@ def validate_unfinished_header_block( cc_sp_hash, height, expected_vs.difficulty, - expected_vs.ssi, - prev_tx_block(blocks, prev_b), ) if required_iters is None: return None, ValidationError(Err.INVALID_POSPACE) diff --git a/chia/consensus/multiprocess_validation.py b/chia/consensus/multiprocess_validation.py index 8a3e68ceb622..740a9aa42112 100644 --- a/chia/consensus/multiprocess_validation.py +++ b/chia/consensus/multiprocess_validation.py @@ -28,7 +28,7 @@ from chia.consensus.blockchain_interface import BlockRecordsProtocol from chia.consensus.full_block_to_block_record import block_to_block_record from chia.consensus.generator_tools import get_block_header, tx_removals_and_additions -from chia.consensus.get_block_challenge import get_block_challenge, prev_tx_block +from chia.consensus.get_block_challenge import get_block_challenge from chia.consensus.get_block_generator import get_block_generator from chia.consensus.pot_iterations import ( is_overflow_block, @@ -220,8 +220,6 @@ async def return_error(error_code: Err) -> PreValidationResult: cc_sp_hash, block.height, vs.difficulty, - vs.ssi, - prev_tx_block(blockchain, prev_b), ) if required_iters is None: return return_error(Err.INVALID_POSPACE) diff --git a/chia/consensus/pot_iterations.py b/chia/consensus/pot_iterations.py index b02d2ca13b80..ca7ea6362e06 100644 --- a/chia/consensus/pot_iterations.py +++ b/chia/consensus/pot_iterations.py @@ -78,8 +78,6 @@ def validate_pospace_and_get_required_iters( cc_sp_hash: bytes32, height: uint32, difficulty: uint64, - sub_slot_iters: uint64, - prev_transaction_block_height: uint32, # this is the height of the last tx block before the current block SP ) -> Optional[uint64]: q_str: Optional[bytes32] = verify_and_get_quality_string( proof_of_space, constants, challenge, cc_sp_hash, height=height @@ -93,8 +91,6 @@ def validate_pospace_and_get_required_iters( proof_of_space.size(), difficulty, cc_sp_hash, - sub_slot_iters, - prev_transaction_block_height, ) @@ -104,8 +100,6 @@ def calculate_iterations_quality( size: PlotSize, difficulty: uint64, cc_sp_output_hash: bytes32, - ssi: uint64, - prev_transaction_block_height: uint32, # this is the height of the last tx block before the current block SP ) -> uint64: """ Calculates the number of iterations from the quality. This is derives as the difficulty times the constant factor @@ -114,15 +108,11 @@ def calculate_iterations_quality( if size.size_v1 is not None: assert size.size_v2 is None sp_quality_string: bytes32 = std_hash(quality_string + cc_sp_output_hash) - phase_out = calculate_phase_out(constants, ssi, prev_transaction_block_height) iters = uint64( - ( - int(difficulty) - * int(constants.DIFFICULTY_CONSTANT_FACTOR) - * int.from_bytes(sp_quality_string, "big", signed=False) - // (int(pow(2, 256)) * int(_expected_plot_size(size.size_v1))) - ) - + phase_out + int(difficulty) + * int(constants.DIFFICULTY_CONSTANT_FACTOR) + * int.from_bytes(sp_quality_string, "big", signed=False) + // (int(pow(2, 256)) * int(_expected_plot_size(size.size_v1))) ) return max(iters, uint64(1)) else: diff --git a/chia/farmer/farmer_api.py b/chia/farmer/farmer_api.py index c88850b4bc51..19a45dd15285 100644 --- a/chia/farmer/farmer_api.py +++ b/chia/farmer/farmer_api.py @@ -38,6 +38,7 @@ from chia.server.ws_connection import WSChiaConnection from chia.ssl.create_ssl import get_mozilla_ca_crt from chia.types.blockchain_format.proof_of_space import ( + calculate_prefix_bits, generate_plot_public_key, generate_taproot_sk, get_plot_id, @@ -114,8 +115,6 @@ async def new_proof_of_space( new_proof_of_space.proof.size(), sp.difficulty, new_proof_of_space.sp_hash, - sp.sub_slot_iters, - sp.last_tx_height, ) # If the iters are good enough to make a block, proceed with the block making flow @@ -223,8 +222,6 @@ async def new_proof_of_space( new_proof_of_space.proof.size(), pool_state_dict["current_difficulty"], new_proof_of_space.sp_hash, - sp.sub_slot_iters, - sp.last_tx_height, ) if required_iters >= calculate_sp_interval_iters( self.farmer.constants, self.farmer.constants.POOL_SUB_SLOT_ITERS @@ -535,8 +532,7 @@ async def new_signage_point(self, new_signage_point: farmer_protocol.NewSignageP new_signage_point.signage_point_index, new_signage_point.challenge_chain_sp, pool_difficulties, - new_signage_point.peak_height, - new_signage_point.last_tx_height, + uint8(calculate_prefix_bits(self.farmer.constants, new_signage_point.peak_height)), ) msg = make_msg(ProtocolMessageTypes.new_signage_point_harvester, message) diff --git a/chia/full_node/full_node.py b/chia/full_node/full_node.py index 84d1db7363e6..9df0edb7e076 100644 --- a/chia/full_node/full_node.py +++ b/chia/full_node/full_node.py @@ -1817,7 +1817,6 @@ async def signage_point_post_processing( difficulty = self.constants.DIFFICULTY_STARTING sub_slot_iters = self.constants.SUB_SLOT_ITERS_STARTING - tx_peak = self.blockchain.get_tx_peak() # Notify farmers of the new signage point broadcast_farmer = farmer_protocol.NewSignagePoint( request.challenge_chain_vdf.challenge, @@ -1827,7 +1826,6 @@ async def signage_point_post_processing( sub_slot_iters, request.index_from_challenge, uint32(0) if peak is None else peak.height, - tx_peak.height if tx_peak is not None else uint32(0), sp_source_data=SignagePointSourceData( vdf_data=SPVDFSourceData(request.challenge_chain_vdf.output, request.reward_chain_vdf.output) ), @@ -2724,7 +2722,6 @@ async def add_end_of_sub_slot( for infusion in new_infusions: await self.new_infusion_point_vdf(infusion) - tx_peak = self.blockchain.get_tx_peak() # Notify farmers of the new sub-slot broadcast_farmer = farmer_protocol.NewSignagePoint( end_of_slot_bundle.challenge_chain.get_hash(), @@ -2734,7 +2731,6 @@ async def add_end_of_sub_slot( next_sub_slot_iters, uint8(0), uint32(0) if peak is None else peak.height, - tx_peak.height if tx_peak is not None else uint32(0), sp_source_data=SignagePointSourceData( sub_slot_data=SPSubSlotSourceData( end_of_slot_bundle.challenge_chain, end_of_slot_bundle.reward_chain diff --git a/chia/full_node/full_node_api.py b/chia/full_node/full_node_api.py index 9dce12721227..1c8bb6a3f6d9 100644 --- a/chia/full_node/full_node_api.py +++ b/chia/full_node/full_node_api.py @@ -982,15 +982,12 @@ def get_pool_sig(_1: PoolTarget, _2: Optional[G1Element]) -> Optional[G2Element] if sub_slot.challenge_chain.new_sub_slot_iters is not None: sub_slot_iters = sub_slot.challenge_chain.new_sub_slot_iters - tx_peak = self.full_node.blockchain.get_tx_peak() required_iters: uint64 = calculate_iterations_quality( self.full_node.constants, quality_string, request.proof_of_space.size(), difficulty, request.challenge_chain_sp, - sub_slot_iters, - tx_peak.height if tx_peak is not None else uint32(0), ) sp_iters: uint64 = calculate_sp_iters(self.full_node.constants, sub_slot_iters, request.signage_point_index) ip_iters: uint64 = calculate_ip_iters( diff --git a/chia/full_node/full_node_rpc_api.py b/chia/full_node/full_node_rpc_api.py index edc9426ae8aa..92851985e3e0 100644 --- a/chia/full_node/full_node_rpc_api.py +++ b/chia/full_node/full_node_rpc_api.py @@ -10,7 +10,6 @@ BlockRecord, CoinSpend, FullBlock, - PlotSize, SpendBundle, SpendBundleConditions, run_block_generator2, @@ -602,7 +601,7 @@ async def get_network_space(self, request: dict[str, Any]) -> EndpointResult: # TODO: todo_v2_plots Update this calculation to take v2 plots into # account - plot_filter_size = calculate_prefix_bits(self.service.constants, newer_block.height, PlotSize.make_v1(32)) + plot_filter_size = calculate_prefix_bits(self.service.constants, newer_block.height) delta_iters = newer_block.total_iters - older_block.total_iters weight_div_iters = delta_weight / delta_iters additional_difficulty_constant = self.service.constants.DIFFICULTY_CONSTANT_FACTOR diff --git a/chia/full_node/weight_proof.py b/chia/full_node/weight_proof.py index e397ec4ba026..a86d5b53faea 100644 --- a/chia/full_node/weight_proof.py +++ b/chia/full_node/weight_proof.py @@ -30,7 +30,6 @@ from chia.consensus.blockchain_interface import BlockchainInterface from chia.consensus.deficit import calculate_deficit from chia.consensus.full_block_to_block_record import header_block_to_sub_block_record -from chia.consensus.get_block_challenge import prev_tx_block from chia.consensus.pot_iterations import ( calculate_ip_iters, calculate_sp_iters, @@ -1329,8 +1328,6 @@ def _validate_pospace_recent_chain( cc_sp_hash, block.height, diff, - ssi, - prev_tx_block(blocks, blocks.block_record(block.prev_header_hash)), ) if required_iters is None: log.error(f"could not verify proof of space block {block.height} {overflow}") @@ -1378,8 +1375,6 @@ def __validate_pospace( cc_sp_hash, height, curr_diff, - curr_sub_slot_iters, - uint32(0), # prev_tx_block(blocks, prev_b), todo need to get height of prev tx block somehow here ) if required_iters is None: log.error("could not verify proof of space") diff --git a/chia/harvester/harvester_api.py b/chia/harvester/harvester_api.py index b547102b4354..ab3c548dc05c 100644 --- a/chia/harvester/harvester_api.py +++ b/chia/harvester/harvester_api.py @@ -25,7 +25,6 @@ from chia.server.ws_connection import WSChiaConnection from chia.types.blockchain_format.proof_of_space import ( calculate_pos_challenge, - calculate_prefix_bits, generate_plot_public_key, passes_plot_filter, ) @@ -154,8 +153,6 @@ def blocking_lookup(filename: Path, plot_info: PlotInfo) -> list[tuple[bytes32, PlotSize.make_v1(plot_info.prover.get_size()), difficulty, new_challenge.sp_hash, - sub_slot_iters, - new_challenge.last_tx_height, ) sp_interval_iters = calculate_sp_interval_iters(self.harvester.constants, sub_slot_iters) if required_iters < sp_interval_iters: @@ -249,17 +246,8 @@ async def lookup_challenge( # Passes the plot filter (does not check sp filter yet though, since we have not reached sp) # This is being executed at the beginning of the slot total += 1 - - # TODO: todo_v2_plots support v2 plots in PlotManager - filter_prefix_bits = uint8( - calculate_prefix_bits( - self.harvester.constants, - new_challenge.peak_height, - PlotSize.make_v1(try_plot_info.prover.get_size()), - ) - ) if passes_plot_filter( - filter_prefix_bits, + new_challenge.filter_prefix_bits, try_plot_info.prover.get_id(), new_challenge.challenge_hash, new_challenge.sp_hash, diff --git a/chia/protocols/farmer_protocol.py b/chia/protocols/farmer_protocol.py index 0ee840f98931..43f14fbec6f4 100644 --- a/chia/protocols/farmer_protocol.py +++ b/chia/protocols/farmer_protocol.py @@ -56,7 +56,6 @@ class NewSignagePoint(Streamable): sub_slot_iters: uint64 signage_point_index: uint8 peak_height: uint32 - last_tx_height: uint32 sp_source_data: Optional[SignagePointSourceData] = None diff --git a/chia/protocols/harvester_protocol.py b/chia/protocols/harvester_protocol.py index 5554d5c95f9a..da2fc2732359 100644 --- a/chia/protocols/harvester_protocol.py +++ b/chia/protocols/harvester_protocol.py @@ -40,8 +40,7 @@ class NewSignagePointHarvester(Streamable): signage_point_index: uint8 sp_hash: bytes32 pool_difficulties: list[PoolDifficulty] - peak_height: uint32 - last_tx_height: uint32 + filter_prefix_bits: uint8 @streamable diff --git a/chia/protocols/shared_protocol.py b/chia/protocols/shared_protocol.py index b628ca7ddb2b..55cecf90ccd5 100644 --- a/chia/protocols/shared_protocol.py +++ b/chia/protocols/shared_protocol.py @@ -11,8 +11,8 @@ protocol_version = { NodeType.FULL_NODE: "0.0.36", - NodeType.HARVESTER: "0.0.37", - NodeType.FARMER: "0.0.37", + NodeType.HARVESTER: "0.0.36", + NodeType.FARMER: "0.0.36", NodeType.TIMELORD: "0.0.36", NodeType.INTRODUCER: "0.0.36", NodeType.WALLET: "0.0.38", diff --git a/chia/simulator/block_tools.py b/chia/simulator/block_tools.py index f9a981930fcc..019d99abdbd0 100644 --- a/chia/simulator/block_tools.py +++ b/chia/simulator/block_tools.py @@ -1506,8 +1506,7 @@ def get_pospaces_for_challenge( plot_id: bytes32 = plot_info.prover.get_id() if force_plot_id is not None and plot_id != force_plot_id: continue - # TODO: todo_v2_plots support v2 plots in the plot manager - prefix_bits = calculate_prefix_bits(constants, height, PlotSize.make_v1(plot_info.prover.get_size())) + prefix_bits = calculate_prefix_bits(constants, height) if passes_plot_filter(prefix_bits, plot_id, challenge_hash, signage_point): new_challenge: bytes32 = calculate_pos_challenge(plot_id, challenge_hash, signage_point) qualities = plot_info.prover.get_qualities_for_challenge(new_challenge) @@ -1520,8 +1519,6 @@ def get_pospaces_for_challenge( PlotSize.make_v1(plot_info.prover.get_size()), difficulty, signage_point, - sub_slot_iters, - prev_transaction_b_height, ) if required_iters < calculate_sp_interval_iters(constants, sub_slot_iters): proof_xs: bytes = plot_info.prover.get_full_proof(new_challenge, proof_index) @@ -1774,7 +1771,6 @@ def load_block_list( sp_hash = full_block.reward_chain_block.challenge_chain_sp_vdf.output.get_hash() cache = BlockCache(blocks) - prev_transaction_b_height = uint32(0) # TODO: todo_v2_plots required_iters = validate_pospace_and_get_required_iters( constants, @@ -1783,8 +1779,6 @@ def load_block_list( sp_hash, full_block.height, uint64(difficulty), - sub_slot_iters, - prev_transaction_b_height, ) assert required_iters is not None diff --git a/chia/timelord/iters_from_block.py b/chia/timelord/iters_from_block.py index edbd2e71a89b..5e5873c5d2b3 100644 --- a/chia/timelord/iters_from_block.py +++ b/chia/timelord/iters_from_block.py @@ -34,8 +34,6 @@ def iters_from_block( cc_sp, height, difficulty, - sub_slot_iters, - prev_transaction_block_height, ) assert required_iters is not None diff --git a/chia/types/blockchain_format/proof_of_space.py b/chia/types/blockchain_format/proof_of_space.py index 3befb30fc6d9..c5ebff3685f1 100644 --- a/chia/types/blockchain_format/proof_of_space.py +++ b/chia/types/blockchain_format/proof_of_space.py @@ -79,9 +79,7 @@ def verify_and_get_quality_string( if new_challenge != pos.challenge: log.error("Calculated pos challenge doesn't match the provided one") return None - - # we use different plot filter prefix sizes depending on v1 or v2 plots - prefix_bits = calculate_prefix_bits(constants, height, plot_size) + prefix_bits = calculate_prefix_bits(constants, height) if not passes_plot_filter(prefix_bits, plot_id, original_challenge_hash, signage_point): log.error("Did not pass the plot filter") return None @@ -119,11 +117,7 @@ def passes_plot_filter( return cast(bool, plot_filter[:prefix_bits].uint == 0) -def calculate_prefix_bits(constants: ConsensusConstants, height: uint32, plot_size: PlotSize) -> int: - # v2 plots have a constant plot filter size - if plot_size.size_v2 is not None: - return constants.NUMBER_ZERO_BITS_PLOT_FILTER_V2 - +def calculate_prefix_bits(constants: ConsensusConstants, height: uint32) -> int: prefix_bits = int(constants.NUMBER_ZERO_BITS_PLOT_FILTER_V1) if height >= constants.PLOT_FILTER_32_HEIGHT: prefix_bits -= 4