Skip to content

backport: cherry-pick #7208, #7209, #7211, #7221, and #7222 into v23.1.x#7214

Merged
PastaPastaPasta merged 6 commits intodashpay:v23.1.xfrom
thepastaclaw:backport/v23.1.x-7208-7209
Mar 14, 2026
Merged

backport: cherry-pick #7208, #7209, #7211, #7221, and #7222 into v23.1.x#7214
PastaPastaPasta merged 6 commits intodashpay:v23.1.xfrom
thepastaclaw:backport/v23.1.x-7208-7209

Conversation

@thepastaclaw
Copy link

@thepastaclaw thepastaclaw commented Mar 12, 2026

Backport

Cherry-picks of #7208, #7209, #7211, #7221, and #7222 into v23.1.x for v23.1.2.

Included

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@thepastaclaw thepastaclaw changed the title backport: cherry-pick #7208 and #7209 into v23.1.x backport: cherry-pick #7208, #7209, and #7211 into v23.1.x Mar 12, 2026
@UdjinM6 UdjinM6 added this to the 23.1.2 milestone Mar 12, 2026
UdjinM6
UdjinM6 previously approved these changes Mar 12, 2026
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 f431bae

PastaPastaPasta added a commit that referenced this pull request Mar 14, 2026
8670238 fix: properly skip evodb repair on reindex (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  `ThreadImport` can switch `fReindex` from `true` to `false`, so we can't rely on it later.

  Consider backporting in #7214

  ## What was done?

  ## How Has This Been Tested?
  Reindex and check logs once all blocks are processed:
  develop: "RecalculateAndRepairDiffs ..."
  this PR: "Skipping evodb repair during reindex"

  ## Breaking Changes
  n/a

  ## Checklist:
  - [ ] 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)_

Top commit has no ACKs.

Tree-SHA512: d1a36800a83fc3165a49c983b527429b04dcebca22d5f880709786c40e9a61894e7a63216daa7e5a2ebd860b8f13f1e8d48e88c41cb7e4a9e6d4814648f91b4a
PastaPastaPasta added a commit that referenced this pull request Mar 14, 2026
…s to dash-util

c9af781 refactor: rename bitcoin-util manpage and test references to dash-util (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Rename bitcoin-util.1 placeholder to dash-util.1 with regenerated content for v23.1.2. Update Makefile.am, test config, and test framework to use dash-util naming consistently. The original bitcoin-util references were missed during the backport in #7054.

  Consider backporting in #7214

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes
  n/a

  ## Checklist:
  - [ ] 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)_

Top commit has no ACKs.

Tree-SHA512: 9218d5812f5272167a6a705c04cf85a0be236bd2e0a1217a3b706dad4759ab4f45c61fb2d3a9044b247a181b1c1019305acee217d3710b86e9a182a1e1eec83e
…event unbounded memory growth

c3a552a fix(chainlock): skip collecting block txids during IBD to prevent unbounded memory growth (PastaClaw)

Pull request description:

  ## Motivation

  `ChainLockSigner` is registered as a `CValidationInterface` and receives `BlockConnected` events during initial block download. It stores all non-coinbase txids for every connected block in `blockTxs`, but `Cleanup()` skips pruning while `!IsBlockchainSynced()`. This causes `blockTxs` to grow with the entire chain's transaction IDs during IBD/reindex, leading to unbounded memory growth.

  Since `TrySignChainTip()` already returns early when `!IsBlockchainSynced()`, the collected txids are never used during IBD — they just accumulate until sync completes.

  ## Fix

  Add the same `!IsBlockchainSynced()` guard to `BlockConnected()` that already exists in `TrySignChainTip()` and `Cleanup()`, skipping txid collection entirely during IBD.

  ## Validation

  - Traced `TrySignChainTip()` — confirms it early-returns when not synced, so txids collected during IBD are never consumed
  - Traced `Cleanup()` — confirms it also early-returns when not synced, so no pruning happens during IBD
  - Traced `GetBlockTxs()` — has a fallback path that reads from disk when txids aren't in `blockTxs`, so post-sync tip signing still works for blocks connected during IBD
  - `BlockDisconnected` only handles reorgs (erases single entry), not bulk cleanup

  ## Checklist

  - [x] I have performed a self-review of my own code
  - [x] 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

ACKs for top commit:
  UdjinM6:
    utACK c3a552a

Tree-SHA512: d395d33ff8c9d4f2539b8ab3fb14adafc732ff7b3a5cccc83efa390615926ea920e7d50490080ace39812960f04439b4387784a0ffa1d7c12f1e69434b3f336c
…ent signing race

881bbce fix(chainlock): serialize TrySignChainTip to prevent concurrent signing race (PastaClaw)

Pull request description:

  ## Motivation

  `TrySignChainTip()` can be called concurrently from two independent threads:

  1. The signer's own `m_scheduler` thread (every 5 seconds, via `Start()`)
  2. The `CValidationInterface` scheduler thread (via `UpdatedBlockTip()`)

  The function only briefly locks `cs_signer` around the `lastSignedHeight` check, then releases it to perform chain tip reads, IS lock checks, and eventually calls `AsyncSignIfMember` — only re-acquiring `cs_signer` to update `lastSignedHeight`/`lastSignedRequestId`/`lastSignedMsgHash` right before signing.

  Under competing tips (short reorg between the two reads of `m_chainstate.m_chain.Tip()`), two concurrent calls can both pass the height check with different tips and issue `AsyncSignIfMember` with different block hashes for the same height-based `requestId`. This splits signing shares across different messages and can prevent a chainlock from forming.

  ## Fix

  Add a dedicated `cs_try_sign` mutex that serializes the entire `TrySignChainTip()` function. This ensures only one thread evaluates and signs a tip at a time.

  Lock ordering: `cs_try_sign` → `cs_main` → `cs_signer` (no deadlock risk as `cs_try_sign` is only acquired at `TrySignChainTip` entry).

  ## Validation

  - Confirmed the signer's scheduler and `CValidationInterface` scheduler are independent threads with no cross-synchronization for `TrySignChainTip`
  - The handler's `tryLockChainTipScheduled` atomic only serializes within the handler scheduler, not across the signer scheduler
  - Verified lock ordering: `cs_try_sign` is always acquired first, no other code path acquires it, so no deadlock possible
  - Thread safety annotations updated on both `TrySignChainTip()` and `UpdatedBlockTip()` declarations

  ## Checklist

  - [x] I have performed a self-review of my own code
  - [x] 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

ACKs for top commit:
  PastaPastaPasta:
    utACK 881bbce
  UdjinM6:
    utACK 881bbce

Tree-SHA512: b7746f0bf12063702e7ebfa60262b8e4a750472efe1bf6e06d9e7daf440d5e53fd67292f0191f016aeb3e6eed775b68b632c0f482bae831e44e1629639ec6d34
c1f9135 fix(qt): eliminate Governance tab margin mismatch causing jiggle (pasta)
6cf7259 fix(qt): consolidate Network tab layout into two-column grid (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  - The Network sub-tab in the Information page had a broken layout: ChainLocks was stranded in a separate bottom grid, leaving a large dead-space gap below Masternodes.
  - Switching between the General/Network and Governance sub-tabs caused visible text "jiggle" because the Governance grid had double margins (its `leftPanel` wrapper added an extra layer of default ~9px margins).

  Before:
  <img width="2168" height="1397" alt="Screenshot 2026-03-11 at 23 50 00" src="proxy.php?url=https://github.com/user-attachments/assets/f90d6b87-6b75-4df3-8119-d1cdaabcd93b" />

  After:
  <img width="2168" height="1397" alt="Screenshot 2026-03-11 at 23 48 28" src="proxy.php?url=https://github.com/user-attachments/assets/87c39596-dbb6-4e03-b0de-deb200c300b1" />

  ## What was done?
  - **Commit 1**: Moved ChainLocks from a standalone `bottomGridLayout` into the existing `leftGridLayout` (below Masternodes), creating a single continuous left column. Removed the now-unused bottom grid, its vertical spacer, and the `showEvent` override that synced column widths between the two grids.
  - **Commit 2**: Zeroed the inner `gridLayoutGovernance` margins in `proposalinfo.ui` so only the outer `QHBoxLayout` margins control spacing, matching the margin structure of the General and Network tabs.

  ## How Has This Been Tested?
  - Built `dash-qt` and visually verified:
    - Network tab: all five sections (Credit Pool, InstantSend, Masternodes, ChainLocks, Quorums) display in a clean two-column layout with no dead space.
    - Switching between General, Network, and Governance sub-tabs: labels stay aligned with no jiggle.
    - Governance tab: donut chart and left panel render correctly with consistent margins.

  ## Breaking Changes
  None.

  ## Checklist:
  - [x] 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)_

ACKs for top commit:
  UdjinM6:
    light ACK c1f9135
  kwvg:
    ACK c1f9135

Tree-SHA512: cb82986e17c940013af0fb83745a5a0078563248966acffa7abd8975ab2810bbb239179705fb291d02464c260e474344b68f50ab7a8f63c822ac1df858633e62
…ferences to dash-util

c9af781 refactor: rename bitcoin-util manpage and test references to dash-util (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Rename bitcoin-util.1 placeholder to dash-util.1 with regenerated content for v23.1.2. Update Makefile.am, test config, and test framework to use dash-util naming consistently. The original bitcoin-util references were missed during the backport in dashpay#7054.

  Consider backporting in dashpay#7214

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes
  n/a

  ## Checklist:
  - [ ] 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)_

Top commit has no ACKs.

Tree-SHA512: 9218d5812f5272167a6a705c04cf85a0be236bd2e0a1217a3b706dad4759ab4f45c61fb2d3a9044b247a181b1c1019305acee217d3710b86e9a182a1e1eec83e
8670238 fix: properly skip evodb repair on reindex (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  `ThreadImport` can switch `fReindex` from `true` to `false`, so we can't rely on it later.

  Consider backporting in dashpay#7214

  ## What was done?

  ## How Has This Been Tested?
  Reindex and check logs once all blocks are processed:
  develop: "RecalculateAndRepairDiffs ..."
  this PR: "Skipping evodb repair during reindex"

  ## Breaking Changes
  n/a

  ## Checklist:
  - [ ] 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)_

Top commit has no ACKs.

Tree-SHA512: d1a36800a83fc3165a49c983b527429b04dcebca22d5f880709786c40e9a61894e7a63216daa7e5a2ebd860b8f13f1e8d48e88c41cb7e4a9e6d4814648f91b4a
@thepastaclaw thepastaclaw force-pushed the backport/v23.1.x-7208-7209 branch from f431bae to 8a93926 Compare March 14, 2026 18:00
@thepastaclaw thepastaclaw changed the title backport: cherry-pick #7208, #7209, and #7211 into v23.1.x backport: cherry-pick #7208, #7209, #7211, #7221, and #7222 into v23.1.x Mar 14, 2026
UdjinM6
UdjinM6 previously approved these changes Mar 14, 2026
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 8a93926

@UdjinM6
Copy link

UdjinM6 commented Mar 14, 2026

Should probably also include 7221 and 7222 backports into 23.1.2 release notes either here or in a separate PR.

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 da16809

@PastaPastaPasta PastaPastaPasta merged commit b564a33 into dashpay:v23.1.x Mar 14, 2026
41 of 43 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.

3 participants