Skip to content

[Feature] Node.js KeyProvider#1168

Open
iamalwaysuncomfortable wants to merge 8 commits intomainnetfrom
feature/node-key-provider
Open

[Feature] Node.js KeyProvider#1168
iamalwaysuncomfortable wants to merge 8 commits intomainnetfrom
feature/node-key-provider

Conversation

@iamalwaysuncomfortable
Copy link
Member

@iamalwaysuncomfortable iamalwaysuncomfortable commented Jan 27, 2026

Motivation

This PR provides a node.js based key provider that stores Proving and Verifying keys in an in-memory cache first and if not, will look on disk for the key in a specified directory.

Test Plan

This PR should include several program-manager based tests to ensure this KeyProvider works correctly.


Note

Medium Risk
New key-loading path (including filesystem access and caching) can affect runtime key availability and performance, and the added describe.only in tests risks unintentionally limiting the CI test run.

Overview
Adds a new Node-specific NodeKeyProvider that implements FunctionKeyProvider by resolving keys via locator: memory cache first (optional), then disk through LocalFileKeyStore, and supports both functionKeys({ cacheKey }) and credits key name lookup via functionKeys({ name }).

Exports NodeKeyProvider from sdk/src/node.ts and adds a new test suite covering cache hits (no disk read), cache-miss disk fallback + caching, credits name lookup, transferKeys("public") resolution, and missing-key error behavior.

Written by Cursor Bugbot for commit 9fd2e13. This will update automatically on new commits. Configure here.

@iamalwaysuncomfortable iamalwaysuncomfortable changed the base branch from mainnet to feature/key-store January 27, 2026 03:36
@iamalwaysuncomfortable iamalwaysuncomfortable marked this pull request as ready for review February 18, 2026 18:49
@ProvableHQ ProvableHQ deleted a comment from cursor bot Feb 18, 2026
@ProvableHQ ProvableHQ deleted a comment from cursor bot Feb 18, 2026
@iamalwaysuncomfortable
Copy link
Member Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

} else {
throw new Error("Invalid visibility type");
}
}
Copy link

Choose a reason for hiding this comment

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

Missing PUBLIC_TO_PRIVATE_TRANSFER case in transferKeys

High Severity

The transferKeys method is missing the PUBLIC_TO_PRIVATE_TRANSFER visibility case that both AleoKeyProvider and OfflineKeyProvider handle. Callers passing "publicToPrivate" or "transfer_public_to_private" will get an "Invalid visibility type" error instead of the correct keys. The PUBLIC_TO_PRIVATE_TRANSFER constant is also not imported.

Additional Locations (1)

Fix in Cursor Fix in Web

});
});

describe.only('NodeKeyProvider', () => {
Copy link

Choose a reason for hiding this comment

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

describe.only skips other test suites

Medium Severity

The new describe.only('NodeKeyProvider', ...) block causes Mocha to skip any test suites not also marked with .only, such as the main describe('KeyProvider', ...) suite. This likely was used during development and inadvertently left in.

Fix in Cursor Fix in Web

Base automatically changed from feature/key-store to mainnet February 25, 2026 23:54
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.

1 participant