Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog


## Unreleased

### Added
* `getHealth` now returns `latestLedgerCloseTime` and `oldestLedgerCloseTime`, the unix timestamps (seconds) at which the latest and oldest ledgers closed. This lets clients assess ledger freshness from the lightweight health endpoint without fetching full ledger metadata via `getLatestLedger` ([#797](https://github.com/stellar/stellar-rpc/pull/797)).


## [v27.0.0](https://github.com/stellar/stellar-rpc/compare/v26.0.1...v27.0.0)

### Breaking Changes
Expand Down
3 changes: 3 additions & 0 deletions cmd/stellar-rpc/internal/integrationtest/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ func TestHealth(t *testing.T) {
assert.Greater(t, result.OldestLedger, uint32(0))
assert.Greater(t, result.LatestLedger, uint32(0))
assert.GreaterOrEqual(t, result.LatestLedger, result.OldestLedger)
assert.Positive(t, result.LatestLedgerCloseTime)
assert.Positive(t, result.OldestLedgerCloseTime)
assert.GreaterOrEqual(t, result.LatestLedgerCloseTime, result.OldestLedgerCloseTime)
}
2 changes: 2 additions & 0 deletions cmd/stellar-rpc/internal/methods/get_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ func NewHealthCheck(
result := protocol.GetHealthResponse{
Status: "healthy",
LatestLedger: ledgerRange.LastLedger.Sequence,
LatestLedgerCloseTime: ledgerRange.LastLedger.CloseTime,
OldestLedger: ledgerRange.FirstLedger.Sequence,
OldestLedgerCloseTime: ledgerRange.FirstLedger.CloseTime,
LedgerRetentionWindow: retentionWindow,
Comment thread
felixl256 marked this conversation as resolved.
}
return result, nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stellar/go-stellar-sdk v0.6.1-0.20260618191317-308407eca8c6
github.com/stellar/go-stellar-sdk v0.6.1-0.20260624185910-fc9acb3f1ba6
github.com/stretchr/testify v1.11.1
Comment thread
felixl256 marked this conversation as resolved.
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=
github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=
github.com/stellar/go-stellar-sdk v0.6.1-0.20260618191317-308407eca8c6 h1:UiPdd65wjndoURfq4+55UH1VCgCyCCdX0bMqr3LIo5k=
github.com/stellar/go-stellar-sdk v0.6.1-0.20260618191317-308407eca8c6/go.mod h1:IkcqcrE9UQi7n/1y+MxKB+7qzdjG1T2kGOD7Ss8dqjw=
github.com/stellar/go-stellar-sdk v0.6.1-0.20260624185910-fc9acb3f1ba6 h1:NL5m+E+Ln5/HAYenkgyr/kI5xmgGOQ+BMRFktjl1eIw=
github.com/stellar/go-stellar-sdk v0.6.1-0.20260624185910-fc9acb3f1ba6/go.mod h1:IkcqcrE9UQi7n/1y+MxKB+7qzdjG1T2kGOD7Ss8dqjw=
github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364 h1:gOKrfuWdZ92LFlv0TAwgZ7OsWKeBsOMDlGLyFgduI1w=
github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364/go.mod h1:If+U9Z1W5xU97VrOgJandQT+2dN7/iOpkCrxBJEyF80=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
Loading