Skip to content

node: harden bounded /pending/confirm observability (tri-brain follow-up to #6900)#6901

Merged
Scottcjn merged 1 commit into
mainfrom
harden/pending-confirm-observability
Jun 6, 2026
Merged

node: harden bounded /pending/confirm observability (tri-brain follow-up to #6900)#6901
Scottcjn merged 1 commit into
mainfrom
harden/pending-confirm-observability

Conversation

@Scottcjn
Copy link
Copy Markdown
Owner

@Scottcjn Scottcjn commented Jun 6, 2026

Tri-brain follow-up to #6900 — bounded /pending/confirm observability hardening

The tri-brain review of #6900 surfaced two non-blocking robustness items (the BLOCKING finding — scheduler-throttle — was already fixed in rustchain-bounties#13228). This lands the two SHOULD-FIX items.

1. _pending_confirm_env_int — non-positive override now falls back to default

Previously max(1, int(raw)) meant RC_PENDING_CONFIRM_MAX_LIMIT=0 (or negative) silently became 1, throttling the confirm scheduler to one transfer per call with ok: true and no error. Now a non-positive override falls back to the configured default, so a misconfig fails loud-enough (default throughput) instead of silently starving the queue.

2. _pending_overdue_stats — narrow the swallow + log

Was except Exception: return {0, 0}. For an observability helper that's the worst case: a locked DB or pending_ledger schema drift would masquerade as a healthy "0 overdue" to any monitor trusting the new fields. Now:

  • narrowed to except sqlite3.Error (genuine code bugs propagate instead of being absorbed),
  • logs a WARN on the degrade so a real DB problem is visible rather than a silent false-healthy,
  • still returns 0,0 so the endpoint never 500s on observability alone.

Verification

  • py_compile clean
  • scripts/check_fetchall.sh green — baseline regenerated for the +8 line shift; content-identical (no .fetchall() site added or removed, only 5 main-node line numbers moved)
  • pending/confirm/overdue test failure-set is byte-identical to main before vs after this change (the 19 reds are pre-existing bare-clone fixture gaps, green in CI; 78 pass both ways)

Pure robustness, no behavior change on the happy path. Credit to the tri-brain pass (Codex NIT #2 + Grok SHOULD-FIX) for both.

🤖 Generated with Claude Code

…-up to #6900)

Two robustness fixes surfaced by the tri-brain review of #6900:

- _pending_confirm_env_int: a non-positive override (RC_PENDING_CONFIRM_*_LIMIT=0
  or negative) now falls back to the default instead of silently clamping to 1,
  which would throttle the confirm scheduler to one transfer per call with no
  error signal.

- _pending_overdue_stats: narrow the swallow from bare Exception to sqlite3.Error
  and LOG it. A locked DB or pending_ledger schema drift must not masquerade as a
  healthy '0 overdue' to monitors trusting the new observability fields; genuine
  bugs now surface instead of being silently absorbed.

Regenerated scripts/baselines/fetchall_existing.txt for the +8 line shift
(content-identical: no fetchall site added or removed). py_compile clean,
fetchall guard green, pending/confirm test failure-set unchanged vs main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines labels Jun 6, 2026
@Scottcjn Scottcjn merged commit 5ae81b6 into main Jun 6, 2026
12 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 6, 2026

⚠️ BCOS v2 Scan Results

Metric Value
Trust Score 52/100
Certificate ID BCOS-25c16621
Tier L1 (not met)

BCOS Badge

What does this mean?

The BCOS (Beacon Certified Open Source) engine scans for:

  • SPDX license header compliance
  • Known CVE vulnerabilities (OSV database)
  • Static analysis findings (Semgrep)
  • SBOM completeness
  • Dependency freshness
  • Test infrastructure evidence
  • Review attestation tier

Full report | What is BCOS?


BCOS v2 Engine - Free & Open Source (MIT) - Elyan Labs

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! The code changes look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants