Skip to content

backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 27944#7091

Open
vijaydasmp wants to merge 4 commits intodashpay:developfrom
vijaydasmp:Jan_2026_5
Open

backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 27944#7091
vijaydasmp wants to merge 4 commits intodashpay:developfrom
vijaydasmp:Jan_2026_5

Conversation

@vijaydasmp
Copy link

Bitcoin Backporting work

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@vijaydasmp vijaydasmp force-pushed the Jan_2026_5 branch 2 times, most recently from 2904f22 to 1a61563 Compare January 7, 2026 08:27
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin/bitcoin#28644, 24957, gui#757, gui#765 backport: Merge bitcoin/bitcoin#28644, gui#765 Jan 7, 2026
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin/bitcoin#28644, gui#765 backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 28542, 28450, 27944, 25284 Jan 8, 2026
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 28542, 28450, 27944, 25284 backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 28542, 28450, 27944 Jan 8, 2026
@vijaydasmp vijaydasmp force-pushed the Jan_2026_5 branch 3 times, most recently from 343e254 to 1bf441f Compare January 10, 2026 14:19
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 28542, 28450, 27944 backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 28450 Jan 10, 2026
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 28450 backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 27944 Jan 10, 2026
@vijaydasmp vijaydasmp force-pushed the Jan_2026_5 branch 3 times, most recently from 2aa6e19 to 0ebc185 Compare January 29, 2026 16:21
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

This pull request has conflicts, please rebase.

fanquake and others added 3 commits February 26, 2026 08:04
faa190b test: Fuzz merge with -use_value_profile=0 for now (MarcoFalke)

Pull request description:

  Seems odd that this has to be done, but for now there are (unknown) size limits on the qa-assets repo. Also, a larger size means that cloning and iterating over the files takes a longer time.

  Not sure how to measure the net impact of this, but with some backups reverting this commit, it can be limited on the downside?

ACKs for top commit:
  dergoegge:
    ACK faa190b

Tree-SHA512: 9f8b3f4526f60e4ff6fca97859a725d145a8339c216bd15c92fad7e53f84308745fee47727527de459c0245ef9d474a9dc836fee599ab2b556b519bd900b9a33
8b6470a gui: disable top bar menu actions during shutdown (furszy)
7066e89 gui: provide wallet controller context to wallet actions (furszy)

Pull request description:

  Small follow-up to dashpay#751.

  Fixes another crash cause during shutdown. Which occurs when the user hovers over the wallets list.

  Future Note:
  This surely happen in other places as well, we should re-work the way we connect signals. Register
  lambas without any precaution can leave dangling pointers.

ACKs for top commit:
  hebasto:
    ACK 8b6470a, I've tested each commit separately on macOS Sonoma 14.0 (Apple M1).

Tree-SHA512: 6fbd1bcd6717a8c1633beb9371463ed22422f929cccf9b791ee292c5364134c501e099329cf77a06b74a84c64c1c3d22539199ec49ccd74b3950036316c0dab3
f904777 lint: fix custom mypy cache dir setting (Fabian Jahr)

Pull request description:

  fixes bitcoin#28183

  The custom cache dir for `mypy` can only be set via an environment variable, setting the `MYPY_CACHE_DIR` variable in the program is not sufficient. This error was introduced while translating the shell script to python.

  See also the mypy documentation: https://mypy.readthedocs.io/en/stable/config_file.html#confval-cache_dir

ACKs for top commit:
  MarcoFalke:
    lgtm ACK f904777

Tree-SHA512: 7e8fb0cd06688129bd46d1afb8647262eb53d0f60b1ef6f288fedaa122d906fb62c9855e8bb0d6c6297d41a87a47d3cec7a00df55a7d033947937dfe23d07ba7
…31 follow-ups)

9f55773 test: refactor: usdt_mempool: store all events (stickies-v)
bc43270 test: refactor: remove unnecessary nonlocal (stickies-v)
326db63 test: log sanity check assertion failures (stickies-v)
f5525ad test: store utxocache events (stickies-v)
f1b99ac test: refactor: deduplicate handle_utxocache_* logic (stickies-v)
ad90ba3 test: refactor:  rename inbound to is_inbound (stickies-v)
afc0224 test: refactor: remove unnecessary blocks_checked counter (stickies-v)

Pull request description:

  Various cleanups to the USDT functional tests, largely (but not exclusively) follow-ups to bitcoin#27831 (review). Except for slightly different logging behaviour in "test: store utxocache events" and "test: log sanity check assertion failures", this is a refactor PR, removing unnecessary code and (imo) making it more readable and maintainable.

  The rationale for each change is in the corresponding commit message.

  Note: except for "test: store utxocache events" (which relies on its parent, and I separated into two commits because we may want the parent but not the child), all commits are stand-alone and I'm okay with dropping one/multiple commits if they turn out to be controversial or undesired.

ACKs for top commit:
  0xB10C:
    ACK 9f55773. Reviewed the code and ran the USDT interface tests. I stepped through the commits and think all changes are reasonable.

Tree-SHA512: 6c37a0265b6c26d4f9552a056a690b8f86f7304bd33b4419febd8b17369cf6af799cb87c16df35d0c2a1b839ad31de24661d4384eafa88816c2051c522fd3bf5
@vijaydasmp vijaydasmp marked this pull request as ready for review February 26, 2026 11:26
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Walkthrough

