Skip to content

QUIC miner#49

Merged
illuzen merged 21 commits intomainfrom
illuzen/quic-miner
Feb 2, 2026
Merged

QUIC miner#49
illuzen merged 21 commits intomainfrom
illuzen/quic-miner

Conversation

@illuzen
Copy link
Contributor

@illuzen illuzen commented Jan 26, 2026

Deep refactor of miner

  • companion to QUIC miner chain#363
  • needs to update to quantus-node-api release
  • no more MiningService
  • reduced complexity in metrics
  • miner initiates quic connection to node
  • miner picks random 512 bit number as start nonce
  • cpu-driven cancellation of gpu (10x speedup)
  • dedicated pool of cpu / gpu workers

@n13
Copy link
Contributor

n13 commented Jan 31, 2026

Review: PR #49 QUIC Miner

Summary

This PR implements a major architectural shift from a RESTful HTTP API to a persistent QUIC connection for miner-node communication. It introduces a persistent WorkerPool to eliminate thread churn and updates the protocol specification.

Findings

Protocol & Architecture

  • QUIC Transition: The move to quinn + rustls is well-implemented. The bidirectional stream model significantly reduces latency compared to HTTP polling.
  • WorkerPool: The introduction of WorkerPool is a major performance improvement, preventing thread/GPU context recreation for every job.
  • Implicit Cancellation: The "new job cancels old job" logic is simplified and robust.
  • Stale Results: The job_epoch mechanism in WorkerPool correctly handles race conditions where a worker finishes a cancelled job.

Implementation Details

  • Random Nonces: Shifting nonce range management to miners (random start in U512 space) is statistically safe and simplifies node logic.
  • Error Handling: The reconnection loop with exponential backoff in quic.rs is correctly implemented.
  • Security: InsecureCertVerifier is used, which is noted in the docs. For production, certificate pinning or CA validation should be exposed as a configuration option.

Documentation

  • EXTERNAL_MINER_PROTOCOL.md accurately reflects the new QUIC protocol, message types, and flow.

Conclusion

The refactor is solid and aligns with high-performance mining requirements. The code is clean and adheres to the project's style.

Copy link
Contributor

@n13 n13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vibe review - feels great to get rid of all that trashy old AI code!

Gemini loves it

LGTM!

@illuzen illuzen merged commit 443f0f9 into main Feb 2, 2026
4 checks passed
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.

2 participants

Comments