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

bench: make `setup()` use single-iteration epochs

Public commit record

What the developer wrote

Authored by Lőrinc

68/100 · Adequate
bench: make `setup()` use single-iteration epochs

`setup()` in nanobench runs once per epoch, not once per timed call.
If an epoch executes the benchmark body multiple times, `setup()` can silently leave later iterations with different preconditions.

Make `setup()` force `epochIterations(1)` itself: keep rejecting incompatible larger explicit epoch sizes, but allow existing single-iteration callers such as `-sanity-check`.

With `setup()` handling this centrally, remove the redundant `epochIterations(1)` calls from the benchmarks that use it.

Co-authored-by: David Gumberg <davidzgumberg@gmail.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a correctness issue in Bitcoin Core's internal benchmarking tool. Previously, benchmark setup code could run once per batch of repeated measurements, meaning later repeats might not start from a clean state. The change forces setup to run before every single measurement. This only affects benchmark tests, not the live Bitcoin network software, so it has no direct security impact on users.

Recommended action

No security action required. Treat as a normal code-quality/test-harness improvement.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

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