Skip to content

Commit 4d2d271

Browse files
authored
[CHIA-3659] ignore unreasonably small v2 plots (#19984)
just like we ignore unreasonably small v1 plots, ignore unreasonably small v2 plots
1 parent fcc0415 commit 4d2d271

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

chia/plotting/manager.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -333,22 +333,20 @@ def process_file(file_path: Path) -> Optional[PlotInfo]:
333333
# TODO: consider checking if the file was just written to (which would mean that the file is still
334334
# being copied). A segfault might happen in this edge case.
335335

336-
version_and_size = prover.get_size()
337-
if version_and_size.size_v1 is not None:
338-
k = version_and_size.size_v1
339-
level = prover.get_compression_level()
340-
if level == 0:
341-
if k >= 30 and stat_info.st_size < 0.98 * expected_size:
342-
log.warning(
343-
f"Not farming plot {file_path}. "
344-
f"Size is {stat_info.st_size / (1024**3)} GiB, "
345-
f"but expected at least: {expected_size / (1024**3)} GiB. "
346-
"We assume the file is being copied."
347-
)
348-
return None
349-
else:
350-
# TODO: todo_v2_plots do we need to check v2 plots?
351-
pass
336+
k = prover.get_size()
337+
level = prover.get_compression_level()
338+
if (
339+
level == 0
340+
and stat_info.st_size < 0.98 * expected_size
341+
and ((k.size_v1 is not None and k.size_v1 >= 30) or (k.size_v2 is not None and k.size_v2 >= 28))
342+
):
343+
log.warning(
344+
f"Not farming plot {file_path}. "
345+
f"Size is {stat_info.st_size / (1024**3)} GiB, "
346+
f"but expected at least: {expected_size / (1024**3)} GiB. "
347+
"We assume the file is being copied."
348+
)
349+
return None
352350

353351
cache_entry = CacheEntry.from_prover(prover)
354352
self.cache.update(file_path, cache_entry)

0 commit comments

Comments
 (0)