qml: redesign the block clock

bitcoin-core/gui-qml: PR #994

6 minor findings · 2 suggestions

Findings

Link

[minor] · Saved dismissals survive a warning clearing across restart

A previously dismissed warning remains suppressed when it returns after a warning-free restart, because setWarnings never reconciles saved dismissals that were absent from this process's warning list.

Location: qml/models/nodemodel.cpp:684 (head).

Details and suggested fix

The constructor loads m_dismissed_warnings from QSettings, but setWarnings removes entries only by iterating the previous m_warning_list, which starts empty. An unchanged empty snapshot also returns before cleanup. For example, dismiss the clock-skew warning, fix the clock and restart without the warning, then let the condition recur. Core raises the same text, and activeWarningList filters it out again. On an otherwise synced node, the status uses its success colour and shows neither a warning banner nor the main warnings links. Node details still exposes the dismissed warning and its restore action, limiting the impact. Reconcile saved dismissals against the first authoritative snapshot, including an empty or unchanged snapshot, before the early return. Add a restart test that begins without the dismissed warning and then raises it; the existing restart test keeps both warnings present.


Link

[minor] · The oldest retained block has no dial segment

The layered renderer draws only intervals between retained timestamps, while the model discards their predecessor, so a single block in the twelve-hour window produces no block arc.

Location: qml/components/blockclockdial.cpp:732 (head).

Details and suggested fix

paintLayeredBlocks starts at i = 1 and draws from blocks[i - 1] to blocks[i]. Meanwhile, replaceBlockHistory removes every timestamp before current_time - PERIOD_SECONDS. Consequently, the interval ending at the oldest retained block is missing, and a synced dial with one retained block draws only its track, ticks and hand. The base renderer started its segments at the period origin instead. Preserve the preceding timestamp as a clipped boundary, with a marker fallback when no predecessor is available. Add layered-renderer cases for a single retained block and for an interval crossing the rolling-window boundary.


Link

[minor] · Closing Node details can freeze the visible traffic page

Using the native desktop menu to open Network Traffic while Node details remains open lets closing the popup disable updates to the newly visible page.

Location: qml/components/NodeDetailsPopup.qml:60 (head).

Details and suggested fix

When traffic is initially inactive, NodeDetailsPopup.onOpened enables it and sets ownsTrafficActivity. The native Network Traffic command remains enabled while the overlay-parented modal is open and routes to the settings page. That page writes active = true, but the popup still considers itself the owner. Closing the popup then writes active = false. The page only reasserts activity on completion or a visibility change, so its totals and graphs stop updating until it is hidden and shown again. Raw sampling continues; publication to the GUI stops. Give each consumer an activity lease or reference-counted request so closing one cannot deactivate another. Cover opening the popup, navigating through the native menu to Network Traffic, and then closing the popup.


Link

[minor] · Node details speed inherits the traffic chart's averaging window

The speed rows use receivedRateList[0], whose averaging window depends on the last traffic-chart range and can cover up to 2.4 hours after selecting one day.

Location: qml/components/NodeDetailsPopup.qml:88 (head).

Details and suggested fix

latestRate returns the first value of the tower's smoothed history. NetworkTrafficSettingsPage sets its shared filter window to scale / 10, so the one-day range selects 8,640 samples. Raw samples accumulate even while the page is inactive, and opening Node details does not reset that window. With enough history, the displayed download speed therefore averages approximately 2.4 hours at the default one-second sampling interval, obscuring recent stalls or recoveries while being labelled simply as speed. Publish a separate recent-rate property with a fixed short window for Node details, leaving chart smoothing unchanged. Test opening the popup after selecting the one-day chart range.


Link

[minor] · Host offline status hides Resume while Core is paused

When Core is paused and Qt reports the host as disconnected, the new controls offer Network settings instead of Resume, preventing users from enabling reconnection before connectivity returns.

Location: qml/components/NodeStatus.qml:87 (head).

Details and suggested fix

NodeStatus.key checks offline before paused, while primaryAction returns resume only for the paused key. Thus, after a user pauses Core and the host goes offline, both the status bar and Node details replace Resume with Network settings. That action opens connection settings rather than clearing nodeModel.pause; the RPC console remains a workaround. Keep the offline diagnostic, but offer Resume whenever Core is paused and network actions are ready, either as the primary action or as an offline-state secondary action.


Link

[minor] · Short block intervals can lose the newest segment colour

Equal timestamps are skipped, and intervals below about 7.5 seconds produce a zero arc span, so the newest block's confirmationColors[0] can be absent from the layered dial.

Location: qml/components/blockclockdial.cpp:739 (head).

Details and suggested fix

For a short interval, half_gap removes one quarter from each end. On a twelve-hour dial, the remaining span passed to drawArc rounds to zero when the timestamp separation is below about 7.5 seconds; equal timestamps hit end <= start directly. Two future-timestamped newest blocks also collapse to the current fraction and omit their interval. Since colour age is calculated from the original list index, the newest visible arc retains an older colour rather than representing the collapsed newest interval. The base renderer coalesced close boundaries instead. Fold zero or near-zero intervals into an adjacent arc and preserve the newest age. Extend layeredShortIntervalsStayVisible, which currently uses a two-minute interval, with equal timestamps and two future-timestamped newest blocks.


Optional improvements

Link

[suggestion] · Dismissing operational warnings also clears their main status indicator

Dismissing all active warnings makes an otherwise synced node use its success status and hide the main warning links, even while Core still reports a fork or clock condition.

Location: qml/components/NodeStatus.qml:69 (head).

Details and suggested fix

dismissWarnings persists any warning text, and NodeStatus derives its synced tone, banner and warning count from the filtered activeWarningList. Consequently, dismissing a clock-skew, unknown-rules or large-work invalid-chain warning removes every main-view reminder while the condition remains active. Only Node details exposes the dismissed count and restoration route. The captured discussion distinguishes a dismissible pre-release notice from operational warnings but does not settle their policy. Keep an amber status indicator or a dismissed-warning count on the main surfaces while such warnings remain active. This preserves the user's choice to hide the message without presenting that ongoing condition identically to a warning-free node.


Link

[suggestion] · Persistent warning dismissal is spread across two broader commits

The dismissal model and UI arrive in separate, broader commits, making its persistence and clear-on-recurrence behaviour harder to review together.

Location: qml/models/nodemodel.cpp:711 at 7bd72b3e9cd7 (commit) (commit).

Details and suggested fix

7bd72b3e9cd7b4dd5a8b480d837e50eefa65aa88 adds the dismissal API, QSettings persistence and model tests alongside diagnostic row IDs, directory formatting and header-height notification changes. Its UI arrives in d3c0b294d32516c522af5e1f76cd555dcd858fb1, together with the broader block-clock redesign. Consider extracting a dedicated warning-dismissal commit containing the model API, settings key, mock support, dialog controls and associated tests. Place it after the prerequisite NodeStatus UI is introduced, leaving that earlier UI on the unfiltered warning list until the feature commit. This keeps intermediate dependencies valid and the final tree unchanged while allowing persistence, recurrence, dismissal and restoration to be evaluated as one behaviour.


Coverage details

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

Pausing network activity needs a deliberate, discoverable action because users interpret clicking the block clock as requesting information, not disconnecting their node.

Issue #321 reports accidental IBD pauses, including a node left paused overnight. Issue #822 explicitly requests confirmation and suggests using the clock to open information instead. This directly explains the redesign's details-on-click behavior and separate confirmed pause action. The inspected NodeStatusBar opens a confirmation before setting pause; NodeModel retains the existing asynchronous setNetworkActive contract.

Source 1 · Source 2 · Source 3 · Source 4

The five peer dots were a compact connection-strength abstraction, but conflicted with familiar pagination and navigation conventions.

The original explanation says each dot represented 20% of the target peer count, choosing five for quickly graspable detail. Other participants interpreted the dots as swipeable pages. This establishes the tradeoff behind replacing them with explicit state and peer-count text: compact abstraction versus unambiguous meaning. NodeStatus now exposes textual peer counts and inbound/outbound details.

Source 1 · Source 2 · Source 3

Synchronization progress historically represents estimated validation work, not merely downloaded bytes or block count; absolute progress was preferred because restart-relative progress looked like starting over.

The 2015 discussion explains that transaction processing could dominate synchronization and that a useful time estimate must integrate several factors. The 2024 explanation describes transaction-count extrapolation and warns that using the best header's timestamp can be misleading during header sync. This contextualizes separate download-speed, block-height and transaction-progress displays. Importantly, the exact pinned Core formula already includes a recent-tip height-based adjustment to quantize values near completion, so the older explanation is historical rationale rather than a complete description of the current implementation.

Source 1 · Source 2

Header pre-synchronization is a genuine anti-denial-of-service phase, not redundant work or an ordinary block-download percentage.

The original proposal explains that new nodes must avoid permanently storing arbitrary low-work headers. Its two-pass approach first checks sufficient work and records commitments, then verifies the repeated headers before storage. The same change deliberately added pre-sync progress notifications and UI feedback. This explains why the redesigned clock and details retain separate header/pre-sync and block-validation presentations, rather than treating all synchronization as one homogeneous activity.

Source 1

Node warnings are an ongoing operational channel, not just a prerelease notice suitable for onboarding or an inconspicuous information button.

Issue #789 initially proposes making the prerelease warning unavoidable during onboarding. A response explains that the same channel carries runtime warnings and that already-onboarded users could miss an onboarding-only notice. Another captured comment emphasizes that fork-related warnings can affect decisions to send or accept transactions without necessarily disabling those actions. Issue #850 separately objects to hiding general warnings behind a small sub-page information button. These concerns explain the distinction between technical node details and prominent warning access in this redesign.

Source 1 · Source 2 · Source 3 · Source 4

The block clock's presentation is intentionally separated from potentially blocking backend work, with cached history, coalesced updates and explicit shutdown handling.

The prerequisite #981 explains that chain queries and other operations can block the GUI, and describes initialization-time history loading followed by notification updates, preserved block identity across reorganizations, minute-based clock updates, and worker/subscription cleanup. The redesign inherits that architecture: its model consumes cached snapshots and updates on its QObject thread rather than querying Core while rendering. Thus responsiveness and lifecycle behavior are existing integration constraints on the visual redesign.

Source 1

Ralph's inferences

A rolling twelve-hour history favors continuity across noon and midnight over displaying only the current clock half-day.

The base model filters blocks to the current noon/midnight period. The head instead retains blocks from current time minus twelve hours while preserving the local clock-face origin. Additional retained history accommodates backward clock steps without backend reads. This supports continuity and responsiveness as explanations of the implementation, but does not establish the historical reason for choosing twelve hours.

The clock is a visualization of active-chain timestamps, not a precise measurement of when this node received or observed a block.

Pinned Core returns the active tip's block timestamp; NodeStatus explicitly identifies it as miner-set rather than receipt time. The model clamps negative ages and future timestamp positions, and its contract preserves equal timestamps for distinct blocks. These choices accommodate timestamp irregularities while keeping the display meaningful. They do not make the displayed age an exact mining or receipt-time measurement.

Unresolved disagreements

The inspected warning discussion leaves tension between dismissible, context-specific notices and prominent, persistent warnings about potentially consequential chain conditions.

One participant proposes a dismissible landing-page prerelease banner and differentiated treatment by warning type; another calls fork-related warnings prominent and permanent. The current NodeModel adds persisted message-based dismissals, restoration, and removal of dismissals when an observed warning clears. The captured history does not establish an agreed policy applying dismissal uniformly across warning types. This is historical context, not a finding about the implementation.

Source 1 · Source 2