AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 34 Bitcoin

global: use clock_time in place of time_now().

Public commit record

What the developer wrote

Authored by Rusty Russell

60/100 · Adequate
global: use clock_time in place of time_now().

Except for tracing, that sticks with time_now().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit swaps most uses of the real-time clock function `time_now()` for a new internal helper called `clock_time()`. The change is infrastructure, not a fix for a known attack. It makes the node’s view of time easier to override for testing and reproducibility, and it reduces the risk that a backward clock jump confuses timers, logs, or payment expiry checks. Tracing is deliberately left on real time. There is no direct security bug being patched here, but the change touches many time-sensitive parts of a payment system, so it has broad defensive value.

Recommended action

Treat as a routine defensive refactor. Review the new `common/clock_time.h` implementation (not shown in the diff) to confirm that `clock_time()` and `clock_time_progresses()` behave correctly under `CLN_DEV_SET_TIME`, especially around invoice/payment expiry and HTLC timeouts. Ensure CI still passes and that no remaining `time_now()` call outside `common/trace.c` was missed by the linter.

Security signals we found

01

Mass replacement of wall-clock source with an internal, overridable clock abstraction

02

Makefile lint rule now treats `time_now()` as a discouraged function

03

Tracing explicitly exempted from the new clock because it needs real wall time

04

Coin movements use `clock_time_progresses()` to guarantee non-decreasing timestamps

05

No explicit vulnerability, CVE, or security advisory referenced in commit message

Risk score

Why this scored 34/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.