Commit Graph

60 Commits

Author SHA1 Message Date
2bf721e76a Merge bitcoin/bitcoin#30661: fuzz: Test headers pre-sync through p2p
a97f43d63a fuzz: Add harness for p2p headers sync (marcofleon)
a0eaa4749f Add FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION in PoW check (marcofleon)
a3f6f5acd8 build: Automatically define FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION for fuzz builds (marcofleon)
0c02d4b2bd net_processing: Make MAX_HEADERS_RESULTS a PeerManager option (marcofleon)

Pull request description:

  This PR reopens https://github.com/bitcoin/bitcoin/pull/28043. It's a regression fuzz test for https://github.com/bitcoin/bitcoin/pull/26355 and [a couple bugs](ed6cddd98e) that were addressed in https://github.com/bitcoin/bitcoin/pull/25717. This should help us move forward with the [removal of mainnet checkpoints](https://github.com/bitcoin/bitcoin/pull/25725).

  It seems like the main concern in https://github.com/bitcoin/bitcoin/pull/28043 was the global mock function for proof of work. This PR aims to be an improvement by replacing the previous approach with a fuzz build configured using `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`. This ensures that the simplified test code will never be in a release binary. If we agree this is the way to go, there are some other places (for future targets) where this method could be used.

  In this target, PoW isn't being tested, so the goal is to bypass the check and let the fuzzer do its thing. In the other harnesses where PoW is actually being fuzzed, `CheckProofOfWork` is now `CheckProofOfWorkImpl`. So, the only change to that function is in the name.

  More about `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` can be found at https://llvm.org/docs/LibFuzzer.html#fuzzer-friendly-build-mode and https://github.com/AFLplusplus/AFLplusplus/blob/stable/docs/fuzzing_in_depth.md#d-modifying-the-target.

ACKs for top commit:
  naumenkogs:
    ACK a97f43d63a
  dergoegge:
    reACK a97f43d63a
  instagibbs:
    tested ACK a97f43d63a
  brunoerg:
    ACK a97f43d63a

Tree-SHA512: 60b0bc6aadd8ca4c39db9cbba2da2debaaf68afcb6a8dd75c1ce48ca9e3996948fda8020930b6771a424e0f7c41b0b1068db4aa7dbe517f8fc152f1f712058ad
2024-09-16 13:59:22 -04:00
001b1cf010 build: use standard branch-protection for aarch64-linux 2024-09-13 11:26:40 +01:00
db8350b0e3 Merge bitcoin/bitcoin#30803: build: Minor build system fixes and amendments
1cc93fe7b4 build: Delete dead code that implements `IF_CHECK_FAILED` option (Hennadii Stepanov)
341ad23809 build: Delete MSVC special case for `BUILD_FOR_FUZZING` option (Hennadii Stepanov)
fdad128b52 build: Stop enabling CMake's CMP0141 policy (Hennadii Stepanov)
b2a6f545b4 doc: Drop `ctest` command from Windows cross-compiling instructions (Hennadii Stepanov)
73b618582d build: Print `CMAKE_CXX_COMPILER_ARG1` in summary (Hennadii Stepanov)
f03c942095 build, test: Add missed log options (Hennadii Stepanov)
6f2cb0eafd doc: Amend comment about ZeroMQ config files (Hennadii Stepanov)

Pull request description:

  This PR addresses the following comments:
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1742342524
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1728692369
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1736110362
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1742931121
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1747723657
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1742328675
  - https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1723106474

ACKs for top commit:
  sipsorcery:
    tACK 1cc93fe7b4 (win11 msvc).
  maflcko:
    re-ACK 1cc93fe7b4

Tree-SHA512: a390797bb4d3b7eb9163653b6c9c324e7a01090f6cdda74df7349a24a5c4a2084e5912878747f56561315afc70cae9adb1c363f47ceb0af96004ea591d25171b
2024-09-12 10:30:06 +01:00
0037d53d1a build: Fix ENABLE_WALLET option
The removed commands were left over from the transition from
autodetection to explicit options. These commands prevented the
`-DENABLE_WALLET=OFF` option from being work properly when building with
depends.
2024-09-10 22:13:09 +01:00
94bc3c4cc0 Merge bitcoin/bitcoin#30824: cmake: decouple FORTIFY_SOURCE check from Debug build type
30803a35d5 cmake: decouple FORTIFY_SOURCE check from Debug build type (fanquake)

Pull request description:

  `FORTIFY_SOURCE` should be used if `ENABLE_HARDENING=ON` and optimisations are being used. This should not be coupled to any particular build type, because even if the build type is `Debug`, optimisations might still be in use.

  Fixes: #30800.
  Also somewhat of a followup to https://github.com/bitcoin/bitcoin/pull/30778#discussion_r1742257436.

ACKs for top commit:
  ryanofsky:
    Code review ACK 30803a35d5
  TheCharlatan:
    ACK 30803a35d5

