getHealth: return LedgerCloseTime in response#797
Merged
Conversation
0585ad8 to
fcf6eb6
Compare
This was referenced Jun 19, 2026
fcf6eb6 to
d3715bc
Compare
Shaptic
requested changes
Jun 24, 2026
Pulls in stellar/go-stellar-sdk#5958. fc9acb3f is the current SDK main tip; no tagged release includes it yet.
…response Expose the latest and oldest ledgers' close times (unix seconds) on the getHealth response, populated from the ledger range already available to the handler, so clients can gauge ledger freshness from the lightweight health endpoint.
cd63f57 to
bb7b925
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This draft PR updates the getHealth JSON-RPC handler to return ledger close time(s) alongside the existing ledger range fields, enabling clients to measure chain-tip freshness without calling the heavyweight getLatestLedger endpoint.
Changes:
- Populate
latestLedgerCloseTime(and alsooldestLedgerCloseTime) in thegetHealthresponse. - Extend the health integration test to assert close-time fields are present and monotonic.
- Add an Unreleased changelog entry and bump
github.com/stellar/go-stellar-sdkto a newer pseudo-version.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Bumps go-stellar-sdk dependency version. |
| go.sum | Updates checksums for the bumped go-stellar-sdk version. |
| cmd/stellar-rpc/internal/methods/get_health.go | Adds close-time fields to the GetHealthResponse struct literal. |
| cmd/stellar-rpc/internal/integrationtest/health_test.go | Adds assertions for the new close-time fields. |
| CHANGELOG.md | Documents new getHealth response fields under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Shaptic
approved these changes
Jun 25, 2026
Shaptic
reviewed
Jun 25, 2026
Shaptic
reviewed
Jun 25, 2026
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.
Resolves #798
What
Populates the new
latestLedgerCloseTimeandoldestLedgerCloseTimefields on thegetHealthresponse with the close times (unix seconds) of the latest and oldest ingested ledgers.Why
Lets clients read ledger close times from the lightweight
getHealthprobe. Previously the only way to obtain a ledger's close time wasgetLatestLedger, which always returns the fullheaderXdr+metadataXdrof the ledger (multiple MB on active ledgers) — unsuitable for frequent health/monitoring polling.Both values (
ledgerRange.LastLedger.CloseTime/ledgerRange.FirstLedger.CloseTime) are already loaded for the existing latency check, so there is no additional cost.oldestLedgerCloseTimewas added for parity with the existinglatestLedger/oldestLedgerpair (requested in review on the SDK PR).SDK dependency
Depends on stellar/go-stellar-sdk#5958 (now merged), which adds both
LatestLedgerCloseTimeandOldestLedgerCloseTimetoGetHealthResponse.No tagged
go-stellar-sdkrelease includes #5958 yet, sogo.modis bumped to the post-mergemainpseudo-version (v0.6.1-0.20260624185910-fc9acb3f1ba6) and the temporary forkreplacehas been dropped. To be re-pinned to a tagged release once one is cut.Additive, backward-compatible change.