[Feature] Node.js KeyProvider#1168
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Mike Turner <mike@provable.com>
Signed-off-by: Mike Turner <mike@provable.com>
… fixes for local and in-memory key retrieval
|
@cursor review |
There was a problem hiding this comment.
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"); | ||
| } | ||
| } |
There was a problem hiding this comment.
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)
| }); | ||
| }); | ||
|
|
||
| describe.only('NodeKeyProvider', () => { |
There was a problem hiding this comment.
d7bb066 to
78699e5
Compare


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.onlyin tests risks unintentionally limiting the CI test run.Overview
Adds a new Node-specific
NodeKeyProviderthat implementsFunctionKeyProviderby resolving keys via locator: memory cache first (optional), then disk throughLocalFileKeyStore, and supports bothfunctionKeys({ cacheKey })and credits key name lookup viafunctionKeys({ name }).Exports
NodeKeyProviderfromsdk/src/node.tsand 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.