Skip to content

Commit 1119ac5

Browse files
committed
Merge bitcoin/bitcoin#33040: doc: update headers and remove manual TOCs
ca38cf7 doc: fix a few obvious typos in the affected files (Lőrinc) ddab466 doc: remove manual TOCs (Lőrinc) 26a3730 doc: unify `developer-notes` and `productivity` header styles (Lőrinc) Pull request description: The table of contents of our markdown documents weren't always adjusted when corresponding entries were added/removed e.g. * `Ignoring IDE/editor files`: bitcoin/bitcoin@faf65f0#diff-5e319039d67254bed6ca82562ec5f560f102004aa4806e4ca77f5d0065c65fbbL788-L802 * `Shebang`: bitcoin/bitcoin@7777fb8#diff-5e319039d67254bed6ca82562ec5f560f102004aa4806e4ca77f5d0065c65fbbL1128-L1144 * `Wallet`: bitcoin/bitcoin@fa69c5b#diff-5e319039d67254bed6ca82562ec5f560f102004aa4806e4ca77f5d0065c65fbbL882-L885 * `Fetch and update PRs individually` bitcoin/bitcoin@45b1d39#diff-fb3fb3681e7dbfc61c47a7d1f890941b8c886cd46fc06cf7839a03a68dc2aa02R188-R200 * `External libmultiprocess installation` bitcoin/bitcoin@9ccee9c#diff-41e578ab9c8df11d4143597ad73dbe7be92dba4521a5d17c074b79aad1776ee4R38-R40 Since GitHub generates these automatically, it suffices if we unify the header styles instead and delete the manual TOC sections. ACKs for top commit: maflcko: lgtm ACK ca38cf7 🌔 janb84: ACK ca38cf7 yuvicc: re-ACK ca38cf7 Tree-SHA512: a2edcae9a1c4fa9b910dc1cf43f4461f1d79016949b5b4a93fb204ffd735dc2de884785e9796dc084a9852419047a438784a8eec2c38d7e1573a494d81a77494
2 parents e2f2df0 + ca38cf7 commit 1119ac5

File tree

3 files changed

+41
-166
lines changed

3 files changed

+41
-166
lines changed

doc/design/multiprocess.md

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@ Guide to the design and architecture of the Bitcoin Core multiprocess feature
44

55
_This document describes the design of the multiprocess feature. For usage information, see the top-level [multiprocess.md](../multiprocess.md) file._
66

