Faketime work#3503
Draft
OlufemiAdeOlusile wants to merge 3 commits into
Draft
Conversation
Inject optional clock-skew env vars into generated pool wrapper scripts via TIME_DRIFT_POOL and TIME_DRIFT_SPEC. When TIME_DRIFT_POOL=<N> and TIME_DRIFT_SPEC=<FAKETIME_string> are set at cluster start, pool N's wrapper exports LD_PRELOAD pointing at libfaketimeMT.so.1 and FAKETIME before exec-ing cardano-node. All other pools and bft1 are unaffected. Default-off: unset vars leave behaviour unchanged. Example: TIME_DRIFT_POOL=1 TIME_DRIFT_SPEC='+0 x1.008' make start-cluster
Add libfaketime prerequisite to README time-drift section and add an optional check for libfaketimeMT.so.1 in check_dev_env.sh.
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.
Summary
Adds optional clock skew on one pool node in a local dev cluster via
libfaketime(LD_PRELOAD+FAKETIME). Default-off: no env vars → unchanged behaviour. Local experiments only — not wired into CI or regression.Changes
cluster_scripts.py—_inject_time_drift_hook()inserts a conditional bash block beforeexec cardano-node runin generatedcardano-node-poolNwrappers only (bft1and tx-generator untouched).flake.nix— addpkgs.libfaketimeto the Nix dev shell.README.md— install matrix (Nix, apt x86_64/aarch64, Docker, macOS unsupported), env vars, example commands.check_dev_env.sh— optional check thatfaketimeis onPATH.Env contract
TIME_DRIFT_POOL1,2, or3); unset = no driftTIME_DRIFT_SPEC+0 x1.008(gradual, no boot offset)LIBFAKETIME_PATH.sopath (aarch64 apt, Nix if auto-detect fails)Usage
make cluster-scripts TIME_DRIFT_POOL=1 TIME_DRIFT_SPEC='+0 x1.008' make start-cluster make stop-cluster