Skip to content

AuxPoW merge-mining RPCs: createauxblock / submitauxblock#103

Open
Boblepointu wants to merge 28 commits into
doged-io:masterfrom
FrenchBTC:pr/auxpow-rpc
Open

AuxPoW merge-mining RPCs: createauxblock / submitauxblock#103
Boblepointu wants to merge 28 commits into
doged-io:masterfrom
FrenchBTC:pr/auxpow-rpc

Conversation

@Boblepointu
Copy link
Copy Markdown

@Boblepointu Boblepointu commented Apr 16, 2026

Summary

Add createauxblock and submitauxblock JSON-RPC methods that enable external miners to request and submit Auxiliary Proof-of-Work blocks, the standard interface for Dogecoin merge-mining.

Depends on PR #102 (Stratum v1 core).

What's included

Component Files Description
AuxPoW manager stratumaux.{h,cpp} Work cache with FIFO eviction, CreateWork / GetWork / RemoveWork, commitment building
RPC methods rpc/mining.cpp createauxblock(coinbase_addr) → returns hash + target; submitauxblock(hash, auxpow_hex) → validates and submits
Unit tests stratumaux_tests.cpp AuxPoW block construction, validation, cache eviction
Functional tests stratum_auxpow.py, stratum_mining.py End-to-end: create aux block, build proof, submit; share submission flow
Build CMakeLists.txt Add stratumaux module to server library and test suite

Usage

# Request work
doged createauxblock DYourAddress
# → {"hash": "...", "chainid": 1, "previousblockhash": "...", "target": "..."}

# Submit solved block
doged submitauxblock <hash> <serialized_auxpow>
# → true

Test plan

  • ninja check-stratum — stratumaux test suite passes
  • test/functional/stratum_auxpow.py — e2e create + submit cycle
  • test/functional/stratum_mining.py — share submission flow

- 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
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