Skip to content

web(d-web): emit primary-coin tip in node_topology auto-detect fallback - #454

Merged
frstrtr merged 1 commit into
masterfrom
web/topology-fallback-primary-tip
Jun 24, 2026
Merged

web(d-web): emit primary-coin tip in node_topology auto-detect fallback#454
frstrtr merged 1 commit into
masterfrom
web/topology-fallback-primary-tip

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

The /api/node_topology auto-detect fallback (the path used when no per-coin StatsProvider hook is wired) emitted coin/primary/peers/embedded/has_rpc but never height — so the topology card front-end (PR #452) rendered the primary chain with peers but no tip on fallback nodes.

This fills the primary coin entry with the embedded daemon's REAL current block height from the cached template (m_cached_template["height"] under m_work_mutex — the same source rest_local_stats already uses), guarded > 0 to match the front-end's render guard.

Why (charter)

Charter #2: each node's dashboard must show that node's real topology, truthful and sourced from the same internal state debug.log uses. #452 surfaced synced/tip on the front-end, but the backend fallback never emitted tip — a node without the StatsProvider hook showed a less-truthful card than one with it. This closes that gap.

Scope / safety

  • Web layer only. No ICoinNode interface change → no per-coin / consensus ripple (deliberately avoided, per the BCH-enum-gap precedent).
  • synced is not added here: is_blockchain_synced() is declared-but-unimplemented, so a truthful synced flag still requires the StatsProvider hook path. Left as-is rather than emit a fabricated value.
  • Builds clean locally (c2pool target links).

The /api/node_topology auto-detect fallback (used when no per-coin
StatsProvider hook is wired) emitted coin/primary/peers/embedded/has_rpc
but never height, so the topology card (PR #452 front-end) rendered the
primary chain with peers but no tip on fallback nodes.

Fill the primary entry with the embedded daemon REAL current block
height from the cached template (m_cached_template[height] under
m_work_mutex -- the same source rest_local_stats uses), guarded > 0 to
match the front-end render guard. synced still requires the StatsProvider
hook (is_blockchain_synced() is declared-but-unimplemented), so it is
deliberately left to the hook path.

Web layer only, no ICoinNode change -> no per-coin/consensus ripple.
@frstrtr
frstrtr merged commit 4fdc8d9 into master Jun 24, 2026
21 checks passed
@frstrtr
frstrtr deleted the web/topology-fallback-primary-tip branch July 28, 2026 06:04
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.

1 participant