Skip to content

Commit

Permalink
Fixed missing partial count was incorrectly incremented on solo plotN…
Browse files Browse the repository at this point in the history
…FT farming (#18346)

* Fixed an issue where missing partial count was incorrectly incremented on solo plotNFT farming

* Updated test
  • Loading branch information
ChiaMineJP authored Jul 31, 2024
1 parent ec02a78 commit f6bfc9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 5 additions & 4 deletions chia/_tests/farmer_harvester/test_farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,18 +349,19 @@ def test_increment_pool_stats(case: IncrementPoolStatsCase) -> None:
"points_acknowledged_since_start": 0,
"points_acknowledged_24h": [],
"pool_errors_24h": [],
"valid_partials_since_start": 0,
"valid_partials_24h": [],
"valid_partials_since_start": 1,
"valid_partials_24h": [1],
"invalid_partials_since_start": 0,
"invalid_partials_24h": [],
"insufficient_partials_since_start": 0,
"insufficient_partials_24h": [],
"stale_partials_since_start": 0,
"stale_partials_24h": [],
"missing_partials_since_start": 1,
"missing_partials_24h": [1],
"missing_partials_since_start": 0,
"missing_partials_24h": [],
},
),
# Empty pool_url means solo plotNFT farming
id="empty_pool_url",
),
pytest.param(
Expand Down
7 changes: 2 additions & 5 deletions chia/farmer/farmer_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,13 @@ async def new_proof_of_space(
pool_state_dict: Dict[str, Any] = self.farmer.pool_state[p2_singleton_puzzle_hash]
pool_url = pool_state_dict["pool_config"].pool_url
if pool_url == "":
# `pool_url == ""` means solo plotNFT farming
increment_pool_stats(
self.farmer.pool_state,
p2_singleton_puzzle_hash,
"missing_partials",
"valid_partials",
time.time(),
)
self.farmer.state_changed(
"failed_partial",
{"p2_singleton_puzzle_hash": p2_singleton_puzzle_hash.hex()},
)
return

if pool_state_dict["current_difficulty"] is None:
Expand Down

0 comments on commit f6bfc9c

Please sign in to comment.