Skip to content

Add support for time shifting inside the container#921

Draft
leighmcculloch wants to merge 6 commits into
mainfrom
allow-fake-time
Draft

Add support for time shifting inside the container#921
leighmcculloch wants to merge 6 commits into
mainfrom
allow-fake-time

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch commented Mar 25, 2026

What

Install faketime in the container image and configure libfaketime via ld.so.preload so all processes see the modified time. Expose time control through /etc/faketimerc, defaulting to +0 (no modification). Pass FAKETIME_NO_CACHE through to supervisord so changes take effect immediately. Document time manipulation via volume-mounted config, offset syntax, progressive jumps, and speed multipliers.

Why

Testing time-sensitive Stellar network behavior (e.g. ledger close times, expiry) requires advancing the clock without affecting the host or restarting the container. libfaketime intercepts time calls at the libc level, making it transparent to all services.

This probably doesn't allow for testing all time movement situations, but it's a simple way to provide some ability to do that with quickstart. Generally the soroban-sdk test framework is still the best place to codify tests that involve time changing.

Close stellar/stellar-protocol#1897

@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Mar 25, 2026
@leighmcculloch leighmcculloch marked this pull request as ready for review March 25, 2026 01:30
Copilot AI review requested due to automatic review settings March 25, 2026 01:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds container-wide time shifting support for Stellar Quickstart by integrating libfaketime and documenting how to control the fake time via /etc/faketimerc.

Changes:

  • Install faketime-related packages in the image and preload libfaketime for all processes.
  • Add a default /etc/faketimerc and pass FAKETIME_NO_CACHE through to supervisord-launched services.
  • Document how to modify time in a running container via a bind-mounted faketimerc file.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
start Passes FAKETIME_NO_CACHE into the clean supervisord environment.
dependencies Adds a faketime package to the apt install list.
Dockerfile Attempts to symlink and preload libfaketime.so.1, sets FAKETIME_NO_CACHE=1, and copies /etc/faketimerc.
faketimerc Introduces the default faketime configuration file content.
README.md Documents time modification usage and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread start Outdated
Comment thread dependencies Outdated
Comment thread Dockerfile
Comment thread faketimerc
Comment thread README.md
@leighmcculloch leighmcculloch marked this pull request as draft March 25, 2026 01:54
@leighmcculloch
Copy link
Copy Markdown
Member Author

leighmcculloch commented Mar 25, 2026

Todo:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

2 participants