Bug: Can't Sync Firo Wallet
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
I have tried numerous build numbers on my Ubunut 22.04 machine and none can restore a wallet or sync when creating a new FIRO wallet. However, build 227 on my Pixel 5 is the only device which has been able to synchronize and restore FIRO wallets - this was downloaded via google play on Graphene. All my other graphene phones do not sync firo wallets. I'm not sure why this is. I get the same hanging with Campfire as well. I've let it go for days and it does nothing.
Hanging Sync
Proper sync on Google Play build 227 Pixel 5
Expected Behavior
Firo wallet will restore and sync
Reproduce Steps
Not sure if this is reproducible but I will provide logs from the Ubuntu 22.04 machine
Environment
- Operating system and version: Ubuntu 22.04/Graphene OS (latest)
- Device platform and version: Hp EliteDesk, Pixel 6
- Real device or emulator/simulator: Real
Logs
https://gist.github.com/freQniK/1767d29689308f00312cec7f689e54b3
Further Information
Tried all Builds from 2.1.0
FWIW, My router has a VPN, but I have also disabled this and tried and also tried connecting through tor. Nada.
Looking at the logs, it seems the connection gets terminated for some reason:
flutter: Log: [Info][2024-08-07 05:07:30.702Z]: NodeConnectionStatusChangedEvent fired in d9196c40-547a-11ef-adf7-1b7272c6a3e4 with arg newStatus = NodeConnectionStatus.disconnectedflutter: didChangeAppLifecycleState: inactive[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SocketException: Broken pipe (OS Error: Broken pipe, errno = 32), address = firo.stackwallet.com, port = 59128
Since the socket closed and doesn't try to reopen, this would be the reason for the hang.
Here are the logs from my Pixel 6 (Graphene OS). Stackwallet shows build 2243 but Obtanium shows build 243. Looks like a timeout error. Maybe extend the timeout to 2x or 3x the 5 second limit?
[Warning][2024-08-18 03:33:08.846Z]: FiroWallet<ElectrumXCurrencyInterface> init() did not complete: TimeoutException after 0:00:05.000000: Future not completed
[Error][2024-08-18 03:33:08.863Z]: Color not found in theme for eCash
[Info][2024-08-18 03:33:24.199Z]: Periodic notifications update check
[Info][2024-08-18 03:34:24.199Z]: Periodic notifications update check
[Warning][2024-08-18 03:35:18.808Z]: FiroWallet<ElectrumXCurrencyInterface> init() did not complete: TimeoutException after 0:00:05.000000: Future not completed
I believe the 5 seconnd timeout is right here in the electrum_adapter package
https://github.com/cypherstack/electrum_adapter/blob/6bf385b2e1e18c8aa23783cb8afeabace299cf68/lib/connect.dart#L12
This may the reason for all my non-syncing issues
Here are the logs from my Pixel 6 (Graphene OS). Stackwallet shows build 2243 but Obtanium shows build 243. Looks like a timeout error. Maybe extend the timeout to 2x or 3x the 5 second limit?
[Warning][2024-08-18 03:33:08.846Z]: FiroWallet<ElectrumXCurrencyInterface> init() did not complete: TimeoutException after 0:00:05.000000: Future not completed [Error][2024-08-18 03:33:08.863Z]: Color not found in theme for eCash [Info][2024-08-18 03:33:24.199Z]: Periodic notifications update check [Info][2024-08-18 03:34:24.199Z]: Periodic notifications update check [Warning][2024-08-18 03:35:18.808Z]: FiroWallet<ElectrumXCurrencyInterface> init() did not complete: TimeoutException after 0:00:05.000000: Future not completed
Judging from these logs, that 5 second timeout occurs here: https://github.com/cypherstack/stack_wallet/blob/bb7f0ff46f0f3e53b123e4cbf0d42f2525a07b98/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart#L1789 That shouldn't cause sync issues but may be triggered by a sync issue.
Are you able to do a test connection in node settings successfully?
Looking at the logs, it seems the connection gets terminated for some reason:
flutter: Log: [Info][2024-08-07 05:07:30.702Z]: NodeConnectionStatusChangedEvent fired in d9196c40-547a-11ef-adf7-1b7272c6a3e4 with arg newStatus = NodeConnectionStatus.disconnectedflutter: didChangeAppLifecycleState: inactive[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SocketException: Broken pipe (OS Error: Broken pipe, errno = 32), address = firo.stackwallet.com, port = 59128Since the socket closed and doesn't try to reopen, this would be the reason for the hang.
This one a bit hard to follow as there isn't any more context in the provided logs snippet.
There is logic to reconnect on disconnect which should be happening but may not log any details thereof.
Shows:
"Server ping success"
It may ping it to test if it is a live, but shouldn't it do a socket open test to make sure it can establish a connection with the socket?
Yea, a new connection is made and an electrumx "ping" call is sent over the new connection. So it seems you are able to connect and talk to the electrumx server and the forever hang is likely not related to the server.
Are you able to provide complete logs?
Yea, a new connection is made and an electrumx "ping" call is sent over the new connection. So it seems you are able to connect and talk to the electrumx server and the forever hang is likely not related to the server.
Are you able to provide complete logs?
How do I go about providing complete logs other than console when I run on desktop or the logs from within the app on mobile? Do you want me to do an adb debug?
FWIW, tonight I tested campfire from google play on the following devices:
Pixel 3 (Graphene OS/Android 12) Pixel 2 XL (Stock Android 10) LGv40 (Stock Android 10) Pixel Six (Latest Graphene OS)
I have also tested stack wallet and campfire on my Ubuntu 20.04 and my Ubuntu 22.04 boxes
All these hang forever and do not sync with the sole exception of the Pixel 5 with Graphene which now has all my Firo on it since it is the only one that syncs.
I got this error on Campfire just now on my Pix Six
Caught exception in refreshWalletData(): Bad state: The client closed with pending request "spark.getsparkanonymityset
Also there are no storage permissions on campfire to be able to save the log to a file
I finally got it to restore and sync my wallet on my M1. I had to disable the VPN on my router.