observability for the testnet outages, and members that resume across a key rotation #569
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 511 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.373
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #569"
general
weight: 0.35
aojea
Follow-up to #563, from debugging three testnet outages in a week. Two kinds of change: making each failure visible and alertable, and covering the key-rotation cases with tests, which found one more bug.
What was invisible
A router on bananas refused every new connection from one node's egress IP for a day. libp2p's resource manager closes such a connection before TLS, the dialer sees "stream closed while reading 0/1 bytes", and the per-IP and rate-limit paths return plain errors its metrics do not count. The router's log showed nothing; its
Router Online. PeerIDline had rotated away under a flood of one peer's failed handshakes (which is also what broke the DNS sync job, fixed in #563).router:the resource manager is always wrapped, whether the cap is--conns-per-source-ipor libp2p's default. Each inbound refusal counts insam_router_inbound_connections_refused_total{reason}(per_ip_limit,rate_limit,scope_limit,other) and is logged once a minute per source IP;sam_router_conns_per_source_ip_limitexports the cap in force. The identity line is repeated hourly; a peer whose credential keeps failing is logged once a minute instead of on every retry.control-plane:sam_control_plane_signing_keys(1, or 2 during a grace period) andsam_control_plane_retiring_key_expiry_timestamp_seconds. Two outages were rotations and nothing exported said when one had happened.deploy:the SDK canary verdict carries adetailfield with the per-router lines under the error (NO_RESERVATION,resolved to no address, a closed stream), so a failure names the router without rerunning the example by hand.deploy:seven Managed PrometheusRules, one per failure seen: a router refusing inbound connections, handshakes failing for an hour, a router lease not renewed, no active router, a signing key set that is not one current key plus at most one retiring, an unreadable store, a canary not ready for 20 minutes. Every expression was checked against the GMP query API on the testnet project.Tests for members that were offline during a rotation
Every rotation bug so far was a restart case found on a testnet; the existing tests kept every member running.
tests/integration/rotation_offline_test.goenrolls each SDK member and a Go node, stops them, rotates with real routers refreshing under the new key, and starts each again from its persisted state:TestKeyRotationWhileMembersOffline: within the grace period, with no token available. Each must resume as the same identity, be admitted by every router, hold a credential signed by the new key only, and reach the node. Removing the pre-join pull from either SDK or the pre-start sync from the node fails it at that member.TestKeyRotationPastGraceWhileMembersOffline: after the retiring key has left/keys, with a fresh token available.The bug the second test found
A member off for longer than the grace period holds a credential no current key signed and a trusted set no current key is in. Both SDKs resumed it on time-to-live alone; the pre-join
/keyspull could not be verified, and join failed at every router with a message blaming the routers' credentials, while the token beside the state directory (every canary has its projected service account token) was never used. With the default grace period of an hour and credentials of a day, any member off for a day lands here. The Go node already re-enrolls in this case.enroll()now pulls/keysbefore resuming, verified against the saved set: verified, adopt and resume; signed by no saved key (KeysNotTrustedError, now typed), enroll again as the saved identity with the token given or raiseCredentialRetiredError; unreachable, resume as before. Unit tests cover the three outcomes in each SDK; reverting the decision in either SDK fails the past-grace integration test at that member.Not addressed here: why the router's per-IP connection count drifted from the sockets it held (go-libp2p v0.49 resource manager). The new counter and alert make the next occurrence visible at once.