feat: periodic public-ip heartbeat to super admin (liveness) - #728
Open
johnson-johns-codes-openez wants to merge 3 commits into
Open
feat: periodic public-ip heartbeat to super admin (liveness)#728johnson-johns-codes-openez wants to merge 3 commits into
johnson-johns-codes-openez wants to merge 3 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"):
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.src/bin/super/service/child_swarm/update_public_ip.rs): recordsRemoteStack.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.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— cleancargo test --lib— 26 passedcargo test --bin super child_swarm::update_public_ip— 4 passedsvelte-check— 0 new errors vs baseline (repo has 19 pre-existing)vite build— succeeds, same result as baselineExisting
RemoteStackserialization is backward compatible (#[serde(skip_serializing_if = "Option::is_none")]on the new field; all initializers updated).