Skip to content

Faketime work#3503

Draft
OlufemiAdeOlusile wants to merge 3 commits into
masterfrom
faketime-work
Draft

Faketime work#3503
OlufemiAdeOlusile wants to merge 3 commits into
masterfrom
faketime-work

Conversation

@OlufemiAdeOlusile

Copy link
Copy Markdown
Collaborator

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 before exec cardano-node run in generated cardano-node-poolN wrappers only (bft1 and tx-generator untouched).
  • flake.nix — add pkgs.libfaketime to 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 that faketime is on PATH.

Env contract

Variable Purpose
TIME_DRIFT_POOL Pool index (1, 2, or 3); unset = no drift
TIME_DRIFT_SPEC libfaketime string, e.g. +0 x1.008 (gradual, no boot offset)
LIBFAKETIME_PATH Override .so path (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

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

1 participant