Skip to content

Make closeTimeMs the full close time in milliseconds - #317

Merged
SirTyson merged 1 commit into
stellar:mainfrom
SirTyson:ms-close-time-full-ms
Aug 28, 2026
Merged

Make closeTimeMs the full close time in milliseconds#317
SirTyson merged 1 commit into
stellar:mainfrom
SirTyson:ms-close-time-full-ms

Conversation

@SirTyson

Copy link
Copy Markdown
Contributor

Follow-up to #316, tracking the update to CAP-0088 in stellar/stellar-protocol#1999.

closeTimeMs now carries the full close time in milliseconds since the Unix epoch, rather than only the sub-second component in [0, 999]. closeTime is 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:

closeTime == closeTimeMs / 1000

Changes:

  • Stellar-types.x: new TimePointMilliseconds typedef (uint64, milliseconds since epoch), mirroring TimePoint (whole seconds). Gated behind MS_CLOSE_TIME like the arms that use it, so it appears in the generated next branch only and curr is untouched.
  • Stellar-ledger.x: both STELLAR_VALUE_SIGNED_MS and STELLAR_VALUE_EMPTY_TX_SET_MS carry TimePointMilliseconds closeTimeMs instead of uint32 closeTimeMs.

Rationale, as in the CAP: a self-contained ms timestamp lets downstream consumers use closeTimeMs directly without recombining two fields, while closeTime stays redundant for anything that only reasons in whole seconds. The redundancy is validated by core (a value whose closeTime != closeTimeMs / 1000 is rejected).

Core-side implementation: stellar/stellar-core#5423.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings August 27, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StellarValue arms 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.

@SirTyson
SirTyson merged commit 03cbf40 into stellar:main Aug 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants