Commit Graph

1441 Commits

Author SHA1 Message Date
Andrea Maria Piana e07182b3f3 fix_: Don't count error rate for circuit breaker on cancel and handle
not found
2024-08-20 15:26:28 +01:00
Dario Gabriel Lipicar 479eb71372 fix(wallet)_: prevent backwards range in GetHeadersInRange 2024-08-20 10:49:22 -03:00
Dario Gabriel Lipicar 1d173734a6 fix(wallet)_: set a separate id (and circuit) for the cryptcompare proxy 2024-08-20 14:32:14 +01:00
frank 83aa01c7da
chore_:update route error details (#5749) 2024-08-20 21:14:35 +08:00
Dario Gabriel Lipicar ba005f0d6f chore(wallet)_:make coingeco unit tests not call the real provider 2024-08-20 09:04:30 -03:00
Sale Djenic 759034ec7a fix_: crash when selected token cannot be found is fixed 2024-08-19 09:59:18 +02:00
Sale Djenic 2f08c4c6f9 fix_: crash sending collectibles fixed
When mapping `MultipathProcessorTxArgs` to `ProcessorInputParams` setting `FromChain` was missed.
2024-08-19 09:59:18 +02:00
richΛrd a6645bd209
chore_: remove `status.test` fleet (#5702) 2024-08-16 14:26:35 -04:00
richΛrd c02ebf957c
refactor_: use concrete datatypes instead of `string` (#5701) 2024-08-16 19:24:21 +01:00
frank 9cdfd6fb42
fix scheduler panic after quick stop (#5724)
* fix_: scheduler panic after quick stop

* test_: fix failed test TestScheduler_Enqueue_ValidateOrder
2024-08-16 21:16:29 +08:00
Andrea Maria Piana 9e5fa3f22c feat_: Cache GetWalletToken method and split circuits
This commits does a few things:

1) Adds cache of token amount to the GetWalletToken endpoint, used by
   mobile, in case the user is offline.

2) Split circuits by chain-id (when available) and by host+index when
   not

3) It makes GetWalletToken always refresh, as that's directed from an
   user action and we want to respect that. A cool down of 10s should be
   added in the future to avoid spamming.
2024-08-16 14:02:29 +01:00
Mikhail Rogachev c257874be9
chore(connector)_: Polish connector service (#5711) 2024-08-15 13:49:29 +02:00
Andrea Maria Piana 0954a4ad13 feat!: drive proxy stage name from the client 2024-08-14 18:50:01 +00:00
Icaro Motta f837bb55c4
fix(wallet)_: pass loop var by value to goroutine (#5710) 2024-08-14 16:45:55 +01:00
Anthony Laibe 1287e5af14 fix_: Token cache usage
When fetch or cache, always return the cache
Do not save if the token is not being returns
Resolve connection map AFTER making the call
2024-08-14 13:18:58 +02:00
Mikhail Rogachev be9ba7604b
feat(connector)_: impl `personal_sign` endpoint (#5681) 2024-08-13 11:11:24 +02:00
Igor Sirotin 9175e45e61
fix_: block on logout (#5696)
* fix_: check context on processAndPushTelemetry

* fix_: fix waitgroup add/done in Waku

* fix(pendingTracker)_: stop the pending transacitonTracker on logout

* chore_: lint fix

---------

Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2024-08-12 22:30:13 +01:00
Sale Djenic 4a78d7c1e9 fix_: when preparing a balance map skip chains where cannot get the balance, instead of returning the error 2024-08-12 17:35:19 +02:00
Sale Djenic db5e5832d1 fix_: calculating route for erc721 checks one more call if the function doesn't exist on the contract
Old ERC721 contracts do not have  `safeTransferFrom` function, because of that we couldn't estimate the gas
and we couldn't resolve the right route. Now we firstly check for `safeTransferFrom` function which is supported
by ERC721A contracts and if the contract doesn't have it then we do `transferFrom` function call.

Example of ERC721A contract:
- https://etherscan.io/address/0x0024bc1035d30ae229a4712189b32131758cb000#code

Example of ERC721 contract:
- https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code
2024-08-12 17:26:56 +02:00
dlipicar b9d083c6d5
feat(wallet): add split onramp url endpoint (#5656)
* feat(wallet)_: add split onramp url endpoint & fix onrmap url
2024-08-12 12:53:32 +00:00
saledjenic 79b1c547d1
Improvements on resolving nonce (#5658)
* chore_: unused `BuildTx` function removed from the processor interface and types that are implement it

Since the `BuildTx` function is not used anywhere, it's removed from the code.

* fix_: resolving nonce improvements

When the app sends more than a single tx from the same account on the same chain, some
chains do not return appropriate nonce (they do not consider pending txs), because of
that we place more tx with the same nonce, where all but the first one fail.

Changes in this PR keep track of nonces being used in the same sending/bridging flow, which means
for the first tx from the multi txs the app asks the chain for the nonce, and every next nonce is resolved
by incrementing the last used nonce by 1.
2024-08-12 08:07:32 -04:00
Anthony Laibe 74fa567cda fix(wallet)_: return balance when available, do not fail all 2024-08-12 08:49:35 +02:00
dlipicar d7fcbd3444
feat(wallet)_: handle paraswap price impact error (#5622) 2024-08-07 23:33:44 +01:00
Mikhail Rogachev d5a78e784a
feat_: connector revoke permissions and accounts (#5646)
* feat(connector)_: add `wallet_revokePermissions` endpoint

* feat_: same behavior for `eth_accounts` and `eth_requestAccounts`
2024-08-06 12:28:55 -07:00
Sale Djenic 2129a3f95c feat_: accounts/saved addresses capacity related api endpoints added
Added endpoints:
- `RemainingAccountCapacity`
- `RemainingKeypairCapacity`
- `RemainingWatchOnlyAccountCapacity`
- `RmaininngCapacityForSavedAddresses`
2024-08-06 08:19:33 +02:00
Mikhail Rogachev 551af54fda
fix(connector)_: connector response structure to valid json (#5624) 2024-08-02 11:43:31 +04:00
Ivan Belyakov c84b136b4a fix(wallet)_: fixed error with parsing coingecko response.
For tokens that it does not support and some that were listed in mapping
we responded with error
2024-08-02 09:21:01 +02:00
Sale Djenic cf1a6631f8 fix_: the last known route with positive balance returned if no route without balance/bonder error
The Router algorithm is checking all the routes in order to find one the user has a balance to execute it
even that one is not the cheapest one. But if the user has some balances, but not enough to execute any
of suggested routes, we we're returning the last route which was checked, with the changes from this commit
we will return the last route for which the user has some balance, but not enough.
2024-08-01 15:26:01 +02:00
Belal Shehab 89d6c55d3e
fix(wallet)_: Handle balance fetching errors & fallback to cached values (#5628)
- Return errors from fetchBalancesForChain and GetBalancesAtByChain instead of silently ignoring them.
 - Use cached balances if fetching new data fails, preventing empty wallets and ensuring data consistency.
 - Fixed unit tests that was expecting GetBalancesAtByChain to always return nil error

Closes #15767

Co-authored-by: belalshehab <belal@status.im>
2024-08-01 12:54:29 +01:00
Ivan Belyakov b74d9e6b4e feat(wallet)_: add status proxy RPC urls for blockchain providers
Replace the status proxy URL for cryptocompare.
2024-08-01 08:19:20 +02:00
Sale Djenic 8787da1b89 feat_: added new error which will be returned in case bonder fee is higher than the amount being sent 2024-07-31 15:12:05 +02:00
Cuteivist daef6ee030
chore_: Validate multi tx type (#5619) 2024-07-31 06:45:11 +02:00
Sale Djenic 19b5bcf3ce chore_: endpoint for checking address checksum validity added to wallet api
- added `IsChecksumValidForAddress` function to `wallet` api
2024-07-30 17:38:29 +02:00
richΛrd 855643757e
fix_: storenode URLs (#5630) 2024-07-30 10:27:51 -04:00
IvanBelyakoff 5b34cd9e9f
feat(wallet)_: add basic auth for cryptocompare proxy (#5536)
* feat(wallet)_: add basic auth for cryptocompare proxy

* test(wallet)_: add a test for httpclient used in market clients
2024-07-30 14:48:22 +01:00
frank f123e98179
feat: fallback pairing seed (#5614)
* feat(pairing)!: Add extra parameters and remove v2 compatibility

This commit includes the following changes:

I have added a flag to maintain 2.29 compatibility.

Breaking change in connection string

The local pairing code that was parsing the connection string had a few non-upgradable features:

It was strictly checking the number of parameters, throwing an error if the number was different. This made it impossible to add parameters to it without breaking.
It was strictly checking the version number. This made increasing the version number impossible as older client would just refuse to connect.
The code has been changed so that:

Two parameters have been added, installation-id and key-uid. Those are needed for the fallback flow.
I have also removed version from the payload, since it wasn't used.

This means that we don't support v1 anymore. V2 parsing is supported . Going forward there's a clear strategy on how to update the protocol (append parameters, don't change existing one).

https://www.youtube.com/watch?v=oyLBGkS5ICk Is a must watch video for understanding the strategy

Changed MessengerResponse to use internally a map of installations rather than an array (minor)
Just moving towards maps as arrays tend to lead to subtle bugs.

Moved pairing methods to messenger_pairing.go
Just moved some methods

Added 2 new methods for the fallback flow
FinishPairingThroughSeedPhraseProcess
https://github.com/status-im/status-go/pull/5567/files#diff-1ad620b07fa3bd5fbc96c9f459d88829938a162bf1aaf41c61dea6e38b488d54R29

EnableAndSyncInstallation

https://github.com/status-im/status-go/pull/5567/files#diff-1ad620b07fa3bd5fbc96c9f459d88829938a162bf1aaf41c61dea6e38b488d54R18

Flow for clients
Client A1 is logged in
Client A2 is logged out

Client A1 shows a QR code
Client A2 scans a QR code
If connection fails on A2, the user will be prompted to enter a seed phrase.
If the generated account matches the key-uid from the QR code, A2 should call FinishPairingThroughSeedPhraseProcess with the installation id passed in the QR code. This will send installation information over waku. The user should be shown its own installation id and prompted to check the other device.
Client A1 will receive new installation data through waku, if they are still on the qr code page, they should show a popup to the user showing the received installation id, and a way to Enable and Sync, which should call the EnableAndSyncInstallation endpoint. This should finish the fallback syncing flow.
Current issues
Currently I haven't tested that all the data is synced after finishing the flow. I see that the two devices are paired correctly, but for example the DisplayName is not changed on the receiving device. I haven't had time to look into it further.

* test_: add more test for connection string parser

* fix_: fix panic when parse old connection string

* test_: add comments for TestMessengerPairAfterSeedPhrase

* fix_: correct error description

* feat_:rename FinishPairingThroughSeedPhraseProcess to EnableInstallationAndPair

* fix_: delete leftover

* fix_: add UniqueKey method

* fix_: unify the response for InputConnectionStringForBootstrapping

* fix_: remove fields installationID and keyUID in GethStatusBackend

* fix_: rename messenger_pairing to messenger_pairing_and_syncing

---------

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2024-07-30 17:14:05 +08:00
richΛrd 0e982f1a3d
chore_: rename shards.test to status.prod (#5571) 2024-07-29 17:19:48 -04:00
IvanBelyakoff bf6c0c4cc6
fix(wallet)_: fix provider down event happening too often (#5595)
* fix(wallet)_: fix provider down event happening too often

- handle context cancelled error
- do not count expected errors when calling tokenURI as providers
  errors
- use archival not for optimism (was silently added by Grove makeing the
  old URL non-archival)

Closes #5555

* test(wallet)_: add test for collectibles manager to verify that main
circuit is not tripped calling by tokenURI method
2024-07-29 18:07:43 +01:00
Sale Djenic 18885b3663 test_: flaky router tests fixed
Closes https://github.com/status-im/status-go/issues/5601
2024-07-29 16:53:56 +02:00
Sale Djenic 20c1b83b7c chore_: when returning errors, give precedence to custom (network) errors 2024-07-29 10:05:56 +02:00
Sale Djenic 9472e18315 fix_: setting best route only when we have it 2024-07-29 10:05:56 +02:00
Igor Sirotin e76d93d340
chore: skip flaky tests (#5606)
* chore_: skip TestPeerCount

* chore_: skip flaky wallet tests

* chore_: skip flaky TestMemberReceivesPendingRequestToJoinAfterAfterGettingTokenMasterRole
2024-07-27 10:27:26 +01:00
Andrea Maria Piana 3cc4767638
Check for mobile data connection if setting is on (#5511)
* feat_: Check for mobile data connection if setting is on

* fix_: check code control flag inside  asyncRequestAllHistoricMessages

---------

Co-authored-by: Igor Sirotin <sirotin@status.im>
2024-07-26 22:34:57 +01:00
Godfrain Jacques 4ddf9f2727
fix_: fix switchEthereum api when processing chain input string (#5589)
fix #5587
2024-07-26 13:00:12 -07:00
Godfrain Jacques 72baaebe39
fix_: conversion from int to string causes code scanning error (#5600)
fixes #5599
2024-07-26 11:56:48 -07:00
Godfrain Jacques f6d7d1429c
fix_: return default chainID instead of throwing error for unregistered dApp (#5584)
fix #5583
2024-07-26 09:18:01 -07:00
belalshehab 03cb3ad0ab fix(Wallet)_: Add quotes around token symbol in insufficient balance error messages to ensure valid JSON parsing 2024-07-26 13:16:23 +03:00
Igor Sirotin 870ede0829
fix_: tests (#5585)
* fix_: router tests errors sprintf

* chore_: skip flaky tests
2024-07-25 23:27:12 +01:00
Godfrain Jacques 0ecc266b1e
feat_:implement connector requestPermissions api (#5566) 2024-07-25 09:02:26 -07:00
Godfrain Jacques 5e88d5b498
fix_: return array of account without accounts key (#5576) 2024-07-25 06:10:13 -07:00