cypherstack / stack_wallet

Stack Wallet, a multicoin, cryptocurrency wallet
https://stackwallet.com
GNU General Public License v3.0
188 stars 55 forks source link

Bug: [Linux] Restoring wallet with Firo Lelantus historical balance fails #869

Open justanwar opened 3 months ago

justanwar commented 3 months ago

Is there an existing issue for this?

Current Behavior

When restoring a Firo seed with Lelantus in transaction history on Linux, the following is displayed:

Restore failed:
Invalid argument(s): Failed to load dynamic library 'libmobileliblelantus.so': libcrypto.so.1.1: cannot open shared object file: No such file or directory

and restore fails.

Expected Behavior

Wallet restores normally.

Reproduce Steps

Attempt to restore a wallet with Lelantus transactions on Linux. The Lelantus balance can be 0 (as in, no longer has any Lelantus balance) or otherwise.

Environment

Logs

No response

Further Information

No response

sneurlax commented 1 month ago

I am not able to reproduce this from either staging or the v2.1.2 release. @rehrar

justanwar commented 1 month ago
flutter: Log: [Info][2024-07-12 07:22:00.893Z]: features: {hosts: {}, pruning: null, server_version: ElectrumX 1.16.0, protocol_min: 1.4, protocol_max: 1.4.2, genesis_hash: 4381deb85b1b2c9843c222944b616d997516dcbd6a964e1eaf0def0830695233, hash_function: sha256, services: []}
flutter: Log: [Info][2024-07-12 07:22:00.893Z]: restore possible cat _parseServerVersion(ElectrumX 1.16.0) => [1, 16, 0]
flutter: Log: [Info][2024-07-12 07:22:01.546Z]: attempting to fetch lelantus.getlatestcoinid...
flutter: BUILD: _MyStackViewState
flutter: BUILD: _WalletTableState
flutter: Log: [Info][2024-07-12 07:22:01.560Z]: Fetching lelantus.getlatestcoinid finished
flutter: Log: [Info][2024-07-12 07:22:01.560Z]: attempting to fetch lelantus.getlatestcoinid...
flutter: Log: [Info][2024-07-12 07:22:01.560Z]: attempting to fetch spark.getsparklatestcoinid...
flutter: Log: [Info][2024-07-12 07:22:01.576Z]: attempting to fetch lelantus.getusedcoinserials...
flutter: Log: [Info][2024-07-12 07:22:01.592Z]: Fetching lelantus.getlatestcoinid finished
flutter: Log: [Info][2024-07-12 07:22:01.601Z]: Fetching spark.getsparklatestcoinid finished
flutter: Log: [Info][2024-07-12 07:22:01.602Z]: checking receiving addresses...
flutter: Log: [Info][2024-07-12 07:22:01.603Z]: index: 0,    GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.611Z]: checking change addresses...
flutter: Log: [Info][2024-07-12 07:22:01.611Z]: index: 0,    GapCounter 1 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.654Z]: index: 12,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.704Z]: Finished ElectrumXClient.getSparkAnonymitySet(coinGroupId=1, startBlockHash=09422f2be6a95330a1ac0416e9a430cb5c8f5f81da30226a9a397c1c3628f769). coins.length: 0Duration=0:00:00.101585
flutter: Log: [Info][2024-07-12 07:22:01.738Z]: Fetching lelantus.getusedcoinserials finished
flutter: Log: [Info][2024-07-12 07:22:01.764Z]: index: 24,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.780Z]: index: 36,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.795Z]: index: 48,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.807Z]: index: 60,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.827Z]: index: 12,   GapCounter 1 bip44: 10
flutter: Log: [Info][2024-07-12 07:22:01.833Z]: index: 72,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:01.941Z]: index: 84,   GapCounter 0 bip44: 0
flutter: Log: [Info][2024-07-12 07:22:02.174Z]: attempting to fetch lelantus.getanonymityset...
flutter: Log: [Info][2024-07-12 07:22:02.174Z]: attempting to fetch lelantus.getanonymityset...
flutter: Log: [Info][2024-07-12 07:22:02.175Z]: index: 24,   GapCounter 1 bip44: 22
flutter: Log: [Info][2024-07-12 07:22:02.179Z]: index: 96,   GapCounter 0 bip44: 11
flutter: Log: [Info][2024-07-12 07:22:02.274Z]: index: 36,   GapCounter 1 bip44: 34
flutter: Log: [Info][2024-07-12 07:22:02.343Z]: index: 108,      GapCounter 0 bip44: 23
flutter: Log: [Info][2024-07-12 07:22:02.393Z]: index: 48,   GapCounter 1 bip44: 46
flutter: Log: [Info][2024-07-12 07:22:02.452Z]: index: 120,      GapCounter 0 bip44: 35
flutter: Log: [Info][2024-07-12 07:22:02.520Z]: index: 132,      GapCounter 0 bip44: 47
flutter: Log: [Info][2024-07-12 07:22:03.788Z]: Finished ElectrumXClient.getSparkAnonymitySet(coinGroupId=3, startBlockHash=575258b9b83a7a1e9e8441dad92c2608b323a1a04c3172f0e0e0be315d2e687c). coins.length: 0Duration=0:00:02.185203
flutter: Log: [Info][2024-07-12 07:22:03.788Z]: Fetching lelantus.getanonymityset finished
flutter: Log: [Info][2024-07-12 07:22:03.788Z]: Finished ElectrumXClient.getSparkAnonymitySet(coinGroupId=2, startBlockHash=55c0008dbd132528b434e9fdfe177f85bbe14eb707e8fa126d666501dbf72122). coins.length: 0Duration=0:00:02.185740
flutter: Log: [Info][2024-07-12 07:22:03.789Z]: Fetching lelantus.getusedcoinserials finished
flutter: Log: [Info][2024-07-12 07:22:03.846Z]: Fetching lelantus.getanonymityset finished
flutter: Log: [Info][2024-07-12 07:22:04.067Z]: Updated current anonymity set for firo with group ID 2
flutter: Log: [Info][2024-07-12 07:22:04.078Z]: Finished ElectrumXClient.getSparkUnhashedUsedCoinsTagsWithTxHashes(startNumber=67314). # of tags fetched=2770, Duration=0:00:02.475172
flutter: Log: [Info][2024-07-12 07:22:04.079Z]: Fetching lelantus.getusedcoinserials finished
flutter: Log: [Info][2024-07-12 07:22:04.225Z]: attempting to fetch spark.getsparklatestcoinid...
flutter: Log: [Info][2024-07-12 07:22:04.634Z]: Fetching spark.getsparklatestcoinid finished
flutter: Log: [Info][2024-07-12 07:22:04.745Z]: Exception rethrown from _restore(): Invalid argument(s): Failed to load dynamic library 'libmobileliblelantus.so': libcrypto.so.1.1: cannot open shared object file: No such file or directory
flutter: #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11)
flutter: #1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22)
flutter: #2      nativeAddLib (package:lelantus/lelantus.dart:24)
flutter: #3      _CreateTag (package:lelantus/lelantus.dart)
flutter: #4      CreateTag (package:lelantus/lelantus.dart)
flutter: #5      LelantusFfiWrapper._restore (package:stackwallet/wallets/api/lelantus_ffi_wrapper.dart:90)
flutter: #6      compute.<anonymous closure> (package:flutter/src/foundation/_isolates_io.dart:19)
flutter: #7      _RemoteRunner._run (dart:isolate:1090)
flutter: #8      _RemoteRunner._remoteExecute (dart:isolate:1084)
flutter: #9      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300)
flutter: #10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)
flutter: 
flutter: didChangeAppLifecycleState: inactive
flutter: Log: [Info][2024-07-12 07:22:06.657Z]: Finished ElectrumXClient.getSparkAnonymitySet(coinGroupId=3, startBlockHash=575258b9b83a7a1e9e8441dad92c2608b323a1a04c3172f0e0e0be315d2e687c). coins.length: 0Duration=0:00:02.022307
flutter: Log: [Info][2024-07-12 07:22:06.892Z]: Finished ElectrumXClient.getSparkUnhashedUsedCoinsTagsWithTxHashes(startNumber=67314). # of tags fetched=2770, Duration=0:00:02.256604
flutter: BUILD: _MyStackViewState
flutter: BUILD: _WalletTableState
flutter: Log: [Info][2024-07-12 07:22:22.659Z]: Finished ElectrumXClient.getMempoolTxids(). Duration=0:00:00.008291
flutter: Log: [Info][2024-07-12 07:22:22.671Z]: Finished ElectrumXClient.getMempoolSparkData(txids: [5d86ba292434ade4e401f37359c4b89070ce19deacbf583092e7368c167223c5]). Duration=0:00:00.012012
flutter: Log: [Debug][2024-07-12 07:22:22.672Z]: 6dc55ef0-401f-11ef-8cd8-9333ffab4869 restore possible cat _refreshSparkCoinsMempoolCheck() run duration: 0:00:00.021243
flutter: BUILD: _MyStackViewState
flutter: BUILD: _WalletTableState
flutter: Log: [Debug][2024-07-12 07:22:22.792Z]: restore possible cat refreshSparkData() duration: 0:00:18.566871
flutter: Log: [Info][2024-07-12 07:22:22.792Z]: Exception rethrown from electrumx_mixin recover(): Invalid argument(s): Failed to load dynamic library 'libmobileliblelantus.so': libcrypto.so.1.1: cannot open shared object file: No such file or directory
flutter: #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11)
flutter: #1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22)
flutter: #2      nativeAddLib (package:lelantus/lelantus.dart:24)
flutter: #3      _CreateTag (package:lelantus/lelantus.dart)
flutter: #4      CreateTag (package:lelantus/lelantus.dart)
flutter: #5      LelantusFfiWrapper._restore (package:stackwallet/wallets/api/lelantus_ffi_wrapper.dart:90)
flutter: #6      compute.<anonymous closure> (package:flutter/src/foundation/_isolates_io.dart:19)
flutter: #7      _RemoteRunner._run (dart:isolate:1090)
flutter: #8      _RemoteRunner._remoteExecute (dart:isolate:1084)
flutter: #9      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300)
flutter: #10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)
flutter: 
flutter: BUILD: TableView
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _MyStackViewState
flutter: BUILD: _WalletTableState
flutter: BUILD: TableView
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState
flutter: BUILD: _TableViewRowState

Was able to reproduce this issue with v2.1.2 release by checking Scan for Lelantus transaction in the advanced restore options. If this option was unchecked, the error did not appear and wallet was restored successfully.

justanwar commented 1 month ago

@sneurlax Have you tried the AppImage in a fresh Linux installation?