Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | |||||
The `-debug=...` command-line option controls debugging; running with just `-debug` or `-debug=1` will turn | The `-debug=...` command-line option controls debugging; running with just `-debug` or `-debug=1` will turn | ||||
on all categories (and give you a very large debug.log file). | on all categories (and give you a very large debug.log file). | ||||
The Qt code routes `qDebug()` output to debug.log under category "qt": run with `-debug=qt` | The Qt code routes `qDebug()` output to debug.log under category "qt": run with `-debug=qt` | ||||
to see it. | to see it. | ||||
### Writing tests | ### Writing tests | ||||
For details on unit tests, see `unit-tests.md` | For details on unit tests, see [Compiling/running unit tests](unit-tests.md). | ||||
For details on functional tests, see `functional-tests.md` | For details on functional tests, see [Functional tests](functional-tests.md). | ||||
### Writing script integration tests | ### Writing script integration tests | ||||
Script integration tests are built using `src/test/script_tests.cpp`: | Script integration tests are built using `src/test/script_tests.cpp`: | ||||
1. Uncomment the line with `#define UPDATE_JSON_TESTS` | 1. Uncomment the line with `#define UPDATE_JSON_TESTS` | ||||
2. Add a new TestBuilder to the `script_build` test to cover your test case. | 2. Add a new TestBuilder to the `script_build` test to cover your test case. | ||||
3. `ninja check-bitcoin-script_tests` | 3. `ninja check-bitcoin-script_tests` | ||||
▲ Show 20 Lines • Show All 538 Lines • ▼ Show 20 Lines | |||||
- Avoid adding slow or blocking code in the GUI thread. In particular do not | - Avoid adding slow or blocking code in the GUI thread. In particular do not | ||||
add new `interface::Node` and `interface::Wallet` method calls, even if they | add new `interface::Node` and `interface::Wallet` method calls, even if they | ||||
may be fast now, in case they are changed to lock or communicate across | may be fast now, in case they are changed to lock or communicate across | ||||
processes in the future. | processes in the future. | ||||
Prefer to offload work from the GUI thread to worker threads (see | Prefer to offload work from the GUI thread to worker threads (see | ||||
`RPCExecutor` in console code as an example) or take other steps (see | `RPCExecutor` in console code as an example) or take other steps (see | ||||
https://doc.qt.io/archives/qq/qq27-responsive-guis.html) to keep the GUI | <https://doc.qt.io/archives/qq/qq27-responsive-guis.html>) to keep the GUI | ||||
responsive. | responsive. | ||||
- *Rationale*: Blocking the GUI thread can increase latency, and lead to | - *Rationale*: Blocking the GUI thread can increase latency, and lead to | ||||
hangs and deadlocks. | hangs and deadlocks. | ||||
Unit Tests | Unit Tests | ||||
----------- | ----------- | ||||
- Test suite naming convention: The Boost test suite in file | - Test suite naming convention: The Boost test suite in file | ||||
`src/test/foo_tests.cpp` should be named `foo_tests`. Test suite names must | `src/test/foo_tests.cpp` should be named `foo_tests`. Test suite names must | ||||
be unique. | be unique. | ||||
Third party libraries | Third party libraries | ||||
--------------------- | --------------------- | ||||
Several parts of the repository are software maintained elsewhere. | Several parts of the repository are software maintained elsewhere. | ||||
Changes to these should preferably be sent upstream but bugfixes may also be | Changes to these should preferably be sent upstream but bugfixes may also be | ||||
submitted to Bitcoin ABC so that they can be integrated quickly. | submitted to Bitcoin ABC so that they can be integrated quickly. | ||||
Cosmetic changes should be purely taken upstream. | Cosmetic changes should be purely taken upstream. | ||||
Current third party libraries include: | Current third party libraries include: | ||||
- src/leveldb | - src/leveldb | ||||
- Upstream at https://github.com/google/leveldb ; Maintained by Google. | - Upstream at <https://github.com/google/leveldb> ; Maintained by Google. | ||||
- **Note**: Follow the instructions in [Upgrading LevelDB](#upgrading-leveldb) | - **Note**: Follow the instructions in [Upgrading LevelDB](#upgrading-leveldb) | ||||
when merging upstream changes to Bitcoin ABC. | when merging upstream changes to Bitcoin ABC. | ||||
- src/libsecp256k1 | - src/libsecp256k1 | ||||
- Upstream at https://github.com/bitcoin-core/secp256k1/ ; actively maintained | - Upstream at <https://github.com/bitcoin-core/secp256k1/> ; actively maintained | ||||
by Bitcoin Core contributors. | by Bitcoin Core contributors. | ||||
Bitcoin ABC is using a modified version of libsecp256k1, some changes might | Bitcoin ABC is using a modified version of libsecp256k1, some changes might | ||||
be directly submitted to Bitcoin ABC. | be directly submitted to Bitcoin ABC. | ||||
See the [secp256k1 README](/src/secp256k1/README.md) for details. | See the [secp256k1 README](../src/secp256k1/README.md) for details. | ||||
- src/crypto/ctaes | - src/crypto/ctaes | ||||
- Upstream at https://github.com/bitcoin-core/ctaes ; maintained by Bitcoin | - Upstream at https://github.com/bitcoin-core/ctaes ; maintained by Bitcoin | ||||
Core contributors. | Core contributors. | ||||
- src/univalue | - src/univalue | ||||
- Upstream at https://github.com/jgarzik/univalue ; maintained by Jeff Garzik. | - Upstream at https://github.com/jgarzik/univalue ; maintained by Jeff Garzik. | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
be an incompatible consensus change. In this situation the correct behavior | be an incompatible consensus change. In this situation the correct behavior | ||||
would be to revert the upstream fix before applying the updates to Bitcoin ABC's | would be to revert the upstream fix before applying the updates to Bitcoin ABC's | ||||
copy of LevelDB. In general you should be wary of any upstream changes affecting | copy of LevelDB. In general you should be wary of any upstream changes affecting | ||||
what data is returned from LevelDB queries. | what data is returned from LevelDB queries. | ||||
Git and GitHub tips | Git and GitHub tips | ||||
--------------------- | --------------------- | ||||
- Github is not typically the source of truth for pull requests. See CONTRIBUTING.md for instructions | - Github is not typically the source of truth for pull requests. See [CONTRIBUTING](../CONTRIBUTING.md) for instructions | ||||
on setting up your repo correctly. | on setting up your repo correctly. | ||||
- Similarly, your git remote origin should be set to: `ssh://vcs@reviews.bitcoinabc.org:2221/source/bitcoin-abc.git` | - Similarly, your git remote origin should be set to: `ssh://vcs@reviews.bitcoinabc.org:2221/source/bitcoin-abc.git` | ||||
instead of github.com. See CONTRIBUTING.md for details. | instead of github.com. See [CONTRIBUTING](../CONTRIBUTING.md). | ||||
- For resolving merge/rebase conflicts, it can be useful to enable diff3 style using | - For resolving merge/rebase conflicts, it can be useful to enable diff3 style using | ||||
`git config merge.conflictstyle diff3`. Instead of | `git config merge.conflictstyle diff3`. Instead of | ||||
<<< | <<< | ||||
yours | yours | ||||
=== | === | ||||
theirs | theirs | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |