-
Notifications
You must be signed in to change notification settings - Fork 88
Feature/jss 29 feature add naga uptime bot #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d endpoint testing - Added health check initialization and management for Naga networks. - Implemented tests for key functionalities: Handshake, PKP Sign, Sign Session Key, Execute JS, and Decrypt. - Integrated logging to Lit Status backend for monitoring. - Created GitHub Actions workflow for automated health checks on push and manual triggers. - Updated package.json and pnpm-lock.yaml for new dependencies and scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a standalone Naga health check system that validates core Lit Protocol endpoints and reports to the Lit Status backend. The system performs automated health monitoring with minimal chain interactions and is currently triggered on pushes to the feature branch with scheduled runs prepared but disabled.
Key changes:
- Implements a lightweight health check runner with 5 core endpoint tests (handshake, PKP sign, session key signing, Lit Actions execution, and encryption/decryption)
- Adds GitHub Actions workflow for automated testing with environment-specific configurations
- Integrates with
@lit-protocol/lit-status-sdkfor monitoring and alerting
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/e2e/src/health/index.ts | Main health check runner with status backend integration and test orchestration |
| packages/e2e/src/health/health-init.ts | Lightweight initialization module for minimal chain interactions during health checks |
| packages/e2e/src/health/README.md | Comprehensive documentation covering usage, configuration, and troubleshooting |
| packages/e2e/src/health/NagaHealthManager.ts | Health check test implementations for the 5 core endpoints |
| package.json | Added health check npm scripts and lit-status-sdk dependency |
| .github/workflows/release.yml | Updated branch reference handling for release workflow |
| .github/workflows/health-checks.yml | GitHub Actions workflow for automated health check execution |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| console.log('═══════════════════════════════════════'); | ||
| console.log('🏥 Naga Health Check Starting'); | ||
| console.log('═══════════════════════════════════════'); |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions 'ESM compatibility' but doesn't explain why dynamic import is necessary here or what compatibility issue it solves. Consider clarifying the specific compatibility concern.
| console.log('═══════════════════════════════════════'); | |
| // Initialize Lit Status Client. | |
| // @lit-protocol/lit-status-sdk is only available as an ESM module. | |
| // To import it from this (CommonJS or non-ESM) context, we must use dynamic import. |
|
|
||
| /** |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants lack documentation about the units (ETH) and rationale for the specific amounts chosen for health checks.
| /** | |
| // Configuration constants | |
| /** | |
| * Amount of ETH (in units of ETH) to fund the test account on live networks. | |
| * Chosen as 0.01 ETH to ensure enough balance for basic health check transactions | |
| * (e.g., PKP minting, small contract interactions), while minimizing cost and risk. | |
| */ | |
| const LIVE_NETWORK_FUNDING_AMOUNT = '0.01'; | |
| /** | |
| * Amount of ETH (in units of ETH) to deposit into the ledger for health checks. | |
| * Set to 2 ETH to guarantee sufficient balance for all required test operations, | |
| * including PKP minting and other on-chain actions, without risk of depletion. | |
| */ |
| const litActionCode = ` | ||
| (async () => { | ||
| const { sigName, toSign, publicKey } = jsParams; | ||
| const { keccak256, arrayify } = ethers.utils; | ||
|
|
||
| const toSignBytes = new TextEncoder().encode(toSign); | ||
| const toSignBytes32 = keccak256(toSignBytes); | ||
| const toSignBytes32Array = arrayify(toSignBytes32); | ||
|
|
||
| const sigShare = await Lit.Actions.signEcdsa({ | ||
| toSign: toSignBytes32Array, | ||
| publicKey, | ||
| sigName, | ||
| }); | ||
| })();`; |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline Lit Action code string is complex and could be moved to a separate constant or file for better maintainability and readability.
WHAT