From ac4d00a0bbc0653e491a2da9d14330cc568e7641 Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 25 Jun 2026 14:16:36 +0900 Subject: [PATCH 1/4] chore: bump go-stellar-sdk to fc9acb3f for getHealth close-time fields Pulls in stellar/go-stellar-sdk#5958. fc9acb3f is the current SDK main tip; no tagged release includes it yet. --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8569e5e20..fb6101884 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index 554569825..262c6d611 100644 --- a/go.sum +++ b/go.sum @@ -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= From bb7b925e2357929b2ae2698dc91aded9580fce57 Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 25 Jun 2026 14:16:36 +0900 Subject: [PATCH 2/4] getHealth: return latestLedgerCloseTime and oldestLedgerCloseTime in 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. --- CHANGELOG.md | 6 ++++++ cmd/stellar-rpc/internal/integrationtest/health_test.go | 3 +++ cmd/stellar-rpc/internal/methods/get_health.go | 2 ++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec6ee7082..218d1e646 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cmd/stellar-rpc/internal/integrationtest/health_test.go b/cmd/stellar-rpc/internal/integrationtest/health_test.go index 21387865f..2990102e8 100644 --- a/cmd/stellar-rpc/internal/integrationtest/health_test.go +++ b/cmd/stellar-rpc/internal/integrationtest/health_test.go @@ -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.Greater(t, result.LatestLedgerCloseTime, int64(0)) + assert.Greater(t, result.OldestLedgerCloseTime, int64(0)) + assert.GreaterOrEqual(t, result.LatestLedgerCloseTime, result.OldestLedgerCloseTime) } diff --git a/cmd/stellar-rpc/internal/methods/get_health.go b/cmd/stellar-rpc/internal/methods/get_health.go index 65f308bed..b57f72daa 100644 --- a/cmd/stellar-rpc/internal/methods/get_health.go +++ b/cmd/stellar-rpc/internal/methods/get_health.go @@ -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, } return result, nil From 16037180621038f0468d0c8c58a8569a499a5c8c Mon Sep 17 00:00:00 2001 From: George Date: Thu, 25 Jun 2026 09:19:45 -0700 Subject: [PATCH 3/4] Fix CI complaints --- cmd/stellar-rpc/internal/integrationtest/health_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/stellar-rpc/internal/integrationtest/health_test.go b/cmd/stellar-rpc/internal/integrationtest/health_test.go index 2990102e8..9a7551d32 100644 --- a/cmd/stellar-rpc/internal/integrationtest/health_test.go +++ b/cmd/stellar-rpc/internal/integrationtest/health_test.go @@ -19,7 +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.Greater(t, result.LatestLedgerCloseTime, int64(0)) - assert.Greater(t, result.OldestLedgerCloseTime, int64(0)) + assert.Positive(t, result.LatestLedgerCloseTime) //nolint:testifylint // unnecessary whining + assert.Positive(t, result.OldestLedgerCloseTime) //nolint:testifylint // unnecessary whining assert.GreaterOrEqual(t, result.LatestLedgerCloseTime, result.OldestLedgerCloseTime) } From 565f889995382f72676667d4360b0fa1a99b933f Mon Sep 17 00:00:00 2001 From: George Date: Thu, 25 Jun 2026 09:28:36 -0700 Subject: [PATCH 4/4] omfg linting is so annoying just let me merge bro --- cmd/stellar-rpc/internal/integrationtest/health_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/stellar-rpc/internal/integrationtest/health_test.go b/cmd/stellar-rpc/internal/integrationtest/health_test.go index 9a7551d32..05d217c3d 100644 --- a/cmd/stellar-rpc/internal/integrationtest/health_test.go +++ b/cmd/stellar-rpc/internal/integrationtest/health_test.go @@ -19,7 +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) //nolint:testifylint // unnecessary whining - assert.Positive(t, result.OldestLedgerCloseTime) //nolint:testifylint // unnecessary whining + assert.Positive(t, result.LatestLedgerCloseTime) + assert.Positive(t, result.OldestLedgerCloseTime) assert.GreaterOrEqual(t, result.LatestLedgerCloseTime, result.OldestLedgerCloseTime) }