Information about the file in harvester, and don't warn about things … (#1500)

* Information about the file in harvester, and don't warn about things that are OK

* Add more info on warning log

* Log the actual exception
This commit is contained in:
Mariano Sorgente 2021-03-26 17:40:32 +09:00 committed by GitHub
parent f459f78e98
commit e1eef318fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 7 deletions

View File

@ -438,7 +438,7 @@ class FullNodeAPI:
)
return make_msg(ProtocolMessageTypes.respond_signage_point, full_node_response)
else:
self.log.warning(f"Don't have signage point {request}")
self.log.info(f"Don't have signage point {request}")
return None
@peer_required

View File

@ -214,7 +214,7 @@ class FullNodeStore:
if rc_challenge not in self.future_eos_cache:
self.future_eos_cache[rc_challenge] = []
self.future_eos_cache[rc_challenge].append(eos)
log.warning(f"Don't have challenge hash {rc_challenge}")
log.info(f"Don't have challenge hash {rc_challenge}")
return None
if peak.deficit == self.constants.MIN_BLOCKS_PER_CHALLENGE_BLOCK:

View File

@ -80,8 +80,9 @@ class HarvesterAPI:
# Uses the DiskProver object to lookup qualities. This is a blocking call,
# so it should be run in a thread pool.
try:
plot_id = plot_info.prover.get_id()
sp_challenge_hash = ProofOfSpace.calculate_pos_challenge(
plot_info.prover.get_id(),
plot_id,
new_challenge.challenge_hash,
new_challenge.sp_hash,
)
@ -89,6 +90,9 @@ class HarvesterAPI:
quality_strings = plot_info.prover.get_qualities_for_challenge(sp_challenge_hash)
except Exception as e:
self.harvester.log.error(f"Error using prover object {e}")
self.harvester.log.error(
f"File: {filename} Plot ID: {plot_id}, challenge: {sp_challenge_hash}, plot_info: {plot_info}"
)
return []
responses: List[Tuple[bytes32, ProofOfSpace]] = []
@ -110,8 +114,12 @@ class HarvesterAPI:
# then send to farmer
try:
proof_xs = plot_info.prover.get_full_proof(sp_challenge_hash, index)
except RuntimeError:
self.harvester.log.error(f"Exception fetching full proof for {filename}")
except Exception as e:
self.harvester.log.error(f"Exception fetching full proof for {filename}. {e}")
self.harvester.log.error(
f"File: {filename} Plot ID: {plot_id}, challenge: {sp_challenge_hash}, "
f"plot_info: {plot_info}"
)
continue
# Look up local_sk from plot to save locked memory

View File

@ -32,8 +32,8 @@ def _get_filenames(directory: Path) -> List[Path]:
if not directory.exists():
log.warning(f"Directory: {directory} does not exist.")
return []
except OSError:
log.warning(OSError.strerror)
except OSError as e:
log.warning(f"Error checking if directory {directory} exists: {e}")
return []
all_files: List[Path] = []
try: