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

common: don't trigger siphash_seed() init from span hashing either.

Public commit record

What the developer wrote

Authored by ShahanaFarooqui

73/100 · Adequate
common: don't trigger siphash_seed() init from span hashing either.

Previous commit stopped trace ids consuming the deterministic
randbytes stream, but tracing still touched it once: span_key_hash()
calls siphash_seed(), whose lazy init draws 16 bytes from the stream.
Since randbytes call sites are assigned their offset blocks in
first-use order, that single draw shifts every later draw in the
process by 1000 when tracing is active (HAVE_USDT builds, as in CI):
keysend preimages and invoicerequest payer keys then differ from a
build with tracing disabled, showing up as an 11-file doc-examples
diff.

Use a cheap multiplicative hash for span keys when the deterministic
override is active, so tracing touches the RNG stream zero times.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a small bug-fix commit in Core Lightning's tracing code. It fixes a situation where enabling tracing accidentally changed the sequence of random numbers used elsewhere in the program, causing test outputs to differ between builds with and without tracing. The change makes tracing use a simple math hash instead of a randomness-seeded hash when deterministic mode is active. There is no direct security vulnerability here; it is a determinism/reproducibility fix.

Recommended action

No urgent security action required. Treat as a normal correctness/reproducibility fix. Reviewers may want to verify that the multiplicative hash provides adequate distribution for the span hash table in deterministic test scenarios, and that no other tracing code paths still consume randbytes in deterministic mode.

Security signals we found

01

No direct memory safety issue

02

No input validation bypass

03

No authentication or authorization change

04

Fixes deterministic/reproducibility behavior under tracing

05

Avoids unintended RNG stream consumption by tracing instrumentation

Risk score

Why this scored 19/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 2/15
Affected reach 3/15
Confidence 8/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.