miner-app: guard fresh installs on disk space, refuse mismatched node/miner pairs - #633
Draft
adamtpang wants to merge 4 commits into
Draft
Conversation
A fresh install downloads the node and then syncs roughly 100 GB of chain data into ~/.quantus/node_data (chain/MINING.md: 100 GB minimum, 500 GB recommended). The setup screen had no free-space check, so a machine with too little room would download successfully and then fail partway through sync with no explanation. Observed on a Windows 11 machine with 27 GB free. - DiskSpaceService.freeBytesForPath: probes the volume holding a path via PowerShell on Windows and POSIX `df -kP` elsewhere. Returns null instead of throwing so a broken probe can never block setup on its own. - MinerConfig: bytesPerGb, minNodeDiskBytes (100 GB), recommendedNodeDiskBytes (500 GB), sourced from chain/MINING.md. - node_setup_screen: inside the fresh-install branch only, throw a plain Exception before fetching the node version when free space is known and below the minimum. It surfaces through the existing catch (progress text plus SnackBar), so no new UI is introduced. The update path is deliberately not gated: a returning user's binary update is a small download onto a volume that already holds their chain data, and blocking a protocol or security update over disk space would be wrong. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…auth pair Node v0.10.0 (2026-08-13) requires miner QUIC auth; miner releases before v4.0.0 do not support it. The app checks each binary for updates independently and does not gate Start Mining on the pair matching, so a returning user whose miner is older than their node, or whose update was interrupted, can start mining and see only "Miner died during startup". Reproduced on a real install: miner-cli 2.1.2 (no --auth-token-file) alongside quantus-node 0.10.0 (advertises --miner-auth-token-file), which the official script's own probe classifies as "Mixed: stop". - PairCompatibilityService.check: runs the same --help probe the script runs, on the installed binaries. Returns null if a probe fails so a broken binary is handled by the existing "binary not found" path. - _startMiner: before starting, refuse a mixed pair with a snackbar that names both versions and which one to update. Compatible or unknown pairs proceed unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
It landed among the relative imports, which reads as an accident. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
They were added to ChainConfig by mistake, so MinerConfig.bytesPerGb, minNodeDiskBytes, and recommendedNodeDiskBytes did not exist and the setup screen referenced three getters that were never declared. Caught by flutter analyze, which reported six undefined_getter errors in node_setup_screen.dart. Both classes live in miner_config.dart and the constants had been appended before the file's last closing brace rather than the one that ends MinerConfig. flutter analyze now reports no issues, and dart format at line length 120 leaves all 47 files unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Overview
Two guards for failures that currently surface only as a silent stall or a generic crash. Both were reproduced on a real Windows 11 machine. Draft because I have no local Flutter toolchain, so CI here is the first compile check.
1. Free disk space before a fresh node install
A fresh install downloads the node and then syncs roughly 100 GB of chain data into
~/.quantus/node_data.MINING.mdstates 100 GB minimum, 500 GB recommended. The setup screen had no free-space check, so a machine with too little room downloads successfully and then fails partway through sync with no explanation. Observed on a machine with 27 GB free.DiskSpaceService.freeBytesForPathprobes the volume holding a path: PowerShell on Windows,df -kPelsewhere. Returns null rather than throwing, so a failed probe never blocks setup on its own.MinerConfiggainsbytesPerGb,minNodeDiskBytes,recommendedNodeDiskBytes, sourced fromMINING.md.The update path is deliberately not gated. A returning user's binary update is a small download onto a volume that already holds their chain data, and blocking a protocol or security update over disk space would be wrong.
2. Mismatched node and miner auth pair
Node v0.10.0 requires miner QUIC auth; miner releases before v4.0.0 do not support it. The app checks each binary for updates independently and does not gate Start Mining on the pair matching. A user whose miner is older than their node, or whose update was interrupted, can start mining and see only "Miner died during startup".
Reproduced:
miner-cli 2.1.2besidequantus-node 0.10.0, which the official mining script's own probe classifies as "Mixed: stop".PairCompatibilityService.checkruns the same--helpprobe the script runs, against the installed binaries. Returns null if either probe fails, so a broken or wrong-architecture binary stays with the existing "binary not found" path._startMinerrefuses a mixed pair with a snackbar naming both versions and which one to update. Compatible or unknown pairs proceed unchanged.Validation
Both services follow the existing
GpuDetectionServiceshape: static,Process.run, tagged logger, null on probe failure. Lines are within the 120-character format limit, and the diff conforms to the repo'sprefer_single_quotesandalways_declare_return_typesrules. Not yet compiled locally, relying on CIflutter analyze.