Repository navigation
backport: bitcoin#30355, bitcoin#30697, bitcoin#28979, bitcoin#29586 - #8173
DCG-Claude wants to merge 4 commits into
Conversation
Maintainer controlsTick a box; backportsys acts within a few minutes, then clears it. For other requests, leave a review comment.
Hands off persists after its box clears: no automated branch updates until operator release (not tracker Release hold). Close abandons the batch and releases its items. Review confidence🟢 4/5 overall (3 at 5/5, 1 at 4/5). How sure the system is that each commit is exactly right, so how much review it needs: 5 clean or plainly correct, a glance · 4 small adaptations, check the noted spots · 3 real judgment calls, review them · 2 substantial or risky, review in full · 1 not checked, or the system doubts it. The independent reviewer gives the score; a failed check or an open decision below caps it. Below 5 the cause of concern says why. The adapting lane's explanations are in the PR description and each commit body.
Needs maintainer inputNothing. Reviewing means checking the differences listed above. Fork gate: thepastaclaw#142 at d58c507 (CI pending). |
|
No actionable comments were generated in the recent review. WalkthroughThe chain interface now supports callback-based settings updates, overwrite, and deletion. Wallet setting additions and removals use the callback API, and a test covers concurrent changes. Functional tests cover sendall spending unconfirmed funds. The default-wallet migration test checks its backup file and path. SQLite statement traces use the WALLETDB trace logger. Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant WalletSettingCaller
participant Chain
participant ChainImpl
participant SettingsFile
WalletSettingCaller->>Chain: updateRwSetting with callback
Chain->>ChainImpl: invoke update callback
ChainImpl->>ChainImpl: mutate setting under lock
ChainImpl->>SettingsFile: write unless action is SKIP_WRITE
Merge Risk:
|
|
🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.
Commit d58c507. Normal review starts when eligible; priority review starts as soon as a slot is available. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The atomic wallet-settings backport introduces a real null-entry bug: removing a wallet that is absent from the startup list inserts a null wallet setting, which can later be persisted and then consumed as a wallet name during startup. The ancestor-aware sendall implementation and test omissions are explicitly documented adaptations for the unavailable MiniMiner dependency and are not actionable findings. CI shows no completed code-check failures; remaining build checks are pending, and the milestone failure is a policy check unrelated to the code.
🔴 1 blocking
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: backport-reviewer); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: backport-reviewer); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The backport includes wallet sendall coin-selection behavior, wallet migration backup handling, and wallet settings atomicity changes, but the diff is a set of scoped upstream changes rather than a large or intricate new change meeting the critical-surface bar. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `src/node/interfaces.cpp`:
- [BLOCKING] src/node/interfaces.cpp:1734-1737: Do not insert a null setting for no-op updates
When `name` is absent, `settings.rw_settings[name]` creates a null `SettingsValue` before the callback runs. `RemoveWalletSetting` receives that null value, returns `SKIP_WRITE` because it is not an array, and leaves the null entry in the in-memory settings map. Although that call does not immediately write the file, any later settings write serializes the entry as `"wallet": null`; on the next startup, `getSettingsList("wallet")` returns the null value and `VerifyWallets` calls `get_str()` on it. The update path must operate on a temporary value for absent keys and erase an existing value if the callback leaves it null, inserting a new key only when the callback produces a non-null value.
| auto* ptr_value = common::FindKey(settings.rw_settings, name); | ||
| // Create value if it doesn't exist | ||
| auto& value = ptr_value ? *ptr_value : settings.rw_settings[name]; | ||
| action = update_settings_func(value); |
There was a problem hiding this comment.
🔴 Blocking: Do not insert a null setting for no-op updates
When name is absent, settings.rw_settings[name] creates a null SettingsValue before the callback runs. RemoveWalletSetting receives that null value, returns SKIP_WRITE because it is not an array, and leaves the null entry in the in-memory settings map. Although that call does not immediately write the file, any later settings write serializes the entry as "wallet": null; on the next startup, getSettingsList("wallet") returns the null value and VerifyWallets calls get_str() on it. The update path must operate on a temporary value for absent keys and erase an existing value if the callback leaves it null, inserting a new key only when the callback produces a non-null value.
| auto* ptr_value = common::FindKey(settings.rw_settings, name); | |
| // Create value if it doesn't exist | |
| auto& value = ptr_value ? *ptr_value : settings.rw_settings[name]; | |
| action = update_settings_func(value); | |
| if (auto* value = common::FindKey(settings.rw_settings, name)) { | |
| action = update_settings_func(*value); | |
| if (value->isNull()) settings.rw_settings.erase(name); | |
| } else { | |
| common::SettingsValue new_value; | |
| action = update_settings_func(new_value); | |
| if (!new_value.isNull()) settings.rw_settings[name] = std::move(new_value); | |
| } |
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
This hunk matches upstream bitcoin#30697 exactly. The suggested change is upstream commit df60199 from bitcoin#30828, which also changes src/interfaces/chain.h, so it belongs in a backport of bitcoin#30828 and not in this commit.
🤖 backportsys, on behalf of the Dash backport pipeline.
There was a problem hiding this comment.
Matching upstream bitcoin#30697 does not make this implementation safe; the regression is introduced by this backport's new absent-key handling. In the existing RemoveWalletSetting caller, an absent wallet setting remains a null map entry because the callback returns SKIP_WRITE, and a later unrelated settings write persists that null value. The mention of bitcoin#30828 confirms this was fixed upstream later, but it does not resolve the defect in this commit.
|
The 🤖 backportsys, on behalf of the Dash backport pipeline. |
This external status context came with no log and names no file, test or diff hunk, so there is nothing on this branch to fix; a rerun or the bot's own output is needed if it points at something concrete. 🤖 backportsys, on behalf of the Dash backport pipeline. |
The only failure is a ThreadSanitizer data race in dashbls/runtest, inside the vendored mimalloc allocator (mi_tld_free vs _mi_meta_free), with no wallet frames; this branch touches nothing under src/dashbls. Develop commit 84f36b2 ('test: suppress TSan races reported inside mimalloc') adds the race:dashbls/depends/mimalloc/ suppression for exactly this stack, and the branch base b46c5d1 predates it, so rebasing onto develop fixes it. This branch is based on 🤖 backportsys, on behalf of the Dash backport pipeline. |
…t trace level 46819f5 wallet: use LogTrace for walletdb log messages at trace level (Anthony Towns) Pull request description: Wallet sqlite logging is enabled by `-debug=walletdb -loglevel=walletdb:trace` however the actual log messages are sent at `BCLog::Level::Info`. Switch to the trace level to make this consistent. This adds `[walletdb:trace]` to the log output, eg: ``` [httpworker.3] [wallet/sqlite.cpp:55] [TraceSqlCallback] [/tmp/bitcoin_func_test_4fsnatpg/node0/regtest/wallets/boring/wallet.dat] SQLite Statement: BEGIN EXCLUSIVE TRANSACTION ``` becomes ``` [httpworker.0] [wallet/sqlite.cpp:55] [TraceSqlCallback] [walletdb:trace] [/tmp/bitcoin_func_test_9lcwth4z/node0/regtest/wallets/boring/wallet.dat] SQLite Statement: BEGIN EXCLUSIVE TRANSACTION ``` ACKs for top commit: maflcko: ACK 46819f5 ryanofsky: Code review ACK 46819f5. Nice catch! furszy: ACK 46819f5 luke-jr: utACK 46819f5 Tree-SHA512: 6fc1bc63c2ee686d4ca8f4f558f06c0cd9e7813b5fce1588351f55ef8bedfc23c97ea443e54a6a447008fa79ea022b6d631cb010929932f1db23fa8e255e6482
…tes from Chain Interface 1b41d45 wallet: bugfix: ensure atomicity in settings updates (ismaelsadeeq) Pull request description: This PR fixes bitcoin#30620. As outlined in the issue, creating two wallets with `load_on_startup=true` simultaneously results in only one wallet being added to the startup file. The current issue arises because the wallet settings update process involves: 1. Obtaining the settings value while acquiring the settings lock. 2. Modifying the settings value. 3. Overwriting the settings value while acquiring the settings lock again. This sequence is not thread-safe. Different threads could modify the same base value simultaneously, overwriting data from other workers without realizing it. The PR attempts to fix this by modifying the chain interface's `updateRwSetting` method to accept a function that will be called with the settings reference. This function will either update or delete the setting and return an enum indicating whether the settings need to be overwritten in this or not. Additionally, this PR introduces two new methods to the chain interface: - `overwriteRwSetting`: This method replaces the setting with a new value. Used in `VerifyWallets` - `deleteRwSettings`: This method completely erases a specified setting. This method is currently used only in `overwriteRwSetting`. These changes ensure that updates are race-free across all clients. ACKs for top commit: achow101: ACK 1b41d45 furszy: self-code-ACK bitcoin@1b41d45 Tree-SHA512: 50cda612b782aeb5e03e2cf63cc44779a013de1c535b883b57af4de22f24b0de80b4edecbcda235413baec0a12bdf0e5750fb6731c9e67d32e742d8c63f08c13
…ior around unconfirmed inputs 71aae72 test: test sendall does ancestor aware funding (ishaanam) 3675794 wallet, rpc: implement ancestor aware funding for sendall (ishaanam) 544131f rpc, test: test sendall spends unconfirmed change and unconfirmed inputs when specified (ishaanam) Pull request description: This PR: - Adds a functional test that `sendall` spends unconfirmed change - Adds a functional test that `sendall` spends regular unconfirmed inputs when specified by user - Adds ancestor aware funding to `sendall` by using `calculateCombinedBumpFee` and adjusting the effective value accordingly - Adds a functional test for ancestor aware funding in `sendall` ACKs for top commit: S3RK: ACK 71aae72 achow101: ACK 71aae72 furszy: ACK 71aae72 Tree-SHA512: acaeb7c65166ce53123a1d6cb5012197202246acc02ef9f37a28154cc93afdbd77c25e840ab79bdc7e0b88904014a43ab1ddea79d5337dc310ea210634ab61f0 Dash adaptations: - src/wallet/rpc/spend.cpp: takes only the sendall help-text update; the bump-fee change to effective_value is left out because Dash declined bitcoin#26152 - test/functional/wallet_sendall.py: leaves out sendall_does_ancestor_aware_funding and its call in run_test, since it only tests the omitted bump-fee change Not applicable to Dash (intentionally omitted): - src/wallet/rpc/spend.cpp: Builds outpoints_spent and subtracts chain().calculateCombinedBumpFee(), a MiniMiner interface from bitcoin#26152, which Dash declined - test/functional/wallet_sendall.py: sendall_does_ancestor_aware_funding checks ancestor bump fees, which Dash does not have without bitcoin#26152
…nient backup filename a951dba wallet: default wallet migration, modify inconvenient backup filename (furszy) Pull request description: Fixes bitcoin#29584 On default legacy wallets, the backup filename starts with an "-" due to the wallet name being empty. This is inconvenient for systems who treat what follows the initial "-" character as flags. Note: As the user can freely set the wallet name to anything, we could also guard the backup filename against other inconvenient characters in the future (we need to be careful here, because the wallet name could also be a path). ACKs for top commit: achow101: ACK a951dba brunoerg: utACK a951dba vasild: ACK a951dba Tree-SHA512: 6347bb12cfb50526a4baad96e4f1df9d82b493f79f0a0f7e0a1c8335a86a1e8e147c7b7f95cec6ede6f4507506a7eaf7972bd35131a2d5ed4cbbf38d94f0a9ca Dash adaptations: - src/wallet/wallet.cpp: no change; Dash already names the unnamed wallet's backup default_wallet_<time>.legacy.bak (MigrationPrefixName + basename reduction from its bitcoin#34156 backport) - test/functional/wallet_migration.py: takes the backup timestamp from the framework's self.mocktime instead of int(time.time()); the file doesn't import time and nearby tests use mocktime
04949e4 to
d58c507
Compare
Issue being fixed or feature implemented
Backports 4 Bitcoin Core v0.28 pull request(s) to Dash.
What was done?
wallet, rpc: document and update
sendallbehavior around unconfirmed inputs bitcoin/bitcoin#28979 — wallet, rpc: document and updatesendallbehavior around unconfirmed inputs.Upstream: wallet, rpc: document and update
sendallbehavior around unconfirmed inputs bitcoin/bitcoin#28979 (merge e54c392). Dash commit: 1973a57.Backports wallet, rpc: document and update
sendallbehavior around unconfirmed inputs bitcoin/bitcoin#28979's sendall help-text update and its two functional tests for spending unconfirmed change and user-specified unconfirmed inputs. The ancestor-aware bump-fee adjustment and its test are left out because they depend on calculateCombinedBumpFee from Bump unconfirmed ancestor transactions to target feerate bitcoin/bitcoin#26152 (MiniMiner), which Dash has declined.Dash adaptations:
Not applicable to Dash (intentionally omitted):
wallet: use LogTrace for walletdb log messages at trace level bitcoin/bitcoin#30355 — wallet: use LogTrace for walletdb log messages at trace level.
Upstream: wallet: use LogTrace for walletdb log messages at trace level bitcoin/bitcoin#30355 (merge e53a3fb). Dash commit: faee448.
clean cherry-pick
Bugfix: Ensure Atomicity in Wallet Settings Updates from Chain Interface bitcoin/bitcoin#30697 — Bugfix: Ensure Atomicity in Wallet Settings Updates from Chain Interface.
Upstream: Bugfix: Ensure Atomicity in Wallet Settings Updates from Chain Interface bitcoin/bitcoin#30697 (merge 78567b0). Dash commit: 1d85de3.
clean cherry-pick
wallet: default wallet migration, modify inconvenient backup filename bitcoin/bitcoin#29586 — wallet: default wallet migration, modify inconvenient backup filename.
Upstream: wallet: default wallet migration, modify inconvenient backup filename bitcoin/bitcoin#29586 (merge b4a0575). Dash commit: d58c507.
Backports wallet: default wallet migration, modify inconvenient backup filename bitcoin/bitcoin#29586: Dash already names an unnamed legacy wallet's migration backup default_wallet_‹time›.legacy.bak thanks to its earlier wallet: fix unnamed legacy wallet migration failure bitcoin/bitcoin#34156 backport, so only upstream's test assertions are added. The test takes the backup timestamp from the framework's mocktime instead of time.time().
Dash adaptations:
How Has This Been Tested?
sendallbehavior around unconfirmed inputs bitcoin/bitcoin#28979 at 1973a57: Local build: pass — 8s; Selected tests: pass — 76s; Independent verification: pass.Breaking Changes
None beyond the upstream changes themselves.
Checklist: