-
Notifications
You must be signed in to change notification settings - Fork 153
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
k256 MPrime missing strip() #239
Comments
We have likely a similar problem in ethereumjs/ethereumjs-wallet#121 |
Update: tested a downgrade of the BN.js version from |
Yeah that's our solution as well in http://github.com/ava-labs/slopes ... until this is patched, we can't upgrade BN.js. |
Debugged this a bit more. This is triggered by having mixed versions of BN.js in the dependency stack, so v4 and v5 running on different libraries and coming into collision. Couldn't completely trace this but in our case the @fanatid not sure, a "fix" here would likely be to keep respectively reintroduce a |
On a second thought: I would say it's worth to reintroduce |
We did a longer investigation here along this PR ethereumjs/ethereumjs-wallet#121 on the wallet library. This is indeed an interoperability issue between In our case this is even happening without having any production dependencies on ethereumjs-wallet@0.6.3 [PATH]/ethereumjs-wallet
├─┬ ethereumjs-util@7.0.1
│ ├── bn.js@4.11.8
│ └─┬ rlp@2.2.4
│ └── bn.js@4.11.8 deduped
├─┬ ethers@4.0.47
│ ├── bn.js@4.11.8 deduped
│ └─┬ elliptic@6.5.2
│ └── bn.js@4.11.8 deduped
├─┬ hdkey@1.1.2
│ └─┬ secp256k1@3.8.0
│ └── bn.js@4.11.8 deduped
└─┬ karma-typescript@5.0.2
└─┬ crypto-browserify@3.12.0
├─┬ browserify-sign@4.1.0
│ ├── bn.js@5.1.1 <--- BN v5 dependency injected here!
│ ├─┬ browserify-rsa@4.0.1
│ │ └── bn.js@4.11.8 deduped
│ └─┬ parse-asn1@5.1.5
│ └─┬ asn1.js@4.10.1
│ └── bn.js@4.11.8 deduped
├─┬ create-ecdh@4.0.3
│ └── bn.js@4.11.8 deduped
├─┬ diffie-hellman@5.0.3
│ ├── bn.js@4.11.8 deduped
│ └─┬ miller-rabin@4.0.1
│ └── bn.js@4.11.8 deduped
└─┬ public-encrypt@4.0.3
└── bn.js@4.11.8 deduped This led to a BN This will likely lead to more problems within the community once more people upgrade to if (r.strip !== undefined) {
r.strip();
} else {
r._strip();
} This solution wouldn't affect or revert any breaking changes but just improve interoperability between the versions. Fix would need to be applied and released on both versions though, since this can actually happen in both directions (a @fanatid would you be ok with this fix? Then I would open two PRs here on this. Could you create a new |
Sorry that missed previous messages. I like idea of patching 4.x version, looks like this will resolve |
No problem 👍, yes, will do directly! |
Thanks @holgerd77! |
Related to issue: indutny/elliptic#191 (comment)
@fanatid said he saw the same issue as the one below where strip() is missing. I'm posting it here in hopes for a minor patch with a workaround.
from code:
The text was updated successfully, but these errors were encountered: