Bitcoin Core integration/staging tree
Go to file
merge-script 2cd7c6bd93
Merge bitcoin/bitcoin#30147: contrib: Fixup verify-binaries OS platform parsing
3ab2520190 contrib: Fixup verify-binaries OS platform parsing (Ben Westgate)

Pull request description:

  Closes #30145.

  This PR solves two major issues in the `parse_version_string` function of verify-binaries:
  1. `-aarch64` binaries cannot be specifically downloaded. The -platform string gets interpreted as a release candidate that doesn't exist due to containing sub-string "rc".
  2. Specifying a platform with a "-" in the name causes the parser to ignore both "-platform" AND "-rcN" and download the potentially wrong (non-rc) version for every platform. This also prevented specifying just one platform binary the user wished to download.

  It also updates the accompanying `test.py` to cover problem two and adds two examples that were formerly broken to `README.md` to show what is now possible. Including the most useful case of downloading only 1 specific platform's binary.

  This improves the Bitcoin verify-binaries tools user experience by not:
  1. Failing to download for inexplicable reasons,
  2. Downloading more files than what the user told it to, or in the worst case
  3. Downloading only the wrong files.

  * A test was added to cover the command `verify-binaries/verify.py pub 22.0-x86_64-linux-gnu.tar.gz` which checks that _bitcoin-22.0-x86_64-linux-gnu.tar.gz_ downloads successfully AND ONLY _bitcoin-22.0-x86_64-linux-gnu.tar.gz_ downloads.
  * The steps to reproduce each bug are in the referenced issue #30145. Explanation of the potential issue as well as reasoning for the way the bug was fixed are in my commit descriptions.
  * This delivers the promised feature of "only download the binaries for a certain platform", by allowing strings with '-' to be accepted, allowing for single file downloads for any specific platform which was not always possible before.
  * Removes 6 lines of code from the offending `parse_version_string` function, while fixing the bugs/errors, and extending the functionality to be practical for users with slow connections.
  * Makes the error message more helpful when no file matches the provided platform string, now prints "Did you mean: `closest-match`" to help correct typos.

  Thanks for reading my PR. I look forward to getting this helpful tool in its best shape yet.

  Log of this branch passing the new test.py:
  ```
  python3 test.py
  ✓ 'Nonexistent version should fail' passed
  ✓ 'Malformed version should fail' passed
  ✓ '--min-good-sigs 20 should fail' passed
  - testing verification (22.0-x86_64-linux-gnu.tar.gz)
  ✓ '22.0-x86_64-linux-gnu.tar.gz should succeed' passed
  - testing verification (22.0)
  ✓ '22.0 should succeed' passed
  ```

  Log of master failing the new test.py:
  ```
  python3 test.py
  ✓ 'Nonexistent version should fail' passed
  ✓ 'Malformed version should fail' passed
  ✓ '--min-good-sigs 20 should fail' passed
  - testing verification (22.0-x86_64-linux-gnu.tar.gz)
  ✓ '22.0-x86_64-linux-gnu.tar.gz should succeed' passed
  Traceback (most recent call last):
    File "/home/ben/Documents/GitHub/bitcoin/contrib/verify-binaries/test.py", line 74, in <module>
      main()
    File "/home/ben/Documents/GitHub/bitcoin/contrib/verify-binaries/test.py", line 27, in main
      assert len(v) == 1
             ^^^^^^^^^^^
  AssertionError
  ```

ACKs for top commit:
  stickies-v:
    re-ACK 3ab2520190
  willcl-ark:
    re-ACK 3ab2520190

Tree-SHA512: 6093228bb876cd0ac84d1cd2630074e17a3f09c4b23325b9419d859a5721a802f928844575233b135df52b882287dd18d6fadf4419d88ec0a2cdf82db315329e
2024-06-26 10:28:44 +01:00
.github ci: add option for running tests without volume 2024-06-20 17:42:28 +01:00
.tx qt: Bump Transifex slug for 27.x 2024-02-07 09:24:32 +00:00
build_msvc Merge bitcoin/bitcoin#29494: build: Assume HAVE_CONFIG_H, Add IWYU pragma keep to bitcoin-config.h includes 2024-05-07 14:14:03 -04:00
build-aux/m4 build: no-longer allow GCC-10 in C++20 check 2024-06-05 10:47:52 +01:00
ci ci: increase available ccache size to 300MB 2024-06-21 16:33:01 +01:00
contrib Merge bitcoin/bitcoin#30147: contrib: Fixup verify-binaries OS platform parsing 2024-06-26 10:28:44 +01:00
depends depends: swap mmacosx-version-min for mmacos-version-min 2024-06-14 09:43:36 +01:00
doc Introduce Mining interface 2024-06-18 18:47:51 +02:00
share contrib: rpcauth.py - Add new option (-j/--json) to output text in json format 2024-04-25 08:32:28 -05:00
src Merge bitcoin/bitcoin#30200: Introduce Mining interface 2024-06-24 19:29:48 -04:00
test Merge bitcoin/bitcoin#30200: Introduce Mining interface 2024-06-24 19:29:48 -04:00
.cirrus.yml ci: clarify Cirrus self-hosted workers setup 2024-06-21 08:58:59 +02:00
.editorconfig ci: Drop AppVeyor CI integration 2021-09-07 06:12:53 +03:00
.gitattributes
.gitignore Merge bitcoin/bitcoin#29733: build, macos: Drop unused osx_volname target 2024-04-02 14:57:22 +01:00
.python-version Bump .python-version from 3.9.17 to 3.9.18 2023-10-24 18:51:24 +02:00
.style.yapf Update .style.yapf 2023-06-01 23:35:10 +05:30
autogen.sh build: make sure we can overwrite config.{guess,sub} 2023-06-13 14:58:43 +02:00
configure.ac build: add -Wundef 2024-06-21 09:43:48 +01:00
CONTRIBUTING.md doc: Correct pull request prefix for scripts and tools 2024-05-22 09:59:58 +02:00
COPYING doc: upgrade Bitcoin Core license to 2024 2024-01-10 16:29:01 -06:00
INSTALL.md doc: Added hyperlink for doc/build 2021-09-09 19:53:12 +05:30
Makefile.am Merge bitcoin/bitcoin#29739: build: swap cctools otool for llvm-objdump 2024-05-11 18:34:42 +08:00
README.md doc: Explain Bitcoin Core in README.md 2022-05-10 07:49:09 +02:00
SECURITY.md Update security.md contact for achow101 2023-12-14 18:14:54 -05:00

Bitcoin Core integration/staging tree

https://bitcoincore.org

For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.

What is Bitcoin Core?

Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.

Further information about Bitcoin Core is available in the doc folder.

License

Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. Tags are created regularly from release branches to indicate new official, stable release versions of Bitcoin Core.

The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.