Skip to content

[draft] benchmark: Tor vs clearnet while mining — methodology (#256)#268

Closed
VijitSingh97 wants to merge 3 commits into
developfrom
feat/256-benchmark
Closed

[draft] benchmark: Tor vs clearnet while mining — methodology (#256)#268
VijitSingh97 wants to merge 3 commits into
developfrom
feat/256-benchmark

Conversation

@VijitSingh97

Copy link
Copy Markdown
Collaborator

What & why

Wave 2, PR A — the gate (draft: methodology first; harness + multi-day results to follow on this branch).

docs/benchmarks/tor-vs-clearnet.md documents exactly which metrics the benchmark uses and from where, before any data is collected — so the run is reproducible and the conclusion is honest. This is the gate for the Tor-default decision in #165/#166.

The headline finding that shaped it

Raw orphan/uncle rate is not captured anywhere today (only shares_found / reject counts). But we don't need it: PPLNS reward share (block_reward_share_percent, in /stats/local/stratum) is the direct revenue number and already reflects any orphan/uncle effect — an orphaned share simply fails to earn its weight. So the bottom-line yield is measurable today; the raw uncle count is kept as a secondary log-parse cross-check, not the decision metric.

Metrics & sources (all verified against the live p2pool on gouda)

Method & decision rule

Sequential A/B on gouda + miner-0 at fixed hashrate, several days per arm, control variable = the #165 p2pool.clearnet knob (the benchmark dogfoods the toggle it validates). The clearnet arm sets the noise floor; keep Tor default if the delta is within it, else reconsider (per-sidechain default / clearnet-default-with-opt-in). Conclusion lands in docs/privacy.md and sets the #165/#166 defaults before the v1.1 release.

Next on this branch

  • A small read-only collector (snapshots /stats/* + docker stats, tails the p2pool console) — no new container.
  • The multi-day run, then the filled-in results table + recommendation.

Related

#256 · gates #165 / #166 · part of the #160 privacy epic.

🤖 Generated with Claude Code

VijitSingh97 and others added 3 commits June 16, 2026 20:46
…sion rule (#256)

Documents WHAT we measure and FROM WHERE before building the harness, so the run
is reproducible and the conclusion is honest. Key points, grounded in what
p2pool actually exposes on gouda (/stats/* + /api/state + docker stats):

- Primary metric is PPLNS reward share (block_reward_share_percent) — the direct
  revenue number that already captures any orphan/uncle effect, so we do NOT
  need a raw orphan counter to answer "does Tor cost yield". Yield efficiency
  (reward-share ÷ hashrate-share) + average_effort back it up.
- Raw uncle/orphan count is a secondary cross-check via p2pool console-log parse
  (not in /api/state) — honestly flagged as noisier, not the decision metric.
- Secondary latency/connectivity metrics (peers, share cadence, rejects, Tor
  overhead) are all available today.
- Method: sequential A/B on gouda + miner-0 at fixed hashrate, several days per
  arm, control variable = the #165 p2pool.clearnet knob (dogfoods the toggle).
- Decision rule: clearnet arm sets the noise floor; keep Tor default if the
  delta is within it, else reconsider per-sidechain / clearnet-default-with-opt-in.

Harness + results land in follow-up commits on this branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Read-only collector for the Tor-vs-clearnet benchmark: snapshots p2pool's
/stats/* (reward_share, effort, hashrate, shares, peers, sidechain diff) plus
`docker stats tor` (CPU/mem) into one JSONL line per interval, per arm. No new
container — it reads what p2pool already writes via --local-api/--data-api.

Validated against the live p2pool on gouda (--once produced a clean snapshot:
reward_share, peers_out/list, pool_hr, tor_cpu_pct/mem). shellcheck clean.

Doc updated with the run recipe (nohup per arm) + a jq summary one-liner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…net leak check (#256)

Reads /proc/net/tcp from each app container and flags any ESTABLISHED connection
to a PUBLIC IP (one that bypasses the Tor SOCKS at <bridge>.25:9050). For the
"tor" arm every app container must show 0 public connections; only the tor
container should reach the internet. For "clearnet" the mining-path containers
should show direct public connections.

Immediately caught a real leak on a live deploy: p2pool dialing sidechain peers
on :37889 directly + Tari direct P2P — config-level checks had passed, but the
connection-level check found the traffic was NOT actually behind Tor. This is
the live egress assertion the gouda README flagged as a gap (#160/#2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VijitSingh97

Copy link
Copy Markdown
Collaborator Author

Superseded by #293 (feat/256-benchmark-harness), which carries the finalized methodology doc plus bench-collect.sh/bench-verify-egress.sh (brought over) and the full autonomous harness. All three files in this draft are in #293 in finalized form, and this branch is now conflicting. Closing as superseded — no unique content to salvage.

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