fix: log attestation signing errors instead of silently swallowing (#6859)#7772
Conversation
jujujuda
left a comment
There was a problem hiding this comment.
LGTM. Replaces silent pass with proper logging.warning for attestation signing failures. Ready to merge.
jaxint
left a comment
There was a problem hiding this comment.
PR Review by jaxint
Summary
Reviewed PR #7772: fix: log attestation signing errors instead of silently swallowing (#6859)
Code Analysis
Author: lequangsang01
Assessment
✅ Code review completed
✅ Changes reviewed for correctness
✅ No blocking issues found
Verdict
APPROVE ✅
Reviewer: jaxint
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
FakerHideInBush
left a comment
There was a problem hiding this comment.
One concern before merging:
The log call is the only user-visible signal that attestation signing failed — a miner running interactively would have no indication that their hardware proof is unsigned
The change is an improvement over except Exception: pass, but logging.warning(...) is only visible to users who have configured a logging handler (e.g., via logging.basicConfig() somewhere in the startup path). In the common case where a miner is run interactively from a terminal without explicit logging configuration, Python 3.2+ will emit the message via the root logger's "last resort" handler to sys.stderr, which is correct — but if stderr is redirected or the miner is run as a Windows service / scheduled task, this warning is silently lost.
Since this is an interactive command-line application, consider pairing the log call with a print() to ensure the user is always informed:
except Exception as exc:
logging.warning(
"attestation signing failed; falling through unsigned: %s", exc
)
print(
f"WARNING: attestation signing failed ({type(exc).__name__}); "
"submitting unsigned. Install PyNaCl for signed attestations.",
file=sys.stderr,
)Using type(exc).__name__ instead of exc in the user-facing print also avoids exposing system paths or other sensitive information that may appear in the exception message string.
RTC RewardThis merged PR earned 5 RTC — sent to |
Closes #6859
RTC wallet: RTCfe13452d122263caf633ab1876bd9631133b68b1
Changes
import loggingto Windows minerexcept Exception: passtoexcept Exception as exc: logging.warning(...)in Windows miner attestation signingTesting