Tree-SHA512: 298f8805a5bb2f1ff54e51ea31324d712c2070cc3eba26561c31001ace4bfa37ae6d18531cbd45e2faf610a0a1b83b420fcde6e329e17f02b021d26563583913
2024-09-09 12:33:57 +01:00
341ad23809 build: Delete MSVC special case for BUILD_FOR_FUZZING option 2024-09-08 11:03:32 +01:00
fdad128b52 build: Stop enabling CMake's CMP0141 policy
The `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable has not been used
since the merge of https://github.com/hebasto/bitcoin/pull/215 in the
CMake staging branch.
2024-09-06 22:07:31 +01:00
6f2cb0eafd doc: Amend comment about ZeroMQ config files 2024-09-06 21:59:46 +01:00
1f054eca4e cmake: add USE_SOURCE_PERMISSIONS to all configure_file usage
`USE_SOURCE_PERMISSIONS` is the default, so this should not change
behaviour. However, being explicit makes it clear what we are doing.

Related to #30815.

See
https://cmake.org/cmake/help/latest/command/configure_file.html#options.
2024-09-06 10:52:19 +01:00
30803a35d5 cmake: decouple FORTIFY_SOURCE check from Debug build type
`FORTIFY_SOURCE` should be used if `ENABLE_HARDENING=ON` and optimisations
are being used. This should not be coupled to any particular build type,
because even if the build type is `Debug`, optimisations might still
be in use.

Fixes: #30800.
2024-09-05 16:34:17 +01:00
a3f6f5acd8 build: Automatically define FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION for fuzz builds 2024-09-02 15:43:33 +01:00
66dd1b4e58 build: Drop no longer needed workaround 2024-08-29 14:13:48 +01:00
fa053ab7c0 build: Add Centos Stream 9 EOL URL
To match the format of the previous section about the Ubuntu 22.04 EOL.
2024-08-28 15:05:52 +02:00
680f05ee98 build: fix version number post CMake
CMake was merged after branching-off for 28.x.
2024-08-28 11:08:37 +01:00
8b6f1c4353 cmake: Add Coverage and CoverageFuzz scripts 2024-08-16 21:19:12 +01:00
65bdbc1ff2 cmake: Add docs build target 2024-08-16 21:19:12 +01:00
fb75ebbc33 cmake: Add compiler diagnostic flags 2024-08-16 21:19:12 +01:00
747adb6ffe cmake: Add Maintenance module 2024-08-16 21:19:11 +01:00
1f60b30df0 cmake: Add APPEND_{CPP,C,CXX,LD}FLAGS cache variables
The content of those variables is appended to the each target after the
flags added by the build system.
2024-08-16 21:19:11 +01:00
973a3b0c5d cmake: Implement install build target 2024-08-16 21:19:11 +01:00
84ac35cfd4 cmake: Add cross-compiling support
To configure CMake for cross-compiling, use
`--toolchain depends/${HOST}/toolchain.cmake` command-line option.
2024-08-16 21:19:11 +01:00
90cec4d251 cmake: Add MULTIPROCESS option 2024-08-16 21:19:10 +01:00
bb1a450dcb cmake: Build bitcoin-chainstate executable 2024-08-16 21:19:09 +01:00
aed38ea58c cmake: Build bitcoinkernel library
Co-authored-by: TheCharlatan <seb.kung@gmail.com>
2024-08-16 21:19:09 +01:00
975d67369b cmake: Build test_bitcoin-qt executable 2024-08-16 19:28:59 +01:00
10fcc668a3 cmake: Add WITH_DBUS option 2024-08-16 19:27:42 +01:00
5bb5a4bc75 cmake: Add libqrencode optional package support 2024-08-16 19:27:42 +01:00
57a6e2ef4a cmake: Build bitcoin-qt executable 2024-08-16 19:27:42 +01:00
30f642952c cmake: Add WERROR option 2024-08-16 19:27:42 +01:00
c98d4a4c34 cmake: Add REDUCE_EXPORTS option 2024-08-16 19:27:42 +01:00
a01cb6e63f cmake: Add HARDENING option 2024-08-16 19:27:42 +01:00
a8a2e364ac cmake: Add Python-based tests 2024-08-16 19:27:41 +01:00
3d85379570 cmake: Add fuzzing options 2024-08-16 19:27:41 +01:00
908530e312 cmake: Add SANITIZERS option 2024-08-16 19:27:41 +01:00
8bb0e85631 cmake: Build bench_bitcoin executable 2024-08-16 19:27:41 +01:00
801735163a cmake: Add external signer support 2024-08-16 19:27:41 +01:00
353e0c9e96 cmake: Add systemtap-sdt optional package support 2024-08-16 19:27:41 +01:00
d2fda82b49 cmake: Add libzmq optional package support 2024-08-16 19:27:40 +01:00
ae7b39a0e1 cmake: Add libminiupnpc optional package support 2024-08-16 19:27:40 +01:00
6480e1dcdb cmake: Add libnatpmp optional package support 2024-08-16 19:27:40 +01:00
e73e9304a1 cmake: Build bitcoin-util executable 2024-08-16 19:27:40 +01:00
027c6d7caa cmake: Build bitcoin-tx executable 2024-08-16 19:27:40 +01:00
d10c5c34c3 cmake: Add wallet functionality 2024-08-16 19:27:40 +01:00
ab2e99b0d9 cmake: Create test suite for ctest 2024-08-16 19:27:39 +01:00
959370bd76 cmake: Build test_bitcoin executable 2024-08-16 19:27:39 +01:00
b27bf9700d cmake: Build bitcoin-cli executable 2024-08-16 19:27:39 +01:00
a9813df826 cmake: Build bitcoind executable 2024-08-16 19:27:39 +01:00
1f0a78edf3 cmake: Build minisketch static library 2024-08-16 19:27:38 +01:00
12bfbc8154 cmake: Build leveldb static library
Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>
2024-08-16 19:27:38 +01:00
51985c5304 cmake: Build crc32c static library 2024-08-16 19:27:37 +01:00