feat(telemetry): ISO-8601 last_successful_submission on /api/v1/status - #32
Closed
erkancamli wants to merge 1 commit into
Closed
erkancamli wants to merge 1 commit into
erkancamli wants to merge 1 commit into
Conversation
…i/v1/status Closes QuipNetwork#27 The controller snapshot already tracks the wall-clock time of the last accepted submission (pool.py), but /api/v1/status surfaced it as a raw time.time() float. QuipNetworkgh-27 asks for an ISO timestamp so operators can read staleness at a glance. - render the field as ISO-8601 UTC (null before the first accepted submission); invalid or missing snapshot values map to null instead of breaking the whole status response - keep the raw value alongside as last_successful_submission_epoch for consumers that compute staleness arithmetically - document is_mining, last_successful_submission(_epoch), consecutive_submit_failures and runtime_incompatible in docs/rest-api.md - tests: helper edge cases, and an end-to-end telemetry process check that the endpoint returns ISO + epoch, and null for both before the first accepted submit
Author
|
Closing this: it patches files that no longer exist on
The request behind it is still unmet in the Rust coordinator, so I have left the specifics on #27 rather than keeping a stale PR open here. |
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.
Closes #27
What
/api/v1/statusnow reportslast_successful_submissionas an ISO-8601 UTC timestamp (nullbefore the first accepted submission), as requested in #27, and the field is documented.The underlying tracking already existed:
ValidatorPoolstampslast_successful_submission = time.time()on every accepted submit and the controller snapshot carries it through. The endpoint just surfaced the raw float, and none of the liveness fields were indocs/rest-api.md.Changes
substrate/telemetry_process.py_epoch_to_iso()helper: epoch seconds →datetime.fromtimestamp(ts, tz=timezone.utc).isoformat();None, non-numeric,NaNor out-of-range values map tonullso a corrupt snapshot value never breaks the whole status response.last_successful_submissionis now the ISO string.last_successful_submission_epochfor consumers that compute staleness arithmetically (I checkeddashboard.quip.network,nodes.quip.networkandcheck.quip.network; none of them read the field yet, so this is the moment to switch the format without breaking anyone).docs/rest-api.md: documentsis_mining,last_successful_submission,last_successful_submission_epoch,consecutive_submit_failuresandruntime_incompatiblewith an example payload, so operators know how to read a "mining but not landing" node.tests/test_telemetry_process.pytest_epoch_to_iso_renders_utc_or_none: helper edge cases.test_telemetry_status_reports_last_successful_submission_as_iso: spins up the telemetry process against a snapshot file and checks ISO + epoch, then rewrites the snapshot without the field and checks both arenull.Example
{ "is_mining": true, "last_successful_submission": "2026-09-07T18:42:11.503219+00:00", "last_successful_submission_epoch": 1788806531.503219, "consecutive_submit_failures": 0, "runtime_incompatible": null }Acceptance criteria from #27
nullbefore the first accepted submission: yes.ValidatorPoolright afterconfirm_success()on the submit path only.Testing
python -m pytest tests/test_telemetry_process.py(7 passed) and the full set of test files that touch the status endpoint or the pool (275 passed, 2 skipped).ruff checkclean on the touched files.