-
Notifications
You must be signed in to change notification settings - Fork 200
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
fix(vc): change pubKey input from Buffer to Uint8Array #935
fix(vc): change pubKey input from Buffer to Uint8Array #935
Conversation
Signed-off-by: Karim <[email protected]>
Codecov Report
@@ Coverage Diff @@
## 0.3.0-pre #935 +/- ##
=============================================
- Coverage 86.65% 84.69% -1.96%
=============================================
Files 515 517 +2
Lines 12552 12573 +21
Branches 2132 2136 +4
=============================================
- Hits 10877 10649 -228
- Misses 1580 1793 +213
- Partials 95 131 +36
Continue to review full report at Codecov.
|
Tests seem to fail for Node 17. It doesn't look like it's related to the changes in this PR. @TimoGlastra, does this error look familiar to you by any chance? |
I have ran the tests again, and node 18 now failed. Locally it works (m1 Mac), so it might be some issue with the node-addon. |
We're having some issues with flaky tests from the credentials tests with events listener being started after the action has been performed resulting in a race condition. This is often if the CI randomly fails. I made a start at it here, but there's more test we need to fix: #893 Not sure if this is it, but migth be related |
Hmm after looking at it again, this looks like a different issue than the flaky tests as it's only failing on BBS tests. Maybe a linux + node 18 issue? |
As discussed in the WG call today, we will work around this issue for now by forcing the library to use the WASM environment. We can do this by setting an environment variable called However, this does open up the possibility for confusion. If an unknowing developer runs AFJ in Node 17 or 18, it will use |
Signed-off-by: Karim <[email protected]>
Ok, I've added the environment variable in 49c35d4 which should hopefully make sure the tests succeed for all Node versions (waiting on CI to finish atm, wish me luck 😄). One thing I'd like to double check: in order to not have to overhaul the entire workflow structure, I've added the environment variable top level. This means that the tests for Node 14 and 16 (which did succeed using Please let me know if there are any objections regarding this. @TimoGlastra, @blu3beri, would love to hear your thoughts on this. |
Documenting would be good. In addition I think there's two approaches here (maybe more):
|
Could you maybe open an issue in the node bbs signatures repo so the maintainers are aware of the issue? |
Since usability and simplicity are primary goals of AFJ, I'm personally in favour of the first option. I'd like to minimise the amount of edge cases a user has to handle by themselves, as that increases the amount of gotcha's.
Good point, I will raise this issue to make them aware. Just to be sure before I move on to the next issue, how do you feel about the top level environment variable in the CI? If we go with the first option you mentioned this isn't needed anymore, but just in case we take the logging & documentation route.. |
Ahh great! Now we broke Node 14 again! 💯 |
Lol. Maybe we should take the first route and only set it for node 17 & 18? |
Yeah... I tried running the tests on my machine (M1) locally with 14 and it succeeds. I will try to run it with Node 14 on an Ubuntu system now, just to get a better understanding where the problem lies, but I agree, that solution is probably better. However, should we really set this environment variable just before importing the package? Isn't it cleaner to do this more 'top level', e.g. in the |
If we do it in the agent class the bbs library is probably already imported in which case setting the env variable doesn't matter anymore. So we need to make sure it happens before the import of bbs library |
I will try to debug the issue tomorrow with the node library, however a temporary fix would be best for now. WASM should not be that much slower so it's for sure not the end of the world. |
Even if we do this at the very top of the Anyhow, will do it right before the import for now. We can change it in a follow up PR :) |
Maybe the index.ts file is a better suited place? That's the entry point of the framework. I'm almost certain the agent class won't work |
Ok, I ran some local tests. I ran it on Ubuntu hoping to reproduce the error, and on macOs (M1) for future reference. On both platforms all tests succeeded. This is going to be fun! UbuntuSpecsResults for Node v14.19.3Results for Node v16.16.0Results for Node v17.9.1Results for Node v18.5.0macOs (M1)SpecsResults for Node v14.20.0Results for Node v16.16.0Results for Node v17.9.1Results for Node v18.5.0 |
But isn't that expected with WASM? We're having issues with the node js bbs package Or do I mistunderstand the issue? |
Since we have a dedicated issue for the CI failure now, can we merge this in? This problem seems to be beyond the scope of this PR alone. |
Signed-off-by: Karim <[email protected]>
Signed-off-by: Karim <[email protected]>
Signed-off-by: Karim <[email protected]>
…undation#935) Signed-off-by: Karim <[email protected]> Signed-off-by: Ariel Gentile <[email protected]>
This PR addresses an issue that occurred when running the
deriveProof
test case in theW3cCredentialService
tests. Strangely enough this issue only occurred when running in a NodeJS environment (which uses node-bbs-signatures) instead of the WASM fallback.Huge thanks to @blu3beri for helping debug this issue. This one wasn't easy to catch.
Signed-off-by: Karim [email protected]