Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Oct 9, 2025

WHAT

  • Add standalone Naga health checks that validate core endpoints and report to the Lit Status backend.
  • Run on every push to feature/jss-29-feature-add-naga-uptime-bot. (To be removed)
  • Scheduled run (every 5 minutes) is prepared but currently disabled pending review.

…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.
Copilot AI review requested due to automatic review settings October 9, 2025 17:36
Copy link
Contributor

Copilot AI left a 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-sdk for 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('═══════════════════════════════════════');
Copy link

Copilot AI Oct 9, 2025

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.

Suggested change
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 uses AI. Check for mistakes.
Comment on lines +43 to +44

/**
Copy link

Copilot AI Oct 9, 2025

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.

Suggested change
/**
// 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.
*/

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +164
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,
});
})();`;
Copy link

Copilot AI Oct 9, 2025

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.

Copilot uses AI. Check for mistakes.
@Ansonhkg Ansonhkg merged commit e6a5d98 into naga Oct 9, 2025
7 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