MetaMask / MetaMask/toprf-secure-backup

CommitmentJRPCResponse: Type of `nodeIndex` is inconsistent between client and server

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
21h 12m
Merged PRs (30d)
1

Description

The type of `CommitmentJRPCResponse.nodeIndex` is inconsistent between client and server code.

in client: nodeIndex is type number
https://github.com/torusresearch/toprf-sdk/blob/a93538049767bdc3b57934ab2662e4f197d4b008/packages/toprf-secure-backup/src/jrpcInterfaces.ts#L17
in server: nodeIndex is type string
https://github.com/torusresearch/sss-service/blob/c978d40c3625fdfa1463afffa99202252ab59c52/pkg/toprf/toprf_commit_handler.go#L41

This can cause all sorts of problems.
For example, comparisons do not work as expected.
for `nodeIndex = '1'`, we have `nodeIndex != 1`.

Contributor guide

Open the contributing guide

Research direction

Start by comparing CommitmentJRPCResponse in packages/toprf-secure-backup/src/jrpcInterfaces.ts with the server definition at pkg/toprf/toprf_commit_handler.go. Trace how nodeIndex is serialized and consumed on both sides, then verify that the client and server expose the same type and that comparisons behave consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.