Skip to content

feat: periodic public-ip heartbeat to super admin (liveness) - #728

Open
johnson-johns-codes-openez wants to merge 3 commits into
stakwork:masterfrom
johnson-johns-codes-openez:feat/public-ip-heartbeat
Open

feat: periodic public-ip heartbeat to super admin (liveness)#728
johnson-johns-codes-openez wants to merge 3 commits into
stakwork:masterfrom
johnson-johns-codes-openez:feat/public-ip-heartbeat

Conversation

@johnson-johns-codes-openez

@johnson-johns-codes-openez johnson-johns-codes-openez commented Aug 15, 2026

Copy link
Copy Markdown

Summary

Completes the follow-up noted in #727. The public-IP reporting flow already exists (swarms report on IP change every 5 min; superadmin updates route53). This PR makes it a true periodic heartbeat as the Sphinx bounty text describes ("swarms should ping its own IP to superadmin once every 5 minutes"):

  • Swarm side (src/service/public_ip.rs): always reports the current public IP to superadmin every 5 min, even when unchanged. Superadmin-side route53 updates still only happen when the IP actually changed (unchanged IP returns early with "no update needed"). Stack config is only rewritten to disk when the IP actually changed.
  • Super side (src/bin/super/service/child_swarm/update_public_ip.rs): records RemoteStack.last_heartbeat_at (unix seconds) on every heartbeat — both unchanged-IP pings and IP-change updates — giving superadmin a per-swarm liveness signal that can feed the alerting ideas in superadmin: Alerts for ec2 or services going down #553.
  • SuperAdmin UI (src/bin/super/superapp): new "Last Heartbeat" column in the Live Swarms table (formatted timestamp, "never" if no heartbeat recorded yet).

Verification

  • cargo check --bins — clean
  • cargo test --lib — 26 passed
  • cargo test --bin super child_swarm::update_public_ip — 4 passed
  • svelte-check — 0 new errors vs baseline (repo has 19 pre-existing)
  • vite build — succeeds, same result as baseline

Existing RemoteStack serialization is backward compatible (#[serde(skip_serializing_if = "Option::is_none")] on the new field; all initializers updated).

Swarms now report their public IP to super admin every 5 minutes even
when unchanged, not only on IP change. Super admin records the last
heartbeat timestamp (RemoteStack.last_heartbeat_at) and still only
touches route53 when the IP actually changed. Gives super admin a
liveness signal per swarm, which can feed the stakwork#553 alerting work.

Refs: stakwork#727
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