Skip to content

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented May 17, 2024

The first commit resolves this comment

# TODO: Not all targets, which will be added in the future,
# require libevent. Therefore, a proper check will be
# appropriate here.


The rest of the PR switches from the AddLibeventIfNeeded module to a more "standard" FindLibevent one.

Here are the relevant excerpts from configuration logs:

  1. On Linux, no depends:
  • staging branch:
-- Checking for module 'libevent>=2.1.8'
--   Found libevent, version 2.1.12-stable
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
-- Checking for module 'libevent_pthreads>=2.1.8'
--   Found libevent_pthreads, version 2.1.12-stable
  • this PR:
-- Found Libevent: /usr/lib/x86_64-linux-gnu (found suitable version "2.1.12-stable", minimum required is "2.1.8") 
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
  1. On Linux, with depends:
  • staging branch:
-- Checking for module 'libevent>=2.1.8'
--   Found libevent, version 2.1.12-stable
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
-- Checking for module 'libevent_pthreads>=2.1.8'
--   Found libevent_pthreads, version 2.1.12-stable
  • this PR:
-- Found Libevent: /home/hebasto/git/bitcoin/depends/x86_64-pc-linux-gnu/lib (found suitable version "2.1.12-stable", minimum required is "2.1.8") 
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
  1. On Windows, MSVC + vcpkg:
  • staging branch:
-- Found libevent include directory: C:/Users/hebasto/source/repos/bitcoin/build/vcpkg_installed/x64-windows/include
-- Found libevent component: C:/Users/hebasto/source/repos/bitcoin/build/vcpkg_installed/x64-windows/debug/bin/event_extra.dll
-- Found libevent 2.1.12 in C:/Users/hebasto/source/repos/bitcoin/build/vcpkg_installed/x64-windows
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
  • this PR:
-- Found Libevent: C:/Users/hebasto/source/repos/bitcoin/build/vcpkg_installed/x64-windows/share/libevent (found suitable version "2.1.12", minimum required is "2.1.8")
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed

hebasto added 3 commits May 17, 2024 19:07
Can be tested with:
```
cmake -B build -DBUILD_DAEMON=OFF -DBUILD_CLI=OFF -DBUILD_TESTS=OFF -DBUILD_BENCH=OFF -DBUILD_FUZZ_BINARY=OFF
cmake --build build
```
@hebasto hebasto force-pushed the 240517-cmake-FD branch from a8db82c to b18b727 Compare May 17, 2024 19:39
Copy link

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK b18b727

Tested on Linux, both with and without depends.
    with
    • before (staging):
    -- Checking for module 'libevent>=2.1.8'
    --   Found libevent, version 2.1.12-stable
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
    -- Checking for module 'libevent_pthreads>=2.1.8'
    --   Found libevent_pthreads, version 2.1.12-stable
    
    • after (this PR):
    -- Found Libevent: /home/pablo/workspace/bitcoin-hebasto/depends/x86_64-pc-linux-gnu/lib (found suitable version "2.1.12-stable", minimum required is "2.1.8") 
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
    
    
    without
    • before (staging):
    -- Checking for module 'libevent>=2.1.8'
    --   Found libevent, version 2.1.12-stable
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
    -- Checking for module 'libevent_pthreads>=2.1.8'
    --   Found libevent_pthreads, version 2.1.12-stable
    
    • after (this PR):
    -- Found Libevent: /usr/lib/x86_64-linux-gnu (found suitable version "2.1.12-stable", minimum required is "2.1.8") 
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
    -- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
    

Is there no diff building on Windows with/ without depends?

nit: could 2nd. and 3rd. commits be squashed?

@hebasto
Copy link
Owner Author

hebasto commented May 18, 2024

nit: could 2nd. and 3rd. commits be squashed?

During the following sync/rebase round, the 2nd commit remains but the 3rd is to be squashed with other commits.

@hebasto hebasto merged commit 40b7172 into cmake-staging May 20, 2024
hebasto pushed a commit that referenced this pull request Aug 16, 2025
The `-assumevalid` option skips script verification for a specified block and all its ancestors during Initial Block Download.
Many new users are surprised when this suddenly slows their node to a halt.
This commit adds a log message to clearly indicate when this optimization ends and full validation begins (and vice versa).

When using `-assumeutxo`, logging is suppressed for the active assumed-valid chainstate and for the background validation chainstate to avoid the confusing toggles.

-------

> cmake -B build && cmake --build build && mkdir -p demo && build/bin/bitcoind -datadir=demo -stopatheight=500 | grep 'signature validation'

```
2025-08-08T20:59:21Z Disabling signature validations at block #1 (00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048).
2025-08-08T20:59:21Z Enabling signature validations at block #100 (000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a).
2025-08-08T20:59:21Z Disabling signature validations at block #200 (000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320).
2025-08-08T20:59:21Z Enabling signature validations at block #300 (0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609).
```
hebasto pushed a commit that referenced this pull request Aug 16, 2025
…hange

fab2980 assumevalid: log every script validation state change (Lőrinc)

Pull request description:

  The `-assumevalid` option skips script verification for a specified block and all its ancestors during Initial Block Download.
  Many new [users are surprised](bitcoin#32832) when this suddenly slows their node to a halt.
  This commit adds a log message to clearly indicate when this optimization ends and full validation begins (and vice versa).

  <details>
  <summary>Testing instructions</summary>

  The behavior can easily be tested by adding this before the new log:
  ```C++
      // TODO hack to enable/disable script checks based on block height for testing purposes
           if (pindex->nHeight < 100) fScriptChecks = false;
      else if (pindex->nHeight < 200) fScriptChecks = true;
      else if (pindex->nHeight < 300) fScriptChecks = false;
      else if (pindex->nHeight < 400) fScriptChecks = true;
  ```
  and exercise the new code with:
  ```bash
  cmake -B build && cmake --build build && mkdir -p demo && build/bin/bitcoind -datadir=demo -stopatheight=500 | grep 'signature validation'
  ```
  showing something like:
  * Disabling signature validations at block #1 (00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048).
  * Enabling signature validations at block #100 (000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a).
  * Disabling signature validations at block #200 (000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320).
  * Enabling signature validations at block #300 (0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609).

  </details>

ACKs for top commit:
  achow101:
    ACK fab2980
  ajtowns:
    crACK fab2980
  davidgumberg:
    untested crACK bitcoin@fab2980

Tree-SHA512: e90b66f7423b639356daace476942ce83e65e70466544394cbe2f15738bdbf716163eaf590c64c5448f9b41aeeaafe3342c48c6a7a478678a70b0310ca94e11d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants