Commit Graph

23378 Commits

Author SHA1 Message Date
MarcoFalke
01fc1af361 Merge #18569: ci: Add big endian native s390x build
6136a96cdf631f824fb89cf2720422787439acc9 ci: Rename RUN_CI_ON_HOST to DANGER_RUN_CI_ON_HOST (Hennadii Stepanov)
97ba77aa8e58c3c7ff767e6ca804d0e46370e5dc ci: Add native s390x (Hennadii Stepanov)

Pull request description:

  Unlike the Docker wrapped solution (#17591) this PR suggests running on host system directly.

  This approach makes builds quick and stable (see: #18106).

  The excerpt from the Travis log:
  ```
  ...
  Running on host system without docker wrapper
  ...
  Byte Order: Big Endian
  ...
  ```

ACKs for top commit:
  MarcoFalke:
    ACK 6136a96cdf631f824fb89cf2720422787439acc9

Tree-SHA512: 1b591de13e38d10a35217e1de11cbd648a359d18d16eed166fac18ea5788b58cc9fc6d407086ed342b99e57e479efd951a0ea693710177e500eb116316b9a788
2023-06-07 01:50:18 -05:00
MarcoFalke
85be06af39 Merge #18562: ci: Run unit tests sequential once
fa7af33b4cb12315de86315c163393bdb50fad75 ci: Run unit tests sequential once (MarcoFalke)
fa68a3e7640fc00c47f03fa565357679bdafb4b2 appveyor: Enable minimal unit test logging to aid debugging (MarcoFalke)

Pull request description:

  Fixes #16976

Top commit has no ACKs.

Tree-SHA512: 1f1ee8776a67afa8c1c5a16ef170c9975b6a486c087c8eba12e97d23382befd1c2801622ec70ca8e4cd1fbedce1dec46be67677ceaf07f35f1d3f3bead0200f0
2023-06-07 01:50:18 -05:00
fanquake
3ddc17a3b2 Merge #18477: ci: Use Focal for fuzzers
faa9491870bf29583a989c407694d01f49b65bec ci: Use Focal for fuzzers (MarcoFalke)

Pull request description:

  This gives us access to clang-10, as well as a newer version of valgrind

ACKs for top commit:
  fanquake:
    ACK faa9491870bf29583a989c407694d01f49b65bec - [Clang 10](https://packages.ubuntu.com/focal/clang) and [valgrind 3.15](https://packages.ubuntu.com/focal/valgrind).
  practicalswift:
    ACK faa9491870bf29583a989c407694d01f49b65bec -- diff looks correct & contemporary clang is better than vintage clang

Tree-SHA512: 0e67232673434c0309db79c1054e3e981115083585945967e346f4d58792635832100f89911428aab928155e44e5f401207a023681ae008fdb5280cf02c4d427
2023-06-07 01:50:18 -05:00
MarcoFalke
385b9a8733 Merge #18441: ci: Remove misplaced comments from folded block scalar
e41e46cee0d9b98869a569b73dafc5452b4272d6 ci: Remove misplaced comments from folded block scalar (Hennadii Stepanov)

Pull request description:

  On master (f3a91ab0edc70e1bcb7e770f0878f03459c399e1) the [build log for ARM](https://travis-ci.org/github/bitcoin/bitcoin/jobs/667247758) contains:
  ```
  $ export FILE_ENV="./ci/test/00_setup_env_arm.sh"
  $ export QEMU_USER_CMD=""
  $ export Can=
  $ export run=
  $ export the=
  $ export tests=
  $ export natively=
  $ export without=
  $ export qemu=

  Setting up build cache
  ...
  ```
  and
  ![Screenshot from 2020-03-26 18-58-50](https://user-images.githubusercontent.com/32963518/77674223-e28d2d00-6f93-11ea-82a1-7f805ccb678d.png)

  With this PR:
  ```
  $ export FILE_ENV="./ci/test/00_setup_env_arm.sh"
  $ export QEMU_USER_CMD=""

  Setting up build cache
  ...
  ```

  and
  ![Screenshot from 2020-03-26 19-01-56](https://user-images.githubusercontent.com/32963518/77674456-4d3e6880-6f94-11ea-9c83-546c81f1cdf7.png)

  ---

  Also Travis [build config validation](https://docs.travis-ci.com/user/build-config-validation) added:
  ![Screenshot from 2020-03-26 19-04-19](https://user-images.githubusercontent.com/32963518/77674686-9ee6f300-6f94-11ea-900f-fdef8a673113.png)

Top commit has no ACKs.

Tree-SHA512: a3ea05d543a4d46c65fffd7c67df9bbd4ca8d426fa215c5ce26653de34145edd419a54884da0416608a2c90bf5b421cab3ec32290c8916f10399354b44ddeb99
2023-06-07 01:50:18 -05:00
MarcoFalke
548d63e9e6 Merge #18438: ci: Use Homebrew addon on native macOS
25c8b73656c90f7b78a90f25c5bcc308f8b7c598 ci: Use Homebrew addon on native macOS (Hennadii Stepanov)
596c627a1eb2b32e2755ae5b9bf32235cf8ce72b ci: Fix brew in Travis (Hennadii Stepanov)

Pull request description:

  Recently almost every macOS image update on Travis breaks our builds:
  - #17848
  - #18436

  This PR:
  - fixes the error caused by the recent [update](https://changelog.travis-ci.com/xcode-11-3-1-xcode-11-2-1-xcode-11-1-and-xcode11-images-updated-142286) from 10.14.4 (18E226) to 10.14.6 (18G3020) on March 25
  - leverages [Homebrew addon](https://config.travis-ci.com/ref/job/addons/homebrew) to install packages

  Homebrew is not told to install `automake` and `pkg-config` packages, as the [docs](https://docs.travis-ci.com/user/reference/osx/#compilers-and-build-toolchain) states that they are pre-installed:
  >    - automake 1.16.1
  >    - pkg-config 0.29.2

Top commit has no ACKs.

Tree-SHA512: 1a70c06468fbe162503081b03dcf54614d67abf8ff0ce07d118b5bb50bbb92c182a76f769bea586c691aa82b9281a29cdef88091acc16895817a2e7cddafec6e
2023-06-07 01:50:18 -05:00
MarcoFalke
cd16cf96a4 Merge #18430: ci: Only clone bitcoin-core/qa-assets when fuzzing
fae1e992898aa6b36c402cec4085fbf6da9b33ad ci: Only clone bitcoin-core/qa-assets when fuzzing (MarcoFalke)

Pull request description:

  Currently the only content of that repo are some seeds, so we can speed up some ci builds

ACKs for top commit:
  laanwj:
    ACK fae1e992898aa6b36c402cec4085fbf6da9b33ad (provided this passes travis)

Tree-SHA512: ed813738e7f24bb56a2f12aa3b398e414eb4f0ba98379836a33ff3e5602cbf42a28e89aad10e346468191ecddc03e60d5b236097112e27c07cb1c2293533ea58
2023-06-07 01:50:18 -05:00
MarcoFalke
3d141a8663 Merge #18899: travis: Remove valgrind
fa082d0a57afedca9122fac4aecd6a3070f06b04 travis: Remove valgrind (MarcoFalke)

Pull request description:

  When the valgrind run was added, it took 2 hours. Travis kindly raised the timeout limit to the maximum possible of 3 hours.

  Today, a full build of Bitcoin Core with all tests takes more than three hours. Thus, it is impossible to run all tests on travis.

  Moreover, the feedback loop for developers that create a pull request takes at least 2 hours, but in some cases (when the travis queue is full) until the next day. This is unacceptable.

  Fix both issues by removing the build from travis.

  Please note that the `ci/test/` configurations are *not* removed. They will stay in the repo and can be executed anywhere (just not on travis).

ACKs for top commit:
  jamesob:
    ACK fa082d0a57
  jnewbery:
    utACK fa082d0a57afedca9122fac4aecd6a3070f06b04

Tree-SHA512: 9acaa0e2d3926014fadb7dd2e86c4e01df382e9399f6ae99f989fa609da66a77bdd1b75d6ff42d2686f38f730b8564e6dc722aa597a473290c9d30c2abe7ef0f
2023-06-07 01:50:18 -05:00
fanquake
316f6b1895 Merge #19159: test: Make valgrind.supp work on aarch64
fab7d954b261d74b369fe2a3c1785540c4f056b4 test: Make valgrind.supp work on aarch64 (MarcoFalke)

Pull request description:

  Was easy to fix by simply removing a line

ACKs for top commit:
  practicalswift:
    ACK fab7d954b261d74b369fe2a3c1785540c4f056b4 -- diff looks correct

Tree-SHA512: d2d7c6cac453a3177c20e256ec50a03066f8dbf5ae45299077ccf4a2b45a3a40252b1b5fcaf9224a59bb5c3df5bd90ac58af27eb0f47dc87c2640df5b2b460ca
2023-06-07 01:50:18 -05:00
MarcoFalke
32b4f8dd65 Merge #18392: ci: Run feature_block in valgrind
fa92af5af39a08982f785542df5419d6d5a4706d ci: Run feature_block and feature_abortnode in valgrind (MarcoFalke)
fa01febeaf801bade77a613e64f18b556ae16d86 test: Remove ci timeout restriction in test_runner (MarcoFalke)

Pull request description:

  Also revert commit 0a4912e46a, because some tests take too long for this to be useful anymore.

Top commit has no ACKs.

Tree-SHA512: 363f14766e1f4a5860ab668a516b41acebc6fbdf11d8defb3a95a772dbf82304ca1f5f14b1dbad97f2029503e03d92e8c69df0466a8872409c20665838f617ed
2023-06-07 01:50:18 -05:00
MarcoFalke
c2554ab891 Merge #18304: ci: Enable all functional tests in valgrind
4444edc2e6671d3f73de3725447130f73ecf0375 ci: Enable all functional tests in valgrind (MarcoFalke)

Pull request description:

  The travis timeout for our repo has been bumped to 2h, so we can run all tests in valgrind now

ACKs for top commit:
  practicalswift:
    ACK 4444edc2e6671d3f73de3725447130f73ecf0375 -- regarding the three disabled cases (`feature_abortnode`, `feature_block` and `rpc_bind`): not a big deal since MSan will take care of those once #18288 is merged. More is more :)

Tree-SHA512: ea2f798112911b6d1f3d88cfcdf0a7cdb698687248343703d6fe55da144542c961c15d888bffb41672c10aa76765615cb7c7ff93d468bfad3c51f962f24e7abb
2023-06-07 01:50:18 -05:00
MarcoFalke
86094b631e Merge #17725: ci: Add valgrind run
facb416ad5ba47b01ee52c273a5c5e3709f06f07 ci: Add valgrind run (MarcoFalke)

Pull request description:

  Fixes #17460

ACKs for top commit:
  practicalswift:
    ACK facb416ad5ba47b01ee52c273a5c5e3709f06f07

Tree-SHA512: 55396e548a76f976d7b7170b68bc5f93cfd44656162267172f66db7eb549699a2a22d3b1bb0d5f180fe0697931939e652c8cdb86b435e81e7ce572485798009d
2023-06-07 01:50:18 -05:00
UdjinM6
49ca1aa5db
ci: use PR's HEAD in guix workflow (#5416)
## Issue being fixed or feature implemented
Our guix workflow creates a merge commit instead of using HEAD from a PR
itself which is why commit hash is different. That's exactly what is
described in https://github.com/actions/checkout/issues/27 imo.

related:
https://github.com/dashpay/dash/pull/5355#issuecomment-1578459628

## What was done?
adjust guix workflow

## How Has This Been Tested?
see this PR results: the HEAD looks correct now
this PR:
https://github.com/dashpay/dash/actions/runs/5191152453/jobs/9358590629?pr=5416#step:2:482
#5355:
https://github.com/dashpay/dash/actions/runs/5187698039/jobs/9350381761?pr=5355#step:2:489

## Breaking Changes
n/a hopefully 

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-06-07 06:30:12 +03:00
PastaPastaPasta
87b8acf07c
Merge pull request #5236 from kittywhiskers/utxo_assume
backport: merge bitcoin#19806, #21582, #21584, #21270, #21789, #22415, #21525, #21592 (assumeutxo project backports, part 3)
2023-06-06 12:12:30 -05:00
Kittywhiskers Van Gogh
42f2756ae7 merge bitcoin#22415: Make m_mempool optional in CChainState 2023-06-06 22:40:20 +05:30
Kittywhiskers Van Gogh
6c7bd58eed merge bitcoin#21789: Remove ::Params() global from CChainState 2023-06-06 22:38:56 +05:30
Kittywhiskers Van Gogh
9e60bdff16 merge bitcoin#21525: Followup fixups to bundle 4 2023-06-06 22:38:56 +05:30
Kittywhiskers Van Gogh
6ba54ca251 merge bitcoin#21270: Prune g_chainman usage in validation-adjacent modules 2023-06-06 22:38:56 +05:30
Kittywhiskers Van Gogh
8b41e07aea merge bitcoin#21584: Fix assumeutxo crash due to invalid base_blockhash 2023-06-06 22:38:56 +05:30
Kittywhiskers Van Gogh
7fbda904d2 merge bitcoin#21582: Fix assumeutxo crash due to missing base_blockhash 2023-06-06 22:38:56 +05:30
Kittywhiskers Van Gogh
dc3e259713 merge bitcoin#21592: Remove option to make TestChain100Setup non-deterministic 2023-06-06 22:38:56 +05:30
Kittywhiskers Van Gogh
6bf39d7632 merge bitcoin#19806: UTXO snapshot activation 2023-06-06 22:38:56 +05:30
UdjinM6
87863a68a3
fix: reset chainman to allow reindex on failure (#5405)
## Issue being fixed or feature implemented
current develop fails to reindex whenever there is an issue at node
start (prints `should not be overwriting a chainstate` in `debug.log`)

## What was done?
reset chainman to allow it re-initialize chainstate


## How Has This Been Tested?
simulated an issue with
```
 if (!fReset) {
     strLoadError = _("DEBUG");
     break;
 }
```


## Breaking Changes
should not be any but pls test


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-06-06 19:31:11 +03:00
PastaPastaPasta
d49239cd4d
Merge pull request #5415 from kittywhiskers/bp_26633
backport: bitcoin#26633 (update qt 5.12 url to archive location)
2023-06-06 10:56:53 -05:00
Kittywhiskers Van Gogh
313326e846 merge bitcoin#26633: update qt 5.12 url to archive location 2023-06-06 16:19:57 +05:30
UdjinM6
0cbf85a6d2
fix(ci): only run jobs when their ancestors on prevoius stages succeeded (#5412)
## Issue being fixed or feature implemented
We should not be running jobs if their ancestors failed. This was broken
with the introduction of `FAST_MODE`/`.skip-in-fast-mode-template` I
think (via #3635).

## What was done?
Adjust ci rules, make them explicit.

## How Has This Been Tested?
Compare `test` stages:
https://gitlab.com/dashpay/dash/-/pipelines/888510672 (note: some of
`test` stage jobs were started, even though all related jobs from
`build` stage have failed)
vs
https://gitlab.com/UdjinM6/dash/-/pipelines/888923382 (note: none of
`test` stage jobs were started)


## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-06-06 11:54:29 +03:00
Konstantin Akimov
e23449aa81
fix: follow-up #5403: remove double serialization in CDeterministicMNState (#5413)
## Issue being fixed or feature implemented
Member obj.keyIDOwner is read & write twice



## What was done?
Fixed: it is serialized once

## How Has This Been Tested?
Unit/functional tests in CI


## Breaking Changes
Data format in database changed in incompatible way

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-06-05 23:39:16 -05:00
PastaPastaPasta
696ffebc73
Merge pull request #5306 from kittywhiskers/auxports10
backport: merge bitcoin#19192, #18968, #19191, #18991, #19658, #19697, #20000, #19638, #20120, #20757, #20965, #20284, #22025, #22179 (auxiliary backports: part 10)
2023-06-05 10:13:34 -05:00
Kittywhiskers Van Gogh
99b336deba merge bitcoin#22179: Torv2 removal followups 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
31acbf1e2d merge bitcoin#22025: Group and re-order CAddrMan members by access type 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
1ef6322fc2 merge bitcoin#20284: ensure old versions don't parse peers.dat 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
3bfcf7a16b merge bitcoin#20965: return NET_UNROUTABLE as not_publicly_routable, automate helps 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
052b2d0dc1 merge bitcoin#20757: tor.md and -onlynet help updates 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
f003f00e9a merge bitcoin#19638: Replace hidden service with onion service 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
81c686e7db merge bitcoin#20000: fix creation of "std::string"s with \0s 2023-06-05 10:11:03 -05:00
UdjinM6
d0d598dbb0 fix: resolve persistent p2p_getaddr_caching.py failures 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
01130228f0 merge bitcoin#19697: Improvements on ADDR caching 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
56cd0dd80a merge bitcoin#19658: Allow RPC to fetch all addrman records and add records to addrman 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
1244d59522 merge bitcoin#18991: Cache responses to GETADDR to prevent topology leaks 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
a13b72397b merge bitcoin#19191: Extract download permission from noban 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
91d800dce3 merge bitcoin#18968: noban precludes maxuploadtarget disconnects 2023-06-05 10:11:03 -05:00
Kittywhiskers Van Gogh
8806c7baeb merge bitcoin#19192: Extract net permissions doc 2023-06-05 10:11:03 -05:00
UdjinM6
54fb76f2f1
fix: Resolve mainnet v19 fork issues (#5403)
## Issue being fixed or feature implemented
same as  #5392, alternative solution

~based on #5402 atm, will rebase later~

## What was done?
pls see individual commits

## How Has This Been Tested?
reorg mainnet around forkpoint with a patched client (to allow low
difficulty), run tests

## Breaking Changes
Another evodb migration is required. Going back to an older version or
migrating after the fork requires reindexing.

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_
2023-06-04 23:45:56 +03:00
Konstantin Akimov
86dc99f10d
refactor: using reference instead reference to unique_ptr with object (#5381)
## Issue being fixed or feature implemented
Many objects created and functions called by passing `const
std::unique_ptr<Obj>& obj` instead directly passing `Obj& obj`

In some cases it is indeed needed, but in most cases it is just extra
complexity that is better to avoid.

Motivation:
- providing reference to object instead `unique_ptr` is giving warranty
that there's no `nullptr` and no need to keep it in mind
- value inside unique_ptr by reference can be changed externally and
instead `nullptr` it can turn to real object later (or in opposite)
 - code is shorter but cleaner

Based on that this refactoring is useful as it reduces mental load when
reading or writing code.
`std::unique` should be used ONLY for owning object, but not for passing
it everywhere.

## What was done?
Replaced most of usages `std::unique_ptr<Obj>& obj` to `Obj& obj`.
Btw, in several cases implementation assumes that object can be nullptr
and replacement to reference is not possible.
Even using raw pointer is not possible, because the empty
std::unique_ptr can be initialized later somewhere in code.
For example, in `src/init.cpp` there's called `PeerManager::make` and
pass unique_ptr to the `node.llmq_ctx` that would be initialized way
later.
That is out of scope this PR.
List of cases, where reference to `std::unique_ptr` stayed as they are:
- `std::unique_ptr<LLMQContext>& llmq_ctx` in `PeerManagerImpl`,
`PeerManager` and `CDSNotificationInterface`
- `std::unique_ptr<CDeterministicMNManager>& dmnman` in
`CDSNotificationInterface`

Also `CChainState` have 3 references to `unique_ptr` that can't be
replaced too:
 - `std::unique_ptr<llmq::CChainLocksHandler>& m_clhandler;`
 - `std::unique_ptr<llmq::CInstantSendManager>& m_isman;`
- `std::unique_ptr<llmq::CQuorumBlockProcessor>&
m_quorum_block_processor;`


## How Has This Been Tested?
Run unit/functional tests.

## Breaking Changes
No breaking changes, all of these changes - are internal APIs for Dash
Core developers only.

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added or updated relevant unit/integration/functional/e2e
tests
- [x] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-06-04 15:26:23 -05:00
UdjinM6
89fcecbe4b
Merge pull request #5373 from knst/bc-bp-v20-missing-6
backport: bitcoin#17585, #17804, #17819, #18122, #18192, #18208, #18234, #18292, #18305, #18314, partial #18224
2023-06-01 16:53:48 +03:00
Samuel Dobson
68dfc06916 partial Merge #18224: Make AnalyzePSBT next role calculation simple, correct
1ef28b4f7cfba410fef524def1dac24bbc4086ca Make AnalyzePSBT next role calculation simple, correct (Gregory Sanders)

Pull request description:

  Sniped test and alternative to https://github.com/bitcoin/bitcoin/pull/18220

  Sjors documenting the issue:
  ```
  A PSBT signed by ColdCard was analyzed as follows (see #17509 (comment))

  {
    "inputs": [
      {
        "has_utxo": true,
        "is_final": false,
        "next": "finalizer"
      }
    ],
    "estimated_vsize": 141,
    "estimated_feerate": 1e-05,
    "fee": 1.41e-06,
    "next": "signer"
  }
  I changed AnalyzePSBT so that it returns "next": "finalizer" instead.
  ```

  It makes it much clearer that the role has been decided before hitting the `calc_fee` block, and groups all state-deciding in one spot instead of 2.

  Note that this assumes that PSBT roles are a complete ordering, which for now and in the future seems to be a correct assumption.

ACKs for top commit:
  Sjors:
    ACK 1ef28b4f7cfba410fef524def1dac24bbc4086ca, much nicer. Don't forget to document the bug fix.
  achow101:
    ACK 1ef28b4f7cfba410fef524def1dac24bbc4086ca
  Empact:
    ACK 1ef28b4f7c

Tree-SHA512: 22ba4234985c6f9c1445b14565c71268cfaa121c4ef000ee3d5117212b09442dee8d46d9701bceddaf355263fe25dfe40def2ef614d4f2fe66c9ce876cb49934
2023-05-31 18:14:23 -05:00
Konstantin Akimov
a5778e1db9 Merge #18314: tests: Add deserialization fuzzing of SnapshotMetadata (utxo_snapshot). Increase fuzzing coverage. 2023-05-31 18:14:23 -05:00
MarcoFalke
87de1bc7c7 Merge #18305: test: Explain why test logging should be used
ffff9dcdc3cbe427739cc19cc7a53f032474fa2a test: Explain why test logging should be used (MarcoFalke)

Pull request description:

  Background is that some tests don't have any `self.log` call at all. Thus there are no "anchor points" and those tests are hard to debug because the logs can't easily be parsed by a human.

ACKs for top commit:
  jonatack:
    ACK ffff9dcdc3cbe427739cc19cc7a53f032474fa2a
  instagibbs:
    ACK ffff9dcdc3
  fanquake:
    re-ACK ffff9dcdc3cbe427739cc19cc7a53f032474fa2a

Tree-SHA512: 08d962e85c4892c2a0c58feb5dc697c680a9d68e41a79417da6fcd415e0c5c735c4533a985cf225bb89deb5ca717d9bedf990657958079185804caa512b10f5a
2023-05-31 18:14:23 -05:00
MarcoFalke
c2b4dd698c Merge #18292: fuzz: Add assert(script == decompressed_script)
fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8 fuzz: Add assert(script == decompressed_script) (MarcoFalke)

Pull request description:

  Presumably an oversight in https://github.com/bitcoin/bitcoin/pull/17926#discussion_r389262151

ACKs for top commit:
  practicalswift:
    Tested ACK fab0e5ba7f2777b86f1487234ed7cc4be9f72ea8

Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370
2023-05-31 18:14:23 -05:00
Konstantin Akimov
c0ba1e3269 Merge #18234: refactor: Replace boost::mutex,condition_var,chrono with std equivalents in scheduler 2023-05-31 18:14:23 -05:00
MarcoFalke
cedb78e157 Merge #18192: Bugfix: Wallet: Safely deal with change in the address book
b5795a788639305bab86a8b3f6b75d6ce81be083 Wallet: Add warning comments and assert to CWallet::DelAddressBook (Luke Dashjr)
6d2905f57aaeb3ec3b63d31043f7673ca10003f2 Wallet: Avoid unnecessary/redundant m_address_book lookups (Luke Dashjr)
c751d886f499257627b308b11ffaa51c22db6cc0 Wallet: Avoid treating change-in-the-addressbook as non-change everywhere (Luke Dashjr)
8e64b8c84bcbd63caea06f3af087af1f0609eaf5 Wallet: New FindAddressBookEntry method to filter out change entries (and skip ->second everywhere) (Luke Dashjr)
65b6bdc2b164343ec3cc3d32a0297daff9e24fec Wallet: Add CAddressBookData::IsChange which returns true iff label has never been set (Luke Dashjr)
144b2f85da4d51bf7d72b987888ddcaf5b429eed Wallet: Require usage of new CAddressBookData::setLabel to change label (Luke Dashjr)
b86cd155f6f661052042048aa7cfc2a397afe4f7 scripted-diff: Wallet: Rename mapAddressBook to m_address_book (Luke Dashjr)

Pull request description:

  In many places, our code assumes that presence in the address book indicates a non-change key, and absence of an entry in mapAddressBook indicates change.

  This no longer holds true after #13756 (first released in 0.19) since it added a "used" DestData populated even for change addresses. Only avoid-reuse wallets should be affected by this issue.

  Thankfully, populating DestData does not write a label to the database, so we can retroactively fix this (so long as the user didn't see the change address and manually assign it a real label).

  Fixing it is accomplished by:

  * Adding a new bool to CAddressBookData to track if the label has ever been assigned, either by loading one from the database, or by assigning one at runtime.
  * `CAddressBookData::IsChange` and `CWallet::FindAddressBookEntry` are new methods to assist in excluding change from code that doesn't expect to see them.
  * For safety in merging, `CAddressBookData::name` has been made read-only (the actual data is stored in `m_label`, a new private member, and can be changed only with `setLabel` which updates the `m_change` flag), and `mapAddressBook` has been renamed to `m_address_book` (to force old code to be rebased to compile).

  A final commit also does some minor optimisation, avoiding redundant lookups in `m_address_book` when we already have a pointer to the `CAddressBookData`.

ACKs for top commit:
  ryanofsky:
    Code review ACK b5795a788639305bab86a8b3f6b75d6ce81be083. Pretty clever and nicely implemented fix!
  jonatack:
    ACK b5795a788639305bab86a8b3f6b75d6ce81be083 nice improvements -- code review, built/ran tests rebased on current master ff53433fe4ed06893d7c4 and tested manually with rpc/cli
  jnewbery:
    Good fix. utACK b5795a788.

Tree-SHA512: 40525185a0bcc1723f602243c269499ec86ecb298fecb5ef24d626bbdd5e3efece86cdb1084ad7eebf7eeaf251db4a6e056bcd25bc8457b417fcbb53d032ebf0
2023-05-31 18:14:23 -05:00