Skip to content

banditcallback: shorten default TTL to 60s for absence-detection heartbeat#670

Merged
reflog merged 1 commit into
mainfrom
reflog/banditcallback-heartbeat
May 22, 2026
Merged

banditcallback: shorten default TTL to 60s for absence-detection heartbeat#670
reflog merged 1 commit into
mainfrom
reflog/banditcallback-heartbeat

Conversation

@reflog
Copy link
Copy Markdown
Contributor

@reflog reflog commented May 22, 2026

Summary

  • Drop the default --banditcallbackttl from 10m to 60s so the emitter re-fires per-device callbacks on a short cadence.
  • This is the proxy half of the lantern-cloud arm-callback heartbeat / absence-reaper design — see lantern-cloud PR #2792.

Why

The API previously had only a one-shot positive signal per (arm, device) — no way to learn from failure. For a circumvention proxy that's a serious gap: when the proxy is IP-blocked / SNI-blocked / DPI-dropped, the proxy itself sees nothing because the client never reaches it. Only absence of expected heartbeats can reveal the censorship event.

The fix is two-sided: the API tracks a deadline per (arm, device) and turns missed heartbeats into a flat negative EXP3 reward; the proxy must re-emit on a short cadence so absence is detected within ~minutes, not hours. This PR is the proxy half.

API heartbeat window is 90s; 60s here leaves ~30s of slack for scheduling/network jitter.

Test plan

  • go test ./banditcallback/... green
  • After merge + nightly debs, deploy on staging proxy fleet; confirm in SigNoz that arm callbacks fan out per-device on ~60s cadence while a client is active
  • Confirm absence on a quiesced arm trips the API's new absence-reaper (lantern-cloud PR #2792)

🤖 Generated with Claude Code

…tbeat

The lantern-cloud API now interprets absence of arm callbacks as a
negative reward signal for the EXP3 bandit. That's the only signal the
API can synthesize for censorship blocking: when a proxy is IP-blocked,
SNI-blocked, or DPI-dropped at the network layer, the proxy itself sees
nothing — the client never reaches it. Only the silence of expected
heartbeats reveals the event.

For absence to be detected promptly, the emitter must re-fire callbacks
on a short cadence while a device is actively using the proxy. Drop the
default TTL from 10 min to 60 s; the API-side heartbeat window is 90 s,
so a healthy 60s-cadence device always lands before the absence-reaper
deadline with ~30 s of jitter slack.

Operators who pinned --banditcallbackttl explicitly are unaffected.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@reflog reflog merged commit 7f088dc into main May 22, 2026
1 check passed
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