Design: TollGate capacity advertisement vs client measurement + reputation model
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- go
- Domain
- backend-api-design, networking
Research direction
Start by reading the UpstreamManager, which the issue says already tracks bytes transferred during active sessions, and review #312 for the related discovery logger work. The issue leaves key decisions open about capacity measurement, reputation signals, and storage, so first clarify and agree on those choices. Done means an agreed design for how measurements and reputation will be collected and used.
Written by the indexing model from the issue text.
Description
Open Questions
1. Self-advertised capacity vs client-measured
Should a TollGate self-report its uplink speed, or should the client measure it?
Self-advertised (push model):
- TollGate includes
uplink_speed_mbpsin itsGET /advertisement response - Pro: client knows before committing to a connection
- Con: nothing prevents lying — a TollGate could claim 100 Mbps on a 5 Mbps DSL line
- Mitigation: client verifies after connecting and adjusts trust
Client-measured (pull model):
- Client does a timed download from the TollGate backend after connecting
- Pro: ground truth, can't be faked
- Con: only available AFTER connection (too late for pre-connection scoring)
- Con: small downloads are inaccurate for high-bandwidth links
Hybrid (likely best):
- TollGate advertises expected capacity (from config or self-test)
- Client measures actual throughput after connecting
- Discrepancy logged → feeds reputation score
- Future scoring weights measured > advertised
2. TollGate reputation
How do we track whether a TollGate is trustworthy and performs well?
Signals to collect:
- Price accuracy: advertised price vs actual charge per step
- Throughput delivery: advertised speed vs measured speed (ratio)
- Uptime: what fraction of probes succeeded over time?
- Payment reliability: did Cashu tokens work? Any meltdowns/errors?
- Session stability: did sessions get cut prematurely?
Storage options:
- Local JSONL per-TollGate (by npub) — simple, no infrastructure
- Nostr reputation event (kind 1984 or custom) — shared across the network
- Stake-based: TollGates lock sats as collateral, slashed for bad behavior
Trust bootstrapping:
- New TollGate starts at neutral reputation (score 0)
- Reputation accrues from client measurements over time
- Social trust: follow npubs of known operators (profit_share identities)
- Network effects: TollGates recommended by trusted TollGates get a boost
3. Measurement methodology
If we measure throughput from the client side:
- HTTP GET to
/: Already exists, returns advertisement (~500 bytes). Too small for throughput estimation. - Timed file download: Would need a dedicated endpoint serving a known-size payload (e.g.,
/speedtest?size=1000000). More accurate but adds backend complexity. - iperf3: Most accurate but requires installation on every TollGate.
- Ongoing session throughput: The UpstreamManager already tracks bytes transferred during active sessions. This is "free" data — no extra probes needed. The session manager knows exactly how many bytes flowed through per second.
Proposal: Use ongoing session bytes/second as the primary throughput signal. The session manager already measures this for data-metered sessions. We just need to log it alongside the TollGate identity.
Related
- #311 — WiFi AP selection algorithm roadmap
- #312 — Discovery logger (Phase 1-2 implementation)
- Dominant language
- Go
- Stars
- 12
- Forks
- 14
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 211
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenTollGate/tollgate-module-basic-go
-
go-battery needs an ndsctl on PATH: TestPurchaseSessionGuardHoldsThroughTheOutcomeUnknownWindow fails on bare hosts (passes with stub)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#726 ·
Maintainers usually reply within 1 day
-
rebrand-literal-gutter: uhttpd section-vocabulary check trips on a COMMENT (uhttpd.luci in 92-tollgate-admin-setup:178)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#723 ·
Maintainers usually reply within 1 day
-
Discovery endpoint serves text/plain content-type on / — r2r clients warnPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenTollGate/tollgate-module-basic-go#628 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
OpenTollGate/tollgate-module-basic-go#725 ·
Maintainers usually reply within 1 day
-
cloud-lab Dockerfile.client: mid-file ARG invisible to FROM — client and killer images unbuildable on docker/buildkit 29 (golang:-bookworm)Possibly taken @Amperstrand claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 25/100
OpenTollGate/tollgate-module-basic-go#724 ·
Maintainers usually reply within 1 day
All issues in OpenTollGate/tollgate-module-basic-go
Similar issues
-
agent-research-recommend agent-review-finding chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jordansmall/spindrift#4821 · 1 comment ·
Maintainers usually reply within 1 day
-
area:web
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
praetorianer777/GoTome#178 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
oracle/go-oracledb#105 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day