Skip to content

multi_index: fix compilation failure with boost >= 1.91 (backport bitcoin#35175) - #237

Open
djh58 wants to merge 1 commit into
feature/pq-transportfrom
djh58/boost-multiindex-backport
Open

djh58 wants to merge 1 commit into
feature/pq-transportfrom
djh58/boost-multiindex-backport

Conversation

@djh58

@djh58 djh58 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Backport of bitcoin/bitcoin#35175, "multi_index: fix compilation failure with boost >= 1.91", applied cleanly from Core's 30.x backport, 9632450ff6.

  • Problem. Boost 1.91 no longer accepts a struct derived from boost::multi_index::indexed_by<...> as a container's index list. qbit has four, inherited from Core: CTxMemPoolEntry_Indices (txmempool.h), Announcement_Indices (txrequest.cpp), OrphanIndices (node/txorphanage.cpp) and CTxMemPoolModifiedEntry_Indices (node/miner.h). Against Boost 1.91 or newer, the build fails.
  • Effect here. Release builds use depends' Boost 1.88 and aren't affected. CI jobs that install the newest Homebrew Boost fail to compile. The new macOS PQ jobs in crypto: vendor mlkem-native and build ML-KEM-1024 with runtime backend selection #225 hit this first, and crypto: vendor mlkem-native and build ML-KEM-1024 with runtime backend selection #225 now moves them to depends anyway.
  • Fix. Use indexed_by<...> directly instead of inheriting from it. The change is type-only, with no behavior change. The original author is kept on the commit.

Testing

  • Built locally: test_qbit and qbitd.
  • Ran focused unit or functional tests for the changed area: mempool_tests, txrequest_tests, orphanage_tests, miner_tests, txpackage_tests and mempool_persist_tests (25 cases).
  • Not run. Reason: a build against Boost 1.91+ on this host. Upstream verified it on that version, and crypto: vendor mlkem-native and build ML-KEM-1024 with runtime backend selection #225's macOS job log shows the failure this fixes.

Target Branch

Risk / Review Notes

  • Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.

Notes: a type-level change from upstream, in mempool and transaction-request containers. No behavior change.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

This effectively reverts a3cb309 from PR #30194.

That PR reduced the multi_index type signatures as recommended upstream, but
this is no longer supported as of boost 1.91 because it is no longer necessary.
1.91 drops support for the pre-c++11 work-arounds that bloated the type
signatures to begin with.

The upstream `BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT` define is meant to provide
compatibility with removed features, but it does not work for this case. Using
`indexed_by` directly when defining the `multi_index` (as opposed to inheriting
from it) works with all versions, and avoids the use of the back-compat define.

This is a slight regression when building against boost < 1.91 because the
bloated type signatures are reintroduced in that case, but it's not significant
enough to go to the trouble of introducing version detection and ifdefs.

Github-Pull: #35175
Rebased-From: 0bc9d354dfd8074d1c36a891a69b6585a8775c65

(cherry picked from commit 9632450ff65c1fee29c2564a6ad64dfaad4d663c)
Backport of bitcoin/bitcoin#35175.
@djh58

djh58 commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T18:00:03.599189Z 7285bbf Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 7285bbf544

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants