mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
Update testnet height for SOFT_FORK3 and fix Chip-13 logic (#15831)
Update testnet height for SOFT_FORK3 and fix some logic issues in Chip-13 implementation
This commit is contained in:
@@ -80,15 +80,17 @@ async def validate_block_body(
|
||||
|
||||
while curr_optional_block_record is not None and sp_count < constants.UNIQUE_PLOTS_WINDOW:
|
||||
prefix_bits = calculate_prefix_bits(constants, curr_optional_block_record.height)
|
||||
if passes_plot_filter(
|
||||
prefix_bits,
|
||||
plot_id,
|
||||
curr_optional_block_record.pos_ss_cc_challenge_hash,
|
||||
curr_optional_block_record.cc_sp_hash,
|
||||
):
|
||||
return Err.INVALID_POSPACE, None
|
||||
|
||||
if curr_optional_block_record.cc_sp_hash != curr_sp:
|
||||
if passes_plot_filter(
|
||||
prefix_bits,
|
||||
plot_id,
|
||||
curr_optional_block_record.pos_ss_cc_challenge_hash,
|
||||
curr_optional_block_record.cc_sp_hash,
|
||||
):
|
||||
log.error(f"Chip-13 Block Failed at height: {height}")
|
||||
return Err.INVALID_POSPACE, None
|
||||
|
||||
sp_count += 1
|
||||
curr_sp = curr_optional_block_record.cc_sp_hash
|
||||
if sp_count < constants.UNIQUE_PLOTS_WINDOW:
|
||||
|
||||
@@ -505,15 +505,16 @@ def validate_unfinished_header_block(
|
||||
|
||||
while curr_optional_block_record is not None and sp_count < constants.UNIQUE_PLOTS_WINDOW:
|
||||
prefix_bits = calculate_prefix_bits(constants, curr_optional_block_record.height)
|
||||
if passes_plot_filter(
|
||||
prefix_bits,
|
||||
plot_id,
|
||||
curr_optional_block_record.pos_ss_cc_challenge_hash,
|
||||
curr_optional_block_record.cc_sp_hash,
|
||||
):
|
||||
return None, ValidationError(Err.INVALID_POSPACE)
|
||||
|
||||
if curr_optional_block_record.cc_sp_hash != curr_sp:
|
||||
if passes_plot_filter(
|
||||
prefix_bits,
|
||||
plot_id,
|
||||
curr_optional_block_record.pos_ss_cc_challenge_hash,
|
||||
curr_optional_block_record.cc_sp_hash,
|
||||
):
|
||||
return None, ValidationError(Err.INVALID_POSPACE, f"Chip-13 Block Failed: {height}")
|
||||
|
||||
sp_count += 1
|
||||
curr_sp = curr_optional_block_record.cc_sp_hash
|
||||
if sp_count < constants.UNIQUE_PLOTS_WINDOW:
|
||||
|
||||
@@ -75,7 +75,7 @@ def update_testnet_overrides(network_id: str, overrides: Dict[str, Any]) -> None
|
||||
if "SOFT_FORK2_HEIGHT" not in overrides:
|
||||
overrides["SOFT_FORK2_HEIGHT"] = 0
|
||||
if "SOFT_FORK3_HEIGHT" not in overrides:
|
||||
overrides["SOFT_FORK3_HEIGHT"] = 0
|
||||
overrides["SOFT_FORK3_HEIGHT"] = 2960728
|
||||
if "HARD_FORK_HEIGHT" not in overrides:
|
||||
overrides["HARD_FORK_HEIGHT"] = 2997292
|
||||
if "PLOT_FILTER_128_HEIGHT" not in overrides:
|
||||
|
||||
@@ -10,7 +10,7 @@ def test_testnet10() -> None:
|
||||
update_testnet_overrides("testnet10", overrides)
|
||||
assert overrides == {
|
||||
"SOFT_FORK2_HEIGHT": 0,
|
||||
"SOFT_FORK3_HEIGHT": 0,
|
||||
"SOFT_FORK3_HEIGHT": 2960728,
|
||||
"HARD_FORK_HEIGHT": 2997292,
|
||||
"PLOT_FILTER_128_HEIGHT": 3061804,
|
||||
"PLOT_FILTER_64_HEIGHT": 8010796,
|
||||
|
||||
Reference in New Issue
Block a user