The pull request contains changes across the Qt GUI layer, functional tests, and configuration scripts. In the main functional change, bitcoingui.cpp refactors wallet-related action bindings to route through a WalletController instance instead of inline lambdas, centralizing wallet lifecycle management. Additional UI shutdown handling logic is introduced for menu clearing during client shutdown. The functional tests are refactored to accumulate actual events and compare them against expected events post-execution rather than asserting within callbacks. Configuration updates include disabling value profiling in the fuzzing merge workflow and adjusting the mypy cache directory path to use a relative path from the repository root.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title references specific upstream PR numbers (bitcoin#28644, gui#765, 28184, 27944) and matches the commit summaries showing actual backporting of GUI wallet controller routing, fuzzing profile changes, mypy cache handling, and test refactoring work.
Description check ✅ Passed The description 'Bitcoin Backporting work' is minimal but directly relevant to the changeset, which consists entirely of backporting commits from upstream Bitcoin projects as indicated by the title and commit messages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
test/functional/interface_usdt_validation.py (1)

99-137: ⚠️ Potential issue | 🔴 Critical

events is never populated, so Line 136 will always fail.

Line 136 asserts len(events) == BLOCKS_EXPECTED, but handle_blockconnected() never appends to events. This makes the test fail even when tracepoints are correct.

Suggested fix
 def handle_blockconnected(_, data, __):
     event = ctypes.cast(data, ctypes.POINTER(Block)).contents
     self.log.info(f"handle_blockconnected(): {event}")
-    block_hash = bytes(event.hash[::-1]).hex()
-    block = expected_blocks[block_hash]
-    assert_equal(block["hash"], block_hash)
-    assert_equal(block["height"], event.height)
-    assert_equal(len(block["tx"]), event.transactions)
-    assert_equal(len([tx["vin"] for tx in block["tx"]]), event.inputs)
-    assert_equal(0, event.sigops)  # no sigops in coinbase tx
-    # only plausibility checks
-    assert event.duration > 0
-    del expected_blocks[block_hash]
+    events.append(event)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/functional/interface_usdt_validation.py` around lines 99 - 137, The test
fails because the events list is never populated; initialize a shared list
(e.g., events = []) before defining handle_blockconnected and append the
received event (or a lightweight copy of it) inside handle_blockconnected (the
callback registered via
bpf["block_connected"].open_perf_buffer(handle_blockconnected)); ensure you
append the same event object shape expected later (the variable named event used
in the later loop) so the final assertions and len(events) == BLOCKS_EXPECTED
succeed.
src/qt/bitcoingui.cpp (1)

555-620: ⚠️ Potential issue | 🔴 Critical

Use this as connection context for wallet actions instead of null m_wallet_controller.

createActions() executes during construction (line 157) when m_wallet_controller is still nullptr (initialized at line 122). Using nullptr as the Qt::connect context object on lines 555, 583, 609, 612, 618 bypasses Qt's automatic signal-slot lifecycle management. When the context object is null, Qt cannot properly manage connection cleanup, creating a resource management issue.

Replace m_wallet_controller with this as the context object and add null checks inside each lambda, as the suggested fix shows. This ensures wallet actions are properly lifecycle-managed through BitcoinGUI.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/qt/bitcoingui.cpp` around lines 555 - 620, The connect calls for
wallet-related actions (the QMenu aboutToShow lambda using
m_wallet_controller->listWalletDir(), and the triggered handlers for
m_restore_wallet_action/CreateWalletActivity/RestoreWalletActivity/CloseWalletActivity/closeAllWallets
via m_close_wallet_action, m_create_wallet_action, m_close_all_wallets_action)
currently use m_wallet_controller as the connection context even though it can
be nullptr during construction; change the context argument in these
connect(...) calls from m_wallet_controller to this, and inside each lambda add
a guard that returns early if m_wallet_controller is nullptr before calling
methods like m_wallet_controller->listWalletDir(), creating activities that take
m_wallet_controller, or calling
m_wallet_controller->closeWallet()/closeAllWallets(); this preserves Qt's
automatic connection cleanup while avoiding dereferencing a null
m_wallet_controller.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/qt/bitcoingui.cpp`:
- Around line 555-620: The connect calls for wallet-related actions (the QMenu
aboutToShow lambda using m_wallet_controller->listWalletDir(), and the triggered
handlers for
m_restore_wallet_action/CreateWalletActivity/RestoreWalletActivity/CloseWalletActivity/closeAllWallets
via m_close_wallet_action, m_create_wallet_action, m_close_all_wallets_action)
currently use m_wallet_controller as the connection context even though it can
be nullptr during construction; change the context argument in these
connect(...) calls from m_wallet_controller to this, and inside each lambda add
a guard that returns early if m_wallet_controller is nullptr before calling
methods like m_wallet_controller->listWalletDir(), creating activities that take
m_wallet_controller, or calling
m_wallet_controller->closeWallet()/closeAllWallets(); this preserves Qt's
automatic connection cleanup while avoiding dereferencing a null
m_wallet_controller.

In `@test/functional/interface_usdt_validation.py`:
- Around line 99-137: The test fails because the events list is never populated;
initialize a shared list (e.g., events = []) before defining
handle_blockconnected and append the received event (or a lightweight copy of
it) inside handle_blockconnected (the callback registered via
bpf["block_connected"].open_perf_buffer(handle_blockconnected)); ensure you
append the same event object shape expected later (the variable named event used
in the later loop) so the final assertions and len(events) == BLOCKS_EXPECTED
succeed.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c0f42a and 5d091d3.

📒 Files selected for processing (6)
  • src/qt/bitcoingui.cpp
  • test/functional/interface_usdt_net.py
  • test/functional/interface_usdt_utxocache.py
  • test/functional/interface_usdt_validation.py
  • test/fuzz/test_runner.py
  • test/lint/lint-python.py

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.

3 participants