7-
## Table of contents
8-
9-
- [Introduction](#introduction)
10-
- [Current Architecture](#current-architecture)
11-
- [Proposed Architecture](#proposed-architecture)
12-
- [Component Overview: Navigating the IPC Framework](#component-overview-navigating-the-ipc-framework)
13-
- [Design Considerations](#design-considerations)
14-
- [Selection of Cap’n Proto](#selection-of-capn-proto)
15-
- [Hiding IPC](#hiding-ipc)
16-
- [Interface Definition Maintenance](#interface-definition-maintenance)
17-
- [Interface Stability](#interface-stability)
18-
- [Security Considerations](#security-considerations)
19-
- [Example Use Cases and Flows](#example-use-cases-and-flows)
20-
- [Retrieving a Block Hash](#retrieving-a-block-hash)
21-
- [Future Enhancements](#future-enhancements)
22-
- [Conclusion](#conclusion)
23-
- [Appendices](#appendices)
24-
- [Glossary of Terms](#glossary-of-terms)
25-
- [References](#references)
26-
- [Acknowledgements](#acknowledgements)
27-
287
## Introduction
298

309
The Bitcoin Core software has historically employed a monolithic architecture. The existing design has integrated functionality like P2P network operations, wallet management, and a GUI into a single executable. While effective, it has limitations in flexibility, security, and scalability. This project introduces changes that transition Bitcoin Core to a more modular architecture. It aims to enhance security, improve usability, and facilitate maintenance and development of the software in the long run.
@@ -136,7 +115,7 @@ The libmultiprocess runtime is designed to place as few constraints as possible
136115

137116
### Interface Definition Maintenance
138117

139-
The choice to maintain interface definitions and C++ type mappings as `.capnp` files in the [`src/ipc/capnp/`](../../src/ipc/capnp/) was mostly done for convenience, and probably something that could be improved in the future.
118+
The choice to maintain interface definitions and C++ type mappings as `.capnp` files in the [`src/ipc/capnp/`](../../src/ipc/capnp/) was mostly done for convenience, and is probably something that could be improved in the future.
140119

141120
In the current design, class names, method names, and parameter names are duplicated between C++ interfaces in [`src/interfaces/`](../../src/interfaces/) and Cap’n Proto files in [`src/ipc/capnp/`](../../src/ipc/capnp/). While this keeps C++ interface headers simple and free of references to IPC, it is a maintenance burden because it means inconsistencies between C++ declarations and Cap’n Proto declarations will result in compile errors. (Static type checking ensures these are not runtime errors.)
142121

doc/developer-notes.md

Lines changed: 33 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,6 @@
1-
Developer Notes
2-
===============
3-
4-
<!-- markdown-toc start -->
5-
**Table of Contents**
6-
7-
- [Developer Notes](#developer-notes)
8-
- [Coding Style (General)](#coding-style-general)
9-
- [Coding Style (C++)](#coding-style-c)
10-
- [Coding Style (Python)](#coding-style-python)
11-
- [Coding Style (Doxygen-compatible comments)](#coding-style-doxygen-compatible-comments)
12-
- [Generating Documentation](#generating-documentation)
13-
- [Development tips and tricks](#development-tips-and-tricks)
14-
- [Compiling for debugging](#compiling-for-debugging)
15-
- [Show sources in debugging](#show-sources-in-debugging)
16-
- [`debug.log`](#debuglog)
17-
- [Signet, testnet, and regtest modes](#signet-testnet-and-regtest-modes)
18-
- [DEBUG_LOCKORDER](#debug_lockorder)
19-
- [DEBUG_LOCKCONTENTION](#debug_lockcontention)
20-
- [Valgrind suppressions file](#valgrind-suppressions-file)
21-
- [Compiling for test coverage](#compiling-for-test-coverage)
22-
- [Performance profiling with perf](#performance-profiling-with-perf)
23-
- [Sanitizers](#sanitizers)
24-
- [Locking/mutex usage notes](#lockingmutex-usage-notes)
25-
- [Threads](#threads)
26-
- [Ignoring IDE/editor files](#ignoring-ideeditor-files)
27-
- [Development guidelines](#development-guidelines)
28-
- [General Bitcoin Core](#general-bitcoin-core)
29-
- [Wallet](#wallet)
30-
- [General C++](#general-c)
31-
- [C++ data structures](#c-data-structures)
32-
- [Strings and formatting](#strings-and-formatting)
33-
- [Shadowing](#shadowing)
34-
- [Lifetimebound](#lifetimebound)
35-
- [Threads and synchronization](#threads-and-synchronization)
36-
- [Scripts](#scripts)
37-
- [Shebang](#shebang)
38-
- [Source code organization](#source-code-organization)
39-
- [GUI](#gui)
40-
- [Subtrees](#subtrees)
41-
- [Upgrading LevelDB](#upgrading-leveldb)
42-
- [File Descriptor Counts](#file-descriptor-counts)
43-
- [Consensus Compatibility](#consensus-compatibility)
44-
- [Scripted diffs](#scripted-diffs)
45-
- [Suggestions and examples](#suggestions-and-examples)
46-
- [Release notes](#release-notes)
47-
- [RPC interface guidelines](#rpc-interface-guidelines)
48-
- [Internal interface guidelines](#internal-interface-guidelines)
49-
50-
<!-- markdown-toc end -->
51-
52-
Coding Style (General)
53-
----------------------
1+
# Developer Notes
2+
3+
## Coding Style (General)
544

555
Various coding styles have been used during the history of the codebase,
566
and the result is not very consistent. However, we're now trying to converge to
@@ -60,8 +10,7 @@ commits.
6010

6111
Do not submit patches solely to modify the style of existing code.
6212

63-
Coding Style (C++)
64-
------------------
13+
## Coding Style (C++)
6514

6615
- **Indentation and whitespace rules** as specified in
6716
[src/.clang-format](/src/.clang-format). You can use the provided
@@ -71,7 +20,7 @@ tool to clean up patches automatically before submission.
7120
- Braces on the same line for everything else.
7221
- 4 space indentation (no tabs) for every block except namespaces.
7322
- No indentation for `public`/`protected`/`private` or for `namespace`.
74-
- No extra spaces inside parenthesis; don't do `( this )`.
23+
- No extra spaces inside parentheses; don't do `( this )`.
7524
- No space after function names; one space after `if`, `for` and `while`.
7625
- If an `if` only has a single-statement `then`-clause, it can appear
7726
on the same line as the `if`, without braces. In every other case,
@@ -171,8 +120,7 @@ public:
171120
} // namespace foo
172121
```
173122

174-
Coding Style (C++ functions and methods)
175-
--------------------
123+
### Coding Style (C++ functions and methods)
176124

177125
- When ordering function parameters, place input parameters first, then any
178126
in-out parameters, followed by any output parameters.
@@ -192,8 +140,7 @@ Coding Style (C++ functions and methods)
192140
non-optional in-out and output parameters should usually be references, as
193141
they cannot be null.
194142

195-
Coding Style (C++ named arguments)
196-
------------------------------
143+
### Coding Style (C++ named arguments)
197144

198145
When passing named arguments, use a format that clang-tidy understands. The
199146
argument names can otherwise not be verified by clang-tidy.
@@ -237,14 +184,11 @@ To run clang-tidy on the changed source lines:
237184
git diff | ( cd ./src/ && clang-tidy-diff -p2 -path ../build -j $(nproc) )
238185
```
239186

240-
Coding Style (Python)
241-
---------------------
187+
## Coding Style (Python)
242188

243189
Refer to [/test/functional/README.md#style-guidelines](/test/functional/README.md#style-guidelines).
244190

245-
246-
Coding Style (Doxygen-compatible comments)
247-
------------------------------------------
191+
## Coding Style (Doxygen-compatible comments)
248192

249193
Bitcoin Core uses [Doxygen](https://www.doxygen.nl/) to generate its official documentation.
250194

@@ -319,7 +263,7 @@ but the above styles are favored.
319263

320264
Recommendations:
321265

322-
- Avoiding duplicating type and input/output information in function
266+
- Avoid duplicating type and input/output information in function
323267
descriptions.
324268

325269
- Use backticks (&#96;&#96;) to refer to `argument` names in function and
@@ -348,8 +292,7 @@ Linux: `sudo apt install doxygen graphviz`
348292

349293
MacOS: `brew install doxygen graphviz`
350294

351-
Development tips and tricks
352-
---------------------------
295+
## Development tips and tricks
353296

354297
### Compiling for debugging
355298

@@ -393,7 +336,7 @@ ln -s /path/to/project/root/src src
393336

394337
4. If your IDE has an option for this, change your breakpoints to use the file name only.
395338

396-
### `debug.log`
339+
### debug.log
397340

398341
If the code is behaving strangely, take a look in the `debug.log` file in the data directory;
399342
error and debugging messages are written there.
@@ -713,8 +656,7 @@ Additional resources:
713656
* [GCC Instrumentation Options](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html)
714657
* [Google Sanitizers Wiki](https://github.com/google/sanitizers/wiki)
715658

716-
Locking/mutex usage notes
717-
-------------------------
659+
## Locking/mutex usage notes
718660

719661
The code is multi-threaded and uses mutexes and the
720662
`LOCK` and `TRY_LOCK` macros to protect data structures.
@@ -730,8 +672,7 @@ between the various components is a goal, with any necessary locking
730672
done by the components (e.g. see the self-contained `FillableSigningProvider` class
731673
and its `cs_KeyStore` lock for example).
732674

733-
Threads
734-
-------
675+
## Threads
735676

736677
- [Main thread (`bitcoind`)](https://doxygen.bitcoincore.org/bitcoind_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97)
737678
: Started from `main()` in `bitcoind.cpp`. Responsible for starting up and
@@ -784,22 +725,19 @@ Threads
784725
- [ThreadI2PAcceptIncoming (`b-i2paccept`)](https://doxygen.bitcoincore.org/class_c_connman.html#a57787b4f9ac847d24065fbb0dd6e70f8)
785726
: Listens for and accepts incoming I2P connections through the I2P SAM proxy.
786727

787-
Development guidelines
788-
============================
728+
# Development guidelines
789729

790730
A few non-style-related recommendations for developers, as well as points to
791731
pay attention to for reviewers of Bitcoin Core code.
792732

793-
General Bitcoin Core
794-
----------------------
733+
## General Bitcoin Core
795734

796735
- New features should be exposed on RPC first, then can be made available in the GUI.
797736

798737
- *Rationale*: RPC allows for better automatic testing. The test suite for
799738
the GUI is very limited.
800739

801-
Logging
802-
-------
740+
## Logging
803741

804742
The macros `LogInfo`, `LogDebug`, `LogTrace`, `LogWarning` and `LogError` are available for
805743
logging messages. They should be used as follows:
@@ -837,8 +775,7 @@ Note that the format strings and parameters of `LogDebug` and `LogTrace`
837775
are only evaluated if the logging category is enabled, so you must be
838776
careful to avoid side-effects in those expressions.
839777

840-
General C++
841-
-------------
778+
## General C++
842779

843780
For general C++ guidelines, you may refer to the [C++ Core
844781
Guidelines](https://isocpp.github.io/CppCoreGuidelines/).
@@ -859,8 +796,7 @@ Common misconceptions are clarified in those sections:
859796

860797
- *Rationale*: This avoids memory and resource leaks, and ensures exception safety.
861798

862-
C++ data structures
863-
--------------------
799+
## C++ data structures
864800

865801
- Never use the `std::map []` syntax when reading from a map, but instead use `.find()`.
866802

@@ -953,8 +889,7 @@ int GetInt(Tabs tab)
953889
954890
*Rationale*: The comment documents skipping `default:` label, and it complies with `clang-format` rules. The assertion prevents firing of `-Wreturn-type` warning on some compilers.
955891
956-
Strings and formatting
957-
------------------------
892+
## Strings and formatting
958893
959894
- Use `std::string`, avoid C string manipulation functions.
960895
@@ -988,8 +923,7 @@ Strings and formatting
988923
checks. If a use of strings is sensitive to this, take care to check the string for embedded NULL characters first
989924
and reject it if there are any.
990925
991-
Shadowing
992-
--------------
926+
## Shadowing
993927
994928
Although the shadowing warning (`-Wshadow`) is not enabled by default (it prevents issues arising
995929
from using a different variable with the same name),
@@ -998,8 +932,7 @@ please name variables so that their names do not shadow variables defined in the
998932
When using nested cycles, do not name the inner cycle variable the same as in
999933
the outer cycle, etc.
1000934
1001-
Lifetimebound
1002-
--------------
935+
## Lifetimebound
1003936
1004937
The [Clang `lifetimebound`
1005938
attribute](https://clang.llvm.org/docs/AttributeReference.html#lifetimebound)
@@ -1008,8 +941,7 @@ potentially see a compile-time warning if the object has a shorter lifetime from
1008941
the invalid use of a temporary. You can use the attribute by adding a `LIFETIMEBOUND`
1009942
annotation defined in `src/attributes.h`; please grep the codebase for examples.
1010943
1011-
Threads and synchronization
1012-
----------------------------
944+
## Threads and synchronization
1013945
1014946
- Prefer `Mutex` type to `RecursiveMutex` one.
1015947
@@ -1110,13 +1042,11 @@ TRY_LOCK(cs_vNodes, lockNodes);
11101042
}
11111043
```
11121044
1113-
Scripts
1114-
--------------------------
1045+
## Scripts
11151046
11161047
Write scripts in Python or Rust rather than bash, when possible.
11171048
1118-
Source code organization
1119-
--------------------------
1049+
## Source code organization
11201050
11211051
- Implementation code should go into the `.cpp` file and not the `.h`, unless necessary due to template usage or
11221052
when performance due to inlining is critical.
@@ -1150,8 +1080,7 @@ namespace {
11501080

11511081
- *Rationale*: Avoids confusion about the namespace context.
11521082

1153-
GUI
1154-
-----
1083+
## GUI
11551084

11561085
- Do not display or manipulate dialogs in model code (classes `*Model`).
11571086

@@ -1172,8 +1101,7 @@ GUI
11721101
- *Rationale*: Blocking the GUI thread can increase latency, and lead to
11731102
hangs and deadlocks.
11741103

1175-
Subtrees
1176-
----------
1104+
## Subtrees
11771105

11781106
Several parts of the repository are subtrees of software maintained elsewhere.
11791107

@@ -1203,8 +1131,7 @@ The ultimate upstream of the few externally managed subtrees are:
12031131
- Used by leveldb for hardware acceleration of CRC32C checksums for data integrity.
12041132
- Upstream at https://github.com/google/crc32c ; maintained by Google.
12051133

1206-
Upgrading LevelDB
1207-
---------------------
1134+
## Upgrading LevelDB
12081135

12091136
Extra care must be taken when upgrading LevelDB. This section explains issues
12101137
you must be aware of.
@@ -1229,7 +1156,7 @@ $ lsof -p $(pidof bitcoind) |\
12291156
mem = 119, fd = 0
12301157
```
12311158

1232-
The `mem` value shows how many files are mmap'ed, and the `fd` value shows you
1159+
The `mem` value shows how many files are mmap'ed, and the `fd` value shows how
12331160
many file descriptors these files are using. You should check that `fd` is a
12341161
small number (usually 0 on 64-bit hosts).
12351162

@@ -1250,8 +1177,7 @@ would be to revert the upstream fix before applying the updates to Bitcoin's
12501177
copy of LevelDB. In general, you should be wary of any upstream changes affecting
12511178
what data is returned from LevelDB queries.
12521179

1253-
Scripted diffs
1254-
--------------
1180+
## Scripted diffs
12551181

12561182
For reformatting and refactoring commits where the changes can be easily automated using a bash script, we use
12571183
scripted-diff commits. The bash script is included in the commit message and our CI job checks that
@@ -1307,8 +1233,7 @@ To find all previous uses of scripted diffs in the repository, do:
13071233
git log --grep="-BEGIN VERIFY SCRIPT-"
13081234
```
13091235

1310-
Release notes
1311-
-------------
1236+
## Release notes
13121237

13131238
Release notes should be written for any PR that:
13141239

@@ -1321,8 +1246,7 @@ Release notes should be added to a PR-specific release note file at
13211246
`/doc/release-notes-<PR number>.md` to avoid conflicts between multiple PRs.
13221247
All `release-notes*` files are merged into a single `release-notes-<version>.md` file prior to the release.
13231248

1324-
RPC interface guidelines
1325-
--------------------------
1249+
## RPC interface guidelines
13261250

13271251
A few guidelines for introducing and reviewing new RPC interfaces:
13281252

@@ -1430,8 +1354,7 @@ A few guidelines for modifying existing RPC interfaces:
14301354

14311355
- *Rationale*: Changes in RPC JSON structure can break downstream application compatibility. Implementation of `deprecatedrpc` provides a grace period for downstream applications to migrate. Release notes provide notification to downstream users.
14321356

1433-
Internal interface guidelines
1434-
-----------------------------
1357+
## Internal interface guidelines
14351358

14361359
Internal interfaces between parts of the codebase that are meant to be
14371360
independent (node, wallet, GUI), are defined in

0 commit comments

Comments
 (0)