backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 27944#7091
backport: Merge bitcoin/bitcoin#28644, gui#765 , 28184, 27944#7091vijaydasmp wants to merge 4 commits intodashpay:developfrom
Conversation
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
2904f22 to
1a61563
Compare
343e254 to
1bf441f
Compare
2aa6e19 to
0ebc185
Compare
0ebc185 to
8ac187e
Compare
|
This pull request has conflicts, please rebase. |
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
8ac187e to
6b3af01
Compare
…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
6b3af01 to
5d091d3
Compare
WalkthroughThe pull request contains changes across the Qt GUI layer, functional tests, and configuration scripts. In the main functional change, Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
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
eventsis never populated, so Line 136 will always fail.Line 136 asserts
len(events) == BLOCKS_EXPECTED, buthandle_blockconnected()never appends toevents. 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 | 🔴 CriticalUse
thisas connection context for wallet actions instead of null m_wallet_controller.
createActions()executes during construction (line 157) whenm_wallet_controlleris stillnullptr(initialized at line 122). Usingnullptras 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_controllerwiththisas the context object and add null checks inside each lambda, as the suggested fix shows. This ensures wallet actions are properly lifecycle-managed throughBitcoinGUI.🤖 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
📒 Files selected for processing (6)
src/qt/bitcoingui.cpptest/functional/interface_usdt_net.pytest/functional/interface_usdt_utxocache.pytest/functional/interface_usdt_validation.pytest/fuzz/test_runner.pytest/lint/lint-python.py
Bitcoin Backporting work