Skip to content

health: count the orphan rate per height, not per candidate row - #109

Merged
rsantacroce merged 1 commit into
mainfrom
fix/orphan-rate-by-height
Nov 7, 2026
Merged

rsantacroce merged 1 commit into
mainfrom
fix/orphan-rate-by-height

Conversation

@rsantacroce

Copy link
Copy Markdown
Collaborator

Problem

orphan_rate counted each blocks_found row. When a template is stuck on an old tip, miners keep solving the same height, and every solve becomes its own rejected row. On pool.vaultnet.sh, one incident on 2026-10-29 (the enforcer got stuck in a mempool re-sync, so the template stayed on 974,037 for about 11h) produced six rejected rows. Every block after the fix confirmed, but the dashboard still showed "only 4 of the last 10 candidates reached the chain". It would have stayed red until two more blocks were found.

Change

Count heights instead of rows. A height counts as reached if any candidate at it confirmed, and as lost if every candidate there was orphaned or rejected. The window is still the last 100, now 100 heights.

Tests

  • Regression: the vaultnet history (1 confirmed, 6 rejected at one height, 3 confirmed) passes. It fails on the old code.
  • A losing candidate at a height the pool also won counts as reached.
  • Rejects at 3 different heights against 1 confirmed still fail, so grouping by height doesn't hide a pool that really is losing blocks.
  • node --test test/*.test.js: 207 pass, 0 fail.

Run read-only against vaultnet's live DB, the new query gives good=4, lost=1 (80%).

🤖 Generated with Claude Code

A template stuck on an old tip keeps miners solving the same height, and
each solve is its own rejected row. On vaultnet one wedged-enforcer
incident (2026-10-29) left six rejected rows at 974,037; every block since
confirmed, yet the check read "4 of the last 10" and stayed red, and would
have until two more blocks landed.

Group by height: a height is reached if any candidate there confirmed,
lost if all were orphaned or rejected. A pool losing blocks at many
heights still fails as before (new test). vaultnet now reads 4 of 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rsantacroce
rsantacroce merged commit 40c8e68 into main Nov 7, 2026
8 of 9 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.

1 participant