d3e40af259index: shorten indexer thread names (Lőrinc)d69c46292dutil: zero-pad thread number suffixes (Lőrinc)41e531c4abutil: shorten `ThreadPool` worker names (Lőrinc) Pull request description: **Problem:** Linux limits thread names set through [`PR_SET_NAME`](https://man7.org/linux/man-pages/man2/PR_SET_NAME.2const.html) to 15 visible bytes: > The name can be up to 16 bytes long, including the terminating null byte. Bitcoin Core prefixes system thread names with `b-`, leaving only 13 bytes for the thread-specific part. This truncates longer indexer names in system tools, for example `b-coinstatsindex` and `b-txospenderindex`. It also makes verbose worker suffixes like `b-http_pool_N` spend much of the available space; the current HTTP worker names fit, but the generic suffix leaves less room for longer pool names. The same limit is documented in the existing thread-name helper:8b49e2dd4e/src/util/threadnames.cpp (L25)This was noticed during review of https://github.com/bitcoin/bitcoin/pull/31132#discussion_r3146688138 **Fix:** Shorten the OS-visible thread names while keeping public index identifiers unchanged. `ThreadPool` workers now use a zero-padded dotted numeric suffix, so HTTP workers are named like `b-http.xx`. `CCheckQueue` worker suffixes are zero-padded as well, so script-check workers are named like `b-scriptch.xx`. Indexer sync threads now pass display and thread names separately at each `BaseIndex` call site. The current indexer thread names use compact `idx`-suffixed names that fit within the Linux limit after the `b-` prefix: ```text txindex -> txidx basic block filter index -> blkfltbscidx coinstatsindex -> coinstatsidx txospenderindex -> txospenderidx ``` Indexer display names, `getindexinfo` keys, command-line options, and on-disk index paths are unchanged. **Testing:** See https://godbolt.org/z/oWonrTKcj for a simple reproducer. Alternatively, start `bitcoind` on Linux with the affected indexes enabled and read the kernel-visible thread names. Before this change, the relevant names were truncated or used longer forms: ```text b-txindex b-basic block f b-coinstatsinde b-http_pool_15 b-txospenderind ``` After this change, the same check shows compact, untruncated names: ```text b-txidx b-blkfltbscidx b-coinstatsidx b-http.15 b-txospenderidx ``` ACKs for top commit: maflcko: re-ACKd3e40af259👳 sedited: ACKd3e40af259winterrdog: re-ACKd3e40af259hodlinator: re-ACKd3e40af259Tree-SHA512: 0b4c087661eb81e767fb2c2a1ce2dd54e6593888a7d30402e76c845a84dff5550e3ad72fee39b136f7f5214f051647c0c1f284e3265f8a614d1028f7b49d76da
Bitcoin Core integration/staging tree
For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.
What is Bitcoin Core?
Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.
Further information about Bitcoin Core is available in the doc folder.
License
Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/license/MIT.
Development Process
The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be
completely stable. Tags are created
regularly from release branches to indicate new official, stable release versions of Bitcoin Core.
The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.
The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.
Testing
Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.
Automated Testing
Developers are strongly encouraged to write unit tests for new code, and to
submit new unit tests for old code. Unit tests can be compiled and run
(assuming they weren't disabled during the generation of the build system) with: ctest. Further details on running
and extending unit tests can be found in /src/test/README.md.
There are also regression and integration tests, written
in Python.
These tests can be run (if the test dependencies are installed) with: build/test/functional/test_runner.py
(assuming build is your build directory).
The CI (Continuous Integration) systems make sure that every pull request is tested on Windows, Linux, and macOS. The CI must pass on all commits before merge to avoid unrelated CI failures on new pull requests.
Manual Quality Assurance (QA) Testing
Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.
Translations
Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.
Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.
Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.