protocols/rpc: Add LatestLedgerCloseTime to GetHealthResponse#5958
Open
felixl256 wants to merge 1 commit into
Open
protocols/rpc: Add LatestLedgerCloseTime to GetHealthResponse#5958felixl256 wants to merge 1 commit into
felixl256 wants to merge 1 commit into
Conversation
b0b0b72 to
e090348
Compare
Author
|
Server-side consumer (populates the field on the |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an additional timestamp field to the RPC protocol type for getHealth, allowing consumers to determine ledger freshness without calling heavier endpoints.
Changes:
- Extend
protocols/rpc.GetHealthResponsewithLatestLedgerCloseTime(unix seconds) and add godoc. - Add a Pending changelog entry describing the new response field.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| protocols/rpc/get_health.go | Adds LatestLedgerCloseTime to the getHealth response struct. |
| CHANGELOG.md | Documents the new GetHealthResponse field under Pending features. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
|
Tracking issue: stellar/stellar-rpc#798 |
Expose the latest ledger's close time (unix seconds) on the getHealth response. The value is already available to the RPC server; surfacing it lets clients assess ledger freshness from the lightweight health endpoint without fetching full ledger metadata via getLatestLedger.
bf8dc71 to
8c1d885
Compare
felixl256
added a commit
to felixl256/stellar-rpc
that referenced
this pull request
Jun 19, 2026
The getHealth handler depends on LatestLedgerCloseTime, added in stellar/go-stellar-sdk#5958 (not yet released). Point the module at the fork commit so this builds; remove this replace and bump to the released SDK version before merging.
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.
PR Checklist
PR Structure
services/friendbot, orallordocif the changes are broad or impact many packages.Thoroughness
Release planning
CHANGELOG.md.main.What
Adds a
LatestLedgerCloseTimefield (unix timestamp, in seconds) toprotocols/rpc.GetHealthResponse.Why
The RPC
getHealthmethod already returnslatestLedger, but not the time at which that ledger closed. Consumers that want to assess ledger freshness from the lightweight health endpoint currently have to additionally callgetLatestLedger, which always returns the fullheaderXdr+metadataXdrof the ledger (multiple MB on active ledgers) — far too heavy for a health/monitoring probe.The close time is the natural companion to
latestLedger. Naming and format mirror the existing top-levellatestLedgerCloseTimefield already present inGetLedgersResponse(plainint64unix seconds).Server-side population is added in a follow-up PR in stellar/stellar-rpc.
Known limitations
N/A — additive, backward-compatible field (existing clients ignore the new field).