Independent per-chain target checking and AuxPoW proof submission#105
Open
Boblepointu wants to merge 33 commits into
Open
Independent per-chain target checking and AuxPoW proof submission#105Boblepointu wants to merge 33 commits into
Boblepointu wants to merge 33 commits into
Conversation
Add stratum protocol, config, worker, job, submit, stats and server modules to the server library, and wire the stratum unit test suite.
- Remove unrelated copyright header from src/rpc/mining.cpp - Replace flaky time.sleep(1) with wait_until on debug log in stratum test - Move stratum config log from AppInitServers to InitStratumServer call site - Add AssertLockHeld(m_cs) in HandleSubmit for thread-safety sanity - Add WIN32 compat for evthread (match httpserver.cpp pattern) - Replace POSIX socket headers with compat.h for cross-platform builds Made-with: Cursor
- Introduced a new HTML file for visualizing the dependency graph of pull requests. - Implemented a responsive design with SVG elements to represent PR statuses (open, ready, queued, draft). - Added a legend to explain the color coding of PR states. This visualization aids in understanding the current state of pull requests in the project.
Wire stratumaux.cpp into the server library and stratumaux_tests.cpp into the stratum unit test suite. Made-with: Cursor
…rface Introduce MergeMineManager, ExternalChainClient and the IAuxChainModule abstract interface that allow doged's stratum server to poll and submit work to an arbitrary number of external PoW chains via RPC. - mergemine.h/cpp: IAuxChainModule interface, ExternalChainClient implementation, MergeMineManager with sorted work snapshots - stratumconfig.h/cpp: parse -mergemine=name:host:port:user:pass:chainid[:poll_ms] - logging.h/cpp: add BCLog::MERGEMINE category
Improve the StratumAuxManager work cache with FIFO eviction, optional GetWork/RemoveWork helpers, and move MergeMineCommitment to stratumjob.h for shared use. Update createauxblock, submitauxblock and getmergemineinfo RPCs to surface external chain data and handle multi-block stress. Add stratumaux unit tests for the cache improvements.
Made-with: Cursor
Replace the simple ShareResult enum with ShareValidationResult, which tracks per-chain solved status independently. ValidateShareEx compares the miner's PoW hash against each configured external chain's nBits target, so a share can solve one aux chain without needing to meet DOGE difficulty. - stratumjob.h/cpp: add MergeMineCommitment, AuxChainTarget to StratumJob; inject fabe6d6d commitment into coinbase scriptSig during CreateJob - stratumsubmit.h/cpp: ShareValidationResult, ValidateShareEx, NBitsToTarget, BuildAuxPowForChain - stratum.h/cpp: rewrite HandleSubmit to iterate auxChainsSolved and submit AuxPoW proofs per chain; add OnExternalWorkUpdate Made-with: Cursor
- Start/stop MergeMineManager and GlobalAuxManager in the init sequence - Wire MergeMineManager work callback to trigger fresh stratum jobs when external chain work updates - Add doged ASCII startup banner and summary log block - Add -coinbasetag CLI argument for custom coinbase inscription Made-with: Cursor
9bd0ac0 to
a361224
Compare
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
When a miner submits a share, compare the PoW hash against each configured external chain's difficulty target independently. A share can solve LTC without meeting DOGE difficulty, or vice versa — standard multi-chain merged mining behavior.
Depends on PR #104 (Multi-chain merge-mine manager).
What's included
stratumsubmit.{h,cpp}ShareResultenum; flagsdogeBlockFound,shareAccepted, plusauxChainsSolvedvectorstratumsubmit.cppnBitsindependentlystratumsubmit.cppstratumsubmit.cppstratumjob.hstratumjob.hnBitssnapshot stored in eachStratumJobstratumjob.cppfabe6d6dmerge-mine commitment into coinbase scriptSigstratum.cppauxChainsSolvedand submits AuxPoW proofs per chainstratum.{h,cpp}init.cppHow it works
Each chain is checked independently — a single share can solve multiple chains simultaneously.
Test plan
ninja check-stratum— all unit tests pass