Commit graph

41822 commits

Author SHA1 Message Date
glozow
e8c3b7172c remove truc_policy.cpp from libbitcoin_common_a_SOURCES
It doesn't need it

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2024-07-11 11:55:37 +01:00
furszy
00b8e26bd6
test: fix inconsistency in fundrawtransaction weight limits test
Currently, the test is passing due to a mistake in the test inputs
selection process. We are selecting the parent transaction change
output as one of the inputs of the transaction to fund, which
helps to surpass the target amount when it shouldn't due to the
fee reduction.

The failure arises when the test behaves as intended by its coder;
that is, when it does not select the change output. In this case,
the pre-selected inputs aren't enough to cover the target amount.

Fix this by excluding the parent transaction's change output from
the inputs selection and including an extra input to cover the tx
fee.
2024-07-10 20:04:21 -03:00
Ava Chow
9b480f7a25
Merge bitcoin/bitcoin#30414: [doc] archive v26.2 release notes
3c61cf3986 [doc] archive v26.2 release notes (glozow)

Pull request description:

  To create the github release

ACKs for top commit:
  achow101:
    ACK 3c61cf3986
  stickies-v:
    ACK 3c61cf3986

Tree-SHA512: 70c316c68f73baae4abf4e5c8999620a7d7aa869a1dd51a4f72dc9093f24a52916249ee460648fe82bc6c1e5d568b9dca185b10b8faa86b499d84e30c65be3fa
2024-07-10 18:41:04 -04:00
Ava Chow
f4849f6922
Merge bitcoin/bitcoin#29668: prune, rpc: Check undo data when finding pruneheight
8789dc8f31 doc: Add note to getblockfrompeer on missing undo data (Fabian Jahr)
4a1975008b rpc: Make pruneheight also reflect undo data presence (Fabian Jahr)
96b4facc91 refactor, blockstorage: Generalize GetFirstStoredBlock (Fabian Jahr)

Pull request description:

  The function `GetFirstStoredBlock()` helps us find the first block for which we have data. So far this function only looked for a block with `BLOCK_HAVE_DATA`. However, this doesn't mean that we also have the undo data of that block, and undo data might be required for what a user would like to do with those blocks. One example of how this might happen is if some blocks were fetched using the `getblockfrompeer` RPC. Blocks fetched from a peer will have data but no undo data.

  The first commit here allows `GetFirstStoredBlock()` to check for undo data as well by passing a parameter. This alone is useful for #29553 and I would use it there.

  In the second commit I am applying the undo check to the RPCs that report `pruneheight` to the user. I find this much more intuitive because I think the user expects to be able to do all operations on blocks up until the `pruneheight` but that is not the case if undo data is missing. I personally ran into this once before and now again when testing for assumeutxo when I had used `getblockfrompeer`. The following commit adds test coverage for this change of behavior.

  The last commit adds a note in the docs of `getblockfrompeer` that undo data will not be available.

ACKs for top commit:
  achow101:
    ACK 8789dc8f31
  furszy:
    Code review ACK 8789dc8f31.
  stickies-v:
    ACK 8789dc8f31

Tree-SHA512: 90ae8bdd07a496ade579aa25240609c61c9ed173ad38d30533f6c631fe674e5a41727478ade69ca4b71a571ad94c9da4b33ebba6b5d8821109313c2de3bdfb3d
2024-07-10 15:27:05 -04:00
Ava Chow
394651ff10
Merge bitcoin/bitcoin#29996: Assumeutxo: bugfix on loadtxoutset with a divergent chain + test
5b7f70ba26 test: loadtxoutset in divergent chain with less work (Alfonso Roman Zubeldia)
d35efe1efc p2p: Start downloading historical blocks from common ancestor (Martin Zumsande)

Pull request description:

  This PR adds a test to cover the scenario of loading an assumeutxo snapshot when the current chain tip is not an ancestor of the snapshot block but has less work.

  During the review process, a bug was discovered where blocks between the last common ancestor and the background tip were not being requested if the background tip was not an ancestor of the snapshot block. mzumsande suggested a fix (65343ec49a6b73c4197dfc38e1c2f433b0a3838a) to start downloading historical blocks from the last common ancestor to address this issue. This fix has been incorporated into the PR with a slight modification.

  Related to https://github.com/bitcoin/bitcoin/issues/28648

