Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing between installed versions of this package fails to update the associated native node module #134

Open
tplooker opened this issue Aug 31, 2020 · 1 comment

Comments

@tplooker
Copy link
Member

When changing between installed versions of node-bbs-signatures it appears that the native node module './index.node' is not always being downloaded and updated by node-pre-gyp leading to issues, especially when changing between versions of the library that feature breaking API changes.

How to reproduce

Start with new empty project and install node-bbs-signatures

yarn add @mattrglobal/[email protected]

Then run the following

node
require("./node_modules/@mattrglobal/node-bbs-signatures/native/index.node")

Which will output

{ bls_generate_blinded_g2_key: [Function],
  bls_generate_blinded_g1_key: [Function],
  bls_generate_g2_key: [Function],
  bls_generate_g1_key: [Function],
  bls_secret_key_to_bbs_key: [Function],
  bls_public_key_to_bbs_key: [Function],
  bbs_sign: [Function],
  bbs_verify: [Function],
  bbs_blind_signature_commitment: [Function],
  bbs_verify_blind_signature_proof: [Function],
  bbs_blind_sign: [Function],
  bbs_get_unblinded_signature: [Function],
  bbs_create_proof: [Function],
  bbs_verify_proof: [Function],
  bls_verify_proof: [Function] }

Now change the installed version of the package

yarn add @mattrglobal/[email protected]

And run

node
require("./node_modules/@mattrglobal/node-bbs-signatures/native/index.node")

Note the output

{ bls_generate_blinded_g2_key: [Function],
  bls_generate_blinded_g1_key: [Function],
  bls_generate_g2_key: [Function],
  bls_generate_g1_key: [Function],
  bls_secret_key_to_bbs_key: [Function],
  bls_public_key_to_bbs_key: [Function],
  bbs_sign: [Function],
  bbs_verify: [Function],
  bbs_blind_signature_commitment: [Function],
  bbs_verify_blind_signature_proof: [Function],
  bbs_blind_sign: [Function],
  bbs_get_unblinded_signature: [Function],
  bbs_create_proof: [Function],
  bbs_verify_proof: [Function],
  bls_verify_proof: [Function] }

Which is incorrect for the 0.9.0 package which did not feature blinded key generation support and the function bls_generate_g2_key was instead called bls_generate_key

Intermediary Solution

It is recommended when changing between installed versions of the library to uninstall and reinstall the library at the new targeted version to ensure the correct native node module is downloaded.

@tplooker
Copy link
Member Author

cc @colinyip who observed and documented this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant