Skip to content

backport: trivial 2025 05 08 #6668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

PastaPastaPasta
Copy link
Member

Issue being fixed or feature implemented

Batch of trivial backports

How Has This Been Tested?

CI

Breaking Changes

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

MarcoFalke and others added 10 commits May 8, 2025 09:04
faf8c73 ci: Use monterey-xcode-13.3 (MarcoFalke)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK faf8c73, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 5e6772371fc9600c7eedacf88344cf98e71250066e16d8759a749d4a53e5b8e855c9e90880023fdd7454f959bb7b5a90cd7a7ad1d8a2e4a65068c66ccf6b828d
…nd libnatpmp. Again :)

1659034 build: Fix `AC_CHECK_HEADERS` and `AC_CHECK_LIB` for `libnatpmp` package (Hennadii Stepanov)
65cddf6 build: Fix `AC_CHECK_HEADERS` and `AC_CHECK_LIB` for `miniupnpc` package (Hennadii Stepanov)
bbbcb96 build, refactor: Fix indentation (Hennadii Stepanov)

Pull request description:

  Apparently, bitcoin#24391 broke the [ability](bitcoin#22397) of the `configure` script to pick up Homebrew's `miniupnpc` and `libnatpmp` packages on macOS Apple M1.

  This PR fixes it.

ACKs for top commit:
  promag:
    Tested ACK 1659034
  jarolrod:
    tACK 1659034

Tree-SHA512: 93988f59f425890d60582b93d4ac5b2ad03011a5c6dbb44678a3ca591da7518c1c741bc1045b2c763bbe887947f32293b38d55fd7a96f09d2092ad34baa1db21
f0f5cd7 Bugfix: configure: Define default for use_libevent (Luke Dashjr)

Pull request description:

  Another trivial fix like bitcoin#25051 - I think this is the only other one missing.

ACKs for top commit:
  laanwj:
    Code review ACK f0f5cd7

