Skip to content

Add offline linked-node owner email notifier (#66) - #69

Merged
cristibleotiu merged 2 commits into
mainfrom
develop
Jun 10, 2026
Merged

Add offline linked-node owner email notifier (#66)#69
cristibleotiu merged 2 commits into
mainfrom
develop

Conversation

@aledefra

Copy link
Copy Markdown
Collaborator

No description provided.

aledefra added 2 commits June 9, 2026 12:49
* Add offline linked-node owner email notifier

* fix: align offline node notifier with live oracle

* fix: continue notifying offline linked nodes on errors
Copilot AI review requested due to automatic review settings June 10, 2026 17:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 “offline linked nodes” notification path to the backend, including a new HTML email template, email-sending function, notifier job (with throttling backed by CStore), and configuration/cron wiring so specific nodes can run the notifier on a schedule.

Changes:

  • Added a new email.nodes.offline.html template plus template loader/cache plumbing and a template getter test.
  • Implemented an offline linked-nodes notifier service that fetches oracle node status, resolves node owners, emails confirmed recipients, and throttles sends via CStore (with unit tests).
  • Optimized job-details allocation lookups in DailyGetStats by introducing a batched allocation query and tests, and added config/cron/env wiring for the notifier.

Reviewed changes

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

Show a summary per file
File Description
templates/util.go Registers and exposes a loader for the new offline-nodes email template.
templates/html/email.nodes.offline.html Adds the HTML email template used to notify owners about offline linked nodes.
templates/cache.go Caches and exposes the offline-nodes email template via a getter.
templates/cache_test.go Ensures the new template getter returns the correct template name.
storage/allocationStorer.go Adds a batched allocation lookup for job-details reuse and refactors the single-job function to use it.
storage/allocationStorer_test.go Tests the batched allocation lookup selection/order behavior and empty-input handling.
service/statsService.go Switches job-details allocation lookups from per-job queries to a batched fetch.
service/offlineNodesNotifier.go Implements the offline linked-nodes notifier (oracle fetch, owner resolution, throttling store, email fanout).
service/offlineNodesNotifier_test.go Adds unit tests for oracle filtering, config validation, grouping/throttling, and failure handling.
service/emailService.go Adds SendOfflineNodesEmail and formats offline durations for the template.
deployScripts/deploy_testnet.py Adds EE_CHAINSTORE_API_URL to the deploy env map and fixes trailing formatting.
deployScripts/deploy_mainnet.py Adds EE_CHAINSTORE_API_URL to the deploy env map and fixes trailing formatting.
deployScripts/deploy_devnet.py Adds EE_CHAINSTORE_API_URL to the deploy env map and fixes trailing formatting.
config/config.testnet.json Adds OraclesApi for testnet.
config/config.mainnet.json Adds OfflineNodesCronJobTiming and OraclesApi for mainnet.
config/config.go Extends config schema with OraclesApi and OfflineNodesCronJobTiming plus a getter.
config/config.devnet.json Adds OraclesApi for devnet.
cmd/main.go Wires the new offline-nodes notifier cron job into startup based on per-node timing config.
.env.example Adds EE_CHAINSTORE_API_URL example entry and fixes formatting.

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

@cristibleotiu
cristibleotiu merged commit 286d884 into main Jun 10, 2026
2 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.

3 participants