fix(blackbox): show live durable sync progress - #18
Open
lupuszr wants to merge 1 commit into
Open
Conversation
lupuszr
marked this pull request as ready for review
August 11, 2026 12:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Blackbox dashboard sync reporting so it follows the durable parent snapshot across retries, fallback catch-up, and bounded exact-repair work.
The dashboard now:
current / expecteddurable checkpoint while DKG fallback catch-up is runningrunningandwaitingtransitionsupdatingwhile verified graph recovery is activeUser-visible problem
The node could be receiving and checkpointing millions of graph triples while the dashboard continued to show only the cached verified-threat count. During exact recovery, the panel could also switch from the multi-million-triple parent snapshot to a small bounded window such as
11,000 / 11,000and incorrectly render Finalizing verified snapshot.Observed symptoms included:
100%snapshot completionThe verified cache remained usable throughout; this PR fixes the monitoring/state-composition layer rather than changing DKG transport or storage behavior.
Root causes
graph-statusmerged durable log progress only when the source-pinned Blackbox transfer hadstatus=running.0 -> positivewindow as a replacement snapshot, even when the entire child window was already behind the incomplete parent prefix.waitingstate writes did not retain all durable progress fields.Sequence: failure before this change
sequenceDiagram participant CLI as Blackbox source-pinned sync participant DKG as Managed DKG daemon participant State as Blackbox sync state participant UI as Dashboard CLI->>DKG: Start curator-pinned catch-up DKG-->>CLI: Transport closes or request deadline fires CLI->>State: Persist failed source-pinned result Note over DKG: Native durable catch-up keeps running DKG->>DKG: Advance safe checkpoint UI->>State: Read old failed result UI-->>UI: Show stale cached count or failureSequence: live progress composition after this change
sequenceDiagram participant UI as Blackbox dashboard participant State as Blackbox sync state participant DKG as DKG catch-up status participant Log as Durable progress log participant Merge as Activity-state merger UI->>State: Read persisted source-pinned result UI->>DKG: Read current fallback catch-up job UI->>Log: Read parent snapshot checkpoint UI->>Merge: Compose authoritative, catch-up, and durable state alt source-pinned request is running Merge->>Merge: Merge durable checkpoint monotonically else fallback DKG catch-up is running Merge->>Merge: Preserve diagnostic failure separately Merge->>Merge: Render replacement job as active end Merge-->>UI: current, expected, percent, updating healthThe persisted authoritative result is not rewritten for presentation. It remains available under
sync_progress.authoritative; only the activity view is synthesized from the newer live job.Sequence: parent snapshot versus nested exact repair
sequenceDiagram participant DKG as DKG durable sync participant Log as daemon.log participant Reader as Durable progress reader participant UI as Dashboard DKG->>Log: Parent checkpoint 169,332 / 6,357,721 DKG->>Log: Exact repair 11,000 / 11,000 Reader->>Reader: Compare child expected with parent received prefix alt child fits entirely behind incomplete parent prefix Reader->>Reader: Keep parent snapshot active Reader-->>UI: 169,332 / 6,357,721 else manifest is a genuine replacement Reader->>Reader: Start the new progress window Reader-->>UI: New current / expected endBehavioral invariants
100%result.Implementation
dashboard/server.pydkg_progress.pysync_state.pyrunning/waitingtransitionsValidation
Live verification on the Blackbox-owned node:
225,184 / 6,357,721, then385,826 / 6,357,7213.5%to6.1%11,000 / 11,000exact repair no longer replaced the parent progress barScope and review focus
This PR changes five Blackbox dashboard/progress files only. It does not change DKG runtime code, node configuration, sync concurrency, installers, storage, or transport timeouts.
Suggested review focus:
running/waitingprogress preservation covers every active transition without retaining terminal state accidentally