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

Merge bitcoin/bitcoin#36966: bench: fix `InputType` ODR violation

Public commit record

What the developer wrote

Authored by Hennadii Stepanov

96/100 · Strong
Merge bitcoin/bitcoin#36966: bench: fix `InputType` ODR violation

66654bc5ce9b1cf9613346107b9520ad003a68c4 ci: add CMAKE_INTERPROCEDURAL_OPTIMIZATION to Alpine job (fanquake)
307b22b59d4417f1f99fe7af8e36b3285045ce8b bench: put InputType enums in anonymous namespaces (fanquake)

Pull request description:

Introduced in #36475:
```bash
/ci_container_base/src/bench/bip352.cpp:22:12: error: type ‘InputType’ violates the C++ One Definition Rule [-Werror=odr]
22 | enum class InputType {
| ^
/ci_container_base/src/bench/sign_transaction.cpp:24:12: note: an enum with different value name is defined in another translation unit
24 | enum class InputType {
| ^
/ci_container_base/src/bench/bip352.cpp:23:5: note: name ‘P2PKH’ differs from name ‘P2WPKH’ defined in another translation unit
23 | P2PKH, // legacy pubkey-hash
| ^
/ci_container_base/src/bench/sign_transaction.cpp:25:5: note: mismatching definition
25 | P2WPKH, // segwitv0, witness-pubkey-hash (ECDSA signature)
| ^
```

There's a commit here that adds a CI config, using GCC and LTO, which uses `-Wodr`. The existing LTO config uses Clang, and I'm not sure about adding LTO to any existing job. However I do think we should be catching ODR violations in CI.

ACKs for top commit:
maflcko:
review ACK 66654bc5ce9b1cf9613346107b9520ad003a68c4 🐨
hebasto:
ACK 66654bc5ce9b1cf9613346107b9520ad003a68c4, tested on Fedora 45.

Tree-SHA512: 8a9f38628a01b4b4ff77fd4120510352e4b0085b1300b55e512745f71567b3f475b3c104bb3156bec957115467043f9102f72e82f6d4c15b74b5bced283d9a93
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This change fixes a C++ programming rule violation where two unrelated pieces of benchmark code happened to use the same name, 'InputType', for slightly different lists of Bitcoin address types. With whole-program optimization enabled, this could cause build warnings or incorrect linking, but it only affects internal benchmark tools—not the live Bitcoin network code, wallet handling, or consensus logic. There is no security vulnerability in the running software.

Recommended action

No security action required. Treat as a normal code-quality/build-hygiene fix. If backporting, include only for build cleanliness; it is not a vulnerability patch.

Security signals we found

01

ODR violation in benchmark-only code

02

No runtime security boundary crossed

03

No input parsing, network, wallet, or consensus code modified

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.