Repository navigation
backport: bitcoin#27556 - #7959
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. Adaptation and gatesHeavy: substantial adaptation; light: at most two invented lines (six counting functional-test/doc edits); faithful: identical to upstream apart from context. Mechanical checks compare upstream hunks, added lines and Dash-specific lines. Review warnings before merging.
Warning details
Fork gate: thepastaclaw#120 at f73e70b. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🕓 Review not started yet because the new head is waiting for the 30-minute push debounce.
Commit f73e70b. Normal review starts when eligible; priority review starts as soon as a slot is available. |
|
No actionable comments were generated in the recent review.
|
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | Check skipped because no linked issues were found for this pull request. | |
| Out of Scope Changes check | Check skipped because no linked issues were found for this pull request. | |
| Title check | The title "backport: bitcoin#27556" names the backported upstream pull request, but it does not describe the change itself. The changeset fixes a read/write deadlock in BDB wallet operations by passin… | |
| Description check | The description is directly related to the changeset. It states that it backports bitcoin#27556 and describes the BerkeleyCursor constructor change, the WalletBatch::EraseRecords transaction c… |
Full details: Title check
-
Explanation
The title "backport: bitcoin#27556" names the backported upstream pull request, but it does not describe the change itself. The changeset fixes a read/write deadlock in BDB wallet operations by passing the batch's transaction to BerkeleyCursor and running EraseRecords in a single transaction. A reader must open the upstream PR to learn what the change does. The title is therefore partially related: it refers to the real change but gives no substantive aspect of it. It is not vague or generic, and it is not off-topic.
Full details: Description check
-
Explanation
The description is directly related to the changeset. It states that it backports bitcoin#27556 and describes the BerkeleyCursor constructor change, the WalletBatch::EraseRecords transaction change, the removed DeleteRecords transaction wrapper, and the added test. It also lists the Dash-specific adaptations and the test results.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The backport is correct and preserves the required Dash adaptations. The wallet transaction and Berkeley cursor changes are consistent across both database backends, the regression test exercises the relevant paths, and the CI retry change is applied to the applicable Dash script. Current CI has build and lint checks queued or in progress, with no failed code checks in the snapshot.
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); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The change modifies wallet Berkeley DB transaction and record-erasure logic plus associated tests, making it an ordinary behavior change in a storage-sensitive subsystem, while the CI adjustment is straightforward and it does not meet the defined critical-surface threshold. - 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) - 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
Both failures come from jobs this branch doesn't touch; it changes only ci/lint/04_install.sh (bitcoin#28643) and src/wallet BDB/walletdb code plus tests (bitcoin#27556). The x86_64-apple-darwin 'Build depends' job failed configuring gmp ('could not find a working compiler' with /usr/bin/clang and the Xcode SDK) after a depends cache miss, and nothing under depends/ or .github/ changed here. In linux64_multiprocess-test, feature_llmq_simplepose.py timed out waiting for masternode quorum connections in its close_mn_port PoSe phase; earlier quorums in the same run formed fine, so the wallet DB change was working, and feature_protx_version.py failed once then passed on retry, which suggests flaky quorum/P2P timing rather than this backport. 🤖 backportsys, on behalf of the Dash backport pipeline. |
| if [ ! -d "${PYTHON_PATH}/bin" ]; then | ||
| ( | ||
| git clone https://github.com/pyenv/pyenv.git | ||
| ${CI_RETRY_EXE} git clone https://github.com/pyenv/pyenv.git |
There was a problem hiding this comment.
CI_RETRY_EXE is not used at all in dash's CI; I suggest to skip 28643 complely.
There was a problem hiding this comment.
Agreed, dropping bitcoin#28643 from this batch as you asked. Dash's CI doesn't rely on CI_RETRY_EXE, so adding it to the pyenv git clone in ci/lint/04_install.sh does nothing for Dash. Dropping bitcoin#28643 from this branch; it is being rewritten without it.
🤖 backportsys, on behalf of the Dash backport pipeline.
69d4390 test: add coverage for wallet read write db deadlock (furszy) 12daf6f walletdb: scope bdb::EraseRecords under a single db txn (furszy) 043fcb0 wallet: bugfix, GetNewCursor() misses to provide batch ptr to BerkeleyCursor (furszy) Pull request description: Decoupled from bitcoin#26644 so it can closed in favor of bitcoin#26715. Basically, with bdb, we can't make a write operation while we are traversing the db with the same db handler. These two operations are performed in different txn contexts and cause a deadlock. Added coverage by using `EraseRecords()` which is the simplest function that executes this process. To replicate it, need bdb support and drop the first commit. The test will run forever. ACKs for top commit: achow101: ACK 69d4390 hebasto: re-ACK 69d4390 Tree-SHA512: b3773be78925f674e962f4a5c54b398a9d0cfe697148c01c3ec0d68281cc5c1444b38165960d219ef3cf1a57c8ce6427f44a876275958d49bbc0808486e19d7d Dash adaptations: - src/wallet/bdb.cpp: ErasePrefix keeps Dash's raw-Dbc cursor, which already opens on activeTxn; the upstream `this`->`*this` line has no counterpart in Dash's version - src/wallet/bdb.h, src/wallet/bdb.cpp: BerkeleyCursor goes from Dash's one-argument constructor (database only) to (database, const BerkeleyBatch&) and uses batch.txn(), instead of upstream's nullable BerkeleyBatch* argument - src/wallet/test/util.h: adds #include <wallet/db.h> so DATABASE_FORMATS has DatabaseFormat; upstream already had it from the MockableDatabase change (bitcoin#26715) - src/wallet/test/walletdb_tests.cpp: legacy SPKM is set up with CanGenerateKeys() && TopUp(), since Dash has no SetupGeneration() (same idiom as Dash's walletload_tests) - src/wallet/scriptpubkeyman.cpp: DeleteRecords drops Dash's own TxnBegin/TxnCommit wrapper, because EraseRecords now opens the transaction and a second open fails
bcd1ef8 to
f73e70b
Compare
|
Branch rewritten at
🤖 backportsys, on behalf of the Dash backport pipeline. |
Issue being fixed or feature implemented
Backports 1 Bitcoin Core v0.26 pull request(s) to Dash.
What was done?
wallet: fix deadlock in bdb read write operation bitcoin/bitcoin#27556 — wallet: fix deadlock in bdb read write operation.
Upstream: wallet: fix deadlock in bdb read write operation bitcoin/bitcoin#27556 (merge 6cc136b). Dash commit: f73e70b.
Backports wallet: fix deadlock in bdb read write operation bitcoin/bitcoin#27556: BerkeleyCursor now always takes the batch so cursors use its transaction, and WalletBatch::EraseRecords runs inside a single transaction that is aborted on failure, with a test for BDB and SQLite. Dash adaptations: the ErasePrefix hunk is not needed because Dash's ErasePrefix already uses a raw cursor on the open transaction, the Dash-only transaction wrapper in DeleteRecords is removed because EraseRecords now opens its own, and the test uses TopUp() in place of SetupGe
Dash adaptations:
this-›*thisline has no counterpart in Dash's versionMockableDatabasefor wallet unit tests bitcoin/bitcoin#26715)How Has This Been Tested?
Breaking Changes
None beyond the upstream changes themselves.
Checklist: