From ed9881392edf86b532b58fb348b1fb575748c64e Mon Sep 17 00:00:00 2001 From: Garand Tyson Date: Thu, 27 Aug 2026 16:42:41 -0700 Subject: [PATCH] Make closeTimeMs the full close time in milliseconds CAP-0088 was updated (stellar/stellar-protocol#1999) so that closeTimeMs carries the full close time in milliseconds since the Unix epoch rather than only the sub-second component. closeTime remains the whole-second value used by every non-consensus protocol feature, and the two must agree: closeTime == closeTimeMs / 1000. Add an MS_CLOSE_TIME-gated TimePointMilliseconds typedef for it, mirroring TimePoint (whole seconds), and use it in both _MS StellarValue arms. Co-Authored-By: Claude Fable 5 --- Stellar-ledger.x | 4 ++-- Stellar-types.x | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Stellar-ledger.x b/Stellar-ledger.x index 77b3d30..7210331 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -61,13 +61,13 @@ struct StellarValue case STELLAR_VALUE_SIGNED_MS: struct { - uint32 closeTimeMs; // millisecond component of closeTime, [0, 999] + TimePointMilliseconds closeTimeMs; // closeTime == closeTimeMs / 1000 LedgerCloseValueSignature lcValueSignature; } signedMsValue; case STELLAR_VALUE_EMPTY_TX_SET_MS: struct { - uint32 closeTimeMs; // millisecond component of closeTime, [0, 999] + TimePointMilliseconds closeTimeMs; // closeTime == closeTimeMs / 1000 Hash txSetHash; Hash previousLedgerHash; uint32 previousLedgerVersion; diff --git a/Stellar-types.x b/Stellar-types.x index ac18496..79b127e 100644 --- a/Stellar-types.x +++ b/Stellar-types.x @@ -16,6 +16,10 @@ typedef hyper int64; typedef uint64 TimePoint; typedef uint64 Duration; +#ifdef MS_CLOSE_TIME +// Milliseconds since the Unix epoch. TimePoint is whole seconds. +typedef uint64 TimePointMilliseconds; +#endif // MS_CLOSE_TIME // An ExtensionPoint is always marshaled as a 32-bit 0 value. At a // later point, it can be replaced by a different union so as to