Skip to content

feat: Zephyr (RandomX) dual-mining integration#1

Open
Bill0151 wants to merge 1 commit intomainfrom
skein/461-zephyr-randomx-integration
Open

feat: Zephyr (RandomX) dual-mining integration#1
Bill0151 wants to merge 1 commit intomainfrom
skein/461-zephyr-randomx-integration

Conversation

@Bill0151
Copy link
Copy Markdown
Owner

Zephyr (RandomX) Dual-Mining Integration — Windows Miner

Closes Scottcjn#461

Hi Sophia — Bill0151 and the skein here. Following your feedback on the previous comment submission, this is the proper pull request against the actual miner codebase.

What this does

Adds Zephyr (RandomX) dual-mining support to rustchain_windows_miner.py by integrating process detection and node verification directly into the RustChainMiner class — plugged into the existing attestation and reward pipeline rather than running as an isolated script.

Changes

Three new methods on RustChainMiner:

  • _detect_zephyr_processes() — detects xmrig or zephyrd running alongside the miner, using psutil if available with a graceful fallback to tasklist for environments where psutil isn't installed.

  • _query_zephyr_rpc() — queries the local Zephyr daemon's JSON-RPC endpoint (localhost:17767) for get_info, capturing block height and version. Uses a short 5-second timeout so the mining loop never stalls if the daemon is unreachable.

  • _build_pow_proof() — constructs the proof block. Returns None immediately if neither process is detected (zero overhead for non-Zephyr miners). Includes a per-cycle nonce for replay-attack mitigation.

Integration points:

  • attest() — calls _build_pow_proof() once per attestation cycle and attaches the result as pow_proof in the payload to /attest/submit. The field is omitted entirely if Zephyr isn't running, so existing attestation behaviour is fully preserved.

  • generate_header() — includes the cached _pow_proof from the last attestation cycle in each header submission to /headers/ingest_signed. Uses the cached value rather than re-detecting on every 10-second loop to avoid repeated process scans.

Design decisions

psutil with tasklist fallback: psutil isn't in the miner's current dependencies, so the detection gracefully falls back to tasklist /fo csv on Windows. This means the integration works out of the box without requiring an additional install, while benefiting from psutil's accuracy when it's available.

Cached proof per attestation cycle: The _pow_proof is refreshed during each attest() call (~every 10 minutes) rather than on every header submission. This matches the natural cadence of the attestation cycle and avoids unnecessary RPC calls.

Zero overhead when Zephyr is absent: _build_pow_proof() returns None at the first process check if neither xmrig nor zephyrd is running. No RPC call is attempted, and no pow_proof field is added to any payload. Miners not running Zephyr are completely unaffected.

Proof schema

{
  "chain":        "zephyr",
  "algorithm":    "randomx",
  "processes":    {"xmrig": true, "zephyrd": false},
  "node_height":  1483921,
  "node_version": "0.18.3.0",
  "timestamp":    1741234567,
  "nonce":        "a3f2c1b8"
}

node_height and node_version are null if the Zephyr daemon isn't reachable (e.g. xmrig is running but the full node isn't). The server-side validator can use this to distinguish between running-miner-only and full-node configurations.

Payout

RTC wallet name: bill0151
RTC wallet address: RTCd06cb051a224204f8b086c1ce248849cba05ffbd

Added Zephyr dual-mining integration and updated fingerprint checks handling. Adjusted API endpoint and improved error handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant