Skip to content

feat: coretime renewal watchdog#1470

Merged
mrq1911 merged 2 commits into
masterfrom
feat/coretime-renew-alert
Jun 2, 2026
Merged

feat: coretime renewal watchdog#1470
mrq1911 merged 2 commits into
masterfrom
feat/coretime-renew-alert

Conversation

@mrq1911

@mrq1911 mrq1911 commented Jun 2, 2026

Copy link
Copy Markdown
Member

what

Adds an operational watchdog (scripts/coretime-alert/) that alerts a Discord webhook when Hydration's (Polkadot, task 2034) or Basilisk's (Kusama, task 2090) bulk coretime cores are at risk of lapsing before the current sale's renewal deadline.

Bulk cores are not leases — they must be renewed every ~28-day sale cycle or they fall back to the open market. The watchdog inspects the broker pallet on each coretime chain and pings before the window closes.

alert logic

Fires for a chain only when it is short of its target core count for the upcoming region and the deadline is near:

  • URGENT< 7d (TOTAL_ALERT_DAYS) until the region begins (hard deadline; renewal right lost after)
  • WARNING — inside the lead-in period with < 3d (LEADIN_ALERT_DAYS) left

"Short" = secured cores for next region (workplan) < desired (default 3). The alert lists the pending broker.renew(core) calls (with encoded hex) needed to close the gap. State is persisted so a standing condition only re-pings every ALERT_COOLDOWN_HOURS (default 12).

contents

  • check.mjs — the check (one-shot; cron/systemd friendly, or looped by the image)
  • Dockerfile / .dockerignore — builds galacticcouncil/coretime-alert
  • lark-stack.yml — Swarm stack (webhook injected via env at deploy, never in repo)
  • package.json, README.md

deployment

Built and pushed galacticcouncil/coretime-alert:{latest,1.0.0}; deployed as the coretime-alert stack on lark (single replica, hourly loop, autoredeploy). First check verified live against both chains.

verification

  • one-shot dry-run and forced-trigger tested against live coretime chains
  • cooldown throttle and --force override confirmed
  • the underlying renewal flow was validated on a Chopsticks fork of the Polkadot coretime chain (3-core workplan after renew)

No runtime/crate changes — scripts-only addition.

Copilot AI review requested due to automatic review settings June 2, 2026 08:58

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Runtime version has not been increased.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an operational watchdog script (scripts/coretime-alert/) that monitors Hydration's (Polkadot, task 2034) and Basilisk's (Kusama, task 2090) bulk coretime cores via the broker pallet and pings a Discord webhook when cores risk lapsing before the sale's renewal deadline. Scripts-only addition; no runtime/crate changes.

Changes:

  • New Node.js check script with phase/shortfall assessment, cooldown-throttled state, and --dry-run/--test/--force modes.
  • Dockerfile + Swarm stack file for deployment as the coretime-alert stack on lark.
  • README documenting alert logic, env vars, cron/systemd/Docker setups, and webhook-handling guidance.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/coretime-alert/check.mjs Core watchdog: connects to coretime chain via fallback endpoints, queries broker storage, decides URGENT/WARNING alerts, posts to Discord with cooldown state.
scripts/coretime-alert/package.json npm manifest declaring @polkadot/api dependency and helper scripts.
scripts/coretime-alert/Dockerfile Builds galacticcouncil/coretime-alert image that loops the check on CHECK_INTERVAL_SECONDS.
scripts/coretime-alert/lark-stack.yml Swarm stack manifest with state volume, env vars, and autoredeploy label.
scripts/coretime-alert/README.md Documentation of trigger logic, configuration, and deployment options.
scripts/coretime-alert/.gitignore Ignores node_modules, state file, logs.
scripts/coretime-alert/.dockerignore Excludes non-runtime files from build context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mrq1911 mrq1911 changed the title feat(coretime-alert): renewal watchdog with discord alerts feat: coretime renewal watchdog Jun 2, 2026
@mrq1911 mrq1911 enabled auto-merge June 2, 2026 09:08
@mrq1911 mrq1911 disabled auto-merge June 2, 2026 09:08
@mrq1911 mrq1911 merged commit 0a41b8b into master Jun 2, 2026
8 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.

2 participants