Skip to content

dashboard: grace period for a new block's bare template - #97

Merged
rsantacroce merged 1 commit into
mainfrom
fix/template-commitments-grace
Oct 5, 2026
Merged

rsantacroce merged 1 commit into
mainfrom
fix/template-commitments-grace

Conversation

@rsantacroce

Copy link
Copy Markdown
Collaborator

The enforcer's first template after every new block has only the witness commitment. The sidechain commitments come in on the next poll, about 30s later. template_commitments only looks at the newest template, so a health run that lands in that gap fails. The dashboard keeps that result for 5 minutes and the broadcaster polls every 60s, so it gets past the broadcaster's 3-poll debounce. The result is a "⚠️ a ledger health check is failing" post followed by "✅ all ledger health checks pass again" a few times a day, with nothing wrong.

Evidence (avonpool betanet, last 7 days): 183 of 1,621 templates were bare (cb_op_returns = 1). That's one per block, each lasting a single 30s poll and never longer. Every block the pool found in that period was mined from a template with commitments.

Change: a bare template younger than TEMPLATE_COMMIT_GRACE_SEC (120s, four polls) passes, with detail "new block — commitments pending". A bare template that outlives the grace period still fails, so an enforcer that really stops committing is still caught within one monitor interval. Two tests cover a young bare template (pass) and a 180s-old one (fail). The existing tests are unchanged and pass.

🤖 Generated with Claude Code

The enforcer's first template after every block carries only the
witness commitment; the sidechain commitments arrive on the next poll,
~30s later. template_commitments judged only the newest row, so a
health run landing in that gap failed — and since the snapshot is held
for 5 minutes, it outlasted the broadcaster's debounce and posted a
"ledger health check is failing" / "pass again" pair a few times a
day. Measured on betanet over 7 days: 183 bare templates, one per
block, none older than 30s.

A bare template younger than 120s now reads as "commitments pending";
one that outlives it still fails, within one monitor interval.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rsantacroce
rsantacroce merged commit f855e58 into main Oct 5, 2026
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