Repository navigation
Description
What's the problem
Part of #2476. Owner priority (2026-10-27): build the opt-in donation feature now, shipping dark. Donation routing must be testable without the real project endpoint, and benches must never dial it. The repo's fake daemons (tests/integration/fakes/) cover Monero, Tari, the wallet RPCs, a SOCKS5 CONNECT relay (fake_socks.py:1-40), a webhook sink and Healthchecks; there is no stratum server, so the controller and the e2e phase have nothing to point a third pool at.
Add tests/integration/fakes/fake_stratum.py, a minimal XMRig-style stratum server (JSON lines over TCP, FakeSocks-style context manager with inspectable state):
- Accepts
login, returns a job, acceptssubmitand answers per a mode (accept,reject,silent);refusecloses new connections likeFakeSocks.refuse(fake_socks.py:36-38). - Records each login's
login,passandagent, counts accepted and rejected shares, and records which pool object shape connected (url,user,pass,coin; the shapeAlgoService.switch_minerssends,dashboard/mining_dashboard/service/xvb/algo_service.py:83-91). - Can be reached directly and through the existing
FakeSocks, to prove a pool withsocks5set dials through the relay. - A stand-alone mode (
--port) so the mini-stack and the e2e phase can start it as a container the wayfake_sink.pyis started (tests/integration/mini-stack/docker-compose.fake.yml:197-204).
Add the contract test as a new file: tests/integration/fakes/test_contract.py is at its 437-line ceiling in docs/dev/file-budget.tsv.
What it impacts
Test code only. It is the stand-in endpoint for the controller tests and for --donation-routing-smoke ({{A12}}).
How I found it
Read-only scan of origin/develop-v2.1.0 at 02852bd on 2026-10-27 from the paths above. Nothing was executed. Unknown: whether the real xmrig-proxy accepts this fake's minimal job template. Tier 2 cannot tell (the mini-stack stands in a BusyBox container for xmrig-proxy, docker-compose.fake.yml:179-181), so that is proved by the e2e phase on a bench.
How important is it
Medium. It unblocks the controller tests and the live phase, and is small enough for one session.
Acceptance criteria
- New
tests/integration/fakes/test_fake_stratum.py(run bymake test-fakes): a test client logs in and receives a job;acceptandrejectmodes update the counters;refuseandsilentare observable; two logins are recorded separately with theiruservalues; a login throughFakeSocksis recorded andFakeSocks.connectedis true. - The fake never binds beyond loopback unless started with an explicit host argument, and uses an OS-assigned port in tests.
- The wire shapes it emits are written down next to the existing vendored contract (
tests/integration/fakes/contract/v1/PROVENANCE) with the upstream P2Pool source file and the release they were read from named; where that cannot be named, the file says "unverified". make test-fakes,make testandmake lint-file-budgetpass. No new explanatory code comments.
Possible solutions
- Hand-rolled asyncio server (recommended: matches the other fakes, no dependency).
- Wrap an existing open-source stratum test server: adds a dependency and a license check for a 150-line fake.
Part of #2476.
Activity
pithead-developer commentedon Oct 27, 2026
Questions before work continues (answer here, then remove the
questionlabel):May the fake’s pool-shaped record use explicitly labelled fixture metadata for
urlandcoin, while recordinguser/login,pass, andagentfrom the wire? Default: yes, because xmrig-proxy’s stratum login does not transmit its configuredurlorcoin; the actual pool configuration must be asserted separately at the controller boundary.pithead-architect commentedon Oct 27, 2026
Ruling: Take the default. Keep url and coin explicitly labelled as fixture metadata, separate from login/user, pass and agent actually received on the wire. Assert the actual pool object independently at the controller boundary, including its SOCKS configuration, and prove relay traversal through FakeSocks observations. Do not present supplied metadata as observed protocol evidence. Add the new contract-test file and record protocol provenance in contract/v1/PROVENANCE; real xmrig-proxy compatibility remains for the stub-only tier4-e2e phase.
pithead-developer commentedon Oct 30, 2026
Merged in #3714.
Forward-port the donation planner (#3696) and fake stratum endpoint (#…