Add offline linked-node owner email notifier (#66) - #69
Merged
Conversation
* Add offline linked-node owner email notifier * fix: align offline node notifier with live oracle * fix: continue notifying offline linked nodes on errors
Contributor
There was a problem hiding this comment.
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.htmltemplate 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
DailyGetStatsby 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
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.