Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Aug 12, 2025

WHAT

This is the main naga branch 🌶️

Getting started

// 1. install
pnpm install

// 2. build
pnpm build

// 3. test
NETWORK=naga-dev pnpm run test:e2e all

@Ansonhkg
Copy link
Collaborator Author

Packages published to prioritise usability of the naga-dev network:

🦋  success packages published successfully:
🦋  @lit-protocol/access-control-conditions@8.0.0-beta.2
🦋  @lit-protocol/access-control-conditions-schemas@8.0.0-beta.2
🦋  @lit-protocol/auth@8.0.0-beta.2
🦋  @lit-protocol/auth-helpers@8.0.0-beta.2
🦋  @lit-protocol/auth-services@2.0.0-beta.2
🦋  @lit-protocol/constants@8.0.0-beta.2
🦋  @lit-protocol/crypto@8.0.0-beta.2
🦋  @lit-protocol/lit-client@8.0.0-beta.2
🦋  @lit-protocol/logger@8.0.0-beta.2
🦋  @lit-protocol/networks@8.0.0-beta.2
🦋  @lit-protocol/schemas@8.0.0-beta.2
🦋  @lit-protocol/types@8.0.0-beta.2
🦋  @lit-protocol/wasm@8.0.0-beta.2

@CLAassistant
Copy link

CLAassistant commented Sep 22, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ Ansonhkg
✅ a1ttech
✅ mikelodder7
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI review requested due to automatic review settings October 7, 2025 16:27
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 is the main naga branch that introduces a comprehensive set of changes across the Lit Protocol JavaScript SDK, including the creation of a new Artillery testing package, significant refactoring of access control conditions with the introduction of new schema-based validation, and removal of wrapped-keys testing files. The PR represents a major restructuring with the addition of comprehensive load testing capabilities and modernized access control condition handling.

Key changes:

  • Added a new Artillery package for load testing with various test configurations
  • Introduced access-control-conditions-schemas package with Zod-based validation
  • Completely refactored access-control-conditions package with new validator, builder pattern, and improved type safety
  • Removed all wrapped-keys related test files from local-tests

Reviewed Changes

Copilot reviewed 223 out of 1442 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/artillery/* New Artillery load testing package with configurations and metadata
packages/access-control-conditions-schemas/* New schema validation package using Zod for access control conditions
packages/access-control-conditions/src/lib/* Complete refactor with new validation, builder pattern, and modernized utilities
local-tests/tests/wrapped-keys/* Removal of all wrapped-keys test files
nx.json, package.json Updated project configuration and dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

});
} catch (e) {
console.log(`Failed to get decimals for ${acc.contractAddress}`);
logger.info(`Failed to get decimals for ${acc.contractAddress}`); // is this safe to fail and continue?
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

The inline comment raises a valid concern about error handling safety. Consider documenting the expected behavior when decimal retrieval fails or implementing proper error handling rather than just logging and continuing.

Suggested change
logger.info(`Failed to get decimals for ${acc.contractAddress}`); // is this safe to fail and continue?
logger.warn(`Failed to get decimals for ${acc.contractAddress}, using default of 18. Error: ${e}`);
decimals = 18; // Default to 18 decimals if retrieval fails

Copilot uses AI. Check for mistakes.
): Promise<string> => {
const hashed = await hashResourceId(resourceId);
return uint8arrayToString(new Uint8Array(hashed), 'base16');
return Buffer.from(new Uint8Array(hashed)).toString('hex');
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

The conversion from ArrayBuffer to Uint8Array to Buffer to hex string could be simplified to Buffer.from(hashed).toString('hex') since Buffer.from() can directly accept ArrayBuffer.

Suggested change
return Buffer.from(new Uint8Array(hashed)).toString('hex');
return Buffer.from(hashed).toString('hex');

Copilot uses AI. Check for mistakes.
path,
returnValueTest: {
key,
comparator: comparator || ('=' as any),
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

Using as any to bypass type checking should be avoided. Instead, define the proper type or use a type assertion that's more specific to the expected type.

Suggested change
comparator: comparator || ('=' as any),
comparator: comparator || '=',

Copilot uses AI. Check for mistakes.
method,
parameters,
returnValueTest: {
comparator: comparator || ('=' as any),
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

Another instance of using as any to bypass type checking. This pattern appears multiple times and should be replaced with proper typing.

Suggested change
comparator: comparator || ('=' as any),
comparator: comparator || '=',

Copilot uses AI. Check for mistakes.
@Ansonhkg Ansonhkg changed the title 🦋 [Beta] Main Naga Branch 🦋 [Main] Naga Branch Oct 8, 2025
- replace Bun setup in .github/workflows/lint.yml with Node + corepack-driven pnpm so linting aligns with the rest of the CI pipelines
- run lint commands through pnpm to ensure they use the workspace lockfile
- update packages/e2e/README.md installation section to point to pnpm add instead of bun install
…to-pnpm

chore: switch lint workflow to pnpm and update e2e install docs
…g-add-signsessionkey-product-index-3-for

feat(pricing): add `sign-session-key` pricing support and product-awa…
chore: update wasm-pack version to latest
chore: update release workflow to build packages before publishing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants