Code Monkey home page Code Monkey logo

pirate-chain-android-wallet's People

Contributors

ccjernigan avatar crystalpony avatar defuse avatar gmale avatar herou avatar lindanlee avatar mandeepbhalothia avatar mandeepdaffo avatar nighthawk24 avatar pacu avatar

pirate-chain-android-wallet's Issues

Unable to send transaction to the network

Tried sending a transaction from this android wallet and getting the following error:
Screen Shot 2021-11-11 at 1 42 10 AM

Clicking on "More Info" shows the following screen:
Screen Shot 2021-11-11 at 1 42 19 AM

And if trying to send the transaction again with same amount and same address, it gives this error:
Screen Shot 2021-11-11 at 1 42 51 AM

Following is the console log from Android Studio:


11/11 01:38:19: Launching 'app' on Pixel 4 API 29.
App restart successful without requiring a re-install.
$ adb shell am start -n "cash.z.ecc.android/cash.z.ecc.android.ui.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3485 on device 'Pixel_4_API_29 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
W/h.z.ecc.androi: Accessing hidden field Ljava/util/Collections$SynchronizedCollection;->mutex:Ljava/lang/Object; (greylist-max-o, reflection, denied)
W/h.z.ecc.androi: Accessing hidden method Ljava/util/Collections$SynchronizedSet;-><init>(Ljava/util/Set;Ljava/lang/Object;)V (greylist-max-o, reflection, denied)
    Accessing hidden method Ljava/util/Collections$SynchronizedCollection;-><init>(Ljava/util/Collection;Ljava/lang/Object;)V (greylist-max-o, reflection, denied)
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/RenderThread: type=1400 audit(0.0:15): avc: denied { write } for name="property_service" dev="tmpfs" ino=201 scontext=u:r:untrusted_app:s0:c147,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=cash.z.ecc.android
I/h.z.ecc.androi: Waiting for a blocking GC ProfileSaver
I/h.z.ecc.androi: WaitForGcToComplete blocked ProfileSaver on AddRemoveAppImageSpace for 81.979ms
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/h.z.ecc.androi: Background concurrent copying GC freed 5351(308KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 2276KB/4553KB, paused 11us total 185.575ms
D/HostConnection: HostConnection::get() New Host Connection established 0xdbeb7810, tid 3550
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0 
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xe72cfe40: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
    HostConnection::get() New Host Connection established 0xdbec9e10, tid 3550
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0 
D/eglCodecCommon: allocate: Ask for block of size 0x1000
    allocate: ioctl allocate returned offset 0x3ffff8000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/h.z.ecc.androi: NativeAlloc concurrent copying GC freed 7788(562KB) AllocSpace objects, 2(40KB) LOS objects, 49% free, 2540KB/5081KB, paused 16us total 169.981ms
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/chatty: uid=10147(cash.z.ecc.android) RenderThread identical 2 lines
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/OpenGLRenderer: endAllActiveAnimators on 0xc3139980 (RippleDrawable) with handle 0xc2f47a80
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/AssistStructure: Flattened final assist data: 7216 bytes, containing 2 windows, 46 views
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
W/TextClassifierService: Package or service not found in package com.google.android.as for user 0
W/TextClassifierService: Package or service not found in package com.google.android.as for user 0
W/TextClassifierService: Package or service not found in package com.google.android.as for user 0
D/androidtc: Loading ModelFile { path=/data/misc/textclassifier/lang_id.model name=lang_id.model version=0 locales=und }
D/androidtc: Loading ModelFile { path=/etc/textclassifier/textclassifier.en.model name=textclassifier.en.model version=608 locales=en }
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/AssistStructure: Flattened final assist data: 7228 bytes, containing 2 windows, 46 views
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/tflite: Initialized TensorFlow Lite runtime.
W/TextClassifierService: Package or service not found in package com.google.android.as for user 0
D/SelectActionModeHelper: Timeout in TextClassificationAsyncTask
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/h.z.ecc.androi: Waiting for a blocking GC ProfileSaver
I/h.z.ecc.androi: WaitForGcToComplete blocked ProfileSaver on HeapTrim for 37.700ms
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
I/chatty: uid=10147(cash.z.ecc.android) RenderThread identical 1 line
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)
D/EGL_emulation: eglMakeCurrent: 0xe72cfe40: ver 3 0 (tinfo 0xc6815260)

Incompatible server: consensus branch 7361707a on mainnet but it was 76b809bb

I'm using lightwalletd with minimal changes done to it.

Upon starting application it was throwing the following error, and clicking OK crashes the app.

Incompatible server: this client expects a server following consensus branch 7361707a on mainnet but it was 76b809bb! Try updating the client or switching servers.

Screen Shot 2021-11-10 at 7 30 17 PM

Further investigation explains lightwalletd has the Sapling consensID same as Zcash's with no change.
Pirate's daemon code has the same consensus IDs for Sapling same as Zcash.
But, android wallet SDK was reflecting a consensus ID which was not matching with the results refelected by the lightwalletd.

I'm not too familiar with how this sapling consensus ID is being calculated, but I assume because of the sapling height activation being different in Pirate Chain, as compared to Zcash, it definitely has to be a different consensus ID for sapling. But since it's not changed in Pirate's daemon code it's being carried over in lightwalletd API as is, but android wallet sdk throws error when it verifies that information with getblock API call calculating and confirming if the consensus ID matches with the blockchain result and lightwalletd API result.

For now, I resolved the issue by tricking android wallet sdk think it's actually matching the sapling consensus ID in this git commit: Meshbits/zcash-android-wallet-sdk@5591f33

Pirate has this consensID at these places:
https://github.com/PirateNetwork/pirate/blob/master/src/komodo_nSPV_defs.h#L25

https://github.com/PirateNetwork/pirate/blob/master/src/zcash/Address.cpp#L10

Relevant consensID documentation in android wallet SDK: https://github.com/Meshbits/zcash-android-wallet-sdk/blob/master/docs/-synchronizer/validate-consensus-branch.md

What I want to know is if this can affect end users in any way.
Tricking the client is not really and ideal solution for sure, so a proper solution must be applied.
That's why I'm documenting here what I did to make sure it's conveyed to other relevant dev(s) to help resolve this issue properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.