ACKs for top commit:
  fjahr:
    tACK 5b7f70ba26
  achow101:
    ACK 5b7f70ba26
  mzumsande:
    Code Review ACK 5b7f70ba26

Tree-SHA512: f8957349686a6a1292165ea9e0fd8c912d21466072632a10f8ef9d852a5f430bc6b2a531e6884a4dbf2e3adb28b3d512b25919e78f5804a67320ef54c3b1aaf6
2024-07-10 15:18:33 -04:00
Ryan Ofsky
45f757c726
Merge bitcoin/bitcoin#29274: Fix issues with CI on forks
576828e732 ci: test-each-commit merge base optional (Sjors Provoost)
e9bfbb5414 ci: forks can opt-out of CI branch push (Cirrus only) (Sjors Provoost)

Pull request description:

  Maintainer note: `SKIP_BRANCH_PUSH=true` must be set in Cirrus for `bitcoin-core/gui` before merging this. See `https://cirrus-ci.com/github/bitcoin-core/gui` -> Settings.

  ---

  I find myself making pull requests against my fork (mostly on top of https://github.com/bitcoin/bitcoin/pull/28983, or asking others to do so. Currently only the Github actions are run on forks, because we use self-hosted runners for the Cirrus tasks.

  While setting up my own self-hosted runners for my fork, I ran into a number of issues. Some of those were addressed by https://github.com/bitcoin/bitcoin/pull/29441, but remaining issues are:

  1. When PRs are opened in the fork, cirrus CI jobs are run twice because PRs and branches reside in the same repository, rather than a main repository and a fork repository, as is the case with bitcoin/bitcoin PRs. Fix this by adding a `SKIP_BRANCH_PUSH` configuration option that allows skipping CI runs not directly associated with a PR. The fix is a generalization of [#20328](https://github.com/bitcoin/bitcoin/pull/20328), which fixed a similar problem for the bitcoin-core/gui mirror repository, and it allows removing a hardcoded reference to that repository.

      Github actions jobs will still run twice despite this change, see [#29274 (comment)](https://github.com/bitcoin/bitcoin/pull/29274#issuecomment-2188840483). Initially this PR tried to prevent that with b9fdd0dc75, but this had some potentially negative side effects, see [#29274 (comment)](https://github.com/bitcoin/bitcoin/pull/29274#discussion_r1457587805), so that commit was dropped for now.

  2. When PRs are opened in the fork, the "test-each-commit" github action can fail due to not being able to find a recent merge commit. This problem doesn't happen in the bitcoin/bitcoin repository because branches in this repository used as the base for pull requests always point at merge commits.

  This PR replaces https://github.com/bitcoin/bitcoin/pull/29259 using the self hosted workers via Cirrus instead of Github.

  You can see this PR in action on this pull request to my fork: https://github.com/Sjors/bitcoin/pull/30

  To test it yourself:

  1. spin up at least two [self hosted runners](https://github.com/cirruslabs/cirrus-cli/blob/master/PERSISTENT-WORKERS.md). Either use a seperate VM for each, or give them their own user.
  3. Install Podman and other CI dependencies (see .cirrus.yml)
  4. Give Cirrus access to your fork at https://cirrus-ci.com/settings/github/YOU
  5. Get a token from Cirrus and use it to start your worker(s)
  6. Optionally set SKIP_BRANCH_PUSH=true ~and NO_ARM=true~ env variables (see .cirrus.yml)
  make a pull request to your own fork, with this PR as the base branch

  Security wise: when dealing with code from strangers on the internet, review it first before running the CI. There's a Cirrus check-box that requires approval for people without write access to trigger CI.

ACKs for top commit:
  maflcko:
    ACK 576828e732
  ryanofsky:
    Code review ACK 576828e732.

Tree-SHA512: fb6be2f228aa62f45a65ce5c613c979b6f387df396f9601ce4622b27aa317a66f198e7d7a194592b0bb397b32a2f50f8be47065834d74af4ea09407c5c8d306d
2024-07-10 13:23:21 -04:00
MarcoFalke
fa601ab9f7
util: Catch translation string errors at compile time 2024-07-10 09:40:47 +02:00
Ava Chow
9adebe1455
Merge bitcoin/bitcoin#29154: tests: improve wallet multisig descriptor test and docs
d93b794709 tests: improve wallet multisig descriptor test and docs (Michael Dietz)

Pull request description:

  It is best to store all key origin information
  (master key fingerprint and all derivation steps)
  in the multisig descriptor. Being explicit with
  this information should be beneficial if this approach is used with other wallets/signers (whether hardware or software). There is no harm including all of this with xpubs (if anything it simplifies the test code) and makes this example/docs more complete and safer incase it is referenced by others.

ACKs for top commit:
  S3RK:
    Code Review ACK d93b794709
  achow101:
    ACK d93b794709

Tree-SHA512: 0e5c4d13f060489405e6cf50c8a09911f5a0cee71023649235afd80a5e3aae38d52c6e12ad4660205b9357b09f45596941391bdcf6fceccbe07c4e5a1592a482
2024-07-09 20:09:07 -04:00
Ava Chow
10677713ca
Merge bitcoin/bitcoin#30396: random: add benchmarks and drop unnecessary Shuffle function
6ecda04fef random: drop ad-hoc Shuffle in favor of std::shuffle (Pieter Wuille)
da28a26aae bench random: benchmark more functions, and add InsecureRandomContext (Pieter Wuille)
0a9bbc64c1 random bench refactor: move to new bench/random.cpp (Pieter Wuille)

Pull request description:

  This adds benchmarks for various operations on `FastRandomContext` and `InsecureRandomContext`, and then removes the ad-hoc `Shuffle` functions, now that it appears that standard library `std::shuffle` has comparable performance. The other reason for keeping `Shuffle`, namely the fact that libstdc++ used self-move (which debug mode panics on) has been fixed as well (see https://github.com/bitcoin/bitcoin/pull/29625#discussion_r1658344049).

ACKs for top commit:
  achow101:
    ACK 6ecda04fef
  hodlinator:
    ACK 6ecda04fef
  dergoegge:
    Code review ACK 6ecda04fef

Tree-SHA512: 2560b7312410581ff2b9bd0716e0f1558d910b5eadb9544785c972384985ac0f11f72d6b2797cfe2e7eb71fa57c30cffd98cc009cb4ee87a18b1524694211417
2024-07-09 17:52:47 -04:00
Ava Chow
c51c694ede
Merge bitcoin/bitcoin#29431: test/BIP324: disconnection scenarios during v2 handshake
c9dacd958d test: Check that non empty version packet is ignored and no disconnection happens (stratospher)
997cc00b95 test: Check that disconnection happens when AAD isn't filled (stratospher)
b5e6238fdb test: Check that disconnection happens when garbage sent/received are different (stratospher)
ad1482d5a2 test: Check that disconnection happens when wrong garbage terminator is sent (stratospher)
e351576862 test: Check that disconnection happens when >4095 garbage bytes is sent (stratospher)
e075fd131d test: Introduce test types and modify v2 handshake function accordingly (stratospher)
7d07daa623 log: Add V2 handshake timeout (stratospher)
d4a1da8543 test: Make global TRANSPORT_VERSION variable an instance variable (stratospher)
c642b08c4e test: Log when the garbage is actually sent to transport layer (stratospher)
86cca2cba2 test: Support disconnect waiting for add_p2p_connection (stratospher)
bf9669af9c test: Rename early key response test and move random_bitflip to util (stratospher)

Pull request description:

  Add tests for the following v2 handshake scenarios:
  1. Disconnection happens when > `MAX_GARBAGE_LEN` bytes garbage is sent
  2. Disconnection happens when incorrect garbage terminator is sent
  3. Disconnection happens when garbage bytes are tampered with
  4. Disconnection happens when AAD of first encrypted packet after the garbage terminator is not filled
  5. bitcoind ignores non-empty version packet and no disconnection happens

  All these tests require a modified v2 P2P class (different from `EncryptedP2PState` used in `v2_p2p.py`) to implement our custom handshake behaviour based on different scenarios and have been kept in a single test file (`test/functional/p2p_v2_misbehaving.py`). Shifted the test in `test/functional/p2p_v2_earlykeyresponse.py` which is of the same pattern to this file too.

ACKs for top commit:
  achow101:
    ACK c9dacd958d
  mzumsande:
    ACK c9dacd958d
  theStack:
    Code-review ACK c9dacd958d

Tree-SHA512: 90df81f0c7f4ecf0a47762d290a618ded92cde9f83d3ef3cc70e1b005ecb16125ec39a9d80ce95f99e695d29abd63443240cb5490aa57c5bc8fa2e52149a0672
2024-07-09 16:37:27 -04:00
Ryan Ofsky
5239e935cf
Merge bitcoin/bitcoin#30329: fuzz: improve utxo_snapshot target
de71d4dece fuzz: improve utxo_snapshot target (Martin Zumsande)

Pull request description:

  Add the possibility of giving more guidance to the creation of the metadata and/or coins, so that the fuzzer gets the chance
  to reach more error conditions in ActivateSnapshot and sometimes successfully creates a valid snapshot.

  This also changes the asserts for the success case that were outdated (after #29370) and only didn't result in a crash because the fuzzer wasn't able to reach this code before.

ACKs for top commit:
  maflcko:
    re-ACK de71d4dece 🎆
  fjahr:
    utACK de71d4dece
  TheCharlatan:
    ACK de71d4dece

Tree-SHA512: 346974d594164544d8cd3df7d8362c905fd93116215e9f5df308dfdac55bab04d727bfd7fd001cf11318682d11ee329b4b4a43308124c04d64b67840ab8a58a0
2024-07-09 16:13:14 -04:00
Sebastian Falbesoner
16bd283b3a Reapply "test: p2p: check that connecting to ourself leads to disconnect"
This reverts commit 9ec2c53701 with
a tiny change included (identation of the wait_until call).
2024-07-09 21:36:35 +02:00
Sebastian Falbesoner
0dbcd4c148 net: prevent sending messages in NetEventsInterface::InitializeNode
Now that the queueing of the VERSION messages has been moved out of
`InitializeNode`, there is no need to pass a mutable `CNode` reference any
more. With a const reference, trying to send messages in this method would
lead to a compile-time error, e.g.:

----------------------------------------------------------------------------------------------------------------------------------
...
net_processing.cpp: In member function ‘virtual void {anonymous}::PeerManagerImpl::InitializeNode(const CNode&, ServiceFlags)’:
net_processing.cpp:1683:21: error: binding reference of type ‘CNode&’ to ‘const CNode’ discards qualifiers
 1683 |     PushNodeVersion(node, *peer);
...
----------------------------------------------------------------------------------------------------------------------------------
2024-07-09 21:36:35 +02:00
Sebastian Falbesoner
66673f1c13 net: fix race condition in self-connect detection
Initiating an outbound network connection currently involves the
following steps after the socket connection is established (see
 `CConnman::OpenNetworkConnection` method):
    1. set up node state
    2. queue VERSION message
    3. add new node to vector `m_nodes`

If we connect to ourself, it can happen that the sent VERSION message
(step 2) is received and processed locally *before* the node object
is added to the connection manager's `m_nodes` vector (step 3). In this
case, the self-connect remains undiscovered, as the detection doesn't
find the outbound peer in `m_nodes` yet (see `CConnman::CheckIncomingNonce`).

Fix this by swapping the order of 2. and 3., by taking the `PushNodeVersion`
call out of `InitializeNode` and doing that in the `SendMessages` method
instead, which is only called for `CNode` instances in `m_nodes`.

Thanks go to vasild, mzumsande, dergoegge and sipa for suggestions on
how to fix this.
2024-07-09 21:35:53 +02:00
Ryan Ofsky
c06b3764fe
Merge bitcoin/bitcoin#30395: rpc: Use untranslated error strings in loadtxoutset
fa5b8920be rpc: Use untranslated error strings in loadtxoutset (MarcoFalke)
fa45865778 refactor: Use named arguments to get path arg in loadtxoutset (MarcoFalke)

Pull request description:

  Motivation:
  * Some are not translated at all, anyway. See https://github.com/bitcoin/bitcoin/pull/30267#discussion_r1663631973
  * For others translation is not yet needed, because they are not called by the GUI (yet)
  * For others translations will never be needed, because they are RPC code. See https://github.com/bitcoin/bitcoin/pull/30267#discussion_r1663611194

  Also, while touching this:
  * Remove the trailing `\n`. See https://github.com/bitcoin/bitcoin/pull/30267#discussion_r1663647981
  * Add back the path. See https://github.com/bitcoin/bitcoin/pull/30267#discussion_r1663666751
  * Use named args to get the path.

ACKs for top commit:
  fjahr:
    re-ACK fa5b8920be
  tdb3:
    ACK fa5b8920be
  ryanofsky:
    Code review ACK fa5b8920be

Tree-SHA512: 46504dc5fd55a6274ef885dbe071aa9efb25bca247cd68cd86fb2ff066d70d295e0522e1fe42e63f1fdf7e4c89bd696220edaf06e33b804aba746492eafd852e
2024-07-09 15:11:54 -04:00
Greg Sanders
3f00aae140 package rbf: cpfp structure requires package > parent feerate 2024-07-09 13:18:04 -04:00
Greg Sanders
ad7f1f697f test package rbf boundary conditions more closely 2024-07-09 13:18:04 -04:00
glozow
09370529fb fuzz: mini_miner_selection fixups.
Delete asserts that are redundant with the == assert.
Add assertion that the coinbase isn't already in mock_template_txids.
2024-07-09 17:22:57 +01:00
glozow
de273d5300 MiniMiner: use FeeFrac in AncestorFeerateComparator
Comparing using FeeFracs is more precise, allows us to simply the
code since FeeFrac comparison internally does cross-multiplication,
and avoids potential overflow in the multiplication.

Previously, we were only comparing feerates up to 0.001sat/vB precision,
since CFeeRate comparison just looks at their respective nSatoshisPerK.
This could lead to MiniMiner selecting packages in the wrong order (i.e.
by txid) if their feerates were less than 0.001sat/vB different.
2024-07-09 17:22:51 +01:00
glozow
3c61cf3986 [doc] archive v26.2 release notes 2024-07-09 15:36:36 +01:00
glozow
79b8472040
Merge bitcoin/bitcoin#30393: refactor: use existing RNG object in ProcessGetBlockData
fa2e74879a net_processing: use existing RNG object in ProcessGetBlockData (MarcoFalke)

Pull request description:

  Small follow-up to commit 8e31cf9c9b

ACKs for top commit:
  dergoegge:
    Code review ACK fa2e74879a
  glozow:
    ACK fa2e74879a

Tree-SHA512: 12709c79e6eefad184609b7306e0f65cb00123e39636cf8b7d538feb25c05ba3c36aa41468886c904a5f44fea267e67f9c4fbbab8733753d1c891b90fa40ce8b
2024-07-09 14:38:03 +01:00
TheCharlatan
51fa26239a
refactor: Mark some static global vars as const
These were found while looking for static mutable state in the kernel
library.
2024-07-08 21:19:23 +02:00
TheCharlatan
39f9b80fba
refactor: De-globalize last notified header index
In future, users of the kernel library might run multiple chainstates in
parallel, or create and destroy multiple chainstates over the lifetime
of a process. Having static, mutable variables could lead to state
inconsistencies in these scenarios.
2024-07-08 21:19:22 +02:00
TheCharlatan
3443943f86
refactor: De-globalize validation benchmark timekeeping
In future, users of the kernel library might run multiple chainstates in
parallel, or create and destroy multiple chainstates over the lifetime
of a process. Having static, mutable variables could lead to state
inconsistencies in these scenarios.
2024-07-08 21:19:18 +02:00
Ryan Ofsky
1f9d30744d
Merge bitcoin/bitcoin#29855: psbt: Check non witness utxo outpoint early
9e13ccc50e psbt: Check non witness utxo outpoint early (Ava Chow)

Pull request description:

  A common issue that our fuzzers keep finding is that outpoints don't exist in the non witness utxos. Instead of trying to track this down and checking in various individual places, do the check early during deserialization. This also unifies the error message returned for this class of problems.

ACKs for top commit:
  maflcko:
    lgtm ACK 9e13ccc50e
  S3RK:
    tACK 9e13ccc50e
  dergoegge:
    utACK 9e13ccc50e

Tree-SHA512: 81b8055b146c6358052226578ddfec0ae5bd877968c7f4f62dc3d6a684545ea568f37c7f1bd619918441af9e453ba8b26531a2280d218da37fa15480f1b45d0e
2024-07-08 13:56:52 -04:00
Ryan Ofsky
94d56b9def
Merge bitcoin/bitcoin#30141: kernel: De-globalize validation caches
606a7ab862 kernel: De-globalize signature cache (TheCharlatan)
66d74bfc45 Expose CSignatureCache class in header (TheCharlatan)
021d38822c kernel: De-globalize script execution cache hasher (TheCharlatan)
13a3661aba kernel: De-globalize script execution cache (TheCharlatan)
ab14d1d6a4 validation: Don't error if maxsigcachesize exceeds uint32::max (TheCharlatan)

Pull request description:

  The validation caches are currently setup independently from where the rest of the validation code is initialized. This makes their ownership semantics unclear. There is also no clear enforcement on when and in what order they need to be initialized. The caches are always initialized in the `BasicTestingSetup` although a number of tests don't actually need them.

  Solve this by moving the caches from global scope into the `ChainstateManager` class. This simplifies the usage of the kernel library by no longer requiring manual setup of the caches prior to using the `ChainstateManager`. Tests that need to access the caches can instantiate them independently.

  ---
  This pull request is part of the [libbitcoinkernel project](https://github.com/bitcoin/bitcoin/issues/27587).

ACKs for top commit:
  stickies-v:
    re-ACK 606a7ab862
  glozow:
    reACK 606a7ab
  ryanofsky:
    Code review ACK 606a7ab862. Just small formatting, include, and static_assert changes since last review.

Tree-SHA512: e7f3ee41406e3b233832bb67dc3a63c4203b5367e5daeed383df9cb590f227fcc62eae31311029c077d5e81b273a37a88a364db3dee2efe91bb3b9c9ddc8a42e
2024-07-08 12:14:12 -04:00
Sebastian Falbesoner
29eafd5733 rpc: doc: use "output script" terminology consistently in "asm"/"hex" results
The wording "public key script" was likely chosen as a human-readable form of
the technical term `scriptPubKey`, but it doesn't seem to be really widespread.
Replace it by the more common term "output script" instead. Note that the
argument for the `decodescript` RPC is not necessarily an output script (it
could e.g. be also a redeem script), so in this case we just stay generic and
use "script".

See also the draft BIP "Terminology for Transaction Components"
(https://github.com/murchandamus/bips/blob/2022-04-tx-terminology/bip-tx-terminology.mediawiki)
which suggests to use "output script" as well.

Affects the help text of the following RPCs:
    - decodepsbt
    - decoderawtransaction
    - decodescript
    - getblock (if verbosity=3)
    - getrawtransaction (if verbosity=2,3)
    - gettxout
2024-07-08 17:21:55 +02:00
merge-script
1c11089c7f
Merge bitcoin/bitcoin#30263: build: Bump clang minimum supported version to 16
fa8f53273c refactor: Remove no longer needed clang-15 workaround for std::span (MarcoFalke)
9999dbc1bd fuzz: Clarify Apple-Clang-16 workaround (MarcoFalke)
fa7462c67a build: Bump clang minimum supported version to 16 (MarcoFalke)

Pull request description:

  Most supported operating systems ship with clang-16 (or later), so bump the minimum to that and allow new code to drop workarounds for previous clang bugs.

  For reference:
  * https://packages.debian.org/bookworm/clang-16
  * https://packages.ubuntu.com/noble/clang (clang-18)
  * CentOS-like 8/9 Stream: All Clang versions from 16 to 17
  * FreeBSD 12/13: All Clang versions from 16 to 18
  * OpenSuse Tumbleweed ships with https://software.opensuse.org/package/clang (`clang18`); No idea about OpenSuse Leap

  On operating systems where the clang version is not shipped by default, the user would have to use GCC, or install clang in a different way. For example:

  * https://packages.debian.org/bookworm/g++ (g++-12)
  * https://packages.ubuntu.com/jammy/g++ (g++-11)
  * https://apt.llvm.org/, or nix, or guix, or compile clang from source, ...

  **Ubuntu 22.04 LTS does not ship with clang-16**, so one of the above workarounds is needed there.

  macOS 13 is unaffected, and the previous minimum requirement of Xcode15.0 remains, see also b1ba1b178f/.github/workflows/ci.yml (L93). For macOS 11 (Big Sur) and 12 (Monterey) you need to install a more recent version of llvm, this remains unchanged as well, see b1ba1b178f/doc/build-osx.md (L54).

ACKs for top commit:
  hebasto:
    ACK fa8f53273c, I have reviewed the code and it looks OK.
  TheCharlatan:
    Re-ACK fa8f53273c
  stickies-v:
    ACK fa8f53273c

Tree-SHA512: 18b79f88301a63bb5e367d2f52fffccd5fb84409061800158e51051667f6581a4cd71d4859d4cfa6d23e47e92963ab637e5ad87e3170ed23b5bebfbe99e759e2
2024-07-08 16:20:17 +01:00
glozow
a83f050dbe
Merge bitcoin/bitcoin#30404: Use WITH_LOCK in Warnings::Set
6af51e8198 Use WITH_LOCK in Warnings::Set (Ava Chow)

Pull request description:

  The scope of the lock should be limited to just guarding m_warnings as anything listening on `NotifyAlertChanged` may execute code that requires the lock as well.

  Fixes #30400

ACKs for top commit:
  maflcko:
    lgtm ACK 6af51e8198
  TheCharlatan:
    ACK 6af51e8198
  glozow:
    ACK 6af51e8198
  willcl-ark:
    ACK 6af51e8198
  stickies-v:
    ACK 6af51e8198

Tree-SHA512: 9884046c70dcad996276931b6d154f0330200332403828f34f7f7b285fc0e770ba7b25056131ab24dcb8a4b18f58d31633aa17fbb09b0eaea8a29e28fca10ec4
2024-07-08 15:50:46 +01:00
Ryan Ofsky
e53a3fb9b1
Merge bitcoin/bitcoin#30355: wallet: use LogTrace for walletdb log messages at trace level
46819f5df6 wallet: use LogTrace for walletdb log messages at trace level (Anthony Towns)

Pull request description:

  Wallet sqlite logging is enabled by `-debug=walletdb -loglevel=walletdb:trace` however the actual log messages are sent at `BCLog::Level::Info`. Switch to the trace level to make this consistent. This adds `[walletdb:trace]` to the log output, eg:

  ```
  [httpworker.3] [wallet/sqlite.cpp:55] [TraceSqlCallback] [/tmp/bitcoin_func_test_4fsnatpg/node0/regtest/wallets/boring/wallet.dat] SQLite Statement: BEGIN EXCLUSIVE TRANSACTION
  ```

  becomes

  ```
  [httpworker.0] [wallet/sqlite.cpp:55] [TraceSqlCallback] [walletdb:trace] [/tmp/bitcoin_func_test_9lcwth4z/node0/regtest/wallets/boring/wallet.dat] SQLite Statement: BEGIN EXCLUSIVE TRANSACTION
  ```

ACKs for top commit:
  maflcko:
    ACK 46819f5df6
  ryanofsky:
    Code review ACK 46819f5df6. Nice catch!
  furszy:
    ACK 46819f5df6
  luke-jr:
    utACK 46819f5df6

Tree-SHA512: 6fc1bc63c2ee686d4ca8f4f558f06c0cd9e7813b5fce1588351f55ef8bedfc23c97ea443e54a6a447008fa79ea022b6d631cb010929932f1db23fa8e255e6482
2024-07-08 10:26:24 -04:00
MarcoFalke
fa690c8e53
test: [refactor] Pass TestOpts 2024-07-08 16:11:15 +02:00
MarcoFalke
3333bae9b2
tidy: modernize-use-equals-default 2024-07-08 11:12:01 +02:00
Ava Chow
6af51e8198 Use WITH_LOCK in Warnings::Set
The scope of the lock should be limited to just guarding m_warnings as
anything listening on `NotifyAlertChanged` may execute code that
requires the lock as well.
2024-07-06 13:00:53 -04:00
Luke Dashjr
b71bfd9eef GUI/OptionsDialog: Prefer to stretch actual options area rather than waste space 2024-07-06 16:00:26 +00:00
Pieter Wuille
6ecda04fef random: drop ad-hoc Shuffle in favor of std::shuffle
Benchmarks show it is no longer faster with modern standard C++ libraries,
and the debug-mode failure due to self-move has been fixed as well.
2024-07-06 09:06:36 -04:00
Pieter Wuille
da28a26aae bench random: benchmark more functions, and add InsecureRandomContext
Also rename the benchmark names to match the operation names
2024-07-06 09:06:01 -04:00
Hodlinator
e233ec036d
refactor: Use designated initializer
Block was recently touched (e2d1f84858) and the codebase recently switched to C++20 which allows this to improve robustness.
2024-07-05 22:04:58 +02:00
MarcoFalke
fa5b8920be
rpc: Use untranslated error strings in loadtxoutset 2024-07-05 17:55:50 +02:00
MarcoFalke
fa2e74879a
net_processing: use existing RNG object in ProcessGetBlockData
Minor follow-up to 8e31cf9c9b, which did
the same.
2024-07-05 16:59:31 +02:00
Pieter Wuille
0a9bbc64c1 random bench refactor: move to new bench/random.cpp 2024-07-05 09:51:26 -04:00
Alfonso Roman Zubeldia
5b7f70ba26 test: loadtxoutset in divergent chain with less work 2024-07-05 12:08:06 +02:00
MarcoFalke
fa45865778
refactor: Use named arguments to get path arg in loadtxoutset 2024-07-05 11:07:07 +02:00
TheCharlatan
606a7ab862
kernel: De-globalize signature cache
Move its ownership to the ChainstateManager class.

Next to simplifying usage of the kernel library by no longer requiring
manual setup of the cache prior to using validation code, it also slims
down the amount of memory allocated by BasicTestingSetup.

Use this opportunity to make SignatureCache RAII styled

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2024-07-05 09:03:04 +02:00
Martin Zumsande
de71d4dece fuzz: improve utxo_snapshot target
Add the possibility of giving more guidance to the creation of the
metadata and/or coins, so that the fuzzer gets the chance
to reach more error conditions in ActivateSnapshot and sometimes
successfully creates a valid snapshot.

This also changes the asserts for the success case that were outdated,
and only didn't result in a crash because the fuzzer wasn't able
to reach this code before.
2024-07-04 20:12:47 -04:00
TheCharlatan
66d74bfc45
Expose CSignatureCache class in header
This is done in preparation for the following commit. Also rename it to
SignatureCache.
2024-07-04 22:45:27 +02:00
TheCharlatan
021d38822c
kernel: De-globalize script execution cache hasher
Move it to the ChainstateManager class.
2024-07-04 22:45:25 +02:00
TheCharlatan
13a3661aba
kernel: De-globalize script execution cache
Move its ownership to the ChainstateManager class.

Next to simplifying usage of the kernel library by no longer requiring
manual setup of the cache prior to using validation code, it also slims
down the amount of memory allocated by BasicTestingSetup.
2024-07-04 22:39:37 +02:00
TheCharlatan
ab14d1d6a4
validation: Don't error if maxsigcachesize exceeds uint32::max
Instead clamp it to uint32::max if it exceeds it.

Co-authored-by: Anthony Towns <aj@erisian.com.au>
2024-07-04 22:35:29 +02:00
Cory Fields
261f770333 contrib: rename cc to cxx in binary checking scripts 2024-07-04 20:16:16 +00:00
Cory Fields
a38c960005 contrib: use c++ rather than c for binary tests
We don't actually use a c compiler as part of Core's build (only for secp).
We should be testing against what we're actually using instead.
2024-07-04 20:16:16 +00:00