Skip to content

feat(antd): live network health on /health — write_ready, peer counts, last-store age (V2-1027) - #241

Draft
Nic-dorman wants to merge 1 commit into
mainfrom
nic/v2-1027-antd-health-write-readiness
Draft

feat(antd): live network health on /health — write_ready, peer counts, last-store age (V2-1027)#241
Nic-dorman wants to merge 1 commit into
mainfrom
nic/v2-1027-antd-health-write-readiness

Conversation

@Nic-dorman

Copy link
Copy Markdown
Member

Important

MERGE GATE — draft until WithAutonomi/saorsa-core#153 (V2-1036) merges. Without the recovery fix, a degraded client can report write_ready:false indefinitely with no runtime remedy (the repair path never heals), and REBOOTSTRAP_THRESHOLD in state.rs mirrors the saorsa-core const that #153 makes public.

What

Both health surfaces (REST /health, gRPC HealthService.Check) were static snapshots of startup state: a daemon with zero peers reported status:ok while every store failed (#232). They now report live network state:

  • write_ready: max(routing_table_size, connected_peers) >= threshold — best-effort write-path floor; the max() is load-bearing (client-mode routing tables under-report, see V2-1036)
  • connected_peers / routing_table_size / rebootstrap_threshold
  • last_store_ok_secs_ago: stamped on every successful store-type operation across all 7 REST + 7 gRPC write paths (null until the first success this process)

All fields are additive on both wire surfaces; status:ok semantics are untouched so existing liveness probes keep working. antd-rust models are updated in the same change (it regenerates from the shared proto and cannot lag); the other 15 SDKs are V2-1040.

Verification

  • antd 45/45, antd-rust 82/82, clippy clean
  • Verified live: peerless daemon (write_ready:false, rt 0), mainnet (write_ready:true, 5 peers), and a full devnet decay reproduction of the reporter's incident — timeline and evidence on V2-1027

Follow-ups

  • V2-1037: move the formula into ant-core; antd's network_health() becomes a pass-through and drops the mirrored const
  • V2-1040: 15-language SDK fan-out of the new fields

🤖 Generated with Claude Code

…, last-store age (V2-1027)

Both health surfaces (REST /health, gRPC HealthService.Check) were
static snapshots of startup state: a daemon with zero peers reported
status:ok while every store failed (ant-sdk#232). They now report:

- write_ready: max(routing_table_size, connected_peers) >= threshold —
  best-effort write-path floor; the max() is load-bearing (client-mode
  routing tables under-report, see V2-1036)
- connected_peers / routing_table_size / rebootstrap_threshold
- last_store_ok_secs_ago, stamped on every successful store-type
  operation across all 7 REST + 7 gRPC write paths (null until the
  first success this process)

All fields additive on both wire surfaces; status:ok semantics are
untouched so existing liveness probes keep working. antd-rust models
updated in the same change (it regenerates from the shared proto and
cannot lag); the other 15 SDKs are V2-1040.

MERGE GATE: do not merge before the matching saorsa-core recovery fix
lands (WithAutonomi/saorsa-core#153 / V2-1036). Without it a degraded
client can report write_ready:false indefinitely with no runtime
remedy (the repair path could never heal), and REBOOTSTRAP_THRESHOLD
in state.rs mirrors the saorsa-core const that #153 makes public.

Verified live: peerless daemon (write_ready:false, rt 0), mainnet
(write_ready:true, 5 peers), and a full devnet decay reproduction of
the reporter's incident — timeline and evidence on V2-1027.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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