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

No implementation found for SubstrateSignModule.ethkeyBrainwalletAddress #713

Closed
Tbaut opened this issue Jan 17, 2021 · 11 comments
Closed

Comments

@Tbaut
Copy link
Contributor

Tbaut commented Jan 17, 2021

I've tried to launch a dev version of Signer on a real android device (lastest android) as well as an emulator (Nexus 5, api 25), and it seems that the bindings with native functions fail. When I restore an identity for instance, it crashes with the following logcat:

2021-01-17 16:44:18.059 25125-25177/io.parity.signer E/o.parity.signe: No implementation found for java.lang.String io.parity.substrateSign.SubstrateSignModule.ethkeyBrainwalletAddress(java.lang.String) (tried Java_io_parity_substrateSign_SubstrateSignModule_ethkeyBrainwalletAddress and Java_io_parity_substrateSign_SubstrateSignModule_ethkeyBrainwalletAddress__Ljava_lang_String_2)
2021-01-17 16:44:18.062 25125-25177/io.parity.signer E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: Could not invoke SubstrateSign.brainWalletAddress
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:223)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) 
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:938) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) 
        at android.os.Looper.loop(Looper.java:223) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) 
        at java.lang.Thread.run(Thread.java:923) 
     Caused by: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String io.parity.substrateSign.SubstrateSignModule.ethkeyBrainwalletAddress(java.lang.String) (tried Java_io_parity_substrateSign_SubstrateSignModule_ethkeyBrainwalletAddress and Java_io_parity_substrateSign_SubstrateSignModule_ethkeyBrainwalletAddress__Ljava_lang_String_2)
        at io.parity.substrateSign.SubstrateSignModule.ethkeyBrainwalletAddress(Native Method)
        at io.parity.substrateSign.SubstrateSignModule.brainWalletAddress(SubstrateSignModule.java:34)
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372) 
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) 
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:938) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) 
        at android.os.Looper.loop(Looper.java:223) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) 
        at java.lang.Thread.run(Thread.java:923) 

Similarly when creating a new identity:

2021-01-17 16:50:03.302 25504-25854/io.parity.signer E/o.parity.signe: No implementation found for java.lang.String io.parity.substrateSign.SubstrateSignModule.ethkeyRandomPhrase(int) (tried Java_io_parity_substrateSign_SubstrateSignModule_ethkeyRandomPhrase and Java_io_parity_substrateSign_SubstrateSignModule_ethkeyRandomPhrase__I)
2021-01-17 16:50:03.304 25504-25854/io.parity.signer E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: Could not invoke SubstrateSign.randomPhrase
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:223)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) 
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:938) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) 
        at android.os.Looper.loop(Looper.java:223) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) 
        at java.lang.Thread.run(Thread.java:923) 
     Caused by: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String io.parity.substrateSign.SubstrateSignModule.ethkeyRandomPhrase(int) (tried Java_io_parity_substrateSign_SubstrateSignModule_ethkeyRandomPhrase and Java_io_parity_substrateSign_SubstrateSignModule_ethkeyRandomPhrase__I)
        at io.parity.substrateSign.SubstrateSignModule.ethkeyRandomPhrase(Native Method)
        at io.parity.substrateSign.SubstrateSignModule.randomPhrase(SubstrateSignModule.java:94)
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372) 
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151) 
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:938) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) 
        at android.os.Looper.loop(Looper.java:223) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226) 
        at java.lang.Thread.run(Thread.java:923) 

I've checkout the lastest release, v 4.5.3 and the same happens.

Any clue what could be the reason?

@Tbaut
Copy link
Contributor Author

Tbaut commented Jan 24, 2021

for the record, reverting af4eacd responsible to move the rust part out of Signer allowed me to build master successfully.

@Slesarew
Copy link
Contributor

@Tbaut can you test this again please?

@Tbaut
Copy link
Contributor Author

Tbaut commented Mar 12, 2021

Yes, just tried again on master, and the same happens. I'm not surprised though, I don't think anything related to this has been touched in the last PRs.

When creating an identity:

image

@Slesarew
Copy link
Contributor

hmm, I can't reproduce this (on new repo clone pull and just following standard procedure) but this most probably relates to those rust packages not updating or building properly, perhaps because their version wasn't bumped at some point (I've got similar issue somewhere in PR #720 when I did similar mistake). Let's see if this disappears on next rust libs update, which should happen very soon.

@Tbaut
Copy link
Contributor Author

Tbaut commented Mar 12, 2021

Are you building it on a mac? I figured that every recent and less recent contributor has built Signer on a mac, and had no problem. This is also what Hanwen has used to build the rust lib. To me, this was the cultprit.
When I import and build the rust locally, it just works, and that's what I did.

@Slesarew
Copy link
Contributor

No, it's typical Arch on intel64. I suspect yarn cache problem on your side, but regardless, this should be fixed - if next rust lib update doesn't fix it, we'll need to spot it before my builds start degrading.

I'm also OK with pulling the rust libs back since I plan to migrate more logic there, but I don't want to focus on rollback just now, I'm pretty sure something nasty will break again.

@Tbaut
Copy link
Contributor Author

Tbaut commented Mar 12, 2021

Ah interesting, then I'll give it a go on another pc I have. I've been running stylo (where I pulled the lib back) on it without issue, I'll see how it goes this weekend and let you know.

@Tbaut
Copy link
Contributor Author

Tbaut commented Mar 17, 2021

Sorry @Slesarew I will not have access to that PC in the next 2 weeks, I'll report back here when I have the chance.

@Tbaut
Copy link
Contributor Author

Tbaut commented May 20, 2021

It took forever, but I just managed to build master and things are looking good on Android now :)

@m00seym00
Copy link

Hi y'all. Can you please put this in lay terms. What I gather now is I should not use parity signer. Is this only a problem on IOS devices?

@Slesarew
Copy link
Contributor

This ticket was about a build problem that I haven't traced to anything in particular before fixing it. Honestly, I wasn't even able to reproduce it, and that's part of the problem.

There were no new vulnerabilities found in Signer; rather, the old a known issue of not knowing what you are signing (#724) and lack of certain features, as well as unreliable memory handling by javascript (which could potentially leak secrets into memory) required us to re-write large fraction of Signer in Rust using native frameworks for UI (see the PR #791 for early stage ios prototype, for example).

So, of course, the Signer always was in state of beta software, and using it had certain inherent risks - which were kind of irrelevant in most cases due to the app being airgapped. But soon we are planning to have proper, reliable and tested release.

I suggest you decide on whether you want to use Signer regardless of this particular ticket, but taking into account the fact that blind signing became real threat now. You might want to wait a few months for a proper release if you want things really polished and reliable.

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

No branches or pull requests

3 participants