Skip to content

fix(network): measure node data sizes from inside the k3d node - #922

Merged
OisinKyne merged 2 commits into
mainfrom
fix/network-data-size
Nov 30, 2026
Merged

OisinKyne merged 2 commits into
mainfrom
fix/network-data-size

Conversation

@OisinKyne

Copy link
Copy Markdown
Contributor

obol network status showed "Data exec unknown · cons unknown": local-path PVC directories belong to each client's uid (often 10001 or root, mode 2770), so the CLI's walk as the user counted nothing.

When the host walk can't read a node's execution-/consensus- dirs, obol now runs one read-only du -sk -- /data/<ns>/<pvc>... inside the k3d node container (paths as separate argv, no shell; 20s bound; follows Ctrl-C). k3d backend only; anything still unreadable stays "unknown". Sizes are allocated KiB from du, cached for a minute as before.

obol network status showed "Data exec unknown · cons unknown": local-path
PVC directories belong to each client's uid (often 10001 or root, mode
2770), so the CLI's walk as the user counted nothing.

When the host walk can't read a node's execution-*/consensus-* dirs, obol
now runs one read-only `du -sk -- /data/<ns>/<pvc>...` inside the k3d node
container (paths as separate argv, no shell; 20s bound; follows Ctrl-C).
k3d backend only; anything still unreadable stays "unknown". Sizes are
allocated KiB from du, cached for a minute as before.
… on disk

One-shot network status took ~5 s warm / ~18 s cold after the node du
landed (rc0: 0.25 s).

- data sizes are cached in <StateDir>/network/sizes.json (0600, atomic,
  keyed by namespace and data dir); a size under 5 min old skips du
- on a TTY the first frame draws at once and fills in as probes finish
  (pending parts show a spinner, e.g. "Data  measuring... · 1.2 TiB
  free"); a stale size is shown marked "(2h ago, refreshing...)" and the
  run waits at most 3 s for the refresh, then a detached
  `obol network status --refresh-sizes` updates the cache (one at a time,
  lock file; up to 15 min so large nodes get measured)
- output taller than the terminal falls back to printing once; Ctrl-C
  restores the cursor
- JSON, pipes, NO_COLOR and dumb terminals: unchanged (wait, print once,
  same exit codes); JSON storage gains measured_at and stale
- --watch fills its first tick progressively and re-measures in the
  background without blanking values
@OisinKyne
OisinKyne merged commit fee2326 into main Nov 30, 2026
15 checks passed
@OisinKyne
OisinKyne deleted the fix/network-data-size branch November 30, 2026 14:09
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