Tree-SHA512: 888c2e6d032ef1de5af635e2a9b2b8ab560c86bd10a6cee54aa9aa62ae43f03c19889bb6a2b64cf8982d4cd514f97ca3ed743c71ed0651e9295a4b1726955b9b
…escanblockchain`

d1a0004 test: add coverage for invalid parameters for `rescanblockchain` (brunoerg)

Pull request description:

  This PR adds test coverage for the following errors:
  https://github.com/bitcoin/bitcoin/blob/2bd9aa5a44b88c866c4d98f8a7bf7154049cba31/src/wallet/rpc/transactions.cpp#L880-L894

ACKs for top commit:
  w0xlt:
    reACK bitcoin@d1a0004

Tree-SHA512: c357fbda3d261e4d06a29d2a5350482db5f97a815adf59abdac1971eb19b69cfd4d54e4d21836851e2e3b116aa2a820ea1437c7aededf86b06df435cca16ac90
…lled from homebrew

b50a4b7 build: quiet warnings in system headers installed from homebrew (Cory Fields)

Pull request description:

  From the included comment:

  Homebrew may create symlinks in `/usr/local/include` for some packages. Because MacOS's clang internally adds `-I /usr/local/include` to its search paths, this will negate efforts to use `-isystem` for those packages, as they will be found first in `/usr/local`. Use the internal `-internal-isystem` option to system-ify all `/usr/local/include` paths without adding it to the list of search paths in case it's not already there.

  This fixes the issue explained here: bitcoin#26056 (comment)

  ~Also temporarily includes bitcoin#26056 as a test. I will remove that commit if/when c-i is happy, and fanquake can rebase it post-merge.~
  I've removed this commit now that c-i succeeded with it.

ACKs for top commit:
  hebasto:
    ACK b50a4b7, tested as a part of bitcoin#26056 on macOS Monterey 12.6 (21G115, both Intel and Apple M1) + Apple clang 14.0.0:

Tree-SHA512: 163aa359d27c31d52b444252762e32dd8a11acc043cf1a2aa953f902d1dab77ece52e2dfedcce637e6a1dda47e4c566bfeb8d3b092f82bfc73923843b7bc619c
…it is available"

d216d71 Revert "build: Use Homebrew's sqlite package if it is available" (fanquake)

Pull request description:

  This reverts ee7b84e from bitcoin#20527.

  That change was made without any rationale, maybe other than, a brew
  installed version might be newer, and that's "better". However when
  building from source on macOS, it just results in drastically worse
  performance, and issues / confusion like bitcoin#25724.

  The difference in performance can be observed using the example from bitcoin#25724 (comment),
  but minified i.e:
  ```bash
  time src/bitcoin-cli createwallet speedy true
  time src/bitcoin-cli importdescriptors '[
    {"desc":"raw(00145846369f3d6ba366d6f5a903fb5cf4dca3763c0e)#k9wh6v62","timestamp":"now"},
    {"desc":"raw(001420800aabf13f3a4c4ce3ce4c66cecf1d17f21a6e)#6m0hlfh4","timestamp":"now"},
    {"desc":"raw(0014c6bf9715e06d73ebf9b3b02d5cc48d24d8bbabc1)#wyavh36r","timestamp":"now"},
    {"desc":"raw(00141ba7807b3f46af113beaea5c698428ce7138cd8a)#jctdsups","timestamp":"now"},
    {"desc":"raw(00140c1bd27f10fff01b36ddf3c1febaa1acff19b080)#9s6nc3pk","timestamp":"now"},
    {"desc":"raw(00141226e31987e4bc2e63c0ee12908f675e40464b20)#9pp7qm39","timestamp":"now"},
    {"desc":"raw(0014f73f149f7503960a5e849c6ee7a8a8c336f631cb)#qtkxv9fc","timestamp":"now"},
    {"desc":"raw(0014c8ccb4d81ffc769fc5fdd8d7eed69b0e0cae5749)#hn39qayv","timestamp":"now"},
    {"desc":"raw(001498565aead2d67a22a6021d55210f2a917fc22169)#6ar3vwsx","timestamp":"now"},
    {"desc":"raw(001403013248ac0cd9eabe176cad162cda2a19f771e1)#4m47mukd","timestamp":"now"}
  ]'
  ```

  Running master, when building from souce and using brew installed
  sqlite, this takes ~3.4s. With this PR, the same operation takes ~0.3s.

  Resolves the "build from source" portion of bitcoin#25724. Building from
  depends is still not ideal, however I have some other changes that might
  help improve things in that case.

  Related performance issue reports:
  * bitcoindevkit/bdk#749
  * https://bitcoin.stackexchange.com/questions/113898/bitcoin-v23-is-10-times-slower-than-v22-on-macos-for-basic-regtest-tests
  * bitcoin#25724
  * bitcoin#25985 (comment)

ACKs for top commit:
  achow101:
    ACK d216d71
  jarolrod:
    ACK d216d71
  hebasto:
    ACK d216d71, I have reviewed the code and it looks OK, I agree it can be merged. No conflicts with our build [docs](https://github.com/bitcoin/bitcoin/blob/d216d714aae36e6f1c95f82aef81a0be74dee2f3/doc/build-osx.md#descriptor-wallet-support).

Tree-SHA512: 1bb4b44385b11fa9fe66edd7449278f9e47a6cc679b7111f9adf17db94c34e29c9cceafc917454e134420db40b24b56da29226af6f43e6dbeff822b79b77ed60
9fbc5fc build: remove ancient unused define (Cory Fields)

Pull request description:

  The generic define was removed in [upstream miniupnpc in 2014](miniupnp/miniupnp@f6774e3).

  Noticed while reviewing hebasto's new CMake buildsystem: hebasto#12 (comment).

ACKs for top commit:
  RandyMcMillan:
    utACK 9fbc5fc
  hebasto:
    ACK 9fbc5fc
  TheCharlatan:
    ACK 9fbc5fc

Tree-SHA512: 2075a2e63441e32d939c23f30f811c73dd1ab1ddcc9e6bf079cc8060e77d9a2a6d707add7b72e9251939a53b53e28a134e9bb330ccf3556244497728f1b091ae
ecfe507 fuzz: use `ConnmanTestMsg` in `connman` (brunoerg)

Pull request description:

  Fixes bitcoin#27980

  Using `ConnmanTestMsg` we can add nodes and be
  more effective fuzzing functions like `DisconnectNode`,
  `FindNode`, `GetNodeStats` and other ones.

ACKs for top commit:
  MarcoFalke:
    review ACK ecfe507
  dergoegge:
    utACK ecfe507

Tree-SHA512: 97c363b422809f2e9755c082d1102237347abfab72c7baca417bd8975f8a595ddf3a085f8353dbdb9f17fb98fbfe830792bfc0b83451168458018faf6c239efa
…n possible

025fda0 fuzz: addrman, avoid `ConsumeDeserializable` when possible (brunoerg)

Pull request description:

  Using specific functions like `ConsumeService`, `ConsumeAddress` and `ConsumeNetAddr` may be more effective than using `ConsumeDeserializable`. They always return some value while `ConsumeDeserializable` may return `std::nullopt`.

  E.g.: In this part of the code, if `op_net_addr` is `std::nullopt`,  we basically generated the addresses (if so) unnecessarily, because we won't be able to use them:
  ```cpp
  std::vector<CAddress> addresses;
  LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) {
      const std::optional<CAddress> opt_address = ConsumeDeserializable<CAddress>(fuzzed_data_provider);
      if (!opt_address) {
          break;
      }
      addresses.push_back(*opt_address);
  }
  const std::optional<CNetAddr> opt_net_addr = ConsumeDeserializable<CNetAddr>(fuzzed_data_provider);
  if (opt_net_addr) {
      addr_man.Add(addresses, *opt_net_addr, std::chrono::seconds{ConsumeTime(fuzzed_data_provider, 0, 100000000)});
  }
  ```

  Also, if we are not calling `Add` effectively, it would also be affect other functions that may "depend" on it.

ACKs for top commit:
  dergoegge:
    Code review ACK 025fda0

Tree-SHA512: 02450bec0b084c15ba0cd1cbdfbac067c8fea4ccf27be0c86d54e020f029a6c749a16d8e0558f9d6d35a7ca9db8916f180c872f09474702b5591129e9be0d192
8cfa22a build: move -fstack-reuse=none to CORE_CXXFLAGS (fanquake)

Pull request description:

  This is not a hardening specific flag, it should be used at all times, regardless of if hardening is enabled or not. Note that this was still the case here, but having this exist in the hardening flags is confusing, and may lead someone to move it inside one of the `use_hardening` blocks, where it would become unused, with `--disable-hardening`.

  Noticed while reviewing hebasto#32 (comment).

ACKs for top commit:
  theuni:
    ACK 8cfa22a. Agree it's confusing as-is and this better matches the intent.
  hebasto:
    ACK 8cfa22a
  luke-jr:
    utACK 8cfa22a
  TheCharlatan:
    ACK 8cfa22a

Tree-SHA512: 74c3219301398361d06b1ef2257fc9ec18055b1661f8733ee909adefee61e458d70991c32adf0e0450905a7ffbddc99799f5fdac894f4896cfade19f961818df
@PastaPastaPasta PastaPastaPasta added this to the 23 milestone May 13, 2025
Copy link

coderabbitai bot commented May 13, 2025

Walkthrough

The changes update the macOS CI configuration to use a newer Xcode version and make several adjustments to build configuration in configure.ac, including improved handling of compiler warning flags, platform-specific workarounds, and external library detection flags. Logging is removed from certain error paths in Proxy::Connect() in src/netbase.cpp. Fuzz tests for addrman and connman are refactored to simplify input handling and add explicit test node management, respectively. Compiler-specific warning suppression is added around self-assignment operations in fuzz and unit tests. The wallet database creation logic is refactored to use if constexpr for supported backends. The wallet transaction time rescan functional test is extended with assertions for error handling on invalid parameters. No changes are made to exported or public entity declarations.

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a01c313 and 6dfb41e.

📒 Files selected for processing (5)
  • configure.ac (7 hunks)
  • src/netbase.cpp (1 hunks)
  • src/test/fuzz/muhash.cpp (1 hunks)
  • src/test/uint256_tests.cpp (2 hunks)
  • src/wallet/walletdb.cpp (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/test/fuzz/muhash.cpp
  • src/test/uint256_tests.cpp
  • src/netbase.cpp
  • src/wallet/walletdb.cpp
  • configure.ac
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: mac-build / Build source
  • GitHub Check: arm-linux-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: linux64_nowallet-build / Build source
  • GitHub Check: linux64_multiprocess-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: win64-build / Build source
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/wallet/walletdb.cpp (2)

1161-1172: Avoid pointless if constexpr (true) – simplify and prevent dead–code noise

The constant-true if constexpr adds no functional value, but it:

  • Generates an always-false else branch that is retained in the source.
    – With modern compilers and -Wunused warnings this becomes a “dead‐code” diagnostic hotspot.
  • Requires readers to mentally unfold two layers (#ifdef and if constexpr) to see that the code is effectively unconditional once USE_SQLITE is defined.

A direct return is clearer and makes the unreachable branch disappear entirely:

#ifdef USE_SQLITE
-        if constexpr (true) {
-            return MakeSQLiteDatabase(path, options, status, error);
-        } else
+#ifdef USE_SQLITE
+        return MakeSQLiteDatabase(path, options, status, error);
#else
         {
             error = Untranslated(strprintf(
                 "Failed to open database path '%s'. Build does not support SQLite database format.",
                 fs::PathToString(path)));
             status = DatabaseStatus::FAILED_BAD_FORMAT;
             return nullptr;
         }
+#endif

(Same pattern appears below for the BerkeleyDB path.)


1174-1183: Duplicate pattern for BDB – apply the same clean-up

Replicate the simplification for the BerkeleyDB section to keep both back-ends uniform and free of unnecessary if constexpr scaffolding.

configure.ac (1)

795-797: Clang-specific -internal-isystem – guard with a compiler check

-Xclang -internal-isystem is accepted by Clang only. When a user supplies CC=/usr/bin/gcc on macOS this test will fail and treat the flag as “unknown”, but the compile-test here is also Clang-only. A quick compiler guard (if test "$CLANG" = "yes") before attempting the check would keep the configure log cleaner.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06de2b0 and a01c313.

📒 Files selected for processing (10)
  • .cirrus.yml (1 hunks)
  • configure.ac (7 hunks)
  • src/init/common.cpp (1 hunks)
  • src/netbase.cpp (1 hunks)
  • src/test/fuzz/addrman.cpp (2 hunks)
  • src/test/fuzz/connman.cpp (3 hunks)
  • src/test/fuzz/muhash.cpp (1 hunks)
  • src/test/uint256_tests.cpp (2 hunks)
  • src/wallet/walletdb.cpp (1 hunks)
  • test/functional/wallet_transactiontime_rescan.py (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
test/functional/wallet_transactiontime_rescan.py (1)
test/functional/test_framework/util.py (1)
  • assert_raises_rpc_error (127-143)
src/netbase.cpp (1)
src/netaddress.cpp (4)
  • IsValid (426-453)
  • IsValid (426-426)
  • IsValid (1085-1088)
  • IsValid (1085-1085)
src/test/fuzz/addrman.cpp (1)
src/test/fuzz/util.h (1)
  • ConsumeWeakEnum (181-181)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: mac-build / Build source
  • GitHub Check: win64-build / Build source
  • GitHub Check: arm-linux-build / Build source
  • GitHub Check: linux64_nowallet-build / Build source
  • GitHub Check: linux64_sqlite-build / Build source
  • GitHub Check: linux64_ubsan-build / Build source
  • GitHub Check: linux64-build / Build source
  • GitHub Check: linux64_fuzz-build / Build source
  • GitHub Check: linux64_tsan-build / Build source
  • GitHub Check: linux64_multiprocess-build / Build source
🔇 Additional comments (17)
src/test/fuzz/muhash.cpp (1)

46-57: Appropriate warning suppression for intentional self-assignment test.

The added compiler-specific pragmas correctly suppress Clang's -Wself-assign-overloaded warning only in the scope where it's needed. This is a clean approach that maintains the test's intention (verifying that self-division returns to initial state) without generating false positive warnings.

src/netbase.cpp (1)

642-642: Code simplification: Removed unnecessary logging for invalid proxy.

The change simplifies the error handling by returning early without logging when a proxy is invalid. This is a sensible cleanup that reduces log verbosity while maintaining the same functionality.

.cirrus.yml (1)

178-178: Updated macOS CI environment to newer Xcode version.

The CI configuration now uses Xcode 13.3 instead of 13.2, which aligns with other compiler configuration changes in this PR. This ensures consistent testing environments.

test/functional/wallet_transactiontime_rescan.py (2)

14-14: Added import for error assertion testing.

Added the assert_raises_rpc_error import to support the new test cases.


163-166: Improved error handling test coverage for rescanblockchain RPC.

These new test cases thoroughly validate the parameter validation in the rescanblockchain RPC method, ensuring it correctly rejects negative heights and invalid height ranges with appropriate error messages.

src/test/fuzz/connman.cpp (3)

36-40: Using ConnmanTestMsg instead of CConnman for better test control

Good change using the test-specific connection manager class which gives better control over network behavior in the test environment.


52-55: Enhancing test coverage with controlled node creation

This is a good improvement to the fuzz test coverage. The new loop creates and adds test nodes in a controlled manner, allowing for better testing of the connection manager's node handling functionality. The LIMITED_WHILE macro ensures the test won't run indefinitely.


148-148: Proper cleanup of test resources

Adding the ClearTestNodes() call ensures proper cleanup of resources after the test, which is a good practice to prevent resource leaks and state contamination between tests.

src/init/common.cpp (1)

65-65: Improved help text clarity for logging configuration

The updated help text provides clearer explanation of the log level options by:

  1. Better formatting the available severity levels
  2. Explicitly mentioning the default level
  3. Clearly stating which levels are always logged (error, warning, info)

This makes the documentation more user-friendly and reduces confusion about logging behavior.

src/test/uint256_tests.cpp (1)

271-298: Properly suppressing expected compiler warnings for self-assignment test

Good addition of compiler-specific pragmas to suppress the Clang self-assignment warning. The detailed comments explain why the suppression is necessary and the approach is correct:

  1. The test deliberately tests self-assignment operations on arith_uint256
  2. The warning suppression is scoped only to this specific test
  3. The warning is properly re-enabled after the test case
  4. The comments document the Clang issue reference and explain why this is valid

This is good practice for maintaining clean builds while still testing edge cases.

src/test/fuzz/addrman.cpp (3)

274-274: Simplified address consumption for more deterministic testing

Good change to use ConsumeAddress to always generate valid addresses instead of conditionally consuming them, which simplifies the control flow and makes the test more deterministic.


276-276: Using direct consumption for network addresses

Using ConsumeNetAddr for network address generation ensures valid network addresses are always used in the test, which improves test reliability and coverage.


279-289: Streamlined service operations with direct consumption functions

Good improvement to use direct consumption functions (ConsumeService, ConsumeWeakEnum) for various operations (Good, Attempt, Connected, SetServices). This simplifies the code by:

  1. Removing conditional branches that handle invalid data
  2. Making the test more deterministic by ensuring valid inputs
  3. Increasing the effectiveness of fuzzing by focusing on valid code paths

This aligns with fuzzing best practices to generate valid, structured inputs that explore deeper code paths.

configure.ac (4)

514-517: -Wself-assign flag: good idea, but be aware of GCC support

Clang provides -Wself-assign; GCC < 12 ignores it silently.
Because you correctly guard it with AX_CHECK_COMPILE_FLAG, the flag is only added when recognised, so no further action is required.


526-531: Global -fstack-reuse=none workaround: double-check non-GCC tool-chains

The comment says “only gcc understands this flag”, but the compile-test is unconditional.
If Clang is the active compiler on a non-Linux build it will quietly drop the flag, yet the surrounding wording implies GCC-specific intent. Consider:

AX_CHECK_COMPILE_FLAG([-fstack-reuse=none], [CORE_CXXFLAGS="$CORE_CXXFLAGS -fstack-reuse=none"], [], [$CXXFLAG_WERROR],
                      [AC_LANG_SOURCE([[#if !defined(__GNUC__) || defined(__clang__) 
                      #error skip
                      #endif
                      int main() { return 0; }]])])

to ensure it is only added for real GCC and avoid confusing diagnostics.


825-838: New MINIUPNPC/NATPMP flag variables – ensure they propagate

The detection section now stores include/library paths in MINIUPNPC_CPPFLAGS / MINIUPNPC_LIBS and similarly for NATPMP.
Please confirm that the relevant Makefile.am targets use these variables (e.g. AM_CPPFLAGS += $(MINIUPNPC_CPPFLAGS)). Otherwise the project may still compile locally (when headers are in a global path) but fail in clean CI environments.


1425-1463: Tmp‐override of CPPFLAGS risks hiding user-provided flags

While temporarily appending MINIUPNPC_CPPFLAGS/NATPMP_CPPFLAGS to CPPFLAGS inside the detection block you restore the original value afterwards. Good.
Just ensure no macro later relies on CPPFLAGS containing those paths – the real build picks them up from the dedicated substituted variables instead.

@PastaPastaPasta PastaPastaPasta requested a review from Copilot May 13, 2025 14:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request contains a batch of trivial backports addressing test improvements, conditional compilation refinements, and build configuration updates.

  • Added tests in the wallet transaction time rescan to verify error handling for invalid parameters.
  • Refactored conditional compilation blocks in walletdb.cpp using if constexpr for SQLite and Berkeley DB support.
  • Updated several fuzz tests, build scripts, and CI configuration (e.g. upgraded the macOS Xcode image).

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/functional/wallet_transactiontime_rescan.py Added invalid parameter tests for rescanblockchain RPC.
src/wallet/walletdb.cpp Refactored conditional compilation using if constexpr for database support.
src/test/uint256_tests.cpp Added clang diagnostic push/pop for self-assignment warnings handling.
src/test/fuzz/muhash.cpp Wrapped self-assignment warning suppression for clang in fuzz tests.
src/test/fuzz/connman.cpp Updated connection test node handling and switched to ConnmanTestMsg.
src/test/fuzz/addrman.cpp Simplified test consumption functions for addresses, net addrs and services.
src/netbase.cpp Removed extra logging on socket connection failures.
src/init/common.cpp Revised logging argument help text and flag handling.
configure.ac Updated compile flag checks and improved flag injection for external libs.
.cirrus.yml Upgraded the macOS CI image from monterey-xcode-13.2 to monterey-xcode-13.3.

Comment on lines +1163 to +1183
if constexpr (true) {
return MakeSQLiteDatabase(path, options, status, error);
} else
#endif
{
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
status = DatabaseStatus::FAILED_BAD_FORMAT;
return nullptr;
}
}

#ifdef USE_BDB
return MakeBerkeleyDatabase(path, options, status, error);
#else
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
status = DatabaseStatus::FAILED_BAD_FORMAT;
return nullptr;
if constexpr (true) {
return MakeBerkeleyDatabase(path, options, status, error);
} else
#endif
{
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
status = DatabaseStatus::FAILED_BAD_FORMAT;
return nullptr;
}
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

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

[nitpick] The use of 'if constexpr (true)' renders the else branch unreachable; consider refactoring this block to simplify the control flow and remove dead code.

Copilot uses AI. Check for mistakes.

@PastaPastaPasta PastaPastaPasta requested review from knst and UdjinM6 May 14, 2025 03:20
achow101 and others added 4 commits May 14, 2025 20:38
fa3373d refactor: Compile unreachable code (MarcoFalke)

Pull request description:

  When unreachable code isn't compiled, compile failures are not detected.

  Fix this by leaving it unreachable, but compiling it.

  Fixes bitcoin#28999 (comment)

ACKs for top commit:
  achow101:
    ACK fa3373d
  ryanofsky:
    Code review ACK fa3373d. This looks good, and should prevent code in the else blocks from accidentally breaking.

Tree-SHA512: 3a3764915dfc935bf5d7a48f1ca151dcbac340c1cbdce8236b24ae9b4f04d6ee9771ed058ca60bcbca6e19d13671de3517f828a8f7ab6444c7cc4e3538d1ba4e
fb4cc5f netbase: clean up Proxy logging (Matthew Zipkin)

Pull request description:

  Follow up to bitcoin#27375 and see bitcoin#29649 (comment)

  This removes an extra log message when we can't connect to our own proxy, and another when the proxy is invalid.

  ## Before bitcoin#27375 if proxy is unreachable

  ```
  2024-04-15T17:54:51Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61)
  2024-04-15T17:54:52Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61)
  2024-04-15T17:54:52Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61)
  2024-04-15T17:54:53Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61)
  2024-04-15T17:54:53Z connect() to 127.0.0.1:9999 failed after wait: Connection refused (61)
  ```

  ## After bitcoin#27375 if unix proxy is unreachable:

  ```
  2024-04-15T17:54:03Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T17:54:03Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor
  2024-04-15T17:54:04Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T17:54:04Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor
  2024-04-15T17:54:04Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T17:54:04Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor
  2024-04-15T17:54:05Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T17:54:05Z Cannot connect to socket for /Users/matthewzipkin/Desktop/tor
  ```

  ## After this PR:

  ```
  2024-04-15T18:18:51Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T18:18:51Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T18:18:52Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  2024-04-15T18:18:52Z connect() to /Users/matthewzipkin/Desktop/tor failed: No such file or directory (2)
  ```

ACKs for top commit:
  tdb3:
    CR ACK for fb4cc5f
  laanwj:
    ACK fb4cc5f

Tree-SHA512: f07b9f7f2ea9f4bc01780c09f0b076547108294a1fa7d158a0dd48d6d7351569e461e5cccf232b7b1413ce2e3679668e523e5a7c89cd58c909da76d3dcbc34de
c3a5e8a build: re-enable deprecated warning copy (Cory Fields)

Pull request description:

  Noticed while looking at the `-wno-*` flags in bitcoin#30235.

  This was disabled in bitcoin#18738 due to the combo of old gcc and qt. We no longer support the affected gcc, and the old qt should no longer be relevant to us anyway.

  See old fixes in:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88136
  and
  https://bugreports.qt.io/browse/QTBUG-75210
  and
  https://codereview.qt-project.org/c/qt/qtbase/+/245434

ACKs for top commit:
  maflcko:
    ACK c3a5e8a
  fanquake:
    ACK c3a5e8a - this is in `-Wextra` for Clang and GCC.

Tree-SHA512: bd008dc50134d15ca3bb0c4f78d910db5b7a0ee98b04c159122a6f13a24b18827806492f053293d9cc1f1528ba60dea6d9ed31a366f63840ccb7c55f002d263b
15796d4 build: warn on self-assignment (Cory Fields)
53372f2 refactor: disable self-assign warning for tests (Cory Fields)

Pull request description:

  Belt-and suspenders after bitcoin#30234. Self-assignment should be safe _and_ discouraged.

  We used to opt out of this warning because something deep in our serialization/byteswapping code could self-assign, but that doesn't appear to be the case anymore.

ACKs for top commit:
  maflcko:
    ACK 15796d4
  fanquake:
    ACK 15796d4 - not a huge fan of inline pragma usage, but this seems fine, given it's to work around an already-fixed compiler bug, and we'll only be carrying it for a shortish time in any case.

Tree-SHA512: 1f95f7c730b974ad1da55ebd381040bac312f2f380fff9d569ebab91d7c1963592a84d1613d81d96238c6f5a66aa40deebba68a76f6b24b02150d0a77c769654
@PastaPastaPasta PastaPastaPasta force-pushed the develop-trivial-2025-05-08 branch from a01c313 to 6dfb41e Compare May 15, 2025 01:39
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK 6dfb41e

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK 6dfb41e

@PastaPastaPasta PastaPastaPasta merged commit 1cf6a67 into dashpay:develop May 19, 2025
36 checks passed
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.

6 participants