feat(mbe): use customSigning fns for MPC eddsa#66
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements custom signing functions for MPC EdDSA algorithms to enable proper integration with the enclaved express client. The main change is extending the existing ECDSA MPCv2 custom signing pattern to support EdDSA algorithms.
- Refactors sendMany handling to use custom signing functions for both ECDSA and EdDSA MPC algorithms
- Creates new EdDSA custom signing functions that maintain state between signing rounds
- Updates test coverage to reflect the new unified MPC signing approach
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/api/master/handlers/handleSendMany.ts |
Refactors MPC signing logic to support both ECDSA and EdDSA with custom signing functions |
src/api/master/handlers/eddsa.ts |
Adds custom EdDSA signing function factory and updates existing handler to use them |
src/api/master/clients/enclavedExpressClient.ts |
Exports SignMpcCommitmentResponse interface for external use |
src/__tests__/api/master/signAndSendTxRequest.test.ts |
Adds comprehensive test coverage for both ECDSA and EdDSA signing workflows |
src/__tests__/api/master/sendMany.test.ts |
Updates EdDSA test to reflect new unified MPC approach |
src/__tests__/api/master/eddsa.test.ts |
Re-enables EdDSA tests and removes obsolete mocking |
| customGShareGenerator: CustomGShareGeneratingFunction; | ||
| } { | ||
| // Create state to maintain data between rounds | ||
| let commitmentResponse: SignMpcCommitmentResponse; |
There was a problem hiding this comment.
The commitmentResponse variable is declared but not initialized, which could lead to runtime errors if customRShareGenerator or customGShareGenerator are called before customCommitmentGenerator. Consider initializing with undefined or adding explicit undefined checks.
| let commitmentResponse: SignMpcCommitmentResponse; | |
| let commitmentResponse: SignMpcCommitmentResponse | undefined = undefined; |
017bf3f to
8ae179e
Compare
8ae179e to
b56e3da
Compare
| createEddsaCustomSigningFunctions(enclavedExpressClient, source, commonKeychain); | ||
|
|
||
| return { | ||
| ...(req.decoded as SendManyOptions), |
There was a problem hiding this comment.
curious why you need to do this? Ideally your parameters should be a subset of SendManyOptions
Ticket: WP-5246