Commit graph

38692 commits

Author SHA1 Message Date
Andrew Chow
df98a12fc2
Merge bitcoin/bitcoin#28350: Log explicit error message when coindb is found in inconsistent state
df60de770d log: Print error message when coindb is in inconsistent state (Fabian Jahr)

Pull request description:

  While doing manual testing on assumeutxo this week I managed to put the coindb into an inconsistent state twice. For a normal user, this can also happen if their computer crashes during a flush or if they try to stop their node during a flush and then get tired of waiting and just shut their computer down or kill the process. It's an edge case but I wouldn't be surprised if this does happen more often when assumeutxo gets used more widely because there might be multiple flushes happening during loading of the UTXO set in the beginning and users may think something is going wrong because of the unexpected wait or they forgot some configs and want to start over quickly.

  The problem is, when this happens at first the node starts up normally until it's time to flush again and then it hits an assert that the user can not understand.

  ```
  2023-08-25T16:31:09Z [httpworker.0] [snapshot] 52000000 coins loaded (43.30%, 6768 MB)
  2023-08-25T16:31:16Z [httpworker.0] Cache size (7272532192) exceeds total space (7256510300)
  2023-08-25T16:31:16Z [httpworker.0] FlushSnapshotToDisk: flushing coins cache (7272 MB) started
  Assertion failed: (old_heads[0] == hashBlock), function BatchWrite, file txdb.cpp, line 126.
  Abort trap: 6
  ```

  We should at least log an error message that gives users a hint of what the problem is and what they can do to resolve it. I am keeping this separate from the assumeutxo project since this issue can also happen during any regular flush.

ACKs for top commit:
  jonatack:
    ACK df60de770d
  achow101:
    ACK df60de770d
  ryanofsky:
    Code review ACK df60de770d
  jamesob:
    Code review ACK df60de770d

Tree-SHA512: b546aa0b0323ece2962867a29c38e014ac83ae8f1ded090da2894b4ff2450c05229629c7e8892f7b550cf7def4038a0b4119812e548e11b00c60b1dc3d4276d2
2023-09-01 13:25:01 -04:00
glozow
b2f1d732cb
Merge bitcoin/bitcoin#28384: ci: Avoid oversubscription in functional tests on Windows
f2d4e510b3 ci: Avoid saving the same Ccache cache (Hennadii Stepanov)
14e5de6d02 ci: Avoid oversubscription in functional tests on Windows (Hennadii Stepanov)

Pull request description:

  This PR aims to reduce the frequency of functional test failures on Windows like this [one](https://github.com/bitcoin/bitcoin/actions/runs/6040229997):
  ```

  2023-09-01T01:05:01.850000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_framework.py", line 552, in start_nodes
      node.wait_for_rpc_connection()
    File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_node.py", line 296, in wait_for_rpc_connection
      self._raise_assertion_error("Unable to connect to bitcoind after {}s".format(self.rpc_timeout))
    File "D:\a\bitcoin\bitcoin\test\functional\test_framework\test_node.py", line 177, in _raise_assertion_error
      raise AssertionError(self._node_msg(msg))
  AssertionError: [node 1] Unable to connect to bitcoind after 2400s
  ```

  This code has had zero failures in my personal repository in more than 25 runs (and is still counting).

  ---

  The second commit is a minor improvement to avoid "Cache save failed." warnings during job re-runs. For [example](https://github.com/bitcoin/bitcoin/actions/runs/5998688759):

  ![image](https://github.com/bitcoin/bitcoin/assets/32963518/d8a049df-fccd-4395-99c9-4be01d0ea706)

ACKs for top commit:
  MarcoFalke:
    lgtm ACK f2d4e510b3 🐾

Tree-SHA512: 0c92817d37325a114886900e49a4d644201397d98d6ac9f2dcd41170c7e7ea2cb1873f7e51b5cb3ad3cc2e59554ad1c8f87d439ea6c1c960bf5c339153be7040
2023-09-01 13:55:11 +01:00
Hennadii Stepanov
f2d4e510b3
ci: Avoid saving the same Ccache cache
This occurred when a job was being rerun.
2023-09-01 11:08:20 +01:00
Hennadii Stepanov
14e5de6d02
ci: Avoid oversubscription in functional tests on Windows 2023-09-01 11:08:05 +01:00
Hennadii Stepanov
162ce4e5dd
qt: Update translation source file
The diff is generated by executing `make -C src translate`.
2023-09-01 08:08:36 +01:00
Hennadii Stepanov
19520bff09
qt: Bump Transifex slug for 26.x 2023-09-01 07:49:31 +01:00
Hennadii Stepanov
69821b27f5
qt: Translation updates from Transifex
The diff is generated by executing the `update-translations.py` script.
2023-09-01 07:39:00 +01:00
Andrew Chow
5666966dff
Merge bitcoin/bitcoin#28364: log: log wtxids when possible, add TXPACKAGES category
a3b55c94b9 [doc] move comment about AlreadyHaveTx DoS score to the right place (glozow)
3b8c17838a [log] add more logs related to orphan handling (glozow)
51b3275cd1 [log] add category TXPACKAGES for orphanage and package relay (glozow)
a33dde1e41 [log] include wtxid in tx {relay,validation,orphanage} logging (glozow)

Pull request description:

  This was taken from #28031 (see #27463 for project tracking).

  - Log wtxids in addition to txids when possible. This allows us to track the fate of a transaction from inv to mempool accept/reject through logs.
  - Additional orphan-related logging to make testing and debugging easier. Suggested in https://github.com/bitcoin/bitcoin/pull/28031#pullrequestreview-1531022386 and https://github.com/bitcoin/bitcoin/pull/28031#discussion_r1269622220
  - Add `TXPACKAGES` category for logging.
  - Move a nearby comment block that was in the wrong place.

ACKs for top commit:
  instagibbs:
    reACK a3b55c94b9
  achow101:
    ACK a3b55c94b9
  brunoerg:
    crACK a3b55c94b9
  mzumsande:
    Code review ACK a3b55c94b9

Tree-SHA512: 21884ef7c2ea2fd006e715574a9dd3e6cbbe8f82d62c6187fe1d39aad5a834051203fda5f355a06ca40c3e2b9561aec50d7c922a662b1edc96f7b552c9f4b24d
2023-08-31 12:55:38 -04:00
fanquake
a4e0bcb6c9
Merge bitcoin/bitcoin#28369: doc: Fill in the required skills in the good_first_issue template
fa3b816240 doc: Fill in the required skills in the good_first_issue template (MarcoFalke)

Pull request description:

  Compiling and running the tests is always required, so fill it in to avoid having to type it manually every time.

ACKs for top commit:
  willcl-ark:
    ACK fa3b816

Tree-SHA512: 1bcb93aaff235dd62513cda05547db90d12ad7638c050ee125845d20df1e1bc457bf4ec590677a0875fae8729dcc58842398e637e517997b35e3b3adffc34a72
2023-08-31 13:37:09 +01:00
Hennadii Stepanov
9561e497e9
Merge bitcoin-core/gui#749: make '-min' minimize wallet loading dialog
32db15450a gui: make '-min' minimize wallet loading dialog (furszy)

Pull request description:

  Simple fix for #748.

  When '-min' is enabled, no loading dialog should
  be presented on screen during startup.

ACKs for top commit:
  hebasto:
    ACK 32db15450a, tested on Debian 11 + XFCE.

Tree-SHA512: d08060b044938c67e8309db77b49ca645850fc21fdd7d78d5368d336fb9f602dcc66ea398a7505b00bf7d43afa07108347c7260480319fad3ec84cb41332f780
2023-08-31 12:29:24 +01:00
josibake
1580e3be83
fuzz: add ConstructPubKeyBytes function
Today, this code only has one spot where it needs well-formed pubkeys,
but future PRs will want to reuse this code.

Add a function which creates a well-formed byte array that can be turned
into a pubkey. It is not required that the pubkey is valid, just that it
can be recognized as a compressed or uncompressed pubkey.

Note: while the main intent of this commit is to wrap the existing
logic into a function, it also switches to `PickValueFromArray` so that
we are only choosing one of 0x04, 0x06, or 0x07. The previous code,
`ConsumeIntegralInRange` would have also picked 0x05, which is not
definied in the context of compressed vs uncompressed keys.

See https://bitcoin.stackexchange.com/questions/57855/c-secp256k1-what-do-prefixes-0x06-and-0x07-in-an-uncompressed-public-key-signif
for more details.
2023-08-30 17:45:51 +02:00
fanquake
96f2cf8d2c
build: use -muse-unaligned-vector-move for Windows
We currently work around a longstanding GCC issue with aligned vector
instructions, in our release builds, by patching the behaviour we want
into GCC (see discussion in #24736).

A new option now exists in the binutils assembler,
`-muse-unaligned-vector-move`, which should also achieve the behaviour
we want (at least for our code). This was added in the 2.38 release,
see
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=c8480b58e1968f209b6365af7422678f348222c2.
```bash
x86: Add -muse-unaligned-vector-move to assembler

Unaligned load/store instructions on aligned memory or register are as
fast as aligned load/store instructions on modern Intel processors.  Add
a command-line option, -muse-unaligned-vector-move, to x86 assembler to
encode encode aligned vector load/store instructions as unaligned
vector load/store instructions.
```

Even if we introduce this option into our build system, we'll have to
maintain our GCC patching, as we want all code that ends up in the
binary, to avoid these instructions. However, there may be some value in
adding the option, as it could be an improvement for someone building
(bitcoind.exe) with an unpatched compiler.
2023-08-30 16:34:37 +01:00
fanquake
df5af114df
Merge bitcoin/bitcoin#28353: ci: Remove /ro_base bind mount, Remove LC_ALL=C from s390x task
fa70cbd969 ci: Remove unused TEST_RUNNER_ENV="LC_ALL=C" from s390x task (MarcoFalke)
fa33354dcb ci: Remove /ro_base bind mount (MarcoFalke)
fa0df9d4c4 doc: Remove sudo from command that is already run as root (MarcoFalke)

Pull request description:

  Remove some CI stuff no longer needed.

ACKs for top commit:
  fanquake:
    ACK  fa70cbd969 - did not test the s390x job.

Tree-SHA512: 3a6ed0cfc855a92c2f834e59494c0a19a5647510247aece5e40a1aa78074894fe7454e684a1ea1f8f0662c50ac1caf2e390398b0fcfbf81544e6488fa9b8915e
2023-08-30 16:23:39 +01:00
fanquake
505ea30b47
Merge bitcoin/bitcoin#28370: guix: remove GCC 10 workaround from NSIS
588068d5a1 guix: remove GCC 10 workaround from NSIS (fanquake)

Pull request description:

  Fixed upstream in 3.06.
  See 229b6136c4 and https://sourceforge.net/p/nsis/bugs/1248/.

  Split from #27897, as that is still WIP, and GCC 12 isn't required to make this change.
  This commit could have gone in with #28328.

  Guix Build (same for x86_64 & aarch64):
  ```bash
  81a565bc5c719d04cb6640cf7593d7fdd6e37935dc2ac9280f638e625c1c5f87  guix-build-588068d5a12b/output/aarch64-linux-gnu/SHA256SUMS.part
  6f1ed3a2a053c3e90f1511fe33239378fc2631f46d795a955807ab39e2b93dfc  guix-build-588068d5a12b/output/aarch64-linux-gnu/bitcoin-588068d5a12b-aarch64-linux-gnu-debug.tar.gz
  c8a2904c651b862d9dce3f4094b59b66be5e745111b75c420452bd04ab9cdbe3  guix-build-588068d5a12b/output/aarch64-linux-gnu/bitcoin-588068d5a12b-aarch64-linux-gnu.tar.gz
  654bb5d89e12f936e63e2c910c78842c43db7048a895052295f613a50b639857  guix-build-588068d5a12b/output/arm-linux-gnueabihf/SHA256SUMS.part
  8a1b67f3c12b579b374c559f59d709bd83bcd3cff3ec5a4274119c0e5f6c388f  guix-build-588068d5a12b/output/arm-linux-gnueabihf/bitcoin-588068d5a12b-arm-linux-gnueabihf-debug.tar.gz
  7d8a3327599702a94be4b8d49eda7857f732c290773a775c6de507da656e271b  guix-build-588068d5a12b/output/arm-linux-gnueabihf/bitcoin-588068d5a12b-arm-linux-gnueabihf.tar.gz
  215786257409612206db7ff4008dbcb6a60dcf6cc92a1a437124a1483612f699  guix-build-588068d5a12b/output/arm64-apple-darwin/SHA256SUMS.part
  e36b41c531d34ca843028b778163bed4ce4c52310ed8056eff8a1a1b47b61fb7  guix-build-588068d5a12b/output/arm64-apple-darwin/bitcoin-588068d5a12b-arm64-apple-darwin-unsigned.dmg
  ecb488625bdf566e7c63781795f296ec4f630ef90edf7e6073591ed1d9b90bda  guix-build-588068d5a12b/output/arm64-apple-darwin/bitcoin-588068d5a12b-arm64-apple-darwin-unsigned.tar.gz
  d8f9759a903cd052ea3e562d1ef186c9dad38089205650d1bcb218e7506c378f  guix-build-588068d5a12b/output/arm64-apple-darwin/bitcoin-588068d5a12b-arm64-apple-darwin.tar.gz
  385084fe6d80d0b563b1b20d558b29681fd5bf624bc70c403e831cd8aae45dc0  guix-build-588068d5a12b/output/dist-archive/bitcoin-588068d5a12b.tar.gz
  89504c8be28482d4f70740d6865aa26db0e1854d0b35598c43462cd35f0b49c4  guix-build-588068d5a12b/output/powerpc64-linux-gnu/SHA256SUMS.part
  5836bfb4c9a11318362a89db25e4cd9363688ae6be18a6abfd1974a52c0b2759  guix-build-588068d5a12b/output/powerpc64-linux-gnu/bitcoin-588068d5a12b-powerpc64-linux-gnu-debug.tar.gz
  3e6f4481a594316ab08ea946c5fac6055ca8a81a91ce0a20c44976b3bc4f8d0d  guix-build-588068d5a12b/output/powerpc64-linux-gnu/bitcoin-588068d5a12b-powerpc64-linux-gnu.tar.gz
  4e753efe5a20cf6f1e83e604d9f8ba0d79b3c96fc5d5487ec7ed0f33c819b99a  guix-build-588068d5a12b/output/powerpc64le-linux-gnu/SHA256SUMS.part
  9d29e49b519ce1d683531699dd15e72495052151b21404affc50e7b228155eb1  guix-build-588068d5a12b/output/powerpc64le-linux-gnu/bitcoin-588068d5a12b-powerpc64le-linux-gnu-debug.tar.gz
  511179d90bbf6beb45b6168575a78600d38a060891dc1aa8f11f0adc5ba51f87  guix-build-588068d5a12b/output/powerpc64le-linux-gnu/bitcoin-588068d5a12b-powerpc64le-linux-gnu.tar.gz
  d46184105524d59a75066b067b63df6bfd2203d8003c343a5898ee7d4e4f78e5  guix-build-588068d5a12b/output/riscv64-linux-gnu/SHA256SUMS.part
  b6434ec5a4a046b9448f36f5596f6db0f8cd71a3e4383827869fcbaa25e005e4  guix-build-588068d5a12b/output/riscv64-linux-gnu/bitcoin-588068d5a12b-riscv64-linux-gnu-debug.tar.gz
  237e37ccae4095a1d8aa34d6b967655561ba0a524dfb79e3dcd4c18ad8f8a222  guix-build-588068d5a12b/output/riscv64-linux-gnu/bitcoin-588068d5a12b-riscv64-linux-gnu.tar.gz
  db28897936262e344da8011d37afde97ed53ba4f5ce1a3f935d258284b22e649  guix-build-588068d5a12b/output/x86_64-apple-darwin/SHA256SUMS.part
  8d71763fc748cde1f68785eef4b1a498c1ec4c13cf94f02ad8727debe0d94a1d  guix-build-588068d5a12b/output/x86_64-apple-darwin/bitcoin-588068d5a12b-x86_64-apple-darwin-unsigned.dmg
  1e0bf2ef0f65f2e7fe5439fe0a15a4803e06d7c42dae06133be5d1b67fa30657  guix-build-588068d5a12b/output/x86_64-apple-darwin/bitcoin-588068d5a12b-x86_64-apple-darwin-unsigned.tar.gz
  2d71083593583f3a3ed2e83d4a05f67338e9cb51cb730d238827eef7d3e9007e  guix-build-588068d5a12b/output/x86_64-apple-darwin/bitcoin-588068d5a12b-x86_64-apple-darwin.tar.gz
  cc3cc2c1077a04d5643ca21a43b8b7f233b8c743eb73f066643ddfd4a1e1ce27  guix-build-588068d5a12b/output/x86_64-linux-gnu/SHA256SUMS.part
  e18c1c0c1cf836c9e540edd969d2657afd3847345b1e0a6e5a9bebfd35782c47  guix-build-588068d5a12b/output/x86_64-linux-gnu/bitcoin-588068d5a12b-x86_64-linux-gnu-debug.tar.gz
  4c88aa50227ccd7bb9069369cfc2196de42212f5d0553902155346ae39ef2401  guix-build-588068d5a12b/output/x86_64-linux-gnu/bitcoin-588068d5a12b-x86_64-linux-gnu.tar.gz
  51f9f0d9c21598d9d37132e21c786378468c50c393b46e084d81c504186238cd  guix-build-588068d5a12b/output/x86_64-w64-mingw32/SHA256SUMS.part
  a4a0b55a40ba17b70c93eaba132e31c94cb2380cad0fe4e2ebe199c68a49c293  guix-build-588068d5a12b/output/x86_64-w64-mingw32/bitcoin-588068d5a12b-win64-debug.zip
  75495c9a00ee7401b96afa51c93fe56d8b10a531ce0526f5b4713b9e8aaab9a5  guix-build-588068d5a12b/output/x86_64-w64-mingw32/bitcoin-588068d5a12b-win64-setup-unsigned.exe
  a6e8416846ebea253d2b3c5c40f60a227bd5cfb2272a477cf364a085fea140e4  guix-build-588068d5a12b/output/x86_64-w64-mingw32/bitcoin-588068d5a12b-win64-unsigned.tar.gz
  2bbd6cd49ad0297a5b3279a5cfbcbb35586cfdd72388e5e1ef2d87e1c8a9cf97  guix-build-588068d5a12b/output/x86_64-w64-mingw32/bitcoin-588068d5a12b-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 588068d5a1.

Tree-SHA512: e5876d64ee02fef8a7152b9f649949933b356347de713e00a58aba278243b7de999c3fc50f3cc88e625d07a38e5a6ec2afcb6e836d256b6ac91e91f90f473e64
2023-08-30 16:19:59 +01:00
fanquake
1348454d82
Merge bitcoin/bitcoin#28352: test: Support powerpc64le in get_previous_releases.py
faf7e69862 test: Support powerpc64le in get_previous_releases.py (MarcoFalke)

Pull request description:

  To test: `test/get_previous_releases.py -b -t /tmp/prev_releases v22.0`

  On master: `Not sure which binary to download for powerpc64le-unknown-linux-gnu`
  Here: (pass)

ACKs for top commit:
  fanquake:
    ACK faf7e69862

Tree-SHA512: 33d9348f99e0d3924a6a5cba8833ec9e413e80167012b557922f3628069dabd555b02f98a6bfd0eb80e2bbbcdb50865b7bca216e1d080b1546ee4812abda4bc2
2023-08-30 16:16:44 +01:00
fanquake
13e169a0c6
Merge bitcoin/bitcoin#28360: ci, windows: Do not run extended functional tests for pull requests
62ab3e98ff ci, windows: Do not run extended functional tests for pull requests (Hennadii Stepanov)

Pull request description:

  This PR is intended to speed up the CI feedback for pull requests:

  - a [PR](https://github.com/bitcoin/bitcoin/actions/runs/6019964104?pr=28196) opened against the current master branch:
  ![image](https://github.com/bitcoin/bitcoin/assets/32963518/481a70eb-13f3-40c9-8f6a-ca2f06350158)

  - this PR:
  ![image](https://github.com/bitcoin/bitcoin/assets/32963518/2582307f-7b72-4816-b5be-e84d5e4a3016)

  Suggested in https://github.com/bitcoin/bitcoin/pull/28173#discussion_r1302929493:

  > An alternative would be to run them on non-pr pushes only. Failures should be rare enough to deal with them post-merge.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 62ab3e98ff if https://github.com/hebasto/bitcoin/actions/runs/6023862001/job/16341417883 is green

Tree-SHA512: e937efc5c03290f5d246ce1b0638dc72f39ef1d509ba5d2063f92bfe9157c602e6a952a9558dfc6413bbc5209fe55280b3278a0e4079773b8cc9ff236c8f9246
2023-08-30 16:15:46 +01:00
MarcoFalke
fa3b816240
doc: Fill in the required skills in the good_first_issue template 2023-08-30 14:02:08 +02:00
Hennadii Stepanov
62ab3e98ff
ci, windows: Do not run extended functional tests for pull requests
This change is intended to speed up the CI feedback for pull requests.
2023-08-30 11:46:47 +01:00
fanquake
588068d5a1
guix: remove GCC 10 workaround from NSIS
Fixed upstream in 3.06, see
229b6136c4.
https://sourceforge.net/p/nsis/bugs/1248/
2023-08-30 11:10:53 +01:00
MarcoFalke
fa07ac48d8
ci: Asan with -ftrivial-auto-var-init=pattern 2023-08-30 10:52:27 +02:00
glozow
a3b55c94b9 [doc] move comment about AlreadyHaveTx DoS score to the right place
This comment isn't in the right place, as detection of a tx in
recent_rejects would cause the function to exit much earlier.
Move the comment to the right place and tweak the first sentence for
accuracy.
2023-08-29 16:41:22 +01:00
glozow
3b8c17838a [log] add more logs related to orphan handling
- Whenever a tx is erased. Allows somebody to see which transactions
  have been erased due to expiry/overflow, not just how many.
- Whenever a tx is added to a peer's workset.
- AcceptToMemoryPool when a tx is accepted, mirroring the one logged for
  a tx received from a peer. This allows someone to see all of the
  transactions that are accepted to mempool just by looking for ATMP logs.
- MEMPOOLREJ when a tx is rejected, mirroring the one logged for
  a tx received from a peer. This allows someone to see all of the
  transaction rejections by looking at MEMPOOLREJ logs.
2023-08-29 16:41:22 +01:00
glozow
51b3275cd1 [log] add category TXPACKAGES for orphanage and package relay 2023-08-29 16:41:22 +01:00
glozow
a33dde1e41 [log] include wtxid in tx {relay,validation,orphanage} logging 2023-08-29 16:41:22 +01:00
fanquake
ab42b2ebdb
Merge bitcoin/bitcoin#28347: lint: replace deprecated pkg_resources with importlib.metadata
6c008a2006 script: replace deprecated pkg_resources with importlib.metadata (Jon Atack)

Pull request description:

  Running our python linter with a recent python and the latest release of setuptools [v68.1.2](https://setuptools.pypa.io/en/stable/history.html):

  ```
  $ python3 --version
  Python 3.11.5
  $ ./test/lint/lint-python.py:12: DeprecationWarning: pkg_resources is deprecated as an API.
    See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources
  ```

  Using `pkg_resources` was [deprecated](https://github.com/pypa/setuptools/pull/3843) earlier in [v67.5.0](https://setuptools.pypa.io/en/stable/history.html#id55): "Although pkg_resources has been discouraged for use, some projects still consider pkg_resources viable for usage. This change makes it clear that pkg_resources should not be used, emitting a DeprecationWarning when imported."

  The `importlib.metadata` library requires Python 3.8, which is currently our minimum-supported Python version.

  For more details about `importlib.metadata` and the two methods imported and used here, see:

  - https://docs.python.org/3/library/importlib.metadata.html
  - https://importlib-metadata.readthedocs.io/en/latest/api.html#importlib_metadata.metadata
  - https://importlib-metadata.readthedocs.io/en/latest/api.html#importlib_metadata.PackageNotFoundError

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 6c008a2006 (review only, did not test)

Tree-SHA512: f5258d37043fcc9744f85641a60a3395ad43822c72d030dea8c39fa7f48ec3d7790cdeeb832f96e8f38046adb7c62fbc577c975ef0c77c8047c0c8f2353ce540
2023-08-29 09:42:31 +01:00
fanquake
5175ae482e
Merge bitcoin/bitcoin#28354: test: default acceptnonstdtxn=0 on all chains
13eb8aa572 doc: Release notes for testnet defaulting to -acceptnonstdtxn=0 (Anthony Towns)
e1dc15d690 config: default acceptnonstdtxn=0 on all chains (Anthony Towns)

Pull request description:

  Changes `-acceptnonstxtxn` to default to 0 on testnet, matching the other chains. Allowing non-standard txs on testnet by default contributed to the difficulties RSK described in #26348: "We see that there are two script paths and, to reduce the script size, a single CHECKMULTISIG is used for the two paths, separating the signer count from the CHECKMULTISIG opcode. This script worked on testnet, because it lacks the standard checks performed in Mainnet."

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 13eb8aa572
  sipa:
    utACK 13eb8aa572
  instagibbs:
    utACK 13eb8aa572
  theStack:
    Code-review ACK 13eb8aa572

Tree-SHA512: eff7a3f9fc9b94003a730beb96e6f3399bc8b8e93fde4b15f20a11eda61d9a3e076f4423989f98b794b32681abecbc3756a54cd0d37b136e2fb2ffbb47ee7774
2023-08-29 09:27:19 +01:00
MarcoFalke
faec591d64
Support for serialization parameters
The moved part can be reviewed with the git options
 --ignore-all-space --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space

(Modified by Marco Falke)

Co-authored-by: Pieter Wuille <pieter@wuille.net>
2023-08-28 17:48:26 +02:00
MarcoFalke
fac42e9d35
Rename CSerAction* to Action*
This allows new code, added in the next commit, to conform to the coding
guideline: No C-prefix for class names.
2023-08-28 17:48:15 +02:00
MarcoFalke
aaaa3fa947
Replace READWRITEAS macro with AsBase wrapping function
Co-authored-by: Pieter Wuille <pieter@wuille.net>
2023-08-28 17:48:15 +02:00
fanquake
1c1a02bbd2
Merge bitcoin/bitcoin#28341: refactor: Use HashWriter over legacy CHashWriter
99995cfe8d refactor: Use HashWriter over legacy CHashWriter (via SerializeHash) (MarcoFalke)
5555aa2d0d refactor: Use HashWriter over legacy CHashWriter (MarcoFalke)

Pull request description:

  `HashWriter` is a slim and less confusing version of `CHashWriter`, so use it in all places where it compiles.

  This should be correct, if it compiles.

ACKs for top commit:
  sipa:
    That said, code review ACK 99995cfe8d
  theuni:
    ACK 99995cfe8d
  TheCharlatan:
    ACK 99995cfe8d

Tree-SHA512: fc967a18379bd00bd334ac3d50beb5435b65ca66a48f72623f1dcdbbce3292fd91839160cd0e69b8f4f3d98e258dcbbc6f73f5e91345f938898ee39c903a442b
2023-08-28 16:20:50 +01:00
Anthony Towns
13eb8aa572 doc: Release notes for testnet defaulting to -acceptnonstdtxn=0 2023-08-28 22:09:39 +10:00
Anthony Towns
e1dc15d690 config: default acceptnonstdtxn=0 on all chains
Previously, the default for acceptnonstdtxn defaulted to 0 on all
chains except testnet. Change this to be consistent across all
chains, and remove the parameter from chainparams entirely.
2023-08-28 22:09:39 +10:00
fanquake
db57574aa8
Merge bitcoin/bitcoin#28173: ci: Run Windows native task on GitHub Actions
6a43372980 ci: Run "Win64 native" job on GitHub Actions (Hennadii Stepanov)

Pull request description:

  From https://github.com/bitcoin/bitcoin/issues/28098:
  > Thus, someone would have to sponsor an amount of roughly 5kUSD/mo for those two tasks.

  > If the goal is to stay on a free plan, I think the only option is GitHub Actions CI.

  Historical context:
  - https://github.com/bitcoin/bitcoin/pull/17697
  - https://github.com/bitcoin/bitcoin/issues/17803
  - https://github.com/bitcoin/bitcoin/pull/18031

  Security concerns:
  - https://github.com/bitcoin/bitcoin/issues/28098#issuecomment-1651432106
  - https://github.com/bitcoin/bitcoin/issues/28098#issuecomment-1651688197

  `GITHUB_TOKEN` permissions (from the build log in my personal repo):
  ```
  2023-07-27T07:30:17.8313534Z ##[group]GITHUB_TOKEN Permissions
  2023-07-27T07:30:17.8314113Z Contents: read
  2023-07-27T07:30:17.8314608Z Metadata: read
  2023-07-27T07:30:17.8314957Z Packages: read
  2023-07-27T07:30:17.8315233Z ##[endgroup]
  ```

  Comparison of resources:

  | Resource | Current, Cirrus CI | Suggested, GitHub Actions |
  |---|:-:|:-:|
  | CPU | 6 | 2 |
  | RAM, GB | 12 | 7 |

  The `TEST_RUNNER_TIMEOUT_FACTOR` variable is set to the current default value for all CI tasks: 64440bb733/ci/test/00_setup_env.sh (L48)

Top commit has no ACKs.

Tree-SHA512: ddfdaf7a1e4793a64ac0cd20f116b29608dd06f15b062769ac70b3ea2fb82775aa96aa79c7b768efefec4338aaa5b57d267b592f62d0e8d5d94ecc11001a165d
2023-08-28 11:27:29 +01:00
MarcoFalke
fa70cbd969
ci: Remove unused TEST_RUNNER_ENV="LC_ALL=C" from s390x task 2023-08-27 22:50:42 +02:00
MarcoFalke
fa33354dcb
ci: Remove /ro_base bind mount
Just set the bind mount to BASE_READ_ONLY_DIR, which allows to drop one
line of code and makes the code easier to understand.
2023-08-27 22:50:07 +02:00
MarcoFalke
fa0df9d4c4
doc: Remove sudo from command that is already run as root 2023-08-27 22:49:59 +02:00
MarcoFalke
faf7e69862
test: Support powerpc64le in get_previous_releases.py 2023-08-27 22:28:57 +02:00
Fabian Jahr
df60de770d
log: Print error message when coindb is in inconsistent state 2023-08-27 20:16:43 +02:00
fanquake
8371914604
Merge bitcoin/bitcoin#28337: build: use Clang 15 for macOS cross-compilation
ff42d81383 guix: use clang-toolchain-15 for macOS compilation (fanquake)
94955b4b1d depends: use LLVM/Clang 15.0.6 for macOS cross-compile (fanquake)

Pull request description:

  This will end up being a blocker for #28210, and is already part of #21778, even though an even newer LLVM/Clang combination is required (and still missing from upstream Guix). Seems straight-forward enough to just bump the macOS compiler to a more modern Clang.

ACKs for top commit:
  TheCharlatan:
    re-ACK ff42d81383

Tree-SHA512: 8af4b54c3a56abb3825c6470444a28e14e9c69820c09ec4a33acebb8ae434df9ae18163c088a582130cc68755293a7e2bde5d065763919d94064ff9b3f83730f
2023-08-27 14:54:48 +01:00
fanquake
ff42d81383
guix: use clang-toolchain-15 for macOS compilation 2023-08-27 10:03:00 +01:00
fanquake
94955b4b1d
depends: use LLVM/Clang 15.0.6 for macOS cross-compile
There is no x86_64 binaries for 15.0.7.
2023-08-27 10:02:55 +01:00
Jon Atack
6c008a2006 script: replace deprecated pkg_resources with importlib.metadata
in our python linter:

```
./test/lint/lint-python.py:12: DeprecationWarning: pkg_resources is deprecated as an API.
  See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
```

The importlib.metadata library was added in Python 3.8, which is currently our
minimum-supported Python version.

For more details about importlib.metadata, see https://docs.python.org/3/library/importlib.metadata.html
2023-08-26 16:42:02 -06:00
fanquake
03675b2ba3
Merge bitcoin/bitcoin#28328: guix: update time-machine
6cbedc3d9b guix: drop Windows broken-longjmp.patch (fanquake)
a1d4a42993 guix: drop NSIS patch now that we use 3.09 (fanquake)
1f6c75e82b guix: use cross-* keyword arguments (fanquake)
ea4387e1d0 guix: update time-machine to 160f78a4d92205df986ed9efcce7d3aac188cb24 (fanquake)
f1a4afb26f guix: update python-oscrypto to 1.3.0 (fanquake)
a8a7b75a01 guix: backport glibc patch to fix powerpc build (fanquake)

Pull request description:

  Bumps our Guix time-machine to [160f78a4d92205df986ed9efcce7d3aac188cb24](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=160f78a4d92205df986ed9efcce7d3aac188cb24), which includes:

  GCC 10.3.0 -> 10.4.0
  Binutils 2.37 -> 2.38
  Automake 1.16.3 -> 1.16.5
  Coreutils 8.32 -> 9.1
  Findutils 4.8.2 -> 4.9.0
  Libtool 2.4.6 -> 2.4.7
  Linux Libre Headers 5.15.37 -> 5.15.127
  Git 2.36.0 -> 2.41.0
  Mingw-w64 8.0.0 -> 11.0.1
  NSIS 3.05 -> 3.09
  Xorriso 1.5.2 -> 1.5.6.pl02
  Python 3.9 -> 3.10.7
  Python-asn1crypto 1.4.0 -> 1.5.1

  GCC 12.3.0 becomes available. See #27897.
  LLVM 15.0.7 becomes available. Sadly not quite new enough for #21778.

  Split from #27897 for easier review, and to make it clear which changes are part of the time-machine bump vs changing to GCC 12.

  Guix Build:
  ```bash
  1e4aab93de36b47cbbfc5882d3d2a598e54a9c3604b3be1891ddac70cdc46547  guix-build-6cbedc3d9b67/output/aarch64-linux-gnu/SHA256SUMS.part
  278206bddf166ce507ab2ae4742ffbe6ec4256dbc6beee7e42ea040ec3d5b679  guix-build-6cbedc3d9b67/output/aarch64-linux-gnu/bitcoin-6cbedc3d9b67-aarch64-linux-gnu-debug.tar.gz
  261974753869297a480db24733f057aa58e33a0ce08754bea74984a00f8c376f  guix-build-6cbedc3d9b67/output/aarch64-linux-gnu/bitcoin-6cbedc3d9b67-aarch64-linux-gnu.tar.gz
  13bde7d903665f7699e2aa42a23ddc5ece9fab450437ae641d8ebfe6f6b084e1  guix-build-6cbedc3d9b67/output/arm-linux-gnueabihf/SHA256SUMS.part
  df951e4b23db34d1248f7ee9837594645acea8e2de1ed03b23ee002579a4c653  guix-build-6cbedc3d9b67/output/arm-linux-gnueabihf/bitcoin-6cbedc3d9b67-arm-linux-gnueabihf-debug.tar.gz
  5839bb71cca6aafa662f3c7e1c09393dce1c3fd13241726796bf3e681a0a34f0  guix-build-6cbedc3d9b67/output/arm-linux-gnueabihf/bitcoin-6cbedc3d9b67-arm-linux-gnueabihf.tar.gz
  637b1aa49db0cab1bc35064d068f1a5fdee5ab2ceba30b7f6d2c80bbf174c107  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/SHA256SUMS.part
  be87c1ad41f06bcaa8c940fc8d881eca41c531d250ce114325b0e042e603c257  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/bitcoin-6cbedc3d9b67-arm64-apple-darwin-unsigned.dmg
  632956e64d2baf9329ee086781b9268786f37b7c3c5f5232e2394ef2839d6d40  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/bitcoin-6cbedc3d9b67-arm64-apple-darwin-unsigned.tar.gz
  1b23548a94aee5e03a8aec1e63938d9c8505005b87fa832ed112af60861c42a6  guix-build-6cbedc3d9b67/output/arm64-apple-darwin/bitcoin-6cbedc3d9b67-arm64-apple-darwin.tar.gz
  e4056df68bac0bdc0a54899af8f8178e78bfb7d170750f2296fd512d0c6c20db  guix-build-6cbedc3d9b67/output/dist-archive/bitcoin-6cbedc3d9b67.tar.gz
  9f149c82f30eed35e2c217dc57cab37745db27f0a3205e66b4535c247dffc500  guix-build-6cbedc3d9b67/output/powerpc64-linux-gnu/SHA256SUMS.part
  ef91dce0a735ce0633fd273d9e1d6599d74c18280a866c1d6b71c2c3434af9c3  guix-build-6cbedc3d9b67/output/powerpc64-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64-linux-gnu-debug.tar.gz
  dfb60f13b9a7435f608f6d09585de37f789b055c77a0ee729e5723b0ef0550fe  guix-build-6cbedc3d9b67/output/powerpc64-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64-linux-gnu.tar.gz
  0ae916b95617042330166e20a27399c14abbc20638ae3e5e5f9f812146d4a07e  guix-build-6cbedc3d9b67/output/powerpc64le-linux-gnu/SHA256SUMS.part
  180d9c29da1efd21fba6be8a670b6ed01d71a5e90991da3c543f6720273831a2  guix-build-6cbedc3d9b67/output/powerpc64le-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64le-linux-gnu-debug.tar.gz
  9753408e3b4c10b19dba30ecb12ee2ae065c08e7c88be25599e1fdffe81bddbe  guix-build-6cbedc3d9b67/output/powerpc64le-linux-gnu/bitcoin-6cbedc3d9b67-powerpc64le-linux-gnu.tar.gz
  b1f09baec636a3bbaff1be629c95e75767c4ae3d96f0ebe63dcefb6fdb4953fb  guix-build-6cbedc3d9b67/output/riscv64-linux-gnu/SHA256SUMS.part
  09149283880c39c76f73ce83848f266f93777f6d9d389c2448ef0a9af9339b30  guix-build-6cbedc3d9b67/output/riscv64-linux-gnu/bitcoin-6cbedc3d9b67-riscv64-linux-gnu-debug.tar.gz
  788ce14925fec9861c78e16a57a1fd25d0f2ddf3f4e10f3c795bac534d339197  guix-build-6cbedc3d9b67/output/riscv64-linux-gnu/bitcoin-6cbedc3d9b67-riscv64-linux-gnu.tar.gz
  f357a0522c779d1953f37f4cab0160622cbf89ed3fe49cb5abea2509dba1d76f  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/SHA256SUMS.part
  be5c797a3e4dc969fd9116dede0cb27bda5180e653bb63d1ef3dbcc3de983bf0  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/bitcoin-6cbedc3d9b67-x86_64-apple-darwin-unsigned.dmg
  7364b2d0223b39debd386b521a5c5d1b26a446331f347b4d4e8fc58bf5b4439e  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/bitcoin-6cbedc3d9b67-x86_64-apple-darwin-unsigned.tar.gz
  7e873165d4ed785381b6e461a81a947814d14fdd41ae65bc82134c03b3ac0471  guix-build-6cbedc3d9b67/output/x86_64-apple-darwin/bitcoin-6cbedc3d9b67-x86_64-apple-darwin.tar.gz
  bf03ca15a885330ed0c91b3137dcc4ec1102570898360cc3f1073f03b792d729  guix-build-6cbedc3d9b67/output/x86_64-linux-gnu/SHA256SUMS.part
  0707b0e4d8529fc5f7567d1ff029b4b6fdf0bb46f1eb227d70c3aaa2018d65e5  guix-build-6cbedc3d9b67/output/x86_64-linux-gnu/bitcoin-6cbedc3d9b67-x86_64-linux-gnu-debug.tar.gz
  5f1e3713cf856f884d305ad12f43254be3871d9020cc514194fc0a6efd0867b1  guix-build-6cbedc3d9b67/output/x86_64-linux-gnu/bitcoin-6cbedc3d9b67-x86_64-linux-gnu.tar.gz
  c0d5e284903dbb55e4ad3d43db9b1e5d211c5259c3fae43bf4cddedea2e02c01  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/SHA256SUMS.part
  d16f61c78b784b664d558a9a537e15da432ef9c18de0754dd7fd19682ab0569f  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64-debug.zip
  617010c1ac295bc692e0a4074acc19ebbc9561a01c8e5365428cfe61dc50fe3c  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64-setup-unsigned.exe
  a48961c49edf9f8988b902d874f47918f6716053be6c3bc263932834cb896510  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64-unsigned.tar.gz
  0cd95e8f919ac694dfd88a14fda37c57f0534cb890acc73f70aff71937fa1a8e  guix-build-6cbedc3d9b67/output/x86_64-w64-mingw32/bitcoin-6cbedc3d9b67-win64.zip
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 6cbedc3d9b

Tree-SHA512: 48950535febab3865a8899b0ce590a7da6dbd0a89d2d2987a467da457e9ff0687d5afc65f952386fa562aa2a3fc6d8c85b1c221c73998d522076486a9fd845c4
2023-08-26 08:49:34 +01:00
MarcoFalke
99995cfe8d
refactor: Use HashWriter over legacy CHashWriter (via SerializeHash) 2023-08-25 17:09:32 +02:00
MarcoFalke
5555aa2d0d
refactor: Use HashWriter over legacy CHashWriter 2023-08-25 17:09:13 +02:00
Hennadii Stepanov
6a43372980
ci: Run "Win64 native" job on GitHub Actions 2023-08-25 13:50:04 +01:00
Antoine Poinsot
10546a569c
wallet: accurately account for the size of the witness stack
When estimating the maximum size of an input, we were assuming the
number of elements on the witness stack could be encode in a single
byte. This is a valid approximation for all the descriptors we support
(including P2WSH Miniscript ones), but may not hold anymore once we
support Miniscript within Taproot descriptors (since the max standard
witness stack size of 100 gets lifted).

It's a low-hanging fruit to account for it correctly, so just do it now.
2023-08-25 12:40:12 +02:00
Antoine Poinsot
9b7ec393b8
wallet: use descriptor satisfaction size to estimate inputs size
Instead of using the dummysigner to compute a placeholder satisfaction,
infer a descriptor on the scriptPubKey of the coin being spent and use
the estimation of the satisfaction size given by the descriptor
directly.

Note this (almost, see next paragraph) exactly conserves the previous
behaviour. For instance CalculateMaximumSignedInputSize was previously
assuming the input to be spent in a transaction that spends at least one
Segwit coin, since it was always accounting for the serialization of the
number of witness elements.

In this commit we use a placeholder for the size of the serialization of
the witness stack size (1 byte). Since the logic in this commit is
already tricky enough to review, and that it is only a very tiny
approximation not observable through the existing tests, it is addressed
in the next commit.
2023-08-25 12:40:12 +02:00
Antoine Poinsot
8d870a9873
script/signingprovider: introduce a MultiSigningProvider
It is sometimes useful to interface with multiple signing providers at
once. For instance when inferring a descriptor with solving information
being provided from multiple sources (see next commit).

Instead of inneficiently copying the information from one provider into
the other, introduce a new signing provider that takes a list of
pointers to existing providers.
2023-08-25 12:40:11 +02:00
Antoine Poinsot
fa7c46b503
descriptor: introduce a method to get the satisfaction size
In the wallet code, we are currently estimating the size of a signed
input by doing a dry run of the signing logic. This is unnecessary as
all outputs we are able to sign for can be represented by a descriptor,
and we can derive the size of a satisfaction ("signature") from the
descriptor itself directly.
In addition, this approach does not scale: getting the size of a
satisfaction through a dry run of the signing logic is only possible for
the most basic scripts.

This commit introduces the computation of the size of satisfaction per
descriptor. It's a bit intricate for 2 main reasons:
- We want to conserve the behaviour of the current dry-run logic used by
  the wallet that sometimes assumes ECDSA signatures will be low-r,
  sometimes not (when we don't create them).
- We need to account for the witness discount. A single descriptor may
  sometimes benefit of it, sometimes not (for instance `pk()` if used as
  top-level versus if used inside `wsh()`).
2023-08-25 12:40:11 +02:00