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

common: don't consume deterministic randbytes stream for trace ids

Public commit record

What the developer wrote

Authored by ShahanaFarooqui

83/100 · Strong
common: don't consume deterministic randbytes stream for trace ids

Trace/span ids now come from a plain counter when CLN_DEV_ENTROPY_SEED is active, so tracing (which CI's HAVE_USDT=1 build enables by default) no longer shifts the deterministic RNG stream that PSBT serial ids and locktime fuzz are drawn from.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This change fixes a subtle bug in Core Lightning's tracing code. When running with a special developer-only deterministic randomness override (CLN_DEV_ENTROPY_SEED), trace IDs were being drawn from the same predictable random stream used for actual transaction details like PSBT serial IDs and locktime fuzzing. Because tracing may be enabled or disabled depending on build settings, this meant the same test or operation could produce different transaction outputs depending on whether tracing was compiled in. The fix makes trace IDs use a separate simple counter when deterministic mode is active, so tracing no longer shifts the random stream and transaction results stay consistent.

Recommended action

Treat as a low-severity correctness/reproducibility fix. No immediate production security response is required because CLN_DEV_ENTROPY_SEED is a developer/testing-only override. Review whether any other observability or diagnostic code paths consume pseudorand_u64() under deterministic mode and could similarly perturb reproducible transaction generation or fuzzing.

Security signals we found

01

Deterministic RNG stream contamination by observability code

02

Transaction output divergence between instrumented and non-instrumented builds

03

Developer-only entropy override affecting reproducibility of transaction generation

04

Potential for non-deterministic test failures or inconsistent fuzzing/coverage results

Risk score

Why this scored 37/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 6/15
Affected reach 7/15
Confidence 7/10
Evidence quality 4/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.