🤔 mzumsande reviewed a pull request: "init: Some small chainstate load improvements"
(https://github.com/bitcoin/bitcoin/pull/31046#pullrequestreview-2355081461)
one more small thing that I noticed reviewing #30968 (it wasn't really on-topic there, but fits with the last commit here): I don't think that we should return `ChainstateLoadStatus::FAILURE` in https://github.com/bitcoin/bitcoin/blob/5837e3463fe188a65d67f96e84cbcca674d61d9e/src/node/chainstate.cpp#L239 (snapshot validation failure). This is not a problem where a general reindex would typically help, and is handled inside of validation (`InvalidateCoinsDBOnDisk`) anyway.
  (https://github.com/bitcoin/bitcoin/pull/31046#pullrequestreview-2355081461)
one more small thing that I noticed reviewing #30968 (it wasn't really on-topic there, but fits with the last commit here): I don't think that we should return `ChainstateLoadStatus::FAILURE` in https://github.com/bitcoin/bitcoin/blob/5837e3463fe188a65d67f96e84cbcca674d61d9e/src/node/chainstate.cpp#L239 (snapshot validation failure). This is not a problem where a general reindex would typically help, and is handled inside of validation (`InvalidateCoinsDBOnDisk`) anyway.
👍 ryanofsky approved a pull request: "Add waitFeesChanged() to Mining interface"
(https://github.com/bitcoin/bitcoin/pull/31003#pullrequestreview-2354996475)
Code review ACK 9a723c784ad5170b1e01e91f018e5794a51dd038, but implementation has a few rough edges described below, which would recommend fixing.
Also I think it would be a lot clearer to squash the two commits. If second commit is a problem for "(very) low end hardware" as described, I think it might make sense to make fee_threshold a std::optional parameter so callers running on slow hardware can skip the fee calculation. Alternately could tweak sleep_until to make sure the function is sle
...
  (https://github.com/bitcoin/bitcoin/pull/31003#pullrequestreview-2354996475)
Code review ACK 9a723c784ad5170b1e01e91f018e5794a51dd038, but implementation has a few rough edges described below, which would recommend fixing.
Also I think it would be a lot clearer to squash the two commits. If second commit is a problem for "(very) low end hardware" as described, I think it might make sense to make fee_threshold a std::optional parameter so callers running on slow hardware can skip the fee calculation. Alternately could tweak sleep_until to make sure the function is sle
...
💬 ryanofsky commented on pull request "Add waitFeesChanged() to Mining interface":
(https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1792221843)
In commit "Have waitFeesChanged() frequently make a template" (9a723c784ad5170b1e01e91f018e5794a51dd038)
It seems like there is a bug here (also present in the previous commit) where `last_mempool_update` variable is not updated during the loop, so once the value changes a single time, this check will always be true, and the same block could be assembled wastefully every tick.
Also, it seems like there is also a race condition in the opposite direction that could lead to stale results, whe
...
  (https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1792221843)
In commit "Have waitFeesChanged() frequently make a template" (9a723c784ad5170b1e01e91f018e5794a51dd038)
It seems like there is a bug here (also present in the previous commit) where `last_mempool_update` variable is not updated during the loop, so once the value changes a single time, this check will always be true, and the same block could be assembled wastefully every tick.
Also, it seems like there is also a race condition in the opposite direction that could lead to stale results, whe
...
💬 ryanofsky commented on pull request "Add waitFeesChanged() to Mining interface":
(https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1792180834)
In commit "Introduce waitFeesChanged() mining interface" (a87589abfde4f2f1dfba0f3f1f5745f7acfef365)
Would suggest deleting this. I don't think this can do anything because the value passed to the sleep function is already capped by `now + tick`
  (https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1792180834)
In commit "Introduce waitFeesChanged() mining interface" (a87589abfde4f2f1dfba0f3f1f5745f7acfef365)
Would suggest deleting this. I don't think this can do anything because the value passed to the sleep function is already capped by `now + tick`
💬 LarryRuane commented on pull request "doc: cmake: prepend "build" to functional/test_runner.py":
(https://github.com/bitcoin/bitcoin/pull/30859#discussion_r1792260314)
Thanks, I don't mind removing the code changes at all (I was on the fence on this part of the change), should we wait a little while to see if there are other opinions?
  (https://github.com/bitcoin/bitcoin/pull/30859#discussion_r1792260314)
Thanks, I don't mind removing the code changes at all (I was on the fence on this part of the change), should we wait a little while to see if there are other opinions?
🤔 maflcko reviewed a pull request: "tinyformat: refactor: increase compile-time checks and don't throw for tfm::format_error"
(https://github.com/bitcoin/bitcoin/pull/30928#pullrequestreview-2355129479)
Left a nit.
Only change is adding `throw` when `DEBUG`, which seems fine.
re-ACK 49f73071a8ec4131595090a619d6198a5f8b7c3c 🎖
<details><summary>Show signature</summary>
Signature:
```
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP
...
  (https://github.com/bitcoin/bitcoin/pull/30928#pullrequestreview-2355129479)
Left a nit.
Only change is adding `throw` when `DEBUG`, which seems fine.
re-ACK 49f73071a8ec4131595090a619d6198a5f8b7c3c 🎖
<details><summary>Show signature</summary>
Signature:
```
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP
...
💬 maflcko commented on pull request "tinyformat: refactor: increase compile-time checks and don't throw for tfm::format_error":
(https://github.com/bitcoin/bitcoin/pull/30928#discussion_r1792263531)
nit in 4ce60d82a0c1e21ee7ecba69e4c8926720829429: Could split the changes to make the format string a bit more const, and never `translated` in real code into a separate commit? The benefit would be that the doc changes and (constroversial?) c_str changes are in a separate commit. It would also allow easier cherry-picking into other pulls.
  (https://github.com/bitcoin/bitcoin/pull/30928#discussion_r1792263531)
nit in 4ce60d82a0c1e21ee7ecba69e4c8926720829429: Could split the changes to make the format string a bit more const, and never `translated` in real code into a separate commit? The benefit would be that the doc changes and (constroversial?) c_str changes are in a separate commit. It would also allow easier cherry-picking into other pulls.
👍 hebasto approved a pull request: "refactor: include the proper header rather than forward-declaring RemovalReasonToString"
(https://github.com/bitcoin/bitcoin/pull/31058#pullrequestreview-2355137114)
ACK ca2e4ba352cb0a3b5983c002b09ce15ebbf95177, IWYU seems [agree](https://cirrus-ci.com/task/6170839912022016):
```
[16:19:43.440] The full include-list for /ci_container_base/src/validationinterface.cpp:
[16:19:43.440] #include <validationinterface.h>
[16:19:43.440] #include <chain.h> // for CBlockIndex
[16:19:43.440] #include <consensus/validation.h> // for BlockValidationState
[16:19:43.440] #include <kernel/mempool_entry.h> // for RemovedMemp
...
  (https://github.com/bitcoin/bitcoin/pull/31058#pullrequestreview-2355137114)
ACK ca2e4ba352cb0a3b5983c002b09ce15ebbf95177, IWYU seems [agree](https://cirrus-ci.com/task/6170839912022016):
```
[16:19:43.440] The full include-list for /ci_container_base/src/validationinterface.cpp:
[16:19:43.440] #include <validationinterface.h>
[16:19:43.440] #include <chain.h> // for CBlockIndex
[16:19:43.440] #include <consensus/validation.h> // for BlockValidationState
[16:19:43.440] #include <kernel/mempool_entry.h> // for RemovedMemp
...
💬 ryanofsky commented on issue "Disallow building fuzz binary without `-DBUILD_FOR_FUZZING`":
(https://github.com/bitcoin/bitcoin/issues/31057#issuecomment-2400458885)
@dergoegge can you clarify what change is being proposed and how it would affect me if I am building with:
```
BUILD_FOR_FUZZING:BOOL=OFF
BUILD_FUZZ_BINARY:BOOL=ON
```
I build with these options to be able to be able to know if changes not related to fuzzing will break the build.
  (https://github.com/bitcoin/bitcoin/issues/31057#issuecomment-2400458885)
@dergoegge can you clarify what change is being proposed and how it would affect me if I am building with:
```
BUILD_FOR_FUZZING:BOOL=OFF
BUILD_FUZZ_BINARY:BOOL=ON
```
I build with these options to be able to be able to know if changes not related to fuzzing will break the build.
🤔 tdb3 reviewed a pull request: "Add waitFeesChanged() to Mining interface"
(https://github.com/bitcoin/bitcoin/pull/31003#pullrequestreview-2349619672)
Approach ACK
Cherry-picked bitcoin-mine from #30437 to exercise some of the interface (on top of 9a723c784ad5170b1e01e91f018e5794a51dd038).
```
git cherry-pick aec7e7d897741fe25fbf54995e1825772e0872d7
git cherry-pick 2227afac0372358287fb879f3b0bd07fd653f3f8
make -C depends NO_QT=1 MULTIPROCESS=1
HOST_PLATFORM="x86_64-pc-linux-gnu"
cmake -B build --toolchain=depends/$HOST_PLATFORM/toolchain.cmake
```
Added the following to `bitcoin-mine.cpp`
```diff
diff --git a/src/bitcoin-min
...
  (https://github.com/bitcoin/bitcoin/pull/31003#pullrequestreview-2349619672)
Approach ACK
Cherry-picked bitcoin-mine from #30437 to exercise some of the interface (on top of 9a723c784ad5170b1e01e91f018e5794a51dd038).
```
git cherry-pick aec7e7d897741fe25fbf54995e1825772e0872d7
git cherry-pick 2227afac0372358287fb879f3b0bd07fd653f3f8
make -C depends NO_QT=1 MULTIPROCESS=1
HOST_PLATFORM="x86_64-pc-linux-gnu"
cmake -B build --toolchain=depends/$HOST_PLATFORM/toolchain.cmake
```
Added the following to `bitcoin-mine.cpp`
```diff
diff --git a/src/bitcoin-min
...
💬 tdb3 commented on pull request "Add waitFeesChanged() to Mining interface":
(https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1788625591)
> calls getTransactionsUpdated once per second. This returns true anytime a transaction is added to the mempool, even if it has no impact on fees in the best block.
nit: The description in the first commit could be updated to be more accurate (so even if the 2nd commit isn't included, the interface is documented accurately). Maybe just add a note, e.g. `(current interim behavior is to return true for any mempool change, not just fee increased)`.
  (https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1788625591)
> calls getTransactionsUpdated once per second. This returns true anytime a transaction is added to the mempool, even if it has no impact on fees in the best block.
nit: The description in the first commit could be updated to be more accurate (so even if the 2nd commit isn't included, the interface is documented accurately). Maybe just add a note, e.g. `(current interim behavior is to return true for any mempool change, not just fee increased)`.
💬 tdb3 commented on pull request "Add waitFeesChanged() to Mining interface":
(https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1788625072)
non-blocking nitty nit: Could include all function arguments as params in the doxygen comments. Feel free to ignore.
  (https://github.com/bitcoin/bitcoin/pull/31003#discussion_r1788625072)
non-blocking nitty nit: Could include all function arguments as params in the doxygen comments. Feel free to ignore.
💬 ryanofsky commented on issue "Disallow building fuzz binary without `-DBUILD_FOR_FUZZING`":
(https://github.com/bitcoin/bitcoin/issues/31057#issuecomment-2400559220)
Looking into windows timeout issue #30950 and the workaround #31028 disabling a subset of fuzz tests when BUILD_FUZZ_BINARY is false, I wonder if we can't just go with a simpler solution of fuzz testing normal libraries instead of building all the libraries specially for fuzz testing. Would a fix like the following not work?
<details><summary>diff</summary>
<p>
```diff
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -240,11 +240,6 @@ if(BUILD_FOR_FUZZING)
set(BUILD_GUI_TESTS OFF)
   
...
  (https://github.com/bitcoin/bitcoin/issues/31057#issuecomment-2400559220)
Looking into windows timeout issue #30950 and the workaround #31028 disabling a subset of fuzz tests when BUILD_FUZZ_BINARY is false, I wonder if we can't just go with a simpler solution of fuzz testing normal libraries instead of building all the libraries specially for fuzz testing. Would a fix like the following not work?
<details><summary>diff</summary>
<p>
```diff
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -240,11 +240,6 @@ if(BUILD_FOR_FUZZING)
set(BUILD_GUI_TESTS OFF)
...
💬 maflcko commented on pull request "ci: Approximate MAKEJOBS in image build phase":
(https://github.com/bitcoin/bitcoin/pull/30935#issuecomment-2400583836)
rebased
  (https://github.com/bitcoin/bitcoin/pull/30935#issuecomment-2400583836)
rebased
💬 achow101 commented on pull request "scripted-diff: Modernize nLocalServices naming":
(https://github.com/bitcoin/bitcoin/pull/30885#issuecomment-2400584380)
ACK 33381ea530ad79ac1e04c37f5707e93d3e0509ca
  (https://github.com/bitcoin/bitcoin/pull/30885#issuecomment-2400584380)
ACK 33381ea530ad79ac1e04c37f5707e93d3e0509ca
💬 TheCharlatan commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#issuecomment-2400726577)
Reworked after receiving a bunch of out-of-band feedback. In short:
* Got rid of the `void *` option handling. Options are now set through dedicated functions instead of a single setter for all options.
* Got rid of the `kernel_TaskRunner`. The context now holds an immediate task runner internally on which a user can register various validation interfaces. It is now the user's responsibility to process the validation callbacks in a non-blocking fashion with their own infrastructure.
* Got r
...
  (https://github.com/bitcoin/bitcoin/pull/30595#issuecomment-2400726577)
Reworked after receiving a bunch of out-of-band feedback. In short:
* Got rid of the `void *` option handling. Options are now set through dedicated functions instead of a single setter for all options.
* Got rid of the `kernel_TaskRunner`. The context now holds an immediate task runner internally on which a user can register various validation interfaces. It is now the user's responsibility to process the validation callbacks in a non-blocking fashion with their own infrastructure.
* Got r
...
👍 TheCharlatan approved a pull request: "refactor: include the proper header rather than forward-declaring RemovalReasonToString"
(https://github.com/bitcoin/bitcoin/pull/31058#pullrequestreview-2355432332)
ACK ca2e4ba352cb0a3b5983c002b09ce15ebbf95177
  (https://github.com/bitcoin/bitcoin/pull/31058#pullrequestreview-2355432332)
ACK ca2e4ba352cb0a3b5983c002b09ce15ebbf95177
💬 fanquake commented on pull request "doc: cmake: prepend "build" to functional/test_runner.py":
(https://github.com/bitcoin/bitcoin/pull/30859#discussion_r1792453358)
I think it'd be good to just get this finished so the docs are updated. So that we don't end up with even more PRs to fix the same docs.
  (https://github.com/bitcoin/bitcoin/pull/30859#discussion_r1792453358)
I think it'd be good to just get this finished so the docs are updated. So that we don't end up with even more PRs to fix the same docs.
💬 TheCharlatan commented on pull request "kernel: Move block tree db open to block manager":
(https://github.com/bitcoin/bitcoin/pull/30965#issuecomment-2400748950)
Rebased 60ade81516d42d275c1143f49f47e142d32c45fc -> 1c1df66cebbe825a24cb2f66a24aab78709db7db ([blockmanDB_2](https://github.com/TheCharlatan/bitcoin/tree/blockmanDB_2) -> [blockmanDB_3](https://github.com/TheCharlatan/bitcoin/tree/blockmanDB_3), [compare](https://github.com/TheCharlatan/bitcoin/compare/blockmanDB_2..blockmanDB_3))
* Fixed conflict with #30967
  (https://github.com/bitcoin/bitcoin/pull/30965#issuecomment-2400748950)
Rebased 60ade81516d42d275c1143f49f47e142d32c45fc -> 1c1df66cebbe825a24cb2f66a24aab78709db7db ([blockmanDB_2](https://github.com/TheCharlatan/bitcoin/tree/blockmanDB_2) -> [blockmanDB_3](https://github.com/TheCharlatan/bitcoin/tree/blockmanDB_3), [compare](https://github.com/TheCharlatan/bitcoin/compare/blockmanDB_2..blockmanDB_3))
* Fixed conflict with #30967
💬 ryanofsky commented on pull request "Add waitFeesChanged() to Mining interface":
(https://github.com/bitcoin/bitcoin/pull/31003#issuecomment-2400758677)
re: https://github.com/bitcoin/bitcoin/pull/31003#pullrequestreview-2349619672
> I did, however, run into a repeatable segfault that appears to be occurring with bitcoin_node when running bitcoin-mine (which calls `waitFeesChanged()`), interrupting bitcoin-mine (CTRL-C while it waits for change), then generating a block (with `bitcoin-cli`). Feels a bit DoSsy. Could be something I'm overlooking/messed up on my end. Not sure. Please request more details if needed.
@tdb3 Thanks for reporting
...
  (https://github.com/bitcoin/bitcoin/pull/31003#issuecomment-2400758677)
re: https://github.com/bitcoin/bitcoin/pull/31003#pullrequestreview-2349619672
> I did, however, run into a repeatable segfault that appears to be occurring with bitcoin_node when running bitcoin-mine (which calls `waitFeesChanged()`), interrupting bitcoin-mine (CTRL-C while it waits for change), then generating a block (with `bitcoin-cli`). Feels a bit DoSsy. Could be something I'm overlooking/messed up on my end. Not sure. Please request more details if needed.
@tdb3 Thanks for reporting
...
