Make closeTimeMs the full close time in milliseconds - #317
Merged
Conversation
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 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates millisecond close times to represent full Unix-epoch timestamps, aligning XDR with CAP-0088.
Changes:
- Adds gated
TimePointMilliseconds. - Updates both millisecond
StellarValuearms to use it.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Stellar-types.x |
Defines the gated millisecond timestamp type. |
Stellar-ledger.x |
Uses full millisecond timestamps in both _MS arms. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
marta-lokhova
approved these changes
Aug 28, 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.
Follow-up to #316, tracking the update to CAP-0088 in stellar/stellar-protocol#1999.
closeTimeMsnow carries the full close time in milliseconds since the Unix epoch, rather than only the sub-second component in[0, 999].closeTimeis unchanged: it remains the whole-second value that every non-consensus protocol feature (time bounds, sequence age, claim predicates, Soroban timestamps, upgrade scheduling) keeps reading, and the two fields must agree:Changes:
Stellar-types.x: newTimePointMillisecondstypedef (uint64, milliseconds since epoch), mirroringTimePoint(whole seconds). Gated behindMS_CLOSE_TIMElike the arms that use it, so it appears in the generatednextbranch only andcurris untouched.Stellar-ledger.x: bothSTELLAR_VALUE_SIGNED_MSandSTELLAR_VALUE_EMPTY_TX_SET_MScarryTimePointMilliseconds closeTimeMsinstead ofuint32 closeTimeMs.Rationale, as in the CAP: a self-contained ms timestamp lets downstream consumers use
closeTimeMsdirectly without recombining two fields, whilecloseTimestays redundant for anything that only reasons in whole seconds. The redundancy is validated by core (a value whosecloseTime != closeTimeMs / 1000is rejected).Core-side implementation: stellar/stellar-core#5423.
🤖 Generated with Claude Code