Repository navigation
2500× hashrate boost: 20k → up to 50m ops/s (cpu-fast, metrics, throttling, stable) - #1
Conversation
Convert repository into Cargo workspace with modular crates - Split code into workspace members: miner-cli, miner-service, pow-core, engine-cpu, engine-gpu-cuda, engine-gpu-opencl, metrics - Moved QPoW math logic into local pow-core crate with compatibility API and incremental helpers - Defined MinerEngine trait and baseline CPU engine in engine-cpu crate - Rewrote service layer in miner-service: job management, HTTP API, engine orchestration - Added CLI binary crate miner-cli with flags: --port, --num-cores, --metrics-port, --engine - Implemented runtime toggle for Prometheus metrics exporter enabled only when --metrics-port provided - Deprecated root src/lib.rs and src/main.rs with notices pointing to new CLI/workspace entrypoints
Improve mining metrics with chunked progress updates and dashboards - Emit periodic per-thread progress updates by chunking search ranges, enabling fresher and more accurate job/global hash rates. - Smooth per-thread hash rates with EMA; derive per-job and global rates from thread aggregates. - Remove job/thread rate series on completion/cancellation to avoid scrape-timing zero artifacts. - Add service-level metrics: `miner_active_jobs` gauge and `miner_mine_requests_total` counter with result labels. - Introduce CLI/env knob `--progress-chunk-ms` to control progress update frequency (default 2000ms). - Update Grafana dashboards for trend-friendly queries, cleaned labels, 24h/1h peak views, and job-level filtering. - Add detailed documentation summarizing metrics improvements, usage, and operational guidance.
active job metrics update
- Replace `--cores`/`--num-cores` with `--workers` to clarify intent (logical CPU threads) - Detect cpuset-aware default for workers, leaving ~50% headroom on shared hosts - Clamp user-specified workers to effective cpuset size - Update logs, configs, and APIs accordingly
- Introduce ChainManipulatorEngine using fast incremental hashing path - Throttle mining speed per solved block using sleeps after nonce batches - Add CLI/env options to control base delay, batch size, throttle cap, and resume state - Wire engine selection and parameters through miner-service and miner-cli - Add debug logs for throttle state at job start and on block found - Add new Grafana panel showing robust difficulty median per chain for visibility
- Switch toolchain to stable with clippy and rustfmt components - Clean up Clippy warnings with inline format args and hygiene fixes - Add GPU engine placeholders (gpu-cuda, gpu-opencl) in CLI and service - Return clear runtime error and exit for unimplemented GPU engines - Format all TOML files with Taplo and ensure taplo fmt --check passes - Improve mining nonce partitioning for safe range splits - Update tests to pass cleanly on stable without warnings
|
Would like to see some unit tests for the protocol implementation and if possible also for the calculations. |
- Detect effective CPUs with cpuset awareness (cgroup v2/v1 fallback) - Log detected cpuset mask or fallback info at startup (debug) - Expose miner_effective_cpus Prometheus gauge (metrics feature) - Add production-ready systemd unit and example CPU affinity overrides - Include documentation for installation, overrides, and validation
| @@ -0,0 +1,99 @@ | |||
| #![deny(rust_2018_idioms)] | |||
There was a problem hiding this comment.
If this code is not used, let's remove it and put it in a branch for the time being. Dead code has a habit of accumulating.
There was a problem hiding this comment.
This code does absolutely nothing and should not be here.
dastansam
left a comment
There was a problem hiding this comment.
I would suggest running this through clippy once. there are a lot of places to reduce the code size. a lot of implicit returns missed, etc.
There was a problem hiding this comment.
Ok requesting this
- remove dead code
- run through clippy
- remove "explanations" which are not neded - the whole /implementation segment
Other than that, Dastan pointed out there's many things that could be done in much fewer lines of code but I don't think it's worth our time rewriting what AI wrote.
So just requesting the above.
- Verify Baseline and Fast CPU engines produce matching results - Test Exhausted and Cancelled engine states with precise hash counts - Cover miner-service request validation error branches - Test miner-service HTTP endpoints for expected status codes - Confirm chunked mining sends progress and completion messages
|
- remove dead code: done (gpu placeholders aren't dead)
- run through clippy: done
- remove "explanations": done
n13
left a comment
There was a problem hiding this comment.
We're already lenient to the extreme with this AI generated code.
It's a new era, ok, we can use AI gen code. There's a lot that could be made a lot better here but we can't use human hours to fix AI code- it doesn't make sense.
Still if we don't uphold the most basic of engineering principles, we have no principles.
Dead code should not go into a production PR.
Call it placeholder, comments, things I really like to do in the future, doesn't really matter. It's dead code. It creates more work for human reviewers.
It really was not a frivolous request.
|
|
Ok well it is a rule and there's always exceptions to the rules. So this is the exception to the rule 🙏 Hopefully we can resolve such things faster in the future and thanks Rob for coming and hashing it out in person |
|
Approved |

overview
this pr implements the 01–07 implementation docs and delivers a production-ready, observable cpu miner with a clean service boundary, consistent cli, and ci/toolchain hygiene. it intentionally defers select items from the 00 roadmap for post-merge follow-ups.
what’s included (docs/implementation)
cli highlights
validation
deferred (from 00 roadmap; to follow after merge)
reviewer guide