Commit Graph

410 Commits

Author SHA1 Message Date
fanquake
4caa10b580
Merge bitcoin/bitcoin#28628: lint: Include test_utxo_snapshots in lint_shell, fix linter errors
348e79f7c6 lint: Include test_utxo_snapshots in lint_shell (Fabian Jahr)

Pull request description:

  jamesob excluded `test_utxo_snapshots.sh` from the shell linter with this explanation: "Add the script to the shellcheck exception list since the quoted variables rule needs to be violated in order to get bitcoind to pick up on $EARLY_IBD_FLAGS." However, macrofake pointed out that single lines can be excluded from linting.

  This fixes one fixable rule violation, excludes the rest of the offending lines from the linter and then removes the exclusion of the `test_utxo_snapshots.sh` file. Also adds documentation.

ACKs for top commit:
  Empact:
    ACK 348e79f7c6
  maflcko:
    lgtm ACK 348e79f7c6
  pablomartin4btc:
    tACK 348e79f7c6

Tree-SHA512: a904cc1cc3c94488dfbd39ea69a3ef17259f991708a797009001669448fef81eed086ecbce1ec433988d88baef293849698e2e0eb86a969b949cc7ef93af7b4b
2023-10-17 09:48:50 +01:00
Andrew Chow
76d89579b5
Merge bitcoin/bitcoin#28630: depends: update LD64_VERSION to 711
092daa2f95 contrib: add test for macOS linker version to symbol-check (fanquake)
cefbf0bc20 depends: update LD64_VERSION to 711 (fanquake)

Pull request description:

  I forgot to do this in 7d5815293e.
  Add a test so it's impossible to forget.

ACKs for top commit:
  TheCharlatan:
    utACK 092daa2f95
  achow101:
    ACK 092daa2f95
  jarolrod:
    ACK 092daa2f95
  hebasto:
    ACK 092daa2f95.
  laanwj:
    ACK 092daa2f95

Tree-SHA512: 37f0bdfd6607a7760eabe5efe279532ba0c59c0915161e08d5e3b9a0b7705839d62537d6e17406062f6a0a1db5407575da7cd671e9cb916e422e77f5649c6e2b
2023-10-16 13:29:26 -04:00
Fabian Jahr
348e79f7c6
lint: Include test_utxo_snapshots in lint_shell 2023-10-13 14:06:06 +02:00
fanquake
73dfa6da08
Merge bitcoin/bitcoin#28631: devtools: test_utxo_snapshots.sh sleep cleanup and documentation
36a3004a41 devtools: test_utxo_snapshots.sh sleep cleanup and documentation (Fabian Jahr)

Pull request description:

  There were bare sleep statements in the script where it was unclear why they were needed and I think they could also be replaced by existing helpers.

ACKs for top commit:
  Sjors:
    utACK 36a3004a41
  pablomartin4btc:
    utACK 36a3004a41

Tree-SHA512: b6e2fc69cd7babcfa7f413f11304f4d648d6d64b3b526862664ccedb0016ad182b9e886aa4e8c33315e4c18824512e11a4fd6365f9c3c95093967d3ef7687e62
2023-10-13 11:16:33 +02:00
Fabian Jahr
36a3004a41
devtools: test_utxo_snapshots.sh sleep cleanup and documentation 2023-10-10 12:57:54 +02:00
fanquake
092daa2f95
contrib: add test for macOS linker version to symbol-check 2023-10-10 11:22:14 +01:00
vuittont60
57131bfa3c docs: fix typo 2023-10-10 15:06:47 +08:00
fanquake
b2ede22395
headerssync: update params for 26.x 2023-10-05 11:36:03 +01:00
fanquake
2eacc61ad7
Merge bitcoin/bitcoin#25970: Add headerssync tuning parameters optimization script to repo
3d420d8f28 Add instructions for headerssync-params.py to release-process.md (Pieter Wuille)
53d7d35b58 Update parameters in headerssync.cpp (Pieter Wuille)
7899402cff Add headerssync-params.py script to the repository (Pieter Wuille)

Pull request description:

  Builds upon #25946, as it incorporates changes based on the selected values there.

  This adds the headerssync tuning parameters optimization script from https://gist.github.com/sipa/016ae445c132cdf65a2791534dfb7ae1 to the repository, updates the parameters based on its output, and adds release process instructions for doing this update in the future.

  A few considerations:
  * It would be a bit cleaner to have these parameters be part of `CChainParams`, but due to the nature of the approach, it really only applies to chains with unforgeable proof-of-work, which we really can only reasonably expect from mainnet, so I think it's fine to keep them local to `headerssync.cpp`. Keeping them as compile-time evaluatable constants also has a (likely negligible) performance impact (avoiding runtime modulo operations).
  * If we want to make sure the chainparams and headerssync params don't go out of date, it could be possible to run the script in CI, and and possibly even have the parameters be generated automatically at build time. I think that's overkill for how unfrequently these need to change, and running the script has non-trivial cost (~minutes in the normal python interpreter).
  * A viable alternative is just leaving this out-of-repo entirely, and just do ad-hoc updating from time to time. Having it in the repo and release notes does make sure it's not forgotten, though adds a cost to contributors/maintainers who follow the process.

ACKs for top commit:
  ajtowns:
    reACK 3d420d8f28

Tree-SHA512: 03188301c20423c72c1cbd008ccce89b93e2898edcbeecc561b2928a0d64e9a829ab0744dc3b017c23de8b02f3c107ae31e694302d3931f4dc3540e184de1963
2023-10-05 11:28:29 +01:00
James O'Beirne
7ee46a755f contrib: add script to demo/test assumeutxo
Add the script to the shellcheck exception list since the
quoted variables rule needs to be violated in order to get
bitcoind to pick up on $CHAIN_HACK_FLAGS.
2023-09-30 06:41:23 -04:00
Pieter Wuille
7899402cff Add headerssync-params.py script to the repository 2023-09-28 12:05:52 -04:00
fanquake
7bf078f2b7
Merge bitcoin/bitcoin#28237: refactor: Enforce C-str fmt strings in WalletLogPrintf()
fa60fa3b0c bitcoin-tidy: Apply bitcoin-unterminated-logprintf to spkm as well (MarcoFalke)
faa11434fe refactor: Enable all clang-tidy plugin bitcoin tests (MarcoFalke)
fa6dc57760 refactor: Enforce C-str fmt strings in WalletLogPrintf() (MarcoFalke)
fa244f3321 doc: Fix bitcoin-unterminated-logprintf tidy comments (MarcoFalke)

Pull request description:

  All fmt functions only accept a raw C-string as argument.

  There should never be a need to pass a format string that is not a compile-time string literal, so disallow it in `WalletLogPrintf()` to avoid accidentally introducing it.

  Apart from consistency, this also fixes the clang-tidy plugin bug https://github.com/bitcoin/bitcoin/pull/26296#discussion_r1286821141.

ACKs for top commit:
  theuni:
    ACK fa60fa3b0c

Tree-SHA512: fa6f4984c50f9b34e850bdfee7236706af586e512d866cc869cf0cdfaf9aa707029c210ca72d91f85e75fcbd8efe0d77084701de8c3d2004abfd7e46b6fa9072
2023-08-18 11:38:38 +01:00
MarcoFalke
fa60fa3b0c
bitcoin-tidy: Apply bitcoin-unterminated-logprintf to spkm as well 2023-08-16 14:56:37 +02:00
fanquake
6c508ac3ff
Merge bitcoin/bitcoin#28258: bitcoin-tidy: fix macOS build
bb3263d3e3 bitcoin-tidy: fix macOS build (Cory Fields)

Pull request description:

  [LLVM uses these options](https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/HandleLLVMOptions.cmake#L178) for building as well, so there's precedent.

  Also fix the shared library extension which was incorrectly being set to dylib.

  Thanks to jonatack for reporting and debugging.

ACKs for top commit:
  jonatack:
    ACK bb3263d3e3 tested with arm64 macos 13.5, llvm 16.0.6 and cmake 3.27.2

Tree-SHA512: de7bfd497f38f1565a14d217d0b057cbfa788bdda702b5942b7f0b55947ae5e1c05af13e7d6a073ed036bc4db57035868f180034508b6e084ab9b901a5baaf2f
2023-08-14 13:10:13 +01:00
Cory Fields
bb3263d3e3 bitcoin-tidy: fix macOS build
LLVM uses these options for building as well, so there's precedent.

Also fix the shared library extension which was incorrectly being set to dylib
2023-08-10 21:14:50 +00:00
fanquake
d82bb90a5b
doc: use llvm-config for bitcoin-tidy example
An LLVM installation will have `llvm-config` available to query for
info. Ask it for the `--cmakedir`, and use that in our bitcoin-tidy
example, rather than listing multiple different (potential) paths per
distro/OS etc.
2023-08-10 12:39:35 +02:00
MarcoFalke
fa6dc57760
refactor: Enforce C-str fmt strings in WalletLogPrintf() 2023-08-08 10:55:11 +02:00
MarcoFalke
fa244f3321
doc: Fix bitcoin-unterminated-logprintf tidy comments
* Move module description from test to LogPrintfCheck
* Add test doc
* Remove unused comment, see https://github.com/bitcoin/bitcoin/pull/26296/files#r1279351539
2023-08-08 09:11:05 +02:00
fanquake
1c976c691c
tidy: Integrate bicoin-tidy clang-tidy plugin
Enable `bitcoin-unterminated-logprintf`.

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2023-08-03 17:52:24 +01:00
fanquake
8c38509233
contrib: move user32.dll from bitcoind.exe libs
The user interface library is no-longer needed by `bitcoind.exe`,
or utils, only `bitcoin-qt.exe`.
Add missing lib doc.
2023-07-18 16:39:22 +01:00
fanquake
e14473299c
contrib: remove librt from release deps 2023-07-12 09:09:14 +01:00
fanquake
a8bd0fef25
Merge bitcoin/bitcoin#27999: contrib: add macOS test for fixup_chains usage
7f96638723 contrib: add macOS fixup_chains check to security-check (fanquake)
3dca683cb7 build: support -no_fixup_chains in ld64 (fanquake)

Pull request description:

  Followup to #27676, adding the check for chained fixups.

  Somewhat annoyingly, we have to patch support for `-no_fixup_chains` into ld64. As it doesn't seem to have been added [until a later version](59a99ab603/src/ld/Options.cpp (L4172)).

  Guix Build:
  ```bash
  0e17d462808f86aa7157e27a957da88fd1adeb491ad6c01138aca93e5ad1d018  guix-build-7f96638723a0/output/arm64-apple-darwin/SHA256SUMS.part
  ceb208e6374f5d7367b73128e90ca6eaeea15d50c69e49c8cf75b47212525ad7  guix-build-7f96638723a0/output/arm64-apple-darwin/bitcoin-7f96638723a0-arm64-apple-darwin-unsigned.dmg
  e31663554cfde8a37a9f3438c9c895dde94b90ff87e28f12f78be71ef6421d93  guix-build-7f96638723a0/output/arm64-apple-darwin/bitcoin-7f96638723a0-arm64-apple-darwin-unsigned.tar.gz
  68a7bbc42418641eab391a85725b5c2f3c46d38a7acc07e7a8cef98909be07ec  guix-build-7f96638723a0/output/arm64-apple-darwin/bitcoin-7f96638723a0-arm64-apple-darwin.tar.gz
  38d966ad93e7384f4f1ce16faded003a675ecce7be1987e6c4eee8e4b82c0432  guix-build-7f96638723a0/output/dist-archive/bitcoin-7f96638723a0.tar.gz
  9d314f595d897a715a321a9fba0d552220fbd4bf69aff84eb8c0001cdb48234f  guix-build-7f96638723a0/output/x86_64-apple-darwin/SHA256SUMS.part
  c218ebfd0e96348c4912e6d522492b621bb043ef45b75105ff1fde979d1004d0  guix-build-7f96638723a0/output/x86_64-apple-darwin/bitcoin-7f96638723a0-x86_64-apple-darwin-unsigned.dmg
  1c5ff7fa82f5c76d7d8b9582ad5202f4a82a917102ecafdc3c1fb7b783f6bc3e  guix-build-7f96638723a0/output/x86_64-apple-darwin/bitcoin-7f96638723a0-x86_64-apple-darwin-unsigned.tar.gz
  15fb01e5afcc842db6a3e793b42c70c05ce07bec79e0d2d605e241901ff9f639  guix-build-7f96638723a0/output/x86_64-apple-darwin/bitcoin-7f96638723a0-x86_64-apple-darwin.tar.gz
  ```

ACKs for top commit:
  theuni:
    utACK 7f96638723.
  hebasto:
    ACK 7f96638723, I have reviewed the code and the patch, and they look OK.
  TheCharlatan:
    ACK 7f96638723

Tree-SHA512: 7f94710460f54b2afe3c9f5d57107b71436c59b799b15f78e5e3011c3c4f6b23a3acc1008eccea9c22226a200774c82900bad6c6236ab6c5c48a17dec3f2d5a2
2023-06-30 16:35:09 +01:00
Jon Atack
f86a301433 script, test: add missing python type annotations
Fix warnings for these files when ./test/lint/lint-python.py is run using
mypy 0.991 (released 11/2022) and later:

"By default the bodies of untyped functions are not checked, consider using
--check-untyped-defs [annotation-unchecked]"

For details, see:

https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
2023-06-29 16:13:51 -06:00
fanquake
7f96638723
contrib: add macOS fixup_chains check to security-check
Followup to #27676.
2023-06-29 12:08:08 +01:00
fanquake
ec822e88dd
Merge bitcoin/bitcoin#27813: guix: Update python-lief package to 0.13.2
529c92e837 guix: Update `python-lief` package to 0.13.2 (Hennadii Stepanov)

Pull request description:

  The Guix's `python-lief` package is going to move to using external deps, rather than the bundled ones (https://lists.gnu.org/archive/html/guix-patches/2023-05/msg01302.html). We want to continue using our own package indefinitely, to keep the build simpler, and allow for easier updating.

  Changes in `contrib/devtools/security-check.py` are caused by 6357c6370b.

  Also see: https://github.com/bitcoin/bitcoin/pull/27507.

ACKs for top commit:
  fanquake:
    ACK 529c92e837

Tree-SHA512: ad81111b090a39b380fe25bb27b54a339e78a158f462c7adda25d5ee55f0d654107b1486b29b9687ad0808e27b01e04f53a0e8ffc6600b79103d6bd0dfec64ef
2023-06-28 11:41:35 +01:00
Hennadii Stepanov
529c92e837
guix: Update python-lief package to 0.13.2 2023-06-23 17:02:49 +01:00
fanquake
3df6070466 contrib: remove macOS lazy_bind check
In future, this will be replaced by a check for fixup_chains usage.
2023-06-22 15:28:47 +00:00
Cory Fields
fb61bc0c02 depends: Bump MacOS minimum runtime requirement to 11.0
This is necessary as the new fixup_chains linker behavior is only valid
when the runtime target is >=11.0.
2023-06-22 15:28:47 +00:00
fanquake
015cc5e588
lint: stop ignoring LIEF imports
Type stubs are now available as of 0.13.0.
See https://github.com/lief-project/LIEF/issues/650.
2023-05-29 10:23:52 +01:00
fanquake
65ba8a79a2
contrib: add ELF ABI check to symbol-check.py 2023-05-02 16:54:36 +01:00
fanquake
0c579203d2
Merge bitcoin/bitcoin#25867: lint: enable E722 do not use bare except
61bb4e783b lint: enable E722 do not use bare except (Leonardo Lazzaro)

Pull request description:

  Improve test code and enable E722 lint check.

   If you want to catch all exceptions that signal program errors, use except Exception: (bare except is equivalent to except BaseException:).

  Reference: https://peps.python.org/pep-0008/#programming-recommendations

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 61bb4e783b

Tree-SHA512: c7497769d5745fa02c78a20f4a0e555d8d3996d64af6faf1ce28e22ac1d8be415b98e967294679007b7bda2a9fd04031a9d140b24201e00257ceadeb5c5d7665
2023-02-22 09:28:09 +00:00
Leonardo Lazzaro
61bb4e783b lint: enable E722 do not use bare except 2023-02-18 11:24:09 +00:00
fanquake
74c9893989
guix: use glibc 2.27 for all Linux builds
Also point to the latest commit on the glibc 2.27 releases branch.

https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.27/master
2023-02-13 14:16:24 +00:00
MarcoFalke
fa8fe5b696
scripted-diff: Use new python 3.7 keywords
-BEGIN VERIFY SCRIPT-
 sed -i 's/universal_newlines/text/g' $(git grep -l universal_newlines)
-END VERIFY SCRIPT-
2023-01-18 13:00:34 +01:00
fanquake
6ba17d4955
scripts: add PE Canary check to security-check 2023-01-06 10:49:18 +00:00
Hennadii Stepanov
306ccd4927
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
- 2021: f47dda2c58
- 2020: fa0074e2d8
- 2019: aaaaad6ac9
2022-12-24 23:49:50 +00:00
Hennadii Stepanov
77779c3717
script: Improve test-{security,symbol}-check.py robustness
This change allows to use the `test-{security,symbol}-check.py` scripts
when building out of source tree with no need to link scripts into the
build directory.
2022-11-03 11:26:00 +00:00
MacroFake
d76a423809
Merge bitcoin/bitcoin#26067: util: improve bitcoin-wallet exit codes
fa2b8ae0a2 util: improve bitcoin-wallet exit codes (MacroFake)

Pull request description:

  Refactors `bitcoin-wallet` so that it doesn't return a non-zero exit code by default, and makes the option handling more inline with the other binaries. i.e outputting `Error: too few parameters` if you don't pass any options.

  Fixing this means we can check the process output in `gen-manpages.py`; which addresses the remaining [review comment](https://github.com/bitcoin/bitcoin/pull/24263#discussion_r806126705) from #24263.

Top commit has no ACKs.

Tree-SHA512: 80bd8098faefb4401ca1e4d49937ef6c960cf60ce0e7fb9dc38904fbc2fd92e319ec04570381da84943b7477845bf6be00e977f4c0451b247a6698662ce8f1bf
2022-09-20 09:54:04 +02:00
fanquake
656f9b0ba2
contrib: remove outdated comment from symbol-check script 2022-09-16 14:56:01 +01:00
fanquake
c36afe39dd
contrib: remove 32bit linux code from release scripts 2022-09-16 14:56:01 +01:00
MacroFake
fa2b8ae0a2
util: improve bitcoin-wallet exit codes 2022-09-12 13:11:18 +02:00
Carl Dong
cb3e9a1e3f Move {Load,Dump}Mempool to kernel namespace
Also:
1. Add the newly introduced kernel/mempool_persist.cpp to IWYU CI script
2. Add chrono mapping for iwyu
2022-07-15 12:26:20 -04:00
Marnix
20c58a3e50 doc: typo fix 2022-06-18 18:34:50 +02:00
fanquake
84e56b45b4
scripts: remove no-longer-needed ignored exports 2022-06-16 16:12:45 +01:00
fanquake
d873ff96e5
refactor: cleanups post unsubtree'ing univalue
Mostly changes to remove src/univalue exceptions from the various linters,
and the required code changes to make them happy. As well as minor doc
changes.
2022-06-15 12:56:44 +01:00
laanwj
d4475ea7ae
Merge bitcoin/bitcoin#22235: script: add script to generate example bitcoin.conf
b42643c253 doc: update init.cpp -conf help text (josibake)
970b9987ad doc: update devtools, release-process readmes (josibake)
50635d27b4 build: include bitcoin.conf in build outputs (josibake)
6aac946f49 doc: update bitcoin-conf.md (Josiah Baker)
1c7e820ded script: add script to generate example bitcoin.conf (josibake)
b483084d86 doc: replace bitcoin.conf with placeholder file (josibake)

Pull request description:

  create a script for parsing the output from `bitcoind --help` to create an example conf file for new users

  ## problem

  per #10746 , `bitcoin.conf` not being put into the data directory during installation causes some confusion for users when running bitcoin. in the discussion on the issue, one proposed solution was to have an example config file and instruct users to `cp` it into their data directory after startup. in addition to #10746 , there have been other requests for a "skeleton config file" (https://github.com/bitcoin/bitcoin/issues/19641) to help users get started with configuring bitcoind.

  the main issue with an example config file is that it creates a second source of truth regarding what options are available for configuring bitcoind. this means any changes to the options (including the addition or removal of options) would have to be updated for the command line and also updated in the example file.

  this PR addresses this issue by providing a script to generate an example file directly from the `bitcoind --help` on-demand by running `contrib/devtools/gen-bitcoin-conf.sh`. this solution was originally proposed on #10746 and would also solve #19641 . this guarantees any changes made to the command-line options or the command-line options help would also be reflected in the example file after compiling and running the script.

  the main purpose of this script is to generate a config file to be included with releases, same as `gen-manpages.sh`. this ensures every release also includes an up-to-date, full example config file for users to edit. the script is also available for users who compile from source for generating an example config for their compiled binary.

  ## special considerations

  this removes the `bitcoin.conf` example file from the repo as it is now generated by this script. the original example file did contain extra text related to how to use certain options but going forward all option help docs should be moved into `init.cpp`

  this also edits `init.cpp` to have the option help indicate that `-conf` is not usable from the config file. this is similar to how `-includeconf` 's help indicates it cannot be used from the command line

ACKs for top commit:
  laanwj:
    Tested and code review ACK b42643c253

Tree-SHA512: 4546e0cef92aa1398da553294ce4712d02e616dd72dcbe0b921af474e54f24750464ec813661f1283802472d1e8774e634dd1cc26fbf1f13286d3e0406c02c09
2022-05-04 21:12:56 +02:00
josibake
970b9987ad
doc: update devtools, release-process readmes
include running `gen-bitcoin-conf.sh` as part of the release process.
2022-05-04 20:45:49 +02:00
laanwj
0047d9b89b
Merge bitcoin/bitcoin#24993: test, contrib, refactor: use with when opening a file
027aab663a test, contrib, refactor: use `with` when opening a file (brunoerg)

Pull request description:

  When manipulating a file in Python without using `with()`, you have to close the file manually, so this PR does it in `get_block_hashes` (`contrib/linearize/linearize-data.py`).

  Edit: this PR does it for all occurances that previously weren't using `with`.

ACKs for top commit:
  laanwj:
    Code review ACK 027aab663a

Tree-SHA512: 879400968e0013e8678ec16f1fe5d0963a73c1e0d442ca34802d885214f0783d2e9a9b500fc6be7c3b93560a367b6a3d685eee24d2f9ce53fddf064ea6feecf8
2022-05-04 19:52:16 +02:00
josibake
1c7e820ded
script: add script to generate example bitcoin.conf
this ensures bitcoind option help is the source of truth and also
gives an example conf file for users to customize and copy to their
data directory.

closes #10746
2022-05-02 15:44:39 +02:00
brunoerg
027aab663a test, contrib, refactor: use with when opening a file 2022-04-27 20:04:33 -03:00