fix: add platform-detecting wrapper at miners/fingerprint_checks.py [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #8070
Closed
waterWang wants to merge 3 commits into
Closed
Conversation
…urning 0 Closes Scottcjn#8057 The _tip_age_slots() function was selecting the newest header slot from the database but discarding the value, returning a hardcoded 0 if any row existed. This caused /health to report tip_age_slots: 0 even when the chain tip was months old. Fix: compute the actual tip age by subtracting the latest header slot from current_slot(), returning max(0, age) to handle edge cases. Empty headers table still returns None. [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
Closes Scottcjn#8055 The chain tip check result was omitted from both all_ok expressions: 1. In render() - the CLI output displayed ALL SYSTEMS OPERATIONAL even when /headers/tip was unreachable 2. In run_once() - the exit code was 0 (success) even when the tip check failed Fix: add and t['reachable'] / and snapshot['tip']['reachable'] to both all_ok expressions. [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
Closes Scottcjn#8031 The fingerprint_checks.py module exists in platform-specific subdirectories (miners/linux/, miners/windows/, miners/macos/) but there was no stub at miners/fingerprint_checks.py, causing users to get a Python path error (0x80070003 on Windows) when running python3 miners/fingerprint_checks.py. Fix: add a platform-detecting wrapper at miners/fingerprint_checks.py that: 1. Detects the current OS (linux/windows/darwin) 2. Loads the corresponding platform-specific module 3. Re-exports all public symbols for backward compatibility 4. Runs the module's main() entry point if available [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
Contributor
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Contributor
Author
|
Closing as duplicate of PR #8059 (already submitted by the same author) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8031
The
fingerprint_checks.pymodule exists in platform-specific subdirectories (miners/linux/,miners/windows/,miners/macos/) but there was no stub atminers/fingerprint_checks.py. This caused a Python path error (0x80070003 on Windows) when users ranpython3 miners/fingerprint_checks.py.Fix
Added a platform-detecting wrapper at
miners/fingerprint_checks.pythat:platform.system()importlib.util.spec_from_file_locationmain()entry point if availableTest
platform.system().lower() == 'linux'→ loadsminers/linux/fingerprint_checks.pyplatform.system().lower() == 'windows'→ loadsminers/windows/fingerprint_checks.pyplatform.system().lower() == 'darwin'→ loadsminers/macos/fingerprint_checks.py